From: Matt Corallo Date: Sun, 1 Sep 2024 13:12:29 +0000 (+0000) Subject: [C#] Update auto-generated bindings X-Git-Tag: v0.0.124.0^2~8 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=9559614da9d99507409cd05379e7de08c72dd493;p=ldk-java [C#] Update auto-generated bindings --- diff --git a/c_sharp/bindings.c b/c_sharp/bindings.c index ee78f2ad..4d9e904e 100644 --- a/c_sharp/bindings.c +++ b/c_sharp/bindings.c @@ -184,10 +184,10 @@ int CS_LDK_register_l_Recipientll_invoker(invoker_l_Recipientll invoker) { return 0; } -typedef int64_t (*invoker_l_llRecipient)(int obj_ptr, int fn_id, int64_t a, int64_t b, int32_t c); -static invoker_l_llRecipient js_invoke_function_l_llRecipient; -int CS_LDK_register_l_llRecipient_invoker(invoker_l_llRecipient invoker) { - js_invoke_function_l_llRecipient = invoker; +typedef int64_t (*invoker_l_lRecipient)(int obj_ptr, int fn_id, int64_t a, int32_t b); +static invoker_l_lRecipient js_invoke_function_l_lRecipient; +int CS_LDK_register_l_lRecipient_invoker(invoker_l_lRecipient invoker) { + js_invoke_function_l_lRecipient = invoker; return 0; } @@ -240,13 +240,6 @@ int CS_LDK_register_ChannelMonitorUpdateStatus_lll_invoker(invoker_ChannelMonito return 0; } -typedef int32_t (*invoker_ChannelMonitorUpdateStatus_llll)(int obj_ptr, int fn_id, int64_t a, int64_t b, int64_t c, int64_t d); -static invoker_ChannelMonitorUpdateStatus_llll js_invoke_function_ChannelMonitorUpdateStatus_llll; -int CS_LDK_register_ChannelMonitorUpdateStatus_llll_invoker(invoker_ChannelMonitorUpdateStatus_llll invoker) { - js_invoke_function_ChannelMonitorUpdateStatus_llll = 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) { @@ -366,6 +359,24 @@ static inline uint64_t tag_ptr(const void* ptr, bool is_owned) { } } +static inline LDKBalanceSource LDKBalanceSource_from_cs(int32_t ord) { + switch (ord) { + case 0: return LDKBalanceSource_HolderForceClosed; + case 1: return LDKBalanceSource_CounterpartyForceClosed; + case 2: return LDKBalanceSource_CoopClose; + case 3: return LDKBalanceSource_Htlc; + default: abort(); + } +} +static inline int32_t LDKBalanceSource_to_cs(LDKBalanceSource val) { + switch (val) { + case LDKBalanceSource_HolderForceClosed: return 0; + case LDKBalanceSource_CounterpartyForceClosed: return 1; + case LDKBalanceSource_CoopClose: return 2; + case LDKBalanceSource_Htlc: return 3; + default: abort(); + } +} static inline LDKBlindedFailure LDKBlindedFailure_from_cs(int32_t ord) { switch (ord) { case 0: return LDKBlindedFailure_FromIntroductionNode; @@ -439,7 +450,8 @@ static inline LDKBolt12SemanticError LDKBolt12SemanticError_from_cs(int32_t ord) case 24: return LDKBolt12SemanticError_InvalidPayInfo; case 25: return LDKBolt12SemanticError_MissingCreationTime; case 26: return LDKBolt12SemanticError_MissingPaymentHash; - case 27: return LDKBolt12SemanticError_MissingSignature; + case 27: return LDKBolt12SemanticError_UnexpectedPaymentHash; + case 28: return LDKBolt12SemanticError_MissingSignature; default: abort(); } } @@ -472,7 +484,8 @@ static inline int32_t LDKBolt12SemanticError_to_cs(LDKBolt12SemanticError val) { case LDKBolt12SemanticError_InvalidPayInfo: return 24; case LDKBolt12SemanticError_MissingCreationTime: return 25; case LDKBolt12SemanticError_MissingPaymentHash: return 26; - case LDKBolt12SemanticError_MissingSignature: return 27; + case LDKBolt12SemanticError_UnexpectedPaymentHash: return 27; + case LDKBolt12SemanticError_MissingSignature: return 28; default: abort(); } } @@ -528,25 +541,27 @@ static inline int32_t LDKChannelShutdownState_to_cs(LDKChannelShutdownState val) } static inline LDKConfirmationTarget LDKConfirmationTarget_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKConfirmationTarget_OnChainSweep; - case 1: return LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee; - case 2: return LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee; - case 3: return LDKConfirmationTarget_AnchorChannelFee; - case 4: return LDKConfirmationTarget_NonAnchorChannelFee; - case 5: return LDKConfirmationTarget_ChannelCloseMinimum; - case 6: return LDKConfirmationTarget_OutputSpendingFee; + case 0: return LDKConfirmationTarget_MaximumFeeEstimate; + case 1: return LDKConfirmationTarget_UrgentOnChainSweep; + case 2: return LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee; + case 3: return LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee; + case 4: return LDKConfirmationTarget_AnchorChannelFee; + case 5: return LDKConfirmationTarget_NonAnchorChannelFee; + case 6: return LDKConfirmationTarget_ChannelCloseMinimum; + case 7: return LDKConfirmationTarget_OutputSpendingFee; default: abort(); } } static inline int32_t LDKConfirmationTarget_to_cs(LDKConfirmationTarget val) { switch (val) { - case LDKConfirmationTarget_OnChainSweep: return 0; - case LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee: return 1; - case LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee: return 2; - case LDKConfirmationTarget_AnchorChannelFee: return 3; - case LDKConfirmationTarget_NonAnchorChannelFee: return 4; - case LDKConfirmationTarget_ChannelCloseMinimum: return 5; - case LDKConfirmationTarget_OutputSpendingFee: return 6; + case LDKConfirmationTarget_MaximumFeeEstimate: return 0; + case LDKConfirmationTarget_UrgentOnChainSweep: return 1; + case LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee: return 2; + case LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee: return 3; + case LDKConfirmationTarget_AnchorChannelFee: return 4; + case LDKConfirmationTarget_NonAnchorChannelFee: return 5; + case LDKConfirmationTarget_ChannelCloseMinimum: return 6; + case LDKConfirmationTarget_OutputSpendingFee: return 7; default: abort(); } } @@ -756,6 +771,9 @@ static inline LDKPaymentFailureReason LDKPaymentFailureReason_from_cs(int32_t or case 3: return LDKPaymentFailureReason_PaymentExpired; case 4: return LDKPaymentFailureReason_RouteNotFound; case 5: return LDKPaymentFailureReason_UnexpectedError; + case 6: return LDKPaymentFailureReason_UnknownRequiredFeatures; + case 7: return LDKPaymentFailureReason_InvoiceRequestExpired; + case 8: return LDKPaymentFailureReason_InvoiceRequestRejected; default: abort(); } } @@ -767,6 +785,9 @@ static inline int32_t LDKPaymentFailureReason_to_cs(LDKPaymentFailureReason val) case LDKPaymentFailureReason_PaymentExpired: return 3; case LDKPaymentFailureReason_RouteNotFound: return 4; case LDKPaymentFailureReason_UnexpectedError: return 5; + case LDKPaymentFailureReason_UnknownRequiredFeatures: return 6; + case LDKPaymentFailureReason_InvoiceRequestExpired: return 7; + case LDKPaymentFailureReason_InvoiceRequestRejected: return 8; default: abort(); } } @@ -789,6 +810,7 @@ static inline LDKRetryableSendFailure LDKRetryableSendFailure_from_cs(int32_t or case 0: return LDKRetryableSendFailure_PaymentExpired; case 1: return LDKRetryableSendFailure_RouteNotFound; case 2: return LDKRetryableSendFailure_DuplicatePayment; + case 3: return LDKRetryableSendFailure_OnionPacketSizeExceeded; default: abort(); } } @@ -797,6 +819,7 @@ static inline int32_t LDKRetryableSendFailure_to_cs(LDKRetryableSendFailure val) case LDKRetryableSendFailure_PaymentExpired: return 0; case LDKRetryableSendFailure_RouteNotFound: return 1; case LDKRetryableSendFailure_DuplicatePayment: return 2; + case LDKRetryableSendFailure_OnionPacketSizeExceeded: return 3; default: abort(); } } @@ -813,6 +836,7 @@ static inline LDKSecp256k1Error LDKSecp256k1Error_from_cs(int32_t ord) { case 8: return LDKSecp256k1Error_NotEnoughMemory; case 9: return LDKSecp256k1Error_InvalidPublicKeySum; case 10: return LDKSecp256k1Error_InvalidParityValue; + case 11: return LDKSecp256k1Error_InvalidEllSwift; default: abort(); } } @@ -829,6 +853,7 @@ static inline int32_t LDKSecp256k1Error_to_cs(LDKSecp256k1Error val) { case LDKSecp256k1Error_NotEnoughMemory: return 8; case LDKSecp256k1Error_InvalidPublicKeySum: return 9; case LDKSecp256k1Error_InvalidParityValue: return 10; + case LDKSecp256k1Error_InvalidEllSwift: return 11; default: abort(); } } @@ -1011,13 +1036,59 @@ int64_t CS_LDK_LDKCOption_u64Z_Some_get_some(int64_t ptr) { int64_t some_conv = obj->some; return some_conv; } -static inline LDKCVec_BlindedPathZ CVec_BlindedPathZ_clone(const LDKCVec_BlindedPathZ *orig) { - LDKCVec_BlindedPathZ ret = { .data = MALLOC(sizeof(LDKBlindedPath) * orig->datalen, "LDKCVec_BlindedPathZ clone bytes"), .datalen = orig->datalen }; +static inline LDKCVec_BlindedMessagePathZ CVec_BlindedMessagePathZ_clone(const LDKCVec_BlindedMessagePathZ *orig) { + LDKCVec_BlindedMessagePathZ ret = { .data = MALLOC(sizeof(LDKBlindedMessagePath) * orig->datalen, "LDKCVec_BlindedMessagePathZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = BlindedPath_clone(&orig->data[i]); + ret.data[i] = BlindedMessagePath_clone(&orig->data[i]); + } + return ret; +} +uint32_t CS_LDK_LDKDecodeError_ty_from_ptr(int64_t ptr) { + LDKDecodeError *obj = (LDKDecodeError*)untag_ptr(ptr); + switch(obj->tag) { + case LDKDecodeError_UnknownVersion: return 0; + case LDKDecodeError_UnknownRequiredFeature: return 1; + case LDKDecodeError_InvalidValue: return 2; + case LDKDecodeError_ShortRead: return 3; + case LDKDecodeError_BadLengthDescriptor: return 4; + case LDKDecodeError_Io: return 5; + case LDKDecodeError_UnsupportedCompression: return 6; + case LDKDecodeError_DangerousValue: return 7; + default: abort(); } +} +int32_t CS_LDK_LDKDecodeError_Io_get_io(int64_t ptr) { + LDKDecodeError *obj = (LDKDecodeError*)untag_ptr(ptr); + CHECK(obj->tag == LDKDecodeError_Io); + int32_t io_conv = LDKIOError_to_cs(obj->io); + return io_conv; +} +static inline struct LDKRefund CResult_RefundDecodeErrorZ_get_ok(LDKCResult_RefundDecodeErrorZ *NONNULL_PTR owner){ + LDKRefund ret = *owner->contents.result; + ret.is_owned = false; return ret; } +int64_t CS_LDK_CResult_RefundDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_RefundDecodeErrorZ* owner_conv = (LDKCResult_RefundDecodeErrorZ*)untag_ptr(owner); + LDKRefund ret_var = CResult_RefundDecodeErrorZ_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_RefundDecodeErrorZ_get_err(LDKCResult_RefundDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_RefundDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_RefundDecodeErrorZ* owner_conv = (LDKCResult_RefundDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_RefundDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline struct LDKRefund CResult_RefundBolt12ParseErrorZ_get_ok(LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR owner){ LDKRefund ret = *owner->contents.result; ret.is_owned = false; @@ -1066,26 +1137,6 @@ int64_t CS_LDK_LDKRetry_Timeout_get_timeout(int64_t ptr) { int64_t timeout_conv = obj->timeout; return timeout_conv; } -uint32_t CS_LDK_LDKDecodeError_ty_from_ptr(int64_t ptr) { - LDKDecodeError *obj = (LDKDecodeError*)untag_ptr(ptr); - switch(obj->tag) { - case LDKDecodeError_UnknownVersion: return 0; - case LDKDecodeError_UnknownRequiredFeature: return 1; - case LDKDecodeError_InvalidValue: return 2; - case LDKDecodeError_ShortRead: return 3; - case LDKDecodeError_BadLengthDescriptor: return 4; - case LDKDecodeError_Io: return 5; - case LDKDecodeError_UnsupportedCompression: return 6; - case LDKDecodeError_DangerousValue: return 7; - default: abort(); - } -} -int32_t CS_LDK_LDKDecodeError_Io_get_io(int64_t ptr) { - LDKDecodeError *obj = (LDKDecodeError*)untag_ptr(ptr); - CHECK(obj->tag == LDKDecodeError_Io); - int32_t io_conv = LDKIOError_to_cs(obj->io); - return io_conv; -} static inline struct LDKRetry CResult_RetryDecodeErrorZ_get_ok(LDKCResult_RetryDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return Retry_clone(&*owner->contents.result); @@ -1496,28 +1547,28 @@ void CS_LDK_CResult_ThirtyTwoBytesNoneZ_get_err(int64_t owner) { CResult_ThirtyTwoBytesNoneZ_get_err(owner_conv); } -static inline struct LDKBlindedPayInfo CResult_BlindedPayInfoDecodeErrorZ_get_ok(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR owner){ - LDKBlindedPayInfo ret = *owner->contents.result; +static inline struct LDKBolt12Invoice CResult_Bolt12InvoiceDecodeErrorZ_get_ok(LDKCResult_Bolt12InvoiceDecodeErrorZ *NONNULL_PTR owner){ + LDKBolt12Invoice ret = *owner->contents.result; ret.is_owned = false; return ret; } -int64_t CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_get_ok(int64_t owner) { - LDKCResult_BlindedPayInfoDecodeErrorZ* owner_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(owner); - LDKBlindedPayInfo ret_var = CResult_BlindedPayInfoDecodeErrorZ_get_ok(owner_conv); +int64_t CS_LDK_CResult_Bolt12InvoiceDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_Bolt12InvoiceDecodeErrorZ* owner_conv = (LDKCResult_Bolt12InvoiceDecodeErrorZ*)untag_ptr(owner); + LDKBolt12Invoice ret_var = CResult_Bolt12InvoiceDecodeErrorZ_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_BlindedPayInfoDecodeErrorZ_get_err(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_Bolt12InvoiceDecodeErrorZ_get_err(LDKCResult_Bolt12InvoiceDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return DecodeError_clone(&*owner->contents.err); } -int64_t CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_get_err(int64_t owner) { - LDKCResult_BlindedPayInfoDecodeErrorZ* owner_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(owner); +int64_t CS_LDK_CResult_Bolt12InvoiceDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_Bolt12InvoiceDecodeErrorZ* owner_conv = (LDKCResult_Bolt12InvoiceDecodeErrorZ*)untag_ptr(owner); LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_BlindedPayInfoDecodeErrorZ_get_err(owner_conv); + *ret_copy = CResult_Bolt12InvoiceDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -1768,24 +1819,6 @@ int64_t CS_LDK_CResult_HTLCDescriptorDecodeErrorZ_get_err(int64_t owner) { return ret_ref; } -static inline void CResult_NoneNoneZ_get_ok(LDKCResult_NoneNoneZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -void CS_LDK_CResult_NoneNoneZ_get_ok(int64_t owner) { - LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner); - CResult_NoneNoneZ_get_ok(owner_conv); -} - -static inline void CResult_NoneNoneZ_get_err(LDKCResult_NoneNoneZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; -} -void CS_LDK_CResult_NoneNoneZ_get_err(int64_t owner) { - LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner); - CResult_NoneNoneZ_get_err(owner_conv); -} - static inline struct LDKPublicKey CResult_PublicKeyNoneZ_get_ok(LDKCResult_PublicKeyNoneZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return *owner->contents.result; @@ -1806,6 +1839,44 @@ void CS_LDK_CResult_PublicKeyNoneZ_get_err(int64_t owner) { CResult_PublicKeyNoneZ_get_err(owner_conv); } +static inline struct LDKThirtyTwoBytes CResult__u832NoneZ_get_ok(LDKCResult__u832NoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return ThirtyTwoBytes_clone(&*owner->contents.result); +} +int8_tArray CS_LDK_CResult__u832NoneZ_get_ok(int64_t owner) { + LDKCResult__u832NoneZ* owner_conv = (LDKCResult__u832NoneZ*)untag_ptr(owner); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, CResult__u832NoneZ_get_ok(owner_conv).data, 32); + return ret_arr; +} + +static inline void CResult__u832NoneZ_get_err(LDKCResult__u832NoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +void CS_LDK_CResult__u832NoneZ_get_err(int64_t owner) { + LDKCResult__u832NoneZ* owner_conv = (LDKCResult__u832NoneZ*)untag_ptr(owner); + CResult__u832NoneZ_get_err(owner_conv); +} + +static inline void CResult_NoneNoneZ_get_ok(LDKCResult_NoneNoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; +} +void CS_LDK_CResult_NoneNoneZ_get_ok(int64_t owner) { + LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner); + CResult_NoneNoneZ_get_ok(owner_conv); +} + +static inline void CResult_NoneNoneZ_get_err(LDKCResult_NoneNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +void CS_LDK_CResult_NoneNoneZ_get_err(int64_t owner) { + LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner); + CResult_NoneNoneZ_get_err(owner_conv); +} + uint32_t CS_LDK_LDKCOption_BigEndianScalarZ_ty_from_ptr(int64_t ptr) { LDKCOption_BigEndianScalarZ *obj = (LDKCOption_BigEndianScalarZ*)untag_ptr(ptr); switch(obj->tag) { @@ -1939,23 +2010,25 @@ static void LDKChannelSigner_JCalls_free(void* this_arg) { FREE(j_calls); } } -LDKPublicKey get_per_commitment_point_LDKChannelSigner_jcall(const void* this_arg, uint64_t idx) { +LDKCResult_PublicKeyNoneZ get_per_commitment_point_LDKChannelSigner_jcall(const void* this_arg, uint64_t idx) { LDKChannelSigner_JCalls *j_calls = (LDKChannelSigner_JCalls*) this_arg; int64_t idx_conv = idx; - int8_tArray ret = (int8_tArray)js_invoke_function_l_l(j_calls->instance_ptr, 0, idx_conv); - LDKPublicKey ret_ref; - CHECK(ret->arr_len == 33); - memcpy(ret_ref.compressed_form, ret->elems, 33); FREE(ret); - return ret_ref; + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 0, idx_conv); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_PublicKeyNoneZ ret_conv = *(LDKCResult_PublicKeyNoneZ*)(ret_ptr); + FREE(untag_ptr(ret)); + return ret_conv; } -LDKThirtyTwoBytes release_commitment_secret_LDKChannelSigner_jcall(const void* this_arg, uint64_t idx) { +LDKCResult__u832NoneZ release_commitment_secret_LDKChannelSigner_jcall(const void* this_arg, uint64_t idx) { LDKChannelSigner_JCalls *j_calls = (LDKChannelSigner_JCalls*) this_arg; int64_t idx_conv = idx; - int8_tArray ret = (int8_tArray)js_invoke_function_l_l(j_calls->instance_ptr, 1, idx_conv); - LDKThirtyTwoBytes ret_ref; - CHECK(ret->arr_len == 32); - memcpy(ret_ref.data, ret->elems, 32); FREE(ret); - return ret_ref; + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 1, idx_conv); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult__u832NoneZ ret_conv = *(LDKCResult__u832NoneZ*)(ret_ptr); + FREE(untag_ptr(ret)); + return ret_conv; } LDKCResult_NoneNoneZ validate_holder_commitment_LDKChannelSigner_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * holder_tx, LDKCVec_ThirtyTwoBytesZ outbound_htlc_preimages) { LDKChannelSigner_JCalls *j_calls = (LDKChannelSigner_JCalls*) this_arg; @@ -2044,22 +2117,22 @@ uint64_t CS_LDK_LDKChannelSigner_new(int32_t o, int64_t pubkeys) { *res_ptr = LDKChannelSigner_init(o, pubkeys); return tag_ptr(res_ptr, true); } -int8_tArray CS_LDK_ChannelSigner_get_per_commitment_point(int64_t this_arg, int64_t idx) { +int64_t CS_LDK_ChannelSigner_get_per_commitment_point(int64_t this_arg, int64_t idx) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelSigner* this_arg_conv = (LDKChannelSigner*)this_arg_ptr; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, (this_arg_conv->get_per_commitment_point)(this_arg_conv->this_arg, idx).compressed_form, 33); - return ret_arr; + LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ"); + *ret_conv = (this_arg_conv->get_per_commitment_point)(this_arg_conv->this_arg, idx); + return tag_ptr(ret_conv, true); } -int8_tArray CS_LDK_ChannelSigner_release_commitment_secret(int64_t this_arg, int64_t idx) { +int64_t CS_LDK_ChannelSigner_release_commitment_secret(int64_t this_arg, int64_t idx) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelSigner* this_arg_conv = (LDKChannelSigner*)this_arg_ptr; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, (this_arg_conv->release_commitment_secret)(this_arg_conv->this_arg, idx).data, 32); - return ret_arr; + LDKCResult__u832NoneZ* ret_conv = MALLOC(sizeof(LDKCResult__u832NoneZ), "LDKCResult__u832NoneZ"); + *ret_conv = (this_arg_conv->release_commitment_secret)(this_arg_conv->this_arg, idx); + return tag_ptr(ret_conv, true); } int64_t CS_LDK_ChannelSigner_validate_holder_commitment(int64_t this_arg, int64_t holder_tx, ptrArray outbound_htlc_preimages) { @@ -2350,6 +2423,7 @@ static inline LDKEcdsaChannelSigner LDKEcdsaChannelSigner_init (int64_t o, int64 .sign_closing_transaction = sign_closing_transaction_LDKEcdsaChannelSigner_jcall, .sign_holder_anchor_input = sign_holder_anchor_input_LDKEcdsaChannelSigner_jcall, .sign_channel_announcement_with_funding_key = sign_channel_announcement_with_funding_key_LDKEcdsaChannelSigner_jcall, + .cloned = LDKEcdsaChannelSigner_JCalls_cloned, .free = LDKEcdsaChannelSigner_JCalls_free, .ChannelSigner = LDKChannelSigner_init(ChannelSigner, pubkeys), }; @@ -2543,89 +2617,25 @@ int64_t CS_LDK_EcdsaChannelSigner_sign_channel_announcement_with_funding_key(in return tag_ptr(ret_conv, true); } -typedef struct LDKWriteableEcdsaChannelSigner_JCalls { - atomic_size_t refcnt; - uint32_t instance_ptr; - LDKEcdsaChannelSigner_JCalls* EcdsaChannelSigner; - LDKChannelSigner_JCalls* ChannelSigner; -} LDKWriteableEcdsaChannelSigner_JCalls; -static void LDKWriteableEcdsaChannelSigner_JCalls_free(void* this_arg) { - LDKWriteableEcdsaChannelSigner_JCalls *j_calls = (LDKWriteableEcdsaChannelSigner_JCalls*) this_arg; - if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { - FREE(j_calls); - } -} -LDKCVec_u8Z write_LDKWriteableEcdsaChannelSigner_jcall(const void* this_arg) { - LDKWriteableEcdsaChannelSigner_JCalls *j_calls = (LDKWriteableEcdsaChannelSigner_JCalls*) this_arg; - int8_tArray ret = (int8_tArray)js_invoke_function_l_(j_calls->instance_ptr, 15); - LDKCVec_u8Z ret_ref; - ret_ref.datalen = ret->arr_len; - ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret); - return ret_ref; -} -static void LDKWriteableEcdsaChannelSigner_JCalls_cloned(LDKWriteableEcdsaChannelSigner* new_obj) { - LDKWriteableEcdsaChannelSigner_JCalls *j_calls = (LDKWriteableEcdsaChannelSigner_JCalls*) new_obj->this_arg; - atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); - atomic_fetch_add_explicit(&j_calls->EcdsaChannelSigner->refcnt, 1, memory_order_release); - atomic_fetch_add_explicit(&j_calls->EcdsaChannelSigner->ChannelSigner->refcnt, 1, memory_order_release); -} -static inline LDKWriteableEcdsaChannelSigner LDKWriteableEcdsaChannelSigner_init (int64_t o, int64_t EcdsaChannelSigner, int64_t ChannelSigner, int64_t pubkeys) { - LDKWriteableEcdsaChannelSigner_JCalls *calls = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner_JCalls), "LDKWriteableEcdsaChannelSigner_JCalls"); - atomic_init(&calls->refcnt, 1); - calls->instance_ptr = o; - - LDKChannelPublicKeys pubkeys_conv; - pubkeys_conv.inner = untag_ptr(pubkeys); - pubkeys_conv.is_owned = ptr_is_owned(pubkeys); - CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv); - - LDKWriteableEcdsaChannelSigner ret = { - .this_arg = (void*) calls, - .write = write_LDKWriteableEcdsaChannelSigner_jcall, - .cloned = LDKWriteableEcdsaChannelSigner_JCalls_cloned, - .free = LDKWriteableEcdsaChannelSigner_JCalls_free, - .EcdsaChannelSigner = LDKEcdsaChannelSigner_init(EcdsaChannelSigner, ChannelSigner, pubkeys), - }; - calls->EcdsaChannelSigner = ret.EcdsaChannelSigner.this_arg; - calls->ChannelSigner = ret.EcdsaChannelSigner.ChannelSigner.this_arg; - return ret; -} -uint64_t CS_LDK_LDKWriteableEcdsaChannelSigner_new(int32_t o, int32_t EcdsaChannelSigner, int32_t ChannelSigner, int64_t pubkeys) { - LDKWriteableEcdsaChannelSigner *res_ptr = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner"); - *res_ptr = LDKWriteableEcdsaChannelSigner_init(o, EcdsaChannelSigner, ChannelSigner, pubkeys); - return tag_ptr(res_ptr, true); -} -int8_tArray CS_LDK_WriteableEcdsaChannelSigner_write(int64_t this_arg) { - void* this_arg_ptr = untag_ptr(this_arg); - if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKWriteableEcdsaChannelSigner* this_arg_conv = (LDKWriteableEcdsaChannelSigner*)this_arg_ptr; - LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -static inline struct LDKWriteableEcdsaChannelSigner CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_ok(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKEcdsaChannelSigner CResult_EcdsaChannelSignerDecodeErrorZ_get_ok(LDKCResult_EcdsaChannelSignerDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return WriteableEcdsaChannelSigner_clone(&*owner->contents.result); + return EcdsaChannelSigner_clone(&*owner->contents.result); } -int64_t CS_LDK_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_ok(int64_t owner) { - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* owner_conv = (LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)untag_ptr(owner); - LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner"); - *ret_ret = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_ok(owner_conv); +int64_t CS_LDK_CResult_EcdsaChannelSignerDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_EcdsaChannelSignerDecodeErrorZ* owner_conv = (LDKCResult_EcdsaChannelSignerDecodeErrorZ*)untag_ptr(owner); + LDKEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner"); + *ret_ret = CResult_EcdsaChannelSignerDecodeErrorZ_get_ok(owner_conv); return tag_ptr(ret_ret, true); } -static inline struct LDKDecodeError CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_err(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_EcdsaChannelSignerDecodeErrorZ_get_err(LDKCResult_EcdsaChannelSignerDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return DecodeError_clone(&*owner->contents.err); } -int64_t CS_LDK_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_err(int64_t owner) { - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* owner_conv = (LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)untag_ptr(owner); +int64_t CS_LDK_CResult_EcdsaChannelSignerDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_EcdsaChannelSignerDecodeErrorZ* owner_conv = (LDKCResult_EcdsaChannelSignerDecodeErrorZ*)untag_ptr(owner); LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_err(owner_conv); + *ret_copy = CResult_EcdsaChannelSignerDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -2831,7 +2841,7 @@ uint64_t channel_penalty_msat_LDKScoreLookUp_jcall(const void* this_arg, const L score_params_var = ProbabilisticScoringFeeParameters_clone(&score_params_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(score_params_var); score_params_ref = tag_ptr(score_params_var.inner, score_params_var.is_owned); - return js_invoke_function_l_lll(j_calls->instance_ptr, 16, ref_candidate, usage_ref, score_params_ref); + return js_invoke_function_l_lll(j_calls->instance_ptr, 15, ref_candidate, usage_ref, score_params_ref); } static void LDKScoreLookUp_JCalls_cloned(LDKScoreLookUp* new_obj) { LDKScoreLookUp_JCalls *j_calls = (LDKScoreLookUp_JCalls*) new_obj->this_arg; @@ -2892,7 +2902,7 @@ void payment_path_failed_LDKScoreUpdate_jcall(void* this_arg, const LDKPath * pa path_ref = tag_ptr(path_var.inner, path_var.is_owned); int64_t short_channel_id_conv = short_channel_id; int64_t duration_since_epoch_conv = duration_since_epoch; - js_invoke_function_void_lll(j_calls->instance_ptr, 17, path_ref, short_channel_id_conv, duration_since_epoch_conv); + js_invoke_function_void_lll(j_calls->instance_ptr, 16, path_ref, short_channel_id_conv, duration_since_epoch_conv); } void payment_path_successful_LDKScoreUpdate_jcall(void* this_arg, const LDKPath * path, uint64_t duration_since_epoch) { LDKScoreUpdate_JCalls *j_calls = (LDKScoreUpdate_JCalls*) this_arg; @@ -2902,7 +2912,7 @@ void payment_path_successful_LDKScoreUpdate_jcall(void* this_arg, const LDKPath CHECK_INNER_FIELD_ACCESS_OR_NULL(path_var); path_ref = tag_ptr(path_var.inner, path_var.is_owned); int64_t duration_since_epoch_conv = duration_since_epoch; - js_invoke_function_void_ll(j_calls->instance_ptr, 18, path_ref, duration_since_epoch_conv); + js_invoke_function_void_ll(j_calls->instance_ptr, 17, path_ref, duration_since_epoch_conv); } void probe_failed_LDKScoreUpdate_jcall(void* this_arg, const LDKPath * path, uint64_t short_channel_id, uint64_t duration_since_epoch) { LDKScoreUpdate_JCalls *j_calls = (LDKScoreUpdate_JCalls*) this_arg; @@ -2913,7 +2923,7 @@ void probe_failed_LDKScoreUpdate_jcall(void* this_arg, const LDKPath * path, uin path_ref = tag_ptr(path_var.inner, path_var.is_owned); int64_t short_channel_id_conv = short_channel_id; int64_t duration_since_epoch_conv = duration_since_epoch; - js_invoke_function_void_lll(j_calls->instance_ptr, 19, path_ref, short_channel_id_conv, duration_since_epoch_conv); + js_invoke_function_void_lll(j_calls->instance_ptr, 18, path_ref, short_channel_id_conv, duration_since_epoch_conv); } void probe_successful_LDKScoreUpdate_jcall(void* this_arg, const LDKPath * path, uint64_t duration_since_epoch) { LDKScoreUpdate_JCalls *j_calls = (LDKScoreUpdate_JCalls*) this_arg; @@ -2923,12 +2933,12 @@ void probe_successful_LDKScoreUpdate_jcall(void* this_arg, const LDKPath * path, CHECK_INNER_FIELD_ACCESS_OR_NULL(path_var); path_ref = tag_ptr(path_var.inner, path_var.is_owned); int64_t duration_since_epoch_conv = duration_since_epoch; - js_invoke_function_void_ll(j_calls->instance_ptr, 20, path_ref, duration_since_epoch_conv); + js_invoke_function_void_ll(j_calls->instance_ptr, 19, path_ref, duration_since_epoch_conv); } void time_passed_LDKScoreUpdate_jcall(void* this_arg, uint64_t duration_since_epoch) { LDKScoreUpdate_JCalls *j_calls = (LDKScoreUpdate_JCalls*) this_arg; int64_t duration_since_epoch_conv = duration_since_epoch; - js_invoke_function_void_l(j_calls->instance_ptr, 21, duration_since_epoch_conv); + js_invoke_function_void_l(j_calls->instance_ptr, 20, duration_since_epoch_conv); } static void LDKScoreUpdate_JCalls_cloned(LDKScoreUpdate* new_obj) { LDKScoreUpdate_JCalls *j_calls = (LDKScoreUpdate_JCalls*) new_obj->this_arg; @@ -3022,7 +3032,7 @@ static void LDKLockableScore_JCalls_free(void* this_arg) { } LDKScoreLookUp read_lock_LDKLockableScore_jcall(const void* this_arg) { LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg; - uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 22); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 21); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKScoreLookUp ret_conv = *(LDKScoreLookUp*)(ret_ptr); @@ -3035,7 +3045,7 @@ LDKScoreLookUp read_lock_LDKLockableScore_jcall(const void* this_arg) { } LDKScoreUpdate write_lock_LDKLockableScore_jcall(const void* this_arg) { LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg; - uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 23); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 22); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKScoreUpdate ret_conv = *(LDKScoreUpdate*)(ret_ptr); @@ -3099,7 +3109,7 @@ static void LDKWriteableScore_JCalls_free(void* this_arg) { } LDKCVec_u8Z write_LDKWriteableScore_jcall(const void* this_arg) { LDKWriteableScore_JCalls *j_calls = (LDKWriteableScore_JCalls*) this_arg; - int8_tArray ret = (int8_tArray)js_invoke_function_l_(j_calls->instance_ptr, 24); + int8_tArray ret = (int8_tArray)js_invoke_function_l_(j_calls->instance_ptr, 23); LDKCVec_u8Z ret_ref; ret_ref.datalen = ret->arr_len; ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes"); @@ -3180,103 +3190,135 @@ int32_t CS_LDK_CResult_NoneIOErrorZ_get_err(int64_t owner) { return ret_conv; } -static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) { - LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = ChannelDetails_clone(&orig->data[i]); - } - return ret; +static inline struct LDKThirtyTwoBytes C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_a(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR owner){ + return ThirtyTwoBytes_clone(&owner->a); } -static inline struct LDKRoute CResult_RouteLightningErrorZ_get_ok(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){ - LDKRoute ret = *owner->contents.result; +int8_tArray CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_a(int64_t owner) { + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* owner_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(owner); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_a(owner_conv).data, 32); + return ret_arr; +} + +static inline struct LDKRecipientOnionFields C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_b(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR owner){ + LDKRecipientOnionFields ret = owner->b; ret.is_owned = false; return ret; } -int64_t CS_LDK_CResult_RouteLightningErrorZ_get_ok(int64_t owner) { - LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner); - LDKRoute ret_var = CResult_RouteLightningErrorZ_get_ok(owner_conv); +int64_t CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_b(int64_t owner) { + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* owner_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(owner); + LDKRecipientOnionFields ret_var = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_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 LDKLightningError CResult_RouteLightningErrorZ_get_err(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){ - LDKLightningError ret = *owner->contents.err; +static inline struct LDKRouteParameters C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_c(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR owner){ + LDKRouteParameters ret = owner->c; ret.is_owned = false; return ret; } -int64_t CS_LDK_CResult_RouteLightningErrorZ_get_err(int64_t owner) { - LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner); - LDKLightningError ret_var = CResult_RouteLightningErrorZ_get_err(owner_conv); +int64_t CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_c(int64_t owner) { + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* owner_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(owner); + LDKRouteParameters ret_var = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_c(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 LDKBlindedPayInfo C2Tuple_BlindedPayInfoBlindedPathZ_get_a(LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR owner){ - LDKBlindedPayInfo ret = owner->a; +static inline struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_ok(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(&*owner->contents.result); +} +int64_t CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_ok(int64_t owner) { + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* owner_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(owner); + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ), "LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ"); + *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_ok(owner_conv); + return tag_ptr(ret_conv, true); +} + +static inline void CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_err(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +void CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_err(int64_t owner) { + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* owner_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(owner); + CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_err(owner_conv); +} + +static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) { + LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = ChannelDetails_clone(&orig->data[i]); + } + return ret; +} +static inline struct LDKRoute CResult_RouteLightningErrorZ_get_ok(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){ + LDKRoute ret = *owner->contents.result; ret.is_owned = false; return ret; } -int64_t CS_LDK_C2Tuple_BlindedPayInfoBlindedPathZ_get_a(int64_t owner) { - LDKC2Tuple_BlindedPayInfoBlindedPathZ* owner_conv = (LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(owner); - LDKBlindedPayInfo ret_var = C2Tuple_BlindedPayInfoBlindedPathZ_get_a(owner_conv); +int64_t CS_LDK_CResult_RouteLightningErrorZ_get_ok(int64_t owner) { + LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner); + LDKRoute ret_var = CResult_RouteLightningErrorZ_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 LDKBlindedPath C2Tuple_BlindedPayInfoBlindedPathZ_get_b(LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR owner){ - LDKBlindedPath ret = owner->b; +static inline struct LDKLightningError CResult_RouteLightningErrorZ_get_err(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){ + LDKLightningError ret = *owner->contents.err; ret.is_owned = false; return ret; } -int64_t CS_LDK_C2Tuple_BlindedPayInfoBlindedPathZ_get_b(int64_t owner) { - LDKC2Tuple_BlindedPayInfoBlindedPathZ* owner_conv = (LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(owner); - LDKBlindedPath ret_var = C2Tuple_BlindedPayInfoBlindedPathZ_get_b(owner_conv); +int64_t CS_LDK_CResult_RouteLightningErrorZ_get_err(int64_t owner) { + LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner); + LDKLightningError ret_var = CResult_RouteLightningErrorZ_get_err(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_BlindedPayInfoBlindedPathZZ CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_clone(const LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ *orig) { - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ) * orig->datalen, "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ clone bytes"), .datalen = orig->datalen }; +static inline LDKCVec_BlindedPaymentPathZ CVec_BlindedPaymentPathZ_clone(const LDKCVec_BlindedPaymentPathZ *orig) { + LDKCVec_BlindedPaymentPathZ ret = { .data = MALLOC(sizeof(LDKBlindedPaymentPath) * orig->datalen, "LDKCVec_BlindedPaymentPathZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C2Tuple_BlindedPayInfoBlindedPathZ_clone(&orig->data[i]); + ret.data[i] = BlindedPaymentPath_clone(&orig->data[i]); } return ret; } -static inline struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_ok(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR owner){ +static inline struct LDKCVec_BlindedPaymentPathZ CResult_CVec_BlindedPaymentPathZNoneZ_get_ok(LDKCResult_CVec_BlindedPaymentPathZNoneZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_clone(&*owner->contents.result); + return CVec_BlindedPaymentPathZ_clone(&*owner->contents.result); } -int64_tArray CS_LDK_CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_ok(int64_t owner) { - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* owner_conv = (LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ*)untag_ptr(owner); - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ ret_var = CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_ok(owner_conv); +int64_tArray CS_LDK_CResult_CVec_BlindedPaymentPathZNoneZ_get_ok(int64_t owner) { + LDKCResult_CVec_BlindedPaymentPathZNoneZ* owner_conv = (LDKCResult_CVec_BlindedPaymentPathZNoneZ*)untag_ptr(owner); + LDKCVec_BlindedPaymentPathZ ret_var = CResult_CVec_BlindedPaymentPathZNoneZ_get_ok(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 l = 0; l < ret_var.datalen; l++) { - LDKC2Tuple_BlindedPayInfoBlindedPathZ* ret_conv_37_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ"); - *ret_conv_37_conv = ret_var.data[l]; - ret_arr_ptr[l] = tag_ptr(ret_conv_37_conv, true); + for (size_t u = 0; u < ret_var.datalen; u++) { + LDKBlindedPaymentPath ret_conv_20_var = ret_var.data[u]; + int64_t ret_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_20_var); + ret_conv_20_ref = tag_ptr(ret_conv_20_var.inner, ret_conv_20_var.is_owned); + ret_arr_ptr[u] = ret_conv_20_ref; } FREE(ret_var.data); return ret_arr; } -static inline void CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_err(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR owner){ +static inline void CResult_CVec_BlindedPaymentPathZNoneZ_get_err(LDKCResult_CVec_BlindedPaymentPathZNoneZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return *owner->contents.err; } -void CS_LDK_CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_err(int64_t owner) { - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* owner_conv = (LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ*)untag_ptr(owner); - CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_err(owner_conv); +void CS_LDK_CResult_CVec_BlindedPaymentPathZNoneZ_get_err(int64_t owner) { + LDKCResult_CVec_BlindedPaymentPathZNoneZ* owner_conv = (LDKCResult_CVec_BlindedPaymentPathZNoneZ*)untag_ptr(owner); + CResult_CVec_BlindedPaymentPathZNoneZ_get_err(owner_conv); } static inline struct LDKOnionMessagePath CResult_OnionMessagePathNoneZ_get_ok(LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR owner){ @@ -3302,37 +3344,44 @@ void CS_LDK_CResult_OnionMessagePathNoneZ_get_err(int64_t owner) { CResult_OnionMessagePathNoneZ_get_err(owner_conv); } -static inline struct LDKCVec_BlindedPathZ CResult_CVec_BlindedPathZNoneZ_get_ok(LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR owner){ +static inline struct LDKCVec_BlindedMessagePathZ CResult_CVec_BlindedMessagePathZNoneZ_get_ok(LDKCResult_CVec_BlindedMessagePathZNoneZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return CVec_BlindedPathZ_clone(&*owner->contents.result); + return CVec_BlindedMessagePathZ_clone(&*owner->contents.result); } -int64_tArray CS_LDK_CResult_CVec_BlindedPathZNoneZ_get_ok(int64_t owner) { - LDKCResult_CVec_BlindedPathZNoneZ* owner_conv = (LDKCResult_CVec_BlindedPathZNoneZ*)untag_ptr(owner); - LDKCVec_BlindedPathZ ret_var = CResult_CVec_BlindedPathZNoneZ_get_ok(owner_conv); +int64_tArray CS_LDK_CResult_CVec_BlindedMessagePathZNoneZ_get_ok(int64_t owner) { + LDKCResult_CVec_BlindedMessagePathZNoneZ* owner_conv = (LDKCResult_CVec_BlindedMessagePathZNoneZ*)untag_ptr(owner); + LDKCVec_BlindedMessagePathZ ret_var = CResult_CVec_BlindedMessagePathZNoneZ_get_ok(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 n = 0; n < ret_var.datalen; n++) { - LDKBlindedPath 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; + for (size_t u = 0; u < ret_var.datalen; u++) { + LDKBlindedMessagePath ret_conv_20_var = ret_var.data[u]; + int64_t ret_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_20_var); + ret_conv_20_ref = tag_ptr(ret_conv_20_var.inner, ret_conv_20_var.is_owned); + ret_arr_ptr[u] = ret_conv_20_ref; } FREE(ret_var.data); return ret_arr; } -static inline void CResult_CVec_BlindedPathZNoneZ_get_err(LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR owner){ +static inline void CResult_CVec_BlindedMessagePathZNoneZ_get_err(LDKCResult_CVec_BlindedMessagePathZNoneZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return *owner->contents.err; } -void CS_LDK_CResult_CVec_BlindedPathZNoneZ_get_err(int64_t owner) { - LDKCResult_CVec_BlindedPathZNoneZ* owner_conv = (LDKCResult_CVec_BlindedPathZNoneZ*)untag_ptr(owner); - CResult_CVec_BlindedPathZNoneZ_get_err(owner_conv); +void CS_LDK_CResult_CVec_BlindedMessagePathZNoneZ_get_err(int64_t owner) { + LDKCResult_CVec_BlindedMessagePathZNoneZ* owner_conv = (LDKCResult_CVec_BlindedMessagePathZNoneZ*)untag_ptr(owner); + CResult_CVec_BlindedMessagePathZNoneZ_get_err(owner_conv); } +static inline LDKCVec_MessageForwardNodeZ CVec_MessageForwardNodeZ_clone(const LDKCVec_MessageForwardNodeZ *orig) { + LDKCVec_MessageForwardNodeZ ret = { .data = MALLOC(sizeof(LDKMessageForwardNode) * orig->datalen, "LDKCVec_MessageForwardNodeZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = MessageForwardNode_clone(&orig->data[i]); + } + return ret; +} static inline struct LDKInFlightHtlcs CResult_InFlightHtlcsDecodeErrorZ_get_ok(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner){ LDKInFlightHtlcs ret = *owner->contents.result; ret.is_owned = false; @@ -3522,13 +3571,6 @@ static inline LDKCVec_RouteHintZ CVec_RouteHintZ_clone(const LDKCVec_RouteHintZ } return ret; } -static inline LDKCVec_RouteHintHopZ CVec_RouteHintHopZ_clone(const LDKCVec_RouteHintHopZ *orig) { - LDKCVec_RouteHintHopZ ret = { .data = MALLOC(sizeof(LDKRouteHintHop) * orig->datalen, "LDKCVec_RouteHintHopZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = RouteHintHop_clone(&orig->data[i]); - } - return ret; -} static inline struct LDKRouteHint CResult_RouteHintDecodeErrorZ_get_ok(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR owner){ LDKRouteHint ret = *owner->contents.result; ret.is_owned = false; @@ -3733,7 +3775,7 @@ void log_LDKLogger_jcall(const void* this_arg, LDKRecord record) { int64_t record_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(record_var); record_ref = tag_ptr(record_var.inner, record_var.is_owned); - js_invoke_function_void_l(j_calls->instance_ptr, 25, record_ref); + js_invoke_function_void_l(j_calls->instance_ptr, 24, record_ref); } static void LDKLogger_JCalls_cloned(LDKLogger* new_obj) { LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) new_obj->this_arg; @@ -3907,6 +3949,7 @@ uint32_t CS_LDK_LDKClosureReason_ty_from_ptr(int64_t ptr) { case LDKClosureReason_CounterpartyCoopClosedUnfundedChannel: return 10; case LDKClosureReason_FundingBatchClosure: return 11; case LDKClosureReason_HTLCsTimedOut: return 12; + case LDKClosureReason_PeerFeerateTooLow: return 13; default: abort(); } } @@ -3919,6 +3962,12 @@ int64_t CS_LDK_LDKClosureReason_CounterpartyForceClosed_get_peer_msg(int64_t ptr peer_msg_ref = tag_ptr(peer_msg_var.inner, false); return peer_msg_ref; } +int64_t CS_LDK_LDKClosureReason_HolderForceClosed_get_broadcasted_latest_txn(int64_t ptr) { + LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr); + CHECK(obj->tag == LDKClosureReason_HolderForceClosed); + int64_t broadcasted_latest_txn_ref = tag_ptr(&obj->holder_force_closed.broadcasted_latest_txn, false); + return broadcasted_latest_txn_ref; +} jstring CS_LDK_LDKClosureReason_ProcessingError_get_err(int64_t ptr) { LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr); CHECK(obj->tag == LDKClosureReason_ProcessingError); @@ -3926,6 +3975,18 @@ jstring CS_LDK_LDKClosureReason_ProcessingError_get_err(int64_t ptr) { jstring err_conv = str_ref_to_cs(err_str.chars, err_str.len); return err_conv; } +int32_t CS_LDK_LDKClosureReason_PeerFeerateTooLow_get_peer_feerate_sat_per_kw(int64_t ptr) { + LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr); + CHECK(obj->tag == LDKClosureReason_PeerFeerateTooLow); + int32_t peer_feerate_sat_per_kw_conv = obj->peer_feerate_too_low.peer_feerate_sat_per_kw; + return peer_feerate_sat_per_kw_conv; +} +int32_t CS_LDK_LDKClosureReason_PeerFeerateTooLow_get_required_feerate_sat_per_kw(int64_t ptr) { + LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr); + CHECK(obj->tag == LDKClosureReason_PeerFeerateTooLow); + int32_t required_feerate_sat_per_kw_conv = obj->peer_feerate_too_low.required_feerate_sat_per_kw; + return required_feerate_sat_per_kw_conv; +} uint32_t CS_LDK_LDKMonitorEvent_ty_from_ptr(int64_t ptr) { LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr); switch(obj->tag) { @@ -4373,6 +4434,32 @@ int32_t CS_LDK_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticEr return ret_conv; } +static inline struct LDKOffer CResult_OfferDecodeErrorZ_get_ok(LDKCResult_OfferDecodeErrorZ *NONNULL_PTR owner){ + LDKOffer ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_OfferDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_OfferDecodeErrorZ* owner_conv = (LDKCResult_OfferDecodeErrorZ*)untag_ptr(owner); + LDKOffer ret_var = CResult_OfferDecodeErrorZ_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_OfferDecodeErrorZ_get_err(LDKCResult_OfferDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_OfferDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_OfferDecodeErrorZ* owner_conv = (LDKCResult_OfferDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_OfferDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline struct LDKOffer CResult_OfferBolt12ParseErrorZ_get_ok(LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR owner){ LDKOffer ret = *owner->contents.result; ret.is_owned = false; @@ -4451,21 +4538,11 @@ int32_t CS_LDK_CResult_PublicKeySecp256k1ErrorZ_get_err(int64_t owner) { uint32_t CS_LDK_LDKNetworkUpdate_ty_from_ptr(int64_t ptr) { LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr); switch(obj->tag) { - case LDKNetworkUpdate_ChannelUpdateMessage: return 0; - case LDKNetworkUpdate_ChannelFailure: return 1; - case LDKNetworkUpdate_NodeFailure: return 2; + case LDKNetworkUpdate_ChannelFailure: return 0; + case LDKNetworkUpdate_NodeFailure: return 1; default: abort(); } } -int64_t CS_LDK_LDKNetworkUpdate_ChannelUpdateMessage_get_msg(int64_t ptr) { - LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr); - CHECK(obj->tag == LDKNetworkUpdate_ChannelUpdateMessage); - LDKChannelUpdate msg_var = obj->channel_update_message.msg; - int64_t msg_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = tag_ptr(msg_var.inner, false); - return msg_ref; -} int64_t CS_LDK_LDKNetworkUpdate_ChannelFailure_get_short_channel_id(int64_t ptr) { LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr); CHECK(obj->tag == LDKNetworkUpdate_ChannelFailure); @@ -4590,7 +4667,7 @@ LDKUtxoResult get_utxo_LDKUtxoLookup_jcall(const void* this_arg, const uint8_t ( int8_tArray chain_hash_arr = init_int8_tArray(32, __LINE__); memcpy(chain_hash_arr->elems, *chain_hash, 32); int64_t short_channel_id_conv = short_channel_id; - uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 26, (int64_t)chain_hash_arr, short_channel_id_conv); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 25, (int64_t)chain_hash_arr, short_channel_id_conv); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKUtxoResult ret_conv = *(LDKUtxoResult*)(ret_ptr); @@ -4828,7 +4905,7 @@ uint32_t CS_LDK_LDKMessageSendEvent_ty_from_ptr(int64_t ptr) { case LDKMessageSendEvent_SendFundingCreated: return 4; case LDKMessageSendEvent_SendFundingSigned: return 5; case LDKMessageSendEvent_SendStfu: return 6; - case LDKMessageSendEvent_SendSplice: return 7; + case LDKMessageSendEvent_SendSpliceInit: return 7; case LDKMessageSendEvent_SendSpliceAck: return 8; case LDKMessageSendEvent_SendSpliceLocked: return 9; case LDKMessageSendEvent_SendTxAddInput: return 10; @@ -4972,17 +5049,17 @@ int64_t CS_LDK_LDKMessageSendEvent_SendStfu_get_msg(int64_t ptr) { msg_ref = tag_ptr(msg_var.inner, false); return msg_ref; } -int8_tArray CS_LDK_LDKMessageSendEvent_SendSplice_get_node_id(int64_t ptr) { +int8_tArray CS_LDK_LDKMessageSendEvent_SendSpliceInit_get_node_id(int64_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr); - CHECK(obj->tag == LDKMessageSendEvent_SendSplice); + CHECK(obj->tag == LDKMessageSendEvent_SendSpliceInit); int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); - memcpy(node_id_arr->elems, obj->send_splice.node_id.compressed_form, 33); + memcpy(node_id_arr->elems, obj->send_splice_init.node_id.compressed_form, 33); return node_id_arr; } -int64_t CS_LDK_LDKMessageSendEvent_SendSplice_get_msg(int64_t ptr) { +int64_t CS_LDK_LDKMessageSendEvent_SendSpliceInit_get_msg(int64_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr); - CHECK(obj->tag == LDKMessageSendEvent_SendSplice); - LDKSplice msg_var = obj->send_splice.msg; + CHECK(obj->tag == LDKMessageSendEvent_SendSpliceInit); + LDKSpliceInit msg_var = obj->send_splice_init.msg; int64_t msg_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, false); @@ -5606,17 +5683,41 @@ static inline LDKCVec_SocketAddressZ CVec_SocketAddressZ_clone(const LDKCVec_Soc } return ret; } +uint32_t CS_LDK_LDKNodeAnnouncementInfo_ty_from_ptr(int64_t ptr) { + LDKNodeAnnouncementInfo *obj = (LDKNodeAnnouncementInfo*)untag_ptr(ptr); + switch(obj->tag) { + case LDKNodeAnnouncementInfo_Relayed: return 0; + case LDKNodeAnnouncementInfo_Local: return 1; + default: abort(); + } +} +int64_t CS_LDK_LDKNodeAnnouncementInfo_Relayed_get_relayed(int64_t ptr) { + LDKNodeAnnouncementInfo *obj = (LDKNodeAnnouncementInfo*)untag_ptr(ptr); + CHECK(obj->tag == LDKNodeAnnouncementInfo_Relayed); + LDKNodeAnnouncement relayed_var = obj->relayed; + int64_t relayed_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(relayed_var); + relayed_ref = tag_ptr(relayed_var.inner, false); + return relayed_ref; +} +int64_t CS_LDK_LDKNodeAnnouncementInfo_Local_get_local(int64_t ptr) { + LDKNodeAnnouncementInfo *obj = (LDKNodeAnnouncementInfo*)untag_ptr(ptr); + CHECK(obj->tag == LDKNodeAnnouncementInfo_Local); + LDKNodeAnnouncementDetails local_var = obj->local; + int64_t local_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(local_var); + local_ref = tag_ptr(local_var.inner, false); + return local_ref; +} static inline struct LDKNodeAnnouncementInfo CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner){ - LDKNodeAnnouncementInfo ret = *owner->contents.result; - ret.is_owned = false; - return ret; +CHECK(owner->result_ok); + return NodeAnnouncementInfo_clone(&*owner->contents.result); } int64_t CS_LDK_CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(int64_t owner) { LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(owner); - LDKNodeAnnouncementInfo ret_var = CResult_NodeAnnouncementInfoDecodeErrorZ_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); + LDKNodeAnnouncementInfo *ret_copy = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo"); + *ret_copy = CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -5658,6 +5759,20 @@ int64_t CS_LDK_CResult_NodeAliasDecodeErrorZ_get_err(int64_t owner) { return ret_ref; } +uint32_t CS_LDK_LDKCOption_NodeAnnouncementInfoZ_ty_from_ptr(int64_t ptr) { + LDKCOption_NodeAnnouncementInfoZ *obj = (LDKCOption_NodeAnnouncementInfoZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_NodeAnnouncementInfoZ_Some: return 0; + case LDKCOption_NodeAnnouncementInfoZ_None: return 1; + default: abort(); + } +} +int64_t CS_LDK_LDKCOption_NodeAnnouncementInfoZ_Some_get_some(int64_t ptr) { + LDKCOption_NodeAnnouncementInfoZ *obj = (LDKCOption_NodeAnnouncementInfoZ*)untag_ptr(ptr); + CHECK(obj->tag == LDKCOption_NodeAnnouncementInfoZ_Some); + int64_t some_ref = tag_ptr(&obj->some, false); + return some_ref; +} static inline struct LDKNodeInfo CResult_NodeInfoDecodeErrorZ_get_ok(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner){ LDKNodeInfo ret = *owner->contents.result; ret.is_owned = false; @@ -6436,6 +6551,68 @@ int64_t CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_get_err(int64_t owner) { return ret_ref; } +uint32_t CS_LDK_LDKOffersContext_ty_from_ptr(int64_t ptr) { + LDKOffersContext *obj = (LDKOffersContext*)untag_ptr(ptr); + switch(obj->tag) { + case LDKOffersContext_InvoiceRequest: return 0; + case LDKOffersContext_OutboundPayment: return 1; + case LDKOffersContext_InboundPayment: return 2; + default: abort(); + } +} +int64_t CS_LDK_LDKOffersContext_InvoiceRequest_get_nonce(int64_t ptr) { + LDKOffersContext *obj = (LDKOffersContext*)untag_ptr(ptr); + CHECK(obj->tag == LDKOffersContext_InvoiceRequest); + LDKNonce nonce_var = obj->invoice_request.nonce; + int64_t nonce_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_var); + nonce_ref = tag_ptr(nonce_var.inner, false); + return nonce_ref; +} +int8_tArray CS_LDK_LDKOffersContext_OutboundPayment_get_payment_id(int64_t ptr) { + LDKOffersContext *obj = (LDKOffersContext*)untag_ptr(ptr); + CHECK(obj->tag == LDKOffersContext_OutboundPayment); + int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__); + memcpy(payment_id_arr->elems, obj->outbound_payment.payment_id.data, 32); + return payment_id_arr; +} +int64_t CS_LDK_LDKOffersContext_OutboundPayment_get_nonce(int64_t ptr) { + LDKOffersContext *obj = (LDKOffersContext*)untag_ptr(ptr); + CHECK(obj->tag == LDKOffersContext_OutboundPayment); + LDKNonce nonce_var = obj->outbound_payment.nonce; + int64_t nonce_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_var); + nonce_ref = tag_ptr(nonce_var.inner, false); + return nonce_ref; +} +int8_tArray CS_LDK_LDKOffersContext_OutboundPayment_get_hmac(int64_t ptr) { + LDKOffersContext *obj = (LDKOffersContext*)untag_ptr(ptr); + CHECK(obj->tag == LDKOffersContext_OutboundPayment); + int8_tArray hmac_arr = init_int8_tArray(32, __LINE__); + memcpy(hmac_arr->elems, obj->outbound_payment.hmac.data, 32); + return hmac_arr; +} +int8_tArray CS_LDK_LDKOffersContext_InboundPayment_get_payment_hash(int64_t ptr) { + LDKOffersContext *obj = (LDKOffersContext*)untag_ptr(ptr); + CHECK(obj->tag == LDKOffersContext_InboundPayment); + int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__); + memcpy(payment_hash_arr->elems, obj->inbound_payment.payment_hash.data, 32); + return payment_hash_arr; +} +uint32_t CS_LDK_LDKCOption_OffersContextZ_ty_from_ptr(int64_t ptr) { + LDKCOption_OffersContextZ *obj = (LDKCOption_OffersContextZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_OffersContextZ_Some: return 0; + case LDKCOption_OffersContextZ_None: return 1; + default: abort(); + } +} +int64_t CS_LDK_LDKCOption_OffersContextZ_Some_get_some(int64_t ptr) { + LDKCOption_OffersContextZ *obj = (LDKCOption_OffersContextZ*)untag_ptr(ptr); + CHECK(obj->tag == LDKCOption_OffersContextZ_Some); + int64_t some_ref = tag_ptr(&obj->some, false); + return some_ref; +} uint32_t CS_LDK_LDKOffersMessage_ty_from_ptr(int64_t ptr) { LDKOffersMessage *obj = (LDKOffersMessage*)untag_ptr(ptr); switch(obj->tag) { @@ -6472,19 +6649,46 @@ int64_t CS_LDK_LDKOffersMessage_InvoiceError_get_invoice_error(int64_t ptr) { invoice_error_ref = tag_ptr(invoice_error_var.inner, false); return invoice_error_ref; } -uint32_t CS_LDK_LDKCOption_OffersMessageZ_ty_from_ptr(int64_t ptr) { - LDKCOption_OffersMessageZ *obj = (LDKCOption_OffersMessageZ*)untag_ptr(ptr); +static inline struct LDKOffersMessage C2Tuple_OffersMessageResponseInstructionZ_get_a(LDKC2Tuple_OffersMessageResponseInstructionZ *NONNULL_PTR owner){ + return OffersMessage_clone(&owner->a); +} +int64_t CS_LDK_C2Tuple_OffersMessageResponseInstructionZ_get_a(int64_t owner) { + LDKC2Tuple_OffersMessageResponseInstructionZ* owner_conv = (LDKC2Tuple_OffersMessageResponseInstructionZ*)untag_ptr(owner); + LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); + *ret_copy = C2Tuple_OffersMessageResponseInstructionZ_get_a(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKResponseInstruction C2Tuple_OffersMessageResponseInstructionZ_get_b(LDKC2Tuple_OffersMessageResponseInstructionZ *NONNULL_PTR owner){ + LDKResponseInstruction ret = owner->b; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_C2Tuple_OffersMessageResponseInstructionZ_get_b(int64_t owner) { + LDKC2Tuple_OffersMessageResponseInstructionZ* owner_conv = (LDKC2Tuple_OffersMessageResponseInstructionZ*)untag_ptr(owner); + LDKResponseInstruction ret_var = C2Tuple_OffersMessageResponseInstructionZ_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; +} + +uint32_t CS_LDK_LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_ty_from_ptr(int64_t ptr) { + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ *obj = (LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ*)untag_ptr(ptr); switch(obj->tag) { - case LDKCOption_OffersMessageZ_Some: return 0; - case LDKCOption_OffersMessageZ_None: return 1; + case LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_Some: return 0; + case LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_None: return 1; default: abort(); } } -int64_t CS_LDK_LDKCOption_OffersMessageZ_Some_get_some(int64_t ptr) { - LDKCOption_OffersMessageZ *obj = (LDKCOption_OffersMessageZ*)untag_ptr(ptr); - CHECK(obj->tag == LDKCOption_OffersMessageZ_Some); - int64_t some_ref = tag_ptr(&obj->some, false); - return some_ref; +int64_t CS_LDK_LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_Some_get_some(int64_t ptr) { + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ *obj = (LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ*)untag_ptr(ptr); + CHECK(obj->tag == LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_Some); + LDKC2Tuple_OffersMessageResponseInstructionZ* some_conv = MALLOC(sizeof(LDKC2Tuple_OffersMessageResponseInstructionZ), "LDKC2Tuple_OffersMessageResponseInstructionZ"); + *some_conv = obj->some; + *some_conv = C2Tuple_OffersMessageResponseInstructionZ_clone(some_conv); + return tag_ptr(some_conv, true); } uint32_t CS_LDK_LDKDestination_ty_from_ptr(int64_t ptr) { LDKDestination *obj = (LDKDestination*)untag_ptr(ptr); @@ -6504,52 +6708,211 @@ int8_tArray CS_LDK_LDKDestination_Node_get_node(int64_t ptr) { int64_t CS_LDK_LDKDestination_BlindedPath_get_blinded_path(int64_t ptr) { LDKDestination *obj = (LDKDestination*)untag_ptr(ptr); CHECK(obj->tag == LDKDestination_BlindedPath); - LDKBlindedPath blinded_path_var = obj->blinded_path; + LDKBlindedMessagePath blinded_path_var = obj->blinded_path; int64_t blinded_path_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_path_var); blinded_path_ref = tag_ptr(blinded_path_var.inner, false); return blinded_path_ref; } -static inline struct LDKOffersMessage C3Tuple_OffersMessageDestinationBlindedPathZ_get_a(LDKC3Tuple_OffersMessageDestinationBlindedPathZ *NONNULL_PTR owner){ +uint32_t CS_LDK_LDKMessageContext_ty_from_ptr(int64_t ptr) { + LDKMessageContext *obj = (LDKMessageContext*)untag_ptr(ptr); + switch(obj->tag) { + case LDKMessageContext_Offers: return 0; + case LDKMessageContext_Custom: return 1; + default: abort(); + } +} +int64_t CS_LDK_LDKMessageContext_Offers_get_offers(int64_t ptr) { + LDKMessageContext *obj = (LDKMessageContext*)untag_ptr(ptr); + CHECK(obj->tag == LDKMessageContext_Offers); + int64_t offers_ref = tag_ptr(&obj->offers, false); + return offers_ref; +} +int8_tArray CS_LDK_LDKMessageContext_Custom_get_custom(int64_t ptr) { + LDKMessageContext *obj = (LDKMessageContext*)untag_ptr(ptr); + CHECK(obj->tag == LDKMessageContext_Custom); + LDKCVec_u8Z custom_var = obj->custom; + int8_tArray custom_arr = init_int8_tArray(custom_var.datalen, __LINE__); + memcpy(custom_arr->elems, custom_var.data, custom_var.datalen); + return custom_arr; +} +uint32_t CS_LDK_LDKMessageSendInstructions_ty_from_ptr(int64_t ptr) { + LDKMessageSendInstructions *obj = (LDKMessageSendInstructions*)untag_ptr(ptr); + switch(obj->tag) { + case LDKMessageSendInstructions_WithSpecifiedReplyPath: return 0; + case LDKMessageSendInstructions_WithReplyPath: return 1; + case LDKMessageSendInstructions_WithoutReplyPath: return 2; + case LDKMessageSendInstructions_ForReply: return 3; + default: abort(); + } +} +int64_t CS_LDK_LDKMessageSendInstructions_WithSpecifiedReplyPath_get_destination(int64_t ptr) { + LDKMessageSendInstructions *obj = (LDKMessageSendInstructions*)untag_ptr(ptr); + CHECK(obj->tag == LDKMessageSendInstructions_WithSpecifiedReplyPath); + int64_t destination_ref = tag_ptr(&obj->with_specified_reply_path.destination, false); + return destination_ref; +} +int64_t CS_LDK_LDKMessageSendInstructions_WithSpecifiedReplyPath_get_reply_path(int64_t ptr) { + LDKMessageSendInstructions *obj = (LDKMessageSendInstructions*)untag_ptr(ptr); + CHECK(obj->tag == LDKMessageSendInstructions_WithSpecifiedReplyPath); + LDKBlindedMessagePath reply_path_var = obj->with_specified_reply_path.reply_path; + int64_t reply_path_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(reply_path_var); + reply_path_ref = tag_ptr(reply_path_var.inner, false); + return reply_path_ref; +} +int64_t CS_LDK_LDKMessageSendInstructions_WithReplyPath_get_destination(int64_t ptr) { + LDKMessageSendInstructions *obj = (LDKMessageSendInstructions*)untag_ptr(ptr); + CHECK(obj->tag == LDKMessageSendInstructions_WithReplyPath); + int64_t destination_ref = tag_ptr(&obj->with_reply_path.destination, false); + return destination_ref; +} +int64_t CS_LDK_LDKMessageSendInstructions_WithReplyPath_get_context(int64_t ptr) { + LDKMessageSendInstructions *obj = (LDKMessageSendInstructions*)untag_ptr(ptr); + CHECK(obj->tag == LDKMessageSendInstructions_WithReplyPath); + int64_t context_ref = tag_ptr(&obj->with_reply_path.context, false); + return context_ref; +} +int64_t CS_LDK_LDKMessageSendInstructions_WithoutReplyPath_get_destination(int64_t ptr) { + LDKMessageSendInstructions *obj = (LDKMessageSendInstructions*)untag_ptr(ptr); + CHECK(obj->tag == LDKMessageSendInstructions_WithoutReplyPath); + int64_t destination_ref = tag_ptr(&obj->without_reply_path.destination, false); + return destination_ref; +} +int64_t CS_LDK_LDKMessageSendInstructions_ForReply_get_instructions(int64_t ptr) { + LDKMessageSendInstructions *obj = (LDKMessageSendInstructions*)untag_ptr(ptr); + CHECK(obj->tag == LDKMessageSendInstructions_ForReply); + LDKResponseInstruction instructions_var = obj->for_reply.instructions; + int64_t instructions_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(instructions_var); + instructions_ref = tag_ptr(instructions_var.inner, false); + return instructions_ref; +} +static inline struct LDKOffersMessage C2Tuple_OffersMessageMessageSendInstructionsZ_get_a(LDKC2Tuple_OffersMessageMessageSendInstructionsZ *NONNULL_PTR owner){ return OffersMessage_clone(&owner->a); } -int64_t CS_LDK_C3Tuple_OffersMessageDestinationBlindedPathZ_get_a(int64_t owner) { - LDKC3Tuple_OffersMessageDestinationBlindedPathZ* owner_conv = (LDKC3Tuple_OffersMessageDestinationBlindedPathZ*)untag_ptr(owner); +int64_t CS_LDK_C2Tuple_OffersMessageMessageSendInstructionsZ_get_a(int64_t owner) { + LDKC2Tuple_OffersMessageMessageSendInstructionsZ* owner_conv = (LDKC2Tuple_OffersMessageMessageSendInstructionsZ*)untag_ptr(owner); LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); - *ret_copy = C3Tuple_OffersMessageDestinationBlindedPathZ_get_a(owner_conv); + *ret_copy = C2Tuple_OffersMessageMessageSendInstructionsZ_get_a(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline struct LDKDestination C3Tuple_OffersMessageDestinationBlindedPathZ_get_b(LDKC3Tuple_OffersMessageDestinationBlindedPathZ *NONNULL_PTR owner){ - return Destination_clone(&owner->b); +static inline struct LDKMessageSendInstructions C2Tuple_OffersMessageMessageSendInstructionsZ_get_b(LDKC2Tuple_OffersMessageMessageSendInstructionsZ *NONNULL_PTR owner){ + return MessageSendInstructions_clone(&owner->b); } -int64_t CS_LDK_C3Tuple_OffersMessageDestinationBlindedPathZ_get_b(int64_t owner) { - LDKC3Tuple_OffersMessageDestinationBlindedPathZ* owner_conv = (LDKC3Tuple_OffersMessageDestinationBlindedPathZ*)untag_ptr(owner); - LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); - *ret_copy = C3Tuple_OffersMessageDestinationBlindedPathZ_get_b(owner_conv); +int64_t CS_LDK_C2Tuple_OffersMessageMessageSendInstructionsZ_get_b(int64_t owner) { + LDKC2Tuple_OffersMessageMessageSendInstructionsZ* owner_conv = (LDKC2Tuple_OffersMessageMessageSendInstructionsZ*)untag_ptr(owner); + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = C2Tuple_OffersMessageMessageSendInstructionsZ_get_b(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline struct LDKBlindedPath C3Tuple_OffersMessageDestinationBlindedPathZ_get_c(LDKC3Tuple_OffersMessageDestinationBlindedPathZ *NONNULL_PTR owner){ - LDKBlindedPath ret = owner->c; +static inline LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ CVec_C2Tuple_OffersMessageMessageSendInstructionsZZ_clone(const LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ *orig) { + LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_OffersMessageMessageSendInstructionsZ) * orig->datalen, "LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = C2Tuple_OffersMessageMessageSendInstructionsZ_clone(&orig->data[i]); + } + return ret; +} +static inline struct LDKReleaseHeldHtlc C2Tuple_ReleaseHeldHtlcResponseInstructionZ_get_a(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ *NONNULL_PTR owner){ + LDKReleaseHeldHtlc ret = owner->a; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_C2Tuple_ReleaseHeldHtlcResponseInstructionZ_get_a(int64_t owner) { + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ* owner_conv = (LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ*)untag_ptr(owner); + LDKReleaseHeldHtlc ret_var = C2Tuple_ReleaseHeldHtlcResponseInstructionZ_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 LDKResponseInstruction C2Tuple_ReleaseHeldHtlcResponseInstructionZ_get_b(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ *NONNULL_PTR owner){ + LDKResponseInstruction ret = owner->b; ret.is_owned = false; return ret; } -int64_t CS_LDK_C3Tuple_OffersMessageDestinationBlindedPathZ_get_c(int64_t owner) { - LDKC3Tuple_OffersMessageDestinationBlindedPathZ* owner_conv = (LDKC3Tuple_OffersMessageDestinationBlindedPathZ*)untag_ptr(owner); - LDKBlindedPath ret_var = C3Tuple_OffersMessageDestinationBlindedPathZ_get_c(owner_conv); +int64_t CS_LDK_C2Tuple_ReleaseHeldHtlcResponseInstructionZ_get_b(int64_t owner) { + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ* owner_conv = (LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ*)untag_ptr(owner); + LDKResponseInstruction ret_var = C2Tuple_ReleaseHeldHtlcResponseInstructionZ_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_C3Tuple_OffersMessageDestinationBlindedPathZZ CVec_C3Tuple_OffersMessageDestinationBlindedPathZZ_clone(const LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ *orig) { - LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_OffersMessageDestinationBlindedPathZ) * orig->datalen, "LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ clone bytes"), .datalen = orig->datalen }; +uint32_t CS_LDK_LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_ty_from_ptr(int64_t ptr) { + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ *obj = (LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_Some: return 0; + case LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_None: return 1; + default: abort(); + } +} +int64_t CS_LDK_LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_Some_get_some(int64_t ptr) { + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ *obj = (LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ*)untag_ptr(ptr); + CHECK(obj->tag == LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_Some); + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ* some_conv = MALLOC(sizeof(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ), "LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ"); + *some_conv = obj->some; + *some_conv = C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone(some_conv); + return tag_ptr(some_conv, true); +} +uint32_t CS_LDK_LDKAsyncPaymentsMessage_ty_from_ptr(int64_t ptr) { + LDKAsyncPaymentsMessage *obj = (LDKAsyncPaymentsMessage*)untag_ptr(ptr); + switch(obj->tag) { + case LDKAsyncPaymentsMessage_HeldHtlcAvailable: return 0; + case LDKAsyncPaymentsMessage_ReleaseHeldHtlc: return 1; + default: abort(); + } +} +int64_t CS_LDK_LDKAsyncPaymentsMessage_HeldHtlcAvailable_get_held_htlc_available(int64_t ptr) { + LDKAsyncPaymentsMessage *obj = (LDKAsyncPaymentsMessage*)untag_ptr(ptr); + CHECK(obj->tag == LDKAsyncPaymentsMessage_HeldHtlcAvailable); + LDKHeldHtlcAvailable held_htlc_available_var = obj->held_htlc_available; + int64_t held_htlc_available_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(held_htlc_available_var); + held_htlc_available_ref = tag_ptr(held_htlc_available_var.inner, false); + return held_htlc_available_ref; +} +int64_t CS_LDK_LDKAsyncPaymentsMessage_ReleaseHeldHtlc_get_release_held_htlc(int64_t ptr) { + LDKAsyncPaymentsMessage *obj = (LDKAsyncPaymentsMessage*)untag_ptr(ptr); + CHECK(obj->tag == LDKAsyncPaymentsMessage_ReleaseHeldHtlc); + LDKReleaseHeldHtlc release_held_htlc_var = obj->release_held_htlc; + int64_t release_held_htlc_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(release_held_htlc_var); + release_held_htlc_ref = tag_ptr(release_held_htlc_var.inner, false); + return release_held_htlc_ref; +} +static inline struct LDKAsyncPaymentsMessage C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_get_a(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ *NONNULL_PTR owner){ + return AsyncPaymentsMessage_clone(&owner->a); +} +int64_t CS_LDK_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_get_a(int64_t owner) { + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ* owner_conv = (LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ*)untag_ptr(owner); + LDKAsyncPaymentsMessage *ret_copy = MALLOC(sizeof(LDKAsyncPaymentsMessage), "LDKAsyncPaymentsMessage"); + *ret_copy = C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_get_a(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKMessageSendInstructions C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_get_b(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ *NONNULL_PTR owner){ + return MessageSendInstructions_clone(&owner->b); +} +int64_t CS_LDK_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_get_b(int64_t owner) { + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ* owner_conv = (LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ*)untag_ptr(owner); + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_get_b(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ CVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ_clone(const LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ *orig) { + LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ) * orig->datalen, "LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C3Tuple_OffersMessageDestinationBlindedPathZ_clone(&orig->data[i]); + ret.data[i] = C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone(&orig->data[i]); } return ret; } @@ -6843,7 +7206,7 @@ LDKCResult_ChannelMonitorUpdateStatusNoneZ watch_channel_LDKWatch_jcall(const vo int64_t monitor_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_var); monitor_ref = tag_ptr(monitor_var.inner, monitor_var.is_owned); - uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 27, funding_txo_ref, monitor_ref); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 26, funding_txo_ref, monitor_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_ChannelMonitorUpdateStatusNoneZ ret_conv = *(LDKCResult_ChannelMonitorUpdateStatusNoneZ*)(ret_ptr); @@ -6861,13 +7224,13 @@ LDKChannelMonitorUpdateStatus update_channel_LDKWatch_jcall(const void* this_arg update_var = ChannelMonitorUpdate_clone(&update_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var); update_ref = tag_ptr(update_var.inner, update_var.is_owned); - uint64_t ret = js_invoke_function_ChannelMonitorUpdateStatus_ll(j_calls->instance_ptr, 28, funding_txo_ref, update_ref); + uint64_t ret = js_invoke_function_ChannelMonitorUpdateStatus_ll(j_calls->instance_ptr, 27, funding_txo_ref, update_ref); LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_cs(ret); return ret_conv; } 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); + int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 28); LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) @@ -6989,7 +7352,7 @@ void broadcast_transactions_LDKBroadcasterInterface_jcall(const void* this_arg, } FREE(txs_var.data); - js_invoke_function_void_l(j_calls->instance_ptr, 30, (int64_t)txs_arr); + js_invoke_function_void_l(j_calls->instance_ptr, 29, (int64_t)txs_arr); } static void LDKBroadcasterInterface_JCalls_cloned(LDKBroadcasterInterface* new_obj) { LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) new_obj->this_arg; @@ -7048,7 +7411,7 @@ static void LDKEntropySource_JCalls_free(void* this_arg) { } LDKThirtyTwoBytes get_secure_random_bytes_LDKEntropySource_jcall(const void* this_arg) { LDKEntropySource_JCalls *j_calls = (LDKEntropySource_JCalls*) this_arg; - int8_tArray ret = (int8_tArray)js_invoke_function_l_(j_calls->instance_ptr, 31); + int8_tArray ret = (int8_tArray)js_invoke_function_l_(j_calls->instance_ptr, 30); LDKThirtyTwoBytes ret_ref; CHECK(ret->arr_len == 32); memcpy(ret_ref.data, ret->elems, 32); FREE(ret); @@ -7132,7 +7495,7 @@ static void LDKNodeSigner_JCalls_free(void* this_arg) { } LDKThirtyTwoBytes get_inbound_payment_key_material_LDKNodeSigner_jcall(const void* this_arg) { LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg; - int8_tArray ret = (int8_tArray)js_invoke_function_l_(j_calls->instance_ptr, 32); + int8_tArray ret = (int8_tArray)js_invoke_function_l_(j_calls->instance_ptr, 31); LDKThirtyTwoBytes ret_ref; CHECK(ret->arr_len == 32); memcpy(ret_ref.data, ret->elems, 32); FREE(ret); @@ -7141,7 +7504,7 @@ LDKThirtyTwoBytes get_inbound_payment_key_material_LDKNodeSigner_jcall(const voi LDKCResult_PublicKeyNoneZ get_node_id_LDKNodeSigner_jcall(const void* this_arg, LDKRecipient recipient) { LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg; int32_t recipient_conv = LDKRecipient_to_cs(recipient); - uint64_t ret = js_invoke_function_l_Recipient(j_calls->instance_ptr, 33, recipient_conv); + uint64_t ret = js_invoke_function_l_Recipient(j_calls->instance_ptr, 32, recipient_conv); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_PublicKeyNoneZ ret_conv = *(LDKCResult_PublicKeyNoneZ*)(ret_ptr); @@ -7156,30 +7519,22 @@ LDKCResult_ThirtyTwoBytesNoneZ ecdh_LDKNodeSigner_jcall(const void* this_arg, LD LDKCOption_BigEndianScalarZ *tweak_copy = MALLOC(sizeof(LDKCOption_BigEndianScalarZ), "LDKCOption_BigEndianScalarZ"); *tweak_copy = tweak; int64_t tweak_ref = tag_ptr(tweak_copy, true); - uint64_t ret = js_invoke_function_l_Recipientll(j_calls->instance_ptr, 34, recipient_conv, (int64_t)other_key_arr, tweak_ref); + uint64_t ret = js_invoke_function_l_Recipientll(j_calls->instance_ptr, 33, recipient_conv, (int64_t)other_key_arr, tweak_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_ThirtyTwoBytesNoneZ ret_conv = *(LDKCResult_ThirtyTwoBytesNoneZ*)(ret_ptr); FREE(untag_ptr(ret)); return ret_conv; } -LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKNodeSigner_jcall(const void* this_arg, LDKu8slice hrp_bytes, LDKCVec_U5Z invoice_data, LDKRecipient recipient) { +LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKNodeSigner_jcall(const void* this_arg, const LDKRawBolt11Invoice * invoice, LDKRecipient recipient) { LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg; - LDKu8slice hrp_bytes_var = hrp_bytes; - int8_tArray hrp_bytes_arr = init_int8_tArray(hrp_bytes_var.datalen, __LINE__); - memcpy(hrp_bytes_arr->elems, hrp_bytes_var.data, hrp_bytes_var.datalen); - LDKCVec_U5Z invoice_data_var = invoice_data; - ptrArray invoice_data_arr = NULL; - invoice_data_arr = init_ptrArray(invoice_data_var.datalen, __LINE__); - int8_t *invoice_data_arr_ptr = (int8_t*)(((uint8_t*)invoice_data_arr) + 8); - for (size_t h = 0; h < invoice_data_var.datalen; h++) { - uint8_t invoice_data_conv_7_val = invoice_data_var.data[h]._0; - invoice_data_arr_ptr[h] = invoice_data_conv_7_val; - } - - FREE(invoice_data_var.data); + LDKRawBolt11Invoice invoice_var = *invoice; + int64_t invoice_ref = 0; + invoice_var = RawBolt11Invoice_clone(&invoice_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_var); + invoice_ref = tag_ptr(invoice_var.inner, invoice_var.is_owned); int32_t recipient_conv = LDKRecipient_to_cs(recipient); - uint64_t ret = js_invoke_function_l_llRecipient(j_calls->instance_ptr, 35, (int64_t)hrp_bytes_arr, (int64_t)invoice_data_arr, recipient_conv); + uint64_t ret = js_invoke_function_l_lRecipient(j_calls->instance_ptr, 34, invoice_ref, recipient_conv); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_RecoverableSignatureNoneZ ret_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(ret_ptr); @@ -7193,7 +7548,7 @@ LDKCResult_SchnorrSignatureNoneZ sign_bolt12_invoice_request_LDKNodeSigner_jcall 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); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 35, invoice_request_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_SchnorrSignatureNoneZ ret_conv = *(LDKCResult_SchnorrSignatureNoneZ*)(ret_ptr); @@ -7207,7 +7562,7 @@ LDKCResult_SchnorrSignatureNoneZ sign_bolt12_invoice_LDKNodeSigner_jcall(const v 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); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 36, invoice_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_SchnorrSignatureNoneZ ret_conv = *(LDKCResult_SchnorrSignatureNoneZ*)(ret_ptr); @@ -7219,7 +7574,7 @@ LDKCResult_ECDSASignatureNoneZ sign_gossip_message_LDKNodeSigner_jcall(const voi LDKUnsignedGossipMessage *msg_copy = MALLOC(sizeof(LDKUnsignedGossipMessage), "LDKUnsignedGossipMessage"); *msg_copy = msg; int64_t msg_ref = tag_ptr(msg_copy, true); - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 38, msg_ref); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 37, msg_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_ECDSASignatureNoneZ ret_conv = *(LDKCResult_ECDSASignatureNoneZ*)(ret_ptr); @@ -7289,30 +7644,18 @@ int64_t CS_LDK_NodeSigner_ecdh(int64_t this_arg, int32_t recipient, int8_tArray return tag_ptr(ret_conv, true); } -int64_t CS_LDK_NodeSigner_sign_invoice(int64_t this_arg, int8_tArray hrp_bytes, ptrArray invoice_data, int32_t recipient) { +int64_t CS_LDK_NodeSigner_sign_invoice(int64_t this_arg, int64_t invoice, int32_t recipient) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKNodeSigner* this_arg_conv = (LDKNodeSigner*)this_arg_ptr; - LDKu8slice hrp_bytes_ref; - hrp_bytes_ref.datalen = hrp_bytes->arr_len; - hrp_bytes_ref.data = hrp_bytes->elems; - LDKCVec_U5Z invoice_data_constr; - invoice_data_constr.datalen = invoice_data->arr_len; - if (invoice_data_constr.datalen > 0) - invoice_data_constr.data = MALLOC(invoice_data_constr.datalen * sizeof(LDKU5), "LDKCVec_U5Z Elements"); - else - invoice_data_constr.data = NULL; - int8_t* invoice_data_vals = (void*) invoice_data->elems; - for (size_t h = 0; h < invoice_data_constr.datalen; h++) { - int8_t invoice_data_conv_7 = invoice_data_vals[h]; - - invoice_data_constr.data[h] = (LDKU5){ ._0 = invoice_data_conv_7 }; - } - FREE(invoice_data); + LDKRawBolt11Invoice invoice_conv; + invoice_conv.inner = untag_ptr(invoice); + invoice_conv.is_owned = ptr_is_owned(invoice); + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); + invoice_conv.is_owned = false; LDKRecipient recipient_conv = LDKRecipient_from_cs(recipient); LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); - *ret_conv = (this_arg_conv->sign_invoice)(this_arg_conv->this_arg, hrp_bytes_ref, invoice_data_constr, recipient_conv); - FREE(hrp_bytes); + *ret_conv = (this_arg_conv->sign_invoice)(this_arg_conv->this_arg, &invoice_conv, recipient_conv); return tag_ptr(ret_conv, true); } @@ -7373,33 +7716,33 @@ LDKThirtyTwoBytes generate_channel_keys_id_LDKSignerProvider_jcall(const void* t int64_t channel_value_satoshis_conv = channel_value_satoshis; int8_tArray user_channel_id_arr = init_int8_tArray(16, __LINE__); memcpy(user_channel_id_arr->elems, user_channel_id.le_bytes, 16); - int8_tArray ret = (int8_tArray)js_invoke_function_l_bll(j_calls->instance_ptr, 39, inbound_conv, channel_value_satoshis_conv, (int64_t)user_channel_id_arr); + int8_tArray ret = (int8_tArray)js_invoke_function_l_bll(j_calls->instance_ptr, 38, inbound_conv, channel_value_satoshis_conv, (int64_t)user_channel_id_arr); LDKThirtyTwoBytes ret_ref; CHECK(ret->arr_len == 32); memcpy(ret_ref.data, ret->elems, 32); FREE(ret); return ret_ref; } -LDKWriteableEcdsaChannelSigner derive_channel_signer_LDKSignerProvider_jcall(const void* this_arg, uint64_t channel_value_satoshis, LDKThirtyTwoBytes channel_keys_id) { +LDKEcdsaChannelSigner derive_channel_signer_LDKSignerProvider_jcall(const void* this_arg, uint64_t channel_value_satoshis, LDKThirtyTwoBytes channel_keys_id) { LDKSignerProvider_JCalls *j_calls = (LDKSignerProvider_JCalls*) this_arg; int64_t channel_value_satoshis_conv = channel_value_satoshis; int8_tArray channel_keys_id_arr = init_int8_tArray(32, __LINE__); memcpy(channel_keys_id_arr->elems, channel_keys_id.data, 32); - uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 40, channel_value_satoshis_conv, (int64_t)channel_keys_id_arr); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 39, channel_value_satoshis_conv, (int64_t)channel_keys_id_arr); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); - LDKWriteableEcdsaChannelSigner ret_conv = *(LDKWriteableEcdsaChannelSigner*)(ret_ptr); + LDKEcdsaChannelSigner ret_conv = *(LDKEcdsaChannelSigner*)(ret_ptr); FREE(untag_ptr(ret)); return ret_conv; } -LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ read_chan_signer_LDKSignerProvider_jcall(const void* this_arg, LDKu8slice reader) { +LDKCResult_EcdsaChannelSignerDecodeErrorZ read_chan_signer_LDKSignerProvider_jcall(const void* this_arg, LDKu8slice reader) { LDKSignerProvider_JCalls *j_calls = (LDKSignerProvider_JCalls*) this_arg; LDKu8slice reader_var = reader; int8_tArray reader_arr = init_int8_tArray(reader_var.datalen, __LINE__); memcpy(reader_arr->elems, reader_var.data, reader_var.datalen); - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 41, (int64_t)reader_arr); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 40, (int64_t)reader_arr); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ ret_conv = *(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)(ret_ptr); + LDKCResult_EcdsaChannelSignerDecodeErrorZ ret_conv = *(LDKCResult_EcdsaChannelSignerDecodeErrorZ*)(ret_ptr); FREE(untag_ptr(ret)); return ret_conv; } @@ -7407,7 +7750,7 @@ LDKCResult_CVec_u8ZNoneZ get_destination_script_LDKSignerProvider_jcall(const vo LDKSignerProvider_JCalls *j_calls = (LDKSignerProvider_JCalls*) this_arg; int8_tArray channel_keys_id_arr = init_int8_tArray(32, __LINE__); memcpy(channel_keys_id_arr->elems, channel_keys_id.data, 32); - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 42, (int64_t)channel_keys_id_arr); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 41, (int64_t)channel_keys_id_arr); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_CVec_u8ZNoneZ ret_conv = *(LDKCResult_CVec_u8ZNoneZ*)(ret_ptr); @@ -7416,7 +7759,7 @@ LDKCResult_CVec_u8ZNoneZ get_destination_script_LDKSignerProvider_jcall(const vo } LDKCResult_ShutdownScriptNoneZ get_shutdown_scriptpubkey_LDKSignerProvider_jcall(const void* this_arg) { LDKSignerProvider_JCalls *j_calls = (LDKSignerProvider_JCalls*) this_arg; - uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 43); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 42); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_ShutdownScriptNoneZ ret_conv = *(LDKCResult_ShutdownScriptNoneZ*)(ret_ptr); @@ -7467,7 +7810,7 @@ int64_t CS_LDK_SignerProvider_derive_channel_signer(int64_t this_arg, int64_t c LDKThirtyTwoBytes channel_keys_id_ref; CHECK(channel_keys_id->arr_len == 32); memcpy(channel_keys_id_ref.data, channel_keys_id->elems, 32); FREE(channel_keys_id); - LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner"); + LDKEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner"); *ret_ret = (this_arg_conv->derive_channel_signer)(this_arg_conv->this_arg, channel_value_satoshis, channel_keys_id_ref); return tag_ptr(ret_ret, true); } @@ -7479,7 +7822,7 @@ int64_t CS_LDK_SignerProvider_read_chan_signer(int64_t this_arg, int8_tArray re LDKu8slice reader_ref; reader_ref.datalen = reader->arr_len; reader_ref.data = reader->elems; - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ), "LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ"); + LDKCResult_EcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_EcdsaChannelSignerDecodeErrorZ), "LDKCResult_EcdsaChannelSignerDecodeErrorZ"); *ret_conv = (this_arg_conv->read_chan_signer)(this_arg_conv->this_arg, reader_ref); FREE(reader); return tag_ptr(ret_conv, true); @@ -7519,7 +7862,7 @@ static void LDKFeeEstimator_JCalls_free(void* this_arg) { uint32_t get_est_sat_per_1000_weight_LDKFeeEstimator_jcall(const void* this_arg, LDKConfirmationTarget confirmation_target) { LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg; int32_t confirmation_target_conv = LDKConfirmationTarget_to_cs(confirmation_target); - return js_invoke_function_i_ConfirmationTarget(j_calls->instance_ptr, 44, confirmation_target_conv); + return js_invoke_function_i_ConfirmationTarget(j_calls->instance_ptr, 43, confirmation_target_conv); } static void LDKFeeEstimator_JCalls_cloned(LDKFeeEstimator* new_obj) { LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) new_obj->this_arg; @@ -7579,17 +7922,20 @@ LDKCResult_OnionMessagePathNoneZ find_path_LDKMessageRouter_jcall(const void* th LDKDestination *destination_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); *destination_copy = destination; int64_t destination_ref = tag_ptr(destination_copy, true); - uint64_t ret = js_invoke_function_l_lll(j_calls->instance_ptr, 45, (int64_t)sender_arr, (int64_t)peers_arr, destination_ref); + uint64_t ret = js_invoke_function_l_lll(j_calls->instance_ptr, 44, (int64_t)sender_arr, (int64_t)peers_arr, destination_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_OnionMessagePathNoneZ ret_conv = *(LDKCResult_OnionMessagePathNoneZ*)(ret_ptr); FREE(untag_ptr(ret)); return ret_conv; } -LDKCResult_CVec_BlindedPathZNoneZ create_blinded_paths_LDKMessageRouter_jcall(const void* this_arg, LDKPublicKey recipient, LDKCVec_PublicKeyZ peers) { +LDKCResult_CVec_BlindedMessagePathZNoneZ create_blinded_paths_LDKMessageRouter_jcall(const void* this_arg, LDKPublicKey recipient, LDKMessageContext context, LDKCVec_PublicKeyZ peers) { LDKMessageRouter_JCalls *j_calls = (LDKMessageRouter_JCalls*) this_arg; int8_tArray recipient_arr = init_int8_tArray(33, __LINE__); memcpy(recipient_arr->elems, recipient.compressed_form, 33); + LDKMessageContext *context_copy = MALLOC(sizeof(LDKMessageContext), "LDKMessageContext"); + *context_copy = context; + int64_t context_ref = tag_ptr(context_copy, true); LDKCVec_PublicKeyZ peers_var = peers; ptrArray peers_arr = NULL; peers_arr = init_ptrArray(peers_var.datalen, __LINE__); @@ -7601,10 +7947,37 @@ LDKCResult_CVec_BlindedPathZNoneZ create_blinded_paths_LDKMessageRouter_jcall(co } FREE(peers_var.data); - uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 46, (int64_t)recipient_arr, (int64_t)peers_arr); + uint64_t ret = js_invoke_function_l_lll(j_calls->instance_ptr, 45, (int64_t)recipient_arr, context_ref, (int64_t)peers_arr); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); - LDKCResult_CVec_BlindedPathZNoneZ ret_conv = *(LDKCResult_CVec_BlindedPathZNoneZ*)(ret_ptr); + LDKCResult_CVec_BlindedMessagePathZNoneZ ret_conv = *(LDKCResult_CVec_BlindedMessagePathZNoneZ*)(ret_ptr); + FREE(untag_ptr(ret)); + return ret_conv; +} +LDKCResult_CVec_BlindedMessagePathZNoneZ create_compact_blinded_paths_LDKMessageRouter_jcall(const void* this_arg, LDKPublicKey recipient, LDKMessageContext context, LDKCVec_MessageForwardNodeZ peers) { + LDKMessageRouter_JCalls *j_calls = (LDKMessageRouter_JCalls*) this_arg; + int8_tArray recipient_arr = init_int8_tArray(33, __LINE__); + memcpy(recipient_arr->elems, recipient.compressed_form, 33); + LDKMessageContext *context_copy = MALLOC(sizeof(LDKMessageContext), "LDKMessageContext"); + *context_copy = context; + int64_t context_ref = tag_ptr(context_copy, true); + LDKCVec_MessageForwardNodeZ peers_var = peers; + int64_tArray peers_arr = NULL; + peers_arr = init_int64_tArray(peers_var.datalen, __LINE__); + int64_t *peers_arr_ptr = (int64_t*)(((uint8_t*)peers_arr) + 8); + for (size_t u = 0; u < peers_var.datalen; u++) { + LDKMessageForwardNode peers_conv_20_var = peers_var.data[u]; + int64_t peers_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(peers_conv_20_var); + peers_conv_20_ref = tag_ptr(peers_conv_20_var.inner, peers_conv_20_var.is_owned); + peers_arr_ptr[u] = peers_conv_20_ref; + } + + FREE(peers_var.data); + uint64_t ret = js_invoke_function_l_lll(j_calls->instance_ptr, 46, (int64_t)recipient_arr, context_ref, (int64_t)peers_arr); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_CVec_BlindedMessagePathZNoneZ ret_conv = *(LDKCResult_CVec_BlindedMessagePathZNoneZ*)(ret_ptr); FREE(untag_ptr(ret)); return ret_conv; } @@ -7621,6 +7994,7 @@ static inline LDKMessageRouter LDKMessageRouter_init (int64_t o) { .this_arg = (void*) calls, .find_path = find_path_LDKMessageRouter_jcall, .create_blinded_paths = create_blinded_paths_LDKMessageRouter_jcall, + .create_compact_blinded_paths = create_compact_blinded_paths_LDKMessageRouter_jcall, .free = LDKMessageRouter_JCalls_free, }; return ret; @@ -7661,13 +8035,17 @@ int64_t CS_LDK_MessageRouter_find_path(int64_t this_arg, int8_tArray sender, pt return tag_ptr(ret_conv, true); } -int64_t CS_LDK_MessageRouter_create_blinded_paths(int64_t this_arg, int8_tArray recipient, ptrArray peers) { +int64_t CS_LDK_MessageRouter_create_blinded_paths(int64_t this_arg, int8_tArray recipient, int64_t context, ptrArray peers) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKMessageRouter* this_arg_conv = (LDKMessageRouter*)this_arg_ptr; LDKPublicKey recipient_ref; CHECK(recipient->arr_len == 33); memcpy(recipient_ref.compressed_form, recipient->elems, 33); FREE(recipient); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKMessageContext context_conv = *(LDKMessageContext*)(context_ptr); + context_conv = MessageContext_clone((LDKMessageContext*)untag_ptr(context)); LDKCVec_PublicKeyZ peers_constr; peers_constr.datalen = peers->arr_len; if (peers_constr.datalen > 0) @@ -7683,8 +8061,41 @@ int64_t CS_LDK_MessageRouter_create_blinded_paths(int64_t this_arg, int8_tArray peers_constr.data[i] = peers_conv_8_ref; } FREE(peers); - LDKCResult_CVec_BlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPathZNoneZ), "LDKCResult_CVec_BlindedPathZNoneZ"); - *ret_conv = (this_arg_conv->create_blinded_paths)(this_arg_conv->this_arg, recipient_ref, peers_constr); + LDKCResult_CVec_BlindedMessagePathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedMessagePathZNoneZ), "LDKCResult_CVec_BlindedMessagePathZNoneZ"); + *ret_conv = (this_arg_conv->create_blinded_paths)(this_arg_conv->this_arg, recipient_ref, context_conv, peers_constr); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_MessageRouter_create_compact_blinded_paths(int64_t this_arg, int8_tArray recipient, int64_t context, int64_tArray peers) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKMessageRouter* this_arg_conv = (LDKMessageRouter*)this_arg_ptr; + LDKPublicKey recipient_ref; + CHECK(recipient->arr_len == 33); + memcpy(recipient_ref.compressed_form, recipient->elems, 33); FREE(recipient); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKMessageContext context_conv = *(LDKMessageContext*)(context_ptr); + context_conv = MessageContext_clone((LDKMessageContext*)untag_ptr(context)); + LDKCVec_MessageForwardNodeZ peers_constr; + peers_constr.datalen = peers->arr_len; + if (peers_constr.datalen > 0) + peers_constr.data = MALLOC(peers_constr.datalen * sizeof(LDKMessageForwardNode), "LDKCVec_MessageForwardNodeZ Elements"); + else + peers_constr.data = NULL; + int64_t* peers_vals = peers->elems; + for (size_t u = 0; u < peers_constr.datalen; u++) { + int64_t peers_conv_20 = peers_vals[u]; + LDKMessageForwardNode peers_conv_20_conv; + peers_conv_20_conv.inner = untag_ptr(peers_conv_20); + peers_conv_20_conv.is_owned = ptr_is_owned(peers_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(peers_conv_20_conv); + peers_conv_20_conv = MessageForwardNode_clone(&peers_conv_20_conv); + peers_constr.data[u] = peers_conv_20_conv; + } + FREE(peers); + LDKCResult_CVec_BlindedMessagePathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedMessagePathZNoneZ), "LDKCResult_CVec_BlindedMessagePathZNoneZ"); + *ret_conv = (this_arg_conv->create_compact_blinded_paths)(this_arg_conv->this_arg, recipient_ref, context_conv, peers_constr); return tag_ptr(ret_conv, true); } @@ -7773,7 +8184,7 @@ LDKCResult_RouteLightningErrorZ find_route_with_id_LDKRouter_jcall(const void* t FREE(untag_ptr(ret)); return ret_conv; } -LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ create_blinded_payment_paths_LDKRouter_jcall(const void* this_arg, LDKPublicKey recipient, LDKCVec_ChannelDetailsZ first_hops, LDKReceiveTlvs tlvs, uint64_t amount_msats) { +LDKCResult_CVec_BlindedPaymentPathZNoneZ create_blinded_payment_paths_LDKRouter_jcall(const void* this_arg, LDKPublicKey recipient, LDKCVec_ChannelDetailsZ first_hops, LDKReceiveTlvs tlvs, uint64_t amount_msats) { LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg; int8_tArray recipient_arr = init_int8_tArray(33, __LINE__); memcpy(recipient_arr->elems, recipient.compressed_form, 33); @@ -7798,7 +8209,7 @@ LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ create_blinded_payment_ uint64_t ret = js_invoke_function_l_llll(j_calls->instance_ptr, 49, (int64_t)recipient_arr, (int64_t)first_hops_arr, tlvs_ref, amount_msats_conv); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ ret_conv = *(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ*)(ret_ptr); + LDKCResult_CVec_BlindedPaymentPathZNoneZ ret_conv = *(LDKCResult_CVec_BlindedPaymentPathZNoneZ*)(ret_ptr); FREE(untag_ptr(ret)); return ret_conv; } @@ -7951,7 +8362,7 @@ int64_t CS_LDK_Router_create_blinded_payment_paths(int64_t this_arg, int8_tArra tlvs_conv.is_owned = ptr_is_owned(tlvs); CHECK_INNER_FIELD_ACCESS_OR_NULL(tlvs_conv); tlvs_conv = ReceiveTlvs_clone(&tlvs_conv); - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ), "LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ"); + LDKCResult_CVec_BlindedPaymentPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPaymentPathZNoneZ), "LDKCResult_CVec_BlindedPaymentPathZNoneZ"); *ret_conv = (this_arg_conv->create_blinded_payment_paths)(this_arg_conv->this_arg, recipient_ref, first_hops_constr, tlvs_conv, amount_msats); return tag_ptr(ret_conv, true); } @@ -8304,6 +8715,29 @@ static inline LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ CVec_C2 } return ret; } +static inline void CResult_NoneReplayEventZ_get_ok(LDKCResult_NoneReplayEventZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; +} +void CS_LDK_CResult_NoneReplayEventZ_get_ok(int64_t owner) { + LDKCResult_NoneReplayEventZ* owner_conv = (LDKCResult_NoneReplayEventZ*)untag_ptr(owner); + CResult_NoneReplayEventZ_get_ok(owner_conv); +} + +static inline struct LDKReplayEvent CResult_NoneReplayEventZ_get_err(LDKCResult_NoneReplayEventZ *NONNULL_PTR owner){ + LDKReplayEvent ret = *owner->contents.err; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_NoneReplayEventZ_get_err(int64_t owner) { + LDKCResult_NoneReplayEventZ* owner_conv = (LDKCResult_NoneReplayEventZ*)untag_ptr(owner); + LDKReplayEvent ret_var = CResult_NoneReplayEventZ_get_err(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_CommitmentTransactionZ CVec_CommitmentTransactionZ_clone(const LDKCVec_CommitmentTransactionZ *orig) { LDKCVec_CommitmentTransactionZ ret = { .data = MALLOC(sizeof(LDKCommitmentTransaction) * orig->datalen, "LDKCVec_CommitmentTransactionZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -8391,6 +8825,36 @@ int64_t CS_LDK_LDKBalance_ClaimableOnChannelClose_get_amount_satoshis(int64_t pt int64_t amount_satoshis_conv = obj->claimable_on_channel_close.amount_satoshis; return amount_satoshis_conv; } +int64_t CS_LDK_LDKBalance_ClaimableOnChannelClose_get_transaction_fee_satoshis(int64_t ptr) { + LDKBalance *obj = (LDKBalance*)untag_ptr(ptr); + CHECK(obj->tag == LDKBalance_ClaimableOnChannelClose); + int64_t transaction_fee_satoshis_conv = obj->claimable_on_channel_close.transaction_fee_satoshis; + return transaction_fee_satoshis_conv; +} +int64_t CS_LDK_LDKBalance_ClaimableOnChannelClose_get_outbound_payment_htlc_rounded_msat(int64_t ptr) { + LDKBalance *obj = (LDKBalance*)untag_ptr(ptr); + CHECK(obj->tag == LDKBalance_ClaimableOnChannelClose); + int64_t outbound_payment_htlc_rounded_msat_conv = obj->claimable_on_channel_close.outbound_payment_htlc_rounded_msat; + return outbound_payment_htlc_rounded_msat_conv; +} +int64_t CS_LDK_LDKBalance_ClaimableOnChannelClose_get_outbound_forwarded_htlc_rounded_msat(int64_t ptr) { + LDKBalance *obj = (LDKBalance*)untag_ptr(ptr); + CHECK(obj->tag == LDKBalance_ClaimableOnChannelClose); + int64_t outbound_forwarded_htlc_rounded_msat_conv = obj->claimable_on_channel_close.outbound_forwarded_htlc_rounded_msat; + return outbound_forwarded_htlc_rounded_msat_conv; +} +int64_t CS_LDK_LDKBalance_ClaimableOnChannelClose_get_inbound_claiming_htlc_rounded_msat(int64_t ptr) { + LDKBalance *obj = (LDKBalance*)untag_ptr(ptr); + CHECK(obj->tag == LDKBalance_ClaimableOnChannelClose); + int64_t inbound_claiming_htlc_rounded_msat_conv = obj->claimable_on_channel_close.inbound_claiming_htlc_rounded_msat; + return inbound_claiming_htlc_rounded_msat_conv; +} +int64_t CS_LDK_LDKBalance_ClaimableOnChannelClose_get_inbound_htlc_rounded_msat(int64_t ptr) { + LDKBalance *obj = (LDKBalance*)untag_ptr(ptr); + CHECK(obj->tag == LDKBalance_ClaimableOnChannelClose); + int64_t inbound_htlc_rounded_msat_conv = obj->claimable_on_channel_close.inbound_htlc_rounded_msat; + return inbound_htlc_rounded_msat_conv; +} int64_t CS_LDK_LDKBalance_ClaimableAwaitingConfirmations_get_amount_satoshis(int64_t ptr) { LDKBalance *obj = (LDKBalance*)untag_ptr(ptr); CHECK(obj->tag == LDKBalance_ClaimableAwaitingConfirmations); @@ -8403,6 +8867,12 @@ int32_t CS_LDK_LDKBalance_ClaimableAwaitingConfirmations_get_confirmation_height int32_t confirmation_height_conv = obj->claimable_awaiting_confirmations.confirmation_height; return confirmation_height_conv; } +int32_t CS_LDK_LDKBalance_ClaimableAwaitingConfirmations_get_source(int64_t ptr) { + LDKBalance *obj = (LDKBalance*)untag_ptr(ptr); + CHECK(obj->tag == LDKBalance_ClaimableAwaitingConfirmations); + int32_t source_conv = LDKBalanceSource_to_cs(obj->claimable_awaiting_confirmations.source); + return source_conv; +} int64_t CS_LDK_LDKBalance_ContentiousClaimable_get_amount_satoshis(int64_t ptr) { LDKBalance *obj = (LDKBalance*)untag_ptr(ptr); CHECK(obj->tag == LDKBalance_ContentiousClaimable); @@ -8448,6 +8918,12 @@ int8_tArray CS_LDK_LDKBalance_MaybeTimeoutClaimableHTLC_get_payment_hash(int64_t memcpy(payment_hash_arr->elems, obj->maybe_timeout_claimable_htlc.payment_hash.data, 32); return payment_hash_arr; } +jboolean CS_LDK_LDKBalance_MaybeTimeoutClaimableHTLC_get_outbound_payment(int64_t ptr) { + LDKBalance *obj = (LDKBalance*)untag_ptr(ptr); + CHECK(obj->tag == LDKBalance_MaybeTimeoutClaimableHTLC); + jboolean outbound_payment_conv = obj->maybe_timeout_claimable_htlc.outbound_payment; + return outbound_payment_conv; +} int64_t CS_LDK_LDKBalance_MaybePreimageClaimableHTLC_get_amount_satoshis(int64_t ptr) { LDKBalance *obj = (LDKBalance*)untag_ptr(ptr); CHECK(obj->tag == LDKBalance_MaybePreimageClaimableHTLC); @@ -8636,43 +9112,6 @@ static inline LDKCVec_C2Tuple_PublicKeyTypeZZ CVec_C2Tuple_PublicKeyTypeZZ_clone } return ret; } -static inline struct LDKPublicKey C2Tuple_PublicKeyCVec_SocketAddressZZ_get_a(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *NONNULL_PTR owner){ - return owner->a; -} -int8_tArray CS_LDK_C2Tuple_PublicKeyCVec_SocketAddressZZ_get_a(int64_t owner) { - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* owner_conv = (LDKC2Tuple_PublicKeyCVec_SocketAddressZZ*)untag_ptr(owner); - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, C2Tuple_PublicKeyCVec_SocketAddressZZ_get_a(owner_conv).compressed_form, 33); - return ret_arr; -} - -static inline struct LDKCVec_SocketAddressZ C2Tuple_PublicKeyCVec_SocketAddressZZ_get_b(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *NONNULL_PTR owner){ - return CVec_SocketAddressZ_clone(&owner->b); -} -int64_tArray CS_LDK_C2Tuple_PublicKeyCVec_SocketAddressZZ_get_b(int64_t owner) { - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* owner_conv = (LDKC2Tuple_PublicKeyCVec_SocketAddressZZ*)untag_ptr(owner); - LDKCVec_SocketAddressZ ret_var = C2Tuple_PublicKeyCVec_SocketAddressZZ_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 p = 0; p < ret_var.datalen; p++) { - LDKSocketAddress *ret_conv_15_copy = MALLOC(sizeof(LDKSocketAddress), "LDKSocketAddress"); - *ret_conv_15_copy = ret_var.data[p]; - int64_t ret_conv_15_ref = tag_ptr(ret_conv_15_copy, true); - ret_arr_ptr[p] = ret_conv_15_ref; - } - - FREE(ret_var.data); - return ret_arr; -} - -static inline LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ CVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ_clone(const LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ *orig) { - LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ) * orig->datalen, "LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C2Tuple_PublicKeyCVec_SocketAddressZZ_clone(&orig->data[i]); - } - return ret; -} typedef struct LDKOnionMessageContents_JCalls { atomic_size_t refcnt; uint32_t instance_ptr; @@ -8687,9 +9126,15 @@ uint64_t tlv_type_LDKOnionMessageContents_jcall(const void* this_arg) { LDKOnionMessageContents_JCalls *j_calls = (LDKOnionMessageContents_JCalls*) this_arg; return js_invoke_function_l_(j_calls->instance_ptr, 53); } +LDKStr msg_type_LDKOnionMessageContents_jcall(const void* this_arg) { + LDKOnionMessageContents_JCalls *j_calls = (LDKOnionMessageContents_JCalls*) this_arg; + jstring ret = (jstring)js_invoke_function_l_(j_calls->instance_ptr, 54); + LDKStr ret_conv = str_ref_to_owned_c(ret); + return ret_conv; +} LDKCVec_u8Z write_LDKOnionMessageContents_jcall(const void* this_arg) { LDKOnionMessageContents_JCalls *j_calls = (LDKOnionMessageContents_JCalls*) this_arg; - int8_tArray ret = (int8_tArray)js_invoke_function_l_(j_calls->instance_ptr, 54); + int8_tArray ret = (int8_tArray)js_invoke_function_l_(j_calls->instance_ptr, 55); LDKCVec_u8Z ret_ref; ret_ref.datalen = ret->arr_len; ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes"); @@ -8698,7 +9143,7 @@ LDKCVec_u8Z write_LDKOnionMessageContents_jcall(const void* this_arg) { } LDKStr debug_str_LDKOnionMessageContents_jcall(const void* this_arg) { LDKOnionMessageContents_JCalls *j_calls = (LDKOnionMessageContents_JCalls*) this_arg; - jstring ret = (jstring)js_invoke_function_l_(j_calls->instance_ptr, 55); + jstring ret = (jstring)js_invoke_function_l_(j_calls->instance_ptr, 56); LDKStr ret_conv = str_ref_to_owned_c(ret); return ret_conv; } @@ -8714,6 +9159,7 @@ static inline LDKOnionMessageContents LDKOnionMessageContents_init (int64_t o) { LDKOnionMessageContents ret = { .this_arg = (void*) calls, .tlv_type = tlv_type_LDKOnionMessageContents_jcall, + .msg_type = msg_type_LDKOnionMessageContents_jcall, .write = write_LDKOnionMessageContents_jcall, .debug_str = debug_str_LDKOnionMessageContents_jcall, .cloned = LDKOnionMessageContents_JCalls_cloned, @@ -8734,6 +9180,16 @@ int64_t CS_LDK_OnionMessageContents_tlv_type(int64_t this_arg) { return ret_conv; } +jstring CS_LDK_OnionMessageContents_msg_type(int64_t this_arg) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKOnionMessageContents* this_arg_conv = (LDKOnionMessageContents*)this_arg_ptr; + LDKStr ret_str = (this_arg_conv->msg_type)(this_arg_conv->this_arg); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + int8_tArray CS_LDK_OnionMessageContents_write(int64_t this_arg) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } @@ -8755,6 +9211,46 @@ jstring CS_LDK_OnionMessageContents_debug_str(int64_t this_arg) { return ret_conv; } +static inline struct LDKOnionMessageContents C2Tuple_OnionMessageContentsResponseInstructionZ_get_a(LDKC2Tuple_OnionMessageContentsResponseInstructionZ *NONNULL_PTR owner){ + return OnionMessageContents_clone(&owner->a); +} +int64_t CS_LDK_C2Tuple_OnionMessageContentsResponseInstructionZ_get_a(int64_t owner) { + LDKC2Tuple_OnionMessageContentsResponseInstructionZ* owner_conv = (LDKC2Tuple_OnionMessageContentsResponseInstructionZ*)untag_ptr(owner); + LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *ret_ret = C2Tuple_OnionMessageContentsResponseInstructionZ_get_a(owner_conv); + return tag_ptr(ret_ret, true); +} + +static inline struct LDKResponseInstruction C2Tuple_OnionMessageContentsResponseInstructionZ_get_b(LDKC2Tuple_OnionMessageContentsResponseInstructionZ *NONNULL_PTR owner){ + LDKResponseInstruction ret = owner->b; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_C2Tuple_OnionMessageContentsResponseInstructionZ_get_b(int64_t owner) { + LDKC2Tuple_OnionMessageContentsResponseInstructionZ* owner_conv = (LDKC2Tuple_OnionMessageContentsResponseInstructionZ*)untag_ptr(owner); + LDKResponseInstruction ret_var = C2Tuple_OnionMessageContentsResponseInstructionZ_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; +} + +uint32_t CS_LDK_LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_ty_from_ptr(int64_t ptr) { + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ *obj = (LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Some: return 0; + case LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_None: return 1; + default: abort(); + } +} +int64_t CS_LDK_LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Some_get_some(int64_t ptr) { + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ *obj = (LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ*)untag_ptr(ptr); + CHECK(obj->tag == LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Some); + LDKC2Tuple_OnionMessageContentsResponseInstructionZ* some_conv = MALLOC(sizeof(LDKC2Tuple_OnionMessageContentsResponseInstructionZ), "LDKC2Tuple_OnionMessageContentsResponseInstructionZ"); + *some_conv = obj->some; + *some_conv = C2Tuple_OnionMessageContentsResponseInstructionZ_clone(some_conv); + return tag_ptr(some_conv, true); +} uint32_t CS_LDK_LDKCOption_OnionMessageContentsZ_ty_from_ptr(int64_t ptr) { LDKCOption_OnionMessageContentsZ *obj = (LDKCOption_OnionMessageContentsZ*)untag_ptr(ptr); switch(obj->tag) { @@ -8794,45 +9290,31 @@ int64_t CS_LDK_CResult_COption_OnionMessageContentsZDecodeErrorZ_get_err(int64_ return ret_ref; } -static inline struct LDKOnionMessageContents C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_a(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *NONNULL_PTR owner){ +static inline struct LDKOnionMessageContents C2Tuple_OnionMessageContentsMessageSendInstructionsZ_get_a(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ *NONNULL_PTR owner){ return OnionMessageContents_clone(&owner->a); } -int64_t CS_LDK_C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_a(int64_t owner) { - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ* owner_conv = (LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ*)untag_ptr(owner); +int64_t CS_LDK_C2Tuple_OnionMessageContentsMessageSendInstructionsZ_get_a(int64_t owner) { + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ* owner_conv = (LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ*)untag_ptr(owner); LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); - *ret_ret = C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_a(owner_conv); + *ret_ret = C2Tuple_OnionMessageContentsMessageSendInstructionsZ_get_a(owner_conv); return tag_ptr(ret_ret, true); } -static inline struct LDKDestination C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_b(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *NONNULL_PTR owner){ - return Destination_clone(&owner->b); +static inline struct LDKMessageSendInstructions C2Tuple_OnionMessageContentsMessageSendInstructionsZ_get_b(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ *NONNULL_PTR owner){ + return MessageSendInstructions_clone(&owner->b); } -int64_t CS_LDK_C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_b(int64_t owner) { - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ* owner_conv = (LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ*)untag_ptr(owner); - LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); - *ret_copy = C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_b(owner_conv); +int64_t CS_LDK_C2Tuple_OnionMessageContentsMessageSendInstructionsZ_get_b(int64_t owner) { + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ* owner_conv = (LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ*)untag_ptr(owner); + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = C2Tuple_OnionMessageContentsMessageSendInstructionsZ_get_b(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline struct LDKBlindedPath C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_c(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *NONNULL_PTR owner){ - LDKBlindedPath ret = owner->c; - ret.is_owned = false; - return ret; -} -int64_t CS_LDK_C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_c(int64_t owner) { - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ* owner_conv = (LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ*)untag_ptr(owner); - LDKBlindedPath ret_var = C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_c(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_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ CVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ_clone(const LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ *orig) { - LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ) * orig->datalen, "LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ clone bytes"), .datalen = orig->datalen }; +static inline LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ CVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ_clone(const LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ *orig) { + LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ) * orig->datalen, "LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone(&orig->data[i]); + ret.data[i] = C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone(&orig->data[i]); } return ret; } @@ -9166,21 +9648,6 @@ int32_t CS_LDK_CResult_InvoiceRequestBolt12SemanticErrorZ_get_err(int64_t owner 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) { - case LDKCOption_SecretKeyZ_Some: return 0; - case LDKCOption_SecretKeyZ_None: return 1; - default: abort(); - } -} -int8_tArray CS_LDK_LDKCOption_SecretKeyZ_Some_get_some(int64_t ptr) { - LDKCOption_SecretKeyZ *obj = (LDKCOption_SecretKeyZ*)untag_ptr(ptr); - CHECK(obj->tag == LDKCOption_SecretKeyZ_Some); - int8_tArray some_arr = init_int8_tArray(32, __LINE__); - 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; @@ -9466,28 +9933,28 @@ int64_t CS_LDK_CResult_StfuDecodeErrorZ_get_err(int64_t owner) { return ret_ref; } -static inline struct LDKSplice CResult_SpliceDecodeErrorZ_get_ok(LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR owner){ - LDKSplice ret = *owner->contents.result; +static inline struct LDKSpliceInit CResult_SpliceInitDecodeErrorZ_get_ok(LDKCResult_SpliceInitDecodeErrorZ *NONNULL_PTR owner){ + LDKSpliceInit ret = *owner->contents.result; ret.is_owned = false; return ret; } -int64_t CS_LDK_CResult_SpliceDecodeErrorZ_get_ok(int64_t owner) { - LDKCResult_SpliceDecodeErrorZ* owner_conv = (LDKCResult_SpliceDecodeErrorZ*)untag_ptr(owner); - LDKSplice ret_var = CResult_SpliceDecodeErrorZ_get_ok(owner_conv); +int64_t CS_LDK_CResult_SpliceInitDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_SpliceInitDecodeErrorZ* owner_conv = (LDKCResult_SpliceInitDecodeErrorZ*)untag_ptr(owner); + LDKSpliceInit ret_var = CResult_SpliceInitDecodeErrorZ_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_SpliceDecodeErrorZ_get_err(LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_SpliceInitDecodeErrorZ_get_err(LDKCResult_SpliceInitDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return DecodeError_clone(&*owner->contents.err); } -int64_t CS_LDK_CResult_SpliceDecodeErrorZ_get_err(int64_t owner) { - LDKCResult_SpliceDecodeErrorZ* owner_conv = (LDKCResult_SpliceDecodeErrorZ*)untag_ptr(owner); +int64_t CS_LDK_CResult_SpliceInitDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_SpliceInitDecodeErrorZ* owner_conv = (LDKCResult_SpliceInitDecodeErrorZ*)untag_ptr(owner); LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_SpliceDecodeErrorZ_get_err(owner_conv); + *ret_copy = CResult_SpliceInitDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -9882,6 +10349,32 @@ int64_t CS_LDK_CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(int64_t owner) return ret_ref; } +static inline struct LDKCommitmentSignedBatch CResult_CommitmentSignedBatchDecodeErrorZ_get_ok(LDKCResult_CommitmentSignedBatchDecodeErrorZ *NONNULL_PTR owner){ + LDKCommitmentSignedBatch ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_CommitmentSignedBatchDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_CommitmentSignedBatchDecodeErrorZ* owner_conv = (LDKCResult_CommitmentSignedBatchDecodeErrorZ*)untag_ptr(owner); + LDKCommitmentSignedBatch ret_var = CResult_CommitmentSignedBatchDecodeErrorZ_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_CommitmentSignedBatchDecodeErrorZ_get_err(LDKCResult_CommitmentSignedBatchDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_CommitmentSignedBatchDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_CommitmentSignedBatchDecodeErrorZ* owner_conv = (LDKCResult_CommitmentSignedBatchDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_CommitmentSignedBatchDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline struct LDKCommitmentSigned CResult_CommitmentSignedDecodeErrorZ_get_ok(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR owner){ LDKCommitmentSigned ret = *owner->contents.result; ret.is_owned = false; @@ -10714,53 +11207,6 @@ int64_t CS_LDK_CResult_GossipTimestampFilterDecodeErrorZ_get_err(int64_t owner) return ret_ref; } -static inline LDKCVec_PhantomRouteHintsZ CVec_PhantomRouteHintsZ_clone(const LDKCVec_PhantomRouteHintsZ *orig) { - LDKCVec_PhantomRouteHintsZ ret = { .data = MALLOC(sizeof(LDKPhantomRouteHints) * orig->datalen, "LDKCVec_PhantomRouteHintsZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = PhantomRouteHints_clone(&orig->data[i]); - } - return ret; -} -uint32_t CS_LDK_LDKSignOrCreationError_ty_from_ptr(int64_t ptr) { - LDKSignOrCreationError *obj = (LDKSignOrCreationError*)untag_ptr(ptr); - switch(obj->tag) { - case LDKSignOrCreationError_SignError: return 0; - case LDKSignOrCreationError_CreationError: return 1; - default: abort(); - } -} -int32_t CS_LDK_LDKSignOrCreationError_CreationError_get_creation_error(int64_t ptr) { - LDKSignOrCreationError *obj = (LDKSignOrCreationError*)untag_ptr(ptr); - CHECK(obj->tag == LDKSignOrCreationError_CreationError); - int32_t creation_error_conv = LDKCreationError_to_cs(obj->creation_error); - return creation_error_conv; -} -static inline struct LDKBolt11Invoice CResult_Bolt11InvoiceSignOrCreationErrorZ_get_ok(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){ - LDKBolt11Invoice ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -int64_t CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_get_ok(int64_t owner) { - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(owner); - LDKBolt11Invoice ret_var = CResult_Bolt11InvoiceSignOrCreationErrorZ_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 LDKSignOrCreationError CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return SignOrCreationError_clone(&*owner->contents.err); -} -int64_t CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err(int64_t owner) { - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(owner); - LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError"); - *ret_copy = CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - uint32_t CS_LDK_LDKCOption_InboundHTLCStateDetailsZ_ty_from_ptr(int64_t ptr) { LDKCOption_InboundHTLCStateDetailsZ *obj = (LDKCOption_InboundHTLCStateDetailsZ*)untag_ptr(ptr); switch(obj->tag) { @@ -11017,6 +11463,82 @@ int64_t CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_get_err(int64_t owner) return ret_ref; } +static inline struct LDKHeldHtlcAvailable CResult_HeldHtlcAvailableDecodeErrorZ_get_ok(LDKCResult_HeldHtlcAvailableDecodeErrorZ *NONNULL_PTR owner){ + LDKHeldHtlcAvailable ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_HeldHtlcAvailableDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_HeldHtlcAvailableDecodeErrorZ* owner_conv = (LDKCResult_HeldHtlcAvailableDecodeErrorZ*)untag_ptr(owner); + LDKHeldHtlcAvailable ret_var = CResult_HeldHtlcAvailableDecodeErrorZ_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_HeldHtlcAvailableDecodeErrorZ_get_err(LDKCResult_HeldHtlcAvailableDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_HeldHtlcAvailableDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_HeldHtlcAvailableDecodeErrorZ* owner_conv = (LDKCResult_HeldHtlcAvailableDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_HeldHtlcAvailableDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKReleaseHeldHtlc CResult_ReleaseHeldHtlcDecodeErrorZ_get_ok(LDKCResult_ReleaseHeldHtlcDecodeErrorZ *NONNULL_PTR owner){ + LDKReleaseHeldHtlc ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_ReleaseHeldHtlcDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* owner_conv = (LDKCResult_ReleaseHeldHtlcDecodeErrorZ*)untag_ptr(owner); + LDKReleaseHeldHtlc ret_var = CResult_ReleaseHeldHtlcDecodeErrorZ_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_ReleaseHeldHtlcDecodeErrorZ_get_err(LDKCResult_ReleaseHeldHtlcDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_ReleaseHeldHtlcDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* owner_conv = (LDKCResult_ReleaseHeldHtlcDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ReleaseHeldHtlcDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKAsyncPaymentsMessage CResult_AsyncPaymentsMessageDecodeErrorZ_get_ok(LDKCResult_AsyncPaymentsMessageDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return AsyncPaymentsMessage_clone(&*owner->contents.result); +} +int64_t CS_LDK_CResult_AsyncPaymentsMessageDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* owner_conv = (LDKCResult_AsyncPaymentsMessageDecodeErrorZ*)untag_ptr(owner); + LDKAsyncPaymentsMessage *ret_copy = MALLOC(sizeof(LDKAsyncPaymentsMessage), "LDKAsyncPaymentsMessage"); + *ret_copy = CResult_AsyncPaymentsMessageDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_AsyncPaymentsMessageDecodeErrorZ_get_err(LDKCResult_AsyncPaymentsMessageDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_AsyncPaymentsMessageDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* owner_conv = (LDKCResult_AsyncPaymentsMessageDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_AsyncPaymentsMessageDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline struct LDKOffersMessage CResult_OffersMessageDecodeErrorZ_get_ok(LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return OffersMessage_clone(&*owner->contents.result); @@ -11431,6 +11953,55 @@ int64_t CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(int64_t own return ret_ref; } +uint32_t CS_LDK_LDKFundingInfo_ty_from_ptr(int64_t ptr) { + LDKFundingInfo *obj = (LDKFundingInfo*)untag_ptr(ptr); + switch(obj->tag) { + case LDKFundingInfo_Tx: return 0; + case LDKFundingInfo_OutPoint: return 1; + default: abort(); + } +} +int8_tArray CS_LDK_LDKFundingInfo_Tx_get_transaction(int64_t ptr) { + LDKFundingInfo *obj = (LDKFundingInfo*)untag_ptr(ptr); + CHECK(obj->tag == LDKFundingInfo_Tx); + LDKTransaction transaction_var = obj->tx.transaction; + int8_tArray transaction_arr = init_int8_tArray(transaction_var.datalen, __LINE__); + memcpy(transaction_arr->elems, transaction_var.data, transaction_var.datalen); + return transaction_arr; +} +int64_t CS_LDK_LDKFundingInfo_OutPoint_get_outpoint(int64_t ptr) { + LDKFundingInfo *obj = (LDKFundingInfo*)untag_ptr(ptr); + CHECK(obj->tag == LDKFundingInfo_OutPoint); + LDKOutPoint outpoint_var = obj->out_point.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; +} +static inline struct LDKFundingInfo CResult_FundingInfoDecodeErrorZ_get_ok(LDKCResult_FundingInfoDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return FundingInfo_clone(&*owner->contents.result); +} +int64_t CS_LDK_CResult_FundingInfoDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_FundingInfoDecodeErrorZ* owner_conv = (LDKCResult_FundingInfoDecodeErrorZ*)untag_ptr(owner); + LDKFundingInfo *ret_copy = MALLOC(sizeof(LDKFundingInfo), "LDKFundingInfo"); + *ret_copy = CResult_FundingInfoDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_FundingInfoDecodeErrorZ_get_err(LDKCResult_FundingInfoDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_FundingInfoDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_FundingInfoDecodeErrorZ* owner_conv = (LDKCResult_FundingInfoDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_FundingInfoDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + uint32_t CS_LDK_LDKPaymentPurpose_ty_from_ptr(int64_t ptr) { LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); switch(obj->tag) { @@ -11735,24 +12306,40 @@ int64_t CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(int64_t own return ret_ref; } -static inline enum LDKPaymentFailureReason CResult_PaymentFailureReasonDecodeErrorZ_get_ok(LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR owner){ +uint32_t CS_LDK_LDKCOption_PaymentFailureReasonZ_ty_from_ptr(int64_t ptr) { + LDKCOption_PaymentFailureReasonZ *obj = (LDKCOption_PaymentFailureReasonZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_PaymentFailureReasonZ_Some: return 0; + case LDKCOption_PaymentFailureReasonZ_None: return 1; + default: abort(); + } +} +int32_t CS_LDK_LDKCOption_PaymentFailureReasonZ_Some_get_some(int64_t ptr) { + LDKCOption_PaymentFailureReasonZ *obj = (LDKCOption_PaymentFailureReasonZ*)untag_ptr(ptr); + CHECK(obj->tag == LDKCOption_PaymentFailureReasonZ_Some); + int32_t some_conv = LDKPaymentFailureReason_to_cs(obj->some); + return some_conv; +} +static inline struct LDKCOption_PaymentFailureReasonZ CResult_COption_PaymentFailureReasonZDecodeErrorZ_get_ok(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return PaymentFailureReason_clone(&*owner->contents.result); + return COption_PaymentFailureReasonZ_clone(&*owner->contents.result); } -int32_t CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_get_ok(int64_t owner) { - LDKCResult_PaymentFailureReasonDecodeErrorZ* owner_conv = (LDKCResult_PaymentFailureReasonDecodeErrorZ*)untag_ptr(owner); - int32_t ret_conv = LDKPaymentFailureReason_to_cs(CResult_PaymentFailureReasonDecodeErrorZ_get_ok(owner_conv)); - return ret_conv; +int64_t CS_LDK_CResult_COption_PaymentFailureReasonZDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* owner_conv = (LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ*)untag_ptr(owner); + LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); + *ret_copy = CResult_COption_PaymentFailureReasonZDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -static inline struct LDKDecodeError CResult_PaymentFailureReasonDecodeErrorZ_get_err(LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_COption_PaymentFailureReasonZDecodeErrorZ_get_err(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return DecodeError_clone(&*owner->contents.err); } -int64_t CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_get_err(int64_t owner) { - LDKCResult_PaymentFailureReasonDecodeErrorZ* owner_conv = (LDKCResult_PaymentFailureReasonDecodeErrorZ*)untag_ptr(owner); +int64_t CS_LDK_CResult_COption_PaymentFailureReasonZDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* owner_conv = (LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ*)untag_ptr(owner); LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_PaymentFailureReasonDecodeErrorZ_get_err(owner_conv); + *ret_copy = CResult_COption_PaymentFailureReasonZDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -11779,20 +12366,6 @@ static inline LDKCVec_ClaimedHTLCZ CVec_ClaimedHTLCZ_clone(const LDKCVec_Claimed } return ret; } -uint32_t CS_LDK_LDKCOption_PaymentFailureReasonZ_ty_from_ptr(int64_t ptr) { - LDKCOption_PaymentFailureReasonZ *obj = (LDKCOption_PaymentFailureReasonZ*)untag_ptr(ptr); - switch(obj->tag) { - case LDKCOption_PaymentFailureReasonZ_Some: return 0; - case LDKCOption_PaymentFailureReasonZ_None: return 1; - default: abort(); - } -} -int32_t CS_LDK_LDKCOption_PaymentFailureReasonZ_Some_get_some(int64_t ptr) { - LDKCOption_PaymentFailureReasonZ *obj = (LDKCOption_PaymentFailureReasonZ*)untag_ptr(ptr); - CHECK(obj->tag == LDKCOption_PaymentFailureReasonZ_Some); - int32_t some_conv = LDKPaymentFailureReason_to_cs(obj->some); - return some_conv; -} uint32_t CS_LDK_LDKBumpTransactionEvent_ty_from_ptr(int64_t ptr) { LDKBumpTransactionEvent *obj = (LDKBumpTransactionEvent*)untag_ptr(ptr); switch(obj->tag) { @@ -11926,27 +12499,30 @@ uint32_t CS_LDK_LDKEvent_ty_from_ptr(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); switch(obj->tag) { case LDKEvent_FundingGenerationReady: return 0; - case LDKEvent_PaymentClaimable: return 1; - case LDKEvent_PaymentClaimed: return 2; - case LDKEvent_ConnectionNeeded: return 3; - case LDKEvent_InvoiceRequestFailed: return 4; - case LDKEvent_PaymentSent: return 5; - case LDKEvent_PaymentFailed: return 6; - case LDKEvent_PaymentPathSuccessful: return 7; - case LDKEvent_PaymentPathFailed: return 8; - case LDKEvent_ProbeSuccessful: return 9; - case LDKEvent_ProbeFailed: return 10; - case LDKEvent_PendingHTLCsForwardable: return 11; - case LDKEvent_HTLCIntercepted: return 12; - case LDKEvent_SpendableOutputs: return 13; - case LDKEvent_PaymentForwarded: return 14; - case LDKEvent_ChannelPending: return 15; - case LDKEvent_ChannelReady: return 16; - case LDKEvent_ChannelClosed: return 17; - case LDKEvent_DiscardFunding: return 18; - case LDKEvent_OpenChannelRequest: return 19; - case LDKEvent_HTLCHandlingFailed: return 20; - case LDKEvent_BumpTransaction: return 21; + case LDKEvent_FundingTxBroadcastSafe: return 1; + case LDKEvent_PaymentClaimable: return 2; + case LDKEvent_PaymentClaimed: return 3; + case LDKEvent_ConnectionNeeded: return 4; + case LDKEvent_InvoiceReceived: return 5; + case LDKEvent_PaymentSent: return 6; + case LDKEvent_PaymentFailed: return 7; + case LDKEvent_PaymentPathSuccessful: return 8; + case LDKEvent_PaymentPathFailed: return 9; + case LDKEvent_ProbeSuccessful: return 10; + case LDKEvent_ProbeFailed: return 11; + case LDKEvent_PendingHTLCsForwardable: return 12; + case LDKEvent_HTLCIntercepted: return 13; + case LDKEvent_SpendableOutputs: return 14; + case LDKEvent_PaymentForwarded: return 15; + case LDKEvent_ChannelPending: return 16; + case LDKEvent_ChannelReady: return 17; + case LDKEvent_ChannelClosed: return 18; + case LDKEvent_DiscardFunding: return 19; + case LDKEvent_OpenChannelRequest: return 20; + case LDKEvent_HTLCHandlingFailed: return 21; + case LDKEvent_BumpTransaction: return 22; + case LDKEvent_OnionMessageIntercepted: return 23; + case LDKEvent_OnionMessagePeerConnected: return 24; default: abort(); } } @@ -11987,6 +12563,47 @@ int8_tArray CS_LDK_LDKEvent_FundingGenerationReady_get_user_channel_id(int64_t p memcpy(user_channel_id_arr->elems, obj->funding_generation_ready.user_channel_id.le_bytes, 16); return user_channel_id_arr; } +int64_t CS_LDK_LDKEvent_FundingTxBroadcastSafe_get_channel_id(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_FundingTxBroadcastSafe); + LDKChannelId channel_id_var = obj->funding_tx_broadcast_safe.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_FundingTxBroadcastSafe_get_user_channel_id(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_FundingTxBroadcastSafe); + int8_tArray user_channel_id_arr = init_int8_tArray(16, __LINE__); + memcpy(user_channel_id_arr->elems, obj->funding_tx_broadcast_safe.user_channel_id.le_bytes, 16); + return user_channel_id_arr; +} +int64_t CS_LDK_LDKEvent_FundingTxBroadcastSafe_get_funding_txo(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_FundingTxBroadcastSafe); + LDKOutPoint funding_txo_var = obj->funding_tx_broadcast_safe.funding_txo; + int64_t funding_txo_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var); + funding_txo_ref = tag_ptr(funding_txo_var.inner, false); + return funding_txo_ref; +} +int8_tArray CS_LDK_LDKEvent_FundingTxBroadcastSafe_get_counterparty_node_id(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_FundingTxBroadcastSafe); + int8_tArray counterparty_node_id_arr = init_int8_tArray(33, __LINE__); + memcpy(counterparty_node_id_arr->elems, obj->funding_tx_broadcast_safe.counterparty_node_id.compressed_form, 33); + return counterparty_node_id_arr; +} +int64_t CS_LDK_LDKEvent_FundingTxBroadcastSafe_get_former_temporary_channel_id(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_FundingTxBroadcastSafe); + LDKChannelId former_temporary_channel_id_var = obj->funding_tx_broadcast_safe.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_PaymentClaimable_get_receiver_node_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_PaymentClaimable); @@ -12098,6 +12715,15 @@ int64_t CS_LDK_LDKEvent_PaymentClaimed_get_sender_intended_total_msat(int64_t pt int64_t sender_intended_total_msat_ref = tag_ptr(&obj->payment_claimed.sender_intended_total_msat, false); return sender_intended_total_msat_ref; } +int64_t CS_LDK_LDKEvent_PaymentClaimed_get_onion_fields(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_PaymentClaimed); + LDKRecipientOnionFields onion_fields_var = obj->payment_claimed.onion_fields; + int64_t onion_fields_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(onion_fields_var); + onion_fields_ref = tag_ptr(onion_fields_var.inner, false); + return onion_fields_ref; +} int8_tArray CS_LDK_LDKEvent_ConnectionNeeded_get_node_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_ConnectionNeeded); @@ -12119,13 +12745,37 @@ int64_tArray CS_LDK_LDKEvent_ConnectionNeeded_get_addresses(int64_t ptr) { return addresses_arr; } -int8_tArray CS_LDK_LDKEvent_InvoiceRequestFailed_get_payment_id(int64_t ptr) { +int8_tArray CS_LDK_LDKEvent_InvoiceReceived_get_payment_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); - CHECK(obj->tag == LDKEvent_InvoiceRequestFailed); + CHECK(obj->tag == LDKEvent_InvoiceReceived); int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__); - memcpy(payment_id_arr->elems, obj->invoice_request_failed.payment_id.data, 32); + memcpy(payment_id_arr->elems, obj->invoice_received.payment_id.data, 32); return payment_id_arr; } +int64_t CS_LDK_LDKEvent_InvoiceReceived_get_invoice(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_InvoiceReceived); + LDKBolt12Invoice invoice_var = obj->invoice_received.invoice; + int64_t invoice_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_var); + invoice_ref = tag_ptr(invoice_var.inner, false); + return invoice_ref; +} +int64_t CS_LDK_LDKEvent_InvoiceReceived_get_context(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_InvoiceReceived); + int64_t context_ref = tag_ptr(&obj->invoice_received.context, false); + return context_ref; +} +int64_t CS_LDK_LDKEvent_InvoiceReceived_get_responder(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_InvoiceReceived); + LDKResponder responder_var = obj->invoice_received.responder; + int64_t responder_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(responder_var); + responder_ref = tag_ptr(responder_var.inner, false); + return responder_ref; +} int64_t CS_LDK_LDKEvent_PaymentSent_get_payment_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_PaymentSent); @@ -12159,12 +12809,11 @@ int8_tArray CS_LDK_LDKEvent_PaymentFailed_get_payment_id(int64_t ptr) { memcpy(payment_id_arr->elems, obj->payment_failed.payment_id.data, 32); return payment_id_arr; } -int8_tArray CS_LDK_LDKEvent_PaymentFailed_get_payment_hash(int64_t ptr) { +int64_t CS_LDK_LDKEvent_PaymentFailed_get_payment_hash(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_PaymentFailed); - int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__); - memcpy(payment_hash_arr->elems, obj->payment_failed.payment_hash.data, 32); - return payment_hash_arr; + int64_t payment_hash_ref = tag_ptr(&obj->payment_failed.payment_hash, false); + return payment_hash_ref; } int64_t CS_LDK_LDKEvent_PaymentFailed_get_reason(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -12536,13 +13185,11 @@ int64_t CS_LDK_LDKEvent_DiscardFunding_get_channel_id(int64_t ptr) { 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) { +int64_t CS_LDK_LDKEvent_DiscardFunding_get_funding_info(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_DiscardFunding); - LDKTransaction transaction_var = obj->discard_funding.transaction; - int8_tArray transaction_arr = init_int8_tArray(transaction_var.datalen, __LINE__); - memcpy(transaction_arr->elems, transaction_var.data, transaction_var.datalen); - return transaction_arr; + int64_t funding_info_ref = tag_ptr(&obj->discard_funding.funding_info, false); + return funding_info_ref; } int64_t CS_LDK_LDKEvent_OpenChannelRequest_get_temporary_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -12581,6 +13228,21 @@ 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; } +jboolean CS_LDK_LDKEvent_OpenChannelRequest_get_is_announced(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_OpenChannelRequest); + jboolean is_announced_conv = obj->open_channel_request.is_announced; + return is_announced_conv; +} +int64_t CS_LDK_LDKEvent_OpenChannelRequest_get_params(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_OpenChannelRequest); + LDKChannelParameters params_var = obj->open_channel_request.params; + int64_t params_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_var); + params_ref = tag_ptr(params_var.inner, false); + return params_ref; +} int64_t CS_LDK_LDKEvent_HTLCHandlingFailed_get_prev_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_HTLCHandlingFailed); @@ -12602,6 +13264,29 @@ int64_t CS_LDK_LDKEvent_BumpTransaction_get_bump_transaction(int64_t ptr) { int64_t bump_transaction_ref = tag_ptr(&obj->bump_transaction, false); return bump_transaction_ref; } +int8_tArray CS_LDK_LDKEvent_OnionMessageIntercepted_get_peer_node_id(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_OnionMessageIntercepted); + int8_tArray peer_node_id_arr = init_int8_tArray(33, __LINE__); + memcpy(peer_node_id_arr->elems, obj->onion_message_intercepted.peer_node_id.compressed_form, 33); + return peer_node_id_arr; +} +int64_t CS_LDK_LDKEvent_OnionMessageIntercepted_get_message(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_OnionMessageIntercepted); + LDKOnionMessage message_var = obj->onion_message_intercepted.message; + int64_t message_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_var); + message_ref = tag_ptr(message_var.inner, false); + return message_ref; +} +int8_tArray CS_LDK_LDKEvent_OnionMessagePeerConnected_get_peer_node_id(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_OnionMessagePeerConnected); + int8_tArray peer_node_id_arr = init_int8_tArray(33, __LINE__); + memcpy(peer_node_id_arr->elems, obj->onion_message_peer_connected.peer_node_id.compressed_form, 33); + return peer_node_id_arr; +} uint32_t CS_LDK_LDKCOption_EventZ_ty_from_ptr(int64_t ptr) { LDKCOption_EventZ *obj = (LDKCOption_EventZ*)untag_ptr(ptr); switch(obj->tag) { @@ -12640,6 +13325,39 @@ int64_t CS_LDK_CResult_COption_EventZDecodeErrorZ_get_err(int64_t owner) { return ret_ref; } +static inline struct LDKNonce CResult_NonceDecodeErrorZ_get_ok(LDKCResult_NonceDecodeErrorZ *NONNULL_PTR owner){ + LDKNonce ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_NonceDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_NonceDecodeErrorZ* owner_conv = (LDKCResult_NonceDecodeErrorZ*)untag_ptr(owner); + LDKNonce ret_var = CResult_NonceDecodeErrorZ_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_NonceDecodeErrorZ_get_err(LDKCResult_NonceDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_NonceDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_NonceDecodeErrorZ* owner_conv = (LDKCResult_NonceDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_NonceDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline LDKCVec_RouteHintHopZ CVec_RouteHintHopZ_clone(const LDKCVec_RouteHintHopZ *orig) { + LDKCVec_RouteHintHopZ ret = { .data = MALLOC(sizeof(LDKRouteHintHop) * orig->datalen, "LDKCVec_RouteHintHopZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = RouteHintHop_clone(&orig->data[i]); + } + return ret; +} uint32_t CS_LDK_LDKBolt11ParseError_ty_from_ptr(int64_t ptr) { LDKBolt11ParseError *obj = (LDKBolt11ParseError*)untag_ptr(ptr); switch(obj->tag) { @@ -13025,6 +13743,32 @@ int64_t CS_LDK_CResult_BigSizeDecodeErrorZ_get_err(int64_t owner) { return ret_ref; } +static inline struct LDKUntrustedString CResult_UntrustedStringDecodeErrorZ_get_ok(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR owner){ + LDKUntrustedString ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_UntrustedStringDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_UntrustedStringDecodeErrorZ* owner_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(owner); + LDKUntrustedString ret_var = CResult_UntrustedStringDecodeErrorZ_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_UntrustedStringDecodeErrorZ_get_err(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_UntrustedStringDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_UntrustedStringDecodeErrorZ* owner_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_UntrustedStringDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline struct LDKHostname CResult_HostnameDecodeErrorZ_get_ok(LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR owner){ LDKHostname ret = *owner->contents.result; ret.is_owned = false; @@ -13100,32 +13844,6 @@ int64_t CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_get_err(int64_t own return ret_ref; } -static inline struct LDKUntrustedString CResult_UntrustedStringDecodeErrorZ_get_ok(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR owner){ - LDKUntrustedString ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -int64_t CS_LDK_CResult_UntrustedStringDecodeErrorZ_get_ok(int64_t owner) { - LDKCResult_UntrustedStringDecodeErrorZ* owner_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(owner); - LDKUntrustedString ret_var = CResult_UntrustedStringDecodeErrorZ_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_UntrustedStringDecodeErrorZ_get_err(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -int64_t CS_LDK_CResult_UntrustedStringDecodeErrorZ_get_err(int64_t owner) { - LDKCResult_UntrustedStringDecodeErrorZ* owner_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_UntrustedStringDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - 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; @@ -13171,6 +13889,62 @@ int16_t CS_LDK_C2Tuple__u832u16Z_get_b(int64_t owner) { return ret_conv; } +static inline struct LDKBlindedPayInfo CResult_BlindedPayInfoDecodeErrorZ_get_ok(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR owner){ + LDKBlindedPayInfo ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_BlindedPayInfoDecodeErrorZ* owner_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(owner); + LDKBlindedPayInfo ret_var = CResult_BlindedPayInfoDecodeErrorZ_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_BlindedPayInfoDecodeErrorZ_get_err(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_BlindedPayInfoDecodeErrorZ* owner_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_BlindedPayInfoDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKBlindedPaymentPath CResult_BlindedPaymentPathNoneZ_get_ok(LDKCResult_BlindedPaymentPathNoneZ *NONNULL_PTR owner){ + LDKBlindedPaymentPath ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_BlindedPaymentPathNoneZ_get_ok(int64_t owner) { + LDKCResult_BlindedPaymentPathNoneZ* owner_conv = (LDKCResult_BlindedPaymentPathNoneZ*)untag_ptr(owner); + LDKBlindedPaymentPath ret_var = CResult_BlindedPaymentPathNoneZ_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_BlindedPaymentPathNoneZ_get_err(LDKCResult_BlindedPaymentPathNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +void CS_LDK_CResult_BlindedPaymentPathNoneZ_get_err(int64_t owner) { + LDKCResult_BlindedPaymentPathNoneZ* owner_conv = (LDKCResult_BlindedPaymentPathNoneZ*)untag_ptr(owner); + CResult_BlindedPaymentPathNoneZ_get_err(owner_conv); +} + +static inline LDKCVec_PaymentForwardNodeZ CVec_PaymentForwardNodeZ_clone(const LDKCVec_PaymentForwardNodeZ *orig) { + LDKCVec_PaymentForwardNodeZ ret = { .data = MALLOC(sizeof(LDKPaymentForwardNode) * orig->datalen, "LDKCVec_PaymentForwardNodeZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = PaymentForwardNode_clone(&orig->data[i]); + } + return ret; +} static inline struct LDKPaymentRelay CResult_PaymentRelayDecodeErrorZ_get_ok(LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR owner){ LDKPaymentRelay ret = *owner->contents.result; ret.is_owned = false; @@ -13325,85 +14099,46 @@ int64_t CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_get_err(int64_t owner) { 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); -} -int8_tArray CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_a(int64_t owner) { - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* owner_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(owner); - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_a(owner_conv).data, 32); - return ret_arr; -} - -static inline struct LDKRecipientOnionFields C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_b(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR owner){ - LDKRecipientOnionFields ret = owner->b; +static inline struct LDKResponder CResult_ResponderDecodeErrorZ_get_ok(LDKCResult_ResponderDecodeErrorZ *NONNULL_PTR owner){ + LDKResponder ret = *owner->contents.result; ret.is_owned = false; return ret; } -int64_t CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_b(int64_t owner) { - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* owner_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(owner); - LDKRecipientOnionFields ret_var = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_b(owner_conv); +int64_t CS_LDK_CResult_ResponderDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_ResponderDecodeErrorZ* owner_conv = (LDKCResult_ResponderDecodeErrorZ*)untag_ptr(owner); + LDKResponder ret_var = CResult_ResponderDecodeErrorZ_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 LDKRouteParameters C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_c(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR owner){ - LDKRouteParameters ret = owner->c; - ret.is_owned = false; - return ret; +static inline struct LDKDecodeError CResult_ResponderDecodeErrorZ_get_err(LDKCResult_ResponderDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } -int64_t CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_c(int64_t owner) { - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* owner_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(owner); - LDKRouteParameters ret_var = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_c(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); +int64_t CS_LDK_CResult_ResponderDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_ResponderDecodeErrorZ* owner_conv = (LDKCResult_ResponderDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ResponderDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_ok(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(&*owner->contents.result); -} -int64_t CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_ok(int64_t owner) { - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* owner_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(owner); - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ), "LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ"); - *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_ok(owner_conv); - return tag_ptr(ret_conv, true); -} - -static inline void CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_err(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; +uint32_t CS_LDK_LDKCOption_MessageContextZ_ty_from_ptr(int64_t ptr) { + LDKCOption_MessageContextZ *obj = (LDKCOption_MessageContextZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_MessageContextZ_Some: return 0; + case LDKCOption_MessageContextZ_None: return 1; + default: abort(); + } } -void CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_err(int64_t owner) { - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* owner_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(owner); - CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_err(owner_conv); +int64_t CS_LDK_LDKCOption_MessageContextZ_Some_get_some(int64_t ptr) { + LDKCOption_MessageContextZ *obj = (LDKCOption_MessageContextZ*)untag_ptr(ptr); + CHECK(obj->tag == LDKCOption_MessageContextZ_Some); + int64_t some_ref = tag_ptr(&obj->some, false); + return some_ref; } - static inline struct LDKPublicKey C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_get_a(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *NONNULL_PTR owner){ return owner->a; } @@ -13562,17 +14297,16 @@ int64_t CS_LDK_LDKPeeledOnion_Receive_get__0(int64_t ptr) { int64_t _0_ref = tag_ptr(&obj->receive._0, false); return _0_ref; } -int8_tArray CS_LDK_LDKPeeledOnion_Receive_get__1(int64_t ptr) { +int64_t CS_LDK_LDKPeeledOnion_Receive_get__1(int64_t ptr) { LDKPeeledOnion *obj = (LDKPeeledOnion*)untag_ptr(ptr); CHECK(obj->tag == LDKPeeledOnion_Receive); - int8_tArray _1_arr = init_int8_tArray(32, __LINE__); - memcpy(_1_arr->elems, obj->receive._1.data, 32); - return _1_arr; + int64_t _1_ref = tag_ptr(&obj->receive._1, false); + return _1_ref; } int64_t CS_LDK_LDKPeeledOnion_Receive_get__2(int64_t ptr) { LDKPeeledOnion *obj = (LDKPeeledOnion*)untag_ptr(ptr); CHECK(obj->tag == LDKPeeledOnion_Receive); - LDKBlindedPath _2_var = obj->receive._2; + LDKBlindedMessagePath _2_var = obj->receive._2; int64_t _2_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(_2_var); _2_ref = tag_ptr(_2_var.inner, false); @@ -13638,104 +14372,96 @@ int64_t CS_LDK_CResult_SendSuccessSendErrorZ_get_err(int64_t owner) { return ret_ref; } -static inline struct LDKBlindedPath CResult_BlindedPathNoneZ_get_ok(LDKCResult_BlindedPathNoneZ *NONNULL_PTR owner){ - LDKBlindedPath ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -int64_t CS_LDK_CResult_BlindedPathNoneZ_get_ok(int64_t owner) { - LDKCResult_BlindedPathNoneZ* owner_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(owner); - LDKBlindedPath ret_var = CResult_BlindedPathNoneZ_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_BlindedPathNoneZ_get_err(LDKCResult_BlindedPathNoneZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; -} -void CS_LDK_CResult_BlindedPathNoneZ_get_err(int64_t owner) { - LDKCResult_BlindedPathNoneZ* owner_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(owner); - CResult_BlindedPathNoneZ_get_err(owner_conv); -} - -static inline struct LDKC2Tuple_BlindedPayInfoBlindedPathZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_get_ok(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR owner){ +static inline void CResult_NoneSendErrorZ_get_ok(LDKCResult_NoneSendErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return C2Tuple_BlindedPayInfoBlindedPathZ_clone(&*owner->contents.result); + return *owner->contents.result; } -int64_t CS_LDK_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_get_ok(int64_t owner) { - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* owner_conv = (LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ*)untag_ptr(owner); - LDKC2Tuple_BlindedPayInfoBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ"); - *ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_get_ok(owner_conv); - return tag_ptr(ret_conv, true); +void CS_LDK_CResult_NoneSendErrorZ_get_ok(int64_t owner) { + LDKCResult_NoneSendErrorZ* owner_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(owner); + CResult_NoneSendErrorZ_get_ok(owner_conv); } -static inline void CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_get_err(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR owner){ +static inline struct LDKSendError CResult_NoneSendErrorZ_get_err(LDKCResult_NoneSendErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); - return *owner->contents.err; + return SendError_clone(&*owner->contents.err); } -void CS_LDK_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_get_err(int64_t owner) { - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* owner_conv = (LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ*)untag_ptr(owner); - CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_get_err(owner_conv); +int64_t CS_LDK_CResult_NoneSendErrorZ_get_err(int64_t owner) { + LDKCResult_NoneSendErrorZ* owner_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(owner); + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = CResult_NoneSendErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -static inline LDKCVec_ForwardNodeZ CVec_ForwardNodeZ_clone(const LDKCVec_ForwardNodeZ *orig) { - LDKCVec_ForwardNodeZ ret = { .data = MALLOC(sizeof(LDKForwardNode) * orig->datalen, "LDKCVec_ForwardNodeZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = ForwardNode_clone(&orig->data[i]); - } - return ret; -} -static inline struct LDKBlindedPath CResult_BlindedPathDecodeErrorZ_get_ok(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR owner){ - LDKBlindedPath ret = *owner->contents.result; +static inline struct LDKBlindedHop CResult_BlindedHopDecodeErrorZ_get_ok(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){ + LDKBlindedHop ret = *owner->contents.result; ret.is_owned = false; return ret; } -int64_t CS_LDK_CResult_BlindedPathDecodeErrorZ_get_ok(int64_t owner) { - LDKCResult_BlindedPathDecodeErrorZ* owner_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(owner); - LDKBlindedPath ret_var = CResult_BlindedPathDecodeErrorZ_get_ok(owner_conv); +int64_t CS_LDK_CResult_BlindedHopDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner); + LDKBlindedHop ret_var = CResult_BlindedHopDecodeErrorZ_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_BlindedPathDecodeErrorZ_get_err(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_BlindedHopDecodeErrorZ_get_err(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return DecodeError_clone(&*owner->contents.err); } -int64_t CS_LDK_CResult_BlindedPathDecodeErrorZ_get_err(int64_t owner) { - LDKCResult_BlindedPathDecodeErrorZ* owner_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(owner); +int64_t CS_LDK_CResult_BlindedHopDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner); LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_BlindedPathDecodeErrorZ_get_err(owner_conv); + *ret_copy = CResult_BlindedHopDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline struct LDKBlindedHop CResult_BlindedHopDecodeErrorZ_get_ok(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){ - LDKBlindedHop ret = *owner->contents.result; +static inline LDKCVec_PhantomRouteHintsZ CVec_PhantomRouteHintsZ_clone(const LDKCVec_PhantomRouteHintsZ *orig) { + LDKCVec_PhantomRouteHintsZ ret = { .data = MALLOC(sizeof(LDKPhantomRouteHints) * orig->datalen, "LDKCVec_PhantomRouteHintsZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = PhantomRouteHints_clone(&orig->data[i]); + } + return ret; +} +uint32_t CS_LDK_LDKSignOrCreationError_ty_from_ptr(int64_t ptr) { + LDKSignOrCreationError *obj = (LDKSignOrCreationError*)untag_ptr(ptr); + switch(obj->tag) { + case LDKSignOrCreationError_SignError: return 0; + case LDKSignOrCreationError_CreationError: return 1; + default: abort(); + } +} +int32_t CS_LDK_LDKSignOrCreationError_CreationError_get_creation_error(int64_t ptr) { + LDKSignOrCreationError *obj = (LDKSignOrCreationError*)untag_ptr(ptr); + CHECK(obj->tag == LDKSignOrCreationError_CreationError); + int32_t creation_error_conv = LDKCreationError_to_cs(obj->creation_error); + return creation_error_conv; +} +static inline struct LDKBolt11Invoice CResult_Bolt11InvoiceSignOrCreationErrorZ_get_ok(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){ + LDKBolt11Invoice ret = *owner->contents.result; ret.is_owned = false; return ret; } -int64_t CS_LDK_CResult_BlindedHopDecodeErrorZ_get_ok(int64_t owner) { - LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner); - LDKBlindedHop ret_var = CResult_BlindedHopDecodeErrorZ_get_ok(owner_conv); +int64_t CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_get_ok(int64_t owner) { + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(owner); + LDKBolt11Invoice ret_var = CResult_Bolt11InvoiceSignOrCreationErrorZ_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_BlindedHopDecodeErrorZ_get_err(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKSignOrCreationError CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); + return SignOrCreationError_clone(&*owner->contents.err); } -int64_t CS_LDK_CResult_BlindedHopDecodeErrorZ_get_err(int64_t owner) { - LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_BlindedHopDecodeErrorZ_get_err(owner_conv); +int64_t CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err(int64_t owner) { + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(owner); + LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError"); + *ret_copy = CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -13903,7 +14629,7 @@ void register_tx_LDKFilter_jcall(const void* this_arg, const uint8_t (* txid)[32 LDKu8slice script_pubkey_var = script_pubkey; int8_tArray script_pubkey_arr = init_int8_tArray(script_pubkey_var.datalen, __LINE__); memcpy(script_pubkey_arr->elems, script_pubkey_var.data, script_pubkey_var.datalen); - js_invoke_function_void_ll(j_calls->instance_ptr, 56, (int64_t)txid_arr, (int64_t)script_pubkey_arr); + js_invoke_function_void_ll(j_calls->instance_ptr, 57, (int64_t)txid_arr, (int64_t)script_pubkey_arr); } void register_output_LDKFilter_jcall(const void* this_arg, LDKWatchedOutput output) { LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg; @@ -13911,7 +14637,7 @@ void register_output_LDKFilter_jcall(const void* this_arg, LDKWatchedOutput outp int64_t output_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(output_var); output_ref = tag_ptr(output_var.inner, output_var.is_owned); - js_invoke_function_void_l(j_calls->instance_ptr, 57, output_ref); + js_invoke_function_void_l(j_calls->instance_ptr, 58, output_ref); } static void LDKFilter_JCalls_cloned(LDKFilter* new_obj) { LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) new_obj->this_arg; @@ -14001,7 +14727,7 @@ static void LDKChangeDestinationSource_JCalls_free(void* this_arg) { } 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); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 59); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_CVec_u8ZNoneZ ret_conv = *(LDKCResult_CVec_u8ZNoneZ*)(ret_ptr); @@ -14059,7 +14785,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, 59, (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, 60, (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); @@ -14080,7 +14806,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, 60, (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, 61, (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); @@ -14099,7 +14825,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, 61, (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, 62, (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); @@ -14114,7 +14840,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, 62, (int64_t)primary_namespace_conv, (int64_t)secondary_namespace_conv); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 63, (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); @@ -14239,7 +14965,7 @@ LDKCResult_TransactionNoneZ spend_spendable_outputs_LDKOutputSpender_jcall(const 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); + uint64_t ret = js_invoke_function_l_lllil(j_calls->instance_ptr, 64, (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_TransactionNoneZ ret_conv = *(LDKCResult_TransactionNoneZ*)(ret_ptr); @@ -14606,55 +15332,142 @@ static inline LDKCVec_C2Tuple_OutPointChannelIdZZ CVec_C2Tuple_OutPointChannelId } 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){ +static inline struct LDKOutPoint C2Tuple_OutPointCVec_u64ZZ_get_a(LDKC2Tuple_OutPointCVec_u64ZZ *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 CS_LDK_C2Tuple_OutPointCVec_u64ZZ_get_a(int64_t owner) { + LDKC2Tuple_OutPointCVec_u64ZZ* owner_conv = (LDKC2Tuple_OutPointCVec_u64ZZ*)untag_ptr(owner); + LDKOutPoint ret_var = C2Tuple_OutPointCVec_u64ZZ_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); +static inline struct LDKCVec_u64Z C2Tuple_OutPointCVec_u64ZZ_get_b(LDKC2Tuple_OutPointCVec_u64ZZ *NONNULL_PTR owner){ + return CVec_u64Z_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 CS_LDK_C2Tuple_OutPointCVec_u64ZZ_get_b(int64_t owner) { + LDKC2Tuple_OutPointCVec_u64ZZ* owner_conv = (LDKC2Tuple_OutPointCVec_u64ZZ*)untag_ptr(owner); + LDKCVec_u64Z ret_var = C2Tuple_OutPointCVec_u64ZZ_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; + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; } 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 }; +static inline LDKCVec_C2Tuple_OutPointCVec_u64ZZZ CVec_C2Tuple_OutPointCVec_u64ZZZ_clone(const LDKCVec_C2Tuple_OutPointCVec_u64ZZZ *orig) { + LDKCVec_C2Tuple_OutPointCVec_u64ZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_u64ZZ) * orig->datalen, "LDKCVec_C2Tuple_OutPointCVec_u64ZZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(&orig->data[i]); + ret.data[i] = C2Tuple_OutPointCVec_u64ZZ_clone(&orig->data[i]); } return ret; } +static inline struct LDKBlindedMessagePath CResult_BlindedMessagePathDecodeErrorZ_get_ok(LDKCResult_BlindedMessagePathDecodeErrorZ *NONNULL_PTR owner){ + LDKBlindedMessagePath ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_BlindedMessagePathDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_BlindedMessagePathDecodeErrorZ* owner_conv = (LDKCResult_BlindedMessagePathDecodeErrorZ*)untag_ptr(owner); + LDKBlindedMessagePath ret_var = CResult_BlindedMessagePathDecodeErrorZ_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_BlindedMessagePathDecodeErrorZ_get_err(LDKCResult_BlindedMessagePathDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_BlindedMessagePathDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_BlindedMessagePathDecodeErrorZ* owner_conv = (LDKCResult_BlindedMessagePathDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_BlindedMessagePathDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKBlindedMessagePath CResult_BlindedMessagePathNoneZ_get_ok(LDKCResult_BlindedMessagePathNoneZ *NONNULL_PTR owner){ + LDKBlindedMessagePath ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_BlindedMessagePathNoneZ_get_ok(int64_t owner) { + LDKCResult_BlindedMessagePathNoneZ* owner_conv = (LDKCResult_BlindedMessagePathNoneZ*)untag_ptr(owner); + LDKBlindedMessagePath ret_var = CResult_BlindedMessagePathNoneZ_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_BlindedMessagePathNoneZ_get_err(LDKCResult_BlindedMessagePathNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +void CS_LDK_CResult_BlindedMessagePathNoneZ_get_err(int64_t owner) { + LDKCResult_BlindedMessagePathNoneZ* owner_conv = (LDKCResult_BlindedMessagePathNoneZ*)untag_ptr(owner); + CResult_BlindedMessagePathNoneZ_get_err(owner_conv); +} + +static inline struct LDKMessageContext CResult_MessageContextDecodeErrorZ_get_ok(LDKCResult_MessageContextDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return MessageContext_clone(&*owner->contents.result); +} +int64_t CS_LDK_CResult_MessageContextDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_MessageContextDecodeErrorZ* owner_conv = (LDKCResult_MessageContextDecodeErrorZ*)untag_ptr(owner); + LDKMessageContext *ret_copy = MALLOC(sizeof(LDKMessageContext), "LDKMessageContext"); + *ret_copy = CResult_MessageContextDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_MessageContextDecodeErrorZ_get_err(LDKCResult_MessageContextDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_MessageContextDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_MessageContextDecodeErrorZ* owner_conv = (LDKCResult_MessageContextDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_MessageContextDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKOffersContext CResult_OffersContextDecodeErrorZ_get_ok(LDKCResult_OffersContextDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return OffersContext_clone(&*owner->contents.result); +} +int64_t CS_LDK_CResult_OffersContextDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_OffersContextDecodeErrorZ* owner_conv = (LDKCResult_OffersContextDecodeErrorZ*)untag_ptr(owner); + LDKOffersContext *ret_copy = MALLOC(sizeof(LDKOffersContext), "LDKOffersContext"); + *ret_copy = CResult_OffersContextDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_OffersContextDecodeErrorZ_get_err(LDKCResult_OffersContextDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_OffersContextDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_OffersContextDecodeErrorZ* owner_conv = (LDKCResult_OffersContextDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_OffersContextDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + typedef struct LDKPersister_JCalls { atomic_size_t refcnt; uint32_t instance_ptr; @@ -14672,7 +15485,7 @@ LDKCResult_NoneIOErrorZ persist_manager_LDKPersister_jcall(const void* this_arg, // WARNING: we may need a move here but no clone is available for LDKChannelManager CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_var); channel_manager_ref = tag_ptr(channel_manager_var.inner, channel_manager_var.is_owned); - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 64, channel_manager_ref); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 65, channel_manager_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneIOErrorZ ret_conv = *(LDKCResult_NoneIOErrorZ*)(ret_ptr); @@ -14686,7 +15499,7 @@ LDKCResult_NoneIOErrorZ persist_graph_LDKPersister_jcall(const void* this_arg, c // WARNING: we may need a move here but no clone is available for LDKNetworkGraph CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_var); network_graph_ref = tag_ptr(network_graph_var.inner, network_graph_var.is_owned); - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 65, network_graph_ref); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 66, network_graph_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneIOErrorZ ret_conv = *(LDKCResult_NoneIOErrorZ*)(ret_ptr); @@ -14697,7 +15510,7 @@ LDKCResult_NoneIOErrorZ persist_scorer_LDKPersister_jcall(const void* this_arg, LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg; // WARNING: This object doesn't live past this scope, needs clone! int64_t ret_scorer = tag_ptr(scorer, false); - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 66, ret_scorer); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 67, ret_scorer); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneIOErrorZ ret_conv = *(LDKCResult_NoneIOErrorZ*)(ret_ptr); @@ -14777,45 +15590,37 @@ static void LDKPersist_JCalls_free(void* this_arg) { FREE(j_calls); } } -LDKChannelMonitorUpdateStatus persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_funding_outpoint, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) { +LDKChannelMonitorUpdateStatus persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_funding_outpoint, const LDKChannelMonitor * monitor) { 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); + LDKChannelMonitor monitor_var = *monitor; + int64_t monitor_ref = 0; + monitor_var = ChannelMonitor_clone(&monitor_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_var); + monitor_ref = tag_ptr(monitor_var.inner, monitor_var.is_owned); + uint64_t ret = js_invoke_function_ChannelMonitorUpdateStatus_ll(j_calls->instance_ptr, 68, channel_funding_outpoint_ref, monitor_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) { +LDKChannelMonitorUpdateStatus update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_funding_outpoint, LDKChannelMonitorUpdate monitor_update, const LDKChannelMonitor * monitor) { 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); + LDKChannelMonitorUpdate monitor_update_var = monitor_update; + int64_t monitor_update_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_update_var); + monitor_update_ref = tag_ptr(monitor_update_var.inner, monitor_update_var.is_owned); + LDKChannelMonitor monitor_var = *monitor; + int64_t monitor_ref = 0; + monitor_var = ChannelMonitor_clone(&monitor_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_var); + monitor_ref = tag_ptr(monitor_var.inner, monitor_var.is_owned); + uint64_t ret = js_invoke_function_ChannelMonitorUpdateStatus_lll(j_calls->instance_ptr, 69, channel_funding_outpoint_ref, monitor_update_ref, monitor_ref); LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_cs(ret); return ret_conv; } @@ -14825,7 +15630,7 @@ void archive_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoin 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); + js_invoke_function_void_l(j_calls->instance_ptr, 70, channel_funding_outpoint_ref); } static void LDKPersist_JCalls_cloned(LDKPersist* new_obj) { LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) new_obj->this_arg; @@ -14850,7 +15655,7 @@ uint64_t CS_LDK_LDKPersist_new(int32_t o) { *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) { +int32_t CS_LDK_Persist_persist_new_channel(int64_t this_arg, int64_t channel_funding_outpoint, int64_t monitor) { 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; @@ -14859,21 +15664,16 @@ int32_t CS_LDK_Persist_persist_new_channel(int64_t this_arg, int64_t channel_fu 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)); + LDKChannelMonitor monitor_conv; + monitor_conv.inner = untag_ptr(monitor); + monitor_conv.is_owned = ptr_is_owned(monitor); + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_conv); + monitor_conv.is_owned = false; + int32_t ret_conv = LDKChannelMonitorUpdateStatus_to_cs((this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_funding_outpoint_conv, &monitor_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) { +int32_t CS_LDK_Persist_update_persisted_channel(int64_t this_arg, int64_t channel_funding_outpoint, int64_t monitor_update, int64_t monitor) { 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; @@ -14882,22 +15682,17 @@ int32_t CS_LDK_Persist_update_persisted_channel(int64_t this_arg, int64_t chann 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)); + LDKChannelMonitorUpdate monitor_update_conv; + monitor_update_conv.inner = untag_ptr(monitor_update); + monitor_update_conv.is_owned = ptr_is_owned(monitor_update); + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_update_conv); + monitor_update_conv = ChannelMonitorUpdate_clone(&monitor_update_conv); + LDKChannelMonitor monitor_conv; + monitor_conv.inner = untag_ptr(monitor); + monitor_conv.is_owned = ptr_is_owned(monitor); + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_conv); + monitor_conv.is_owned = false; + int32_t ret_conv = LDKChannelMonitorUpdateStatus_to_cs((this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_funding_outpoint_conv, monitor_update_conv, &monitor_conv)); return ret_conv; } @@ -14939,7 +15734,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, 70, (int64_t)header_arr, (int64_t)txdata_arr, height_conv); + js_invoke_function_void_lli(j_calls->instance_ptr, 71, (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; @@ -14947,14 +15742,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, 71, (int64_t)block_arr, height_conv); + js_invoke_function_void_li(j_calls->instance_ptr, 72, (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, 72, (int64_t)header_arr, height_conv); + js_invoke_function_void_li(j_calls->instance_ptr, 73, (int64_t)header_arr, height_conv); } static void LDKListen_JCalls_cloned(LDKListen* new_obj) { LDKListen_JCalls *j_calls = (LDKListen_JCalls*) new_obj->this_arg; @@ -15054,24 +15849,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, 73, (int64_t)header_arr, (int64_t)txdata_arr, height_conv); + js_invoke_function_void_lli(j_calls->instance_ptr, 74, (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, 74, (int64_t)txid_arr); + js_invoke_function_void_l(j_calls->instance_ptr, 75, (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, 75, (int64_t)header_arr, height_conv); + js_invoke_function_void_li(j_calls->instance_ptr, 76, (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, 76); + int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 77); LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) @@ -15213,7 +16008,7 @@ static void LDKFutureCallback_JCalls_free(void* this_arg) { } void call_LDKFutureCallback_jcall(const void* this_arg) { LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) this_arg; - js_invoke_function_void_(j_calls->instance_ptr, 77); + js_invoke_function_void_(j_calls->instance_ptr, 78); } static void LDKFutureCallback_JCalls_cloned(LDKFutureCallback* new_obj) { LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) new_obj->this_arg; @@ -15253,12 +16048,17 @@ static void LDKEventHandler_JCalls_free(void* this_arg) { FREE(j_calls); } } -void handle_event_LDKEventHandler_jcall(const void* this_arg, LDKEvent event) { +LDKCResult_NoneReplayEventZ handle_event_LDKEventHandler_jcall(const void* this_arg, LDKEvent event) { LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) this_arg; LDKEvent *event_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *event_copy = event; int64_t event_ref = tag_ptr(event_copy, true); - js_invoke_function_void_l(j_calls->instance_ptr, 78, event_ref); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 79, event_ref); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_NoneReplayEventZ ret_conv = *(LDKCResult_NoneReplayEventZ*)(ret_ptr); + FREE(untag_ptr(ret)); + return ret_conv; } static void LDKEventHandler_JCalls_cloned(LDKEventHandler* new_obj) { LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) new_obj->this_arg; @@ -15281,7 +16081,7 @@ uint64_t CS_LDK_LDKEventHandler_new(int32_t o) { *res_ptr = LDKEventHandler_init(o); return tag_ptr(res_ptr, true); } -void CS_LDK_EventHandler_handle_event(int64_t this_arg, int64_t event) { +int64_t CS_LDK_EventHandler_handle_event(int64_t this_arg, int64_t event) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKEventHandler* this_arg_conv = (LDKEventHandler*)this_arg_ptr; @@ -15289,7 +16089,9 @@ void CS_LDK_EventHandler_handle_event(int64_t this_arg, int64_t event) { CHECK_ACCESS(event_ptr); LDKEvent event_conv = *(LDKEvent*)(event_ptr); event_conv = Event_clone((LDKEvent*)untag_ptr(event)); - (this_arg_conv->handle_event)(this_arg_conv->this_arg, event_conv); + LDKCResult_NoneReplayEventZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneReplayEventZ), "LDKCResult_NoneReplayEventZ"); + *ret_conv = (this_arg_conv->handle_event)(this_arg_conv->this_arg, event_conv); + return tag_ptr(ret_conv, true); } typedef struct LDKEventsProvider_JCalls { @@ -15306,7 +16108,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, 79, tag_ptr(handler_ret, true)); + js_invoke_function_void_l(j_calls->instance_ptr, 80, tag_ptr(handler_ret, true)); } static void LDKEventsProvider_JCalls_cloned(LDKEventsProvider* new_obj) { LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) new_obj->this_arg; @@ -15371,7 +16173,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, 80); + int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 81); LDKCVec_MessageSendEventZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) @@ -15450,7 +16252,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, 81, (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_open_channel_v2_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKOpenChannelV2 * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15461,7 +16263,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, 82, (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_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAcceptChannel * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15472,7 +16274,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, 83, (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_accept_channel_v2_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAcceptChannelV2 * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15483,7 +16285,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, 84, (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_created_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingCreated * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15494,7 +16296,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, 85, (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_funding_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15505,7 +16307,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, 86, (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_channel_ready_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReady * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15516,7 +16318,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, 87, (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_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKShutdown * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15527,7 +16329,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, 88, (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_closing_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKClosingSigned * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15538,7 +16340,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, 89, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 90, (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; @@ -15549,7 +16351,7 @@ 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, 90, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 91, (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) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15560,7 +16362,7 @@ void handle_tx_add_input_LDKChannelMessageHandler_jcall(const void* this_arg, LD msg_var = TxAddInput_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, 91, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 92, (int64_t)their_node_id_arr, msg_ref); } void handle_tx_add_output_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKTxAddOutput * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15571,7 +16373,7 @@ void handle_tx_add_output_LDKChannelMessageHandler_jcall(const void* this_arg, L msg_var = TxAddOutput_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, 92, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 93, (int64_t)their_node_id_arr, msg_ref); } void handle_tx_remove_input_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKTxRemoveInput * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15582,7 +16384,7 @@ void handle_tx_remove_input_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = TxRemoveInput_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, 93, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 94, (int64_t)their_node_id_arr, msg_ref); } void handle_tx_remove_output_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKTxRemoveOutput * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15593,7 +16395,7 @@ void handle_tx_remove_output_LDKChannelMessageHandler_jcall(const void* this_arg msg_var = TxRemoveOutput_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, 94, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 95, (int64_t)their_node_id_arr, msg_ref); } void handle_tx_complete_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKTxComplete * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15604,7 +16406,7 @@ void handle_tx_complete_LDKChannelMessageHandler_jcall(const void* this_arg, LDK msg_var = TxComplete_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, 95, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 96, (int64_t)their_node_id_arr, msg_ref); } void handle_tx_signatures_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKTxSignatures * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15615,7 +16417,7 @@ void handle_tx_signatures_LDKChannelMessageHandler_jcall(const void* this_arg, L msg_var = TxSignatures_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, 96, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 97, (int64_t)their_node_id_arr, msg_ref); } void handle_tx_init_rbf_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKTxInitRbf * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15626,7 +16428,7 @@ void handle_tx_init_rbf_LDKChannelMessageHandler_jcall(const void* this_arg, LDK msg_var = TxInitRbf_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, 97, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 98, (int64_t)their_node_id_arr, msg_ref); } void handle_tx_ack_rbf_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKTxAckRbf * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15637,7 +16439,7 @@ void handle_tx_ack_rbf_LDKChannelMessageHandler_jcall(const void* this_arg, LDKP msg_var = TxAckRbf_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, 98, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 99, (int64_t)their_node_id_arr, msg_ref); } void handle_tx_abort_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKTxAbort * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15648,7 +16450,7 @@ void handle_tx_abort_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPub msg_var = TxAbort_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, 99, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 100, (int64_t)their_node_id_arr, msg_ref); } void handle_update_add_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateAddHTLC * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15659,7 +16461,7 @@ void handle_update_add_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = UpdateAddHTLC_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 100, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 101, (int64_t)their_node_id_arr, msg_ref); } void handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFulfillHTLC * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15670,7 +16472,7 @@ void handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_ msg_var = UpdateFulfillHTLC_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 101, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 102, (int64_t)their_node_id_arr, msg_ref); } void handle_update_fail_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailHTLC * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15681,7 +16483,7 @@ void handle_update_fail_htlc_LDKChannelMessageHandler_jcall(const void* this_arg msg_var = UpdateFailHTLC_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 102, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 103, (int64_t)their_node_id_arr, msg_ref); } void handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailMalformedHTLC * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15692,7 +16494,7 @@ void handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall(const void msg_var = UpdateFailMalformedHTLC_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 103, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 104, (int64_t)their_node_id_arr, msg_ref); } void handle_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKCommitmentSigned * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15703,7 +16505,7 @@ void handle_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_ar msg_var = CommitmentSigned_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 104, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 105, (int64_t)their_node_id_arr, msg_ref); } void handle_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKRevokeAndACK * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15714,7 +16516,7 @@ void handle_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = RevokeAndACK_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 105, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 106, (int64_t)their_node_id_arr, msg_ref); } void handle_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFee * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15725,7 +16527,7 @@ void handle_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKP msg_var = UpdateFee_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 106, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 107, (int64_t)their_node_id_arr, msg_ref); } void handle_announcement_signatures_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAnnouncementSignatures * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15736,13 +16538,13 @@ void handle_announcement_signatures_LDKChannelMessageHandler_jcall(const void* t msg_var = AnnouncementSignatures_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 107, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 108, (int64_t)their_node_id_arr, msg_ref); } void peer_disconnected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); - js_invoke_function_void_l(j_calls->instance_ptr, 108, (int64_t)their_node_id_arr); + js_invoke_function_void_l(j_calls->instance_ptr, 109, (int64_t)their_node_id_arr); } LDKCResult_NoneNoneZ peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * msg, bool inbound) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15754,7 +16556,7 @@ LDKCResult_NoneNoneZ peer_connected_LDKChannelMessageHandler_jcall(const void* t CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); jboolean inbound_conv = inbound; - uint64_t ret = js_invoke_function_l_llb(j_calls->instance_ptr, 109, (int64_t)their_node_id_arr, msg_ref, inbound_conv); + uint64_t ret = js_invoke_function_l_llb(j_calls->instance_ptr, 110, (int64_t)their_node_id_arr, msg_ref, inbound_conv); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr); @@ -15770,7 +16572,7 @@ void handle_channel_reestablish_LDKChannelMessageHandler_jcall(const void* this_ msg_var = ChannelReestablish_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 110, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 111, (int64_t)their_node_id_arr, msg_ref); } void handle_channel_update_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelUpdate * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15781,7 +16583,7 @@ void handle_channel_update_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = ChannelUpdate_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 111, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 112, (int64_t)their_node_id_arr, msg_ref); } void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKErrorMessage * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15792,11 +16594,11 @@ void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublic msg_var = ErrorMessage_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 112, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 113, (int64_t)their_node_id_arr, msg_ref); } LDKNodeFeatures provided_node_features_LDKChannelMessageHandler_jcall(const void* this_arg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 113); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 114); LDKNodeFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -15807,7 +16609,7 @@ LDKInitFeatures provided_init_features_LDKChannelMessageHandler_jcall(const void LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 114, (int64_t)their_node_id_arr); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 115, (int64_t)their_node_id_arr); LDKInitFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -15816,7 +16618,7 @@ LDKInitFeatures provided_init_features_LDKChannelMessageHandler_jcall(const void } LDKCOption_CVec_ThirtyTwoBytesZZ get_chain_hashes_LDKChannelMessageHandler_jcall(const void* this_arg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 115); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 116); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCOption_CVec_ThirtyTwoBytesZZ ret_conv = *(LDKCOption_CVec_ThirtyTwoBytesZZ*)(ret_ptr); @@ -16403,35 +17205,42 @@ static void LDKOffersMessageHandler_JCalls_free(void* this_arg) { FREE(j_calls); } } -LDKCOption_OffersMessageZ handle_message_LDKOffersMessageHandler_jcall(const void* this_arg, LDKOffersMessage message) { +LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ handle_message_LDKOffersMessageHandler_jcall(const void* this_arg, LDKOffersMessage message, LDKCOption_OffersContextZ context, LDKResponder responder) { LDKOffersMessageHandler_JCalls *j_calls = (LDKOffersMessageHandler_JCalls*) this_arg; LDKOffersMessage *message_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); *message_copy = message; int64_t message_ref = tag_ptr(message_copy, true); - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 116, message_ref); + LDKCOption_OffersContextZ *context_copy = MALLOC(sizeof(LDKCOption_OffersContextZ), "LDKCOption_OffersContextZ"); + *context_copy = context; + int64_t context_ref = tag_ptr(context_copy, true); + LDKResponder responder_var = responder; + int64_t responder_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(responder_var); + responder_ref = tag_ptr(responder_var.inner, responder_var.is_owned); + uint64_t ret = js_invoke_function_l_lll(j_calls->instance_ptr, 117, message_ref, context_ref, responder_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); - LDKCOption_OffersMessageZ ret_conv = *(LDKCOption_OffersMessageZ*)(ret_ptr); + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ ret_conv = *(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ*)(ret_ptr); FREE(untag_ptr(ret)); return ret_conv; } -LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ release_pending_messages_LDKOffersMessageHandler_jcall(const void* this_arg) { +LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ release_pending_messages_LDKOffersMessageHandler_jcall(const void* this_arg) { LDKOffersMessageHandler_JCalls *j_calls = (LDKOffersMessageHandler_JCalls*) this_arg; - int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 117); - LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ ret_constr; + int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 118); + LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) - ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC3Tuple_OffersMessageDestinationBlindedPathZ), "LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ Elements"); + ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_OffersMessageMessageSendInstructionsZ), "LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ 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_OffersMessageDestinationBlindedPathZ ret_conv_49_conv = *(LDKC3Tuple_OffersMessageDestinationBlindedPathZ*)(ret_conv_49_ptr); - FREE(untag_ptr(ret_conv_49)); - ret_constr.data[x] = ret_conv_49_conv; + for (size_t w = 0; w < ret_constr.datalen; w++) { + int64_t ret_conv_48 = ret_vals[w]; + void* ret_conv_48_ptr = untag_ptr(ret_conv_48); + CHECK_ACCESS(ret_conv_48_ptr); + LDKC2Tuple_OffersMessageMessageSendInstructionsZ ret_conv_48_conv = *(LDKC2Tuple_OffersMessageMessageSendInstructionsZ*)(ret_conv_48_ptr); + FREE(untag_ptr(ret_conv_48)); + ret_constr.data[w] = ret_conv_48_conv; } FREE(ret); return ret_constr; @@ -16458,7 +17267,7 @@ uint64_t CS_LDK_LDKOffersMessageHandler_new(int32_t o) { *res_ptr = LDKOffersMessageHandler_init(o); return tag_ptr(res_ptr, true); } -int64_t CS_LDK_OffersMessageHandler_handle_message(int64_t this_arg, int64_t message) { +int64_t CS_LDK_OffersMessageHandler_handle_message(int64_t this_arg, int64_t message, int64_t context, int64_t responder) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKOffersMessageHandler* this_arg_conv = (LDKOffersMessageHandler*)this_arg_ptr; @@ -16466,8 +17275,17 @@ int64_t CS_LDK_OffersMessageHandler_handle_message(int64_t this_arg, int64_t me CHECK_ACCESS(message_ptr); LDKOffersMessage message_conv = *(LDKOffersMessage*)(message_ptr); message_conv = OffersMessage_clone((LDKOffersMessage*)untag_ptr(message)); - LDKCOption_OffersMessageZ *ret_copy = MALLOC(sizeof(LDKCOption_OffersMessageZ), "LDKCOption_OffersMessageZ"); - *ret_copy = (this_arg_conv->handle_message)(this_arg_conv->this_arg, message_conv); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKCOption_OffersContextZ context_conv = *(LDKCOption_OffersContextZ*)(context_ptr); + context_conv = COption_OffersContextZ_clone((LDKCOption_OffersContextZ*)untag_ptr(context)); + LDKResponder responder_conv; + responder_conv.inner = untag_ptr(responder); + responder_conv.is_owned = ptr_is_owned(responder); + CHECK_INNER_FIELD_ACCESS_OR_NULL(responder_conv); + responder_conv = Responder_clone(&responder_conv); + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ), "LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ"); + *ret_copy = (this_arg_conv->handle_message)(this_arg_conv->this_arg, message_conv, context_conv, responder_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -16476,14 +17294,143 @@ int64_tArray CS_LDK_OffersMessageHandler_release_pending_messages(int64_t this_ void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKOffersMessageHandler* this_arg_conv = (LDKOffersMessageHandler*)this_arg_ptr; - LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ ret_var = (this_arg_conv->release_pending_messages)(this_arg_conv->this_arg); + LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ ret_var = (this_arg_conv->release_pending_messages)(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_OffersMessageDestinationBlindedPathZ* ret_conv_49_conv = MALLOC(sizeof(LDKC3Tuple_OffersMessageDestinationBlindedPathZ), "LDKC3Tuple_OffersMessageDestinationBlindedPathZ"); - *ret_conv_49_conv = ret_var.data[x]; - ret_arr_ptr[x] = tag_ptr(ret_conv_49_conv, true); + for (size_t w = 0; w < ret_var.datalen; w++) { + LDKC2Tuple_OffersMessageMessageSendInstructionsZ* ret_conv_48_conv = MALLOC(sizeof(LDKC2Tuple_OffersMessageMessageSendInstructionsZ), "LDKC2Tuple_OffersMessageMessageSendInstructionsZ"); + *ret_conv_48_conv = ret_var.data[w]; + ret_arr_ptr[w] = tag_ptr(ret_conv_48_conv, true); + } + + FREE(ret_var.data); + return ret_arr; +} + +typedef struct LDKAsyncPaymentsMessageHandler_JCalls { + atomic_size_t refcnt; + uint32_t instance_ptr; +} LDKAsyncPaymentsMessageHandler_JCalls; +static void LDKAsyncPaymentsMessageHandler_JCalls_free(void* this_arg) { + LDKAsyncPaymentsMessageHandler_JCalls *j_calls = (LDKAsyncPaymentsMessageHandler_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + FREE(j_calls); + } +} +LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ held_htlc_available_LDKAsyncPaymentsMessageHandler_jcall(const void* this_arg, LDKHeldHtlcAvailable message, LDKResponder responder) { + LDKAsyncPaymentsMessageHandler_JCalls *j_calls = (LDKAsyncPaymentsMessageHandler_JCalls*) this_arg; + LDKHeldHtlcAvailable message_var = message; + int64_t message_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_var); + message_ref = tag_ptr(message_var.inner, message_var.is_owned); + LDKResponder responder_var = responder; + int64_t responder_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(responder_var); + responder_ref = tag_ptr(responder_var.inner, responder_var.is_owned); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 119, message_ref, responder_ref); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ ret_conv = *(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ*)(ret_ptr); + FREE(untag_ptr(ret)); + return ret_conv; +} +void release_held_htlc_LDKAsyncPaymentsMessageHandler_jcall(const void* this_arg, LDKReleaseHeldHtlc message) { + LDKAsyncPaymentsMessageHandler_JCalls *j_calls = (LDKAsyncPaymentsMessageHandler_JCalls*) this_arg; + LDKReleaseHeldHtlc message_var = message; + int64_t message_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_var); + message_ref = tag_ptr(message_var.inner, message_var.is_owned); + js_invoke_function_void_l(j_calls->instance_ptr, 120, message_ref); +} +LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ release_pending_messages_LDKAsyncPaymentsMessageHandler_jcall(const void* this_arg) { + LDKAsyncPaymentsMessageHandler_JCalls *j_calls = (LDKAsyncPaymentsMessageHandler_JCalls*) this_arg; + int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 121); + LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ ret_constr; + ret_constr.datalen = ret->arr_len; + if (ret_constr.datalen > 0) + ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ), "LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ Elements"); + else + ret_constr.data = NULL; + int64_t* ret_vals = ret->elems; + for (size_t d = 0; d < ret_constr.datalen; d++) { + int64_t ret_conv_55 = ret_vals[d]; + void* ret_conv_55_ptr = untag_ptr(ret_conv_55); + CHECK_ACCESS(ret_conv_55_ptr); + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ ret_conv_55_conv = *(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ*)(ret_conv_55_ptr); + FREE(untag_ptr(ret_conv_55)); + ret_constr.data[d] = ret_conv_55_conv; + } + FREE(ret); + return ret_constr; +} +static void LDKAsyncPaymentsMessageHandler_JCalls_cloned(LDKAsyncPaymentsMessageHandler* new_obj) { + LDKAsyncPaymentsMessageHandler_JCalls *j_calls = (LDKAsyncPaymentsMessageHandler_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +} +static inline LDKAsyncPaymentsMessageHandler LDKAsyncPaymentsMessageHandler_init (int64_t o) { + LDKAsyncPaymentsMessageHandler_JCalls *calls = MALLOC(sizeof(LDKAsyncPaymentsMessageHandler_JCalls), "LDKAsyncPaymentsMessageHandler_JCalls"); + atomic_init(&calls->refcnt, 1); + calls->instance_ptr = o; + + LDKAsyncPaymentsMessageHandler ret = { + .this_arg = (void*) calls, + .held_htlc_available = held_htlc_available_LDKAsyncPaymentsMessageHandler_jcall, + .release_held_htlc = release_held_htlc_LDKAsyncPaymentsMessageHandler_jcall, + .release_pending_messages = release_pending_messages_LDKAsyncPaymentsMessageHandler_jcall, + .free = LDKAsyncPaymentsMessageHandler_JCalls_free, + }; + return ret; +} +uint64_t CS_LDK_LDKAsyncPaymentsMessageHandler_new(int32_t o) { + LDKAsyncPaymentsMessageHandler *res_ptr = MALLOC(sizeof(LDKAsyncPaymentsMessageHandler), "LDKAsyncPaymentsMessageHandler"); + *res_ptr = LDKAsyncPaymentsMessageHandler_init(o); + return tag_ptr(res_ptr, true); +} +int64_t CS_LDK_AsyncPaymentsMessageHandler_held_htlc_available(int64_t this_arg, int64_t message, int64_t responder) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKAsyncPaymentsMessageHandler* this_arg_conv = (LDKAsyncPaymentsMessageHandler*)this_arg_ptr; + LDKHeldHtlcAvailable 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 = HeldHtlcAvailable_clone(&message_conv); + LDKResponder responder_conv; + responder_conv.inner = untag_ptr(responder); + responder_conv.is_owned = ptr_is_owned(responder); + CHECK_INNER_FIELD_ACCESS_OR_NULL(responder_conv); + responder_conv = Responder_clone(&responder_conv); + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ), "LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ"); + *ret_copy = (this_arg_conv->held_htlc_available)(this_arg_conv->this_arg, message_conv, responder_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_AsyncPaymentsMessageHandler_release_held_htlc(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); } + LDKAsyncPaymentsMessageHandler* this_arg_conv = (LDKAsyncPaymentsMessageHandler*)this_arg_ptr; + LDKReleaseHeldHtlc 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 = ReleaseHeldHtlc_clone(&message_conv); + (this_arg_conv->release_held_htlc)(this_arg_conv->this_arg, message_conv); +} + +int64_tArray CS_LDK_AsyncPaymentsMessageHandler_release_pending_messages(int64_t this_arg) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKAsyncPaymentsMessageHandler* this_arg_conv = (LDKAsyncPaymentsMessageHandler*)this_arg_ptr; + LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ ret_var = (this_arg_conv->release_pending_messages)(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 d = 0; d < ret_var.datalen; d++) { + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ* ret_conv_55_conv = MALLOC(sizeof(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ), "LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ"); + *ret_conv_55_conv = ret_var.data[d]; + ret_arr_ptr[d] = tag_ptr(ret_conv_55_conv, true); } FREE(ret_var.data); @@ -16503,7 +17450,7 @@ static void LDKNodeIdLookUp_JCalls_free(void* this_arg) { 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); + int8_tArray ret = (int8_tArray)js_invoke_function_l_l(j_calls->instance_ptr, 122, short_channel_id_conv); LDKPublicKey ret_ref; CHECK(ret->arr_len == 33); memcpy(ret_ref.compressed_form, ret->elems, 33); FREE(ret); @@ -16557,7 +17504,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, 119, msg_ref); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 123, msg_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr); @@ -16571,7 +17518,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, 120, msg_ref); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 124, msg_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr); @@ -16585,7 +17532,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, 121, msg_ref); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 125, msg_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr); @@ -16595,7 +17542,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, 122, starting_point_conv); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 126, starting_point_conv); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_conv = *(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)(ret_ptr); @@ -16608,7 +17555,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, 123, starting_point_ref); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 127, starting_point_ref); LDKNodeAnnouncement ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -16625,7 +17572,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, 124, (int64_t)their_node_id_arr, init_ref, inbound_conv); + uint64_t ret = js_invoke_function_l_llb(j_calls->instance_ptr, 128, (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); @@ -16640,7 +17587,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, 125, (int64_t)their_node_id_arr, msg_ref); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 129, (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); @@ -16655,7 +17602,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, 126, (int64_t)their_node_id_arr, msg_ref); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 130, (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); @@ -16670,7 +17617,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, 127, (int64_t)their_node_id_arr, msg_ref); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 131, (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); @@ -16685,7 +17632,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, 128, (int64_t)their_node_id_arr, msg_ref); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 132, (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); @@ -16694,11 +17641,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, 129); + return js_invoke_function_b_(j_calls->instance_ptr, 133); } 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, 130); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 134); LDKNodeFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -16709,7 +17656,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, 131, (int64_t)their_node_id_arr); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 135, (int64_t)their_node_id_arr); LDKInitFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -16948,27 +17895,6 @@ static void LDKOnionMessageHandler_JCalls_free(void* this_arg) { FREE(j_calls); } } -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, 132); - LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ ret_constr; - ret_constr.datalen = ret->arr_len; - if (ret_constr.datalen > 0) - ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ), "LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ Elements"); - else - ret_constr.data = NULL; - int64_t* ret_vals = ret->elems; - for (size_t o = 0; o < ret_constr.datalen; o++) { - int64_t ret_conv_40 = ret_vals[o]; - void* ret_conv_40_ptr = untag_ptr(ret_conv_40); - CHECK_ACCESS(ret_conv_40_ptr); - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ ret_conv_40_conv = *(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ*)(ret_conv_40_ptr); - FREE(untag_ptr(ret_conv_40)); - ret_constr.data[o] = ret_conv_40_conv; - } - FREE(ret); - return ret_constr; -} void handle_onion_message_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey peer_node_id, const LDKOnionMessage * msg) { LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg; int8_tArray peer_node_id_arr = init_int8_tArray(33, __LINE__); @@ -16978,13 +17904,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, 133, (int64_t)peer_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 136, (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, 134, (int64_t)peer_node_id_arr); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 137, (int64_t)peer_node_id_arr); LDKOnionMessage ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -17001,7 +17927,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, 135, (int64_t)their_node_id_arr, init_ref, inbound_conv); + uint64_t ret = js_invoke_function_l_llb(j_calls->instance_ptr, 138, (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); @@ -17012,15 +17938,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, 136, (int64_t)their_node_id_arr); + js_invoke_function_void_l(j_calls->instance_ptr, 139, (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, 137); + js_invoke_function_void_(j_calls->instance_ptr, 140); } 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, 138); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 141); LDKNodeFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -17031,7 +17957,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, 139, (int64_t)their_node_id_arr); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 142, (int64_t)their_node_id_arr); LDKInitFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -17049,7 +17975,6 @@ static inline LDKOnionMessageHandler LDKOnionMessageHandler_init (int64_t o) { LDKOnionMessageHandler ret = { .this_arg = (void*) calls, - .get_and_clear_connections_needed = get_and_clear_connections_needed_LDKOnionMessageHandler_jcall, .handle_onion_message = handle_onion_message_LDKOnionMessageHandler_jcall, .next_onion_message_for_peer = next_onion_message_for_peer_LDKOnionMessageHandler_jcall, .peer_connected = peer_connected_LDKOnionMessageHandler_jcall, @@ -17066,24 +17991,6 @@ uint64_t CS_LDK_LDKOnionMessageHandler_new(int32_t o) { *res_ptr = LDKOnionMessageHandler_init(o); return tag_ptr(res_ptr, true); } -int64_tArray CS_LDK_OnionMessageHandler_get_and_clear_connections_needed(int64_t this_arg) { - void* this_arg_ptr = untag_ptr(this_arg); - if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr; - LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ ret_var = (this_arg_conv->get_and_clear_connections_needed)(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 o = 0; o < ret_var.datalen; o++) { - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* ret_conv_40_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ), "LDKC2Tuple_PublicKeyCVec_SocketAddressZZ"); - *ret_conv_40_conv = ret_var.data[o]; - ret_arr_ptr[o] = tag_ptr(ret_conv_40_conv, true); - } - - FREE(ret_var.data); - return ret_arr; -} - void CS_LDK_OnionMessageHandler_handle_onion_message(int64_t this_arg, int8_tArray peer_node_id, int64_t msg) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } @@ -17188,7 +18095,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, 140, message_type_conv, (int64_t)buffer_arr); + uint64_t ret = js_invoke_function_l_sl(j_calls->instance_ptr, 143, 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); @@ -17246,7 +18153,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, 141, tag_ptr(msg_ret, true), (int64_t)sender_node_id_arr); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 144, 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); @@ -17255,7 +18162,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, 142); + int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 145); LDKCVec_C2Tuple_PublicKeyTypeZZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) @@ -17274,9 +18181,32 @@ LDKCVec_C2Tuple_PublicKeyTypeZZ get_and_clear_pending_msg_LDKCustomMessageHandle FREE(ret); return ret_constr; } +void peer_disconnected_LDKCustomMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id) { + 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); + js_invoke_function_void_l(j_calls->instance_ptr, 146, (int64_t)their_node_id_arr); +} +LDKCResult_NoneNoneZ peer_connected_LDKCustomMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * msg, bool inbound) { + 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); + LDKInit msg_var = *msg; + int64_t msg_ref = 0; + msg_var = Init_clone(&msg_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); + msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); + jboolean inbound_conv = inbound; + uint64_t ret = js_invoke_function_l_llb(j_calls->instance_ptr, 147, (int64_t)their_node_id_arr, msg_ref, inbound_conv); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr); + FREE(untag_ptr(ret)); + return ret_conv; +} 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, 143); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 148); LDKNodeFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -17287,7 +18217,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, 144, (int64_t)their_node_id_arr); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 149, (int64_t)their_node_id_arr); LDKInitFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -17308,6 +18238,8 @@ static inline LDKCustomMessageHandler LDKCustomMessageHandler_init (int64_t o, i .this_arg = (void*) calls, .handle_custom_message = handle_custom_message_LDKCustomMessageHandler_jcall, .get_and_clear_pending_msg = get_and_clear_pending_msg_LDKCustomMessageHandler_jcall, + .peer_disconnected = peer_disconnected_LDKCustomMessageHandler_jcall, + .peer_connected = peer_connected_LDKCustomMessageHandler_jcall, .provided_node_features = provided_node_features_LDKCustomMessageHandler_jcall, .provided_init_features = provided_init_features_LDKCustomMessageHandler_jcall, .free = LDKCustomMessageHandler_JCalls_free, @@ -17358,6 +18290,33 @@ int64_tArray CS_LDK_CustomMessageHandler_get_and_clear_pending_msg(int64_t this return ret_arr; } +void CS_LDK_CustomMessageHandler_peer_disconnected(int64_t this_arg, int8_tArray their_node_id) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr; + LDKPublicKey their_node_id_ref; + CHECK(their_node_id->arr_len == 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); + (this_arg_conv->peer_disconnected)(this_arg_conv->this_arg, their_node_id_ref); +} + +int64_t CS_LDK_CustomMessageHandler_peer_connected(int64_t this_arg, int8_tArray their_node_id, int64_t msg, jboolean inbound) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr; + LDKPublicKey their_node_id_ref; + CHECK(their_node_id->arr_len == 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); + LDKInit msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv, inbound); + return tag_ptr(ret_conv, true); +} + int64_t CS_LDK_CustomMessageHandler_provided_node_features(int64_t this_arg) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } @@ -17393,14 +18352,21 @@ static void LDKCustomOnionMessageHandler_JCalls_free(void* this_arg) { FREE(j_calls); } } -LDKCOption_OnionMessageContentsZ handle_custom_message_LDKCustomOnionMessageHandler_jcall(const void* this_arg, LDKOnionMessageContents msg) { +LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ handle_custom_message_LDKCustomOnionMessageHandler_jcall(const void* this_arg, LDKOnionMessageContents message, LDKCOption_CVec_u8ZZ context, LDKResponder responder) { 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, 145, tag_ptr(msg_ret, true)); + LDKOnionMessageContents* message_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *message_ret = message; + LDKCOption_CVec_u8ZZ *context_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *context_copy = context; + int64_t context_ref = tag_ptr(context_copy, true); + LDKResponder responder_var = responder; + int64_t responder_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(responder_var); + responder_ref = tag_ptr(responder_var.inner, responder_var.is_owned); + uint64_t ret = js_invoke_function_l_lll(j_calls->instance_ptr, 150, tag_ptr(message_ret, true), context_ref, responder_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); - LDKCOption_OnionMessageContentsZ ret_conv = *(LDKCOption_OnionMessageContentsZ*)(ret_ptr); + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ ret_conv = *(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ*)(ret_ptr); FREE(untag_ptr(ret)); return ret_conv; } @@ -17410,30 +18376,30 @@ 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, 146, message_type_conv, (int64_t)buffer_arr); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 151, 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); FREE(untag_ptr(ret)); return ret_conv; } -LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ release_pending_custom_messages_LDKCustomOnionMessageHandler_jcall(const void* this_arg) { +LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ 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, 147); - LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ ret_constr; + int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 152); + LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) - ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ), "LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ Elements"); + ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ), "LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ Elements"); else ret_constr.data = NULL; int64_t* ret_vals = ret->elems; - for (size_t e = 0; e < ret_constr.datalen; e++) { - int64_t ret_conv_56 = ret_vals[e]; - void* ret_conv_56_ptr = untag_ptr(ret_conv_56); - CHECK_ACCESS(ret_conv_56_ptr); - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ ret_conv_56_conv = *(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ*)(ret_conv_56_ptr); - FREE(untag_ptr(ret_conv_56)); - ret_constr.data[e] = ret_conv_56_conv; + for (size_t d = 0; d < ret_constr.datalen; d++) { + int64_t ret_conv_55 = ret_vals[d]; + void* ret_conv_55_ptr = untag_ptr(ret_conv_55); + CHECK_ACCESS(ret_conv_55_ptr); + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ ret_conv_55_conv = *(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ*)(ret_conv_55_ptr); + FREE(untag_ptr(ret_conv_55)); + ret_constr.data[d] = ret_conv_55_conv; } FREE(ret); return ret_constr; @@ -17461,19 +18427,28 @@ uint64_t CS_LDK_LDKCustomOnionMessageHandler_new(int32_t o) { *res_ptr = LDKCustomOnionMessageHandler_init(o); return tag_ptr(res_ptr, true); } -int64_t CS_LDK_CustomOnionMessageHandler_handle_custom_message(int64_t this_arg, int64_t msg) { +int64_t CS_LDK_CustomOnionMessageHandler_handle_custom_message(int64_t this_arg, int64_t message, int64_t context, int64_t responder) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKCustomOnionMessageHandler* this_arg_conv = (LDKCustomOnionMessageHandler*)this_arg_ptr; - void* msg_ptr = untag_ptr(msg); - CHECK_ACCESS(msg_ptr); - LDKOnionMessageContents msg_conv = *(LDKOnionMessageContents*)(msg_ptr); - if (msg_conv.free == LDKOnionMessageContents_JCalls_free) { + void* message_ptr = untag_ptr(message); + CHECK_ACCESS(message_ptr); + LDKOnionMessageContents message_conv = *(LDKOnionMessageContents*)(message_ptr); + if (message_conv.free == LDKOnionMessageContents_JCalls_free) { // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKOnionMessageContents_JCalls_cloned(&msg_conv); + LDKOnionMessageContents_JCalls_cloned(&message_conv); } - LDKCOption_OnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_OnionMessageContentsZ), "LDKCOption_OnionMessageContentsZ"); - *ret_copy = (this_arg_conv->handle_custom_message)(this_arg_conv->this_arg, msg_conv); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKCOption_CVec_u8ZZ context_conv = *(LDKCOption_CVec_u8ZZ*)(context_ptr); + context_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(context)); + LDKResponder responder_conv; + responder_conv.inner = untag_ptr(responder); + responder_conv.is_owned = ptr_is_owned(responder); + CHECK_INNER_FIELD_ACCESS_OR_NULL(responder_conv); + responder_conv = Responder_clone(&responder_conv); + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ), "LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ"); + *ret_copy = (this_arg_conv->handle_custom_message)(this_arg_conv->this_arg, message_conv, context_conv, responder_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -17495,14 +18470,14 @@ int64_tArray CS_LDK_CustomOnionMessageHandler_release_pending_custom_messages(i void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKCustomOnionMessageHandler* this_arg_conv = (LDKCustomOnionMessageHandler*)this_arg_ptr; - LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ ret_var = (this_arg_conv->release_pending_custom_messages)(this_arg_conv->this_arg); + LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ ret_var = (this_arg_conv->release_pending_custom_messages)(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 e = 0; e < ret_var.datalen; e++) { - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ* ret_conv_56_conv = MALLOC(sizeof(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ), "LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ"); - *ret_conv_56_conv = ret_var.data[e]; - ret_arr_ptr[e] = tag_ptr(ret_conv_56_conv, true); + for (size_t d = 0; d < ret_var.datalen; d++) { + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ* ret_conv_55_conv = MALLOC(sizeof(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ), "LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ"); + *ret_conv_55_conv = ret_var.data[d]; + ret_arr_ptr[d] = tag_ptr(ret_conv_55_conv, true); } FREE(ret_var.data); @@ -17525,21 +18500,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, 148, (int64_t)data_arr, resume_read_conv); + return js_invoke_function_l_lb(j_calls->instance_ptr, 153, (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, 149); + js_invoke_function_void_(j_calls->instance_ptr, 154); } 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, 150, tag_ptr(other_arg_clone, true)); + return js_invoke_function_b_l(j_calls->instance_ptr, 155, 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, 151); + return js_invoke_function_l_(j_calls->instance_ptr, 156); } static void LDKSocketDescriptor_JCalls_cloned(LDKSocketDescriptor* new_obj) { LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) new_obj->this_arg; @@ -17593,6 +18568,22 @@ int64_t CS_LDK_SocketDescriptor_hash(int64_t this_arg) { return ret_conv; } +uint32_t CS_LDK_LDKBolt12PaymentError_ty_from_ptr(int64_t ptr) { + LDKBolt12PaymentError *obj = (LDKBolt12PaymentError*)untag_ptr(ptr); + switch(obj->tag) { + case LDKBolt12PaymentError_UnexpectedInvoice: return 0; + case LDKBolt12PaymentError_DuplicateInvoice: return 1; + case LDKBolt12PaymentError_UnknownRequiredFeatures: return 2; + case LDKBolt12PaymentError_SendingFailed: return 3; + default: abort(); + } +} +int32_t CS_LDK_LDKBolt12PaymentError_SendingFailed_get_sending_failed(int64_t ptr) { + LDKBolt12PaymentError *obj = (LDKBolt12PaymentError*)untag_ptr(ptr); + CHECK(obj->tag == LDKBolt12PaymentError_SendingFailed); + int32_t sending_failed_conv = LDKRetryableSendFailure_to_cs(obj->sending_failed); + return sending_failed_conv; +} typedef struct LDKSignBolt12InvoiceFn_JCalls { atomic_size_t refcnt; uint32_t instance_ptr; @@ -17610,7 +18601,7 @@ LDKCResult_SchnorrSignatureNoneZ sign_invoice_LDKSignBolt12InvoiceFn_jcall(const 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); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 157, message_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_SchnorrSignatureNoneZ ret_conv = *(LDKCResult_SchnorrSignatureNoneZ*)(ret_ptr); @@ -17669,7 +18660,7 @@ LDKCResult_SchnorrSignatureNoneZ sign_invoice_request_LDKSignInvoiceRequestFn_jc 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); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 158, message_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_SchnorrSignatureNoneZ ret_conv = *(LDKCResult_SchnorrSignatureNoneZ*)(ret_ptr); @@ -17778,15 +18769,16 @@ uint32_t CS_LDK_LDKPayee_ty_from_ptr(int64_t ptr) { int64_tArray CS_LDK_LDKPayee_Blinded_get_route_hints(int64_t ptr) { LDKPayee *obj = (LDKPayee*)untag_ptr(ptr); CHECK(obj->tag == LDKPayee_Blinded); - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ route_hints_var = obj->blinded.route_hints; + LDKCVec_BlindedPaymentPathZ route_hints_var = obj->blinded.route_hints; int64_tArray route_hints_arr = NULL; route_hints_arr = init_int64_tArray(route_hints_var.datalen, __LINE__); int64_t *route_hints_arr_ptr = (int64_t*)(((uint8_t*)route_hints_arr) + 8); - for (size_t l = 0; l < route_hints_var.datalen; l++) { - LDKC2Tuple_BlindedPayInfoBlindedPathZ* route_hints_conv_37_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ"); - *route_hints_conv_37_conv = route_hints_var.data[l]; - *route_hints_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone(route_hints_conv_37_conv); - route_hints_arr_ptr[l] = tag_ptr(route_hints_conv_37_conv, true); + for (size_t u = 0; u < route_hints_var.datalen; u++) { + LDKBlindedPaymentPath route_hints_conv_20_var = route_hints_var.data[u]; + int64_t route_hints_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_hints_conv_20_var); + route_hints_conv_20_ref = tag_ptr(route_hints_conv_20_var.inner, false); + route_hints_arr_ptr[u] = route_hints_conv_20_ref; } return route_hints_arr; @@ -17853,7 +18845,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, 154); + int8_tArray ret = (int8_tArray)js_invoke_function_l_(j_calls->instance_ptr, 159); LDKCVec_u8Z ret_ref; ret_ref.datalen = ret->arr_len; ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes"); @@ -17964,7 +18956,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, 155, (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, 160, (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); @@ -17977,7 +18969,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, 156, (int64_t)psbt_arr); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 161, (int64_t)psbt_arr); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_TransactionNoneZ ret_conv = *(LDKCResult_TransactionNoneZ*)(ret_ptr); @@ -18076,7 +19068,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, 157); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 162); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_CVec_UtxoZNoneZ ret_conv = *(LDKCResult_CVec_UtxoZNoneZ*)(ret_ptr); @@ -18085,7 +19077,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, 158); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 163); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_CVec_u8ZNoneZ ret_conv = *(LDKCResult_CVec_u8ZNoneZ*)(ret_ptr); @@ -18098,7 +19090,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, 159, (int64_t)psbt_arr); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 164, (int64_t)psbt_arr); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_TransactionNoneZ ret_conv = *(LDKCResult_TransactionNoneZ*)(ret_ptr); @@ -18653,24 +19645,78 @@ int64_t CS_LDK_COption_u64Z_clone(int64_t orig) { return ret_ref; } -void CS_LDK_CVec_BlindedPathZ_free(int64_tArray _res) { - LDKCVec_BlindedPathZ _res_constr; +void CS_LDK_CVec_BlindedMessagePathZ_free(int64_tArray _res) { + LDKCVec_BlindedMessagePathZ _res_constr; _res_constr.datalen = _res->arr_len; if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKBlindedPath), "LDKCVec_BlindedPathZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKBlindedMessagePath), "LDKCVec_BlindedMessagePathZ Elements"); else _res_constr.data = NULL; int64_t* _res_vals = _res->elems; - for (size_t n = 0; n < _res_constr.datalen; n++) { - int64_t _res_conv_13 = _res_vals[n]; - LDKBlindedPath _res_conv_13_conv; - _res_conv_13_conv.inner = untag_ptr(_res_conv_13); - _res_conv_13_conv.is_owned = ptr_is_owned(_res_conv_13); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_13_conv); - _res_constr.data[n] = _res_conv_13_conv; + for (size_t u = 0; u < _res_constr.datalen; u++) { + int64_t _res_conv_20 = _res_vals[u]; + LDKBlindedMessagePath _res_conv_20_conv; + _res_conv_20_conv.inner = untag_ptr(_res_conv_20); + _res_conv_20_conv.is_owned = ptr_is_owned(_res_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_20_conv); + _res_constr.data[u] = _res_conv_20_conv; } FREE(_res); - CVec_BlindedPathZ_free(_res_constr); + CVec_BlindedMessagePathZ_free(_res_constr); +} + +int64_t CS_LDK_CResult_RefundDecodeErrorZ_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_RefundDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundDecodeErrorZ), "LDKCResult_RefundDecodeErrorZ"); + *ret_conv = CResult_RefundDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_RefundDecodeErrorZ_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_RefundDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundDecodeErrorZ), "LDKCResult_RefundDecodeErrorZ"); + *ret_conv = CResult_RefundDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_RefundDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_RefundDecodeErrorZ* o_conv = (LDKCResult_RefundDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_RefundDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_RefundDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_RefundDecodeErrorZ _res_conv = *(LDKCResult_RefundDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_RefundDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_RefundDecodeErrorZ_clone_ptr(LDKCResult_RefundDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RefundDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundDecodeErrorZ), "LDKCResult_RefundDecodeErrorZ"); + *ret_conv = CResult_RefundDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_RefundDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_RefundDecodeErrorZ* arg_conv = (LDKCResult_RefundDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_RefundDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_RefundDecodeErrorZ_clone(int64_t orig) { + LDKCResult_RefundDecodeErrorZ* orig_conv = (LDKCResult_RefundDecodeErrorZ*)untag_ptr(orig); + LDKCResult_RefundDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundDecodeErrorZ), "LDKCResult_RefundDecodeErrorZ"); + *ret_conv = CResult_RefundDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } int64_t CS_LDK_CResult_RefundBolt12ParseErrorZ_ok(int64_t o) { @@ -19274,6 +20320,23 @@ int64_t CS_LDK_CResult_SchnorrSignatureNoneZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +void CS_LDK_CVec_StrZ_free(ptrArray _res) { + LDKCVec_StrZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKStr), "LDKCVec_StrZ Elements"); + else + _res_constr.data = NULL; + jstring* _res_vals = (void*) _res->elems; + for (size_t i = 0; i < _res_constr.datalen; i++) { + jstring _res_conv_8 = _res_vals[i]; + LDKStr dummy = { .chars = NULL, .len = 0, .chars_is_owned = false }; + _res_constr.data[i] = dummy; + } + FREE(_res); + CVec_StrZ_free(_res_constr); +} + void CS_LDK_CVec_ThirtyTwoBytesZ_free(ptrArray _res) { LDKCVec_ThirtyTwoBytesZ _res_constr; _res_constr.datalen = _res->arr_len; @@ -19493,57 +20556,57 @@ int64_t CS_LDK_CResult_ThirtyTwoBytesNoneZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_ok(int64_t o) { - LDKBlindedPayInfo o_conv; +int64_t CS_LDK_CResult_Bolt12InvoiceDecodeErrorZ_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 = BlindedPayInfo_clone(&o_conv); - LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); - *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_ok(o_conv); + o_conv = Bolt12Invoice_clone(&o_conv); + LDKCResult_Bolt12InvoiceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceDecodeErrorZ), "LDKCResult_Bolt12InvoiceDecodeErrorZ"); + *ret_conv = CResult_Bolt12InvoiceDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_Bolt12InvoiceDecodeErrorZ_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_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); - *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_err(e_conv); + LDKCResult_Bolt12InvoiceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceDecodeErrorZ), "LDKCResult_Bolt12InvoiceDecodeErrorZ"); + *ret_conv = CResult_Bolt12InvoiceDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_BlindedPayInfoDecodeErrorZ* o_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_BlindedPayInfoDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_Bolt12InvoiceDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_Bolt12InvoiceDecodeErrorZ* o_conv = (LDKCResult_Bolt12InvoiceDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_Bolt12InvoiceDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_Bolt12InvoiceDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_BlindedPayInfoDecodeErrorZ _res_conv = *(LDKCResult_BlindedPayInfoDecodeErrorZ*)(_res_ptr); + LDKCResult_Bolt12InvoiceDecodeErrorZ _res_conv = *(LDKCResult_Bolt12InvoiceDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_BlindedPayInfoDecodeErrorZ_free(_res_conv); + CResult_Bolt12InvoiceDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_BlindedPayInfoDecodeErrorZ_clone_ptr(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); - *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_clone(arg); +static inline uint64_t CResult_Bolt12InvoiceDecodeErrorZ_clone_ptr(LDKCResult_Bolt12InvoiceDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_Bolt12InvoiceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceDecodeErrorZ), "LDKCResult_Bolt12InvoiceDecodeErrorZ"); + *ret_conv = CResult_Bolt12InvoiceDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_BlindedPayInfoDecodeErrorZ* arg_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_BlindedPayInfoDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_Bolt12InvoiceDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_Bolt12InvoiceDecodeErrorZ* arg_conv = (LDKCResult_Bolt12InvoiceDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_Bolt12InvoiceDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_clone(int64_t orig) { - LDKCResult_BlindedPayInfoDecodeErrorZ* orig_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(orig); - LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); - *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_Bolt12InvoiceDecodeErrorZ_clone(int64_t orig) { + LDKCResult_Bolt12InvoiceDecodeErrorZ* orig_conv = (LDKCResult_Bolt12InvoiceDecodeErrorZ*)untag_ptr(orig); + LDKCResult_Bolt12InvoiceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceDecodeErrorZ), "LDKCResult_Bolt12InvoiceDecodeErrorZ"); + *ret_conv = CResult_Bolt12InvoiceDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -19985,51 +21048,6 @@ int64_t CS_LDK_CResult_HTLCDescriptorDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_NoneNoneZ_ok() { - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = CResult_NoneNoneZ_ok(); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_NoneNoneZ_err() { - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = CResult_NoneNoneZ_err(); - return tag_ptr(ret_conv, true); -} - -jboolean CS_LDK_CResult_NoneNoneZ_is_ok(int64_t o) { - LDKCResult_NoneNoneZ* o_conv = (LDKCResult_NoneNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_NoneNoneZ_is_ok(o_conv); - return ret_conv; -} - -void CS_LDK_CResult_NoneNoneZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_NoneNoneZ _res_conv = *(LDKCResult_NoneNoneZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_NoneNoneZ_free(_res_conv); -} - -static inline uint64_t CResult_NoneNoneZ_clone_ptr(LDKCResult_NoneNoneZ *NONNULL_PTR arg) { - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = CResult_NoneNoneZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t CS_LDK_CResult_NoneNoneZ_clone_ptr(int64_t arg) { - LDKCResult_NoneNoneZ* arg_conv = (LDKCResult_NoneNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_NoneNoneZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_CResult_NoneNoneZ_clone(int64_t orig) { - LDKCResult_NoneNoneZ* orig_conv = (LDKCResult_NoneNoneZ*)untag_ptr(orig); - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = CResult_NoneNoneZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - int64_t CS_LDK_CResult_PublicKeyNoneZ_ok(int8_tArray o) { LDKPublicKey o_ref; CHECK(o->arr_len == 33); @@ -20078,6 +21096,99 @@ int64_t CS_LDK_CResult_PublicKeyNoneZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_CResult__u832NoneZ_ok(int8_tArray o) { + LDKThirtyTwoBytes o_ref; + CHECK(o->arr_len == 32); + memcpy(o_ref.data, o->elems, 32); FREE(o); + LDKCResult__u832NoneZ* ret_conv = MALLOC(sizeof(LDKCResult__u832NoneZ), "LDKCResult__u832NoneZ"); + *ret_conv = CResult__u832NoneZ_ok(o_ref); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult__u832NoneZ_err() { + LDKCResult__u832NoneZ* ret_conv = MALLOC(sizeof(LDKCResult__u832NoneZ), "LDKCResult__u832NoneZ"); + *ret_conv = CResult__u832NoneZ_err(); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult__u832NoneZ_is_ok(int64_t o) { + LDKCResult__u832NoneZ* o_conv = (LDKCResult__u832NoneZ*)untag_ptr(o); + jboolean ret_conv = CResult__u832NoneZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult__u832NoneZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult__u832NoneZ _res_conv = *(LDKCResult__u832NoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult__u832NoneZ_free(_res_conv); +} + +static inline uint64_t CResult__u832NoneZ_clone_ptr(LDKCResult__u832NoneZ *NONNULL_PTR arg) { + LDKCResult__u832NoneZ* ret_conv = MALLOC(sizeof(LDKCResult__u832NoneZ), "LDKCResult__u832NoneZ"); + *ret_conv = CResult__u832NoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult__u832NoneZ_clone_ptr(int64_t arg) { + LDKCResult__u832NoneZ* arg_conv = (LDKCResult__u832NoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult__u832NoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult__u832NoneZ_clone(int64_t orig) { + LDKCResult__u832NoneZ* orig_conv = (LDKCResult__u832NoneZ*)untag_ptr(orig); + LDKCResult__u832NoneZ* ret_conv = MALLOC(sizeof(LDKCResult__u832NoneZ), "LDKCResult__u832NoneZ"); + *ret_conv = CResult__u832NoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_NoneNoneZ_ok() { + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = CResult_NoneNoneZ_ok(); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_NoneNoneZ_err() { + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = CResult_NoneNoneZ_err(); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_NoneNoneZ_is_ok(int64_t o) { + LDKCResult_NoneNoneZ* o_conv = (LDKCResult_NoneNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_NoneNoneZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_NoneNoneZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_NoneNoneZ _res_conv = *(LDKCResult_NoneNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_NoneNoneZ_free(_res_conv); +} + +static inline uint64_t CResult_NoneNoneZ_clone_ptr(LDKCResult_NoneNoneZ *NONNULL_PTR arg) { + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = CResult_NoneNoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_NoneNoneZ_clone_ptr(int64_t arg) { + LDKCResult_NoneNoneZ* arg_conv = (LDKCResult_NoneNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_NoneNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_NoneNoneZ_clone(int64_t orig) { + LDKCResult_NoneNoneZ* orig_conv = (LDKCResult_NoneNoneZ*)untag_ptr(orig); + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = CResult_NoneNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + int64_t CS_LDK_COption_BigEndianScalarZ_some(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -20125,23 +21236,6 @@ int64_t CS_LDK_COption_BigEndianScalarZ_clone(int64_t orig) { return ret_ref; } -void CS_LDK_CVec_U5Z_free(ptrArray _res) { - LDKCVec_U5Z _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKU5), "LDKCVec_U5Z Elements"); - else - _res_constr.data = NULL; - int8_t* _res_vals = (void*) _res->elems; - for (size_t h = 0; h < _res_constr.datalen; h++) { - int8_t _res_conv_7 = _res_vals[h]; - - _res_constr.data[h] = (LDKU5){ ._0 = _res_conv_7 }; - } - FREE(_res); - CVec_U5Z_free(_res_constr); -} - int64_t CS_LDK_CResult_RecoverableSignatureNoneZ_ok(int8_tArray o) { LDKRecoverableSignature o_ref; CHECK(o->arr_len == 68); @@ -20288,59 +21382,59 @@ int64_t CS_LDK_CResult_TransactionNoneZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(int64_t o) { +int64_t CS_LDK_CResult_EcdsaChannelSignerDecodeErrorZ_ok(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); - LDKWriteableEcdsaChannelSigner o_conv = *(LDKWriteableEcdsaChannelSigner*)(o_ptr); - if (o_conv.free == LDKWriteableEcdsaChannelSigner_JCalls_free) { + LDKEcdsaChannelSigner o_conv = *(LDKEcdsaChannelSigner*)(o_ptr); + if (o_conv.free == LDKEcdsaChannelSigner_JCalls_free) { // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKWriteableEcdsaChannelSigner_JCalls_cloned(&o_conv); + LDKEcdsaChannelSigner_JCalls_cloned(&o_conv); } - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ), "LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ"); - *ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(o_conv); + LDKCResult_EcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_EcdsaChannelSignerDecodeErrorZ), "LDKCResult_EcdsaChannelSignerDecodeErrorZ"); + *ret_conv = CResult_EcdsaChannelSignerDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_EcdsaChannelSignerDecodeErrorZ_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_WriteableEcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ), "LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ"); - *ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err(e_conv); + LDKCResult_EcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_EcdsaChannelSignerDecodeErrorZ), "LDKCResult_EcdsaChannelSignerDecodeErrorZ"); + *ret_conv = CResult_EcdsaChannelSignerDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* o_conv = (LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_EcdsaChannelSignerDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_EcdsaChannelSignerDecodeErrorZ* o_conv = (LDKCResult_EcdsaChannelSignerDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_EcdsaChannelSignerDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_EcdsaChannelSignerDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ _res_conv = *(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)(_res_ptr); + LDKCResult_EcdsaChannelSignerDecodeErrorZ _res_conv = *(LDKCResult_EcdsaChannelSignerDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free(_res_conv); + CResult_EcdsaChannelSignerDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone_ptr(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ), "LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ"); - *ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(arg); +static inline uint64_t CResult_EcdsaChannelSignerDecodeErrorZ_clone_ptr(LDKCResult_EcdsaChannelSignerDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_EcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_EcdsaChannelSignerDecodeErrorZ), "LDKCResult_EcdsaChannelSignerDecodeErrorZ"); + *ret_conv = CResult_EcdsaChannelSignerDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* arg_conv = (LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_EcdsaChannelSignerDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_EcdsaChannelSignerDecodeErrorZ* arg_conv = (LDKCResult_EcdsaChannelSignerDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_EcdsaChannelSignerDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(int64_t orig) { - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* orig_conv = (LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)untag_ptr(orig); - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ), "LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ"); - *ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_EcdsaChannelSignerDecodeErrorZ_clone(int64_t orig) { + LDKCResult_EcdsaChannelSignerDecodeErrorZ* orig_conv = (LDKCResult_EcdsaChannelSignerDecodeErrorZ*)untag_ptr(orig); + LDKCResult_EcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_EcdsaChannelSignerDecodeErrorZ), "LDKCResult_EcdsaChannelSignerDecodeErrorZ"); + *ret_conv = CResult_EcdsaChannelSignerDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -20828,6 +21922,101 @@ int64_t CS_LDK_CResult_NoneIOErrorZ_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); +} + void CS_LDK_CVec_ChannelDetailsZ_free(int64_tArray _res) { LDKCVec_ChannelDetailsZ _res_constr; _res_constr.datalen = _res->arr_len; @@ -20903,127 +22092,85 @@ int64_t CS_LDK_CResult_RouteLightningErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -static inline uint64_t C2Tuple_BlindedPayInfoBlindedPathZ_clone_ptr(LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR arg) { - LDKC2Tuple_BlindedPayInfoBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ"); - *ret_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t CS_LDK_C2Tuple_BlindedPayInfoBlindedPathZ_clone_ptr(int64_t arg) { - LDKC2Tuple_BlindedPayInfoBlindedPathZ* arg_conv = (LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(arg); - int64_t ret_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_C2Tuple_BlindedPayInfoBlindedPathZ_clone(int64_t orig) { - LDKC2Tuple_BlindedPayInfoBlindedPathZ* orig_conv = (LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(orig); - LDKC2Tuple_BlindedPayInfoBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ"); - *ret_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_C2Tuple_BlindedPayInfoBlindedPathZ_new(int64_t a, int64_t b) { - LDKBlindedPayInfo a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = BlindedPayInfo_clone(&a_conv); - LDKBlindedPath b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv = BlindedPath_clone(&b_conv); - LDKC2Tuple_BlindedPayInfoBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ"); - *ret_conv = C2Tuple_BlindedPayInfoBlindedPathZ_new(a_conv, b_conv); - return tag_ptr(ret_conv, true); -} - -void CS_LDK_C2Tuple_BlindedPayInfoBlindedPathZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ _res_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(_res_ptr); - FREE(untag_ptr(_res)); - C2Tuple_BlindedPayInfoBlindedPathZ_free(_res_conv); -} - -void CS_LDK_CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_free(int64_tArray _res) { - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ _res_constr; +void CS_LDK_CVec_BlindedPaymentPathZ_free(int64_tArray _res) { + LDKCVec_BlindedPaymentPathZ _res_constr; _res_constr.datalen = _res->arr_len; if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ 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_37 = _res_vals[l]; - void* _res_conv_37_ptr = untag_ptr(_res_conv_37); - CHECK_ACCESS(_res_conv_37_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ _res_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(_res_conv_37_ptr); - FREE(untag_ptr(_res_conv_37)); - _res_constr.data[l] = _res_conv_37_conv; + for (size_t u = 0; u < _res_constr.datalen; u++) { + int64_t _res_conv_20 = _res_vals[u]; + LDKBlindedPaymentPath _res_conv_20_conv; + _res_conv_20_conv.inner = untag_ptr(_res_conv_20); + _res_conv_20_conv.is_owned = ptr_is_owned(_res_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_20_conv); + _res_constr.data[u] = _res_conv_20_conv; } FREE(_res); - CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_free(_res_constr); + CVec_BlindedPaymentPathZ_free(_res_constr); } -int64_t CS_LDK_CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_ok(int64_tArray o) { - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ o_constr; +int64_t CS_LDK_CResult_CVec_BlindedPaymentPathZNoneZ_ok(int64_tArray o) { + LDKCVec_BlindedPaymentPathZ o_constr; o_constr.datalen = o->arr_len; if (o_constr.datalen > 0) - o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); + o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); else o_constr.data = NULL; int64_t* o_vals = o->elems; - for (size_t l = 0; l < o_constr.datalen; l++) { - int64_t o_conv_37 = o_vals[l]; - void* o_conv_37_ptr = untag_ptr(o_conv_37); - CHECK_ACCESS(o_conv_37_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ o_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(o_conv_37_ptr); - o_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(o_conv_37)); - o_constr.data[l] = o_conv_37_conv; + for (size_t u = 0; u < o_constr.datalen; u++) { + int64_t o_conv_20 = o_vals[u]; + LDKBlindedPaymentPath o_conv_20_conv; + o_conv_20_conv.inner = untag_ptr(o_conv_20); + o_conv_20_conv.is_owned = ptr_is_owned(o_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv_20_conv); + o_conv_20_conv = BlindedPaymentPath_clone(&o_conv_20_conv); + o_constr.data[u] = o_conv_20_conv; } FREE(o); - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ), "LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ"); - *ret_conv = CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_ok(o_constr); + LDKCResult_CVec_BlindedPaymentPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPaymentPathZNoneZ), "LDKCResult_CVec_BlindedPaymentPathZNoneZ"); + *ret_conv = CResult_CVec_BlindedPaymentPathZNoneZ_ok(o_constr); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_err() { - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ), "LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ"); - *ret_conv = CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_err(); +int64_t CS_LDK_CResult_CVec_BlindedPaymentPathZNoneZ_err() { + LDKCResult_CVec_BlindedPaymentPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPaymentPathZNoneZ), "LDKCResult_CVec_BlindedPaymentPathZNoneZ"); + *ret_conv = CResult_CVec_BlindedPaymentPathZNoneZ_err(); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_is_ok(int64_t o) { - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* o_conv = (LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_is_ok(o_conv); +jboolean CS_LDK_CResult_CVec_BlindedPaymentPathZNoneZ_is_ok(int64_t o) { + LDKCResult_CVec_BlindedPaymentPathZNoneZ* o_conv = (LDKCResult_CVec_BlindedPaymentPathZNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_CVec_BlindedPaymentPathZNoneZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_free(int64_t _res) { +void CS_LDK_CResult_CVec_BlindedPaymentPathZNoneZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ _res_conv = *(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ*)(_res_ptr); + LDKCResult_CVec_BlindedPaymentPathZNoneZ _res_conv = *(LDKCResult_CVec_BlindedPaymentPathZNoneZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_free(_res_conv); + CResult_CVec_BlindedPaymentPathZNoneZ_free(_res_conv); } -static inline uint64_t CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone_ptr(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR arg) { - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ), "LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ"); - *ret_conv = CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone(arg); +static inline uint64_t CResult_CVec_BlindedPaymentPathZNoneZ_clone_ptr(LDKCResult_CVec_BlindedPaymentPathZNoneZ *NONNULL_PTR arg) { + LDKCResult_CVec_BlindedPaymentPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPaymentPathZNoneZ), "LDKCResult_CVec_BlindedPaymentPathZNoneZ"); + *ret_conv = CResult_CVec_BlindedPaymentPathZNoneZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone_ptr(int64_t arg) { - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* arg_conv = (LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_CVec_BlindedPaymentPathZNoneZ_clone_ptr(int64_t arg) { + LDKCResult_CVec_BlindedPaymentPathZNoneZ* arg_conv = (LDKCResult_CVec_BlindedPaymentPathZNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_CVec_BlindedPaymentPathZNoneZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone(int64_t orig) { - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* orig_conv = (LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ*)untag_ptr(orig); - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ), "LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ"); - *ret_conv = CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone(orig_conv); +int64_t CS_LDK_CResult_CVec_BlindedPaymentPathZNoneZ_clone(int64_t orig) { + LDKCResult_CVec_BlindedPaymentPathZNoneZ* orig_conv = (LDKCResult_CVec_BlindedPaymentPathZNoneZ*)untag_ptr(orig); + LDKCResult_CVec_BlindedPaymentPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPaymentPathZNoneZ), "LDKCResult_CVec_BlindedPaymentPathZNoneZ"); + *ret_conv = CResult_CVec_BlindedPaymentPathZNoneZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -21096,68 +22243,88 @@ int64_t CS_LDK_CResult_OnionMessagePathNoneZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_CVec_BlindedPathZNoneZ_ok(int64_tArray o) { - LDKCVec_BlindedPathZ o_constr; +int64_t CS_LDK_CResult_CVec_BlindedMessagePathZNoneZ_ok(int64_tArray o) { + LDKCVec_BlindedMessagePathZ o_constr; o_constr.datalen = o->arr_len; if (o_constr.datalen > 0) - o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKBlindedPath), "LDKCVec_BlindedPathZ Elements"); + o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKBlindedMessagePath), "LDKCVec_BlindedMessagePathZ Elements"); else o_constr.data = NULL; int64_t* o_vals = o->elems; - for (size_t n = 0; n < o_constr.datalen; n++) { - int64_t o_conv_13 = o_vals[n]; - LDKBlindedPath o_conv_13_conv; - o_conv_13_conv.inner = untag_ptr(o_conv_13); - o_conv_13_conv.is_owned = ptr_is_owned(o_conv_13); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv_13_conv); - o_conv_13_conv = BlindedPath_clone(&o_conv_13_conv); - o_constr.data[n] = o_conv_13_conv; + for (size_t u = 0; u < o_constr.datalen; u++) { + int64_t o_conv_20 = o_vals[u]; + LDKBlindedMessagePath o_conv_20_conv; + o_conv_20_conv.inner = untag_ptr(o_conv_20); + o_conv_20_conv.is_owned = ptr_is_owned(o_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv_20_conv); + o_conv_20_conv = BlindedMessagePath_clone(&o_conv_20_conv); + o_constr.data[u] = o_conv_20_conv; } FREE(o); - LDKCResult_CVec_BlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPathZNoneZ), "LDKCResult_CVec_BlindedPathZNoneZ"); - *ret_conv = CResult_CVec_BlindedPathZNoneZ_ok(o_constr); + LDKCResult_CVec_BlindedMessagePathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedMessagePathZNoneZ), "LDKCResult_CVec_BlindedMessagePathZNoneZ"); + *ret_conv = CResult_CVec_BlindedMessagePathZNoneZ_ok(o_constr); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_CVec_BlindedPathZNoneZ_err() { - LDKCResult_CVec_BlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPathZNoneZ), "LDKCResult_CVec_BlindedPathZNoneZ"); - *ret_conv = CResult_CVec_BlindedPathZNoneZ_err(); +int64_t CS_LDK_CResult_CVec_BlindedMessagePathZNoneZ_err() { + LDKCResult_CVec_BlindedMessagePathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedMessagePathZNoneZ), "LDKCResult_CVec_BlindedMessagePathZNoneZ"); + *ret_conv = CResult_CVec_BlindedMessagePathZNoneZ_err(); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_CVec_BlindedPathZNoneZ_is_ok(int64_t o) { - LDKCResult_CVec_BlindedPathZNoneZ* o_conv = (LDKCResult_CVec_BlindedPathZNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_CVec_BlindedPathZNoneZ_is_ok(o_conv); +jboolean CS_LDK_CResult_CVec_BlindedMessagePathZNoneZ_is_ok(int64_t o) { + LDKCResult_CVec_BlindedMessagePathZNoneZ* o_conv = (LDKCResult_CVec_BlindedMessagePathZNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_CVec_BlindedMessagePathZNoneZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_CVec_BlindedPathZNoneZ_free(int64_t _res) { +void CS_LDK_CResult_CVec_BlindedMessagePathZNoneZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_CVec_BlindedPathZNoneZ _res_conv = *(LDKCResult_CVec_BlindedPathZNoneZ*)(_res_ptr); + LDKCResult_CVec_BlindedMessagePathZNoneZ _res_conv = *(LDKCResult_CVec_BlindedMessagePathZNoneZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_CVec_BlindedPathZNoneZ_free(_res_conv); + CResult_CVec_BlindedMessagePathZNoneZ_free(_res_conv); } -static inline uint64_t CResult_CVec_BlindedPathZNoneZ_clone_ptr(LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR arg) { - LDKCResult_CVec_BlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPathZNoneZ), "LDKCResult_CVec_BlindedPathZNoneZ"); - *ret_conv = CResult_CVec_BlindedPathZNoneZ_clone(arg); +static inline uint64_t CResult_CVec_BlindedMessagePathZNoneZ_clone_ptr(LDKCResult_CVec_BlindedMessagePathZNoneZ *NONNULL_PTR arg) { + LDKCResult_CVec_BlindedMessagePathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedMessagePathZNoneZ), "LDKCResult_CVec_BlindedMessagePathZNoneZ"); + *ret_conv = CResult_CVec_BlindedMessagePathZNoneZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_CVec_BlindedPathZNoneZ_clone_ptr(int64_t arg) { - LDKCResult_CVec_BlindedPathZNoneZ* arg_conv = (LDKCResult_CVec_BlindedPathZNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_CVec_BlindedPathZNoneZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_CVec_BlindedMessagePathZNoneZ_clone_ptr(int64_t arg) { + LDKCResult_CVec_BlindedMessagePathZNoneZ* arg_conv = (LDKCResult_CVec_BlindedMessagePathZNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_CVec_BlindedMessagePathZNoneZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_CVec_BlindedPathZNoneZ_clone(int64_t orig) { - LDKCResult_CVec_BlindedPathZNoneZ* orig_conv = (LDKCResult_CVec_BlindedPathZNoneZ*)untag_ptr(orig); - LDKCResult_CVec_BlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPathZNoneZ), "LDKCResult_CVec_BlindedPathZNoneZ"); - *ret_conv = CResult_CVec_BlindedPathZNoneZ_clone(orig_conv); +int64_t CS_LDK_CResult_CVec_BlindedMessagePathZNoneZ_clone(int64_t orig) { + LDKCResult_CVec_BlindedMessagePathZNoneZ* orig_conv = (LDKCResult_CVec_BlindedMessagePathZNoneZ*)untag_ptr(orig); + LDKCResult_CVec_BlindedMessagePathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedMessagePathZNoneZ), "LDKCResult_CVec_BlindedMessagePathZNoneZ"); + *ret_conv = CResult_CVec_BlindedMessagePathZNoneZ_clone(orig_conv); return tag_ptr(ret_conv, true); } +void CS_LDK_CVec_MessageForwardNodeZ_free(int64_tArray _res) { + LDKCVec_MessageForwardNodeZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMessageForwardNode), "LDKCVec_MessageForwardNodeZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = _res->elems; + for (size_t u = 0; u < _res_constr.datalen; u++) { + int64_t _res_conv_20 = _res_vals[u]; + LDKMessageForwardNode _res_conv_20_conv; + _res_conv_20_conv.inner = untag_ptr(_res_conv_20); + _res_conv_20_conv.is_owned = ptr_is_owned(_res_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_20_conv); + _res_constr.data[u] = _res_conv_20_conv; + } + FREE(_res); + CVec_MessageForwardNodeZ_free(_res_constr); +} + int64_t CS_LDK_CResult_InFlightHtlcsDecodeErrorZ_ok(int64_t o) { LDKInFlightHtlcs o_conv; o_conv.inner = untag_ptr(o); @@ -21578,26 +22745,6 @@ void CS_LDK_CVec_RouteHintZ_free(int64_tArray _res) { CVec_RouteHintZ_free(_res_constr); } -void CS_LDK_CVec_RouteHintHopZ_free(int64_tArray _res) { - LDKCVec_RouteHintHopZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = _res->elems; - for (size_t o = 0; o < _res_constr.datalen; o++) { - int64_t _res_conv_14 = _res_vals[o]; - LDKRouteHintHop _res_conv_14_conv; - _res_conv_14_conv.inner = untag_ptr(_res_conv_14); - _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv); - _res_constr.data[o] = _res_conv_14_conv; - } - FREE(_res); - CVec_RouteHintHopZ_free(_res_constr); -} - int64_t CS_LDK_CResult_RouteHintDecodeErrorZ_ok(int64_t o) { LDKRouteHint o_conv; o_conv.inner = untag_ptr(o); @@ -22926,6 +24073,60 @@ void CS_LDK_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticError CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_free(_res_conv); } +int64_t CS_LDK_CResult_OfferDecodeErrorZ_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_OfferDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferDecodeErrorZ), "LDKCResult_OfferDecodeErrorZ"); + *ret_conv = CResult_OfferDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_OfferDecodeErrorZ_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_OfferDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferDecodeErrorZ), "LDKCResult_OfferDecodeErrorZ"); + *ret_conv = CResult_OfferDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_OfferDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_OfferDecodeErrorZ* o_conv = (LDKCResult_OfferDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OfferDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_OfferDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_OfferDecodeErrorZ _res_conv = *(LDKCResult_OfferDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_OfferDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_OfferDecodeErrorZ_clone_ptr(LDKCResult_OfferDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OfferDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferDecodeErrorZ), "LDKCResult_OfferDecodeErrorZ"); + *ret_conv = CResult_OfferDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_OfferDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_OfferDecodeErrorZ* arg_conv = (LDKCResult_OfferDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OfferDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_OfferDecodeErrorZ_clone(int64_t orig) { + LDKCResult_OfferDecodeErrorZ* orig_conv = (LDKCResult_OfferDecodeErrorZ*)untag_ptr(orig); + LDKCResult_OfferDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferDecodeErrorZ), "LDKCResult_OfferDecodeErrorZ"); + *ret_conv = CResult_OfferDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + int64_t CS_LDK_CResult_OfferBolt12ParseErrorZ_ok(int64_t o) { LDKOffer o_conv; o_conv.inner = untag_ptr(o); @@ -23612,11 +24813,10 @@ void CS_LDK_CVec_SocketAddressZ_free(int64_tArray _res) { } int64_t CS_LDK_CResult_NodeAnnouncementInfoDecodeErrorZ_ok(int64_t o) { - LDKNodeAnnouncementInfo o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = NodeAnnouncementInfo_clone(&o_conv); + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKNodeAnnouncementInfo o_conv = *(LDKNodeAnnouncementInfo*)(o_ptr); + o_conv = NodeAnnouncementInfo_clone((LDKNodeAnnouncementInfo*)untag_ptr(o)); LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); @@ -23719,6 +24919,53 @@ int64_t CS_LDK_CResult_NodeAliasDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_COption_NodeAnnouncementInfoZ_some(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKNodeAnnouncementInfo o_conv = *(LDKNodeAnnouncementInfo*)(o_ptr); + o_conv = NodeAnnouncementInfo_clone((LDKNodeAnnouncementInfo*)untag_ptr(o)); + LDKCOption_NodeAnnouncementInfoZ *ret_copy = MALLOC(sizeof(LDKCOption_NodeAnnouncementInfoZ), "LDKCOption_NodeAnnouncementInfoZ"); + *ret_copy = COption_NodeAnnouncementInfoZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_COption_NodeAnnouncementInfoZ_none() { + LDKCOption_NodeAnnouncementInfoZ *ret_copy = MALLOC(sizeof(LDKCOption_NodeAnnouncementInfoZ), "LDKCOption_NodeAnnouncementInfoZ"); + *ret_copy = COption_NodeAnnouncementInfoZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_COption_NodeAnnouncementInfoZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_NodeAnnouncementInfoZ _res_conv = *(LDKCOption_NodeAnnouncementInfoZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_NodeAnnouncementInfoZ_free(_res_conv); +} + +static inline uint64_t COption_NodeAnnouncementInfoZ_clone_ptr(LDKCOption_NodeAnnouncementInfoZ *NONNULL_PTR arg) { + LDKCOption_NodeAnnouncementInfoZ *ret_copy = MALLOC(sizeof(LDKCOption_NodeAnnouncementInfoZ), "LDKCOption_NodeAnnouncementInfoZ"); + *ret_copy = COption_NodeAnnouncementInfoZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_COption_NodeAnnouncementInfoZ_clone_ptr(int64_t arg) { + LDKCOption_NodeAnnouncementInfoZ* arg_conv = (LDKCOption_NodeAnnouncementInfoZ*)untag_ptr(arg); + int64_t ret_conv = COption_NodeAnnouncementInfoZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_COption_NodeAnnouncementInfoZ_clone(int64_t orig) { + LDKCOption_NodeAnnouncementInfoZ* orig_conv = (LDKCOption_NodeAnnouncementInfoZ*)untag_ptr(orig); + LDKCOption_NodeAnnouncementInfoZ *ret_copy = MALLOC(sizeof(LDKCOption_NodeAnnouncementInfoZ), "LDKCOption_NodeAnnouncementInfoZ"); + *ret_copy = COption_NodeAnnouncementInfoZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + int64_t CS_LDK_CResult_NodeInfoDecodeErrorZ_ok(int64_t o) { LDKNodeInfo o_conv; o_conv.inner = untag_ptr(o); @@ -25042,117 +26289,352 @@ int64_t CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -int64_t CS_LDK_COption_OffersMessageZ_some(int64_t o) { +int64_t CS_LDK_COption_OffersContextZ_some(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); - LDKOffersMessage o_conv = *(LDKOffersMessage*)(o_ptr); - o_conv = OffersMessage_clone((LDKOffersMessage*)untag_ptr(o)); - LDKCOption_OffersMessageZ *ret_copy = MALLOC(sizeof(LDKCOption_OffersMessageZ), "LDKCOption_OffersMessageZ"); - *ret_copy = COption_OffersMessageZ_some(o_conv); + LDKOffersContext o_conv = *(LDKOffersContext*)(o_ptr); + o_conv = OffersContext_clone((LDKOffersContext*)untag_ptr(o)); + LDKCOption_OffersContextZ *ret_copy = MALLOC(sizeof(LDKCOption_OffersContextZ), "LDKCOption_OffersContextZ"); + *ret_copy = COption_OffersContextZ_some(o_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_COption_OffersMessageZ_none() { - LDKCOption_OffersMessageZ *ret_copy = MALLOC(sizeof(LDKCOption_OffersMessageZ), "LDKCOption_OffersMessageZ"); - *ret_copy = COption_OffersMessageZ_none(); +int64_t CS_LDK_COption_OffersContextZ_none() { + LDKCOption_OffersContextZ *ret_copy = MALLOC(sizeof(LDKCOption_OffersContextZ), "LDKCOption_OffersContextZ"); + *ret_copy = COption_OffersContextZ_none(); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void CS_LDK_COption_OffersMessageZ_free(int64_t _res) { +void CS_LDK_COption_OffersContextZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCOption_OffersMessageZ _res_conv = *(LDKCOption_OffersMessageZ*)(_res_ptr); + LDKCOption_OffersContextZ _res_conv = *(LDKCOption_OffersContextZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_OffersMessageZ_free(_res_conv); + COption_OffersContextZ_free(_res_conv); } -static inline uint64_t COption_OffersMessageZ_clone_ptr(LDKCOption_OffersMessageZ *NONNULL_PTR arg) { - LDKCOption_OffersMessageZ *ret_copy = MALLOC(sizeof(LDKCOption_OffersMessageZ), "LDKCOption_OffersMessageZ"); - *ret_copy = COption_OffersMessageZ_clone(arg); +static inline uint64_t COption_OffersContextZ_clone_ptr(LDKCOption_OffersContextZ *NONNULL_PTR arg) { + LDKCOption_OffersContextZ *ret_copy = MALLOC(sizeof(LDKCOption_OffersContextZ), "LDKCOption_OffersContextZ"); + *ret_copy = COption_OffersContextZ_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_COption_OffersMessageZ_clone_ptr(int64_t arg) { - LDKCOption_OffersMessageZ* arg_conv = (LDKCOption_OffersMessageZ*)untag_ptr(arg); - int64_t ret_conv = COption_OffersMessageZ_clone_ptr(arg_conv); +int64_t CS_LDK_COption_OffersContextZ_clone_ptr(int64_t arg) { + LDKCOption_OffersContextZ* arg_conv = (LDKCOption_OffersContextZ*)untag_ptr(arg); + int64_t ret_conv = COption_OffersContextZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_COption_OffersMessageZ_clone(int64_t orig) { - LDKCOption_OffersMessageZ* orig_conv = (LDKCOption_OffersMessageZ*)untag_ptr(orig); - LDKCOption_OffersMessageZ *ret_copy = MALLOC(sizeof(LDKCOption_OffersMessageZ), "LDKCOption_OffersMessageZ"); - *ret_copy = COption_OffersMessageZ_clone(orig_conv); +int64_t CS_LDK_COption_OffersContextZ_clone(int64_t orig) { + LDKCOption_OffersContextZ* orig_conv = (LDKCOption_OffersContextZ*)untag_ptr(orig); + LDKCOption_OffersContextZ *ret_copy = MALLOC(sizeof(LDKCOption_OffersContextZ), "LDKCOption_OffersContextZ"); + *ret_copy = COption_OffersContextZ_clone(orig_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline uint64_t C3Tuple_OffersMessageDestinationBlindedPathZ_clone_ptr(LDKC3Tuple_OffersMessageDestinationBlindedPathZ *NONNULL_PTR arg) { - LDKC3Tuple_OffersMessageDestinationBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OffersMessageDestinationBlindedPathZ), "LDKC3Tuple_OffersMessageDestinationBlindedPathZ"); - *ret_conv = C3Tuple_OffersMessageDestinationBlindedPathZ_clone(arg); +static inline uint64_t C2Tuple_OffersMessageResponseInstructionZ_clone_ptr(LDKC2Tuple_OffersMessageResponseInstructionZ *NONNULL_PTR arg) { + LDKC2Tuple_OffersMessageResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OffersMessageResponseInstructionZ), "LDKC2Tuple_OffersMessageResponseInstructionZ"); + *ret_conv = C2Tuple_OffersMessageResponseInstructionZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C3Tuple_OffersMessageDestinationBlindedPathZ_clone_ptr(int64_t arg) { - LDKC3Tuple_OffersMessageDestinationBlindedPathZ* arg_conv = (LDKC3Tuple_OffersMessageDestinationBlindedPathZ*)untag_ptr(arg); - int64_t ret_conv = C3Tuple_OffersMessageDestinationBlindedPathZ_clone_ptr(arg_conv); +int64_t CS_LDK_C2Tuple_OffersMessageResponseInstructionZ_clone_ptr(int64_t arg) { + LDKC2Tuple_OffersMessageResponseInstructionZ* arg_conv = (LDKC2Tuple_OffersMessageResponseInstructionZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_OffersMessageResponseInstructionZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_C3Tuple_OffersMessageDestinationBlindedPathZ_clone(int64_t orig) { - LDKC3Tuple_OffersMessageDestinationBlindedPathZ* orig_conv = (LDKC3Tuple_OffersMessageDestinationBlindedPathZ*)untag_ptr(orig); - LDKC3Tuple_OffersMessageDestinationBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OffersMessageDestinationBlindedPathZ), "LDKC3Tuple_OffersMessageDestinationBlindedPathZ"); - *ret_conv = C3Tuple_OffersMessageDestinationBlindedPathZ_clone(orig_conv); +int64_t CS_LDK_C2Tuple_OffersMessageResponseInstructionZ_clone(int64_t orig) { + LDKC2Tuple_OffersMessageResponseInstructionZ* orig_conv = (LDKC2Tuple_OffersMessageResponseInstructionZ*)untag_ptr(orig); + LDKC2Tuple_OffersMessageResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OffersMessageResponseInstructionZ), "LDKC2Tuple_OffersMessageResponseInstructionZ"); + *ret_conv = C2Tuple_OffersMessageResponseInstructionZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C3Tuple_OffersMessageDestinationBlindedPathZ_new(int64_t a, int64_t b, int64_t c) { +int64_t CS_LDK_C2Tuple_OffersMessageResponseInstructionZ_new(int64_t a, int64_t b) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKOffersMessage a_conv = *(LDKOffersMessage*)(a_ptr); + a_conv = OffersMessage_clone((LDKOffersMessage*)untag_ptr(a)); + LDKResponseInstruction 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 = ResponseInstruction_clone(&b_conv); + LDKC2Tuple_OffersMessageResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OffersMessageResponseInstructionZ), "LDKC2Tuple_OffersMessageResponseInstructionZ"); + *ret_conv = C2Tuple_OffersMessageResponseInstructionZ_new(a_conv, b_conv); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_C2Tuple_OffersMessageResponseInstructionZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKC2Tuple_OffersMessageResponseInstructionZ _res_conv = *(LDKC2Tuple_OffersMessageResponseInstructionZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_OffersMessageResponseInstructionZ_free(_res_conv); +} + +int64_t CS_LDK_COption_C2Tuple_OffersMessageResponseInstructionZZ_some(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_OffersMessageResponseInstructionZ o_conv = *(LDKC2Tuple_OffersMessageResponseInstructionZ*)(o_ptr); + o_conv = C2Tuple_OffersMessageResponseInstructionZ_clone((LDKC2Tuple_OffersMessageResponseInstructionZ*)untag_ptr(o)); + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ), "LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_OffersMessageResponseInstructionZZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_COption_C2Tuple_OffersMessageResponseInstructionZZ_none() { + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ), "LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_OffersMessageResponseInstructionZZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_COption_C2Tuple_OffersMessageResponseInstructionZZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ _res_conv = *(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_C2Tuple_OffersMessageResponseInstructionZZ_free(_res_conv); +} + +static inline uint64_t COption_C2Tuple_OffersMessageResponseInstructionZZ_clone_ptr(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ *NONNULL_PTR arg) { + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ), "LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_OffersMessageResponseInstructionZZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_COption_C2Tuple_OffersMessageResponseInstructionZZ_clone_ptr(int64_t arg) { + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ* arg_conv = (LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ*)untag_ptr(arg); + int64_t ret_conv = COption_C2Tuple_OffersMessageResponseInstructionZZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_COption_C2Tuple_OffersMessageResponseInstructionZZ_clone(int64_t orig) { + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ* orig_conv = (LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ*)untag_ptr(orig); + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ), "LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_OffersMessageResponseInstructionZZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline uint64_t C2Tuple_OffersMessageMessageSendInstructionsZ_clone_ptr(LDKC2Tuple_OffersMessageMessageSendInstructionsZ *NONNULL_PTR arg) { + LDKC2Tuple_OffersMessageMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OffersMessageMessageSendInstructionsZ), "LDKC2Tuple_OffersMessageMessageSendInstructionsZ"); + *ret_conv = C2Tuple_OffersMessageMessageSendInstructionsZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_C2Tuple_OffersMessageMessageSendInstructionsZ_clone_ptr(int64_t arg) { + LDKC2Tuple_OffersMessageMessageSendInstructionsZ* arg_conv = (LDKC2Tuple_OffersMessageMessageSendInstructionsZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_OffersMessageMessageSendInstructionsZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_C2Tuple_OffersMessageMessageSendInstructionsZ_clone(int64_t orig) { + LDKC2Tuple_OffersMessageMessageSendInstructionsZ* orig_conv = (LDKC2Tuple_OffersMessageMessageSendInstructionsZ*)untag_ptr(orig); + LDKC2Tuple_OffersMessageMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OffersMessageMessageSendInstructionsZ), "LDKC2Tuple_OffersMessageMessageSendInstructionsZ"); + *ret_conv = C2Tuple_OffersMessageMessageSendInstructionsZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_C2Tuple_OffersMessageMessageSendInstructionsZ_new(int64_t a, int64_t b) { void* a_ptr = untag_ptr(a); CHECK_ACCESS(a_ptr); LDKOffersMessage a_conv = *(LDKOffersMessage*)(a_ptr); a_conv = OffersMessage_clone((LDKOffersMessage*)untag_ptr(a)); void* b_ptr = untag_ptr(b); CHECK_ACCESS(b_ptr); - LDKDestination b_conv = *(LDKDestination*)(b_ptr); - b_conv = Destination_clone((LDKDestination*)untag_ptr(b)); - LDKBlindedPath 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 = BlindedPath_clone(&c_conv); - LDKC3Tuple_OffersMessageDestinationBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OffersMessageDestinationBlindedPathZ), "LDKC3Tuple_OffersMessageDestinationBlindedPathZ"); - *ret_conv = C3Tuple_OffersMessageDestinationBlindedPathZ_new(a_conv, b_conv, c_conv); + LDKMessageSendInstructions b_conv = *(LDKMessageSendInstructions*)(b_ptr); + b_conv = MessageSendInstructions_clone((LDKMessageSendInstructions*)untag_ptr(b)); + LDKC2Tuple_OffersMessageMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OffersMessageMessageSendInstructionsZ), "LDKC2Tuple_OffersMessageMessageSendInstructionsZ"); + *ret_conv = C2Tuple_OffersMessageMessageSendInstructionsZ_new(a_conv, b_conv); return tag_ptr(ret_conv, true); } -void CS_LDK_C3Tuple_OffersMessageDestinationBlindedPathZ_free(int64_t _res) { +void CS_LDK_C2Tuple_OffersMessageMessageSendInstructionsZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKC3Tuple_OffersMessageDestinationBlindedPathZ _res_conv = *(LDKC3Tuple_OffersMessageDestinationBlindedPathZ*)(_res_ptr); + LDKC2Tuple_OffersMessageMessageSendInstructionsZ _res_conv = *(LDKC2Tuple_OffersMessageMessageSendInstructionsZ*)(_res_ptr); FREE(untag_ptr(_res)); - C3Tuple_OffersMessageDestinationBlindedPathZ_free(_res_conv); + C2Tuple_OffersMessageMessageSendInstructionsZ_free(_res_conv); } -void CS_LDK_CVec_C3Tuple_OffersMessageDestinationBlindedPathZZ_free(int64_tArray _res) { - LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ _res_constr; +void CS_LDK_CVec_C2Tuple_OffersMessageMessageSendInstructionsZZ_free(int64_tArray _res) { + LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ _res_constr; _res_constr.datalen = _res->arr_len; if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC3Tuple_OffersMessageDestinationBlindedPathZ), "LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OffersMessageMessageSendInstructionsZ), "LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ 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_OffersMessageDestinationBlindedPathZ _res_conv_49_conv = *(LDKC3Tuple_OffersMessageDestinationBlindedPathZ*)(_res_conv_49_ptr); - FREE(untag_ptr(_res_conv_49)); - _res_constr.data[x] = _res_conv_49_conv; + for (size_t w = 0; w < _res_constr.datalen; w++) { + int64_t _res_conv_48 = _res_vals[w]; + void* _res_conv_48_ptr = untag_ptr(_res_conv_48); + CHECK_ACCESS(_res_conv_48_ptr); + LDKC2Tuple_OffersMessageMessageSendInstructionsZ _res_conv_48_conv = *(LDKC2Tuple_OffersMessageMessageSendInstructionsZ*)(_res_conv_48_ptr); + FREE(untag_ptr(_res_conv_48)); + _res_constr.data[w] = _res_conv_48_conv; + } + FREE(_res); + CVec_C2Tuple_OffersMessageMessageSendInstructionsZZ_free(_res_constr); +} + +static inline uint64_t C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone_ptr(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ *NONNULL_PTR arg) { + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ), "LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ"); + *ret_conv = C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone_ptr(int64_t arg) { + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ* arg_conv = (LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone(int64_t orig) { + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ* orig_conv = (LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ*)untag_ptr(orig); + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ), "LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ"); + *ret_conv = C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_C2Tuple_ReleaseHeldHtlcResponseInstructionZ_new(int64_t a, int64_t b) { + LDKReleaseHeldHtlc a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = ReleaseHeldHtlc_clone(&a_conv); + LDKResponseInstruction 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 = ResponseInstruction_clone(&b_conv); + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ), "LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ"); + *ret_conv = C2Tuple_ReleaseHeldHtlcResponseInstructionZ_new(a_conv, b_conv); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_C2Tuple_ReleaseHeldHtlcResponseInstructionZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ _res_conv = *(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_ReleaseHeldHtlcResponseInstructionZ_free(_res_conv); +} + +int64_t CS_LDK_COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_some(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ o_conv = *(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ*)(o_ptr); + o_conv = C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone((LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ*)untag_ptr(o)); + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ), "LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_none() { + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ), "LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ _res_conv = *(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_free(_res_conv); +} + +static inline uint64_t COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone_ptr(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ *NONNULL_PTR arg) { + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ), "LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone_ptr(int64_t arg) { + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ* arg_conv = (LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ*)untag_ptr(arg); + int64_t ret_conv = COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone(int64_t orig) { + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ* orig_conv = (LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ*)untag_ptr(orig); + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ), "LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline uint64_t C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone_ptr(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ *NONNULL_PTR arg) { + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ), "LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ"); + *ret_conv = C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone_ptr(int64_t arg) { + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ* arg_conv = (LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone(int64_t orig) { + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ* orig_conv = (LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ*)untag_ptr(orig); + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ), "LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ"); + *ret_conv = C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_new(int64_t a, int64_t b) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKAsyncPaymentsMessage a_conv = *(LDKAsyncPaymentsMessage*)(a_ptr); + a_conv = AsyncPaymentsMessage_clone((LDKAsyncPaymentsMessage*)untag_ptr(a)); + void* b_ptr = untag_ptr(b); + CHECK_ACCESS(b_ptr); + LDKMessageSendInstructions b_conv = *(LDKMessageSendInstructions*)(b_ptr); + b_conv = MessageSendInstructions_clone((LDKMessageSendInstructions*)untag_ptr(b)); + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ), "LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ"); + *ret_conv = C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_new(a_conv, b_conv); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ _res_conv = *(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_free(_res_conv); +} + +void CS_LDK_CVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ_free(int64_tArray _res) { + LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ), "LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = _res->elems; + for (size_t d = 0; d < _res_constr.datalen; d++) { + int64_t _res_conv_55 = _res_vals[d]; + void* _res_conv_55_ptr = untag_ptr(_res_conv_55); + CHECK_ACCESS(_res_conv_55_ptr); + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ _res_conv_55_conv = *(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ*)(_res_conv_55_ptr); + FREE(untag_ptr(_res_conv_55)); + _res_constr.data[d] = _res_conv_55_conv; } FREE(_res); - CVec_C3Tuple_OffersMessageDestinationBlindedPathZZ_free(_res_constr); + CVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ_free(_res_constr); } int64_t CS_LDK_CResult_PhantomRouteHintsDecodeErrorZ_ok(int64_t o) { @@ -26132,6 +27614,56 @@ void CS_LDK_CVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ_free(int64_ CVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ_free(_res_constr); } +int64_t CS_LDK_CResult_NoneReplayEventZ_ok() { + LDKCResult_NoneReplayEventZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneReplayEventZ), "LDKCResult_NoneReplayEventZ"); + *ret_conv = CResult_NoneReplayEventZ_ok(); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_NoneReplayEventZ_err(int64_t e) { + LDKReplayEvent e_conv; + e_conv.inner = untag_ptr(e); + e_conv.is_owned = ptr_is_owned(e); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = ReplayEvent_clone(&e_conv); + LDKCResult_NoneReplayEventZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneReplayEventZ), "LDKCResult_NoneReplayEventZ"); + *ret_conv = CResult_NoneReplayEventZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_NoneReplayEventZ_is_ok(int64_t o) { + LDKCResult_NoneReplayEventZ* o_conv = (LDKCResult_NoneReplayEventZ*)untag_ptr(o); + jboolean ret_conv = CResult_NoneReplayEventZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_NoneReplayEventZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_NoneReplayEventZ _res_conv = *(LDKCResult_NoneReplayEventZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_NoneReplayEventZ_free(_res_conv); +} + +static inline uint64_t CResult_NoneReplayEventZ_clone_ptr(LDKCResult_NoneReplayEventZ *NONNULL_PTR arg) { + LDKCResult_NoneReplayEventZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneReplayEventZ), "LDKCResult_NoneReplayEventZ"); + *ret_conv = CResult_NoneReplayEventZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_NoneReplayEventZ_clone_ptr(int64_t arg) { + LDKCResult_NoneReplayEventZ* arg_conv = (LDKCResult_NoneReplayEventZ*)untag_ptr(arg); + int64_t ret_conv = CResult_NoneReplayEventZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_NoneReplayEventZ_clone(int64_t orig) { + LDKCResult_NoneReplayEventZ* orig_conv = (LDKCResult_NoneReplayEventZ*)untag_ptr(orig); + LDKCResult_NoneReplayEventZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneReplayEventZ), "LDKCResult_NoneReplayEventZ"); + *ret_conv = CResult_NoneReplayEventZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + void CS_LDK_CVec_CommitmentTransactionZ_free(int64_tArray _res) { LDKCVec_CommitmentTransactionZ _res_constr; _res_constr.datalen = _res->arr_len; @@ -26458,76 +27990,96 @@ void CS_LDK_CVec_C2Tuple_PublicKeyTypeZZ_free(int64_tArray _res) { CVec_C2Tuple_PublicKeyTypeZZ_free(_res_constr); } -static inline uint64_t C2Tuple_PublicKeyCVec_SocketAddressZZ_clone_ptr(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *NONNULL_PTR arg) { - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ), "LDKC2Tuple_PublicKeyCVec_SocketAddressZZ"); - *ret_conv = C2Tuple_PublicKeyCVec_SocketAddressZZ_clone(arg); +static inline uint64_t C2Tuple_OnionMessageContentsResponseInstructionZ_clone_ptr(LDKC2Tuple_OnionMessageContentsResponseInstructionZ *NONNULL_PTR arg) { + LDKC2Tuple_OnionMessageContentsResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OnionMessageContentsResponseInstructionZ), "LDKC2Tuple_OnionMessageContentsResponseInstructionZ"); + *ret_conv = C2Tuple_OnionMessageContentsResponseInstructionZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C2Tuple_PublicKeyCVec_SocketAddressZZ_clone_ptr(int64_t arg) { - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* arg_conv = (LDKC2Tuple_PublicKeyCVec_SocketAddressZZ*)untag_ptr(arg); - int64_t ret_conv = C2Tuple_PublicKeyCVec_SocketAddressZZ_clone_ptr(arg_conv); +int64_t CS_LDK_C2Tuple_OnionMessageContentsResponseInstructionZ_clone_ptr(int64_t arg) { + LDKC2Tuple_OnionMessageContentsResponseInstructionZ* arg_conv = (LDKC2Tuple_OnionMessageContentsResponseInstructionZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_OnionMessageContentsResponseInstructionZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_C2Tuple_PublicKeyCVec_SocketAddressZZ_clone(int64_t orig) { - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* orig_conv = (LDKC2Tuple_PublicKeyCVec_SocketAddressZZ*)untag_ptr(orig); - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ), "LDKC2Tuple_PublicKeyCVec_SocketAddressZZ"); - *ret_conv = C2Tuple_PublicKeyCVec_SocketAddressZZ_clone(orig_conv); +int64_t CS_LDK_C2Tuple_OnionMessageContentsResponseInstructionZ_clone(int64_t orig) { + LDKC2Tuple_OnionMessageContentsResponseInstructionZ* orig_conv = (LDKC2Tuple_OnionMessageContentsResponseInstructionZ*)untag_ptr(orig); + LDKC2Tuple_OnionMessageContentsResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OnionMessageContentsResponseInstructionZ), "LDKC2Tuple_OnionMessageContentsResponseInstructionZ"); + *ret_conv = C2Tuple_OnionMessageContentsResponseInstructionZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C2Tuple_PublicKeyCVec_SocketAddressZZ_new(int8_tArray a, int64_tArray b) { - LDKPublicKey a_ref; - CHECK(a->arr_len == 33); - memcpy(a_ref.compressed_form, a->elems, 33); FREE(a); - LDKCVec_SocketAddressZ b_constr; - b_constr.datalen = b->arr_len; - if (b_constr.datalen > 0) - b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKSocketAddress), "LDKCVec_SocketAddressZ Elements"); - else - b_constr.data = NULL; - int64_t* b_vals = b->elems; - for (size_t p = 0; p < b_constr.datalen; p++) { - int64_t b_conv_15 = b_vals[p]; - void* b_conv_15_ptr = untag_ptr(b_conv_15); - CHECK_ACCESS(b_conv_15_ptr); - LDKSocketAddress b_conv_15_conv = *(LDKSocketAddress*)(b_conv_15_ptr); - b_conv_15_conv = SocketAddress_clone((LDKSocketAddress*)untag_ptr(b_conv_15)); - b_constr.data[p] = b_conv_15_conv; +int64_t CS_LDK_C2Tuple_OnionMessageContentsResponseInstructionZ_new(int64_t a, int64_t b) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKOnionMessageContents a_conv = *(LDKOnionMessageContents*)(a_ptr); + if (a_conv.free == LDKOnionMessageContents_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOnionMessageContents_JCalls_cloned(&a_conv); } - FREE(b); - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ), "LDKC2Tuple_PublicKeyCVec_SocketAddressZZ"); - *ret_conv = C2Tuple_PublicKeyCVec_SocketAddressZZ_new(a_ref, b_constr); + LDKResponseInstruction 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 = ResponseInstruction_clone(&b_conv); + LDKC2Tuple_OnionMessageContentsResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OnionMessageContentsResponseInstructionZ), "LDKC2Tuple_OnionMessageContentsResponseInstructionZ"); + *ret_conv = C2Tuple_OnionMessageContentsResponseInstructionZ_new(a_conv, b_conv); return tag_ptr(ret_conv, true); } -void CS_LDK_C2Tuple_PublicKeyCVec_SocketAddressZZ_free(int64_t _res) { +void CS_LDK_C2Tuple_OnionMessageContentsResponseInstructionZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ _res_conv = *(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ*)(_res_ptr); + LDKC2Tuple_OnionMessageContentsResponseInstructionZ _res_conv = *(LDKC2Tuple_OnionMessageContentsResponseInstructionZ*)(_res_ptr); FREE(untag_ptr(_res)); - C2Tuple_PublicKeyCVec_SocketAddressZZ_free(_res_conv); + C2Tuple_OnionMessageContentsResponseInstructionZ_free(_res_conv); } -void CS_LDK_CVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ_free(int64_tArray _res) { - LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ), "LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = _res->elems; - for (size_t o = 0; o < _res_constr.datalen; o++) { - int64_t _res_conv_40 = _res_vals[o]; - void* _res_conv_40_ptr = untag_ptr(_res_conv_40); - CHECK_ACCESS(_res_conv_40_ptr); - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ _res_conv_40_conv = *(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ*)(_res_conv_40_ptr); - FREE(untag_ptr(_res_conv_40)); - _res_constr.data[o] = _res_conv_40_conv; - } - FREE(_res); - CVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ_free(_res_constr); +int64_t CS_LDK_COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_some(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_OnionMessageContentsResponseInstructionZ o_conv = *(LDKC2Tuple_OnionMessageContentsResponseInstructionZ*)(o_ptr); + o_conv = C2Tuple_OnionMessageContentsResponseInstructionZ_clone((LDKC2Tuple_OnionMessageContentsResponseInstructionZ*)untag_ptr(o)); + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ), "LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_none() { + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ), "LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ _res_conv = *(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_free(_res_conv); +} + +static inline uint64_t COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone_ptr(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ *NONNULL_PTR arg) { + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ), "LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone_ptr(int64_t arg) { + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ* arg_conv = (LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ*)untag_ptr(arg); + int64_t ret_conv = COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone(int64_t orig) { + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ* orig_conv = (LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ*)untag_ptr(orig); + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ), "LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } int64_t CS_LDK_COption_OnionMessageContentsZ_some(int64_t o) { @@ -26633,25 +28185,25 @@ int64_t CS_LDK_CResult_COption_OnionMessageContentsZDecodeErrorZ_clone(int64_t return tag_ptr(ret_conv, true); } -static inline uint64_t C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone_ptr(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *NONNULL_PTR arg) { - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ), "LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ"); - *ret_conv = C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone(arg); +static inline uint64_t C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone_ptr(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ *NONNULL_PTR arg) { + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ), "LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ"); + *ret_conv = C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone_ptr(int64_t arg) { - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ* arg_conv = (LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ*)untag_ptr(arg); - int64_t ret_conv = C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone_ptr(arg_conv); +int64_t CS_LDK_C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone_ptr(int64_t arg) { + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ* arg_conv = (LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone(int64_t orig) { - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ* orig_conv = (LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ*)untag_ptr(orig); - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ), "LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ"); - *ret_conv = C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone(orig_conv); +int64_t CS_LDK_C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone(int64_t orig) { + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ* orig_conv = (LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ*)untag_ptr(orig); + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ), "LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ"); + *ret_conv = C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C3Tuple_OnionMessageContentsDestinationBlindedPathZ_new(int64_t a, int64_t b, int64_t c) { +int64_t CS_LDK_C2Tuple_OnionMessageContentsMessageSendInstructionsZ_new(int64_t a, int64_t b) { void* a_ptr = untag_ptr(a); CHECK_ACCESS(a_ptr); LDKOnionMessageContents a_conv = *(LDKOnionMessageContents*)(a_ptr); @@ -26661,45 +28213,40 @@ int64_t CS_LDK_C3Tuple_OnionMessageContentsDestinationBlindedPathZ_new(int64_t } void* b_ptr = untag_ptr(b); CHECK_ACCESS(b_ptr); - LDKDestination b_conv = *(LDKDestination*)(b_ptr); - b_conv = Destination_clone((LDKDestination*)untag_ptr(b)); - LDKBlindedPath 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 = BlindedPath_clone(&c_conv); - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ), "LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ"); - *ret_conv = C3Tuple_OnionMessageContentsDestinationBlindedPathZ_new(a_conv, b_conv, c_conv); + LDKMessageSendInstructions b_conv = *(LDKMessageSendInstructions*)(b_ptr); + b_conv = MessageSendInstructions_clone((LDKMessageSendInstructions*)untag_ptr(b)); + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ), "LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ"); + *ret_conv = C2Tuple_OnionMessageContentsMessageSendInstructionsZ_new(a_conv, b_conv); return tag_ptr(ret_conv, true); } -void CS_LDK_C3Tuple_OnionMessageContentsDestinationBlindedPathZ_free(int64_t _res) { +void CS_LDK_C2Tuple_OnionMessageContentsMessageSendInstructionsZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ _res_conv = *(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ*)(_res_ptr); + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ _res_conv = *(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ*)(_res_ptr); FREE(untag_ptr(_res)); - C3Tuple_OnionMessageContentsDestinationBlindedPathZ_free(_res_conv); + C2Tuple_OnionMessageContentsMessageSendInstructionsZ_free(_res_conv); } -void CS_LDK_CVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ_free(int64_tArray _res) { - LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ _res_constr; +void CS_LDK_CVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ_free(int64_tArray _res) { + LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ _res_constr; _res_constr.datalen = _res->arr_len; if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ), "LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ), "LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ Elements"); else _res_constr.data = NULL; int64_t* _res_vals = _res->elems; - for (size_t e = 0; e < _res_constr.datalen; e++) { - int64_t _res_conv_56 = _res_vals[e]; - void* _res_conv_56_ptr = untag_ptr(_res_conv_56); - CHECK_ACCESS(_res_conv_56_ptr); - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ _res_conv_56_conv = *(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ*)(_res_conv_56_ptr); - FREE(untag_ptr(_res_conv_56)); - _res_constr.data[e] = _res_conv_56_conv; + for (size_t d = 0; d < _res_constr.datalen; d++) { + int64_t _res_conv_55 = _res_vals[d]; + void* _res_conv_55_ptr = untag_ptr(_res_conv_55); + CHECK_ACCESS(_res_conv_55_ptr); + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ _res_conv_55_conv = *(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ*)(_res_conv_55_ptr); + FREE(untag_ptr(_res_conv_55)); + _res_constr.data[d] = _res_conv_55_conv; } FREE(_res); - CVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ_free(_res_constr); + CVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ_free(_res_constr); } int64_t CS_LDK_COption_TypeZ_some(int64_t o) { @@ -27107,23 +28654,6 @@ int64_t CS_LDK_CResult_CVec_u8ZIOErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -void CS_LDK_CVec_StrZ_free(ptrArray _res) { - LDKCVec_StrZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKStr), "LDKCVec_StrZ Elements"); - else - _res_constr.data = NULL; - jstring* _res_vals = (void*) _res->elems; - for (size_t i = 0; i < _res_constr.datalen; i++) { - jstring _res_conv_8 = _res_vals[i]; - LDKStr dummy = { .chars = NULL, .len = 0, .chars_is_owned = false }; - _res_constr.data[i] = dummy; - } - FREE(_res); - CVec_StrZ_free(_res_constr); -} - int64_t CS_LDK_CResult_CVec_StrZIOErrorZ_ok(ptrArray o) { LDKCVec_StrZ o_constr; o_constr.datalen = o->arr_len; @@ -27417,52 +28947,6 @@ int64_t CS_LDK_CResult_InvoiceRequestBolt12SemanticErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -int64_t CS_LDK_COption_SecretKeyZ_some(int8_tArray o) { - LDKSecretKey o_ref; - CHECK(o->arr_len == 32); - memcpy(o_ref.bytes, o->elems, 32); FREE(o); - LDKCOption_SecretKeyZ *ret_copy = MALLOC(sizeof(LDKCOption_SecretKeyZ), "LDKCOption_SecretKeyZ"); - *ret_copy = COption_SecretKeyZ_some(o_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_COption_SecretKeyZ_none() { - LDKCOption_SecretKeyZ *ret_copy = MALLOC(sizeof(LDKCOption_SecretKeyZ), "LDKCOption_SecretKeyZ"); - *ret_copy = COption_SecretKeyZ_none(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -void CS_LDK_COption_SecretKeyZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCOption_SecretKeyZ _res_conv = *(LDKCOption_SecretKeyZ*)(_res_ptr); - FREE(untag_ptr(_res)); - COption_SecretKeyZ_free(_res_conv); -} - -static inline uint64_t COption_SecretKeyZ_clone_ptr(LDKCOption_SecretKeyZ *NONNULL_PTR arg) { - LDKCOption_SecretKeyZ *ret_copy = MALLOC(sizeof(LDKCOption_SecretKeyZ), "LDKCOption_SecretKeyZ"); - *ret_copy = COption_SecretKeyZ_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -int64_t CS_LDK_COption_SecretKeyZ_clone_ptr(int64_t arg) { - LDKCOption_SecretKeyZ* arg_conv = (LDKCOption_SecretKeyZ*)untag_ptr(arg); - int64_t ret_conv = COption_SecretKeyZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_COption_SecretKeyZ_clone(int64_t orig) { - LDKCOption_SecretKeyZ* orig_conv = (LDKCOption_SecretKeyZ*)untag_ptr(orig); - LDKCOption_SecretKeyZ *ret_copy = MALLOC(sizeof(LDKCOption_SecretKeyZ), "LDKCOption_SecretKeyZ"); - *ret_copy = COption_SecretKeyZ_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - int64_t CS_LDK_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_ok(int64_t o) { LDKInvoiceWithExplicitSigningPubkeyBuilder o_conv; o_conv.inner = untag_ptr(o); @@ -28105,57 +29589,57 @@ int64_t CS_LDK_CResult_StfuDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_SpliceDecodeErrorZ_ok(int64_t o) { - LDKSplice o_conv; +int64_t CS_LDK_CResult_SpliceInitDecodeErrorZ_ok(int64_t o) { + LDKSpliceInit o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = Splice_clone(&o_conv); - LDKCResult_SpliceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceDecodeErrorZ), "LDKCResult_SpliceDecodeErrorZ"); - *ret_conv = CResult_SpliceDecodeErrorZ_ok(o_conv); + o_conv = SpliceInit_clone(&o_conv); + LDKCResult_SpliceInitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceInitDecodeErrorZ), "LDKCResult_SpliceInitDecodeErrorZ"); + *ret_conv = CResult_SpliceInitDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_SpliceDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_SpliceInitDecodeErrorZ_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_SpliceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceDecodeErrorZ), "LDKCResult_SpliceDecodeErrorZ"); - *ret_conv = CResult_SpliceDecodeErrorZ_err(e_conv); + LDKCResult_SpliceInitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceInitDecodeErrorZ), "LDKCResult_SpliceInitDecodeErrorZ"); + *ret_conv = CResult_SpliceInitDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_SpliceDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_SpliceDecodeErrorZ* o_conv = (LDKCResult_SpliceDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_SpliceDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_SpliceInitDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_SpliceInitDecodeErrorZ* o_conv = (LDKCResult_SpliceInitDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_SpliceInitDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_SpliceDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_SpliceInitDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_SpliceDecodeErrorZ _res_conv = *(LDKCResult_SpliceDecodeErrorZ*)(_res_ptr); + LDKCResult_SpliceInitDecodeErrorZ _res_conv = *(LDKCResult_SpliceInitDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_SpliceDecodeErrorZ_free(_res_conv); + CResult_SpliceInitDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_SpliceDecodeErrorZ_clone_ptr(LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_SpliceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceDecodeErrorZ), "LDKCResult_SpliceDecodeErrorZ"); - *ret_conv = CResult_SpliceDecodeErrorZ_clone(arg); +static inline uint64_t CResult_SpliceInitDecodeErrorZ_clone_ptr(LDKCResult_SpliceInitDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_SpliceInitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceInitDecodeErrorZ), "LDKCResult_SpliceInitDecodeErrorZ"); + *ret_conv = CResult_SpliceInitDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_SpliceDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_SpliceDecodeErrorZ* arg_conv = (LDKCResult_SpliceDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_SpliceDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_SpliceInitDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_SpliceInitDecodeErrorZ* arg_conv = (LDKCResult_SpliceInitDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_SpliceInitDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_SpliceDecodeErrorZ_clone(int64_t orig) { - LDKCResult_SpliceDecodeErrorZ* orig_conv = (LDKCResult_SpliceDecodeErrorZ*)untag_ptr(orig); - LDKCResult_SpliceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceDecodeErrorZ), "LDKCResult_SpliceDecodeErrorZ"); - *ret_conv = CResult_SpliceDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_SpliceInitDecodeErrorZ_clone(int64_t orig) { + LDKCResult_SpliceInitDecodeErrorZ* orig_conv = (LDKCResult_SpliceInitDecodeErrorZ*)untag_ptr(orig); + LDKCResult_SpliceInitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceInitDecodeErrorZ), "LDKCResult_SpliceInitDecodeErrorZ"); + *ret_conv = CResult_SpliceInitDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -28969,6 +30453,60 @@ int64_t CS_LDK_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_CResult_CommitmentSignedBatchDecodeErrorZ_ok(int64_t o) { + LDKCommitmentSignedBatch o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = CommitmentSignedBatch_clone(&o_conv); + LDKCResult_CommitmentSignedBatchDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedBatchDecodeErrorZ), "LDKCResult_CommitmentSignedBatchDecodeErrorZ"); + *ret_conv = CResult_CommitmentSignedBatchDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_CommitmentSignedBatchDecodeErrorZ_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_CommitmentSignedBatchDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedBatchDecodeErrorZ), "LDKCResult_CommitmentSignedBatchDecodeErrorZ"); + *ret_conv = CResult_CommitmentSignedBatchDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_CommitmentSignedBatchDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_CommitmentSignedBatchDecodeErrorZ* o_conv = (LDKCResult_CommitmentSignedBatchDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_CommitmentSignedBatchDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_CommitmentSignedBatchDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_CommitmentSignedBatchDecodeErrorZ _res_conv = *(LDKCResult_CommitmentSignedBatchDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_CommitmentSignedBatchDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_CommitmentSignedBatchDecodeErrorZ_clone_ptr(LDKCResult_CommitmentSignedBatchDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_CommitmentSignedBatchDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedBatchDecodeErrorZ), "LDKCResult_CommitmentSignedBatchDecodeErrorZ"); + *ret_conv = CResult_CommitmentSignedBatchDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_CommitmentSignedBatchDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_CommitmentSignedBatchDecodeErrorZ* arg_conv = (LDKCResult_CommitmentSignedBatchDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_CommitmentSignedBatchDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_CommitmentSignedBatchDecodeErrorZ_clone(int64_t orig) { + LDKCResult_CommitmentSignedBatchDecodeErrorZ* orig_conv = (LDKCResult_CommitmentSignedBatchDecodeErrorZ*)untag_ptr(orig); + LDKCResult_CommitmentSignedBatchDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedBatchDecodeErrorZ), "LDKCResult_CommitmentSignedBatchDecodeErrorZ"); + *ret_conv = CResult_CommitmentSignedBatchDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + int64_t CS_LDK_CResult_CommitmentSignedDecodeErrorZ_ok(int64_t o) { LDKCommitmentSigned o_conv; o_conv.inner = untag_ptr(o); @@ -30697,80 +32235,6 @@ int64_t CS_LDK_CResult_GossipTimestampFilterDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -void CS_LDK_CVec_PhantomRouteHintsZ_free(int64_tArray _res) { - LDKCVec_PhantomRouteHintsZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = _res->elems; - for (size_t t = 0; t < _res_constr.datalen; t++) { - int64_t _res_conv_19 = _res_vals[t]; - LDKPhantomRouteHints _res_conv_19_conv; - _res_conv_19_conv.inner = untag_ptr(_res_conv_19); - _res_conv_19_conv.is_owned = ptr_is_owned(_res_conv_19); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_19_conv); - _res_constr.data[t] = _res_conv_19_conv; - } - FREE(_res); - CVec_PhantomRouteHintsZ_free(_res_constr); -} - -int64_t CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(int64_t o) { - LDKBolt11Invoice o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = Bolt11Invoice_clone(&o_conv); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_err(int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKSignOrCreationError e_conv = *(LDKSignOrCreationError*)(e_ptr); - e_conv = SignOrCreationError_clone((LDKSignOrCreationError*)untag_ptr(e)); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -jboolean CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(int64_t o) { - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* o_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(o_conv); - return ret_conv; -} - -void CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ _res_conv = *(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_Bolt11InvoiceSignOrCreationErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_Bolt11InvoiceSignOrCreationErrorZ_clone_ptr(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR arg) { - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_clone_ptr(int64_t arg) { - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* arg_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(int64_t orig) { - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* orig_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(orig); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - int64_t CS_LDK_COption_InboundHTLCStateDetailsZ_some(int32_t o) { LDKInboundHTLCStateDetails o_conv = LDKInboundHTLCStateDetails_from_cs(o); LDKCOption_InboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_InboundHTLCStateDetailsZ), "LDKCOption_InboundHTLCStateDetailsZ"); @@ -31389,6 +32853,167 @@ void CS_LDK_CVec_FutureZ_free(int64_tArray _res) { CVec_FutureZ_free(_res_constr); } +int64_t CS_LDK_CResult_HeldHtlcAvailableDecodeErrorZ_ok(int64_t o) { + LDKHeldHtlcAvailable o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = HeldHtlcAvailable_clone(&o_conv); + LDKCResult_HeldHtlcAvailableDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HeldHtlcAvailableDecodeErrorZ), "LDKCResult_HeldHtlcAvailableDecodeErrorZ"); + *ret_conv = CResult_HeldHtlcAvailableDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_HeldHtlcAvailableDecodeErrorZ_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_HeldHtlcAvailableDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HeldHtlcAvailableDecodeErrorZ), "LDKCResult_HeldHtlcAvailableDecodeErrorZ"); + *ret_conv = CResult_HeldHtlcAvailableDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_HeldHtlcAvailableDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_HeldHtlcAvailableDecodeErrorZ* o_conv = (LDKCResult_HeldHtlcAvailableDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_HeldHtlcAvailableDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_HeldHtlcAvailableDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_HeldHtlcAvailableDecodeErrorZ _res_conv = *(LDKCResult_HeldHtlcAvailableDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_HeldHtlcAvailableDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_HeldHtlcAvailableDecodeErrorZ_clone_ptr(LDKCResult_HeldHtlcAvailableDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HeldHtlcAvailableDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HeldHtlcAvailableDecodeErrorZ), "LDKCResult_HeldHtlcAvailableDecodeErrorZ"); + *ret_conv = CResult_HeldHtlcAvailableDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_HeldHtlcAvailableDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_HeldHtlcAvailableDecodeErrorZ* arg_conv = (LDKCResult_HeldHtlcAvailableDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_HeldHtlcAvailableDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_HeldHtlcAvailableDecodeErrorZ_clone(int64_t orig) { + LDKCResult_HeldHtlcAvailableDecodeErrorZ* orig_conv = (LDKCResult_HeldHtlcAvailableDecodeErrorZ*)untag_ptr(orig); + LDKCResult_HeldHtlcAvailableDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HeldHtlcAvailableDecodeErrorZ), "LDKCResult_HeldHtlcAvailableDecodeErrorZ"); + *ret_conv = CResult_HeldHtlcAvailableDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_ReleaseHeldHtlcDecodeErrorZ_ok(int64_t o) { + LDKReleaseHeldHtlc o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = ReleaseHeldHtlc_clone(&o_conv); + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReleaseHeldHtlcDecodeErrorZ), "LDKCResult_ReleaseHeldHtlcDecodeErrorZ"); + *ret_conv = CResult_ReleaseHeldHtlcDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_ReleaseHeldHtlcDecodeErrorZ_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_ReleaseHeldHtlcDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReleaseHeldHtlcDecodeErrorZ), "LDKCResult_ReleaseHeldHtlcDecodeErrorZ"); + *ret_conv = CResult_ReleaseHeldHtlcDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_ReleaseHeldHtlcDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* o_conv = (LDKCResult_ReleaseHeldHtlcDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ReleaseHeldHtlcDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_ReleaseHeldHtlcDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_ReleaseHeldHtlcDecodeErrorZ _res_conv = *(LDKCResult_ReleaseHeldHtlcDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_ReleaseHeldHtlcDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_ReleaseHeldHtlcDecodeErrorZ_clone_ptr(LDKCResult_ReleaseHeldHtlcDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReleaseHeldHtlcDecodeErrorZ), "LDKCResult_ReleaseHeldHtlcDecodeErrorZ"); + *ret_conv = CResult_ReleaseHeldHtlcDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_ReleaseHeldHtlcDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* arg_conv = (LDKCResult_ReleaseHeldHtlcDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ReleaseHeldHtlcDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_ReleaseHeldHtlcDecodeErrorZ_clone(int64_t orig) { + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* orig_conv = (LDKCResult_ReleaseHeldHtlcDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReleaseHeldHtlcDecodeErrorZ), "LDKCResult_ReleaseHeldHtlcDecodeErrorZ"); + *ret_conv = CResult_ReleaseHeldHtlcDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_AsyncPaymentsMessageDecodeErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKAsyncPaymentsMessage o_conv = *(LDKAsyncPaymentsMessage*)(o_ptr); + o_conv = AsyncPaymentsMessage_clone((LDKAsyncPaymentsMessage*)untag_ptr(o)); + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AsyncPaymentsMessageDecodeErrorZ), "LDKCResult_AsyncPaymentsMessageDecodeErrorZ"); + *ret_conv = CResult_AsyncPaymentsMessageDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_AsyncPaymentsMessageDecodeErrorZ_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_AsyncPaymentsMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AsyncPaymentsMessageDecodeErrorZ), "LDKCResult_AsyncPaymentsMessageDecodeErrorZ"); + *ret_conv = CResult_AsyncPaymentsMessageDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_AsyncPaymentsMessageDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* o_conv = (LDKCResult_AsyncPaymentsMessageDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_AsyncPaymentsMessageDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_AsyncPaymentsMessageDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_AsyncPaymentsMessageDecodeErrorZ _res_conv = *(LDKCResult_AsyncPaymentsMessageDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_AsyncPaymentsMessageDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_AsyncPaymentsMessageDecodeErrorZ_clone_ptr(LDKCResult_AsyncPaymentsMessageDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AsyncPaymentsMessageDecodeErrorZ), "LDKCResult_AsyncPaymentsMessageDecodeErrorZ"); + *ret_conv = CResult_AsyncPaymentsMessageDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_AsyncPaymentsMessageDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* arg_conv = (LDKCResult_AsyncPaymentsMessageDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_AsyncPaymentsMessageDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_AsyncPaymentsMessageDecodeErrorZ_clone(int64_t orig) { + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* orig_conv = (LDKCResult_AsyncPaymentsMessageDecodeErrorZ*)untag_ptr(orig); + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AsyncPaymentsMessageDecodeErrorZ), "LDKCResult_AsyncPaymentsMessageDecodeErrorZ"); + *ret_conv = CResult_AsyncPaymentsMessageDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + int64_t CS_LDK_CResult_OffersMessageDecodeErrorZ_ok(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -32251,6 +33876,59 @@ void CS_LDK_CVec_TransactionZ_free(ptrArray _res) { CVec_TransactionZ_free(_res_constr); } +int64_t CS_LDK_CResult_FundingInfoDecodeErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKFundingInfo o_conv = *(LDKFundingInfo*)(o_ptr); + o_conv = FundingInfo_clone((LDKFundingInfo*)untag_ptr(o)); + LDKCResult_FundingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingInfoDecodeErrorZ), "LDKCResult_FundingInfoDecodeErrorZ"); + *ret_conv = CResult_FundingInfoDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_FundingInfoDecodeErrorZ_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_FundingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingInfoDecodeErrorZ), "LDKCResult_FundingInfoDecodeErrorZ"); + *ret_conv = CResult_FundingInfoDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_FundingInfoDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_FundingInfoDecodeErrorZ* o_conv = (LDKCResult_FundingInfoDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_FundingInfoDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_FundingInfoDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_FundingInfoDecodeErrorZ _res_conv = *(LDKCResult_FundingInfoDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_FundingInfoDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_FundingInfoDecodeErrorZ_clone_ptr(LDKCResult_FundingInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_FundingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingInfoDecodeErrorZ), "LDKCResult_FundingInfoDecodeErrorZ"); + *ret_conv = CResult_FundingInfoDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_FundingInfoDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_FundingInfoDecodeErrorZ* arg_conv = (LDKCResult_FundingInfoDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_FundingInfoDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_FundingInfoDecodeErrorZ_clone(int64_t orig) { + LDKCResult_FundingInfoDecodeErrorZ* orig_conv = (LDKCResult_FundingInfoDecodeErrorZ*)untag_ptr(orig); + LDKCResult_FundingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingInfoDecodeErrorZ), "LDKCResult_FundingInfoDecodeErrorZ"); + *ret_conv = CResult_FundingInfoDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + int64_t CS_LDK_CResult_PaymentPurposeDecodeErrorZ_ok(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -32658,53 +34336,100 @@ int64_t CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_clone(int64_t orig) return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_ok(int32_t o) { +int64_t CS_LDK_COption_PaymentFailureReasonZ_some(int32_t o) { LDKPaymentFailureReason o_conv = LDKPaymentFailureReason_from_cs(o); - LDKCResult_PaymentFailureReasonDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentFailureReasonDecodeErrorZ), "LDKCResult_PaymentFailureReasonDecodeErrorZ"); - *ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_ok(o_conv); + LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); + *ret_copy = COption_PaymentFailureReasonZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_COption_PaymentFailureReasonZ_none() { + LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); + *ret_copy = COption_PaymentFailureReasonZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_COption_PaymentFailureReasonZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_PaymentFailureReasonZ _res_conv = *(LDKCOption_PaymentFailureReasonZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_PaymentFailureReasonZ_free(_res_conv); +} + +static inline uint64_t COption_PaymentFailureReasonZ_clone_ptr(LDKCOption_PaymentFailureReasonZ *NONNULL_PTR arg) { + LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); + *ret_copy = COption_PaymentFailureReasonZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_COption_PaymentFailureReasonZ_clone_ptr(int64_t arg) { + LDKCOption_PaymentFailureReasonZ* arg_conv = (LDKCOption_PaymentFailureReasonZ*)untag_ptr(arg); + int64_t ret_conv = COption_PaymentFailureReasonZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_COption_PaymentFailureReasonZ_clone(int64_t orig) { + LDKCOption_PaymentFailureReasonZ* orig_conv = (LDKCOption_PaymentFailureReasonZ*)untag_ptr(orig); + LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); + *ret_copy = COption_PaymentFailureReasonZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_CResult_COption_PaymentFailureReasonZDecodeErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKCOption_PaymentFailureReasonZ o_conv = *(LDKCOption_PaymentFailureReasonZ*)(o_ptr); + o_conv = COption_PaymentFailureReasonZ_clone((LDKCOption_PaymentFailureReasonZ*)untag_ptr(o)); + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ), "LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_PaymentFailureReasonZDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_COption_PaymentFailureReasonZDecodeErrorZ_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_PaymentFailureReasonDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentFailureReasonDecodeErrorZ), "LDKCResult_PaymentFailureReasonDecodeErrorZ"); - *ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_err(e_conv); + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ), "LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_PaymentFailureReasonZDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_PaymentFailureReasonDecodeErrorZ* o_conv = (LDKCResult_PaymentFailureReasonDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_COption_PaymentFailureReasonZDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* o_conv = (LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_COption_PaymentFailureReasonZDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_COption_PaymentFailureReasonZDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_PaymentFailureReasonDecodeErrorZ _res_conv = *(LDKCResult_PaymentFailureReasonDecodeErrorZ*)(_res_ptr); + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ _res_conv = *(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_PaymentFailureReasonDecodeErrorZ_free(_res_conv); + CResult_COption_PaymentFailureReasonZDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_PaymentFailureReasonDecodeErrorZ_clone_ptr(LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_PaymentFailureReasonDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentFailureReasonDecodeErrorZ), "LDKCResult_PaymentFailureReasonDecodeErrorZ"); - *ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_clone(arg); +static inline uint64_t CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone_ptr(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ), "LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_PaymentFailureReasonDecodeErrorZ* arg_conv = (LDKCResult_PaymentFailureReasonDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* arg_conv = (LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_clone(int64_t orig) { - LDKCResult_PaymentFailureReasonDecodeErrorZ* orig_conv = (LDKCResult_PaymentFailureReasonDecodeErrorZ*)untag_ptr(orig); - LDKCResult_PaymentFailureReasonDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentFailureReasonDecodeErrorZ), "LDKCResult_PaymentFailureReasonDecodeErrorZ"); - *ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone(int64_t orig) { + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* orig_conv = (LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ*)untag_ptr(orig); + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ), "LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -32774,50 +34499,6 @@ void CS_LDK_CVec_ClaimedHTLCZ_free(int64_tArray _res) { CVec_ClaimedHTLCZ_free(_res_constr); } -int64_t CS_LDK_COption_PaymentFailureReasonZ_some(int32_t o) { - LDKPaymentFailureReason o_conv = LDKPaymentFailureReason_from_cs(o); - LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); - *ret_copy = COption_PaymentFailureReasonZ_some(o_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_COption_PaymentFailureReasonZ_none() { - LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); - *ret_copy = COption_PaymentFailureReasonZ_none(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -void CS_LDK_COption_PaymentFailureReasonZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCOption_PaymentFailureReasonZ _res_conv = *(LDKCOption_PaymentFailureReasonZ*)(_res_ptr); - FREE(untag_ptr(_res)); - COption_PaymentFailureReasonZ_free(_res_conv); -} - -static inline uint64_t COption_PaymentFailureReasonZ_clone_ptr(LDKCOption_PaymentFailureReasonZ *NONNULL_PTR arg) { - LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); - *ret_copy = COption_PaymentFailureReasonZ_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -int64_t CS_LDK_COption_PaymentFailureReasonZ_clone_ptr(int64_t arg) { - LDKCOption_PaymentFailureReasonZ* arg_conv = (LDKCOption_PaymentFailureReasonZ*)untag_ptr(arg); - int64_t ret_conv = COption_PaymentFailureReasonZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_COption_PaymentFailureReasonZ_clone(int64_t orig) { - LDKCOption_PaymentFailureReasonZ* orig_conv = (LDKCOption_PaymentFailureReasonZ*)untag_ptr(orig); - LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); - *ret_copy = COption_PaymentFailureReasonZ_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - int64_t CS_LDK_COption_EventZ_some(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -32918,6 +34599,80 @@ int64_t CS_LDK_CResult_COption_EventZDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_CResult_NonceDecodeErrorZ_ok(int64_t o) { + LDKNonce o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = Nonce_clone(&o_conv); + LDKCResult_NonceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonceDecodeErrorZ), "LDKCResult_NonceDecodeErrorZ"); + *ret_conv = CResult_NonceDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_NonceDecodeErrorZ_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_NonceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonceDecodeErrorZ), "LDKCResult_NonceDecodeErrorZ"); + *ret_conv = CResult_NonceDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_NonceDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_NonceDecodeErrorZ* o_conv = (LDKCResult_NonceDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_NonceDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_NonceDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_NonceDecodeErrorZ _res_conv = *(LDKCResult_NonceDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_NonceDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_NonceDecodeErrorZ_clone_ptr(LDKCResult_NonceDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NonceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonceDecodeErrorZ), "LDKCResult_NonceDecodeErrorZ"); + *ret_conv = CResult_NonceDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_NonceDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_NonceDecodeErrorZ* arg_conv = (LDKCResult_NonceDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_NonceDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_NonceDecodeErrorZ_clone(int64_t orig) { + LDKCResult_NonceDecodeErrorZ* orig_conv = (LDKCResult_NonceDecodeErrorZ*)untag_ptr(orig); + LDKCResult_NonceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonceDecodeErrorZ), "LDKCResult_NonceDecodeErrorZ"); + *ret_conv = CResult_NonceDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_CVec_RouteHintHopZ_free(int64_tArray _res) { + LDKCVec_RouteHintHopZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = _res->elems; + for (size_t o = 0; o < _res_constr.datalen; o++) { + int64_t _res_conv_14 = _res_vals[o]; + LDKRouteHintHop _res_conv_14_conv; + _res_conv_14_conv.inner = untag_ptr(_res_conv_14); + _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv); + _res_constr.data[o] = _res_conv_14_conv; + } + FREE(_res); + CVec_RouteHintHopZ_free(_res_constr); +} + int64_t CS_LDK_CResult_SiPrefixBolt11ParseErrorZ_ok(int32_t o) { LDKSiPrefix o_conv = LDKSiPrefix_from_cs(o); LDKCResult_SiPrefixBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixBolt11ParseErrorZ), "LDKCResult_SiPrefixBolt11ParseErrorZ"); @@ -33551,6 +35306,60 @@ int64_t CS_LDK_CResult_BigSizeDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_CResult_UntrustedStringDecodeErrorZ_ok(int64_t o) { + LDKUntrustedString o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = UntrustedString_clone(&o_conv); + LDKCResult_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ"); + *ret_conv = CResult_UntrustedStringDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_UntrustedStringDecodeErrorZ_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_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ"); + *ret_conv = CResult_UntrustedStringDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_UntrustedStringDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_UntrustedStringDecodeErrorZ* o_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_UntrustedStringDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_UntrustedStringDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_UntrustedStringDecodeErrorZ _res_conv = *(LDKCResult_UntrustedStringDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_UntrustedStringDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_UntrustedStringDecodeErrorZ_clone_ptr(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ"); + *ret_conv = CResult_UntrustedStringDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_UntrustedStringDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_UntrustedStringDecodeErrorZ* arg_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_UntrustedStringDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_UntrustedStringDecodeErrorZ_clone(int64_t orig) { + LDKCResult_UntrustedStringDecodeErrorZ* orig_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(orig); + LDKCResult_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ"); + *ret_conv = CResult_UntrustedStringDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + int64_t CS_LDK_CResult_HostnameDecodeErrorZ_ok(int64_t o) { LDKHostname o_conv; o_conv.inner = untag_ptr(o); @@ -33709,60 +35518,6 @@ int64_t CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_clone(int64_t orig) return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_UntrustedStringDecodeErrorZ_ok(int64_t o) { - LDKUntrustedString o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = UntrustedString_clone(&o_conv); - LDKCResult_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ"); - *ret_conv = CResult_UntrustedStringDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_UntrustedStringDecodeErrorZ_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_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ"); - *ret_conv = CResult_UntrustedStringDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -jboolean CS_LDK_CResult_UntrustedStringDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_UntrustedStringDecodeErrorZ* o_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_UntrustedStringDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -void CS_LDK_CResult_UntrustedStringDecodeErrorZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_UntrustedStringDecodeErrorZ _res_conv = *(LDKCResult_UntrustedStringDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_UntrustedStringDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_UntrustedStringDecodeErrorZ_clone_ptr(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ"); - *ret_conv = CResult_UntrustedStringDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t CS_LDK_CResult_UntrustedStringDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_UntrustedStringDecodeErrorZ* arg_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_UntrustedStringDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_CResult_UntrustedStringDecodeErrorZ_clone(int64_t orig) { - LDKCResult_UntrustedStringDecodeErrorZ* orig_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(orig); - LDKCResult_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ"); - *ret_conv = CResult_UntrustedStringDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - int64_t CS_LDK_CResult_ChannelIdDecodeErrorZ_ok(int64_t o) { LDKChannelId o_conv; o_conv.inner = untag_ptr(o); @@ -33853,6 +35608,130 @@ void CS_LDK_C2Tuple__u832u16Z_free(int64_t _res) { C2Tuple__u832u16Z_free(_res_conv); } +int64_t CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_ok(int64_t o) { + LDKBlindedPayInfo o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = BlindedPayInfo_clone(&o_conv); + LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); + *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_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_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); + *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_BlindedPayInfoDecodeErrorZ* o_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_BlindedPayInfoDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_BlindedPayInfoDecodeErrorZ _res_conv = *(LDKCResult_BlindedPayInfoDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_BlindedPayInfoDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_BlindedPayInfoDecodeErrorZ_clone_ptr(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); + *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_BlindedPayInfoDecodeErrorZ* arg_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BlindedPayInfoDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_clone(int64_t orig) { + LDKCResult_BlindedPayInfoDecodeErrorZ* orig_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(orig); + LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); + *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_BlindedPaymentPathNoneZ_ok(int64_t o) { + LDKBlindedPaymentPath o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = BlindedPaymentPath_clone(&o_conv); + LDKCResult_BlindedPaymentPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPaymentPathNoneZ), "LDKCResult_BlindedPaymentPathNoneZ"); + *ret_conv = CResult_BlindedPaymentPathNoneZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_BlindedPaymentPathNoneZ_err() { + LDKCResult_BlindedPaymentPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPaymentPathNoneZ), "LDKCResult_BlindedPaymentPathNoneZ"); + *ret_conv = CResult_BlindedPaymentPathNoneZ_err(); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_BlindedPaymentPathNoneZ_is_ok(int64_t o) { + LDKCResult_BlindedPaymentPathNoneZ* o_conv = (LDKCResult_BlindedPaymentPathNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_BlindedPaymentPathNoneZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_BlindedPaymentPathNoneZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_BlindedPaymentPathNoneZ _res_conv = *(LDKCResult_BlindedPaymentPathNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_BlindedPaymentPathNoneZ_free(_res_conv); +} + +static inline uint64_t CResult_BlindedPaymentPathNoneZ_clone_ptr(LDKCResult_BlindedPaymentPathNoneZ *NONNULL_PTR arg) { + LDKCResult_BlindedPaymentPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPaymentPathNoneZ), "LDKCResult_BlindedPaymentPathNoneZ"); + *ret_conv = CResult_BlindedPaymentPathNoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_BlindedPaymentPathNoneZ_clone_ptr(int64_t arg) { + LDKCResult_BlindedPaymentPathNoneZ* arg_conv = (LDKCResult_BlindedPaymentPathNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BlindedPaymentPathNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_BlindedPaymentPathNoneZ_clone(int64_t orig) { + LDKCResult_BlindedPaymentPathNoneZ* orig_conv = (LDKCResult_BlindedPaymentPathNoneZ*)untag_ptr(orig); + LDKCResult_BlindedPaymentPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPaymentPathNoneZ), "LDKCResult_BlindedPaymentPathNoneZ"); + *ret_conv = CResult_BlindedPaymentPathNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_CVec_PaymentForwardNodeZ_free(int64_tArray _res) { + LDKCVec_PaymentForwardNodeZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPaymentForwardNode), "LDKCVec_PaymentForwardNodeZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = _res->elems; + for (size_t u = 0; u < _res_constr.datalen; u++) { + int64_t _res_conv_20 = _res_vals[u]; + LDKPaymentForwardNode _res_conv_20_conv; + _res_conv_20_conv.inner = untag_ptr(_res_conv_20); + _res_conv_20_conv.is_owned = ptr_is_owned(_res_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_20_conv); + _res_constr.data[u] = _res_conv_20_conv; + } + FREE(_res); + CVec_PaymentForwardNodeZ_free(_res_constr); +} + int64_t CS_LDK_CResult_PaymentRelayDecodeErrorZ_ok(int64_t o) { LDKPaymentRelay o_conv; o_conv.inner = untag_ptr(o); @@ -34176,196 +36055,155 @@ int64_t CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_StrSecp256k1ErrorZ_ok(jstring o) { - LDKStr o_conv = str_ref_to_owned_c(o); - LDKCResult_StrSecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StrSecp256k1ErrorZ), "LDKCResult_StrSecp256k1ErrorZ"); - *ret_conv = CResult_StrSecp256k1ErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_TxOutUtxoLookupErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKTxOut o_conv = *(LDKTxOut*)(o_ptr); + o_conv = TxOut_clone((LDKTxOut*)untag_ptr(o)); + LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); + *ret_conv = CResult_TxOutUtxoLookupErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_StrSecp256k1ErrorZ_err(int32_t e) { - LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_cs(e); - LDKCResult_StrSecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StrSecp256k1ErrorZ), "LDKCResult_StrSecp256k1ErrorZ"); - *ret_conv = CResult_StrSecp256k1ErrorZ_err(e_conv); +int64_t CS_LDK_CResult_TxOutUtxoLookupErrorZ_err(int32_t e) { + LDKUtxoLookupError e_conv = LDKUtxoLookupError_from_cs(e); + LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); + *ret_conv = CResult_TxOutUtxoLookupErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_StrSecp256k1ErrorZ_is_ok(int64_t o) { - LDKCResult_StrSecp256k1ErrorZ* o_conv = (LDKCResult_StrSecp256k1ErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_StrSecp256k1ErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_TxOutUtxoLookupErrorZ_is_ok(int64_t o) { + LDKCResult_TxOutUtxoLookupErrorZ* o_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_TxOutUtxoLookupErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_StrSecp256k1ErrorZ_free(int64_t _res) { +void CS_LDK_CResult_TxOutUtxoLookupErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_StrSecp256k1ErrorZ _res_conv = *(LDKCResult_StrSecp256k1ErrorZ*)(_res_ptr); + LDKCResult_TxOutUtxoLookupErrorZ _res_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_StrSecp256k1ErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_StrSecp256k1ErrorZ_clone_ptr(LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR arg) { - LDKCResult_StrSecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StrSecp256k1ErrorZ), "LDKCResult_StrSecp256k1ErrorZ"); - *ret_conv = CResult_StrSecp256k1ErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t CS_LDK_CResult_StrSecp256k1ErrorZ_clone_ptr(int64_t arg) { - LDKCResult_StrSecp256k1ErrorZ* arg_conv = (LDKCResult_StrSecp256k1ErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_StrSecp256k1ErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_CResult_StrSecp256k1ErrorZ_clone(int64_t orig) { - LDKCResult_StrSecp256k1ErrorZ* orig_conv = (LDKCResult_StrSecp256k1ErrorZ*)untag_ptr(orig); - LDKCResult_StrSecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StrSecp256k1ErrorZ), "LDKCResult_StrSecp256k1ErrorZ"); - *ret_conv = CResult_StrSecp256k1ErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); + CResult_TxOutUtxoLookupErrorZ_free(_res_conv); } -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); +static inline uint64_t CResult_TxOutUtxoLookupErrorZ_clone_ptr(LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR arg) { + LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); + *ret_conv = CResult_TxOutUtxoLookupErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t 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_TxOutUtxoLookupErrorZ_clone_ptr(int64_t arg) { + LDKCResult_TxOutUtxoLookupErrorZ* arg_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_TxOutUtxoLookupErrorZ_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); +int64_t CS_LDK_CResult_TxOutUtxoLookupErrorZ_clone(int64_t orig) { + LDKCResult_TxOutUtxoLookupErrorZ* orig_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(orig); + LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); + *ret_conv = CResult_TxOutUtxoLookupErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -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); +int64_t CS_LDK_CResult_ResponderDecodeErrorZ_ok(int64_t o) { + LDKResponder o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = Responder_clone(&o_conv); + LDKCResult_ResponderDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ResponderDecodeErrorZ), "LDKCResult_ResponderDecodeErrorZ"); + *ret_conv = CResult_ResponderDecodeErrorZ_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(); +int64_t CS_LDK_CResult_ResponderDecodeErrorZ_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_ResponderDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ResponderDecodeErrorZ), "LDKCResult_ResponderDecodeErrorZ"); + *ret_conv = CResult_ResponderDecodeErrorZ_err(e_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); +jboolean CS_LDK_CResult_ResponderDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_ResponderDecodeErrorZ* o_conv = (LDKCResult_ResponderDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ResponderDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(int64_t _res) { +void CS_LDK_CResult_ResponderDecodeErrorZ_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_ResponderDecodeErrorZ _res_conv = *(LDKCResult_ResponderDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(_res_conv); + CResult_ResponderDecodeErrorZ_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_ResponderDecodeErrorZ_clone_ptr(LDKCResult_ResponderDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ResponderDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ResponderDecodeErrorZ), "LDKCResult_ResponderDecodeErrorZ"); + *ret_conv = CResult_ResponderDecodeErrorZ_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_ResponderDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_ResponderDecodeErrorZ* arg_conv = (LDKCResult_ResponderDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ResponderDecodeErrorZ_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_ResponderDecodeErrorZ_clone(int64_t orig) { + LDKCResult_ResponderDecodeErrorZ* orig_conv = (LDKCResult_ResponderDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ResponderDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ResponderDecodeErrorZ), "LDKCResult_ResponderDecodeErrorZ"); + *ret_conv = CResult_ResponderDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_TxOutUtxoLookupErrorZ_ok(int64_t o) { +int64_t CS_LDK_COption_MessageContextZ_some(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); - LDKTxOut o_conv = *(LDKTxOut*)(o_ptr); - o_conv = TxOut_clone((LDKTxOut*)untag_ptr(o)); - LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); - *ret_conv = CResult_TxOutUtxoLookupErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_TxOutUtxoLookupErrorZ_err(int32_t e) { - LDKUtxoLookupError e_conv = LDKUtxoLookupError_from_cs(e); - LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); - *ret_conv = CResult_TxOutUtxoLookupErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); + LDKMessageContext o_conv = *(LDKMessageContext*)(o_ptr); + o_conv = MessageContext_clone((LDKMessageContext*)untag_ptr(o)); + LDKCOption_MessageContextZ *ret_copy = MALLOC(sizeof(LDKCOption_MessageContextZ), "LDKCOption_MessageContextZ"); + *ret_copy = COption_MessageContextZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_CResult_TxOutUtxoLookupErrorZ_is_ok(int64_t o) { - LDKCResult_TxOutUtxoLookupErrorZ* o_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_TxOutUtxoLookupErrorZ_is_ok(o_conv); - return ret_conv; +int64_t CS_LDK_COption_MessageContextZ_none() { + LDKCOption_MessageContextZ *ret_copy = MALLOC(sizeof(LDKCOption_MessageContextZ), "LDKCOption_MessageContextZ"); + *ret_copy = COption_MessageContextZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_CResult_TxOutUtxoLookupErrorZ_free(int64_t _res) { +void CS_LDK_COption_MessageContextZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_TxOutUtxoLookupErrorZ _res_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(_res_ptr); + LDKCOption_MessageContextZ _res_conv = *(LDKCOption_MessageContextZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_TxOutUtxoLookupErrorZ_free(_res_conv); + COption_MessageContextZ_free(_res_conv); } -static inline uint64_t CResult_TxOutUtxoLookupErrorZ_clone_ptr(LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR arg) { - LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); - *ret_conv = CResult_TxOutUtxoLookupErrorZ_clone(arg); - return tag_ptr(ret_conv, true); +static inline uint64_t COption_MessageContextZ_clone_ptr(LDKCOption_MessageContextZ *NONNULL_PTR arg) { + LDKCOption_MessageContextZ *ret_copy = MALLOC(sizeof(LDKCOption_MessageContextZ), "LDKCOption_MessageContextZ"); + *ret_copy = COption_MessageContextZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_CResult_TxOutUtxoLookupErrorZ_clone_ptr(int64_t arg) { - LDKCResult_TxOutUtxoLookupErrorZ* arg_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_TxOutUtxoLookupErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_COption_MessageContextZ_clone_ptr(int64_t arg) { + LDKCOption_MessageContextZ* arg_conv = (LDKCOption_MessageContextZ*)untag_ptr(arg); + int64_t ret_conv = COption_MessageContextZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_TxOutUtxoLookupErrorZ_clone(int64_t orig) { - LDKCResult_TxOutUtxoLookupErrorZ* orig_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(orig); - LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); - *ret_conv = CResult_TxOutUtxoLookupErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_COption_MessageContextZ_clone(int64_t orig) { + LDKCOption_MessageContextZ* orig_conv = (LDKCOption_MessageContextZ*)untag_ptr(orig); + LDKCOption_MessageContextZ *ret_copy = MALLOC(sizeof(LDKCOption_MessageContextZ), "LDKCOption_MessageContextZ"); + *ret_copy = COption_MessageContextZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } static inline uint64_t C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone_ptr(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *NONNULL_PTR arg) { @@ -34568,176 +36406,52 @@ int64_t CS_LDK_CResult_SendSuccessSendErrorZ_clone(int64_t orig) { 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); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = BlindedPath_clone(&o_conv); - LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); - *ret_conv = CResult_BlindedPathNoneZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_BlindedPathNoneZ_err() { - LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); - *ret_conv = CResult_BlindedPathNoneZ_err(); - return tag_ptr(ret_conv, true); -} - -jboolean CS_LDK_CResult_BlindedPathNoneZ_is_ok(int64_t o) { - LDKCResult_BlindedPathNoneZ* o_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_BlindedPathNoneZ_is_ok(o_conv); - return ret_conv; -} - -void CS_LDK_CResult_BlindedPathNoneZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_BlindedPathNoneZ _res_conv = *(LDKCResult_BlindedPathNoneZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_BlindedPathNoneZ_free(_res_conv); -} - -static inline uint64_t CResult_BlindedPathNoneZ_clone_ptr(LDKCResult_BlindedPathNoneZ *NONNULL_PTR arg) { - LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); - *ret_conv = CResult_BlindedPathNoneZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t CS_LDK_CResult_BlindedPathNoneZ_clone_ptr(int64_t arg) { - LDKCResult_BlindedPathNoneZ* arg_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_BlindedPathNoneZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_CResult_BlindedPathNoneZ_clone(int64_t orig) { - LDKCResult_BlindedPathNoneZ* orig_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(orig); - LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); - *ret_conv = CResult_BlindedPathNoneZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_ok(int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ o_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(o_ptr); - o_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(o)); - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ), "LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ"); - *ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_err() { - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ), "LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ"); - *ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_err(); +int64_t CS_LDK_CResult_NoneSendErrorZ_ok() { + LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ"); + *ret_conv = CResult_NoneSendErrorZ_ok(); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_is_ok(int64_t o) { - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* o_conv = (LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_is_ok(o_conv); - return ret_conv; -} - -void CS_LDK_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ _res_conv = *(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free(_res_conv); -} - -static inline uint64_t CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone_ptr(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR arg) { - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ), "LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ"); - *ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t CS_LDK_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone_ptr(int64_t arg) { - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* arg_conv = (LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(int64_t orig) { - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* orig_conv = (LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ*)untag_ptr(orig); - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ), "LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ"); - *ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -void CS_LDK_CVec_ForwardNodeZ_free(int64_tArray _res) { - LDKCVec_ForwardNodeZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKForwardNode), "LDKCVec_ForwardNodeZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = _res->elems; - for (size_t n = 0; n < _res_constr.datalen; n++) { - int64_t _res_conv_13 = _res_vals[n]; - LDKForwardNode _res_conv_13_conv; - _res_conv_13_conv.inner = untag_ptr(_res_conv_13); - _res_conv_13_conv.is_owned = ptr_is_owned(_res_conv_13); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_13_conv); - _res_constr.data[n] = _res_conv_13_conv; - } - FREE(_res); - CVec_ForwardNodeZ_free(_res_constr); -} - -int64_t CS_LDK_CResult_BlindedPathDecodeErrorZ_ok(int64_t o) { - LDKBlindedPath o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = BlindedPath_clone(&o_conv); - LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ"); - *ret_conv = CResult_BlindedPathDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_BlindedPathDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_NoneSendErrorZ_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_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ"); - *ret_conv = CResult_BlindedPathDecodeErrorZ_err(e_conv); + LDKSendError e_conv = *(LDKSendError*)(e_ptr); + e_conv = SendError_clone((LDKSendError*)untag_ptr(e)); + LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ"); + *ret_conv = CResult_NoneSendErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_BlindedPathDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_BlindedPathDecodeErrorZ* o_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_BlindedPathDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_NoneSendErrorZ_is_ok(int64_t o) { + LDKCResult_NoneSendErrorZ* o_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_NoneSendErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_BlindedPathDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_NoneSendErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_BlindedPathDecodeErrorZ _res_conv = *(LDKCResult_BlindedPathDecodeErrorZ*)(_res_ptr); + LDKCResult_NoneSendErrorZ _res_conv = *(LDKCResult_NoneSendErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_BlindedPathDecodeErrorZ_free(_res_conv); + CResult_NoneSendErrorZ_free(_res_conv); } -static inline uint64_t CResult_BlindedPathDecodeErrorZ_clone_ptr(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ"); - *ret_conv = CResult_BlindedPathDecodeErrorZ_clone(arg); +static inline uint64_t CResult_NoneSendErrorZ_clone_ptr(LDKCResult_NoneSendErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ"); + *ret_conv = CResult_NoneSendErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_BlindedPathDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_BlindedPathDecodeErrorZ* arg_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_BlindedPathDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_NoneSendErrorZ_clone_ptr(int64_t arg) { + LDKCResult_NoneSendErrorZ* arg_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_NoneSendErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_BlindedPathDecodeErrorZ_clone(int64_t orig) { - LDKCResult_BlindedPathDecodeErrorZ* orig_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(orig); - LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ"); - *ret_conv = CResult_BlindedPathDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_NoneSendErrorZ_clone(int64_t orig) { + LDKCResult_NoneSendErrorZ* orig_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(orig); + LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ"); + *ret_conv = CResult_NoneSendErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -34795,6 +36509,80 @@ int64_t CS_LDK_CResult_BlindedHopDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +void CS_LDK_CVec_PhantomRouteHintsZ_free(int64_tArray _res) { + LDKCVec_PhantomRouteHintsZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = _res->elems; + for (size_t t = 0; t < _res_constr.datalen; t++) { + int64_t _res_conv_19 = _res_vals[t]; + LDKPhantomRouteHints _res_conv_19_conv; + _res_conv_19_conv.inner = untag_ptr(_res_conv_19); + _res_conv_19_conv.is_owned = ptr_is_owned(_res_conv_19); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_19_conv); + _res_constr.data[t] = _res_conv_19_conv; + } + FREE(_res); + CVec_PhantomRouteHintsZ_free(_res_constr); +} + +int64_t CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(int64_t o) { + LDKBolt11Invoice o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = Bolt11Invoice_clone(&o_conv); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_err(int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKSignOrCreationError e_conv = *(LDKSignOrCreationError*)(e_ptr); + e_conv = SignOrCreationError_clone((LDKSignOrCreationError*)untag_ptr(e)); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(int64_t o) { + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* o_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ _res_conv = *(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_Bolt11InvoiceSignOrCreationErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_Bolt11InvoiceSignOrCreationErrorZ_clone_ptr(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_clone_ptr(int64_t arg) { + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* arg_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(int64_t orig) { + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* orig_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(orig); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + int64_t CS_LDK_CResult_InvoiceErrorDecodeErrorZ_ok(int64_t o) { LDKInvoiceError o_conv; o_conv.inner = untag_ptr(o); @@ -35524,99 +37312,284 @@ void CS_LDK_CVec_C2Tuple_OutPointChannelIdZZ_free(int64_tArray _res) { CVec_C2Tuple_OutPointChannelIdZZ_free(_res_constr); } -void CS_LDK_CVec_MonitorUpdateIdZ_free(int64_tArray _res) { - LDKCVec_MonitorUpdateIdZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMonitorUpdateId), "LDKCVec_MonitorUpdateIdZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = _res->elems; - for (size_t r = 0; r < _res_constr.datalen; r++) { - int64_t _res_conv_17 = _res_vals[r]; - LDKMonitorUpdateId _res_conv_17_conv; - _res_conv_17_conv.inner = untag_ptr(_res_conv_17); - _res_conv_17_conv.is_owned = ptr_is_owned(_res_conv_17); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_17_conv); - _res_constr.data[r] = _res_conv_17_conv; - } - FREE(_res); - CVec_MonitorUpdateIdZ_free(_res_constr); -} - -static inline uint64_t C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR arg) { - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ"); - *ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(arg); +static inline uint64_t C2Tuple_OutPointCVec_u64ZZ_clone_ptr(LDKC2Tuple_OutPointCVec_u64ZZ *NONNULL_PTR arg) { + LDKC2Tuple_OutPointCVec_u64ZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_u64ZZ), "LDKC2Tuple_OutPointCVec_u64ZZ"); + *ret_conv = C2Tuple_OutPointCVec_u64ZZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(int64_t arg) { - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* arg_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(arg); - int64_t ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(arg_conv); +int64_t CS_LDK_C2Tuple_OutPointCVec_u64ZZ_clone_ptr(int64_t arg) { + LDKC2Tuple_OutPointCVec_u64ZZ* arg_conv = (LDKC2Tuple_OutPointCVec_u64ZZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_OutPointCVec_u64ZZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(int64_t orig) { - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* orig_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(orig); - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ"); - *ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(orig_conv); +int64_t CS_LDK_C2Tuple_OutPointCVec_u64ZZ_clone(int64_t orig) { + LDKC2Tuple_OutPointCVec_u64ZZ* orig_conv = (LDKC2Tuple_OutPointCVec_u64ZZ*)untag_ptr(orig); + LDKC2Tuple_OutPointCVec_u64ZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_u64ZZ), "LDKC2Tuple_OutPointCVec_u64ZZ"); + *ret_conv = C2Tuple_OutPointCVec_u64ZZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(int64_t a, int64_tArray b) { +int64_t CS_LDK_C2Tuple_OutPointCVec_u64ZZ_new(int64_t a, int64_tArray b) { LDKOutPoint a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = OutPoint_clone(&a_conv); - LDKCVec_MonitorUpdateIdZ b_constr; + LDKCVec_u64Z b_constr; b_constr.datalen = b->arr_len; if (b_constr.datalen > 0) - b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKMonitorUpdateId), "LDKCVec_MonitorUpdateIdZ Elements"); + b_constr.data = MALLOC(b_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); else b_constr.data = NULL; int64_t* b_vals = b->elems; - for (size_t r = 0; r < b_constr.datalen; r++) { - int64_t b_conv_17 = b_vals[r]; - LDKMonitorUpdateId b_conv_17_conv; - b_conv_17_conv.inner = untag_ptr(b_conv_17); - b_conv_17_conv.is_owned = ptr_is_owned(b_conv_17); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv_17_conv); - b_conv_17_conv = MonitorUpdateId_clone(&b_conv_17_conv); - b_constr.data[r] = b_conv_17_conv; + for (size_t g = 0; g < b_constr.datalen; g++) { + int64_t b_conv_6 = b_vals[g]; + b_constr.data[g] = b_conv_6; } FREE(b); - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ"); - *ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(a_conv, b_constr); + LDKC2Tuple_OutPointCVec_u64ZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_u64ZZ), "LDKC2Tuple_OutPointCVec_u64ZZ"); + *ret_conv = C2Tuple_OutPointCVec_u64ZZ_new(a_conv, b_constr); return tag_ptr(ret_conv, true); } -void CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(int64_t _res) { +void CS_LDK_C2Tuple_OutPointCVec_u64ZZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res_conv = *(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)(_res_ptr); + LDKC2Tuple_OutPointCVec_u64ZZ _res_conv = *(LDKC2Tuple_OutPointCVec_u64ZZ*)(_res_ptr); FREE(untag_ptr(_res)); - C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(_res_conv); + C2Tuple_OutPointCVec_u64ZZ_free(_res_conv); } -void CS_LDK_CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(int64_tArray _res) { - LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ _res_constr; +void CS_LDK_CVec_C2Tuple_OutPointCVec_u64ZZZ_free(int64_tArray _res) { + LDKCVec_C2Tuple_OutPointCVec_u64ZZZ _res_constr; _res_constr.datalen = _res->arr_len; if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OutPointCVec_u64ZZ), "LDKCVec_C2Tuple_OutPointCVec_u64ZZZ Elements"); else _res_constr.data = NULL; int64_t* _res_vals = _res->elems; - for (size_t p = 0; p < _res_constr.datalen; p++) { - int64_t _res_conv_41 = _res_vals[p]; - void* _res_conv_41_ptr = untag_ptr(_res_conv_41); - CHECK_ACCESS(_res_conv_41_ptr); - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res_conv_41_conv = *(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)(_res_conv_41_ptr); - FREE(untag_ptr(_res_conv_41)); - _res_constr.data[p] = _res_conv_41_conv; + 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_OutPointCVec_u64ZZ _res_conv_29_conv = *(LDKC2Tuple_OutPointCVec_u64ZZ*)(_res_conv_29_ptr); + FREE(untag_ptr(_res_conv_29)); + _res_constr.data[d] = _res_conv_29_conv; } FREE(_res); - CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(_res_constr); + CVec_C2Tuple_OutPointCVec_u64ZZZ_free(_res_constr); +} + +int64_t CS_LDK_CResult_BlindedMessagePathDecodeErrorZ_ok(int64_t o) { + LDKBlindedMessagePath o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = BlindedMessagePath_clone(&o_conv); + LDKCResult_BlindedMessagePathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathDecodeErrorZ), "LDKCResult_BlindedMessagePathDecodeErrorZ"); + *ret_conv = CResult_BlindedMessagePathDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_BlindedMessagePathDecodeErrorZ_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_BlindedMessagePathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathDecodeErrorZ), "LDKCResult_BlindedMessagePathDecodeErrorZ"); + *ret_conv = CResult_BlindedMessagePathDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_BlindedMessagePathDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_BlindedMessagePathDecodeErrorZ* o_conv = (LDKCResult_BlindedMessagePathDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_BlindedMessagePathDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_BlindedMessagePathDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_BlindedMessagePathDecodeErrorZ _res_conv = *(LDKCResult_BlindedMessagePathDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_BlindedMessagePathDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_BlindedMessagePathDecodeErrorZ_clone_ptr(LDKCResult_BlindedMessagePathDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_BlindedMessagePathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathDecodeErrorZ), "LDKCResult_BlindedMessagePathDecodeErrorZ"); + *ret_conv = CResult_BlindedMessagePathDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_BlindedMessagePathDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_BlindedMessagePathDecodeErrorZ* arg_conv = (LDKCResult_BlindedMessagePathDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BlindedMessagePathDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_BlindedMessagePathDecodeErrorZ_clone(int64_t orig) { + LDKCResult_BlindedMessagePathDecodeErrorZ* orig_conv = (LDKCResult_BlindedMessagePathDecodeErrorZ*)untag_ptr(orig); + LDKCResult_BlindedMessagePathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathDecodeErrorZ), "LDKCResult_BlindedMessagePathDecodeErrorZ"); + *ret_conv = CResult_BlindedMessagePathDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_BlindedMessagePathNoneZ_ok(int64_t o) { + LDKBlindedMessagePath o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = BlindedMessagePath_clone(&o_conv); + LDKCResult_BlindedMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathNoneZ), "LDKCResult_BlindedMessagePathNoneZ"); + *ret_conv = CResult_BlindedMessagePathNoneZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_BlindedMessagePathNoneZ_err() { + LDKCResult_BlindedMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathNoneZ), "LDKCResult_BlindedMessagePathNoneZ"); + *ret_conv = CResult_BlindedMessagePathNoneZ_err(); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_BlindedMessagePathNoneZ_is_ok(int64_t o) { + LDKCResult_BlindedMessagePathNoneZ* o_conv = (LDKCResult_BlindedMessagePathNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_BlindedMessagePathNoneZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_BlindedMessagePathNoneZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_BlindedMessagePathNoneZ _res_conv = *(LDKCResult_BlindedMessagePathNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_BlindedMessagePathNoneZ_free(_res_conv); +} + +static inline uint64_t CResult_BlindedMessagePathNoneZ_clone_ptr(LDKCResult_BlindedMessagePathNoneZ *NONNULL_PTR arg) { + LDKCResult_BlindedMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathNoneZ), "LDKCResult_BlindedMessagePathNoneZ"); + *ret_conv = CResult_BlindedMessagePathNoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_BlindedMessagePathNoneZ_clone_ptr(int64_t arg) { + LDKCResult_BlindedMessagePathNoneZ* arg_conv = (LDKCResult_BlindedMessagePathNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BlindedMessagePathNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_BlindedMessagePathNoneZ_clone(int64_t orig) { + LDKCResult_BlindedMessagePathNoneZ* orig_conv = (LDKCResult_BlindedMessagePathNoneZ*)untag_ptr(orig); + LDKCResult_BlindedMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathNoneZ), "LDKCResult_BlindedMessagePathNoneZ"); + *ret_conv = CResult_BlindedMessagePathNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_MessageContextDecodeErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKMessageContext o_conv = *(LDKMessageContext*)(o_ptr); + o_conv = MessageContext_clone((LDKMessageContext*)untag_ptr(o)); + LDKCResult_MessageContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_MessageContextDecodeErrorZ), "LDKCResult_MessageContextDecodeErrorZ"); + *ret_conv = CResult_MessageContextDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_MessageContextDecodeErrorZ_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_MessageContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_MessageContextDecodeErrorZ), "LDKCResult_MessageContextDecodeErrorZ"); + *ret_conv = CResult_MessageContextDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_MessageContextDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_MessageContextDecodeErrorZ* o_conv = (LDKCResult_MessageContextDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_MessageContextDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_MessageContextDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_MessageContextDecodeErrorZ _res_conv = *(LDKCResult_MessageContextDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_MessageContextDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_MessageContextDecodeErrorZ_clone_ptr(LDKCResult_MessageContextDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_MessageContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_MessageContextDecodeErrorZ), "LDKCResult_MessageContextDecodeErrorZ"); + *ret_conv = CResult_MessageContextDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_MessageContextDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_MessageContextDecodeErrorZ* arg_conv = (LDKCResult_MessageContextDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_MessageContextDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_MessageContextDecodeErrorZ_clone(int64_t orig) { + LDKCResult_MessageContextDecodeErrorZ* orig_conv = (LDKCResult_MessageContextDecodeErrorZ*)untag_ptr(orig); + LDKCResult_MessageContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_MessageContextDecodeErrorZ), "LDKCResult_MessageContextDecodeErrorZ"); + *ret_conv = CResult_MessageContextDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_OffersContextDecodeErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKOffersContext o_conv = *(LDKOffersContext*)(o_ptr); + o_conv = OffersContext_clone((LDKOffersContext*)untag_ptr(o)); + LDKCResult_OffersContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersContextDecodeErrorZ), "LDKCResult_OffersContextDecodeErrorZ"); + *ret_conv = CResult_OffersContextDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_OffersContextDecodeErrorZ_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_OffersContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersContextDecodeErrorZ), "LDKCResult_OffersContextDecodeErrorZ"); + *ret_conv = CResult_OffersContextDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_OffersContextDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_OffersContextDecodeErrorZ* o_conv = (LDKCResult_OffersContextDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OffersContextDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_OffersContextDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_OffersContextDecodeErrorZ _res_conv = *(LDKCResult_OffersContextDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_OffersContextDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_OffersContextDecodeErrorZ_clone_ptr(LDKCResult_OffersContextDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OffersContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersContextDecodeErrorZ), "LDKCResult_OffersContextDecodeErrorZ"); + *ret_conv = CResult_OffersContextDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_OffersContextDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_OffersContextDecodeErrorZ* arg_conv = (LDKCResult_OffersContextDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OffersContextDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_OffersContextDecodeErrorZ_clone(int64_t orig) { + LDKCResult_OffersContextDecodeErrorZ* orig_conv = (LDKCResult_OffersContextDecodeErrorZ*)untag_ptr(orig); + LDKCResult_OffersContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersContextDecodeErrorZ), "LDKCResult_OffersContextDecodeErrorZ"); + *ret_conv = CResult_OffersContextDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } void CS_LDK_APIError_free(int64_t this_ptr) { @@ -35838,6 +37811,29 @@ int64_t CS_LDK_BigSize_read(int8_tArray ser) { return tag_ptr(ret_conv, true); } +int8_tArray CS_LDK_UntrustedString_write(int64_t obj) { + LDKUntrustedString obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = UntrustedString_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_UntrustedString_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ"); + *ret_conv = UntrustedString_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + void CS_LDK_Hostname_free(int64_t this_obj) { LDKHostname this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -36069,7 +38065,7 @@ int64_t CS_LDK_TransactionU16LenLimited_read(int8_tArray ser) { return tag_ptr(ret_conv, true); } -int64_t CS_LDK_sign(int8_tArray msg, int8_tArray sk) { +jstring CS_LDK_sign(int8_tArray msg, int8_tArray sk) { LDKu8slice msg_ref; msg_ref.datalen = msg->arr_len; msg_ref.data = msg->elems; @@ -36077,10 +38073,11 @@ int64_t CS_LDK_sign(int8_tArray msg, int8_tArray sk) { CHECK(sk->arr_len == 32); memcpy(sk_arr, sk->elems, 32); FREE(sk); uint8_t (*sk_ref)[32] = &sk_arr; - LDKCResult_StrSecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StrSecp256k1ErrorZ), "LDKCResult_StrSecp256k1ErrorZ"); - *ret_conv = sign(msg_ref, sk_ref); + LDKStr ret_str = sign(msg_ref, sk_ref); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); FREE(msg); - return tag_ptr(ret_conv, true); + return ret_conv; } int64_t CS_LDK_recover_pk(int8_tArray msg, jstring sig) { @@ -36107,31 +38104,6 @@ jboolean CS_LDK_verify(int8_tArray msg, jstring sig, int8_tArray pk) { return ret_conv; } -int8_tArray CS_LDK_construct_invoice_preimage(int8_tArray hrp_bytes, ptrArray data_without_signature) { - LDKu8slice hrp_bytes_ref; - hrp_bytes_ref.datalen = hrp_bytes->arr_len; - hrp_bytes_ref.data = hrp_bytes->elems; - LDKCVec_U5Z data_without_signature_constr; - data_without_signature_constr.datalen = data_without_signature->arr_len; - if (data_without_signature_constr.datalen > 0) - data_without_signature_constr.data = MALLOC(data_without_signature_constr.datalen * sizeof(LDKU5), "LDKCVec_U5Z Elements"); - else - data_without_signature_constr.data = NULL; - int8_t* data_without_signature_vals = (void*) data_without_signature->elems; - for (size_t h = 0; h < data_without_signature_constr.datalen; h++) { - int8_t data_without_signature_conv_7 = data_without_signature_vals[h]; - - data_without_signature_constr.data[h] = (LDKU5){ ._0 = data_without_signature_conv_7 }; - } - FREE(data_without_signature); - LDKCVec_u8Z ret_var = construct_invoice_preimage(hrp_bytes_ref, data_without_signature_constr); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - FREE(hrp_bytes); - return ret_arr; -} - void CS_LDK_KVStore_free(int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -36185,7 +38157,7 @@ void CS_LDK_MonitorUpdatingPersister_free(int64_t this_obj) { MonitorUpdatingPersister_free(this_obj_conv); } -int64_t CS_LDK_MonitorUpdatingPersister_new(int64_t kv_store, int64_t logger, int64_t maximum_pending_updates, int64_t entropy_source, int64_t signer_provider) { +int64_t CS_LDK_MonitorUpdatingPersister_new(int64_t kv_store, int64_t logger, int64_t maximum_pending_updates, int64_t entropy_source, int64_t signer_provider, int64_t broadcaster, int64_t fee_estimator) { void* kv_store_ptr = untag_ptr(kv_store); CHECK_ACCESS(kv_store_ptr); LDKKVStore kv_store_conv = *(LDKKVStore*)(kv_store_ptr); @@ -36214,45 +38186,47 @@ int64_t CS_LDK_MonitorUpdatingPersister_new(int64_t kv_store, int64_t logger, i // If this_arg is a JCalls struct, then we need to increment the refcnt in it. LDKSignerProvider_JCalls_cloned(&signer_provider_conv); } - LDKMonitorUpdatingPersister ret_var = MonitorUpdatingPersister_new(kv_store_conv, logger_conv, maximum_pending_updates, entropy_source_conv, signer_provider_conv); + 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); + } + LDKMonitorUpdatingPersister ret_var = MonitorUpdatingPersister_new(kv_store_conv, logger_conv, maximum_pending_updates, entropy_source_conv, signer_provider_conv, broadcaster_conv, fee_estimator_conv); int64_t ret_ref = 0; 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_MonitorUpdatingPersister_read_all_channel_monitors_with_updates(int64_t this_arg, int64_t broadcaster, int64_t fee_estimator) { +int64_t CS_LDK_MonitorUpdatingPersister_read_all_channel_monitors_with_updates(int64_t this_arg) { LDKMonitorUpdatingPersister this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - void* broadcaster_ptr = untag_ptr(broadcaster); - if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); } - LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; - void* fee_estimator_ptr = untag_ptr(fee_estimator); - if (ptr_is_owned(fee_estimator)) { CHECK_ACCESS(fee_estimator_ptr); } - LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ), "LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ"); - *ret_conv = MonitorUpdatingPersister_read_all_channel_monitors_with_updates(&this_arg_conv, broadcaster_conv, fee_estimator_conv); + *ret_conv = MonitorUpdatingPersister_read_all_channel_monitors_with_updates(&this_arg_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_MonitorUpdatingPersister_read_channel_monitor_with_updates(int64_t this_arg, int64_t broadcaster, int64_t fee_estimator, jstring monitor_key) { +int64_t CS_LDK_MonitorUpdatingPersister_read_channel_monitor_with_updates(int64_t this_arg, jstring monitor_key) { LDKMonitorUpdatingPersister this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - void* broadcaster_ptr = untag_ptr(broadcaster); - if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); } - LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; - void* fee_estimator_ptr = untag_ptr(fee_estimator); - if (ptr_is_owned(fee_estimator)) { CHECK_ACCESS(fee_estimator_ptr); } - LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; LDKStr monitor_key_conv = str_ref_to_owned_c(monitor_key); LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ), "LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ"); - *ret_conv = MonitorUpdatingPersister_read_channel_monitor_with_updates(&this_arg_conv, broadcaster_conv, fee_estimator_conv, monitor_key_conv); + *ret_conv = MonitorUpdatingPersister_read_channel_monitor_with_updates(&this_arg_conv, monitor_key_conv); return tag_ptr(ret_conv, true); } @@ -36327,186 +38301,6 @@ int64_t CS_LDK_scid_from_parts(int64_t block, int64_t tx_index, int64_t vout_in 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); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - UntrustedString_free(this_obj_conv); -} - -jstring CS_LDK_UntrustedString_get_a(int64_t this_ptr) { - LDKUntrustedString this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKStr ret_str = UntrustedString_get_a(&this_ptr_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; -} - -void CS_LDK_UntrustedString_set_a(int64_t this_ptr, jstring val) { - LDKUntrustedString this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKStr val_conv = str_ref_to_owned_c(val); - UntrustedString_set_a(&this_ptr_conv, val_conv); -} - -int64_t CS_LDK_UntrustedString_new(jstring a_arg) { - LDKStr a_arg_conv = str_ref_to_owned_c(a_arg); - LDKUntrustedString ret_var = UntrustedString_new(a_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 UntrustedString_clone_ptr(LDKUntrustedString *NONNULL_PTR arg) { - LDKUntrustedString ret_var = UntrustedString_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_UntrustedString_clone_ptr(int64_t arg) { - LDKUntrustedString arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = UntrustedString_clone_ptr(&arg_conv); - return ret_conv; -} - -int64_t CS_LDK_UntrustedString_clone(int64_t orig) { - LDKUntrustedString orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKUntrustedString ret_var = UntrustedString_clone(&orig_conv); - int64_t ret_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_UntrustedString_eq(int64_t a, int64_t b) { - LDKUntrustedString a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKUntrustedString b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = UntrustedString_eq(&a_conv, &b_conv); - return ret_conv; -} - -int64_t CS_LDK_UntrustedString_hash(int64_t o) { - LDKUntrustedString o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = UntrustedString_hash(&o_conv); - return ret_conv; -} - -int8_tArray CS_LDK_UntrustedString_write(int64_t obj) { - LDKUntrustedString obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = UntrustedString_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -int64_t CS_LDK_UntrustedString_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ"); - *ret_conv = UntrustedString_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -jstring CS_LDK_UntrustedString_to_str(int64_t o) { - LDKUntrustedString o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = UntrustedString_to_str(&o_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; -} - -void CS_LDK_PrintableString_free(int64_t this_obj) { - LDKPrintableString this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PrintableString_free(this_obj_conv); -} - -jstring CS_LDK_PrintableString_get_a(int64_t this_ptr) { - LDKPrintableString this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKStr ret_str = PrintableString_get_a(&this_ptr_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; -} - -void CS_LDK_PrintableString_set_a(int64_t this_ptr, jstring val) { - LDKPrintableString this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKStr val_conv = str_ref_to_owned_c(val); - PrintableString_set_a(&this_ptr_conv, val_conv); -} - -int64_t CS_LDK_PrintableString_new(jstring a_arg) { - LDKStr a_arg_conv = str_ref_to_owned_c(a_arg); - LDKPrintableString ret_var = PrintableString_new(a_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; -} - -jstring CS_LDK_PrintableString_to_str(int64_t o) { - LDKPrintableString o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = PrintableString_to_str(&o_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; -} - void CS_LDK_TrackedSpendableOutput_free(int64_t this_obj) { LDKTrackedSpendableOutput this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -37222,6 +39016,29 @@ int64_t CS_LDK_Sleeper_from_two_futures(int64_t fut_a, int64_t fut_b) { return ret_ref; } +int64_t CS_LDK_Sleeper_from_three_futures(int64_t fut_a, int64_t fut_b, int64_t fut_c) { + LDKFuture fut_a_conv; + 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.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.is_owned = false; + LDKFuture fut_c_conv; + fut_c_conv.inner = untag_ptr(fut_c); + fut_c_conv.is_owned = ptr_is_owned(fut_c); + CHECK_INNER_FIELD_ACCESS_OR_NULL(fut_c_conv); + fut_c_conv.is_owned = false; + LDKSleeper ret_var = Sleeper_from_three_futures(&fut_a_conv, &fut_b_conv, &fut_c_conv); + int64_t ret_ref = 0; + 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_Sleeper_new(int64_tArray futures) { LDKCVec_FutureZ futures_constr; futures_constr.datalen = futures->arr_len; @@ -37492,7 +39309,32 @@ void CS_LDK_Record_set_line(int64_t this_ptr, int32_t val) { Record_set_line(&this_ptr_conv, val); } -int64_t CS_LDK_Record_new(int32_t level_arg, int8_tArray peer_id_arg, int64_t channel_id_arg, jstring args_arg, jstring module_path_arg, jstring file_arg, int32_t line_arg) { +int64_t CS_LDK_Record_get_payment_hash(int64_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); + *ret_copy = Record_get_payment_hash(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_Record_set_payment_hash(int64_t this_ptr, int64_t val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_ThirtyTwoBytesZ val_conv = *(LDKCOption_ThirtyTwoBytesZ*)(val_ptr); + val_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(val)); + Record_set_payment_hash(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_Record_new(int32_t level_arg, int8_tArray peer_id_arg, int64_t channel_id_arg, jstring args_arg, jstring module_path_arg, jstring file_arg, int32_t line_arg, int64_t payment_hash_arg) { LDKLevel level_arg_conv = LDKLevel_from_cs(level_arg); LDKPublicKey peer_id_arg_ref; CHECK(peer_id_arg->arr_len == 33); @@ -37505,7 +39347,11 @@ int64_t CS_LDK_Record_new(int32_t level_arg, int8_tArray peer_id_arg, int64_t c LDKStr args_arg_conv = str_ref_to_owned_c(args_arg); LDKStr module_path_arg_conv = str_ref_to_owned_c(module_path_arg); LDKStr file_arg_conv = str_ref_to_owned_c(file_arg); - LDKRecord ret_var = Record_new(level_arg_conv, peer_id_arg_ref, channel_id_arg_conv, args_arg_conv, module_path_arg_conv, file_arg_conv, line_arg); + void* payment_hash_arg_ptr = untag_ptr(payment_hash_arg); + CHECK_ACCESS(payment_hash_arg_ptr); + LDKCOption_ThirtyTwoBytesZ payment_hash_arg_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_arg_ptr); + payment_hash_arg_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash_arg)); + LDKRecord ret_var = Record_new(level_arg_conv, peer_id_arg_ref, channel_id_arg_conv, args_arg_conv, module_path_arg_conv, file_arg_conv, line_arg, payment_hash_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); @@ -37654,23 +39500,23 @@ void CS_LDK_ChannelHandshakeConfig_set_negotiate_scid_privacy(int64_t this_ptr, ChannelHandshakeConfig_set_negotiate_scid_privacy(&this_ptr_conv, val); } -jboolean CS_LDK_ChannelHandshakeConfig_get_announced_channel(int64_t this_ptr) { +jboolean CS_LDK_ChannelHandshakeConfig_get_announce_for_forwarding(int64_t this_ptr) { LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - jboolean ret_conv = ChannelHandshakeConfig_get_announced_channel(&this_ptr_conv); + jboolean ret_conv = ChannelHandshakeConfig_get_announce_for_forwarding(&this_ptr_conv); return ret_conv; } -void CS_LDK_ChannelHandshakeConfig_set_announced_channel(int64_t this_ptr, jboolean val) { +void CS_LDK_ChannelHandshakeConfig_set_announce_for_forwarding(int64_t this_ptr, jboolean val) { LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelHandshakeConfig_set_announced_channel(&this_ptr_conv, val); + ChannelHandshakeConfig_set_announce_for_forwarding(&this_ptr_conv, val); } jboolean CS_LDK_ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(int64_t this_ptr) { @@ -37749,8 +39595,8 @@ void CS_LDK_ChannelHandshakeConfig_set_our_max_accepted_htlcs(int64_t this_ptr, ChannelHandshakeConfig_set_our_max_accepted_htlcs(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelHandshakeConfig_new(int32_t minimum_depth_arg, int16_t our_to_self_delay_arg, int64_t our_htlc_minimum_msat_arg, int8_t max_inbound_htlc_value_in_flight_percent_of_channel_arg, jboolean negotiate_scid_privacy_arg, jboolean announced_channel_arg, jboolean commit_upfront_shutdown_pubkey_arg, int32_t their_channel_reserve_proportional_millionths_arg, jboolean negotiate_anchors_zero_fee_htlc_tx_arg, int16_t our_max_accepted_htlcs_arg) { - LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg, max_inbound_htlc_value_in_flight_percent_of_channel_arg, negotiate_scid_privacy_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg, their_channel_reserve_proportional_millionths_arg, negotiate_anchors_zero_fee_htlc_tx_arg, our_max_accepted_htlcs_arg); +int64_t CS_LDK_ChannelHandshakeConfig_new(int32_t minimum_depth_arg, int16_t our_to_self_delay_arg, int64_t our_htlc_minimum_msat_arg, int8_t max_inbound_htlc_value_in_flight_percent_of_channel_arg, jboolean negotiate_scid_privacy_arg, jboolean announce_for_forwarding_arg, jboolean commit_upfront_shutdown_pubkey_arg, int32_t their_channel_reserve_proportional_millionths_arg, jboolean negotiate_anchors_zero_fee_htlc_tx_arg, int16_t our_max_accepted_htlcs_arg) { + LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg, max_inbound_htlc_value_in_flight_percent_of_channel_arg, negotiate_scid_privacy_arg, announce_for_forwarding_arg, commit_upfront_shutdown_pubkey_arg, their_channel_reserve_proportional_millionths_arg, negotiate_anchors_zero_fee_htlc_tx_arg, our_max_accepted_htlcs_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); @@ -38499,14 +40345,6 @@ int64_t CS_LDK_ChannelConfigUpdate_new(int64_t forwarding_fee_proportional_mill return ret_ref; } -int64_t CS_LDK_ChannelConfigUpdate_default() { - LDKChannelConfigUpdate ret_var = ChannelConfigUpdate_default(); - int64_t ret_ref = 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_UserConfig_free(int64_t this_obj) { LDKUserConfig this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -38691,7 +40529,26 @@ void CS_LDK_UserConfig_set_accept_mpp_keysend(int64_t this_ptr, jboolean val) { UserConfig_set_accept_mpp_keysend(&this_ptr_conv, val); } -int64_t CS_LDK_UserConfig_new(int64_t channel_handshake_config_arg, int64_t channel_handshake_limits_arg, int64_t channel_config_arg, jboolean accept_forwards_to_priv_channels_arg, jboolean accept_inbound_channels_arg, jboolean manually_accept_inbound_channels_arg, jboolean accept_intercept_htlcs_arg, jboolean accept_mpp_keysend_arg) { +jboolean CS_LDK_UserConfig_get_manually_handle_bolt12_invoices(int64_t this_ptr) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + jboolean ret_conv = UserConfig_get_manually_handle_bolt12_invoices(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_UserConfig_set_manually_handle_bolt12_invoices(int64_t this_ptr, jboolean val) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + UserConfig_set_manually_handle_bolt12_invoices(&this_ptr_conv, val); +} + +int64_t CS_LDK_UserConfig_new(int64_t channel_handshake_config_arg, int64_t channel_handshake_limits_arg, int64_t channel_config_arg, jboolean accept_forwards_to_priv_channels_arg, jboolean accept_inbound_channels_arg, jboolean manually_accept_inbound_channels_arg, jboolean accept_intercept_htlcs_arg, jboolean accept_mpp_keysend_arg, jboolean manually_handle_bolt12_invoices_arg) { LDKChannelHandshakeConfig channel_handshake_config_arg_conv; channel_handshake_config_arg_conv.inner = untag_ptr(channel_handshake_config_arg); channel_handshake_config_arg_conv.is_owned = ptr_is_owned(channel_handshake_config_arg); @@ -38707,7 +40564,7 @@ int64_t CS_LDK_UserConfig_new(int64_t channel_handshake_config_arg, int64_t cha channel_config_arg_conv.is_owned = ptr_is_owned(channel_config_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_config_arg_conv); channel_config_arg_conv = ChannelConfig_clone(&channel_config_arg_conv); - LDKUserConfig ret_var = UserConfig_new(channel_handshake_config_arg_conv, channel_handshake_limits_arg_conv, channel_config_arg_conv, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg, manually_accept_inbound_channels_arg, accept_intercept_htlcs_arg, accept_mpp_keysend_arg); + LDKUserConfig ret_var = UserConfig_new(channel_handshake_config_arg_conv, channel_handshake_limits_arg_conv, channel_config_arg_conv, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg, manually_accept_inbound_channels_arg, accept_intercept_htlcs_arg, accept_mpp_keysend_arg, manually_handle_bolt12_invoices_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); @@ -39141,8 +40998,13 @@ int32_t CS_LDK_ConfirmationTarget_clone(int64_t orig) { return ret_conv; } -int32_t CS_LDK_ConfirmationTarget_on_chain_sweep() { - int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_on_chain_sweep()); +int32_t CS_LDK_ConfirmationTarget_maximum_fee_estimate() { + int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_maximum_fee_estimate()); + return ret_conv; +} + +int32_t CS_LDK_ConfirmationTarget_urgent_on_chain_sweep() { + int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_urgent_on_chain_sweep()); return ret_conv; } @@ -39198,69 +41060,6 @@ void CS_LDK_FeeEstimator_free(int64_t this_ptr) { FeeEstimator_free(this_ptr_conv); } -void CS_LDK_MonitorUpdateId_free(int64_t this_obj) { - LDKMonitorUpdateId this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - MonitorUpdateId_free(this_obj_conv); -} - -static inline uint64_t MonitorUpdateId_clone_ptr(LDKMonitorUpdateId *NONNULL_PTR arg) { - LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(arg); - int64_t ret_ref = 0; - 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_MonitorUpdateId_clone_ptr(int64_t arg) { - LDKMonitorUpdateId arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = MonitorUpdateId_clone_ptr(&arg_conv); - return ret_conv; -} - -int64_t CS_LDK_MonitorUpdateId_clone(int64_t orig) { - LDKMonitorUpdateId orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(&orig_conv); - int64_t ret_ref = 0; - 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_MonitorUpdateId_hash(int64_t o) { - LDKMonitorUpdateId o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = MonitorUpdateId_hash(&o_conv); - return ret_conv; -} - -jboolean CS_LDK_MonitorUpdateId_eq(int64_t a, int64_t b) { - LDKMonitorUpdateId a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKMonitorUpdateId b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = MonitorUpdateId_eq(&a_conv, &b_conv); - return ret_conv; -} - void CS_LDK_Persist_free(int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -39413,14 +41212,14 @@ int64_tArray CS_LDK_ChainMonitor_list_pending_monitor_updates(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_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ret_var = ChainMonitor_list_pending_monitor_updates(&this_arg_conv); + LDKCVec_C2Tuple_OutPointCVec_u64ZZZ ret_var = ChainMonitor_list_pending_monitor_updates(&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 p = 0; p < ret_var.datalen; p++) { - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv_41_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ"); - *ret_conv_41_conv = ret_var.data[p]; - ret_arr_ptr[p] = tag_ptr(ret_conv_41_conv, true); + for (size_t d = 0; d < ret_var.datalen; d++) { + LDKC2Tuple_OutPointCVec_u64ZZ* ret_conv_29_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_u64ZZ), "LDKC2Tuple_OutPointCVec_u64ZZ"); + *ret_conv_29_conv = ret_var.data[d]; + ret_arr_ptr[d] = tag_ptr(ret_conv_29_conv, true); } FREE(ret_var.data); @@ -39438,13 +41237,8 @@ int64_t CS_LDK_ChainMonitor_channel_monitor_updated(int64_t this_arg, int64_t f funding_txo_conv.is_owned = ptr_is_owned(funding_txo); CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); funding_txo_conv = OutPoint_clone(&funding_txo_conv); - LDKMonitorUpdateId completed_update_id_conv; - completed_update_id_conv.inner = untag_ptr(completed_update_id); - completed_update_id_conv.is_owned = ptr_is_owned(completed_update_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(completed_update_id_conv); - completed_update_id_conv = MonitorUpdateId_clone(&completed_update_id_conv); LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id_conv); + *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id); return tag_ptr(ret_conv, true); } @@ -39852,6 +41646,39 @@ int64_t CS_LDK_HTLCUpdate_read(int8_tArray ser) { return tag_ptr(ret_conv, true); } +int32_t CS_LDK_BalanceSource_clone(int64_t orig) { + LDKBalanceSource* orig_conv = (LDKBalanceSource*)untag_ptr(orig); + int32_t ret_conv = LDKBalanceSource_to_cs(BalanceSource_clone(orig_conv)); + return ret_conv; +} + +int32_t CS_LDK_BalanceSource_holder_force_closed() { + int32_t ret_conv = LDKBalanceSource_to_cs(BalanceSource_holder_force_closed()); + return ret_conv; +} + +int32_t CS_LDK_BalanceSource_counterparty_force_closed() { + int32_t ret_conv = LDKBalanceSource_to_cs(BalanceSource_counterparty_force_closed()); + return ret_conv; +} + +int32_t CS_LDK_BalanceSource_coop_close() { + int32_t ret_conv = LDKBalanceSource_to_cs(BalanceSource_coop_close()); + return ret_conv; +} + +int32_t CS_LDK_BalanceSource_htlc() { + int32_t ret_conv = LDKBalanceSource_to_cs(BalanceSource_htlc()); + return ret_conv; +} + +jboolean CS_LDK_BalanceSource_eq(int64_t a, int64_t b) { + LDKBalanceSource* a_conv = (LDKBalanceSource*)untag_ptr(a); + LDKBalanceSource* b_conv = (LDKBalanceSource*)untag_ptr(b); + jboolean ret_conv = BalanceSource_eq(a_conv, b_conv); + return ret_conv; +} + void CS_LDK_Balance_free(int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -39881,16 +41708,17 @@ int64_t CS_LDK_Balance_clone(int64_t orig) { return ret_ref; } -int64_t CS_LDK_Balance_claimable_on_channel_close(int64_t amount_satoshis) { +int64_t CS_LDK_Balance_claimable_on_channel_close(int64_t amount_satoshis, int64_t transaction_fee_satoshis, int64_t outbound_payment_htlc_rounded_msat, int64_t outbound_forwarded_htlc_rounded_msat, int64_t inbound_claiming_htlc_rounded_msat, int64_t inbound_htlc_rounded_msat) { LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_claimable_on_channel_close(amount_satoshis); + *ret_copy = Balance_claimable_on_channel_close(amount_satoshis, transaction_fee_satoshis, outbound_payment_htlc_rounded_msat, outbound_forwarded_htlc_rounded_msat, inbound_claiming_htlc_rounded_msat, inbound_htlc_rounded_msat); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Balance_claimable_awaiting_confirmations(int64_t amount_satoshis, int32_t confirmation_height) { +int64_t CS_LDK_Balance_claimable_awaiting_confirmations(int64_t amount_satoshis, int32_t confirmation_height, int32_t source) { + LDKBalanceSource source_conv = LDKBalanceSource_from_cs(source); LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_claimable_awaiting_confirmations(amount_satoshis, confirmation_height); + *ret_copy = Balance_claimable_awaiting_confirmations(amount_satoshis, confirmation_height, source_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -39908,12 +41736,12 @@ int64_t CS_LDK_Balance_contentious_claimable(int64_t amount_satoshis, int32_t t return ret_ref; } -int64_t CS_LDK_Balance_maybe_timeout_claimable_htlc(int64_t amount_satoshis, int32_t claimable_height, int8_tArray payment_hash) { +int64_t CS_LDK_Balance_maybe_timeout_claimable_htlc(int64_t amount_satoshis, int32_t claimable_height, int8_tArray payment_hash, jboolean outbound_payment) { LDKThirtyTwoBytes payment_hash_ref; CHECK(payment_hash->arr_len == 32); memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_maybe_timeout_claimable_htlc(amount_satoshis, claimable_height, payment_hash_ref); + *ret_copy = Balance_maybe_timeout_claimable_htlc(amount_satoshis, claimable_height, payment_hash_ref, outbound_payment); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -40114,7 +41942,7 @@ int64_tArray CS_LDK_ChannelMonitor_get_and_clear_pending_monitor_events(int64_t return ret_arr; } -void CS_LDK_ChannelMonitor_process_pending_events(int64_t this_arg, int64_t handler) { +int64_t CS_LDK_ChannelMonitor_process_pending_events(int64_t this_arg, int64_t handler) { LDKChannelMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -40123,7 +41951,9 @@ void CS_LDK_ChannelMonitor_process_pending_events(int64_t this_arg, int64_t han void* handler_ptr = untag_ptr(handler); if (ptr_is_owned(handler)) { CHECK_ACCESS(handler_ptr); } LDKEventHandler* handler_conv = (LDKEventHandler*)handler_ptr; - ChannelMonitor_process_pending_events(&this_arg_conv, handler_conv); + LDKCResult_NoneReplayEventZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneReplayEventZ), "LDKCResult_NoneReplayEventZ"); + *ret_conv = ChannelMonitor_process_pending_events(&this_arg_conv, handler_conv); + return tag_ptr(ret_conv, true); } int64_t CS_LDK_ChannelMonitor_initial_counterparty_commitment_tx(int64_t this_arg) { @@ -40485,6 +42315,16 @@ 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); } +jboolean CS_LDK_ChannelMonitor_has_pending_claims(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; + jboolean ret_conv = ChannelMonitor_has_pending_claims(&this_arg_conv); + return ret_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); @@ -40888,11 +42728,19 @@ int64_t CS_LDK_peel_payment_onion(int64_t msg, int64_t node_signer, int64_t log CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv.is_owned = false; void* node_signer_ptr = untag_ptr(node_signer); - if (ptr_is_owned(node_signer)) { CHECK_ACCESS(node_signer_ptr); } - LDKNodeSigner* node_signer_conv = (LDKNodeSigner*)node_signer_ptr; + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } void* logger_ptr = untag_ptr(logger); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + 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); + } LDKCResult_PendingHTLCInfoInboundHTLCErrZ* ret_conv = MALLOC(sizeof(LDKCResult_PendingHTLCInfoInboundHTLCErrZ), "LDKCResult_PendingHTLCInfoInboundHTLCErrZ"); *ret_conv = peel_payment_onion(&msg_conv, node_signer_conv, logger_conv, cur_height, accept_mpp_keysend, allow_skimmed_fees); return tag_ptr(ret_conv, true); @@ -41069,12 +42917,38 @@ void CS_LDK_BlindedForward_set_failure(int64_t this_ptr, int32_t val) { BlindedForward_set_failure(&this_ptr_conv, val_conv); } -int64_t CS_LDK_BlindedForward_new(int8_tArray inbound_blinding_point_arg, int32_t failure_arg) { +int8_tArray CS_LDK_BlindedForward_get_next_blinding_override(int64_t this_ptr) { + LDKBlindedForward this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, BlindedForward_get_next_blinding_override(&this_ptr_conv).compressed_form, 33); + return ret_arr; +} + +void CS_LDK_BlindedForward_set_next_blinding_override(int64_t this_ptr, int8_tArray val) { + LDKBlindedForward this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + BlindedForward_set_next_blinding_override(&this_ptr_conv, val_ref); +} + +int64_t CS_LDK_BlindedForward_new(int8_tArray inbound_blinding_point_arg, int32_t failure_arg, int8_tArray next_blinding_override_arg) { LDKPublicKey inbound_blinding_point_arg_ref; CHECK(inbound_blinding_point_arg->arr_len == 33); memcpy(inbound_blinding_point_arg_ref.compressed_form, inbound_blinding_point_arg->elems, 33); FREE(inbound_blinding_point_arg); LDKBlindedFailure failure_arg_conv = LDKBlindedFailure_from_cs(failure_arg); - LDKBlindedForward ret_var = BlindedForward_new(inbound_blinding_point_arg_ref, failure_arg_conv); + LDKPublicKey next_blinding_override_arg_ref; + CHECK(next_blinding_override_arg->arr_len == 33); + memcpy(next_blinding_override_arg_ref.compressed_form, next_blinding_override_arg->elems, 33); FREE(next_blinding_override_arg); + LDKBlindedForward ret_var = BlindedForward_new(inbound_blinding_point_arg_ref, failure_arg_conv, next_blinding_override_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); @@ -42042,7 +43916,7 @@ int64_t CS_LDK_ChannelManager_close_channel_with_feerate_and_script(int64_t thi return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelManager_force_close_broadcasting_latest_txn(int64_t this_arg, int64_t 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, jstring error_message) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -42056,12 +43930,13 @@ int64_t CS_LDK_ChannelManager_force_close_broadcasting_latest_txn(int64_t this_ 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); + LDKStr error_message_conv = str_ref_to_owned_c(error_message); LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_force_close_broadcasting_latest_txn(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref); + *ret_conv = ChannelManager_force_close_broadcasting_latest_txn(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref, error_message_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelManager_force_close_without_broadcasting_txn(int64_t this_arg, int64_t 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, jstring error_message) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -42075,27 +43950,30 @@ int64_t CS_LDK_ChannelManager_force_close_without_broadcasting_txn(int64_t this 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); + LDKStr error_message_conv = str_ref_to_owned_c(error_message); LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_force_close_without_broadcasting_txn(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref); + *ret_conv = ChannelManager_force_close_without_broadcasting_txn(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref, error_message_conv); return tag_ptr(ret_conv, true); } -void CS_LDK_ChannelManager_force_close_all_channels_broadcasting_latest_txn(int64_t this_arg) { +void CS_LDK_ChannelManager_force_close_all_channels_broadcasting_latest_txn(int64_t this_arg, jstring error_message) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelManager_force_close_all_channels_broadcasting_latest_txn(&this_arg_conv); + LDKStr error_message_conv = str_ref_to_owned_c(error_message); + ChannelManager_force_close_all_channels_broadcasting_latest_txn(&this_arg_conv, error_message_conv); } -void CS_LDK_ChannelManager_force_close_all_channels_without_broadcasting_txn(int64_t this_arg) { +void CS_LDK_ChannelManager_force_close_all_channels_without_broadcasting_txn(int64_t this_arg, jstring error_message) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelManager_force_close_all_channels_without_broadcasting_txn(&this_arg_conv); + LDKStr error_message_conv = str_ref_to_owned_c(error_message); + ChannelManager_force_close_all_channels_without_broadcasting_txn(&this_arg_conv, error_message_conv); } int64_t CS_LDK_ChannelManager_send_payment_with_route(int64_t this_arg, int64_t route, int8_tArray payment_hash, int64_t recipient_onion, int8_tArray payment_id) { @@ -42108,7 +43986,7 @@ int64_t CS_LDK_ChannelManager_send_payment_with_route(int64_t this_arg, int64_t route_conv.inner = untag_ptr(route); route_conv.is_owned = ptr_is_owned(route); CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); - route_conv.is_owned = false; + route_conv = Route_clone(&route_conv); LDKThirtyTwoBytes payment_hash_ref; CHECK(payment_hash->arr_len == 32); memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); @@ -42121,7 +43999,7 @@ int64_t CS_LDK_ChannelManager_send_payment_with_route(int64_t this_arg, int64_t CHECK(payment_id->arr_len == 32); memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); - *ret_conv = ChannelManager_send_payment_with_route(&this_arg_conv, &route_conv, payment_hash_ref, recipient_onion_conv, payment_id_ref); + *ret_conv = ChannelManager_send_payment_with_route(&this_arg_conv, route_conv, payment_hash_ref, recipient_onion_conv, payment_id_ref); return tag_ptr(ret_conv, true); } @@ -42292,7 +44170,7 @@ int64_t CS_LDK_ChannelManager_funding_transaction_generated(int64_t this_arg, i 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; + 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); @@ -42302,7 +44180,31 @@ 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_conv, 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); +} + +int64_t CS_LDK_ChannelManager_unsafe_manual_funding_transaction_generated(int64_t this_arg, int64_t temporary_channel_id, int8_tArray counterparty_node_id, int64_t funding) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelId temporary_channel_id_conv; + temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); + temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); + temporary_channel_id_conv = 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); + LDKOutPoint funding_conv; + funding_conv.inner = untag_ptr(funding); + funding_conv.is_owned = ptr_is_owned(funding); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_conv); + funding_conv = OutPoint_clone(&funding_conv); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_unsafe_manual_funding_transaction_generated(&this_arg_conv, temporary_channel_id_conv, counterparty_node_id_ref, funding_conv); return tag_ptr(ret_conv, true); } @@ -42573,14 +44475,18 @@ int64_t CS_LDK_ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(in return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelManager_create_offer_builder(int64_t this_arg) { +int64_t CS_LDK_ChannelManager_create_offer_builder(int64_t this_arg, int64_t absolute_expiry) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; + void* absolute_expiry_ptr = untag_ptr(absolute_expiry); + CHECK_ACCESS(absolute_expiry_ptr); + LDKCOption_u64Z absolute_expiry_conv = *(LDKCOption_u64Z*)(absolute_expiry_ptr); + absolute_expiry_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(absolute_expiry)); LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ"); - *ret_conv = ChannelManager_create_offer_builder(&this_arg_conv); + *ret_conv = ChannelManager_create_offer_builder(&this_arg_conv, absolute_expiry_conv); return tag_ptr(ret_conv, true); } @@ -42919,6 +44825,17 @@ int64_t CS_LDK_ChannelManager_as_OffersMessageHandler(int64_t this_arg) { return tag_ptr(ret_ret, true); } +int64_t CS_LDK_ChannelManager_as_AsyncPaymentsMessageHandler(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; + LDKAsyncPaymentsMessageHandler* ret_ret = MALLOC(sizeof(LDKAsyncPaymentsMessageHandler), "LDKAsyncPaymentsMessageHandler"); + *ret_ret = ChannelManager_as_AsyncPaymentsMessageHandler(&this_arg_conv); + 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); @@ -45721,23 +47638,23 @@ void CS_LDK_ChannelDetails_set_is_usable(int64_t this_ptr, jboolean val) { ChannelDetails_set_is_usable(&this_ptr_conv, val); } -jboolean CS_LDK_ChannelDetails_get_is_public(int64_t this_ptr) { +jboolean CS_LDK_ChannelDetails_get_is_announced(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; - jboolean ret_conv = ChannelDetails_get_is_public(&this_ptr_conv); + jboolean ret_conv = ChannelDetails_get_is_announced(&this_ptr_conv); return ret_conv; } -void CS_LDK_ChannelDetails_set_is_public(int64_t this_ptr, jboolean val) { +void CS_LDK_ChannelDetails_set_is_announced(int64_t this_ptr, jboolean val) { LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelDetails_set_is_public(&this_ptr_conv, val); + ChannelDetails_set_is_announced(&this_ptr_conv, val); } int64_t CS_LDK_ChannelDetails_get_inbound_htlc_minimum_msat(int64_t this_ptr) { @@ -45913,7 +47830,7 @@ void CS_LDK_ChannelDetails_set_pending_outbound_htlcs(int64_t this_ptr, int64_t ChannelDetails_set_pending_outbound_htlcs(&this_ptr_conv, val_constr); } -int64_t CS_LDK_ChannelDetails_new(int64_t 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, int64_tArray pending_inbound_htlcs_arg, int64_tArray pending_outbound_htlcs_arg) { +int64_t CS_LDK_ChannelDetails_new(int64_t 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_announced_arg, int64_t inbound_htlc_minimum_msat_arg, int64_t inbound_htlc_maximum_msat_arg, int64_t config_arg, int64_tArray pending_inbound_htlcs_arg, int64_tArray pending_outbound_htlcs_arg) { LDKChannelId channel_id_arg_conv; channel_id_arg_conv.inner = untag_ptr(channel_id_arg); channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); @@ -45949,6 +47866,7 @@ int64_t CS_LDK_ChannelDetails_new(int64_t channel_id_arg, int64_t counterparty_ 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); + unspendable_punishment_reserve_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(unspendable_punishment_reserve_arg)); 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); @@ -46019,7 +47937,7 @@ int64_t CS_LDK_ChannelDetails_new(int64_t channel_id_arg, int64_t counterparty_ pending_outbound_htlcs_arg_constr.data[v] = pending_outbound_htlcs_arg_conv_21_conv; } FREE(pending_outbound_htlcs_arg); - LDKChannelDetails ret_var = ChannelDetails_new(channel_id_arg_conv, counterparty_arg_conv, funding_txo_arg_conv, channel_type_arg_conv, short_channel_id_arg_conv, outbound_scid_alias_arg_conv, inbound_scid_alias_arg_conv, channel_value_satoshis_arg, unspendable_punishment_reserve_arg_conv, user_channel_id_arg_ref, feerate_sat_per_1000_weight_arg_conv, balance_msat_arg, outbound_capacity_msat_arg, next_outbound_htlc_limit_msat_arg, next_outbound_htlc_minimum_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg_conv, confirmations_arg_conv, force_close_spend_delay_arg_conv, is_outbound_arg, is_channel_ready_arg, channel_shutdown_state_arg_conv, is_usable_arg, is_public_arg, inbound_htlc_minimum_msat_arg_conv, inbound_htlc_maximum_msat_arg_conv, config_arg_conv, pending_inbound_htlcs_arg_constr, pending_outbound_htlcs_arg_constr); + LDKChannelDetails ret_var = ChannelDetails_new(channel_id_arg_conv, counterparty_arg_conv, funding_txo_arg_conv, channel_type_arg_conv, short_channel_id_arg_conv, outbound_scid_alias_arg_conv, inbound_scid_alias_arg_conv, channel_value_satoshis_arg, unspendable_punishment_reserve_arg_conv, user_channel_id_arg_ref, feerate_sat_per_1000_weight_arg_conv, balance_msat_arg, outbound_capacity_msat_arg, next_outbound_htlc_limit_msat_arg, next_outbound_htlc_minimum_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg_conv, confirmations_arg_conv, force_close_spend_delay_arg_conv, is_outbound_arg, is_channel_ready_arg, channel_shutdown_state_arg_conv, is_usable_arg, is_announced_arg, inbound_htlc_minimum_msat_arg_conv, inbound_htlc_maximum_msat_arg_conv, config_arg_conv, pending_inbound_htlcs_arg_constr, pending_outbound_htlcs_arg_constr); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -46421,6 +48339,7 @@ int64_t CS_LDK_Init_new(int64_t features_arg, int64_t networks_arg, int64_t rem void* remote_network_address_arg_ptr = untag_ptr(remote_network_address_arg); CHECK_ACCESS(remote_network_address_arg_ptr); LDKCOption_SocketAddressZ remote_network_address_arg_conv = *(LDKCOption_SocketAddressZ*)(remote_network_address_arg_ptr); + remote_network_address_arg_conv = COption_SocketAddressZ_clone((LDKCOption_SocketAddressZ*)untag_ptr(remote_network_address_arg)); LDKInit ret_var = Init_new(features_arg_conv, networks_arg_conv, remote_network_address_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); @@ -47432,6 +49351,204 @@ jboolean CS_LDK_CommonOpenChannelFields_eq(int64_t a, int64_t b) { return ret_conv; } +int64_t CS_LDK_CommonOpenChannelFields_channel_parameters(int64_t this_arg) { + LDKCommonOpenChannelFields this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelParameters ret_var = CommonOpenChannelFields_channel_parameters(&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_ChannelParameters_free(int64_t this_obj) { + LDKChannelParameters this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelParameters_free(this_obj_conv); +} + +int64_t CS_LDK_ChannelParameters_get_dust_limit_satoshis(int64_t this_ptr) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = ChannelParameters_get_dust_limit_satoshis(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_ChannelParameters_set_dust_limit_satoshis(int64_t this_ptr, int64_t val) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelParameters_set_dust_limit_satoshis(&this_ptr_conv, val); +} + +int64_t CS_LDK_ChannelParameters_get_max_htlc_value_in_flight_msat(int64_t this_ptr) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = ChannelParameters_get_max_htlc_value_in_flight_msat(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_ChannelParameters_set_max_htlc_value_in_flight_msat(int64_t this_ptr, int64_t val) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelParameters_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val); +} + +int64_t CS_LDK_ChannelParameters_get_htlc_minimum_msat(int64_t this_ptr) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = ChannelParameters_get_htlc_minimum_msat(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_ChannelParameters_set_htlc_minimum_msat(int64_t this_ptr, int64_t val) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelParameters_set_htlc_minimum_msat(&this_ptr_conv, val); +} + +int32_t CS_LDK_ChannelParameters_get_commitment_feerate_sat_per_1000_weight(int64_t this_ptr) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = ChannelParameters_get_commitment_feerate_sat_per_1000_weight(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_ChannelParameters_set_commitment_feerate_sat_per_1000_weight(int64_t this_ptr, int32_t val) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelParameters_set_commitment_feerate_sat_per_1000_weight(&this_ptr_conv, val); +} + +int16_t CS_LDK_ChannelParameters_get_to_self_delay(int64_t this_ptr) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = ChannelParameters_get_to_self_delay(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_ChannelParameters_set_to_self_delay(int64_t this_ptr, int16_t val) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelParameters_set_to_self_delay(&this_ptr_conv, val); +} + +int16_t CS_LDK_ChannelParameters_get_max_accepted_htlcs(int64_t this_ptr) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = ChannelParameters_get_max_accepted_htlcs(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_ChannelParameters_set_max_accepted_htlcs(int64_t this_ptr, int16_t val) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelParameters_set_max_accepted_htlcs(&this_ptr_conv, val); +} + +int64_t CS_LDK_ChannelParameters_new(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) { + LDKChannelParameters ret_var = ChannelParameters_new(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); + int64_t ret_ref = 0; + 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 ChannelParameters_clone_ptr(LDKChannelParameters *NONNULL_PTR arg) { + LDKChannelParameters ret_var = ChannelParameters_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_ChannelParameters_clone_ptr(int64_t arg) { + LDKChannelParameters 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 = ChannelParameters_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_ChannelParameters_clone(int64_t orig) { + LDKChannelParameters 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; + LDKChannelParameters ret_var = ChannelParameters_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_ChannelParameters_hash(int64_t o) { + LDKChannelParameters o_conv; + 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 = ChannelParameters_hash(&o_conv); + return ret_conv; +} + +jboolean CS_LDK_ChannelParameters_eq(int64_t a, int64_t b) { + LDKChannelParameters a_conv; + 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; + LDKChannelParameters 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 = ChannelParameters_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); @@ -49059,29 +51176,29 @@ jboolean CS_LDK_Stfu_eq(int64_t a, int64_t b) { return ret_conv; } -void CS_LDK_Splice_free(int64_t this_obj) { - LDKSplice this_obj_conv; +void CS_LDK_SpliceInit_free(int64_t this_obj) { + LDKSpliceInit this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Splice_free(this_obj_conv); + SpliceInit_free(this_obj_conv); } -int64_t CS_LDK_Splice_get_channel_id(int64_t this_ptr) { - LDKSplice this_ptr_conv; +int64_t CS_LDK_SpliceInit_get_channel_id(int64_t this_ptr) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = Splice_get_channel_id(&this_ptr_conv); + LDKChannelId ret_var = SpliceInit_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, int64_t val) { - LDKSplice this_ptr_conv; +void CS_LDK_SpliceInit_set_channel_id(int64_t this_ptr, int64_t val) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -49091,173 +51208,168 @@ void CS_LDK_Splice_set_channel_id(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 = ChannelId_clone(&val_conv); - Splice_set_channel_id(&this_ptr_conv, val_conv); + SpliceInit_set_channel_id(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_Splice_get_chain_hash(int64_t this_ptr) { - LDKSplice this_ptr_conv; +int64_t CS_LDK_SpliceInit_get_funding_contribution_satoshis(int64_t this_ptr) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(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_chain_hash(&this_ptr_conv), 32); - return ret_arr; + int64_t ret_conv = SpliceInit_get_funding_contribution_satoshis(&this_ptr_conv); + return ret_conv; } -void CS_LDK_Splice_set_chain_hash(int64_t this_ptr, int8_tArray val) { - LDKSplice this_ptr_conv; +void CS_LDK_SpliceInit_set_funding_contribution_satoshis(int64_t this_ptr, int64_t val) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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_chain_hash(&this_ptr_conv, val_ref); + SpliceInit_set_funding_contribution_satoshis(&this_ptr_conv, val); } -int64_t CS_LDK_Splice_get_relative_satoshis(int64_t this_ptr) { - LDKSplice this_ptr_conv; +int32_t CS_LDK_SpliceInit_get_funding_feerate_perkw(int64_t this_ptr) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = Splice_get_relative_satoshis(&this_ptr_conv); + int32_t ret_conv = SpliceInit_get_funding_feerate_perkw(&this_ptr_conv); return ret_conv; } -void CS_LDK_Splice_set_relative_satoshis(int64_t this_ptr, int64_t val) { - LDKSplice this_ptr_conv; +void CS_LDK_SpliceInit_set_funding_feerate_perkw(int64_t this_ptr, int32_t val) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - Splice_set_relative_satoshis(&this_ptr_conv, val); + SpliceInit_set_funding_feerate_perkw(&this_ptr_conv, val); } -int32_t CS_LDK_Splice_get_funding_feerate_perkw(int64_t this_ptr) { - LDKSplice this_ptr_conv; +int32_t CS_LDK_SpliceInit_get_locktime(int64_t this_ptr) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = Splice_get_funding_feerate_perkw(&this_ptr_conv); + int32_t ret_conv = SpliceInit_get_locktime(&this_ptr_conv); return ret_conv; } -void CS_LDK_Splice_set_funding_feerate_perkw(int64_t this_ptr, int32_t val) { - LDKSplice this_ptr_conv; +void CS_LDK_SpliceInit_set_locktime(int64_t this_ptr, int32_t val) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - Splice_set_funding_feerate_perkw(&this_ptr_conv, val); + SpliceInit_set_locktime(&this_ptr_conv, val); } -int32_t CS_LDK_Splice_get_locktime(int64_t this_ptr) { - LDKSplice this_ptr_conv; +int8_tArray CS_LDK_SpliceInit_get_funding_pubkey(int64_t this_ptr) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = Splice_get_locktime(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, SpliceInit_get_funding_pubkey(&this_ptr_conv).compressed_form, 33); + return ret_arr; } -void CS_LDK_Splice_set_locktime(int64_t this_ptr, int32_t val) { - LDKSplice this_ptr_conv; +void CS_LDK_SpliceInit_set_funding_pubkey(int64_t this_ptr, int8_tArray val) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - Splice_set_locktime(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + SpliceInit_set_funding_pubkey(&this_ptr_conv, val_ref); } -int8_tArray CS_LDK_Splice_get_funding_pubkey(int64_t this_ptr) { - LDKSplice this_ptr_conv; +int32_t CS_LDK_SpliceInit_get_require_confirmed_inputs(int64_t this_ptr) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(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, Splice_get_funding_pubkey(&this_ptr_conv).compressed_form, 33); - return ret_arr; + int32_t ret_conv = LDKCOption_NoneZ_to_cs(SpliceInit_get_require_confirmed_inputs(&this_ptr_conv)); + return ret_conv; } -void CS_LDK_Splice_set_funding_pubkey(int64_t this_ptr, int8_tArray val) { - LDKSplice this_ptr_conv; +void CS_LDK_SpliceInit_set_require_confirmed_inputs(int64_t this_ptr, int32_t val) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - Splice_set_funding_pubkey(&this_ptr_conv, val_ref); + LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_cs(val); + SpliceInit_set_require_confirmed_inputs(&this_ptr_conv, val_conv); } -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) { +int64_t CS_LDK_SpliceInit_new(int64_t channel_id_arg, int64_t funding_contribution_satoshis_arg, int32_t funding_feerate_perkw_arg, int32_t locktime_arg, int8_tArray funding_pubkey_arg, int32_t require_confirmed_inputs_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_conv, chain_hash_arg_ref, relative_satoshis_arg, funding_feerate_perkw_arg, locktime_arg, funding_pubkey_arg_ref); + LDKCOption_NoneZ require_confirmed_inputs_arg_conv = LDKCOption_NoneZ_from_cs(require_confirmed_inputs_arg); + LDKSpliceInit ret_var = SpliceInit_new(channel_id_arg_conv, funding_contribution_satoshis_arg, funding_feerate_perkw_arg, locktime_arg, funding_pubkey_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); return ret_ref; } -static inline uint64_t Splice_clone_ptr(LDKSplice *NONNULL_PTR arg) { - LDKSplice ret_var = Splice_clone(arg); +static inline uint64_t SpliceInit_clone_ptr(LDKSpliceInit *NONNULL_PTR arg) { + LDKSpliceInit ret_var = SpliceInit_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_Splice_clone_ptr(int64_t arg) { - LDKSplice arg_conv; +int64_t CS_LDK_SpliceInit_clone_ptr(int64_t arg) { + LDKSpliceInit 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 = Splice_clone_ptr(&arg_conv); + int64_t ret_conv = SpliceInit_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_Splice_clone(int64_t orig) { - LDKSplice orig_conv; +int64_t CS_LDK_SpliceInit_clone(int64_t orig) { + LDKSpliceInit 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; - LDKSplice ret_var = Splice_clone(&orig_conv); + LDKSpliceInit ret_var = SpliceInit_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_Splice_eq(int64_t a, int64_t b) { - LDKSplice a_conv; +jboolean CS_LDK_SpliceInit_eq(int64_t a, int64_t b) { + LDKSpliceInit a_conv; 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; - LDKSplice b_conv; + LDKSpliceInit 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 = Splice_eq(&a_conv, &b_conv); + jboolean ret_conv = SpliceInit_eq(&a_conv, &b_conv); return ret_conv; } @@ -49296,46 +51408,23 @@ void CS_LDK_SpliceAck_set_channel_id(int64_t this_ptr, int64_t val) { SpliceAck_set_channel_id(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_SpliceAck_get_chain_hash(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_chain_hash(&this_ptr_conv), 32); - return ret_arr; -} - -void CS_LDK_SpliceAck_set_chain_hash(int64_t this_ptr, int8_tArray 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_chain_hash(&this_ptr_conv, val_ref); -} - -int64_t CS_LDK_SpliceAck_get_relative_satoshis(int64_t this_ptr) { +int64_t CS_LDK_SpliceAck_get_funding_contribution_satoshis(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; - int64_t ret_conv = SpliceAck_get_relative_satoshis(&this_ptr_conv); + int64_t ret_conv = SpliceAck_get_funding_contribution_satoshis(&this_ptr_conv); return ret_conv; } -void CS_LDK_SpliceAck_set_relative_satoshis(int64_t this_ptr, int64_t val) { +void CS_LDK_SpliceAck_set_funding_contribution_satoshis(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; - SpliceAck_set_relative_satoshis(&this_ptr_conv, val); + SpliceAck_set_funding_contribution_satoshis(&this_ptr_conv, val); } int8_tArray CS_LDK_SpliceAck_get_funding_pubkey(int64_t this_ptr) { @@ -49361,19 +51450,37 @@ 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(int64_t channel_id_arg, int8_tArray chain_hash_arg, int64_t relative_satoshis_arg, int8_tArray funding_pubkey_arg) { +int32_t CS_LDK_SpliceAck_get_require_confirmed_inputs(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; + int32_t ret_conv = LDKCOption_NoneZ_to_cs(SpliceAck_get_require_confirmed_inputs(&this_ptr_conv)); + return ret_conv; +} + +void CS_LDK_SpliceAck_set_require_confirmed_inputs(int64_t this_ptr, int32_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; + LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_cs(val); + SpliceAck_set_require_confirmed_inputs(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_SpliceAck_new(int64_t channel_id_arg, int64_t funding_contribution_satoshis_arg, int8_tArray funding_pubkey_arg, int32_t require_confirmed_inputs_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_conv, chain_hash_arg_ref, relative_satoshis_arg, funding_pubkey_arg_ref); + LDKCOption_NoneZ require_confirmed_inputs_arg_conv = LDKCOption_NoneZ_from_cs(require_confirmed_inputs_arg); + LDKSpliceAck ret_var = SpliceAck_new(channel_id_arg_conv, funding_contribution_satoshis_arg, funding_pubkey_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); @@ -49460,13 +51567,39 @@ void CS_LDK_SpliceLocked_set_channel_id(int64_t this_ptr, int64_t val) { SpliceLocked_set_channel_id(&this_ptr_conv, val_conv); } -int64_t CS_LDK_SpliceLocked_new(int64_t channel_id_arg) { +int8_tArray CS_LDK_SpliceLocked_get_splice_txid(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_splice_txid(&this_ptr_conv), 32); + return ret_arr; +} + +void CS_LDK_SpliceLocked_set_splice_txid(int64_t this_ptr, int8_tArray 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_splice_txid(&this_ptr_conv, val_ref); +} + +int64_t CS_LDK_SpliceLocked_new(int64_t channel_id_arg, int8_tArray splice_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); - LDKSpliceLocked ret_var = SpliceLocked_new(channel_id_arg_conv); + LDKThirtyTwoBytes splice_txid_arg_ref; + CHECK(splice_txid_arg->arr_len == 32); + memcpy(splice_txid_arg_ref.data, splice_txid_arg->elems, 32); FREE(splice_txid_arg); + LDKSpliceLocked ret_var = SpliceLocked_new(channel_id_arg_conv, splice_txid_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); @@ -49637,7 +51770,32 @@ 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(int64_t channel_id_arg, int64_t serial_id_arg, int64_t prevtx_arg, int32_t prevtx_out_arg, int32_t sequence_arg) { +int64_t CS_LDK_TxAddInput_get_shared_input_txid(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; + LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); + *ret_copy = TxAddInput_get_shared_input_txid(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_TxAddInput_set_shared_input_txid(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; + 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)); + TxAddInput_set_shared_input_txid(&this_ptr_conv, val_conv); +} + +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, int64_t shared_input_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); @@ -49648,7 +51806,11 @@ int64_t CS_LDK_TxAddInput_new(int64_t channel_id_arg, int64_t serial_id_arg, in 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_conv, serial_id_arg, prevtx_arg_conv, prevtx_out_arg, sequence_arg); + void* shared_input_txid_arg_ptr = untag_ptr(shared_input_txid_arg); + CHECK_ACCESS(shared_input_txid_arg_ptr); + LDKCOption_ThirtyTwoBytesZ shared_input_txid_arg_conv = *(LDKCOption_ThirtyTwoBytesZ*)(shared_input_txid_arg_ptr); + shared_input_txid_arg_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(shared_input_txid_arg)); + LDKTxAddInput ret_var = TxAddInput_new(channel_id_arg_conv, serial_id_arg, prevtx_arg_conv, prevtx_out_arg, sequence_arg, shared_input_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); @@ -50334,19 +52496,19 @@ 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_get_funding_outpoint_sig(int64_t this_ptr) { +int64_t CS_LDK_TxSignatures_get_shared_input_signature(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); + *ret_copy = TxSignatures_get_shared_input_signature(&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) { +void CS_LDK_TxSignatures_set_shared_input_signature(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); @@ -50356,10 +52518,10 @@ void CS_LDK_TxSignatures_set_funding_outpoint_sig(int64_t this_ptr, int64_t 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); + TxSignatures_set_shared_input_signature(&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) { +int64_t CS_LDK_TxSignatures_new(int64_t channel_id_arg, int8_tArray tx_hash_arg, ptrArray witnesses_arg, int64_t shared_input_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); @@ -50385,11 +52547,11 @@ int64_t CS_LDK_TxSignatures_new(int64_t channel_id_arg, int8_tArray tx_hash_arg witnesses_arg_constr.data[i] = witnesses_arg_conv_8_ref; } FREE(witnesses_arg); - 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); + void* shared_input_signature_arg_ptr = untag_ptr(shared_input_signature_arg); + CHECK_ACCESS(shared_input_signature_arg_ptr); + LDKCOption_ECDSASignatureZ shared_input_signature_arg_conv = *(LDKCOption_ECDSASignatureZ*)(shared_input_signature_arg_ptr); + shared_input_signature_arg_conv = COption_ECDSASignatureZ_clone((LDKCOption_ECDSASignatureZ*)untag_ptr(shared_input_signature_arg)); + LDKTxSignatures ret_var = TxSignatures_new(channel_id_arg_conv, tx_hash_arg_ref, witnesses_arg_constr, shared_input_signature_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); @@ -52095,6 +54257,122 @@ jboolean CS_LDK_UpdateFailMalformedHTLC_eq(int64_t a, int64_t b) { return ret_conv; } +void CS_LDK_CommitmentSignedBatch_free(int64_t this_obj) { + LDKCommitmentSignedBatch this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + CommitmentSignedBatch_free(this_obj_conv); +} + +int16_t CS_LDK_CommitmentSignedBatch_get_batch_size(int64_t this_ptr) { + LDKCommitmentSignedBatch this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = CommitmentSignedBatch_get_batch_size(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_CommitmentSignedBatch_set_batch_size(int64_t this_ptr, int16_t val) { + LDKCommitmentSignedBatch this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + CommitmentSignedBatch_set_batch_size(&this_ptr_conv, val); +} + +int8_tArray CS_LDK_CommitmentSignedBatch_get_funding_txid(int64_t this_ptr) { + LDKCommitmentSignedBatch this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(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, *CommitmentSignedBatch_get_funding_txid(&this_ptr_conv), 32); + return ret_arr; +} + +void CS_LDK_CommitmentSignedBatch_set_funding_txid(int64_t this_ptr, int8_tArray val) { + LDKCommitmentSignedBatch this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + CommitmentSignedBatch_set_funding_txid(&this_ptr_conv, val_ref); +} + +int64_t CS_LDK_CommitmentSignedBatch_new(int16_t batch_size_arg, int8_tArray funding_txid_arg) { + 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); + LDKCommitmentSignedBatch ret_var = CommitmentSignedBatch_new(batch_size_arg, funding_txid_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 CommitmentSignedBatch_clone_ptr(LDKCommitmentSignedBatch *NONNULL_PTR arg) { + LDKCommitmentSignedBatch ret_var = CommitmentSignedBatch_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_CommitmentSignedBatch_clone_ptr(int64_t arg) { + LDKCommitmentSignedBatch 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 = CommitmentSignedBatch_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CommitmentSignedBatch_clone(int64_t orig) { + LDKCommitmentSignedBatch 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; + LDKCommitmentSignedBatch ret_var = CommitmentSignedBatch_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_CommitmentSignedBatch_hash(int64_t o) { + LDKCommitmentSignedBatch o_conv; + 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 = CommitmentSignedBatch_hash(&o_conv); + return ret_conv; +} + +jboolean CS_LDK_CommitmentSignedBatch_eq(int64_t a, int64_t b) { + LDKCommitmentSignedBatch a_conv; + 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; + LDKCommitmentSignedBatch 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 = CommitmentSignedBatch_eq(&a_conv, &b_conv); + return ret_conv; +} + void CS_LDK_CommitmentSigned_free(int64_t this_obj) { LDKCommitmentSigned this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -52197,7 +54475,34 @@ 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(int64_t channel_id_arg, int8_tArray signature_arg, ptrArray htlc_signatures_arg) { +int64_t CS_LDK_CommitmentSigned_get_batch(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; + LDKCommitmentSignedBatch ret_var = CommitmentSigned_get_batch(&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_batch(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; + LDKCommitmentSignedBatch 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 = CommitmentSignedBatch_clone(&val_conv); + CommitmentSigned_set_batch(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_CommitmentSigned_new(int64_t channel_id_arg, int8_tArray signature_arg, ptrArray htlc_signatures_arg, int64_t batch_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); @@ -52221,7 +54526,12 @@ int64_t CS_LDK_CommitmentSigned_new(int64_t channel_id_arg, int8_tArray signatu htlc_signatures_arg_constr.data[i] = htlc_signatures_arg_conv_8_ref; } FREE(htlc_signatures_arg); - LDKCommitmentSigned ret_var = CommitmentSigned_new(channel_id_arg_conv, signature_arg_ref, htlc_signatures_arg_constr); + LDKCommitmentSignedBatch batch_arg_conv; + batch_arg_conv.inner = untag_ptr(batch_arg); + batch_arg_conv.is_owned = ptr_is_owned(batch_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(batch_arg_conv); + batch_arg_conv = CommitmentSignedBatch_clone(&batch_arg_conv); + LDKCommitmentSigned ret_var = CommitmentSigned_new(channel_id_arg_conv, signature_arg_ref, htlc_signatures_arg_constr, batch_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); @@ -53472,6 +55782,7 @@ int64_t CS_LDK_UnsignedNodeAnnouncement_new(int64_t features_arg, int32_t times 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_conv_15_conv = SocketAddress_clone((LDKSocketAddress*)untag_ptr(addresses_arg_conv_15)); addresses_arg_constr.data[p] = addresses_arg_conv_15_conv; } FREE(addresses_arg); @@ -54256,23 +56567,42 @@ void CS_LDK_UnsignedChannelUpdate_set_timestamp(int64_t this_ptr, int32_t val) UnsignedChannelUpdate_set_timestamp(&this_ptr_conv, val); } -int8_t CS_LDK_UnsignedChannelUpdate_get_flags(int64_t this_ptr) { +int8_t CS_LDK_UnsignedChannelUpdate_get_message_flags(int64_t this_ptr) { + LDKUnsignedChannelUpdate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_t ret_conv = UnsignedChannelUpdate_get_message_flags(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_UnsignedChannelUpdate_set_message_flags(int64_t this_ptr, int8_t val) { + LDKUnsignedChannelUpdate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + UnsignedChannelUpdate_set_message_flags(&this_ptr_conv, val); +} + +int8_t CS_LDK_UnsignedChannelUpdate_get_channel_flags(int64_t this_ptr) { LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_t ret_conv = UnsignedChannelUpdate_get_flags(&this_ptr_conv); + int8_t ret_conv = UnsignedChannelUpdate_get_channel_flags(&this_ptr_conv); return ret_conv; } -void CS_LDK_UnsignedChannelUpdate_set_flags(int64_t this_ptr, int8_t val) { +void CS_LDK_UnsignedChannelUpdate_set_channel_flags(int64_t this_ptr, int8_t val) { LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - UnsignedChannelUpdate_set_flags(&this_ptr_conv, val); + UnsignedChannelUpdate_set_channel_flags(&this_ptr_conv, val); } int16_t CS_LDK_UnsignedChannelUpdate_get_cltv_expiry_delta(int64_t this_ptr) { @@ -54396,7 +56726,7 @@ void CS_LDK_UnsignedChannelUpdate_set_excess_data(int64_t this_ptr, int8_tArray UnsignedChannelUpdate_set_excess_data(&this_ptr_conv, val_ref); } -int64_t CS_LDK_UnsignedChannelUpdate_new(int8_tArray chain_hash_arg, int64_t short_channel_id_arg, int32_t timestamp_arg, int8_t flags_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg, int32_t fee_base_msat_arg, int32_t fee_proportional_millionths_arg, int8_tArray excess_data_arg) { +int64_t CS_LDK_UnsignedChannelUpdate_new(int8_tArray chain_hash_arg, int64_t short_channel_id_arg, int32_t timestamp_arg, int8_t message_flags_arg, int8_t channel_flags_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg, int32_t fee_base_msat_arg, int32_t fee_proportional_millionths_arg, int8_tArray excess_data_arg) { LDKThirtyTwoBytes chain_hash_arg_ref; CHECK(chain_hash_arg->arr_len == 32); memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg); @@ -54404,7 +56734,7 @@ int64_t CS_LDK_UnsignedChannelUpdate_new(int8_tArray chain_hash_arg, int64_t sh excess_data_arg_ref.datalen = excess_data_arg->arr_len; excess_data_arg_ref.data = MALLOC(excess_data_arg_ref.datalen, "LDKCVec_u8Z Bytes"); memcpy(excess_data_arg_ref.data, excess_data_arg->elems, excess_data_arg_ref.datalen); FREE(excess_data_arg); - LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_new(chain_hash_arg_ref, short_channel_id_arg, timestamp_arg, flags_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, fee_base_msat_arg, fee_proportional_millionths_arg, excess_data_arg_ref); + LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_new(chain_hash_arg_ref, short_channel_id_arg, timestamp_arg, message_flags_arg, channel_flags_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, fee_base_msat_arg, fee_proportional_millionths_arg, excess_data_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -56444,25 +58774,25 @@ int64_t CS_LDK_Stfu_read(int8_tArray ser) { return tag_ptr(ret_conv, true); } -int8_tArray CS_LDK_Splice_write(int64_t obj) { - LDKSplice obj_conv; +int8_tArray CS_LDK_SpliceInit_write(int64_t obj) { + LDKSpliceInit 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 = Splice_write(&obj_conv); + LDKCVec_u8Z ret_var = SpliceInit_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_Splice_read(int8_tArray ser) { +int64_t CS_LDK_SpliceInit_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_SpliceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceDecodeErrorZ), "LDKCResult_SpliceDecodeErrorZ"); - *ret_conv = Splice_read(ser_ref); + LDKCResult_SpliceInitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceInitDecodeErrorZ), "LDKCResult_SpliceInitDecodeErrorZ"); + *ret_conv = SpliceInit_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } @@ -56812,6 +59142,29 @@ int64_t CS_LDK_ClosingSignedFeeRange_read(int8_tArray ser) { return tag_ptr(ret_conv, true); } +int8_tArray CS_LDK_CommitmentSignedBatch_write(int64_t obj) { + LDKCommitmentSignedBatch 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 = CommitmentSignedBatch_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_CommitmentSignedBatch_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_CommitmentSignedBatchDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedBatchDecodeErrorZ), "LDKCResult_CommitmentSignedBatchDecodeErrorZ"); + *ret_conv = CommitmentSignedBatch_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + int8_tArray CS_LDK_CommitmentSigned_write(int64_t obj) { LDKCommitmentSigned obj_conv; obj_conv.inner = untag_ptr(obj); @@ -57583,17 +59936,6 @@ int64_t CS_LDK_IgnoringMessageHandler_new() { return ret_ref; } -int64_t CS_LDK_IgnoringMessageHandler_as_EventsProvider(int64_t this_arg) { - LDKIgnoringMessageHandler this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); - *ret_ret = IgnoringMessageHandler_as_EventsProvider(&this_arg_conv); - return tag_ptr(ret_ret, true); -} - int64_t CS_LDK_IgnoringMessageHandler_as_MessageSendEventsProvider(int64_t this_arg) { LDKIgnoringMessageHandler this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -57638,6 +59980,17 @@ int64_t CS_LDK_IgnoringMessageHandler_as_OffersMessageHandler(int64_t this_arg) return tag_ptr(ret_ret, true); } +int64_t CS_LDK_IgnoringMessageHandler_as_AsyncPaymentsMessageHandler(int64_t this_arg) { + LDKIgnoringMessageHandler this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKAsyncPaymentsMessageHandler* ret_ret = MALLOC(sizeof(LDKAsyncPaymentsMessageHandler), "LDKAsyncPaymentsMessageHandler"); + *ret_ret = IgnoringMessageHandler_as_AsyncPaymentsMessageHandler(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + int64_t CS_LDK_IgnoringMessageHandler_as_CustomOnionMessageHandler(int64_t this_arg) { LDKIgnoringMessageHandler this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -58001,6 +60354,7 @@ int64_t CS_LDK_PeerDetails_new(int8_tArray counterparty_node_id_arg, int64_t so 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); + socket_address_arg_conv = COption_SocketAddressZ_clone((LDKCOption_SocketAddressZ*)untag_ptr(socket_address_arg)); 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); @@ -58168,6 +60522,7 @@ int64_t CS_LDK_PeerManager_new_outbound_connection(int64_t this_arg, int8_tArra void* remote_network_address_ptr = untag_ptr(remote_network_address); CHECK_ACCESS(remote_network_address_ptr); LDKCOption_SocketAddressZ remote_network_address_conv = *(LDKCOption_SocketAddressZ*)(remote_network_address_ptr); + remote_network_address_conv = COption_SocketAddressZ_clone((LDKCOption_SocketAddressZ*)untag_ptr(remote_network_address)); LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); *ret_conv = PeerManager_new_outbound_connection(&this_arg_conv, their_node_id_ref, descriptor_conv, remote_network_address_conv); return tag_ptr(ret_conv, true); @@ -58189,6 +60544,7 @@ int64_t CS_LDK_PeerManager_new_inbound_connection(int64_t this_arg, int64_t des void* remote_network_address_ptr = untag_ptr(remote_network_address); CHECK_ACCESS(remote_network_address_ptr); LDKCOption_SocketAddressZ remote_network_address_conv = *(LDKCOption_SocketAddressZ*)(remote_network_address_ptr); + remote_network_address_conv = COption_SocketAddressZ_clone((LDKCOption_SocketAddressZ*)untag_ptr(remote_network_address)); LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); *ret_conv = PeerManager_new_inbound_connection(&this_arg_conv, descriptor_conv, remote_network_address_conv); return tag_ptr(ret_conv, true); @@ -58301,6 +60657,7 @@ void CS_LDK_PeerManager_broadcast_node_announcement(int64_t this_arg, int8_tArr void* addresses_conv_15_ptr = untag_ptr(addresses_conv_15); CHECK_ACCESS(addresses_conv_15_ptr); LDKSocketAddress addresses_conv_15_conv = *(LDKSocketAddress*)(addresses_conv_15_ptr); + addresses_conv_15_conv = SocketAddress_clone((LDKSocketAddress*)untag_ptr(addresses_conv_15)); addresses_constr.data[p] = addresses_conv_15_conv; } FREE(addresses); @@ -59278,6 +61635,16 @@ jboolean CS_LDK_HTLCOutputInCommitment_eq(int64_t a, int64_t b) { return ret_conv; } +int64_t CS_LDK_HTLCOutputInCommitment_to_bitcoin_amount(int64_t this_arg) { + LDKHTLCOutputInCommitment this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int64_t ret_conv = HTLCOutputInCommitment_to_bitcoin_amount(&this_arg_conv); + return ret_conv; +} + int8_tArray CS_LDK_HTLCOutputInCommitment_write(int64_t obj) { LDKHTLCOutputInCommitment obj_conv; obj_conv.inner = untag_ptr(obj); @@ -60784,7752 +63151,8407 @@ int64_t CS_LDK_get_commitment_transaction_number_obscure_factor(int8_tArray bro return ret_conv; } -jboolean CS_LDK_InitFeatures_eq(int64_t a, int64_t b) { - LDKInitFeatures a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKInitFeatures b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = InitFeatures_eq(&a_conv, &b_conv); - return ret_conv; +int8_tArray CS_LDK_InitFeatures_write(int64_t obj) { + LDKInitFeatures obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = InitFeatures_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -jboolean CS_LDK_NodeFeatures_eq(int64_t a, int64_t b) { - LDKNodeFeatures a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKNodeFeatures b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_eq(&a_conv, &b_conv); - return ret_conv; +int64_t CS_LDK_InitFeatures_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); + *ret_conv = InitFeatures_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_ChannelFeatures_eq(int64_t a, int64_t b) { - LDKChannelFeatures a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKChannelFeatures b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = ChannelFeatures_eq(&a_conv, &b_conv); - return ret_conv; +int8_tArray CS_LDK_ChannelFeatures_write(int64_t obj) { + LDKChannelFeatures obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ChannelFeatures_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -jboolean CS_LDK_Bolt11InvoiceFeatures_eq(int64_t a, int64_t b) { - LDKBolt11InvoiceFeatures a_conv; - 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; - LDKBolt11InvoiceFeatures 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 = Bolt11InvoiceFeatures_eq(&a_conv, &b_conv); - return ret_conv; +int64_t CS_LDK_ChannelFeatures_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); + *ret_conv = ChannelFeatures_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_OfferFeatures_eq(int64_t a, int64_t b) { - LDKOfferFeatures a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKOfferFeatures b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = OfferFeatures_eq(&a_conv, &b_conv); - return ret_conv; +int8_tArray CS_LDK_NodeFeatures_write(int64_t obj) { + LDKNodeFeatures obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = NodeFeatures_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -jboolean CS_LDK_InvoiceRequestFeatures_eq(int64_t a, int64_t b) { - LDKInvoiceRequestFeatures a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKInvoiceRequestFeatures b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = InvoiceRequestFeatures_eq(&a_conv, &b_conv); - return ret_conv; +int64_t CS_LDK_NodeFeatures_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); + *ret_conv = NodeFeatures_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_Bolt12InvoiceFeatures_eq(int64_t a, int64_t b) { - LDKBolt12InvoiceFeatures a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKBolt12InvoiceFeatures b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = Bolt12InvoiceFeatures_eq(&a_conv, &b_conv); - return ret_conv; +int8_tArray CS_LDK_Bolt11InvoiceFeatures_write(int64_t obj) { + LDKBolt11InvoiceFeatures 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 = Bolt11InvoiceFeatures_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -jboolean CS_LDK_BlindedHopFeatures_eq(int64_t a, int64_t b) { - LDKBlindedHopFeatures a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKBlindedHopFeatures b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = BlindedHopFeatures_eq(&a_conv, &b_conv); - return ret_conv; +int64_t CS_LDK_Bolt11InvoiceFeatures_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ"); + *ret_conv = Bolt11InvoiceFeatures_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_ChannelTypeFeatures_eq(int64_t a, int64_t b) { - LDKChannelTypeFeatures a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKChannelTypeFeatures b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_eq(&a_conv, &b_conv); - return ret_conv; +int8_tArray CS_LDK_Bolt12InvoiceFeatures_write(int64_t obj) { + LDKBolt12InvoiceFeatures 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 = Bolt12InvoiceFeatures_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -static inline uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg) { - LDKInitFeatures ret_var = InitFeatures_clone(arg); +int64_t CS_LDK_Bolt12InvoiceFeatures_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ"); + *ret_conv = Bolt12InvoiceFeatures_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray CS_LDK_BlindedHopFeatures_write(int64_t obj) { + LDKBlindedHopFeatures obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = BlindedHopFeatures_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_BlindedHopFeatures_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ"); + *ret_conv = BlindedHopFeatures_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray CS_LDK_ChannelTypeFeatures_write(int64_t obj) { + LDKChannelTypeFeatures obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ChannelTypeFeatures_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_ChannelTypeFeatures_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); + *ret_conv = ChannelTypeFeatures_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_ShutdownScript_free(int64_t this_obj) { + LDKShutdownScript this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ShutdownScript_free(this_obj_conv); +} + +static inline uint64_t ShutdownScript_clone_ptr(LDKShutdownScript *NONNULL_PTR arg) { + LDKShutdownScript ret_var = ShutdownScript_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_InitFeatures_clone_ptr(int64_t arg) { - LDKInitFeatures arg_conv; +int64_t CS_LDK_ShutdownScript_clone_ptr(int64_t arg) { + LDKShutdownScript arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = InitFeatures_clone_ptr(&arg_conv); + int64_t ret_conv = ShutdownScript_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_InitFeatures_clone(int64_t orig) { - LDKInitFeatures orig_conv; +int64_t CS_LDK_ShutdownScript_clone(int64_t orig) { + LDKShutdownScript orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKInitFeatures ret_var = InitFeatures_clone(&orig_conv); + LDKShutdownScript ret_var = ShutdownScript_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; } -static inline uint64_t NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg) { - LDKNodeFeatures ret_var = NodeFeatures_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_NodeFeatures_clone_ptr(int64_t arg) { - LDKNodeFeatures arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = NodeFeatures_clone_ptr(&arg_conv); +jboolean CS_LDK_ShutdownScript_eq(int64_t a, int64_t b) { + LDKShutdownScript a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKShutdownScript b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ShutdownScript_eq(&a_conv, &b_conv); return ret_conv; } -int64_t CS_LDK_NodeFeatures_clone(int64_t orig) { - LDKNodeFeatures orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKNodeFeatures ret_var = NodeFeatures_clone(&orig_conv); +void CS_LDK_InvalidShutdownScript_free(int64_t this_obj) { + LDKInvalidShutdownScript this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InvalidShutdownScript_free(this_obj_conv); +} + +int8_tArray CS_LDK_InvalidShutdownScript_get_script(int64_t this_ptr) { + LDKInvalidShutdownScript this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u8Z ret_var = InvalidShutdownScript_get_script(&this_ptr_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +void CS_LDK_InvalidShutdownScript_set_script(int64_t this_ptr, int8_tArray val) { + LDKInvalidShutdownScript this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u8Z val_ref; + val_ref.datalen = val->arr_len; + val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val); + InvalidShutdownScript_set_script(&this_ptr_conv, val_ref); +} + +int64_t CS_LDK_InvalidShutdownScript_new(int8_tArray script_arg) { + LDKCVec_u8Z script_arg_ref; + script_arg_ref.datalen = script_arg->arr_len; + script_arg_ref.data = MALLOC(script_arg_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(script_arg_ref.data, script_arg->elems, script_arg_ref.datalen); FREE(script_arg); + LDKInvalidShutdownScript ret_var = InvalidShutdownScript_new(script_arg_ref); int64_t ret_ref = 0; 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 ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg) { - LDKChannelFeatures ret_var = ChannelFeatures_clone(arg); +static inline uint64_t InvalidShutdownScript_clone_ptr(LDKInvalidShutdownScript *NONNULL_PTR arg) { + LDKInvalidShutdownScript ret_var = InvalidShutdownScript_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_ChannelFeatures_clone_ptr(int64_t arg) { - LDKChannelFeatures arg_conv; +int64_t CS_LDK_InvalidShutdownScript_clone_ptr(int64_t arg) { + LDKInvalidShutdownScript arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = ChannelFeatures_clone_ptr(&arg_conv); + int64_t ret_conv = InvalidShutdownScript_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_ChannelFeatures_clone(int64_t orig) { - LDKChannelFeatures orig_conv; +int64_t CS_LDK_InvalidShutdownScript_clone(int64_t orig) { + LDKInvalidShutdownScript orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKChannelFeatures ret_var = ChannelFeatures_clone(&orig_conv); + LDKInvalidShutdownScript ret_var = InvalidShutdownScript_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; } -static inline uint64_t Bolt11InvoiceFeatures_clone_ptr(LDKBolt11InvoiceFeatures *NONNULL_PTR arg) { - LDKBolt11InvoiceFeatures ret_var = Bolt11InvoiceFeatures_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; +int8_tArray CS_LDK_ShutdownScript_write(int64_t obj) { + LDKShutdownScript obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ShutdownScript_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -int64_t CS_LDK_Bolt11InvoiceFeatures_clone_ptr(int64_t arg) { - LDKBolt11InvoiceFeatures 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 = Bolt11InvoiceFeatures_clone_ptr(&arg_conv); - return ret_conv; + +int64_t CS_LDK_ShutdownScript_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); + *ret_conv = ShutdownScript_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_Bolt11InvoiceFeatures_clone(int64_t orig) { - LDKBolt11InvoiceFeatures 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; - LDKBolt11InvoiceFeatures ret_var = Bolt11InvoiceFeatures_clone(&orig_conv); +int64_t CS_LDK_ShutdownScript_new_p2wpkh(int8_tArray pubkey_hash) { + uint8_t pubkey_hash_arr[20]; + CHECK(pubkey_hash->arr_len == 20); + memcpy(pubkey_hash_arr, pubkey_hash->elems, 20); FREE(pubkey_hash); + uint8_t (*pubkey_hash_ref)[20] = &pubkey_hash_arr; + LDKShutdownScript ret_var = ShutdownScript_new_p2wpkh(pubkey_hash_ref); int64_t ret_ref = 0; 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 OfferFeatures_clone_ptr(LDKOfferFeatures *NONNULL_PTR arg) { - LDKOfferFeatures ret_var = OfferFeatures_clone(arg); +int64_t CS_LDK_ShutdownScript_new_p2wsh(int8_tArray script_hash) { + uint8_t script_hash_arr[32]; + CHECK(script_hash->arr_len == 32); + memcpy(script_hash_arr, script_hash->elems, 32); FREE(script_hash); + uint8_t (*script_hash_ref)[32] = &script_hash_arr; + LDKShutdownScript ret_var = ShutdownScript_new_p2wsh(script_hash_ref); int64_t ret_ref = 0; 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_OfferFeatures_clone_ptr(int64_t arg) { - LDKOfferFeatures arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = OfferFeatures_clone_ptr(&arg_conv); + +int64_t CS_LDK_ShutdownScript_new_witness_program(int64_t witness_program) { + void* witness_program_ptr = untag_ptr(witness_program); + CHECK_ACCESS(witness_program_ptr); + LDKWitnessProgram witness_program_conv = *(LDKWitnessProgram*)(witness_program_ptr); + witness_program_conv = WitnessProgram_clone((LDKWitnessProgram*)untag_ptr(witness_program)); + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); + *ret_conv = ShutdownScript_new_witness_program(witness_program_conv); + return tag_ptr(ret_conv, true); +} + +int8_tArray CS_LDK_ShutdownScript_into_inner(int64_t this_arg) { + LDKShutdownScript this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = ShutdownScript_clone(&this_arg_conv); + LDKCVec_u8Z ret_var = ShutdownScript_into_inner(this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int8_tArray CS_LDK_ShutdownScript_as_legacy_pubkey(int64_t this_arg) { + LDKShutdownScript this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, ShutdownScript_as_legacy_pubkey(&this_arg_conv).compressed_form, 33); + return ret_arr; +} + +jboolean CS_LDK_ShutdownScript_is_compatible(int64_t this_arg, int64_t features) { + LDKShutdownScript this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKInitFeatures features_conv; + features_conv.inner = untag_ptr(features); + features_conv.is_owned = ptr_is_owned(features); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); + features_conv.is_owned = false; + jboolean ret_conv = ShutdownScript_is_compatible(&this_arg_conv, &features_conv); return ret_conv; } -int64_t CS_LDK_OfferFeatures_clone(int64_t orig) { - LDKOfferFeatures orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKOfferFeatures ret_var = OfferFeatures_clone(&orig_conv); +jstring CS_LDK_ShutdownScript_to_str(int64_t o) { + LDKShutdownScript o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = ShutdownScript_to_str(&o_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + 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 InvoiceRequestFeatures_clone_ptr(LDKInvoiceRequestFeatures *NONNULL_PTR arg) { - LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_clone(arg); +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_InvoiceRequestFeatures_clone_ptr(int64_t arg) { - LDKInvoiceRequestFeatures arg_conv; +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 = InvoiceRequestFeatures_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelId_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_InvoiceRequestFeatures_clone(int64_t orig) { - LDKInvoiceRequestFeatures orig_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; - LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_clone(&orig_conv); + 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; } -static inline uint64_t Bolt12InvoiceFeatures_clone_ptr(LDKBolt12InvoiceFeatures *NONNULL_PTR arg) { - LDKBolt12InvoiceFeatures ret_var = Bolt12InvoiceFeatures_clone(arg); +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_Bolt12InvoiceFeatures_clone_ptr(int64_t arg) { - LDKBolt12InvoiceFeatures arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = Bolt12InvoiceFeatures_clone_ptr(&arg_conv); - return ret_conv; -} -int64_t CS_LDK_Bolt12InvoiceFeatures_clone(int64_t orig) { - LDKBolt12InvoiceFeatures orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKBolt12InvoiceFeatures ret_var = Bolt12InvoiceFeatures_clone(&orig_conv); +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; } -static inline uint64_t BlindedHopFeatures_clone_ptr(LDKBlindedHopFeatures *NONNULL_PTR arg) { - LDKBlindedHopFeatures ret_var = BlindedHopFeatures_clone(arg); +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_BlindedHopFeatures_clone_ptr(int64_t arg) { - LDKBlindedHopFeatures arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = BlindedHopFeatures_clone_ptr(&arg_conv); - return ret_conv; -} -int64_t CS_LDK_BlindedHopFeatures_clone(int64_t orig) { - LDKBlindedHopFeatures orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKBlindedHopFeatures ret_var = BlindedHopFeatures_clone(&orig_conv); +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; } -static inline uint64_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg) { - LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(arg); +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; } -int64_t CS_LDK_ChannelTypeFeatures_clone_ptr(int64_t arg) { - LDKChannelTypeFeatures arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = ChannelTypeFeatures_clone_ptr(&arg_conv); + +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_ChannelTypeFeatures_clone(int64_t orig) { - LDKChannelTypeFeatures orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(&orig_conv); +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_InitFeatures_hash(int64_t o) { - LDKInitFeatures o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = InitFeatures_hash(&o_conv); - return ret_conv; +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; } -int64_t CS_LDK_NodeFeatures_hash(int64_t o) { - LDKNodeFeatures o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = NodeFeatures_hash(&o_conv); - return ret_conv; +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_ChannelFeatures_hash(int64_t o) { - LDKChannelFeatures o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = ChannelFeatures_hash(&o_conv); - return ret_conv; +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); } -int64_t CS_LDK_Bolt11InvoiceFeatures_hash(int64_t o) { - LDKBolt11InvoiceFeatures o_conv; +jstring CS_LDK_ChannelId_to_str(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 = Bolt11InvoiceFeatures_hash(&o_conv); + LDKStr ret_str = ChannelId_to_str(&o_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); return ret_conv; } -int64_t CS_LDK_OfferFeatures_hash(int64_t o) { - LDKOfferFeatures o_conv; - 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 = OfferFeatures_hash(&o_conv); - return ret_conv; +int64_t CS_LDK_create_phantom_invoice(int64_t amt_msat, int64_t payment_hash, jstring description, int32_t invoice_expiry_delta_secs, int64_tArray phantom_route_hints, int64_t entropy_source, int64_t node_signer, int64_t logger, int32_t network, int64_t min_final_cltv_expiry_delta, int64_t duration_since_epoch) { + void* amt_msat_ptr = untag_ptr(amt_msat); + CHECK_ACCESS(amt_msat_ptr); + LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); + amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); + void* payment_hash_ptr = untag_ptr(payment_hash); + CHECK_ACCESS(payment_hash_ptr); + LDKCOption_ThirtyTwoBytesZ payment_hash_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_ptr); + payment_hash_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash)); + LDKStr description_conv = str_ref_to_owned_c(description); + LDKCVec_PhantomRouteHintsZ phantom_route_hints_constr; + phantom_route_hints_constr.datalen = phantom_route_hints->arr_len; + if (phantom_route_hints_constr.datalen > 0) + phantom_route_hints_constr.data = MALLOC(phantom_route_hints_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements"); + else + phantom_route_hints_constr.data = NULL; + int64_t* phantom_route_hints_vals = phantom_route_hints->elems; + for (size_t t = 0; t < phantom_route_hints_constr.datalen; t++) { + int64_t phantom_route_hints_conv_19 = phantom_route_hints_vals[t]; + LDKPhantomRouteHints phantom_route_hints_conv_19_conv; + phantom_route_hints_conv_19_conv.inner = untag_ptr(phantom_route_hints_conv_19); + phantom_route_hints_conv_19_conv.is_owned = ptr_is_owned(phantom_route_hints_conv_19); + CHECK_INNER_FIELD_ACCESS_OR_NULL(phantom_route_hints_conv_19_conv); + phantom_route_hints_conv_19_conv = PhantomRouteHints_clone(&phantom_route_hints_conv_19_conv); + phantom_route_hints_constr.data[t] = phantom_route_hints_conv_19_conv; + } + FREE(phantom_route_hints); + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKCurrency network_conv = LDKCurrency_from_cs(network); + void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); + CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); + LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); + min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = create_phantom_invoice(amt_msat_conv, payment_hash_conv, description_conv, invoice_expiry_delta_secs, phantom_route_hints_constr, entropy_source_conv, node_signer_conv, logger_conv, network_conv, min_final_cltv_expiry_delta_conv, duration_since_epoch); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_InvoiceRequestFeatures_hash(int64_t o) { - LDKInvoiceRequestFeatures o_conv; - 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 = InvoiceRequestFeatures_hash(&o_conv); - return ret_conv; +int64_t CS_LDK_create_phantom_invoice_with_description_hash(int64_t amt_msat, int64_t payment_hash, int32_t invoice_expiry_delta_secs, int64_t description_hash, int64_tArray phantom_route_hints, int64_t entropy_source, int64_t node_signer, int64_t logger, int32_t network, int64_t min_final_cltv_expiry_delta, int64_t duration_since_epoch) { + void* amt_msat_ptr = untag_ptr(amt_msat); + CHECK_ACCESS(amt_msat_ptr); + LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); + amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); + void* payment_hash_ptr = untag_ptr(payment_hash); + CHECK_ACCESS(payment_hash_ptr); + LDKCOption_ThirtyTwoBytesZ payment_hash_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_ptr); + payment_hash_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash)); + LDKSha256 description_hash_conv; + description_hash_conv.inner = untag_ptr(description_hash); + description_hash_conv.is_owned = ptr_is_owned(description_hash); + CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv); + description_hash_conv = Sha256_clone(&description_hash_conv); + LDKCVec_PhantomRouteHintsZ phantom_route_hints_constr; + phantom_route_hints_constr.datalen = phantom_route_hints->arr_len; + if (phantom_route_hints_constr.datalen > 0) + phantom_route_hints_constr.data = MALLOC(phantom_route_hints_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements"); + else + phantom_route_hints_constr.data = NULL; + int64_t* phantom_route_hints_vals = phantom_route_hints->elems; + for (size_t t = 0; t < phantom_route_hints_constr.datalen; t++) { + int64_t phantom_route_hints_conv_19 = phantom_route_hints_vals[t]; + LDKPhantomRouteHints phantom_route_hints_conv_19_conv; + phantom_route_hints_conv_19_conv.inner = untag_ptr(phantom_route_hints_conv_19); + phantom_route_hints_conv_19_conv.is_owned = ptr_is_owned(phantom_route_hints_conv_19); + CHECK_INNER_FIELD_ACCESS_OR_NULL(phantom_route_hints_conv_19_conv); + phantom_route_hints_conv_19_conv = PhantomRouteHints_clone(&phantom_route_hints_conv_19_conv); + phantom_route_hints_constr.data[t] = phantom_route_hints_conv_19_conv; + } + FREE(phantom_route_hints); + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKCurrency network_conv = LDKCurrency_from_cs(network); + void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); + CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); + LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); + min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = create_phantom_invoice_with_description_hash(amt_msat_conv, payment_hash_conv, invoice_expiry_delta_secs, description_hash_conv, phantom_route_hints_constr, entropy_source_conv, node_signer_conv, logger_conv, network_conv, min_final_cltv_expiry_delta_conv, duration_since_epoch); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_Bolt12InvoiceFeatures_hash(int64_t o) { - LDKBolt12InvoiceFeatures o_conv; - 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 = Bolt12InvoiceFeatures_hash(&o_conv); - return ret_conv; +int64_t CS_LDK_create_invoice_from_channelmanager(int64_t channelmanager, int64_t node_signer, int64_t logger, int32_t network, int64_t amt_msat, jstring description, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { + LDKChannelManager channelmanager_conv; + channelmanager_conv.inner = untag_ptr(channelmanager); + channelmanager_conv.is_owned = ptr_is_owned(channelmanager); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); + channelmanager_conv.is_owned = false; + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKCurrency network_conv = LDKCurrency_from_cs(network); + void* amt_msat_ptr = untag_ptr(amt_msat); + CHECK_ACCESS(amt_msat_ptr); + LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); + amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); + LDKStr description_conv = str_ref_to_owned_c(description); + void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); + CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); + LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); + min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = create_invoice_from_channelmanager(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_conv, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_BlindedHopFeatures_hash(int64_t o) { - LDKBlindedHopFeatures o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = BlindedHopFeatures_hash(&o_conv); - return ret_conv; +int64_t CS_LDK_create_invoice_from_channelmanager_with_description_hash(int64_t channelmanager, int64_t node_signer, int64_t logger, int32_t network, int64_t amt_msat, int64_t description_hash, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { + LDKChannelManager channelmanager_conv; + channelmanager_conv.inner = untag_ptr(channelmanager); + channelmanager_conv.is_owned = ptr_is_owned(channelmanager); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); + channelmanager_conv.is_owned = false; + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKCurrency network_conv = LDKCurrency_from_cs(network); + void* amt_msat_ptr = untag_ptr(amt_msat); + CHECK_ACCESS(amt_msat_ptr); + LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); + amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); + LDKSha256 description_hash_conv; + description_hash_conv.inner = untag_ptr(description_hash); + description_hash_conv.is_owned = ptr_is_owned(description_hash); + CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv); + description_hash_conv = Sha256_clone(&description_hash_conv); + void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); + CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); + LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); + min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = create_invoice_from_channelmanager_with_description_hash(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_hash_conv, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelTypeFeatures_hash(int64_t o) { - LDKChannelTypeFeatures o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = ChannelTypeFeatures_hash(&o_conv); - return ret_conv; +int64_t CS_LDK_create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(int64_t channelmanager, int64_t node_signer, int64_t logger, int32_t network, int64_t amt_msat, int64_t description_hash, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { + LDKChannelManager channelmanager_conv; + channelmanager_conv.inner = untag_ptr(channelmanager); + channelmanager_conv.is_owned = ptr_is_owned(channelmanager); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); + channelmanager_conv.is_owned = false; + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKCurrency network_conv = LDKCurrency_from_cs(network); + void* amt_msat_ptr = untag_ptr(amt_msat); + CHECK_ACCESS(amt_msat_ptr); + LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); + amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); + LDKSha256 description_hash_conv; + description_hash_conv.inner = untag_ptr(description_hash); + description_hash_conv.is_owned = ptr_is_owned(description_hash); + CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv); + description_hash_conv = Sha256_clone(&description_hash_conv); + void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); + CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); + LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); + min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_hash_conv, duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); + return tag_ptr(ret_conv, true); } -void CS_LDK_InitFeatures_free(int64_t this_obj) { - LDKInitFeatures this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InitFeatures_free(this_obj_conv); +int64_t CS_LDK_create_invoice_from_channelmanager_and_duration_since_epoch(int64_t channelmanager, int64_t node_signer, int64_t logger, int32_t network, int64_t amt_msat, jstring description, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { + LDKChannelManager channelmanager_conv; + channelmanager_conv.inner = untag_ptr(channelmanager); + channelmanager_conv.is_owned = ptr_is_owned(channelmanager); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); + channelmanager_conv.is_owned = false; + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKCurrency network_conv = LDKCurrency_from_cs(network); + void* amt_msat_ptr = untag_ptr(amt_msat); + CHECK_ACCESS(amt_msat_ptr); + LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); + amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); + LDKStr description_conv = str_ref_to_owned_c(description); + void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); + CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); + LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); + min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = create_invoice_from_channelmanager_and_duration_since_epoch(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_conv, duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); + return tag_ptr(ret_conv, true); } -void CS_LDK_NodeFeatures_free(int64_t this_obj) { - LDKNodeFeatures this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - NodeFeatures_free(this_obj_conv); +int64_t CS_LDK_create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(int64_t channelmanager, int64_t node_signer, int64_t logger, int32_t network, int64_t amt_msat, jstring description, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs, int8_tArray payment_hash, int64_t min_final_cltv_expiry_delta) { + LDKChannelManager channelmanager_conv; + channelmanager_conv.inner = untag_ptr(channelmanager); + channelmanager_conv.is_owned = ptr_is_owned(channelmanager); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); + channelmanager_conv.is_owned = false; + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKCurrency network_conv = LDKCurrency_from_cs(network); + void* amt_msat_ptr = untag_ptr(amt_msat); + CHECK_ACCESS(amt_msat_ptr); + LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); + amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); + LDKStr description_conv = str_ref_to_owned_c(description); + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); + CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); + LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); + min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_conv, duration_since_epoch, invoice_expiry_delta_secs, payment_hash_ref, min_final_cltv_expiry_delta_conv); + return tag_ptr(ret_conv, true); } -void CS_LDK_ChannelFeatures_free(int64_t this_obj) { - LDKChannelFeatures this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelFeatures_free(this_obj_conv); +int64_t CS_LDK_payment_parameters_from_zero_amount_invoice(int64_t invoice, int64_t amount_msat) { + LDKBolt11Invoice invoice_conv; + invoice_conv.inner = untag_ptr(invoice); + invoice_conv.is_owned = ptr_is_owned(invoice); + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); + invoice_conv.is_owned = false; + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); + *ret_conv = payment_parameters_from_zero_amount_invoice(&invoice_conv, amount_msat); + return tag_ptr(ret_conv, true); } -void CS_LDK_Bolt11InvoiceFeatures_free(int64_t this_obj) { - LDKBolt11InvoiceFeatures this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Bolt11InvoiceFeatures_free(this_obj_conv); +int64_t CS_LDK_payment_parameters_from_invoice(int64_t invoice) { + LDKBolt11Invoice invoice_conv; + invoice_conv.inner = untag_ptr(invoice); + invoice_conv.is_owned = ptr_is_owned(invoice); + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); + invoice_conv.is_owned = false; + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); + *ret_conv = payment_parameters_from_invoice(&invoice_conv); + return tag_ptr(ret_conv, true); } -void CS_LDK_OfferFeatures_free(int64_t this_obj) { - LDKOfferFeatures this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - OfferFeatures_free(this_obj_conv); +void CS_LDK_Retry_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); + LDKRetry this_ptr_conv = *(LDKRetry*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Retry_free(this_ptr_conv); } -void CS_LDK_InvoiceRequestFeatures_free(int64_t this_obj) { - LDKInvoiceRequestFeatures this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InvoiceRequestFeatures_free(this_obj_conv); +static inline uint64_t Retry_clone_ptr(LDKRetry *NONNULL_PTR arg) { + LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); + *ret_copy = Retry_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } - -void CS_LDK_Bolt12InvoiceFeatures_free(int64_t this_obj) { - LDKBolt12InvoiceFeatures this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Bolt12InvoiceFeatures_free(this_obj_conv); +int64_t CS_LDK_Retry_clone_ptr(int64_t arg) { + LDKRetry* arg_conv = (LDKRetry*)untag_ptr(arg); + int64_t ret_conv = Retry_clone_ptr(arg_conv); + return ret_conv; } -void CS_LDK_BlindedHopFeatures_free(int64_t this_obj) { - LDKBlindedHopFeatures this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BlindedHopFeatures_free(this_obj_conv); +int64_t CS_LDK_Retry_clone(int64_t orig) { + LDKRetry* orig_conv = (LDKRetry*)untag_ptr(orig); + LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); + *ret_copy = Retry_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_ChannelTypeFeatures_free(int64_t this_obj) { - LDKChannelTypeFeatures this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelTypeFeatures_free(this_obj_conv); +int64_t CS_LDK_Retry_attempts(int32_t a) { + LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); + *ret_copy = Retry_attempts(a); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_InitFeatures_empty() { - LDKInitFeatures ret_var = InitFeatures_empty(); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +int64_t CS_LDK_Retry_timeout(int64_t a) { + LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); + *ret_copy = Retry_timeout(a); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -jboolean CS_LDK_InitFeatures_requires_unknown_bits_from(int64_t this_arg, int64_t other) { - 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; - LDKInitFeatures other_conv; - other_conv.inner = untag_ptr(other); - other_conv.is_owned = ptr_is_owned(other); - CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); - other_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); +jboolean CS_LDK_Retry_eq(int64_t a, int64_t b) { + LDKRetry* a_conv = (LDKRetry*)untag_ptr(a); + LDKRetry* b_conv = (LDKRetry*)untag_ptr(b); + jboolean ret_conv = Retry_eq(a_conv, b_conv); return ret_conv; } -jboolean CS_LDK_InitFeatures_requires_unknown_bits(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_unknown_bits(&this_arg_conv); +int64_t CS_LDK_Retry_hash(int64_t o) { + LDKRetry* o_conv = (LDKRetry*)untag_ptr(o); + int64_t ret_conv = Retry_hash(o_conv); return ret_conv; } -int64_t CS_LDK_InitFeatures_set_required_feature_bit(int64_t this_arg, int64_t bit) { - 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; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = InitFeatures_set_required_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_InitFeatures_set_optional_feature_bit(int64_t this_arg, int64_t bit) { - 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; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = InitFeatures_set_optional_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +int8_tArray CS_LDK_Retry_write(int64_t obj) { + LDKRetry* obj_conv = (LDKRetry*)untag_ptr(obj); + LDKCVec_u8Z ret_var = Retry_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_InitFeatures_set_required_custom_bit(int64_t this_arg, int64_t bit) { - 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; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = InitFeatures_set_required_custom_bit(&this_arg_conv, bit); +int64_t CS_LDK_Retry_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_RetryDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RetryDecodeErrorZ), "LDKCResult_RetryDecodeErrorZ"); + *ret_conv = Retry_read(ser_ref); + FREE(ser); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_InitFeatures_set_optional_custom_bit(int64_t this_arg, int64_t bit) { - 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; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = InitFeatures_set_optional_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +int32_t CS_LDK_RetryableSendFailure_clone(int64_t orig) { + LDKRetryableSendFailure* orig_conv = (LDKRetryableSendFailure*)untag_ptr(orig); + int32_t ret_conv = LDKRetryableSendFailure_to_cs(RetryableSendFailure_clone(orig_conv)); + return ret_conv; } -int64_t CS_LDK_NodeFeatures_empty() { - LDKNodeFeatures ret_var = NodeFeatures_empty(); - int64_t ret_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_RetryableSendFailure_payment_expired() { + int32_t ret_conv = LDKRetryableSendFailure_to_cs(RetryableSendFailure_payment_expired()); + return ret_conv; } -jboolean CS_LDK_NodeFeatures_requires_unknown_bits_from(int64_t this_arg, int64_t other) { - 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; - LDKNodeFeatures other_conv; - other_conv.inner = untag_ptr(other); - other_conv.is_owned = ptr_is_owned(other); - CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); - other_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); +int32_t CS_LDK_RetryableSendFailure_route_not_found() { + int32_t ret_conv = LDKRetryableSendFailure_to_cs(RetryableSendFailure_route_not_found()); return ret_conv; } -jboolean CS_LDK_NodeFeatures_requires_unknown_bits(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_unknown_bits(&this_arg_conv); +int32_t CS_LDK_RetryableSendFailure_duplicate_payment() { + int32_t ret_conv = LDKRetryableSendFailure_to_cs(RetryableSendFailure_duplicate_payment()); return ret_conv; } -int64_t CS_LDK_NodeFeatures_set_required_feature_bit(int64_t this_arg, int64_t bit) { - 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; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = NodeFeatures_set_required_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +int32_t CS_LDK_RetryableSendFailure_onion_packet_size_exceeded() { + int32_t ret_conv = LDKRetryableSendFailure_to_cs(RetryableSendFailure_onion_packet_size_exceeded()); + return ret_conv; } -int64_t CS_LDK_NodeFeatures_set_optional_feature_bit(int64_t this_arg, int64_t bit) { - 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; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = NodeFeatures_set_optional_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +jboolean CS_LDK_RetryableSendFailure_eq(int64_t a, int64_t b) { + LDKRetryableSendFailure* a_conv = (LDKRetryableSendFailure*)untag_ptr(a); + LDKRetryableSendFailure* b_conv = (LDKRetryableSendFailure*)untag_ptr(b); + jboolean ret_conv = RetryableSendFailure_eq(a_conv, b_conv); + return ret_conv; } -int64_t CS_LDK_NodeFeatures_set_required_custom_bit(int64_t this_arg, int64_t bit) { - 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; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = NodeFeatures_set_required_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_NodeFeatures_set_optional_custom_bit(int64_t this_arg, int64_t bit) { - 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; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = NodeFeatures_set_optional_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +void CS_LDK_PaymentSendFailure_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); + LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + PaymentSendFailure_free(this_ptr_conv); } -int64_t CS_LDK_ChannelFeatures_empty() { - LDKChannelFeatures ret_var = ChannelFeatures_empty(); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +static inline uint64_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg) { + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } - -jboolean CS_LDK_ChannelFeatures_requires_unknown_bits_from(int64_t this_arg, int64_t other) { - LDKChannelFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelFeatures other_conv; - other_conv.inner = untag_ptr(other); - other_conv.is_owned = ptr_is_owned(other); - CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); - other_conv.is_owned = false; - jboolean ret_conv = ChannelFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); +int64_t CS_LDK_PaymentSendFailure_clone_ptr(int64_t arg) { + LDKPaymentSendFailure* arg_conv = (LDKPaymentSendFailure*)untag_ptr(arg); + int64_t ret_conv = PaymentSendFailure_clone_ptr(arg_conv); return ret_conv; } -jboolean CS_LDK_ChannelFeatures_requires_unknown_bits(int64_t this_arg) { - LDKChannelFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelFeatures_requires_unknown_bits(&this_arg_conv); - return ret_conv; +int64_t CS_LDK_PaymentSendFailure_clone(int64_t orig) { + LDKPaymentSendFailure* orig_conv = (LDKPaymentSendFailure*)untag_ptr(orig); + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_ChannelFeatures_set_required_feature_bit(int64_t this_arg, int64_t bit) { - LDKChannelFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = ChannelFeatures_set_required_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_PaymentSendFailure_parameter_error(int64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKAPIError a_conv = *(LDKAPIError*)(a_ptr); + a_conv = APIError_clone((LDKAPIError*)untag_ptr(a)); + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_parameter_error(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_ChannelFeatures_set_optional_feature_bit(int64_t this_arg, int64_t bit) { - LDKChannelFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = ChannelFeatures_set_optional_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_PaymentSendFailure_path_parameter_error(int64_tArray a) { + LDKCVec_CResult_NoneAPIErrorZZ a_constr; + a_constr.datalen = a->arr_len; + if (a_constr.datalen > 0) + a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements"); + else + a_constr.data = NULL; + int64_t* a_vals = a->elems; + for (size_t w = 0; w < a_constr.datalen; w++) { + int64_t a_conv_22 = a_vals[w]; + void* a_conv_22_ptr = untag_ptr(a_conv_22); + CHECK_ACCESS(a_conv_22_ptr); + LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(a_conv_22_ptr); + a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)untag_ptr(a_conv_22)); + a_constr.data[w] = a_conv_22_conv; + } + FREE(a); + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_path_parameter_error(a_constr); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_ChannelFeatures_set_required_custom_bit(int64_t this_arg, int64_t bit) { - LDKChannelFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = ChannelFeatures_set_required_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_PaymentSendFailure_all_failed_resend_safe(int64_tArray a) { + LDKCVec_APIErrorZ a_constr; + a_constr.datalen = a->arr_len; + if (a_constr.datalen > 0) + a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements"); + else + a_constr.data = NULL; + int64_t* a_vals = a->elems; + for (size_t k = 0; k < a_constr.datalen; k++) { + int64_t a_conv_10 = a_vals[k]; + void* a_conv_10_ptr = untag_ptr(a_conv_10); + CHECK_ACCESS(a_conv_10_ptr); + LDKAPIError a_conv_10_conv = *(LDKAPIError*)(a_conv_10_ptr); + a_conv_10_conv = APIError_clone((LDKAPIError*)untag_ptr(a_conv_10)); + a_constr.data[k] = a_conv_10_conv; + } + FREE(a); + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_all_failed_resend_safe(a_constr); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_ChannelFeatures_set_optional_custom_bit(int64_t this_arg, int64_t bit) { - LDKChannelFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = ChannelFeatures_set_optional_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_PaymentSendFailure_duplicate_payment() { + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_duplicate_payment(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_Bolt11InvoiceFeatures_empty() { - LDKBolt11InvoiceFeatures ret_var = Bolt11InvoiceFeatures_empty(); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +int64_t CS_LDK_PaymentSendFailure_partial_failure(int64_tArray results, int64_t failed_paths_retry, int8_tArray payment_id) { + LDKCVec_CResult_NoneAPIErrorZZ results_constr; + results_constr.datalen = results->arr_len; + if (results_constr.datalen > 0) + results_constr.data = MALLOC(results_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements"); + else + results_constr.data = NULL; + int64_t* results_vals = results->elems; + for (size_t w = 0; w < results_constr.datalen; w++) { + int64_t results_conv_22 = results_vals[w]; + void* results_conv_22_ptr = untag_ptr(results_conv_22); + CHECK_ACCESS(results_conv_22_ptr); + LDKCResult_NoneAPIErrorZ results_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(results_conv_22_ptr); + results_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)untag_ptr(results_conv_22)); + results_constr.data[w] = results_conv_22_conv; + } + FREE(results); + LDKRouteParameters failed_paths_retry_conv; + failed_paths_retry_conv.inner = untag_ptr(failed_paths_retry); + failed_paths_retry_conv.is_owned = ptr_is_owned(failed_paths_retry); + CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_conv); + failed_paths_retry_conv = RouteParameters_clone(&failed_paths_retry_conv); + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_partial_failure(results_constr, failed_paths_retry_conv, payment_id_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -jboolean CS_LDK_Bolt11InvoiceFeatures_requires_unknown_bits_from(int64_t this_arg, int64_t other) { - 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; - LDKBolt11InvoiceFeatures other_conv; - other_conv.inner = untag_ptr(other); - other_conv.is_owned = ptr_is_owned(other); - CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); - other_conv.is_owned = false; - jboolean ret_conv = Bolt11InvoiceFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); +jboolean CS_LDK_PaymentSendFailure_eq(int64_t a, int64_t b) { + LDKPaymentSendFailure* a_conv = (LDKPaymentSendFailure*)untag_ptr(a); + LDKPaymentSendFailure* b_conv = (LDKPaymentSendFailure*)untag_ptr(b); + jboolean ret_conv = PaymentSendFailure_eq(a_conv, b_conv); return ret_conv; } -jboolean CS_LDK_Bolt11InvoiceFeatures_requires_unknown_bits(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_unknown_bits(&this_arg_conv); - return ret_conv; +void CS_LDK_Bolt12PaymentError_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); + LDKBolt12PaymentError this_ptr_conv = *(LDKBolt12PaymentError*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Bolt12PaymentError_free(this_ptr_conv); } -int64_t CS_LDK_Bolt11InvoiceFeatures_set_required_feature_bit(int64_t this_arg, int64_t bit) { - 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; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = Bolt11InvoiceFeatures_set_required_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +static inline uint64_t Bolt12PaymentError_clone_ptr(LDKBolt12PaymentError *NONNULL_PTR arg) { + LDKBolt12PaymentError *ret_copy = MALLOC(sizeof(LDKBolt12PaymentError), "LDKBolt12PaymentError"); + *ret_copy = Bolt12PaymentError_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_Bolt12PaymentError_clone_ptr(int64_t arg) { + LDKBolt12PaymentError* arg_conv = (LDKBolt12PaymentError*)untag_ptr(arg); + int64_t ret_conv = Bolt12PaymentError_clone_ptr(arg_conv); + return ret_conv; } -int64_t CS_LDK_Bolt11InvoiceFeatures_set_optional_feature_bit(int64_t this_arg, int64_t bit) { - 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; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = Bolt11InvoiceFeatures_set_optional_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_Bolt12PaymentError_clone(int64_t orig) { + LDKBolt12PaymentError* orig_conv = (LDKBolt12PaymentError*)untag_ptr(orig); + LDKBolt12PaymentError *ret_copy = MALLOC(sizeof(LDKBolt12PaymentError), "LDKBolt12PaymentError"); + *ret_copy = Bolt12PaymentError_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_Bolt11InvoiceFeatures_set_required_custom_bit(int64_t this_arg, int64_t bit) { - 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; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = Bolt11InvoiceFeatures_set_required_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_Bolt12PaymentError_unexpected_invoice() { + LDKBolt12PaymentError *ret_copy = MALLOC(sizeof(LDKBolt12PaymentError), "LDKBolt12PaymentError"); + *ret_copy = Bolt12PaymentError_unexpected_invoice(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_Bolt11InvoiceFeatures_set_optional_custom_bit(int64_t this_arg, int64_t bit) { - 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; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = Bolt11InvoiceFeatures_set_optional_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_Bolt12PaymentError_duplicate_invoice() { + LDKBolt12PaymentError *ret_copy = MALLOC(sizeof(LDKBolt12PaymentError), "LDKBolt12PaymentError"); + *ret_copy = Bolt12PaymentError_duplicate_invoice(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_OfferFeatures_empty() { - LDKOfferFeatures ret_var = OfferFeatures_empty(); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +int64_t CS_LDK_Bolt12PaymentError_unknown_required_features() { + LDKBolt12PaymentError *ret_copy = MALLOC(sizeof(LDKBolt12PaymentError), "LDKBolt12PaymentError"); + *ret_copy = Bolt12PaymentError_unknown_required_features(); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -jboolean CS_LDK_OfferFeatures_requires_unknown_bits_from(int64_t this_arg, int64_t other) { - LDKOfferFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOfferFeatures other_conv; - other_conv.inner = untag_ptr(other); - other_conv.is_owned = ptr_is_owned(other); - CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); - other_conv.is_owned = false; - jboolean ret_conv = OfferFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); - return ret_conv; +int64_t CS_LDK_Bolt12PaymentError_sending_failed(int32_t a) { + LDKRetryableSendFailure a_conv = LDKRetryableSendFailure_from_cs(a); + LDKBolt12PaymentError *ret_copy = MALLOC(sizeof(LDKBolt12PaymentError), "LDKBolt12PaymentError"); + *ret_copy = Bolt12PaymentError_sending_failed(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_OfferFeatures_requires_unknown_bits(int64_t this_arg) { - LDKOfferFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = OfferFeatures_requires_unknown_bits(&this_arg_conv); +jboolean CS_LDK_Bolt12PaymentError_eq(int64_t a, int64_t b) { + LDKBolt12PaymentError* a_conv = (LDKBolt12PaymentError*)untag_ptr(a); + LDKBolt12PaymentError* b_conv = (LDKBolt12PaymentError*)untag_ptr(b); + jboolean ret_conv = Bolt12PaymentError_eq(a_conv, b_conv); return ret_conv; } -int64_t CS_LDK_OfferFeatures_set_required_feature_bit(int64_t this_arg, int64_t bit) { - LDKOfferFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = OfferFeatures_set_required_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +void CS_LDK_ProbeSendFailure_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); + LDKProbeSendFailure this_ptr_conv = *(LDKProbeSendFailure*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + ProbeSendFailure_free(this_ptr_conv); } -int64_t CS_LDK_OfferFeatures_set_optional_feature_bit(int64_t this_arg, int64_t bit) { - LDKOfferFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = OfferFeatures_set_optional_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +static inline uint64_t ProbeSendFailure_clone_ptr(LDKProbeSendFailure *NONNULL_PTR arg) { + LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); + *ret_copy = ProbeSendFailure_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_ProbeSendFailure_clone_ptr(int64_t arg) { + LDKProbeSendFailure* arg_conv = (LDKProbeSendFailure*)untag_ptr(arg); + int64_t ret_conv = ProbeSendFailure_clone_ptr(arg_conv); + return ret_conv; } -int64_t CS_LDK_OfferFeatures_set_required_custom_bit(int64_t this_arg, int64_t bit) { - LDKOfferFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = OfferFeatures_set_required_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_ProbeSendFailure_clone(int64_t orig) { + LDKProbeSendFailure* orig_conv = (LDKProbeSendFailure*)untag_ptr(orig); + LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); + *ret_copy = ProbeSendFailure_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_OfferFeatures_set_optional_custom_bit(int64_t this_arg, int64_t bit) { - LDKOfferFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = OfferFeatures_set_optional_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_ProbeSendFailure_route_not_found() { + LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); + *ret_copy = ProbeSendFailure_route_not_found(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_InvoiceRequestFeatures_empty() { - LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_empty(); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +int64_t CS_LDK_ProbeSendFailure_sending_failed(int64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKPaymentSendFailure a_conv = *(LDKPaymentSendFailure*)(a_ptr); + a_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(a)); + LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); + *ret_copy = ProbeSendFailure_sending_failed(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -jboolean CS_LDK_InvoiceRequestFeatures_requires_unknown_bits_from(int64_t this_arg, int64_t other) { - LDKInvoiceRequestFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKInvoiceRequestFeatures other_conv; - other_conv.inner = untag_ptr(other); - other_conv.is_owned = ptr_is_owned(other); - CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); - other_conv.is_owned = false; - jboolean ret_conv = InvoiceRequestFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); +jboolean CS_LDK_ProbeSendFailure_eq(int64_t a, int64_t b) { + LDKProbeSendFailure* a_conv = (LDKProbeSendFailure*)untag_ptr(a); + LDKProbeSendFailure* b_conv = (LDKProbeSendFailure*)untag_ptr(b); + jboolean ret_conv = ProbeSendFailure_eq(a_conv, b_conv); return ret_conv; } -jboolean CS_LDK_InvoiceRequestFeatures_requires_unknown_bits(int64_t this_arg) { - LDKInvoiceRequestFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InvoiceRequestFeatures_requires_unknown_bits(&this_arg_conv); - return ret_conv; +void CS_LDK_RecipientOnionFields_free(int64_t this_obj) { + LDKRecipientOnionFields this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + RecipientOnionFields_free(this_obj_conv); } -int64_t CS_LDK_InvoiceRequestFeatures_set_required_feature_bit(int64_t this_arg, int64_t bit) { - LDKInvoiceRequestFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = InvoiceRequestFeatures_set_required_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_RecipientOnionFields_get_payment_secret(int64_t this_ptr) { + LDKRecipientOnionFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); + *ret_copy = RecipientOnionFields_get_payment_secret(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_InvoiceRequestFeatures_set_optional_feature_bit(int64_t this_arg, int64_t bit) { - LDKInvoiceRequestFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = InvoiceRequestFeatures_set_optional_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +void CS_LDK_RecipientOnionFields_set_payment_secret(int64_t this_ptr, int64_t val) { + LDKRecipientOnionFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_ThirtyTwoBytesZ val_conv = *(LDKCOption_ThirtyTwoBytesZ*)(val_ptr); + val_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(val)); + RecipientOnionFields_set_payment_secret(&this_ptr_conv, val_conv); } -int64_t CS_LDK_InvoiceRequestFeatures_set_required_custom_bit(int64_t this_arg, int64_t bit) { - LDKInvoiceRequestFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = InvoiceRequestFeatures_set_required_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_RecipientOnionFields_get_payment_metadata(int64_t this_ptr) { + LDKRecipientOnionFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = RecipientOnionFields_get_payment_metadata(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_InvoiceRequestFeatures_set_optional_custom_bit(int64_t this_arg, int64_t bit) { - LDKInvoiceRequestFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = InvoiceRequestFeatures_set_optional_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +void CS_LDK_RecipientOnionFields_set_payment_metadata(int64_t this_ptr, int64_t val) { + LDKRecipientOnionFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_CVec_u8ZZ val_conv = *(LDKCOption_CVec_u8ZZ*)(val_ptr); + val_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(val)); + RecipientOnionFields_set_payment_metadata(&this_ptr_conv, val_conv); } -int64_t CS_LDK_Bolt12InvoiceFeatures_empty() { - LDKBolt12InvoiceFeatures ret_var = Bolt12InvoiceFeatures_empty(); +static inline uint64_t RecipientOnionFields_clone_ptr(LDKRecipientOnionFields *NONNULL_PTR arg) { + LDKRecipientOnionFields ret_var = RecipientOnionFields_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; } - -jboolean CS_LDK_Bolt12InvoiceFeatures_requires_unknown_bits_from(int64_t this_arg, int64_t other) { - LDKBolt12InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKBolt12InvoiceFeatures other_conv; - other_conv.inner = untag_ptr(other); - other_conv.is_owned = ptr_is_owned(other); - CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); - other_conv.is_owned = false; - jboolean ret_conv = Bolt12InvoiceFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); - return ret_conv; -} - -jboolean CS_LDK_Bolt12InvoiceFeatures_requires_unknown_bits(int64_t this_arg) { - LDKBolt12InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = Bolt12InvoiceFeatures_requires_unknown_bits(&this_arg_conv); +int64_t CS_LDK_RecipientOnionFields_clone_ptr(int64_t arg) { + LDKRecipientOnionFields arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = RecipientOnionFields_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_Bolt12InvoiceFeatures_set_required_feature_bit(int64_t this_arg, int64_t bit) { - LDKBolt12InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = Bolt12InvoiceFeatures_set_required_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_Bolt12InvoiceFeatures_set_optional_feature_bit(int64_t this_arg, int64_t bit) { - LDKBolt12InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = Bolt12InvoiceFeatures_set_optional_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_Bolt12InvoiceFeatures_set_required_custom_bit(int64_t this_arg, int64_t bit) { - LDKBolt12InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = Bolt12InvoiceFeatures_set_required_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_Bolt12InvoiceFeatures_set_optional_custom_bit(int64_t this_arg, int64_t bit) { - LDKBolt12InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = Bolt12InvoiceFeatures_set_optional_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_BlindedHopFeatures_empty() { - LDKBlindedHopFeatures ret_var = BlindedHopFeatures_empty(); +int64_t CS_LDK_RecipientOnionFields_clone(int64_t orig) { + LDKRecipientOnionFields orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKRecipientOnionFields ret_var = RecipientOnionFields_clone(&orig_conv); int64_t ret_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_BlindedHopFeatures_requires_unknown_bits_from(int64_t this_arg, int64_t other) { - LDKBlindedHopFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKBlindedHopFeatures other_conv; - other_conv.inner = untag_ptr(other); - other_conv.is_owned = ptr_is_owned(other); - CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); - other_conv.is_owned = false; - jboolean ret_conv = BlindedHopFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); - return ret_conv; -} - -jboolean CS_LDK_BlindedHopFeatures_requires_unknown_bits(int64_t this_arg) { - LDKBlindedHopFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = BlindedHopFeatures_requires_unknown_bits(&this_arg_conv); +jboolean CS_LDK_RecipientOnionFields_eq(int64_t a, int64_t b) { + LDKRecipientOnionFields a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKRecipientOnionFields b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = RecipientOnionFields_eq(&a_conv, &b_conv); return ret_conv; } -int64_t CS_LDK_BlindedHopFeatures_set_required_feature_bit(int64_t this_arg, int64_t bit) { - LDKBlindedHopFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = BlindedHopFeatures_set_required_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_BlindedHopFeatures_set_optional_feature_bit(int64_t this_arg, int64_t bit) { - LDKBlindedHopFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = BlindedHopFeatures_set_optional_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +int8_tArray CS_LDK_RecipientOnionFields_write(int64_t obj) { + LDKRecipientOnionFields obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = RecipientOnionFields_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -int64_t CS_LDK_BlindedHopFeatures_set_required_custom_bit(int64_t this_arg, int64_t bit) { - LDKBlindedHopFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = BlindedHopFeatures_set_required_custom_bit(&this_arg_conv, bit); +int64_t CS_LDK_RecipientOnionFields_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_RecipientOnionFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsDecodeErrorZ), "LDKCResult_RecipientOnionFieldsDecodeErrorZ"); + *ret_conv = RecipientOnionFields_read(ser_ref); + FREE(ser); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_BlindedHopFeatures_set_optional_custom_bit(int64_t this_arg, int64_t bit) { - LDKBlindedHopFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = BlindedHopFeatures_set_optional_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_RecipientOnionFields_secret_only(int8_tArray payment_secret) { + LDKThirtyTwoBytes payment_secret_ref; + CHECK(payment_secret->arr_len == 32); + memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret); + LDKRecipientOnionFields ret_var = RecipientOnionFields_secret_only(payment_secret_ref); + int64_t ret_ref = 0; + 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_ChannelTypeFeatures_empty() { - LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_empty(); +int64_t CS_LDK_RecipientOnionFields_spontaneous_empty() { + LDKRecipientOnionFields ret_var = RecipientOnionFields_spontaneous_empty(); int64_t ret_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_ChannelTypeFeatures_requires_unknown_bits_from(int64_t this_arg, int64_t other) { - LDKChannelTypeFeatures this_arg_conv; +int64_t CS_LDK_RecipientOnionFields_with_custom_tlvs(int64_t this_arg, int64_tArray custom_tlvs) { + LDKRecipientOnionFields this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelTypeFeatures other_conv; - other_conv.inner = untag_ptr(other); - other_conv.is_owned = ptr_is_owned(other); - CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); - other_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); - return ret_conv; + this_arg_conv = RecipientOnionFields_clone(&this_arg_conv); + LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs_constr; + custom_tlvs_constr.datalen = custom_tlvs->arr_len; + if (custom_tlvs_constr.datalen > 0) + custom_tlvs_constr.data = MALLOC(custom_tlvs_constr.datalen * sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKCVec_C2Tuple_u64CVec_u8ZZZ Elements"); + else + custom_tlvs_constr.data = NULL; + int64_t* custom_tlvs_vals = custom_tlvs->elems; + for (size_t x = 0; x < custom_tlvs_constr.datalen; x++) { + int64_t custom_tlvs_conv_23 = custom_tlvs_vals[x]; + void* custom_tlvs_conv_23_ptr = untag_ptr(custom_tlvs_conv_23); + CHECK_ACCESS(custom_tlvs_conv_23_ptr); + LDKC2Tuple_u64CVec_u8ZZ custom_tlvs_conv_23_conv = *(LDKC2Tuple_u64CVec_u8ZZ*)(custom_tlvs_conv_23_ptr); + custom_tlvs_conv_23_conv = C2Tuple_u64CVec_u8ZZ_clone((LDKC2Tuple_u64CVec_u8ZZ*)untag_ptr(custom_tlvs_conv_23)); + custom_tlvs_constr.data[x] = custom_tlvs_conv_23_conv; + } + FREE(custom_tlvs); + LDKCResult_RecipientOnionFieldsNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsNoneZ), "LDKCResult_RecipientOnionFieldsNoneZ"); + *ret_conv = RecipientOnionFields_with_custom_tlvs(this_arg_conv, custom_tlvs_constr); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_ChannelTypeFeatures_requires_unknown_bits(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +int64_tArray CS_LDK_RecipientOnionFields_custom_tlvs(int64_t this_arg) { + LDKRecipientOnionFields this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_requires_unknown_bits(&this_arg_conv); - return ret_conv; + LDKCVec_C2Tuple_u64CVec_u8ZZZ ret_var = RecipientOnionFields_custom_tlvs(&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 x = 0; x < ret_var.datalen; x++) { + LDKC2Tuple_u64CVec_u8ZZ* ret_conv_23_conv = MALLOC(sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKC2Tuple_u64CVec_u8ZZ"); + *ret_conv_23_conv = ret_var.data[x]; + ret_arr_ptr[x] = tag_ptr(ret_conv_23_conv, true); + } + + FREE(ret_var.data); + return ret_arr; } -int64_t CS_LDK_ChannelTypeFeatures_set_required_feature_bit(int64_t this_arg, int64_t bit) { - LDKChannelTypeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = ChannelTypeFeatures_set_required_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +void CS_LDK_CustomMessageReader_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); + LDKCustomMessageReader this_ptr_conv = *(LDKCustomMessageReader*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + CustomMessageReader_free(this_ptr_conv); } -int64_t CS_LDK_ChannelTypeFeatures_set_optional_feature_bit(int64_t this_arg, int64_t bit) { - LDKChannelTypeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = ChannelTypeFeatures_set_optional_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +static inline uint64_t Type_clone_ptr(LDKType *NONNULL_PTR arg) { + LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType"); + *ret_ret = Type_clone(arg); + return tag_ptr(ret_ret, true); } - -int64_t CS_LDK_ChannelTypeFeatures_set_required_custom_bit(int64_t this_arg, int64_t bit) { - LDKChannelTypeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = ChannelTypeFeatures_set_required_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_Type_clone_ptr(int64_t arg) { + void* arg_ptr = untag_ptr(arg); + if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); } + LDKType* arg_conv = (LDKType*)arg_ptr; + int64_t ret_conv = Type_clone_ptr(arg_conv); + return ret_conv; } -int64_t CS_LDK_ChannelTypeFeatures_set_optional_custom_bit(int64_t this_arg, int64_t bit) { - LDKChannelTypeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = ChannelTypeFeatures_set_optional_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_Type_clone(int64_t orig) { + void* orig_ptr = untag_ptr(orig); + if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); } + LDKType* orig_conv = (LDKType*)orig_ptr; + LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType"); + *ret_ret = Type_clone(orig_conv); + return tag_ptr(ret_ret, true); } -int8_tArray CS_LDK_InitFeatures_write(int64_t obj) { - LDKInitFeatures obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = InitFeatures_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +void CS_LDK_Type_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); + LDKType this_ptr_conv = *(LDKType*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Type_free(this_ptr_conv); } -int64_t CS_LDK_InitFeatures_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); - *ret_conv = InitFeatures_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +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_ChannelFeatures_write(int64_t obj) { - LDKChannelFeatures obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ChannelFeatures_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); +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; } -int64_t CS_LDK_ChannelFeatures_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); - *ret_conv = ChannelFeatures_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +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); } -int8_tArray CS_LDK_NodeFeatures_write(int64_t obj) { - LDKNodeFeatures obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = NodeFeatures_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +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; } -int64_t CS_LDK_NodeFeatures_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); - *ret_conv = NodeFeatures_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +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; } -int8_tArray CS_LDK_Bolt11InvoiceFeatures_write(int64_t obj) { - LDKBolt11InvoiceFeatures 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 = Bolt11InvoiceFeatures_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_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; } -int64_t CS_LDK_Bolt11InvoiceFeatures_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ"); - *ret_conv = Bolt11InvoiceFeatures_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +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_Bolt12InvoiceFeatures_write(int64_t obj) { - LDKBolt12InvoiceFeatures obj_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 = Bolt12InvoiceFeatures_write(&obj_conv); + 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_Bolt12InvoiceFeatures_read(int8_tArray ser) { +int64_t CS_LDK_OfferId_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ"); - *ret_conv = Bolt12InvoiceFeatures_read(ser_ref); + LDKCResult_OfferIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferIdDecodeErrorZ), "LDKCResult_OfferIdDecodeErrorZ"); + *ret_conv = OfferId_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -int8_tArray CS_LDK_BlindedHopFeatures_write(int64_t obj) { - LDKBlindedHopFeatures obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = BlindedHopFeatures_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +void 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); } -int64_t CS_LDK_BlindedHopFeatures_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ"); - *ret_conv = BlindedHopFeatures_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +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; } -int8_tArray CS_LDK_ChannelTypeFeatures_write(int64_t obj) { - LDKChannelTypeFeatures obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ChannelTypeFeatures_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +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; } -int64_t CS_LDK_ChannelTypeFeatures_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); - *ret_conv = ChannelTypeFeatures_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void 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); } -void CS_LDK_InitFeatures_set_data_loss_protect_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_data_loss_protect_optional(&this_arg_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; } -void CS_LDK_InitFeatures_set_data_loss_protect_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_data_loss_protect_required(&this_arg_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; } -jboolean CS_LDK_InitFeatures_supports_data_loss_protect(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_data_loss_protect(&this_arg_conv); - return ret_conv; +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; } -void CS_LDK_NodeFeatures_set_data_loss_protect_optional(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +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.is_owned = false; - NodeFeatures_set_data_loss_protect_optional(&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_NodeFeatures_set_data_loss_protect_required(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +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.is_owned = false; - NodeFeatures_set_data_loss_protect_required(&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); } -jboolean CS_LDK_NodeFeatures_supports_data_loss_protect(int64_t this_arg) { - LDKNodeFeatures this_arg_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.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_data_loss_protect(&this_arg_conv); - return ret_conv; + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + OfferWithExplicitMetadataBuilder_amount_msats(this_arg_conv, amount_msats); } -jboolean CS_LDK_InitFeatures_requires_data_loss_protect(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +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.is_owned = false; - jboolean ret_conv = InitFeatures_requires_data_loss_protect(&this_arg_conv); - return ret_conv; + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + OfferWithExplicitMetadataBuilder_absolute_expiry(this_arg_conv, absolute_expiry); } -jboolean CS_LDK_NodeFeatures_requires_data_loss_protect(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +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.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_data_loss_protect(&this_arg_conv); - return ret_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_InitFeatures_set_initial_routing_sync_optional(int64_t this_arg) { - LDKInitFeatures this_arg_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.is_owned = false; - InitFeatures_set_initial_routing_sync_optional(&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_InitFeatures_set_initial_routing_sync_required(int64_t this_arg) { - LDKInitFeatures this_arg_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.is_owned = false; - InitFeatures_set_initial_routing_sync_required(&this_arg_conv); + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + LDKBlindedMessagePath 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 = BlindedMessagePath_clone(&path_conv); + OfferWithExplicitMetadataBuilder_path(this_arg_conv, path_conv); } -jboolean CS_LDK_InitFeatures_initial_routing_sync(int64_t this_arg) { - LDKInitFeatures this_arg_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.is_owned = false; - jboolean ret_conv = InitFeatures_initial_routing_sync(&this_arg_conv); - return ret_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); } -void CS_LDK_InitFeatures_set_upfront_shutdown_script_optional(int64_t this_arg) { - LDKInitFeatures this_arg_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.is_owned = false; - InitFeatures_set_upfront_shutdown_script_optional(&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); } -void CS_LDK_InitFeatures_set_upfront_shutdown_script_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_upfront_shutdown_script_required(&this_arg_conv); +int64_t CS_LDK_OfferWithDerivedMetadataBuilder_deriving_signing_pubkey(int8_tArray node_id, int64_t expanded_key, int64_t nonce) { + 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; + LDKNonce nonce_conv; + nonce_conv.inner = untag_ptr(nonce); + nonce_conv.is_owned = ptr_is_owned(nonce); + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_conv); + nonce_conv = Nonce_clone(&nonce_conv); + LDKOfferWithDerivedMetadataBuilder ret_var = OfferWithDerivedMetadataBuilder_deriving_signing_pubkey(node_id_ref, &expanded_key_conv, nonce_conv); + int64_t ret_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_InitFeatures_supports_upfront_shutdown_script(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +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.is_owned = false; - jboolean ret_conv = InitFeatures_supports_upfront_shutdown_script(&this_arg_conv); - return ret_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_NodeFeatures_set_upfront_shutdown_script_optional(int64_t this_arg) { - LDKNodeFeatures this_arg_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.is_owned = false; - NodeFeatures_set_upfront_shutdown_script_optional(&this_arg_conv); + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + OfferWithDerivedMetadataBuilder_amount_msats(this_arg_conv, amount_msats); } -void CS_LDK_NodeFeatures_set_upfront_shutdown_script_required(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +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.is_owned = false; - NodeFeatures_set_upfront_shutdown_script_required(&this_arg_conv); + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + OfferWithDerivedMetadataBuilder_absolute_expiry(this_arg_conv, absolute_expiry); } -jboolean CS_LDK_NodeFeatures_supports_upfront_shutdown_script(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +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.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_upfront_shutdown_script(&this_arg_conv); - return ret_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); } -jboolean CS_LDK_InitFeatures_requires_upfront_shutdown_script(int64_t this_arg) { - LDKInitFeatures this_arg_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.is_owned = false; - jboolean ret_conv = InitFeatures_requires_upfront_shutdown_script(&this_arg_conv); - return ret_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); } -jboolean CS_LDK_NodeFeatures_requires_upfront_shutdown_script(int64_t this_arg) { - LDKNodeFeatures this_arg_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.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_upfront_shutdown_script(&this_arg_conv); - return ret_conv; + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKBlindedMessagePath 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 = BlindedMessagePath_clone(&path_conv); + OfferWithDerivedMetadataBuilder_path(this_arg_conv, path_conv); } -void CS_LDK_InitFeatures_set_gossip_queries_optional(int64_t this_arg) { - LDKInitFeatures this_arg_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.is_owned = false; - InitFeatures_set_gossip_queries_optional(&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); } -void CS_LDK_InitFeatures_set_gossip_queries_required(int64_t this_arg) { - LDKInitFeatures this_arg_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.is_owned = false; - InitFeatures_set_gossip_queries_required(&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); } -jboolean CS_LDK_InitFeatures_supports_gossip_queries(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_gossip_queries(&this_arg_conv); +void CS_LDK_Offer_free(int64_t this_obj) { + LDKOffer this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Offer_free(this_obj_conv); +} + +static inline uint64_t Offer_clone_ptr(LDKOffer *NONNULL_PTR arg) { + LDKOffer ret_var = Offer_clone(arg); + int64_t ret_ref = 0; + 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_clone_ptr(int64_t arg) { + LDKOffer arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = Offer_clone_ptr(&arg_conv); return ret_conv; } -void CS_LDK_NodeFeatures_set_gossip_queries_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_gossip_queries_optional(&this_arg_conv); +int64_t CS_LDK_Offer_clone(int64_t orig) { + LDKOffer orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKOffer ret_var = Offer_clone(&orig_conv); + int64_t ret_ref = 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_NodeFeatures_set_gossip_queries_required(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +ptrArray CS_LDK_Offer_chains(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; - NodeFeatures_set_gossip_queries_required(&this_arg_conv); + LDKCVec_ThirtyTwoBytesZ ret_var = Offer_chains(&this_arg_conv); + ptrArray ret_arr = NULL; + ret_arr = init_ptrArray(ret_var.datalen, __LINE__); + int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8); + for (size_t i = 0; i < ret_var.datalen; i++) { + int8_tArray ret_conv_8_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_conv_8_arr->elems, ret_var.data[i].data, 32); + ret_arr_ptr[i] = ret_conv_8_arr; + } + + FREE(ret_var.data); + return ret_arr; } -jboolean CS_LDK_NodeFeatures_supports_gossip_queries(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_Offer_metadata(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; - jboolean ret_conv = NodeFeatures_supports_gossip_queries(&this_arg_conv); - return ret_conv; + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = Offer_metadata(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_InitFeatures_requires_gossip_queries(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_Offer_amount(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; - jboolean ret_conv = InitFeatures_requires_gossip_queries(&this_arg_conv); - return ret_conv; + 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; } -jboolean CS_LDK_NodeFeatures_requires_gossip_queries(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_Offer_description(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; - jboolean ret_conv = NodeFeatures_requires_gossip_queries(&this_arg_conv); - return ret_conv; + LDKPrintableString ret_var = Offer_description(&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_InitFeatures_set_variable_length_onion_optional(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_Offer_offer_features(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; - InitFeatures_set_variable_length_onion_optional(&this_arg_conv); + LDKOfferFeatures ret_var = Offer_offer_features(&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_InitFeatures_set_variable_length_onion_required(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_Offer_absolute_expiry(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; - InitFeatures_set_variable_length_onion_required(&this_arg_conv); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = Offer_absolute_expiry(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_InitFeatures_supports_variable_length_onion(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_Offer_issuer(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; - jboolean ret_conv = InitFeatures_supports_variable_length_onion(&this_arg_conv); - return ret_conv; + LDKPrintableString ret_var = Offer_issuer(&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_NodeFeatures_set_variable_length_onion_optional(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_tArray CS_LDK_Offer_paths(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; - NodeFeatures_set_variable_length_onion_optional(&this_arg_conv); + LDKCVec_BlindedMessagePathZ ret_var = Offer_paths(&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 u = 0; u < ret_var.datalen; u++) { + LDKBlindedMessagePath ret_conv_20_var = ret_var.data[u]; + int64_t ret_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_20_var); + ret_conv_20_ref = tag_ptr(ret_conv_20_var.inner, ret_conv_20_var.is_owned); + ret_arr_ptr[u] = ret_conv_20_ref; + } + + FREE(ret_var.data); + return ret_arr; } -void CS_LDK_NodeFeatures_set_variable_length_onion_required(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_Offer_supported_quantity(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; - NodeFeatures_set_variable_length_onion_required(&this_arg_conv); + 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; } -jboolean CS_LDK_NodeFeatures_supports_variable_length_onion(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int8_tArray CS_LDK_Offer_signing_pubkey(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; - jboolean ret_conv = NodeFeatures_supports_variable_length_onion(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, Offer_signing_pubkey(&this_arg_conv).compressed_form, 33); + return ret_arr; } -void CS_LDK_Bolt11InvoiceFeatures_set_variable_length_onion_optional(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +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; - Bolt11InvoiceFeatures_set_variable_length_onion_optional(&this_arg_conv); + 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; } -void CS_LDK_Bolt11InvoiceFeatures_set_variable_length_onion_required(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +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); this_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_variable_length_onion_required(&this_arg_conv); + LDKThirtyTwoBytes chain_ref; + CHECK(chain->arr_len == 32); + memcpy(chain_ref.data, chain->elems, 32); FREE(chain); + jboolean ret_conv = Offer_supports_chain(&this_arg_conv, chain_ref); + return ret_conv; } -jboolean CS_LDK_Bolt11InvoiceFeatures_supports_variable_length_onion(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +jboolean CS_LDK_Offer_is_expired(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; - jboolean ret_conv = Bolt11InvoiceFeatures_supports_variable_length_onion(&this_arg_conv); + jboolean ret_conv = Offer_is_expired(&this_arg_conv); return ret_conv; } -jboolean CS_LDK_InitFeatures_requires_variable_length_onion(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +jboolean CS_LDK_Offer_is_expired_no_std(int64_t this_arg, int64_t duration_since_epoch) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_variable_length_onion(&this_arg_conv); + jboolean ret_conv = Offer_is_expired_no_std(&this_arg_conv, duration_since_epoch); return ret_conv; } -jboolean CS_LDK_NodeFeatures_requires_variable_length_onion(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +jboolean CS_LDK_Offer_is_valid_quantity(int64_t this_arg, int64_t quantity) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_variable_length_onion(&this_arg_conv); + jboolean ret_conv = Offer_is_valid_quantity(&this_arg_conv, quantity); return ret_conv; } -jboolean CS_LDK_Bolt11InvoiceFeatures_requires_variable_length_onion(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +jboolean CS_LDK_Offer_expects_quantity(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; - jboolean ret_conv = Bolt11InvoiceFeatures_requires_variable_length_onion(&this_arg_conv); + jboolean ret_conv = Offer_expects_quantity(&this_arg_conv); return ret_conv; } -void CS_LDK_InitFeatures_set_static_remote_key_optional(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_Offer_request_invoice_deriving_payer_id(int64_t this_arg, int64_t expanded_key, int64_t nonce, 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; - InitFeatures_set_static_remote_key_optional(&this_arg_conv); + 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; + LDKNonce nonce_conv; + nonce_conv.inner = untag_ptr(nonce); + nonce_conv.is_owned = ptr_is_owned(nonce); + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_conv); + nonce_conv = Nonce_clone(&nonce_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, nonce_conv, payment_id_ref); + return tag_ptr(ret_conv, true); } -void CS_LDK_InitFeatures_set_static_remote_key_required(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_Offer_request_invoice_deriving_metadata(int64_t this_arg, int8_tArray payer_id, int64_t expanded_key, int64_t nonce, 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; - InitFeatures_set_static_remote_key_required(&this_arg_conv); + 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; + LDKNonce nonce_conv; + nonce_conv.inner = untag_ptr(nonce); + nonce_conv.is_owned = ptr_is_owned(nonce); + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_conv); + nonce_conv = Nonce_clone(&nonce_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, nonce_conv, payment_id_ref); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_InitFeatures_supports_static_remote_key(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +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; - jboolean ret_conv = InitFeatures_supports_static_remote_key(&this_arg_conv); - return ret_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); + 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); } -void CS_LDK_NodeFeatures_set_static_remote_key_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_static_remote_key_optional(&this_arg_conv); +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; } -void CS_LDK_NodeFeatures_set_static_remote_key_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_static_remote_key_required(&this_arg_conv); +int64_t CS_LDK_Offer_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_OfferDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferDecodeErrorZ), "LDKCResult_OfferDecodeErrorZ"); + *ret_conv = Offer_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_NodeFeatures_supports_static_remote_key(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_static_remote_key(&this_arg_conv); +int8_tArray CS_LDK_Offer_write(int64_t obj) { + LDKOffer obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = Offer_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +void 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_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 = (LDKAmount*)untag_ptr(arg); + int64_t ret_conv = Amount_clone_ptr(arg_conv); return ret_conv; } -void CS_LDK_ChannelTypeFeatures_set_static_remote_key_optional(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +int64_t CS_LDK_Amount_clone(int64_t orig) { + 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_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); +} + +jstring CS_LDK_Offer_to_str(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; + LDKStr ret_str = Offer_to_str(&o_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +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); + InvoiceWithExplicitSigningPubkeyBuilder_free(this_obj_conv); +} + +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); - this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_static_remote_key_optional(&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_ChannelTypeFeatures_set_static_remote_key_required(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +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); - this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_static_remote_key_required(&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); } -jboolean CS_LDK_ChannelTypeFeatures_supports_static_remote_key(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +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); - this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_supports_static_remote_key(&this_arg_conv); - return ret_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); } -jboolean CS_LDK_InitFeatures_requires_static_remote_key(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +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); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_static_remote_key(&this_arg_conv); - return ret_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); } -jboolean CS_LDK_NodeFeatures_requires_static_remote_key(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +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); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_static_remote_key(&this_arg_conv); - return ret_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); } -jboolean CS_LDK_ChannelTypeFeatures_requires_static_remote_key(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +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); - this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_requires_static_remote_key(&this_arg_conv); - return ret_conv; + // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder + + InvoiceWithExplicitSigningPubkeyBuilder_allow_mpp(this_arg_conv); } -void CS_LDK_InitFeatures_set_payment_secret_optional(int64_t this_arg) { - LDKInitFeatures 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); - this_arg_conv.is_owned = false; - InitFeatures_set_payment_secret_optional(&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_InitFeatures_set_payment_secret_required(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +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); - this_arg_conv.is_owned = false; - InitFeatures_set_payment_secret_required(&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); } -jboolean CS_LDK_InitFeatures_supports_payment_secret(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +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); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_payment_secret(&this_arg_conv); - return ret_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_NodeFeatures_set_payment_secret_optional(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +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); - this_arg_conv.is_owned = false; - NodeFeatures_set_payment_secret_optional(&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_NodeFeatures_set_payment_secret_required(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +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); - this_arg_conv.is_owned = false; - NodeFeatures_set_payment_secret_required(&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); } -jboolean CS_LDK_NodeFeatures_supports_payment_secret(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +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); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_payment_secret(&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_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 = UnsignedBolt12Invoice_clone_ptr(&arg_conv); return ret_conv; } -void CS_LDK_Bolt11InvoiceFeatures_set_payment_secret_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_payment_secret_optional(&this_arg_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; + 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; } -void CS_LDK_Bolt11InvoiceFeatures_set_payment_secret_required(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_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) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_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_payment_secret_required(&this_arg_conv); + LDKTaggedHash ret_var = UnsignedBolt12Invoice_tagged_hash(&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_Bolt11InvoiceFeatures_supports_payment_secret(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +void CS_LDK_Bolt12Invoice_free(int64_t this_obj) { + LDKBolt12Invoice this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Bolt12Invoice_free(this_obj_conv); +} + +static inline uint64_t Bolt12Invoice_clone_ptr(LDKBolt12Invoice *NONNULL_PTR arg) { + LDKBolt12Invoice ret_var = Bolt12Invoice_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_Bolt12Invoice_clone_ptr(int64_t arg) { + LDKBolt12Invoice 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 = Bolt12Invoice_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_Bolt12Invoice_clone(int64_t orig) { + LDKBolt12Invoice 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; + LDKBolt12Invoice ret_var = Bolt12Invoice_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_UnsignedBolt12Invoice_created_at(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_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_payment_secret(&this_arg_conv); + int64_t ret_conv = UnsignedBolt12Invoice_created_at(&this_arg_conv); return ret_conv; } -jboolean CS_LDK_InitFeatures_requires_payment_secret(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_UnsignedBolt12Invoice_relative_expiry(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_payment_secret(&this_arg_conv); + int64_t ret_conv = UnsignedBolt12Invoice_relative_expiry(&this_arg_conv); return ret_conv; } -jboolean CS_LDK_NodeFeatures_requires_payment_secret(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +jboolean CS_LDK_UnsignedBolt12Invoice_is_expired(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_payment_secret(&this_arg_conv); + jboolean ret_conv = UnsignedBolt12Invoice_is_expired(&this_arg_conv); return ret_conv; } -jboolean CS_LDK_Bolt11InvoiceFeatures_requires_payment_secret(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +ptrArray CS_LDK_UnsignedBolt12Invoice_fallbacks(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_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_payment_secret(&this_arg_conv); - return ret_conv; + LDKCVec_StrZ ret_var = UnsignedBolt12Invoice_fallbacks(&this_arg_conv); + ptrArray ret_arr = NULL; + ret_arr = init_ptrArray(ret_var.datalen, __LINE__); + jstring *ret_arr_ptr = (jstring*)(((uint8_t*)ret_arr) + 8); + for (size_t i = 0; i < ret_var.datalen; i++) { + LDKStr ret_conv_8_str = ret_var.data[i]; + jstring ret_conv_8_conv = str_ref_to_cs(ret_conv_8_str.chars, ret_conv_8_str.len); + Str_free(ret_conv_8_str); + ret_arr_ptr[i] = ret_conv_8_conv; + } + + FREE(ret_var.data); + return ret_arr; } -void CS_LDK_InitFeatures_set_basic_mpp_optional(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_UnsignedBolt12Invoice_invoice_features(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_basic_mpp_optional(&this_arg_conv); + LDKBolt12InvoiceFeatures ret_var = UnsignedBolt12Invoice_invoice_features(&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_InitFeatures_set_basic_mpp_required(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int8_tArray CS_LDK_UnsignedBolt12Invoice_signing_pubkey(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_basic_mpp_required(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, UnsignedBolt12Invoice_signing_pubkey(&this_arg_conv).compressed_form, 33); + return ret_arr; } -jboolean CS_LDK_InitFeatures_supports_basic_mpp(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_UnsignedBolt12Invoice_offer_chains(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_basic_mpp(&this_arg_conv); - return ret_conv; + LDKCOption_CVec_ThirtyTwoBytesZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_ThirtyTwoBytesZZ), "LDKCOption_CVec_ThirtyTwoBytesZZ"); + *ret_copy = UnsignedBolt12Invoice_offer_chains(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_NodeFeatures_set_basic_mpp_optional(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int8_tArray CS_LDK_UnsignedBolt12Invoice_chain(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_basic_mpp_optional(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, UnsignedBolt12Invoice_chain(&this_arg_conv).data, 32); + return ret_arr; } -void CS_LDK_NodeFeatures_set_basic_mpp_required(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_UnsignedBolt12Invoice_metadata(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_basic_mpp_required(&this_arg_conv); + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = UnsignedBolt12Invoice_metadata(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_NodeFeatures_supports_basic_mpp(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_UnsignedBolt12Invoice_amount(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_basic_mpp(&this_arg_conv); - return ret_conv; + 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; } -void CS_LDK_Bolt11InvoiceFeatures_set_basic_mpp_optional(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +int64_t CS_LDK_UnsignedBolt12Invoice_offer_features(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_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_basic_mpp_optional(&this_arg_conv); + LDKOfferFeatures ret_var = UnsignedBolt12Invoice_offer_features(&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_Bolt11InvoiceFeatures_set_basic_mpp_required(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +int64_t CS_LDK_UnsignedBolt12Invoice_description(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_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_basic_mpp_required(&this_arg_conv); + LDKPrintableString ret_var = UnsignedBolt12Invoice_description(&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_Bolt11InvoiceFeatures_supports_basic_mpp(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +int64_t CS_LDK_UnsignedBolt12Invoice_absolute_expiry(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_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_basic_mpp(&this_arg_conv); - return ret_conv; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = UnsignedBolt12Invoice_absolute_expiry(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_Bolt12InvoiceFeatures_set_basic_mpp_optional(int64_t this_arg) { - LDKBolt12InvoiceFeatures this_arg_conv; +int64_t CS_LDK_UnsignedBolt12Invoice_issuer(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - Bolt12InvoiceFeatures_set_basic_mpp_optional(&this_arg_conv); + LDKPrintableString ret_var = UnsignedBolt12Invoice_issuer(&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_Bolt12InvoiceFeatures_set_basic_mpp_required(int64_t this_arg) { - LDKBolt12InvoiceFeatures this_arg_conv; +int64_tArray CS_LDK_UnsignedBolt12Invoice_message_paths(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - Bolt12InvoiceFeatures_set_basic_mpp_required(&this_arg_conv); + LDKCVec_BlindedMessagePathZ ret_var = UnsignedBolt12Invoice_message_paths(&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 u = 0; u < ret_var.datalen; u++) { + LDKBlindedMessagePath ret_conv_20_var = ret_var.data[u]; + int64_t ret_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_20_var); + ret_conv_20_ref = tag_ptr(ret_conv_20_var.inner, ret_conv_20_var.is_owned); + ret_arr_ptr[u] = ret_conv_20_ref; + } + + FREE(ret_var.data); + return ret_arr; } -jboolean CS_LDK_Bolt12InvoiceFeatures_supports_basic_mpp(int64_t this_arg) { - LDKBolt12InvoiceFeatures this_arg_conv; +int64_t CS_LDK_UnsignedBolt12Invoice_supported_quantity(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = Bolt12InvoiceFeatures_supports_basic_mpp(&this_arg_conv); - return ret_conv; + 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; } -jboolean CS_LDK_InitFeatures_requires_basic_mpp(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int8_tArray CS_LDK_UnsignedBolt12Invoice_payer_metadata(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_basic_mpp(&this_arg_conv); - return ret_conv; + LDKu8slice ret_var = UnsignedBolt12Invoice_payer_metadata(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + return ret_arr; } -jboolean CS_LDK_NodeFeatures_requires_basic_mpp(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_UnsignedBolt12Invoice_invoice_request_features(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_basic_mpp(&this_arg_conv); - return ret_conv; + LDKInvoiceRequestFeatures ret_var = UnsignedBolt12Invoice_invoice_request_features(&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_Bolt11InvoiceFeatures_requires_basic_mpp(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +int64_t CS_LDK_UnsignedBolt12Invoice_quantity(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_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_basic_mpp(&this_arg_conv); - return ret_conv; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = UnsignedBolt12Invoice_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_Bolt12InvoiceFeatures_requires_basic_mpp(int64_t this_arg) { - LDKBolt12InvoiceFeatures this_arg_conv; +int8_tArray CS_LDK_UnsignedBolt12Invoice_payer_id(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = Bolt12InvoiceFeatures_requires_basic_mpp(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, UnsignedBolt12Invoice_payer_id(&this_arg_conv).compressed_form, 33); + return ret_arr; } -void CS_LDK_InitFeatures_set_wumbo_optional(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_UnsignedBolt12Invoice_payer_note(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_wumbo_optional(&this_arg_conv); + LDKPrintableString ret_var = UnsignedBolt12Invoice_payer_note(&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_InitFeatures_set_wumbo_required(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int8_tArray CS_LDK_UnsignedBolt12Invoice_payment_hash(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_wumbo_required(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, UnsignedBolt12Invoice_payment_hash(&this_arg_conv).data, 32); + return ret_arr; } -jboolean CS_LDK_InitFeatures_supports_wumbo(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_UnsignedBolt12Invoice_amount_msats(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_wumbo(&this_arg_conv); + int64_t ret_conv = UnsignedBolt12Invoice_amount_msats(&this_arg_conv); return ret_conv; } -void CS_LDK_NodeFeatures_set_wumbo_optional(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_Bolt12Invoice_created_at(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_wumbo_optional(&this_arg_conv); + int64_t ret_conv = Bolt12Invoice_created_at(&this_arg_conv); + return ret_conv; } -void CS_LDK_NodeFeatures_set_wumbo_required(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_Bolt12Invoice_relative_expiry(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_wumbo_required(&this_arg_conv); + int64_t ret_conv = Bolt12Invoice_relative_expiry(&this_arg_conv); + return ret_conv; } -jboolean CS_LDK_NodeFeatures_supports_wumbo(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +jboolean CS_LDK_Bolt12Invoice_is_expired(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_wumbo(&this_arg_conv); + jboolean ret_conv = Bolt12Invoice_is_expired(&this_arg_conv); return ret_conv; } -jboolean CS_LDK_InitFeatures_requires_wumbo(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +ptrArray CS_LDK_Bolt12Invoice_fallbacks(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_wumbo(&this_arg_conv); - return ret_conv; + LDKCVec_StrZ ret_var = Bolt12Invoice_fallbacks(&this_arg_conv); + ptrArray ret_arr = NULL; + ret_arr = init_ptrArray(ret_var.datalen, __LINE__); + jstring *ret_arr_ptr = (jstring*)(((uint8_t*)ret_arr) + 8); + for (size_t i = 0; i < ret_var.datalen; i++) { + LDKStr ret_conv_8_str = ret_var.data[i]; + jstring ret_conv_8_conv = str_ref_to_cs(ret_conv_8_str.chars, ret_conv_8_str.len); + Str_free(ret_conv_8_str); + ret_arr_ptr[i] = ret_conv_8_conv; + } + + FREE(ret_var.data); + return ret_arr; } -jboolean CS_LDK_NodeFeatures_requires_wumbo(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_Bolt12Invoice_invoice_features(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_wumbo(&this_arg_conv); - return ret_conv; + LDKBolt12InvoiceFeatures ret_var = Bolt12Invoice_invoice_features(&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_InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int8_tArray CS_LDK_Bolt12Invoice_signing_pubkey(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, Bolt12Invoice_signing_pubkey(&this_arg_conv).compressed_form, 33); + return ret_arr; } -void CS_LDK_InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_Bolt12Invoice_offer_chains(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(&this_arg_conv); + LDKCOption_CVec_ThirtyTwoBytesZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_ThirtyTwoBytesZZ), "LDKCOption_CVec_ThirtyTwoBytesZZ"); + *ret_copy = Bolt12Invoice_offer_chains(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_InitFeatures_supports_anchors_nonzero_fee_htlc_tx(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int8_tArray CS_LDK_Bolt12Invoice_chain(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_anchors_nonzero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, Bolt12Invoice_chain(&this_arg_conv).data, 32); + return ret_arr; } -void CS_LDK_NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_Bolt12Invoice_metadata(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(&this_arg_conv); + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = Bolt12Invoice_metadata(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_Bolt12Invoice_amount(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(&this_arg_conv); + 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; } -jboolean CS_LDK_NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_Bolt12Invoice_offer_features(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + LDKOfferFeatures ret_var = Bolt12Invoice_offer_features(&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_ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +int64_t CS_LDK_Bolt12Invoice_description(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(&this_arg_conv); + LDKPrintableString ret_var = Bolt12Invoice_description(&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_ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +int64_t CS_LDK_Bolt12Invoice_absolute_expiry(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(&this_arg_conv); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = Bolt12Invoice_absolute_expiry(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +int64_t CS_LDK_Bolt12Invoice_issuer(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + LDKPrintableString ret_var = Bolt12Invoice_issuer(&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_InitFeatures_requires_anchors_nonzero_fee_htlc_tx(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_tArray CS_LDK_Bolt12Invoice_message_paths(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_anchors_nonzero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + LDKCVec_BlindedMessagePathZ ret_var = Bolt12Invoice_message_paths(&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 u = 0; u < ret_var.datalen; u++) { + LDKBlindedMessagePath ret_conv_20_var = ret_var.data[u]; + int64_t ret_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_20_var); + ret_conv_20_ref = tag_ptr(ret_conv_20_var.inner, ret_conv_20_var.is_owned); + ret_arr_ptr[u] = ret_conv_20_ref; + } + + FREE(ret_var.data); + return ret_arr; } -jboolean CS_LDK_NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_Bolt12Invoice_supported_quantity(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + 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; } -jboolean CS_LDK_ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +int8_tArray CS_LDK_Bolt12Invoice_payer_metadata(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + LDKu8slice ret_var = Bolt12Invoice_payer_metadata(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + return ret_arr; } -void CS_LDK_InitFeatures_set_anchors_zero_fee_htlc_tx_optional(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_Bolt12Invoice_invoice_request_features(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_anchors_zero_fee_htlc_tx_optional(&this_arg_conv); + LDKInvoiceRequestFeatures ret_var = Bolt12Invoice_invoice_request_features(&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_InitFeatures_set_anchors_zero_fee_htlc_tx_required(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_Bolt12Invoice_quantity(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_anchors_zero_fee_htlc_tx_required(&this_arg_conv); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = Bolt12Invoice_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_InitFeatures_supports_anchors_zero_fee_htlc_tx(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int8_tArray CS_LDK_Bolt12Invoice_payer_id(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_anchors_zero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, Bolt12Invoice_payer_id(&this_arg_conv).compressed_form, 33); + return ret_arr; } -void CS_LDK_NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_Bolt12Invoice_payer_note(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(&this_arg_conv); + LDKPrintableString ret_var = Bolt12Invoice_payer_note(&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_NodeFeatures_set_anchors_zero_fee_htlc_tx_required(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int8_tArray CS_LDK_Bolt12Invoice_payment_hash(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_anchors_zero_fee_htlc_tx_required(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, Bolt12Invoice_payment_hash(&this_arg_conv).data, 32); + return ret_arr; } -jboolean CS_LDK_NodeFeatures_supports_anchors_zero_fee_htlc_tx(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_Bolt12Invoice_amount_msats(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_anchors_zero_fee_htlc_tx(&this_arg_conv); + int64_t ret_conv = Bolt12Invoice_amount_msats(&this_arg_conv); return ret_conv; } -void CS_LDK_ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +int8_tArray CS_LDK_Bolt12Invoice_signature(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); + memcpy(ret_arr->elems, Bolt12Invoice_signature(&this_arg_conv).compact_form, 64); + return ret_arr; } -void CS_LDK_ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +int8_tArray CS_LDK_Bolt12Invoice_signable_hash(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, Bolt12Invoice_signable_hash(&this_arg_conv).data, 32); + return ret_arr; } -jboolean CS_LDK_ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +int64_t CS_LDK_Bolt12Invoice_verify_using_metadata(int64_t this_arg, int64_t key) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + LDKExpandedKey key_conv; + key_conv.inner = untag_ptr(key); + key_conv.is_owned = ptr_is_owned(key); + CHECK_INNER_FIELD_ACCESS_OR_NULL(key_conv); + key_conv.is_owned = false; + LDKCResult_ThirtyTwoBytesNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesNoneZ), "LDKCResult_ThirtyTwoBytesNoneZ"); + *ret_conv = Bolt12Invoice_verify_using_metadata(&this_arg_conv, &key_conv); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_InitFeatures_requires_anchors_zero_fee_htlc_tx(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_Bolt12Invoice_verify_using_payer_data(int64_t this_arg, int8_tArray payment_id, int64_t nonce, int64_t key) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_anchors_zero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + LDKNonce nonce_conv; + nonce_conv.inner = untag_ptr(nonce); + nonce_conv.is_owned = ptr_is_owned(nonce); + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_conv); + nonce_conv = Nonce_clone(&nonce_conv); + LDKExpandedKey key_conv; + key_conv.inner = untag_ptr(key); + key_conv.is_owned = ptr_is_owned(key); + CHECK_INNER_FIELD_ACCESS_OR_NULL(key_conv); + key_conv.is_owned = false; + LDKCResult_ThirtyTwoBytesNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesNoneZ), "LDKCResult_ThirtyTwoBytesNoneZ"); + *ret_conv = Bolt12Invoice_verify_using_payer_data(&this_arg_conv, payment_id_ref, nonce_conv, &key_conv); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_NodeFeatures_requires_anchors_zero_fee_htlc_tx(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_anchors_zero_fee_htlc_tx(&this_arg_conv); +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; } -jboolean CS_LDK_ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(&this_arg_conv); - return ret_conv; +int8_tArray CS_LDK_UnsignedBolt12Invoice_write(int64_t obj) { + LDKUnsignedBolt12Invoice 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 = UnsignedBolt12Invoice_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -void CS_LDK_InitFeatures_set_route_blinding_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_route_blinding_optional(&this_arg_conv); +int8_tArray CS_LDK_Bolt12Invoice_write(int64_t obj) { + LDKBolt12Invoice 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 = Bolt12Invoice_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -void CS_LDK_InitFeatures_set_route_blinding_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_route_blinding_required(&this_arg_conv); +int64_t CS_LDK_Bolt12Invoice_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_Bolt12InvoiceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceDecodeErrorZ), "LDKCResult_Bolt12InvoiceDecodeErrorZ"); + *ret_conv = Bolt12Invoice_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_InitFeatures_supports_route_blinding(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_route_blinding(&this_arg_conv); - return ret_conv; +void CS_LDK_InvoiceError_free(int64_t this_obj) { + LDKInvoiceError this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InvoiceError_free(this_obj_conv); } -void CS_LDK_NodeFeatures_set_route_blinding_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_route_blinding_optional(&this_arg_conv); +int64_t CS_LDK_InvoiceError_get_erroneous_field(int64_t this_ptr) { + LDKInvoiceError this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKErroneousField ret_var = InvoiceError_get_erroneous_field(&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_NodeFeatures_set_route_blinding_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_route_blinding_required(&this_arg_conv); +void CS_LDK_InvoiceError_set_erroneous_field(int64_t this_ptr, int64_t val) { + LDKInvoiceError this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKErroneousField 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 = ErroneousField_clone(&val_conv); + InvoiceError_set_erroneous_field(&this_ptr_conv, val_conv); } -jboolean CS_LDK_NodeFeatures_supports_route_blinding(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_route_blinding(&this_arg_conv); - return ret_conv; +int64_t CS_LDK_InvoiceError_get_message(int64_t this_ptr) { + LDKInvoiceError this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = InvoiceError_get_message(&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; } -jboolean CS_LDK_InitFeatures_requires_route_blinding(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_route_blinding(&this_arg_conv); - return ret_conv; +void CS_LDK_InvoiceError_set_message(int64_t this_ptr, int64_t val) { + LDKInvoiceError this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + InvoiceError_set_message(&this_ptr_conv, val_conv); } -jboolean CS_LDK_NodeFeatures_requires_route_blinding(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_route_blinding(&this_arg_conv); +int64_t CS_LDK_InvoiceError_new(int64_t erroneous_field_arg, int64_t message_arg) { + LDKErroneousField erroneous_field_arg_conv; + erroneous_field_arg_conv.inner = untag_ptr(erroneous_field_arg); + erroneous_field_arg_conv.is_owned = ptr_is_owned(erroneous_field_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(erroneous_field_arg_conv); + erroneous_field_arg_conv = ErroneousField_clone(&erroneous_field_arg_conv); + LDKUntrustedString message_arg_conv; + message_arg_conv.inner = untag_ptr(message_arg); + message_arg_conv.is_owned = ptr_is_owned(message_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_arg_conv); + message_arg_conv = UntrustedString_clone(&message_arg_conv); + LDKInvoiceError ret_var = InvoiceError_new(erroneous_field_arg_conv, message_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 InvoiceError_clone_ptr(LDKInvoiceError *NONNULL_PTR arg) { + LDKInvoiceError ret_var = InvoiceError_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_InvoiceError_clone_ptr(int64_t arg) { + LDKInvoiceError 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 = InvoiceError_clone_ptr(&arg_conv); return ret_conv; } -void CS_LDK_InitFeatures_set_shutdown_any_segwit_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_shutdown_any_segwit_optional(&this_arg_conv); +int64_t CS_LDK_InvoiceError_clone(int64_t orig) { + LDKInvoiceError 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; + LDKInvoiceError ret_var = InvoiceError_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_InitFeatures_set_shutdown_any_segwit_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_shutdown_any_segwit_required(&this_arg_conv); +void CS_LDK_ErroneousField_free(int64_t this_obj) { + LDKErroneousField this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ErroneousField_free(this_obj_conv); } -jboolean CS_LDK_InitFeatures_supports_shutdown_anysegwit(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_shutdown_anysegwit(&this_arg_conv); +int64_t CS_LDK_ErroneousField_get_tlv_fieldnum(int64_t this_ptr) { + LDKErroneousField this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = ErroneousField_get_tlv_fieldnum(&this_ptr_conv); return ret_conv; } -void CS_LDK_NodeFeatures_set_shutdown_any_segwit_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_shutdown_any_segwit_optional(&this_arg_conv); +void CS_LDK_ErroneousField_set_tlv_fieldnum(int64_t this_ptr, int64_t val) { + LDKErroneousField this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ErroneousField_set_tlv_fieldnum(&this_ptr_conv, val); } -void CS_LDK_NodeFeatures_set_shutdown_any_segwit_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_shutdown_any_segwit_required(&this_arg_conv); +int64_t CS_LDK_ErroneousField_get_suggested_value(int64_t this_ptr) { + LDKErroneousField this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = ErroneousField_get_suggested_value(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_NodeFeatures_supports_shutdown_anysegwit(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_shutdown_anysegwit(&this_arg_conv); - return ret_conv; +void CS_LDK_ErroneousField_set_suggested_value(int64_t this_ptr, int64_t val) { + LDKErroneousField this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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)); + ErroneousField_set_suggested_value(&this_ptr_conv, val_conv); } -jboolean CS_LDK_InitFeatures_requires_shutdown_anysegwit(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_shutdown_anysegwit(&this_arg_conv); - return ret_conv; +int64_t CS_LDK_ErroneousField_new(int64_t tlv_fieldnum_arg, int64_t suggested_value_arg) { + void* suggested_value_arg_ptr = untag_ptr(suggested_value_arg); + CHECK_ACCESS(suggested_value_arg_ptr); + LDKCOption_CVec_u8ZZ suggested_value_arg_conv = *(LDKCOption_CVec_u8ZZ*)(suggested_value_arg_ptr); + suggested_value_arg_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(suggested_value_arg)); + LDKErroneousField ret_var = ErroneousField_new(tlv_fieldnum_arg, suggested_value_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_NodeFeatures_requires_shutdown_anysegwit(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_shutdown_anysegwit(&this_arg_conv); +static inline uint64_t ErroneousField_clone_ptr(LDKErroneousField *NONNULL_PTR arg) { + LDKErroneousField ret_var = ErroneousField_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_ErroneousField_clone_ptr(int64_t arg) { + LDKErroneousField 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 = ErroneousField_clone_ptr(&arg_conv); return ret_conv; } -void CS_LDK_InitFeatures_set_taproot_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_taproot_optional(&this_arg_conv); +int64_t CS_LDK_ErroneousField_clone(int64_t orig) { + LDKErroneousField 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; + LDKErroneousField ret_var = ErroneousField_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_InitFeatures_set_taproot_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_taproot_required(&this_arg_conv); +int64_t CS_LDK_InvoiceError_from_string(jstring s) { + LDKStr s_conv = str_ref_to_owned_c(s); + LDKInvoiceError ret_var = InvoiceError_from_string(s_conv); + int64_t ret_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_InitFeatures_supports_taproot(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_taproot(&this_arg_conv); +jstring CS_LDK_InvoiceError_to_str(int64_t o) { + LDKInvoiceError o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = InvoiceError_to_str(&o_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); return ret_conv; } -void CS_LDK_NodeFeatures_set_taproot_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_taproot_optional(&this_arg_conv); +int8_tArray CS_LDK_InvoiceError_write(int64_t obj) { + LDKInvoiceError 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 = InvoiceError_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -void CS_LDK_NodeFeatures_set_taproot_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_taproot_required(&this_arg_conv); +int64_t CS_LDK_InvoiceError_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); + *ret_conv = InvoiceError_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_NodeFeatures_supports_taproot(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_taproot(&this_arg_conv); - return ret_conv; +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_ChannelTypeFeatures_set_taproot_optional(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_taproot_optional(&this_arg_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); } -void CS_LDK_ChannelTypeFeatures_set_taproot_required(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_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); - this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_taproot_required(&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); } -jboolean CS_LDK_ChannelTypeFeatures_supports_taproot(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +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); - this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_supports_taproot(&this_arg_conv); - return ret_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); } -jboolean CS_LDK_InitFeatures_requires_taproot(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +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); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_taproot(&this_arg_conv); - return ret_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); } -jboolean CS_LDK_NodeFeatures_requires_taproot(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +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); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_taproot(&this_arg_conv); - return ret_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); } -jboolean CS_LDK_ChannelTypeFeatures_requires_taproot(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +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); - this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_requires_taproot(&this_arg_conv); - return ret_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); } -void CS_LDK_InitFeatures_set_onion_messages_optional(int64_t this_arg) { - LDKInitFeatures this_arg_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); - this_arg_conv.is_owned = false; - InitFeatures_set_onion_messages_optional(&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); } -void CS_LDK_InitFeatures_set_onion_messages_required(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +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); - this_arg_conv.is_owned = false; - InitFeatures_set_onion_messages_required(&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); } -jboolean CS_LDK_InitFeatures_supports_onion_messages(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +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); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_onion_messages(&this_arg_conv); - return ret_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); } -void CS_LDK_NodeFeatures_set_onion_messages_optional(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +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); - this_arg_conv.is_owned = false; - NodeFeatures_set_onion_messages_optional(&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_NodeFeatures_set_onion_messages_required(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +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); - this_arg_conv.is_owned = false; - NodeFeatures_set_onion_messages_required(&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); } -jboolean CS_LDK_NodeFeatures_supports_onion_messages(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_onion_messages(&this_arg_conv); - return ret_conv; +void CS_LDK_UnsignedInvoiceRequest_free(int64_t this_obj) { + LDKUnsignedInvoiceRequest this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + UnsignedInvoiceRequest_free(this_obj_conv); } -jboolean CS_LDK_InitFeatures_requires_onion_messages(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_onion_messages(&this_arg_conv); - return ret_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; } - -jboolean CS_LDK_NodeFeatures_requires_onion_messages(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_onion_messages(&this_arg_conv); +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; } -void CS_LDK_InitFeatures_set_channel_type_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_channel_type_optional(&this_arg_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_InitFeatures_set_channel_type_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_channel_type_required(&this_arg_conv); +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); } -jboolean CS_LDK_InitFeatures_supports_channel_type(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_UnsignedInvoiceRequest_tagged_hash(int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_channel_type(&this_arg_conv); - return ret_conv; + LDKTaggedHash ret_var = UnsignedInvoiceRequest_tagged_hash(&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_NodeFeatures_set_channel_type_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_channel_type_optional(&this_arg_conv); +void CS_LDK_InvoiceRequest_free(int64_t this_obj) { + LDKInvoiceRequest this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InvoiceRequest_free(this_obj_conv); } -void CS_LDK_NodeFeatures_set_channel_type_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_channel_type_required(&this_arg_conv); +static inline uint64_t InvoiceRequest_clone_ptr(LDKInvoiceRequest *NONNULL_PTR arg) { + LDKInvoiceRequest ret_var = InvoiceRequest_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; } - -jboolean CS_LDK_NodeFeatures_supports_channel_type(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_channel_type(&this_arg_conv); +int64_t CS_LDK_InvoiceRequest_clone_ptr(int64_t arg) { + LDKInvoiceRequest arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = InvoiceRequest_clone_ptr(&arg_conv); return ret_conv; } -jboolean CS_LDK_InitFeatures_requires_channel_type(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_channel_type(&this_arg_conv); - return ret_conv; +int64_t CS_LDK_InvoiceRequest_clone(int64_t orig) { + LDKInvoiceRequest orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKInvoiceRequest ret_var = InvoiceRequest_clone(&orig_conv); + int64_t ret_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_NodeFeatures_requires_channel_type(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_channel_type(&this_arg_conv); - return ret_conv; +void CS_LDK_VerifiedInvoiceRequest_free(int64_t this_obj) { + LDKVerifiedInvoiceRequest this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + VerifiedInvoiceRequest_free(this_obj_conv); } -void CS_LDK_InitFeatures_set_scid_privacy_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_scid_privacy_optional(&this_arg_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_InitFeatures_set_scid_privacy_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_scid_privacy_required(&this_arg_conv); +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); } -jboolean CS_LDK_InitFeatures_supports_scid_privacy(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_scid_privacy(&this_arg_conv); +static inline uint64_t VerifiedInvoiceRequest_clone_ptr(LDKVerifiedInvoiceRequest *NONNULL_PTR arg) { + LDKVerifiedInvoiceRequest ret_var = VerifiedInvoiceRequest_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_VerifiedInvoiceRequest_clone_ptr(int64_t arg) { + LDKVerifiedInvoiceRequest 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 = VerifiedInvoiceRequest_clone_ptr(&arg_conv); return ret_conv; } -void CS_LDK_NodeFeatures_set_scid_privacy_optional(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_VerifiedInvoiceRequest_clone(int64_t orig) { + LDKVerifiedInvoiceRequest 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; + LDKVerifiedInvoiceRequest ret_var = VerifiedInvoiceRequest_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; +} + +ptrArray CS_LDK_UnsignedInvoiceRequest_chains(int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_scid_privacy_optional(&this_arg_conv); + LDKCVec_ThirtyTwoBytesZ ret_var = UnsignedInvoiceRequest_chains(&this_arg_conv); + ptrArray ret_arr = NULL; + ret_arr = init_ptrArray(ret_var.datalen, __LINE__); + int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8); + for (size_t i = 0; i < ret_var.datalen; i++) { + int8_tArray ret_conv_8_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_conv_8_arr->elems, ret_var.data[i].data, 32); + ret_arr_ptr[i] = ret_conv_8_arr; + } + + FREE(ret_var.data); + return ret_arr; } -void CS_LDK_NodeFeatures_set_scid_privacy_required(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_UnsignedInvoiceRequest_metadata(int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_scid_privacy_required(&this_arg_conv); + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = UnsignedInvoiceRequest_metadata(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_NodeFeatures_supports_scid_privacy(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_UnsignedInvoiceRequest_amount(int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_scid_privacy(&this_arg_conv); - return ret_conv; + 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; } -void CS_LDK_ChannelTypeFeatures_set_scid_privacy_optional(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +int64_t CS_LDK_UnsignedInvoiceRequest_description(int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_scid_privacy_optional(&this_arg_conv); + LDKPrintableString ret_var = UnsignedInvoiceRequest_description(&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_ChannelTypeFeatures_set_scid_privacy_required(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +int64_t CS_LDK_UnsignedInvoiceRequest_offer_features(int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_scid_privacy_required(&this_arg_conv); + LDKOfferFeatures ret_var = UnsignedInvoiceRequest_offer_features(&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_ChannelTypeFeatures_supports_scid_privacy(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +int64_t CS_LDK_UnsignedInvoiceRequest_absolute_expiry(int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_supports_scid_privacy(&this_arg_conv); - return ret_conv; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = UnsignedInvoiceRequest_absolute_expiry(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_InitFeatures_requires_scid_privacy(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_UnsignedInvoiceRequest_issuer(int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_scid_privacy(&this_arg_conv); - return ret_conv; + LDKPrintableString ret_var = UnsignedInvoiceRequest_issuer(&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_NodeFeatures_requires_scid_privacy(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_tArray CS_LDK_UnsignedInvoiceRequest_paths(int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_scid_privacy(&this_arg_conv); - return ret_conv; + LDKCVec_BlindedMessagePathZ ret_var = UnsignedInvoiceRequest_paths(&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 u = 0; u < ret_var.datalen; u++) { + LDKBlindedMessagePath ret_conv_20_var = ret_var.data[u]; + int64_t ret_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_20_var); + ret_conv_20_ref = tag_ptr(ret_conv_20_var.inner, ret_conv_20_var.is_owned); + ret_arr_ptr[u] = ret_conv_20_ref; + } + + FREE(ret_var.data); + return ret_arr; } -jboolean CS_LDK_ChannelTypeFeatures_requires_scid_privacy(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +int64_t CS_LDK_UnsignedInvoiceRequest_supported_quantity(int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_requires_scid_privacy(&this_arg_conv); - return ret_conv; + 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; } -void CS_LDK_Bolt11InvoiceFeatures_set_payment_metadata_optional(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +int8_tArray CS_LDK_UnsignedInvoiceRequest_signing_pubkey(int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_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_payment_metadata_optional(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, UnsignedInvoiceRequest_signing_pubkey(&this_arg_conv).compressed_form, 33); + return ret_arr; } -void CS_LDK_Bolt11InvoiceFeatures_set_payment_metadata_required(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +int8_tArray CS_LDK_UnsignedInvoiceRequest_payer_metadata(int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_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_payment_metadata_required(&this_arg_conv); + LDKu8slice ret_var = UnsignedInvoiceRequest_payer_metadata(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + return ret_arr; } -jboolean CS_LDK_Bolt11InvoiceFeatures_supports_payment_metadata(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +int8_tArray CS_LDK_UnsignedInvoiceRequest_chain(int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_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_payment_metadata(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, UnsignedInvoiceRequest_chain(&this_arg_conv).data, 32); + return ret_arr; } -jboolean CS_LDK_Bolt11InvoiceFeatures_requires_payment_metadata(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +int64_t CS_LDK_UnsignedInvoiceRequest_amount_msats(int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_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_payment_metadata(&this_arg_conv); - return ret_conv; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = UnsignedInvoiceRequest_amount_msats(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_InitFeatures_set_zero_conf_optional(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_UnsignedInvoiceRequest_invoice_request_features(int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_zero_conf_optional(&this_arg_conv); + LDKInvoiceRequestFeatures ret_var = UnsignedInvoiceRequest_invoice_request_features(&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_InitFeatures_set_zero_conf_required(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_UnsignedInvoiceRequest_quantity(int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_zero_conf_required(&this_arg_conv); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = UnsignedInvoiceRequest_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_InitFeatures_supports_zero_conf(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int8_tArray CS_LDK_UnsignedInvoiceRequest_payer_id(int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_zero_conf(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, UnsignedInvoiceRequest_payer_id(&this_arg_conv).compressed_form, 33); + return ret_arr; } -void CS_LDK_NodeFeatures_set_zero_conf_optional(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_UnsignedInvoiceRequest_payer_note(int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_zero_conf_optional(&this_arg_conv); + LDKPrintableString ret_var = UnsignedInvoiceRequest_payer_note(&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_NodeFeatures_set_zero_conf_required(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +ptrArray CS_LDK_InvoiceRequest_chains(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; - NodeFeatures_set_zero_conf_required(&this_arg_conv); + LDKCVec_ThirtyTwoBytesZ ret_var = InvoiceRequest_chains(&this_arg_conv); + ptrArray ret_arr = NULL; + ret_arr = init_ptrArray(ret_var.datalen, __LINE__); + int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8); + for (size_t i = 0; i < ret_var.datalen; i++) { + int8_tArray ret_conv_8_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_conv_8_arr->elems, ret_var.data[i].data, 32); + ret_arr_ptr[i] = ret_conv_8_arr; + } + + FREE(ret_var.data); + return ret_arr; } -jboolean CS_LDK_NodeFeatures_supports_zero_conf(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_InvoiceRequest_metadata(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; - jboolean ret_conv = NodeFeatures_supports_zero_conf(&this_arg_conv); - return ret_conv; + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = InvoiceRequest_metadata(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_ChannelTypeFeatures_set_zero_conf_optional(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +int64_t CS_LDK_InvoiceRequest_amount(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; - ChannelTypeFeatures_set_zero_conf_optional(&this_arg_conv); + 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; } -void CS_LDK_ChannelTypeFeatures_set_zero_conf_required(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +int64_t CS_LDK_InvoiceRequest_description(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; - ChannelTypeFeatures_set_zero_conf_required(&this_arg_conv); + LDKPrintableString ret_var = InvoiceRequest_description(&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_ChannelTypeFeatures_supports_zero_conf(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +int64_t CS_LDK_InvoiceRequest_offer_features(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; - jboolean ret_conv = ChannelTypeFeatures_supports_zero_conf(&this_arg_conv); - return ret_conv; + LDKOfferFeatures ret_var = InvoiceRequest_offer_features(&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_InitFeatures_requires_zero_conf(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_InvoiceRequest_absolute_expiry(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; - jboolean ret_conv = InitFeatures_requires_zero_conf(&this_arg_conv); - return ret_conv; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = InvoiceRequest_absolute_expiry(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_NodeFeatures_requires_zero_conf(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_InvoiceRequest_issuer(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; - jboolean ret_conv = NodeFeatures_requires_zero_conf(&this_arg_conv); - return ret_conv; + LDKPrintableString ret_var = InvoiceRequest_issuer(&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_ChannelTypeFeatures_requires_zero_conf(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +int64_tArray CS_LDK_InvoiceRequest_paths(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; - jboolean ret_conv = ChannelTypeFeatures_requires_zero_conf(&this_arg_conv); - return ret_conv; + LDKCVec_BlindedMessagePathZ ret_var = InvoiceRequest_paths(&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 u = 0; u < ret_var.datalen; u++) { + LDKBlindedMessagePath ret_conv_20_var = ret_var.data[u]; + int64_t ret_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_20_var); + ret_conv_20_ref = tag_ptr(ret_conv_20_var.inner, ret_conv_20_var.is_owned); + ret_arr_ptr[u] = ret_conv_20_ref; + } + + FREE(ret_var.data); + return ret_arr; } -void CS_LDK_NodeFeatures_set_keysend_optional(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_InvoiceRequest_supported_quantity(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; - NodeFeatures_set_keysend_optional(&this_arg_conv); + 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; } -void CS_LDK_NodeFeatures_set_keysend_required(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int8_tArray CS_LDK_InvoiceRequest_signing_pubkey(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; - NodeFeatures_set_keysend_required(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, InvoiceRequest_signing_pubkey(&this_arg_conv).compressed_form, 33); + return ret_arr; } -jboolean CS_LDK_NodeFeatures_supports_keysend(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int8_tArray CS_LDK_InvoiceRequest_payer_metadata(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; - jboolean ret_conv = NodeFeatures_supports_keysend(&this_arg_conv); - return ret_conv; + LDKu8slice ret_var = InvoiceRequest_payer_metadata(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + return ret_arr; } -jboolean CS_LDK_NodeFeatures_requires_keysend(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int8_tArray CS_LDK_InvoiceRequest_chain(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; - jboolean ret_conv = NodeFeatures_requires_keysend(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, InvoiceRequest_chain(&this_arg_conv).data, 32); + return ret_arr; } -void CS_LDK_InitFeatures_set_trampoline_routing_optional(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_InvoiceRequest_amount_msats(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; - InitFeatures_set_trampoline_routing_optional(&this_arg_conv); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = InvoiceRequest_amount_msats(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_InitFeatures_set_trampoline_routing_required(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_InvoiceRequest_invoice_request_features(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; - InitFeatures_set_trampoline_routing_required(&this_arg_conv); + LDKInvoiceRequestFeatures ret_var = InvoiceRequest_invoice_request_features(&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_InitFeatures_supports_trampoline_routing(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_InvoiceRequest_quantity(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; - jboolean ret_conv = InitFeatures_supports_trampoline_routing(&this_arg_conv); - return ret_conv; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = InvoiceRequest_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_NodeFeatures_set_trampoline_routing_optional(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int8_tArray CS_LDK_InvoiceRequest_payer_id(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; - NodeFeatures_set_trampoline_routing_optional(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, InvoiceRequest_payer_id(&this_arg_conv).compressed_form, 33); + return ret_arr; } -void CS_LDK_NodeFeatures_set_trampoline_routing_required(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_InvoiceRequest_payer_note(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; - NodeFeatures_set_trampoline_routing_required(&this_arg_conv); + LDKPrintableString ret_var = InvoiceRequest_payer_note(&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_NodeFeatures_supports_trampoline_routing(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +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; - jboolean ret_conv = NodeFeatures_supports_trampoline_routing(&this_arg_conv); - return ret_conv; + LDKCVec_BlindedPaymentPathZ 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(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); + else + payment_paths_constr.data = NULL; + int64_t* payment_paths_vals = payment_paths->elems; + for (size_t u = 0; u < payment_paths_constr.datalen; u++) { + int64_t payment_paths_conv_20 = payment_paths_vals[u]; + LDKBlindedPaymentPath payment_paths_conv_20_conv; + payment_paths_conv_20_conv.inner = untag_ptr(payment_paths_conv_20); + payment_paths_conv_20_conv.is_owned = ptr_is_owned(payment_paths_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_paths_conv_20_conv); + payment_paths_conv_20_conv = BlindedPaymentPath_clone(&payment_paths_conv_20_conv); + payment_paths_constr.data[u] = payment_paths_conv_20_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); } -void CS_LDK_Bolt11InvoiceFeatures_set_trampoline_routing_optional(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +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; - Bolt11InvoiceFeatures_set_trampoline_routing_optional(&this_arg_conv); -} - -void CS_LDK_Bolt11InvoiceFeatures_set_trampoline_routing_required(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; + LDKCVec_BlindedPaymentPathZ 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(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); + else + payment_paths_constr.data = NULL; + int64_t* payment_paths_vals = payment_paths->elems; + for (size_t u = 0; u < payment_paths_constr.datalen; u++) { + int64_t payment_paths_conv_20 = payment_paths_vals[u]; + LDKBlindedPaymentPath payment_paths_conv_20_conv; + payment_paths_conv_20_conv.inner = untag_ptr(payment_paths_conv_20); + payment_paths_conv_20_conv.is_owned = ptr_is_owned(payment_paths_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_paths_conv_20_conv); + payment_paths_conv_20_conv = BlindedPaymentPath_clone(&payment_paths_conv_20_conv); + payment_paths_constr.data[u] = payment_paths_conv_20_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_using_metadata(int64_t this_arg, int64_t key) { + 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; - Bolt11InvoiceFeatures_set_trampoline_routing_required(&this_arg_conv); + this_arg_conv = InvoiceRequest_clone(&this_arg_conv); + LDKExpandedKey key_conv; + key_conv.inner = untag_ptr(key); + key_conv.is_owned = ptr_is_owned(key); + CHECK_INNER_FIELD_ACCESS_OR_NULL(key_conv); + key_conv.is_owned = false; + LDKCResult_VerifiedInvoiceRequestNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_VerifiedInvoiceRequestNoneZ), "LDKCResult_VerifiedInvoiceRequestNoneZ"); + *ret_conv = InvoiceRequest_verify_using_metadata(this_arg_conv, &key_conv); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_Bolt11InvoiceFeatures_supports_trampoline_routing(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +int64_t CS_LDK_InvoiceRequest_verify_using_recipient_data(int64_t this_arg, int64_t nonce, int64_t key) { + 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 = InvoiceRequest_clone(&this_arg_conv); + LDKNonce nonce_conv; + nonce_conv.inner = untag_ptr(nonce); + nonce_conv.is_owned = ptr_is_owned(nonce); + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_conv); + nonce_conv = Nonce_clone(&nonce_conv); + LDKExpandedKey key_conv; + key_conv.inner = untag_ptr(key); + key_conv.is_owned = ptr_is_owned(key); + CHECK_INNER_FIELD_ACCESS_OR_NULL(key_conv); + key_conv.is_owned = false; + LDKCResult_VerifiedInvoiceRequestNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_VerifiedInvoiceRequestNoneZ), "LDKCResult_VerifiedInvoiceRequestNoneZ"); + *ret_conv = InvoiceRequest_verify_using_recipient_data(this_arg_conv, nonce_conv, &key_conv); + 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; - jboolean ret_conv = Bolt11InvoiceFeatures_supports_trampoline_routing(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); + memcpy(ret_arr->elems, InvoiceRequest_signature(&this_arg_conv).compact_form, 64); + return ret_arr; } -jboolean CS_LDK_InitFeatures_requires_trampoline_routing(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +ptrArray CS_LDK_VerifiedInvoiceRequest_chains(int64_t this_arg) { + 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; - jboolean ret_conv = InitFeatures_requires_trampoline_routing(&this_arg_conv); - return ret_conv; + LDKCVec_ThirtyTwoBytesZ ret_var = VerifiedInvoiceRequest_chains(&this_arg_conv); + ptrArray ret_arr = NULL; + ret_arr = init_ptrArray(ret_var.datalen, __LINE__); + int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8); + for (size_t i = 0; i < ret_var.datalen; i++) { + int8_tArray ret_conv_8_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_conv_8_arr->elems, ret_var.data[i].data, 32); + ret_arr_ptr[i] = ret_conv_8_arr; + } + + FREE(ret_var.data); + return ret_arr; } -jboolean CS_LDK_NodeFeatures_requires_trampoline_routing(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_VerifiedInvoiceRequest_metadata(int64_t this_arg) { + 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; - jboolean ret_conv = NodeFeatures_requires_trampoline_routing(&this_arg_conv); - return ret_conv; + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = VerifiedInvoiceRequest_metadata(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_Bolt11InvoiceFeatures_requires_trampoline_routing(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +int64_t CS_LDK_VerifiedInvoiceRequest_amount(int64_t this_arg) { + 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; - jboolean ret_conv = Bolt11InvoiceFeatures_requires_trampoline_routing(&this_arg_conv); - return ret_conv; + 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; } -void CS_LDK_ShutdownScript_free(int64_t this_obj) { - LDKShutdownScript this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ShutdownScript_free(this_obj_conv); +int64_t CS_LDK_VerifiedInvoiceRequest_description(int64_t this_arg) { + 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; + LDKPrintableString ret_var = VerifiedInvoiceRequest_description(&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; } -static inline uint64_t ShutdownScript_clone_ptr(LDKShutdownScript *NONNULL_PTR arg) { - LDKShutdownScript ret_var = ShutdownScript_clone(arg); +int64_t CS_LDK_VerifiedInvoiceRequest_offer_features(int64_t this_arg) { + 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; + LDKOfferFeatures ret_var = VerifiedInvoiceRequest_offer_features(&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_ShutdownScript_clone_ptr(int64_t arg) { - LDKShutdownScript arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = ShutdownScript_clone_ptr(&arg_conv); - return ret_conv; + +int64_t CS_LDK_VerifiedInvoiceRequest_absolute_expiry(int64_t this_arg) { + 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; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = VerifiedInvoiceRequest_absolute_expiry(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_ShutdownScript_clone(int64_t orig) { - LDKShutdownScript orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKShutdownScript ret_var = ShutdownScript_clone(&orig_conv); +int64_t CS_LDK_VerifiedInvoiceRequest_issuer(int64_t this_arg) { + 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; + LDKPrintableString ret_var = VerifiedInvoiceRequest_issuer(&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_ShutdownScript_eq(int64_t a, int64_t b) { - LDKShutdownScript a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKShutdownScript b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = ShutdownScript_eq(&a_conv, &b_conv); - return ret_conv; +int64_tArray CS_LDK_VerifiedInvoiceRequest_paths(int64_t this_arg) { + 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_BlindedMessagePathZ ret_var = VerifiedInvoiceRequest_paths(&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 u = 0; u < ret_var.datalen; u++) { + LDKBlindedMessagePath ret_conv_20_var = ret_var.data[u]; + int64_t ret_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_20_var); + ret_conv_20_ref = tag_ptr(ret_conv_20_var.inner, ret_conv_20_var.is_owned); + ret_arr_ptr[u] = ret_conv_20_ref; + } + + FREE(ret_var.data); + return ret_arr; } -void CS_LDK_InvalidShutdownScript_free(int64_t this_obj) { - LDKInvalidShutdownScript this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InvalidShutdownScript_free(this_obj_conv); +int64_t CS_LDK_VerifiedInvoiceRequest_supported_quantity(int64_t this_arg) { + 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; + 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; } -int8_tArray CS_LDK_InvalidShutdownScript_get_script(int64_t this_ptr) { - LDKInvalidShutdownScript this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_u8Z ret_var = InvalidShutdownScript_get_script(&this_ptr_conv); +int8_tArray CS_LDK_VerifiedInvoiceRequest_signing_pubkey(int64_t this_arg) { + 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; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, VerifiedInvoiceRequest_signing_pubkey(&this_arg_conv).compressed_form, 33); + return ret_arr; +} + +int8_tArray CS_LDK_VerifiedInvoiceRequest_payer_metadata(int64_t this_arg) { + 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; + LDKu8slice ret_var = VerifiedInvoiceRequest_payer_metadata(&this_arg_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); return ret_arr; } -void CS_LDK_InvalidShutdownScript_set_script(int64_t this_ptr, int8_tArray val) { - LDKInvalidShutdownScript this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_u8Z val_ref; - val_ref.datalen = val->arr_len; - val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val); - InvalidShutdownScript_set_script(&this_ptr_conv, val_ref); +int8_tArray CS_LDK_VerifiedInvoiceRequest_chain(int64_t this_arg) { + 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; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, VerifiedInvoiceRequest_chain(&this_arg_conv).data, 32); + return ret_arr; } -int64_t CS_LDK_InvalidShutdownScript_new(int8_tArray script_arg) { - LDKCVec_u8Z script_arg_ref; - script_arg_ref.datalen = script_arg->arr_len; - script_arg_ref.data = MALLOC(script_arg_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(script_arg_ref.data, script_arg->elems, script_arg_ref.datalen); FREE(script_arg); - LDKInvalidShutdownScript ret_var = InvalidShutdownScript_new(script_arg_ref); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +int64_t CS_LDK_VerifiedInvoiceRequest_amount_msats(int64_t this_arg) { + 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; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = VerifiedInvoiceRequest_amount_msats(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline uint64_t InvalidShutdownScript_clone_ptr(LDKInvalidShutdownScript *NONNULL_PTR arg) { - LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(arg); +int64_t CS_LDK_VerifiedInvoiceRequest_invoice_request_features(int64_t this_arg) { + 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; + LDKInvoiceRequestFeatures ret_var = VerifiedInvoiceRequest_invoice_request_features(&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_InvalidShutdownScript_clone_ptr(int64_t arg) { - LDKInvalidShutdownScript arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = InvalidShutdownScript_clone_ptr(&arg_conv); - return ret_conv; -} -int64_t CS_LDK_InvalidShutdownScript_clone(int64_t orig) { - LDKInvalidShutdownScript orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKInvalidShutdownScript ret_var = InvalidShutdownScript_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); +int64_t CS_LDK_VerifiedInvoiceRequest_quantity(int64_t this_arg) { + 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; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = VerifiedInvoiceRequest_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int8_tArray CS_LDK_ShutdownScript_write(int64_t obj) { - LDKShutdownScript obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ShutdownScript_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); +int8_tArray CS_LDK_VerifiedInvoiceRequest_payer_id(int64_t this_arg) { + 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; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, VerifiedInvoiceRequest_payer_id(&this_arg_conv).compressed_form, 33); return ret_arr; } -int64_t CS_LDK_ShutdownScript_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); - *ret_conv = ShutdownScript_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_ShutdownScript_new_p2wpkh(int8_tArray pubkey_hash) { - uint8_t pubkey_hash_arr[20]; - CHECK(pubkey_hash->arr_len == 20); - memcpy(pubkey_hash_arr, pubkey_hash->elems, 20); FREE(pubkey_hash); - uint8_t (*pubkey_hash_ref)[20] = &pubkey_hash_arr; - LDKShutdownScript ret_var = ShutdownScript_new_p2wpkh(pubkey_hash_ref); - int64_t ret_ref = 0; - 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_ShutdownScript_new_p2wsh(int8_tArray script_hash) { - uint8_t script_hash_arr[32]; - CHECK(script_hash->arr_len == 32); - memcpy(script_hash_arr, script_hash->elems, 32); FREE(script_hash); - uint8_t (*script_hash_ref)[32] = &script_hash_arr; - LDKShutdownScript ret_var = ShutdownScript_new_p2wsh(script_hash_ref); +int64_t CS_LDK_VerifiedInvoiceRequest_payer_note(int64_t this_arg) { + 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; + LDKPrintableString ret_var = VerifiedInvoiceRequest_payer_note(&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_ShutdownScript_new_witness_program(int64_t witness_program) { - void* witness_program_ptr = untag_ptr(witness_program); - CHECK_ACCESS(witness_program_ptr); - LDKWitnessProgram witness_program_conv = *(LDKWitnessProgram*)(witness_program_ptr); - witness_program_conv = WitnessProgram_clone((LDKWitnessProgram*)untag_ptr(witness_program)); - LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); - *ret_conv = ShutdownScript_new_witness_program(witness_program_conv); +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_BlindedPaymentPathZ 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(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); + else + payment_paths_constr.data = NULL; + int64_t* payment_paths_vals = payment_paths->elems; + for (size_t u = 0; u < payment_paths_constr.datalen; u++) { + int64_t payment_paths_conv_20 = payment_paths_vals[u]; + LDKBlindedPaymentPath payment_paths_conv_20_conv; + payment_paths_conv_20_conv.inner = untag_ptr(payment_paths_conv_20); + payment_paths_conv_20_conv.is_owned = ptr_is_owned(payment_paths_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_paths_conv_20_conv); + payment_paths_conv_20_conv = BlindedPaymentPath_clone(&payment_paths_conv_20_conv); + payment_paths_constr.data[u] = payment_paths_conv_20_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); } -int8_tArray CS_LDK_ShutdownScript_into_inner(int64_t this_arg) { - LDKShutdownScript this_arg_conv; +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 = ShutdownScript_clone(&this_arg_conv); - LDKCVec_u8Z ret_var = ShutdownScript_into_inner(this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; + this_arg_conv.is_owned = false; + LDKCVec_BlindedPaymentPathZ 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(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); + else + payment_paths_constr.data = NULL; + int64_t* payment_paths_vals = payment_paths->elems; + for (size_t u = 0; u < payment_paths_constr.datalen; u++) { + int64_t payment_paths_conv_20 = payment_paths_vals[u]; + LDKBlindedPaymentPath payment_paths_conv_20_conv; + payment_paths_conv_20_conv.inner = untag_ptr(payment_paths_conv_20); + payment_paths_conv_20_conv.is_owned = ptr_is_owned(payment_paths_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_paths_conv_20_conv); + payment_paths_conv_20_conv = BlindedPaymentPath_clone(&payment_paths_conv_20_conv); + payment_paths_constr.data[u] = payment_paths_conv_20_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); } -int8_tArray CS_LDK_ShutdownScript_as_legacy_pubkey(int64_t this_arg) { - LDKShutdownScript this_arg_conv; +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; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, ShutdownScript_as_legacy_pubkey(&this_arg_conv).compressed_form, 33); - return ret_arr; + LDKCVec_BlindedPaymentPathZ 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(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); + else + payment_paths_constr.data = NULL; + int64_t* payment_paths_vals = payment_paths->elems; + for (size_t u = 0; u < payment_paths_constr.datalen; u++) { + int64_t payment_paths_conv_20 = payment_paths_vals[u]; + LDKBlindedPaymentPath payment_paths_conv_20_conv; + payment_paths_conv_20_conv.inner = untag_ptr(payment_paths_conv_20); + payment_paths_conv_20_conv.is_owned = ptr_is_owned(payment_paths_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_paths_conv_20_conv); + payment_paths_conv_20_conv = BlindedPaymentPath_clone(&payment_paths_conv_20_conv); + payment_paths_constr.data[u] = payment_paths_conv_20_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); } -jboolean CS_LDK_ShutdownScript_is_compatible(int64_t this_arg, int64_t features) { - LDKShutdownScript this_arg_conv; +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; - LDKInitFeatures features_conv; - features_conv.inner = untag_ptr(features); - features_conv.is_owned = ptr_is_owned(features); - CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); - features_conv.is_owned = false; - jboolean ret_conv = ShutdownScript_is_compatible(&this_arg_conv, &features_conv); - return ret_conv; + LDKCVec_BlindedPaymentPathZ 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(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); + else + payment_paths_constr.data = NULL; + int64_t* payment_paths_vals = payment_paths->elems; + for (size_t u = 0; u < payment_paths_constr.datalen; u++) { + int64_t payment_paths_conv_20 = payment_paths_vals[u]; + LDKBlindedPaymentPath payment_paths_conv_20_conv; + payment_paths_conv_20_conv.inner = untag_ptr(payment_paths_conv_20); + payment_paths_conv_20_conv.is_owned = ptr_is_owned(payment_paths_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_paths_conv_20_conv); + payment_paths_conv_20_conv = BlindedPaymentPath_clone(&payment_paths_conv_20_conv); + payment_paths_constr.data[u] = payment_paths_conv_20_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); } -jstring CS_LDK_ShutdownScript_to_str(int64_t o) { - LDKShutdownScript o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = ShutdownScript_to_str(&o_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; +int8_tArray CS_LDK_UnsignedInvoiceRequest_write(int64_t obj) { + LDKUnsignedInvoiceRequest 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 = UnsignedInvoiceRequest_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -void CS_LDK_ChannelId_free(int64_t this_obj) { - LDKChannelId this_obj_conv; +int8_tArray CS_LDK_InvoiceRequest_write(int64_t obj) { + LDKInvoiceRequest obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = InvoiceRequest_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +void 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); - ChannelId_free(this_obj_conv); + InvoiceRequestFields_free(this_obj_conv); } -int8_tArray CS_LDK_ChannelId_get_a(int64_t this_ptr) { - LDKChannelId this_ptr_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(32, __LINE__); - memcpy(ret_arr->elems, *ChannelId_get_a(&this_ptr_conv), 32); + 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_ChannelId_set_a(int64_t this_ptr, int8_tArray val) { - LDKChannelId this_ptr_conv; +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; - 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); + 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_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; -} +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; +} -static inline uint64_t ChannelId_clone_ptr(LDKChannelId *NONNULL_PTR arg) { - LDKChannelId ret_var = ChannelId_clone(arg); +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; } -int64_t CS_LDK_ChannelId_clone_ptr(int64_t arg) { - LDKChannelId arg_conv; + +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 = ChannelId_clone_ptr(&arg_conv); + int64_t ret_conv = InvoiceRequestFields_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_ChannelId_clone(int64_t orig) { - LDKChannelId orig_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; - LDKChannelId ret_var = ChannelId_clone(&orig_conv); + 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_ChannelId_eq(int64_t a, int64_t b) { - LDKChannelId a_conv; +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; - LDKChannelId b_conv; + 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 = ChannelId_eq(&a_conv, &b_conv); + jboolean ret_conv = InvoiceRequestFields_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; +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_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 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); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + TaggedHash_free(this_obj_conv); +} + +static inline uint64_t TaggedHash_clone_ptr(LDKTaggedHash *NONNULL_PTR arg) { + LDKTaggedHash ret_var = TaggedHash_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_TaggedHash_clone_ptr(int64_t arg) { + LDKTaggedHash 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 = TaggedHash_clone_ptr(&arg_conv); + return ret_conv; +} -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 CS_LDK_TaggedHash_clone(int64_t orig) { + LDKTaggedHash 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; + LDKTaggedHash ret_var = TaggedHash_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_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); +int8_tArray CS_LDK_TaggedHash_as_digest(int64_t this_arg) { + LDKTaggedHash this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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, *TaggedHash_as_digest(&this_arg_conv), 32); + return ret_arr; +} + +jstring CS_LDK_TaggedHash_tag(int64_t this_arg) { + LDKTaggedHash this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKStr ret_str = TaggedHash_tag(&this_arg_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +int8_tArray CS_LDK_TaggedHash_merkle_root(int64_t this_arg) { + LDKTaggedHash this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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, TaggedHash_merkle_root(&this_arg_conv).data, 32); + 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_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); +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_ChannelId_new_zero() { - LDKChannelId ret_var = ChannelId_new_zero(); +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_Nonce_free(int64_t this_obj) { + LDKNonce this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Nonce_free(this_obj_conv); +} + +static inline uint64_t Nonce_clone_ptr(LDKNonce *NONNULL_PTR arg) { + LDKNonce ret_var = Nonce_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; } - -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); +int64_t CS_LDK_Nonce_clone_ptr(int64_t arg) { + LDKNonce 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 = Nonce_clone_ptr(&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 CS_LDK_Nonce_clone(int64_t orig) { + LDKNonce 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; + LDKNonce ret_var = Nonce_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_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); +jboolean CS_LDK_Nonce_eq(int64_t a, int64_t b) { + LDKNonce a_conv; + 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; + LDKNonce 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 = Nonce_eq(&a_conv, &b_conv); + return ret_conv; +} + +int64_t CS_LDK_Nonce_from_entropy_source(int64_t entropy_source) { + 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); + } + LDKNonce ret_var = Nonce_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; } -int8_tArray CS_LDK_ChannelId_write(int64_t obj) { - LDKChannelId obj_conv; +int8_tArray CS_LDK_Nonce_as_slice(int64_t this_arg) { + LDKNonce this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKu8slice ret_var = Nonce_as_slice(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + return ret_arr; +} + +int8_tArray CS_LDK_Nonce_write(int64_t obj) { + LDKNonce 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); + LDKCVec_u8Z ret_var = Nonce_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) { +int64_t CS_LDK_Nonce_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); + LDKCResult_NonceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonceDecodeErrorZ), "LDKCResult_NonceDecodeErrorZ"); + *ret_conv = Nonce_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -jstring CS_LDK_ChannelId_to_str(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; - LDKStr ret_str = ChannelId_to_str(&o_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; +void CS_LDK_Bolt12ParseError_free(int64_t this_obj) { + LDKBolt12ParseError this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Bolt12ParseError_free(this_obj_conv); } -void CS_LDK_Retry_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); - LDKRetry this_ptr_conv = *(LDKRetry*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Retry_free(this_ptr_conv); +static inline uint64_t Bolt12ParseError_clone_ptr(LDKBolt12ParseError *NONNULL_PTR arg) { + LDKBolt12ParseError ret_var = Bolt12ParseError_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_Bolt12ParseError_clone_ptr(int64_t arg) { + LDKBolt12ParseError 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 = Bolt12ParseError_clone_ptr(&arg_conv); + return ret_conv; } -static inline uint64_t Retry_clone_ptr(LDKRetry *NONNULL_PTR arg) { - LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); - *ret_copy = Retry_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); +int64_t CS_LDK_Bolt12ParseError_clone(int64_t orig) { + LDKBolt12ParseError 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; + LDKBolt12ParseError ret_var = Bolt12ParseError_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_Retry_clone_ptr(int64_t arg) { - LDKRetry* arg_conv = (LDKRetry*)untag_ptr(arg); - int64_t ret_conv = Retry_clone_ptr(arg_conv); + +int32_t CS_LDK_Bolt12SemanticError_clone(int64_t orig) { + LDKBolt12SemanticError* orig_conv = (LDKBolt12SemanticError*)untag_ptr(orig); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_clone(orig_conv)); return ret_conv; } -int64_t CS_LDK_Retry_clone(int64_t orig) { - LDKRetry* orig_conv = (LDKRetry*)untag_ptr(orig); - LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); - *ret_copy = Retry_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_Bolt12SemanticError_already_expired() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_already_expired()); + return ret_conv; } -int64_t CS_LDK_Retry_attempts(int32_t a) { - LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); - *ret_copy = Retry_attempts(a); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_Bolt12SemanticError_unsupported_chain() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unsupported_chain()); + return ret_conv; } -int64_t CS_LDK_Retry_timeout(int64_t a) { - LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); - *ret_copy = Retry_timeout(a); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_Bolt12SemanticError_unexpected_chain() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unexpected_chain()); + return ret_conv; } -jboolean CS_LDK_Retry_eq(int64_t a, int64_t b) { - LDKRetry* a_conv = (LDKRetry*)untag_ptr(a); - LDKRetry* b_conv = (LDKRetry*)untag_ptr(b); - jboolean ret_conv = Retry_eq(a_conv, b_conv); +int32_t CS_LDK_Bolt12SemanticError_missing_amount() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_amount()); return ret_conv; } -int64_t CS_LDK_Retry_hash(int64_t o) { - LDKRetry* o_conv = (LDKRetry*)untag_ptr(o); - int64_t ret_conv = Retry_hash(o_conv); +int32_t CS_LDK_Bolt12SemanticError_invalid_amount() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_invalid_amount()); return ret_conv; } -int8_tArray CS_LDK_Retry_write(int64_t obj) { - LDKRetry* obj_conv = (LDKRetry*)untag_ptr(obj); - LDKCVec_u8Z ret_var = Retry_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_Bolt12SemanticError_insufficient_amount() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_insufficient_amount()); + return ret_conv; } -int64_t CS_LDK_Retry_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_RetryDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RetryDecodeErrorZ), "LDKCResult_RetryDecodeErrorZ"); - *ret_conv = Retry_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +int32_t CS_LDK_Bolt12SemanticError_unexpected_amount() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unexpected_amount()); + return ret_conv; } -int32_t CS_LDK_RetryableSendFailure_clone(int64_t orig) { - LDKRetryableSendFailure* orig_conv = (LDKRetryableSendFailure*)untag_ptr(orig); - int32_t ret_conv = LDKRetryableSendFailure_to_cs(RetryableSendFailure_clone(orig_conv)); +int32_t CS_LDK_Bolt12SemanticError_unsupported_currency() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unsupported_currency()); return ret_conv; } -int32_t CS_LDK_RetryableSendFailure_payment_expired() { - int32_t ret_conv = LDKRetryableSendFailure_to_cs(RetryableSendFailure_payment_expired()); +int32_t CS_LDK_Bolt12SemanticError_unknown_required_features() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unknown_required_features()); return ret_conv; } -int32_t CS_LDK_RetryableSendFailure_route_not_found() { - int32_t ret_conv = LDKRetryableSendFailure_to_cs(RetryableSendFailure_route_not_found()); +int32_t CS_LDK_Bolt12SemanticError_unexpected_features() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unexpected_features()); return ret_conv; } -int32_t CS_LDK_RetryableSendFailure_duplicate_payment() { - int32_t ret_conv = LDKRetryableSendFailure_to_cs(RetryableSendFailure_duplicate_payment()); +int32_t CS_LDK_Bolt12SemanticError_missing_description() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_description()); return ret_conv; } -jboolean CS_LDK_RetryableSendFailure_eq(int64_t a, int64_t b) { - LDKRetryableSendFailure* a_conv = (LDKRetryableSendFailure*)untag_ptr(a); - LDKRetryableSendFailure* b_conv = (LDKRetryableSendFailure*)untag_ptr(b); - jboolean ret_conv = RetryableSendFailure_eq(a_conv, b_conv); +int32_t CS_LDK_Bolt12SemanticError_missing_signing_pubkey() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_signing_pubkey()); return ret_conv; } -void CS_LDK_PaymentSendFailure_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); - LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - PaymentSendFailure_free(this_ptr_conv); +int32_t CS_LDK_Bolt12SemanticError_invalid_signing_pubkey() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_invalid_signing_pubkey()); + return ret_conv; } -static inline uint64_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg) { - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = PaymentSendFailure_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_Bolt12SemanticError_unexpected_signing_pubkey() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unexpected_signing_pubkey()); + return ret_conv; } -int64_t CS_LDK_PaymentSendFailure_clone_ptr(int64_t arg) { - LDKPaymentSendFailure* arg_conv = (LDKPaymentSendFailure*)untag_ptr(arg); - int64_t ret_conv = PaymentSendFailure_clone_ptr(arg_conv); + +int32_t CS_LDK_Bolt12SemanticError_missing_quantity() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_quantity()); return ret_conv; } -int64_t CS_LDK_PaymentSendFailure_clone(int64_t orig) { - LDKPaymentSendFailure* orig_conv = (LDKPaymentSendFailure*)untag_ptr(orig); - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = PaymentSendFailure_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_Bolt12SemanticError_invalid_quantity() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_invalid_quantity()); + return ret_conv; } -int64_t CS_LDK_PaymentSendFailure_parameter_error(int64_t a) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKAPIError a_conv = *(LDKAPIError*)(a_ptr); - a_conv = APIError_clone((LDKAPIError*)untag_ptr(a)); - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = PaymentSendFailure_parameter_error(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_Bolt12SemanticError_unexpected_quantity() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unexpected_quantity()); + return ret_conv; } -int64_t CS_LDK_PaymentSendFailure_path_parameter_error(int64_tArray a) { - LDKCVec_CResult_NoneAPIErrorZZ a_constr; - a_constr.datalen = a->arr_len; - if (a_constr.datalen > 0) - a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements"); - else - a_constr.data = NULL; - int64_t* a_vals = a->elems; - for (size_t w = 0; w < a_constr.datalen; w++) { - int64_t a_conv_22 = a_vals[w]; - void* a_conv_22_ptr = untag_ptr(a_conv_22); - CHECK_ACCESS(a_conv_22_ptr); - LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(a_conv_22_ptr); - a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)untag_ptr(a_conv_22)); - a_constr.data[w] = a_conv_22_conv; - } - FREE(a); - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = PaymentSendFailure_path_parameter_error(a_constr); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_Bolt12SemanticError_invalid_metadata() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_invalid_metadata()); + return ret_conv; } -int64_t CS_LDK_PaymentSendFailure_all_failed_resend_safe(int64_tArray a) { - LDKCVec_APIErrorZ a_constr; - a_constr.datalen = a->arr_len; - if (a_constr.datalen > 0) - a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements"); - else - a_constr.data = NULL; - int64_t* a_vals = a->elems; - for (size_t k = 0; k < a_constr.datalen; k++) { - int64_t a_conv_10 = a_vals[k]; - void* a_conv_10_ptr = untag_ptr(a_conv_10); - CHECK_ACCESS(a_conv_10_ptr); - LDKAPIError a_conv_10_conv = *(LDKAPIError*)(a_conv_10_ptr); - a_conv_10_conv = APIError_clone((LDKAPIError*)untag_ptr(a_conv_10)); - a_constr.data[k] = a_conv_10_conv; - } - FREE(a); - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = PaymentSendFailure_all_failed_resend_safe(a_constr); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_Bolt12SemanticError_unexpected_metadata() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unexpected_metadata()); + return ret_conv; } -int64_t CS_LDK_PaymentSendFailure_duplicate_payment() { - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = PaymentSendFailure_duplicate_payment(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_Bolt12SemanticError_missing_payer_metadata() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_payer_metadata()); + return ret_conv; } -int64_t CS_LDK_PaymentSendFailure_partial_failure(int64_tArray results, int64_t failed_paths_retry, int8_tArray payment_id) { - LDKCVec_CResult_NoneAPIErrorZZ results_constr; - results_constr.datalen = results->arr_len; - if (results_constr.datalen > 0) - results_constr.data = MALLOC(results_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements"); - else - results_constr.data = NULL; - int64_t* results_vals = results->elems; - for (size_t w = 0; w < results_constr.datalen; w++) { - int64_t results_conv_22 = results_vals[w]; - void* results_conv_22_ptr = untag_ptr(results_conv_22); - CHECK_ACCESS(results_conv_22_ptr); - LDKCResult_NoneAPIErrorZ results_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(results_conv_22_ptr); - results_constr.data[w] = results_conv_22_conv; - } - FREE(results); - LDKRouteParameters failed_paths_retry_conv; - failed_paths_retry_conv.inner = untag_ptr(failed_paths_retry); - failed_paths_retry_conv.is_owned = ptr_is_owned(failed_paths_retry); - CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_conv); - failed_paths_retry_conv = RouteParameters_clone(&failed_paths_retry_conv); - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = PaymentSendFailure_partial_failure(results_constr, failed_paths_retry_conv, payment_id_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_Bolt12SemanticError_missing_payer_id() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_payer_id()); + return ret_conv; } -jboolean CS_LDK_PaymentSendFailure_eq(int64_t a, int64_t b) { - LDKPaymentSendFailure* a_conv = (LDKPaymentSendFailure*)untag_ptr(a); - LDKPaymentSendFailure* b_conv = (LDKPaymentSendFailure*)untag_ptr(b); - jboolean ret_conv = PaymentSendFailure_eq(a_conv, b_conv); +int32_t CS_LDK_Bolt12SemanticError_duplicate_payment_id() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_duplicate_payment_id()); return ret_conv; } -void CS_LDK_ProbeSendFailure_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); - LDKProbeSendFailure this_ptr_conv = *(LDKProbeSendFailure*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - ProbeSendFailure_free(this_ptr_conv); +int32_t CS_LDK_Bolt12SemanticError_missing_paths() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_paths()); + return ret_conv; } -static inline uint64_t ProbeSendFailure_clone_ptr(LDKProbeSendFailure *NONNULL_PTR arg) { - LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); - *ret_copy = ProbeSendFailure_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_Bolt12SemanticError_unexpected_paths() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unexpected_paths()); + return ret_conv; } -int64_t CS_LDK_ProbeSendFailure_clone_ptr(int64_t arg) { - LDKProbeSendFailure* arg_conv = (LDKProbeSendFailure*)untag_ptr(arg); - int64_t ret_conv = ProbeSendFailure_clone_ptr(arg_conv); + +int32_t CS_LDK_Bolt12SemanticError_invalid_pay_info() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_invalid_pay_info()); return ret_conv; } -int64_t CS_LDK_ProbeSendFailure_clone(int64_t orig) { - LDKProbeSendFailure* orig_conv = (LDKProbeSendFailure*)untag_ptr(orig); - LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); - *ret_copy = ProbeSendFailure_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_Bolt12SemanticError_missing_creation_time() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_creation_time()); + return ret_conv; } -int64_t CS_LDK_ProbeSendFailure_route_not_found() { - LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); - *ret_copy = ProbeSendFailure_route_not_found(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_Bolt12SemanticError_missing_payment_hash() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_payment_hash()); + return ret_conv; } -int64_t CS_LDK_ProbeSendFailure_sending_failed(int64_t a) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKPaymentSendFailure a_conv = *(LDKPaymentSendFailure*)(a_ptr); - a_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(a)); - LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); - *ret_copy = ProbeSendFailure_sending_failed(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_Bolt12SemanticError_unexpected_payment_hash() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unexpected_payment_hash()); + return ret_conv; } -jboolean CS_LDK_ProbeSendFailure_eq(int64_t a, int64_t b) { - LDKProbeSendFailure* a_conv = (LDKProbeSendFailure*)untag_ptr(a); - LDKProbeSendFailure* b_conv = (LDKProbeSendFailure*)untag_ptr(b); - jboolean ret_conv = ProbeSendFailure_eq(a_conv, b_conv); +int32_t CS_LDK_Bolt12SemanticError_missing_signature() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_signature()); return ret_conv; } -void CS_LDK_RecipientOnionFields_free(int64_t this_obj) { - LDKRecipientOnionFields this_obj_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); - RecipientOnionFields_free(this_obj_conv); -} - -int64_t CS_LDK_RecipientOnionFields_get_payment_secret(int64_t this_ptr) { - LDKRecipientOnionFields this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); - *ret_copy = RecipientOnionFields_get_payment_secret(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -void CS_LDK_RecipientOnionFields_set_payment_secret(int64_t this_ptr, int64_t val) { - LDKRecipientOnionFields this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_ThirtyTwoBytesZ val_conv = *(LDKCOption_ThirtyTwoBytesZ*)(val_ptr); - val_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(val)); - RecipientOnionFields_set_payment_secret(&this_ptr_conv, val_conv); -} - -int64_t CS_LDK_RecipientOnionFields_get_payment_metadata(int64_t this_ptr) { - LDKRecipientOnionFields this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = RecipientOnionFields_get_payment_metadata(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -void CS_LDK_RecipientOnionFields_set_payment_metadata(int64_t this_ptr, int64_t val) { - LDKRecipientOnionFields this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_CVec_u8ZZ val_conv = *(LDKCOption_CVec_u8ZZ*)(val_ptr); - val_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(val)); - RecipientOnionFields_set_payment_metadata(&this_ptr_conv, val_conv); + RefundMaybeWithDerivedMetadataBuilder_free(this_obj_conv); } -static inline uint64_t RecipientOnionFields_clone_ptr(LDKRecipientOnionFields *NONNULL_PTR arg) { - LDKRecipientOnionFields ret_var = RecipientOnionFields_clone(arg); +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_RecipientOnionFields_clone_ptr(int64_t arg) { - LDKRecipientOnionFields arg_conv; +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 = RecipientOnionFields_clone_ptr(&arg_conv); + int64_t ret_conv = RefundMaybeWithDerivedMetadataBuilder_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_RecipientOnionFields_clone(int64_t orig) { - LDKRecipientOnionFields orig_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; - LDKRecipientOnionFields ret_var = RecipientOnionFields_clone(&orig_conv); + 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; } -jboolean CS_LDK_RecipientOnionFields_eq(int64_t a, int64_t b) { - LDKRecipientOnionFields a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKRecipientOnionFields b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = RecipientOnionFields_eq(&a_conv, &b_conv); - return ret_conv; -} - -int8_tArray CS_LDK_RecipientOnionFields_write(int64_t obj) { - LDKRecipientOnionFields obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = RecipientOnionFields_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +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_RecipientOnionFields_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_RecipientOnionFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsDecodeErrorZ), "LDKCResult_RecipientOnionFieldsDecodeErrorZ"); - *ret_conv = RecipientOnionFields_read(ser_ref); - FREE(ser); +int64_t CS_LDK_RefundMaybeWithDerivedMetadataBuilder_deriving_payer_id(int8_tArray node_id, int64_t expanded_key, int64_t nonce, 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; + LDKNonce nonce_conv; + nonce_conv.inner = untag_ptr(nonce); + nonce_conv.is_owned = ptr_is_owned(nonce); + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_conv); + nonce_conv = Nonce_clone(&nonce_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, nonce_conv, amount_msats, payment_id_ref); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_RecipientOnionFields_secret_only(int8_tArray payment_secret) { - LDKThirtyTwoBytes payment_secret_ref; - CHECK(payment_secret->arr_len == 32); - memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret); - LDKRecipientOnionFields ret_var = RecipientOnionFields_secret_only(payment_secret_ref); - int64_t ret_ref = 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_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); } -int64_t CS_LDK_RecipientOnionFields_spontaneous_empty() { - LDKRecipientOnionFields ret_var = RecipientOnionFields_spontaneous_empty(); - int64_t ret_ref = 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_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); } -int64_t CS_LDK_RecipientOnionFields_with_custom_tlvs(int64_t this_arg, int64_tArray custom_tlvs) { - LDKRecipientOnionFields this_arg_conv; +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 = RecipientOnionFields_clone(&this_arg_conv); - LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs_constr; - custom_tlvs_constr.datalen = custom_tlvs->arr_len; - if (custom_tlvs_constr.datalen > 0) - custom_tlvs_constr.data = MALLOC(custom_tlvs_constr.datalen * sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKCVec_C2Tuple_u64CVec_u8ZZZ Elements"); - else - custom_tlvs_constr.data = NULL; - int64_t* custom_tlvs_vals = custom_tlvs->elems; - for (size_t x = 0; x < custom_tlvs_constr.datalen; x++) { - int64_t custom_tlvs_conv_23 = custom_tlvs_vals[x]; - void* custom_tlvs_conv_23_ptr = untag_ptr(custom_tlvs_conv_23); - CHECK_ACCESS(custom_tlvs_conv_23_ptr); - LDKC2Tuple_u64CVec_u8ZZ custom_tlvs_conv_23_conv = *(LDKC2Tuple_u64CVec_u8ZZ*)(custom_tlvs_conv_23_ptr); - custom_tlvs_conv_23_conv = C2Tuple_u64CVec_u8ZZ_clone((LDKC2Tuple_u64CVec_u8ZZ*)untag_ptr(custom_tlvs_conv_23)); - custom_tlvs_constr.data[x] = custom_tlvs_conv_23_conv; - } - FREE(custom_tlvs); - LDKCResult_RecipientOnionFieldsNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsNoneZ), "LDKCResult_RecipientOnionFieldsNoneZ"); - *ret_conv = RecipientOnionFields_with_custom_tlvs(this_arg_conv, custom_tlvs_constr); - return tag_ptr(ret_conv, true); + this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKStr issuer_conv = str_ref_to_owned_c(issuer); + RefundMaybeWithDerivedMetadataBuilder_issuer(this_arg_conv, issuer_conv); } -int64_tArray CS_LDK_RecipientOnionFields_custom_tlvs(int64_t this_arg) { - LDKRecipientOnionFields this_arg_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.is_owned = false; - LDKCVec_C2Tuple_u64CVec_u8ZZZ ret_var = RecipientOnionFields_custom_tlvs(&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 x = 0; x < ret_var.datalen; x++) { - LDKC2Tuple_u64CVec_u8ZZ* ret_conv_23_conv = MALLOC(sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKC2Tuple_u64CVec_u8ZZ"); - *ret_conv_23_conv = ret_var.data[x]; - ret_arr_ptr[x] = tag_ptr(ret_conv_23_conv, true); - } - - FREE(ret_var.data); - return ret_arr; + this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKBlindedMessagePath 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 = BlindedMessagePath_clone(&path_conv); + RefundMaybeWithDerivedMetadataBuilder_path(this_arg_conv, path_conv); } -void CS_LDK_CustomMessageReader_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); - LDKCustomMessageReader this_ptr_conv = *(LDKCustomMessageReader*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - CustomMessageReader_free(this_ptr_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); } -static inline uint64_t Type_clone_ptr(LDKType *NONNULL_PTR arg) { - LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType"); - *ret_ret = Type_clone(arg); - return tag_ptr(ret_ret, true); -} -int64_t CS_LDK_Type_clone_ptr(int64_t arg) { - void* arg_ptr = untag_ptr(arg); - if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); } - LDKType* arg_conv = (LDKType*)arg_ptr; - int64_t ret_conv = Type_clone_ptr(arg_conv); - return ret_conv; +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); } -int64_t CS_LDK_Type_clone(int64_t orig) { - void* orig_ptr = untag_ptr(orig); - if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); } - LDKType* orig_conv = (LDKType*)orig_ptr; - LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType"); - *ret_ret = Type_clone(orig_conv); - return tag_ptr(ret_ret, true); +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); } -void CS_LDK_Type_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); - LDKType this_ptr_conv = *(LDKType*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Type_free(this_ptr_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_OfferId_free(int64_t this_obj) { - LDKOfferId this_obj_conv; +void CS_LDK_Refund_free(int64_t this_obj) { + LDKRefund this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - 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; + Refund_free(this_obj_conv); } -static inline uint64_t OfferId_clone_ptr(LDKOfferId *NONNULL_PTR arg) { - LDKOfferId ret_var = OfferId_clone(arg); +static inline uint64_t Refund_clone_ptr(LDKRefund *NONNULL_PTR arg) { + LDKRefund ret_var = Refund_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; +int64_t CS_LDK_Refund_clone_ptr(int64_t arg) { + LDKRefund arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = OfferId_clone_ptr(&arg_conv); + int64_t ret_conv = Refund_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_OfferId_clone(int64_t orig) { - LDKOfferId orig_conv; +int64_t CS_LDK_Refund_clone(int64_t orig) { + LDKRefund orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKOfferId ret_var = OfferId_clone(&orig_conv); + LDKRefund ret_var = Refund_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_Refund_description(int64_t this_arg) { + LDKRefund this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKPrintableString ret_var = Refund_description(&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_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); +int64_t CS_LDK_Refund_absolute_expiry(int64_t this_arg) { + LDKRefund this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = Refund_absolute_expiry(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); 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); +jboolean CS_LDK_Refund_is_expired(int64_t this_arg) { + LDKRefund this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Refund_is_expired(&this_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; +jboolean CS_LDK_Refund_is_expired_no_std(int64_t this_arg, int64_t duration_since_epoch) { + LDKRefund this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Refund_is_expired_no_std(&this_arg_conv, duration_since_epoch); + return ret_conv; } -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 CS_LDK_Refund_issuer(int64_t this_arg) { + LDKRefund this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKPrintableString ret_var = Refund_issuer(&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_OfferWithExplicitMetadataBuilder_metadata(int64_t this_arg, int8_tArray metadata) { - LDKOfferWithExplicitMetadataBuilder this_arg_conv; +int64_tArray CS_LDK_Refund_paths(int64_t this_arg) { + LDKRefund this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = 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); + this_arg_conv.is_owned = false; + LDKCVec_BlindedMessagePathZ ret_var = Refund_paths(&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 u = 0; u < ret_var.datalen; u++) { + LDKBlindedMessagePath ret_conv_20_var = ret_var.data[u]; + int64_t ret_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_20_var); + ret_conv_20_ref = tag_ptr(ret_conv_20_var.inner, ret_conv_20_var.is_owned); + ret_arr_ptr[u] = ret_conv_20_ref; + } + + FREE(ret_var.data); + return ret_arr; } -void CS_LDK_OfferWithExplicitMetadataBuilder_chain(int64_t this_arg, int32_t network) { - LDKOfferWithExplicitMetadataBuilder this_arg_conv; +int8_tArray CS_LDK_Refund_payer_metadata(int64_t this_arg) { + LDKRefund this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); - LDKNetwork network_conv = LDKNetwork_from_cs(network); - OfferWithExplicitMetadataBuilder_chain(this_arg_conv, network_conv); + this_arg_conv.is_owned = false; + LDKu8slice ret_var = Refund_payer_metadata(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + return ret_arr; } -void CS_LDK_OfferWithExplicitMetadataBuilder_amount_msats(int64_t this_arg, int64_t amount_msats) { - LDKOfferWithExplicitMetadataBuilder this_arg_conv; +int8_tArray CS_LDK_Refund_chain(int64_t this_arg) { + LDKRefund this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); - OfferWithExplicitMetadataBuilder_amount_msats(this_arg_conv, amount_msats); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, Refund_chain(&this_arg_conv).data, 32); + return ret_arr; } -void CS_LDK_OfferWithExplicitMetadataBuilder_absolute_expiry(int64_t this_arg, int64_t absolute_expiry) { - LDKOfferWithExplicitMetadataBuilder this_arg_conv; +int64_t CS_LDK_Refund_amount_msats(int64_t this_arg) { + LDKRefund this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); - OfferWithExplicitMetadataBuilder_absolute_expiry(this_arg_conv, absolute_expiry); + this_arg_conv.is_owned = false; + int64_t ret_conv = Refund_amount_msats(&this_arg_conv); + return ret_conv; } -void CS_LDK_OfferWithExplicitMetadataBuilder_description(int64_t this_arg, jstring description) { - LDKOfferWithExplicitMetadataBuilder this_arg_conv; +int64_t CS_LDK_Refund_features(int64_t this_arg) { + LDKRefund this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); - LDKStr description_conv = str_ref_to_owned_c(description); - OfferWithExplicitMetadataBuilder_description(this_arg_conv, description_conv); + this_arg_conv.is_owned = false; + LDKInvoiceRequestFeatures ret_var = Refund_features(&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_OfferWithExplicitMetadataBuilder_issuer(int64_t this_arg, jstring issuer) { - LDKOfferWithExplicitMetadataBuilder this_arg_conv; +int64_t CS_LDK_Refund_quantity(int64_t this_arg) { + LDKRefund this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); - LDKStr issuer_conv = str_ref_to_owned_c(issuer); - OfferWithExplicitMetadataBuilder_issuer(this_arg_conv, issuer_conv); + this_arg_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = Refund_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_OfferWithExplicitMetadataBuilder_path(int64_t this_arg, int64_t path) { - LDKOfferWithExplicitMetadataBuilder this_arg_conv; +int8_tArray CS_LDK_Refund_payer_id(int64_t this_arg) { + LDKRefund this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = 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); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, Refund_payer_id(&this_arg_conv).compressed_form, 33); + return ret_arr; } -void CS_LDK_OfferWithExplicitMetadataBuilder_supported_quantity(int64_t this_arg, int64_t quantity) { - LDKOfferWithExplicitMetadataBuilder this_arg_conv; +int64_t CS_LDK_Refund_payer_note(int64_t this_arg) { + LDKRefund this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = 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); + this_arg_conv.is_owned = false; + LDKPrintableString ret_var = Refund_payer_note(&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_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); +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; +} + +int64_t CS_LDK_Refund_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_RefundDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundDecodeErrorZ), "LDKCResult_RefundDecodeErrorZ"); + *ret_conv = Refund_read(ser_ref); + FREE(ser); 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; +int8_tArray CS_LDK_Refund_write(int64_t obj) { + LDKRefund obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = Refund_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -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); +int64_t CS_LDK_Refund_from_str(jstring s) { + LDKStr s_conv = str_ref_to_owned_c(s); + LDKCResult_RefundBolt12ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundBolt12ParseErrorZ), "LDKCResult_RefundBolt12ParseErrorZ"); + *ret_conv = Refund_from_str(s_conv); + return tag_ptr(ret_conv, true); } -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); +jstring CS_LDK_Refund_to_str(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; + LDKStr ret_str = Refund_to_str(&o_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; } -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); +int32_t CS_LDK_UtxoLookupError_clone(int64_t orig) { + LDKUtxoLookupError* orig_conv = (LDKUtxoLookupError*)untag_ptr(orig); + int32_t ret_conv = LDKUtxoLookupError_to_cs(UtxoLookupError_clone(orig_conv)); + return ret_conv; } -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); +int32_t CS_LDK_UtxoLookupError_unknown_chain() { + int32_t ret_conv = LDKUtxoLookupError_to_cs(UtxoLookupError_unknown_chain()); + return ret_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); +int32_t CS_LDK_UtxoLookupError_unknown_tx() { + int32_t ret_conv = LDKUtxoLookupError_to_cs(UtxoLookupError_unknown_tx()); + return ret_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_UtxoResult_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); + LDKUtxoResult this_ptr_conv = *(LDKUtxoResult*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + UtxoResult_free(this_ptr_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); +static inline uint64_t UtxoResult_clone_ptr(LDKUtxoResult *NONNULL_PTR arg) { + LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult"); + *ret_copy = UtxoResult_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_UtxoResult_clone_ptr(int64_t arg) { + LDKUtxoResult* arg_conv = (LDKUtxoResult*)untag_ptr(arg); + int64_t ret_conv = UtxoResult_clone_ptr(arg_conv); + return ret_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); +int64_t CS_LDK_UtxoResult_clone(int64_t orig) { + LDKUtxoResult* orig_conv = (LDKUtxoResult*)untag_ptr(orig); + LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult"); + *ret_copy = UtxoResult_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_Offer_free(int64_t this_obj) { - LDKOffer this_obj_conv; +int64_t CS_LDK_UtxoResult_sync(int64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKCResult_TxOutUtxoLookupErrorZ a_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(a_ptr); + a_conv = CResult_TxOutUtxoLookupErrorZ_clone((LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(a)); + LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult"); + *ret_copy = UtxoResult_sync(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_UtxoResult_async(int64_t a) { + LDKUtxoFuture a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = UtxoFuture_clone(&a_conv); + LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult"); + *ret_copy = UtxoResult_async(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_UtxoLookup_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); + LDKUtxoLookup this_ptr_conv = *(LDKUtxoLookup*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + UtxoLookup_free(this_ptr_conv); +} + +void CS_LDK_UtxoFuture_free(int64_t this_obj) { + LDKUtxoFuture this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Offer_free(this_obj_conv); + UtxoFuture_free(this_obj_conv); } -static inline uint64_t Offer_clone_ptr(LDKOffer *NONNULL_PTR arg) { - LDKOffer ret_var = Offer_clone(arg); +static inline uint64_t UtxoFuture_clone_ptr(LDKUtxoFuture *NONNULL_PTR arg) { + LDKUtxoFuture ret_var = UtxoFuture_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_Offer_clone_ptr(int64_t arg) { - LDKOffer arg_conv; +int64_t CS_LDK_UtxoFuture_clone_ptr(int64_t arg) { + LDKUtxoFuture arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Offer_clone_ptr(&arg_conv); + int64_t ret_conv = UtxoFuture_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_Offer_clone(int64_t orig) { - LDKOffer orig_conv; +int64_t CS_LDK_UtxoFuture_clone(int64_t orig) { + LDKUtxoFuture orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKOffer ret_var = Offer_clone(&orig_conv); + LDKUtxoFuture ret_var = UtxoFuture_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; } -ptrArray CS_LDK_Offer_chains(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; - LDKCVec_ThirtyTwoBytesZ ret_var = Offer_chains(&this_arg_conv); - ptrArray ret_arr = NULL; - ret_arr = init_ptrArray(ret_var.datalen, __LINE__); - int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8); - for (size_t i = 0; i < ret_var.datalen; i++) { - int8_tArray ret_conv_8_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_conv_8_arr->elems, ret_var.data[i].data, 32); - ret_arr_ptr[i] = ret_conv_8_arr; - } - - FREE(ret_var.data); - return ret_arr; +int64_t CS_LDK_UtxoFuture_new() { + LDKUtxoFuture ret_var = UtxoFuture_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_Offer_metadata(int64_t this_arg) { - LDKOffer this_arg_conv; +void CS_LDK_UtxoFuture_resolve_without_forwarding(int64_t this_arg, int64_t graph, int64_t result) { + LDKUtxoFuture this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = Offer_metadata(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKNetworkGraph graph_conv; + graph_conv.inner = untag_ptr(graph); + graph_conv.is_owned = ptr_is_owned(graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(graph_conv); + graph_conv.is_owned = false; + void* result_ptr = untag_ptr(result); + CHECK_ACCESS(result_ptr); + LDKCResult_TxOutUtxoLookupErrorZ result_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(result_ptr); + result_conv = CResult_TxOutUtxoLookupErrorZ_clone((LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(result)); + UtxoFuture_resolve_without_forwarding(&this_arg_conv, &graph_conv, result_conv); } -int64_t CS_LDK_Offer_amount(int64_t this_arg) { - LDKOffer this_arg_conv; +void CS_LDK_UtxoFuture_resolve(int64_t this_arg, int64_t graph, int64_t gossip, int64_t result) { + LDKUtxoFuture this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - 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; + LDKNetworkGraph graph_conv; + graph_conv.inner = untag_ptr(graph); + graph_conv.is_owned = ptr_is_owned(graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(graph_conv); + graph_conv.is_owned = false; + LDKP2PGossipSync gossip_conv; + gossip_conv.inner = untag_ptr(gossip); + gossip_conv.is_owned = ptr_is_owned(gossip); + CHECK_INNER_FIELD_ACCESS_OR_NULL(gossip_conv); + gossip_conv.is_owned = false; + void* result_ptr = untag_ptr(result); + CHECK_ACCESS(result_ptr); + LDKCResult_TxOutUtxoLookupErrorZ result_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(result_ptr); + result_conv = CResult_TxOutUtxoLookupErrorZ_clone((LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(result)); + UtxoFuture_resolve(&this_arg_conv, &graph_conv, &gossip_conv, result_conv); } -int64_t CS_LDK_Offer_description(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; - LDKPrintableString ret_var = Offer_description(&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_NodeId_free(int64_t this_obj) { + LDKNodeId this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + NodeId_free(this_obj_conv); } -int64_t CS_LDK_Offer_offer_features(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; - LDKOfferFeatures ret_var = Offer_offer_features(&this_arg_conv); +static inline uint64_t NodeId_clone_ptr(LDKNodeId *NONNULL_PTR arg) { + LDKNodeId ret_var = NodeId_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_Offer_absolute_expiry(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; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = Offer_absolute_expiry(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_NodeId_clone_ptr(int64_t arg) { + LDKNodeId arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = NodeId_clone_ptr(&arg_conv); + return ret_conv; } -int64_t CS_LDK_Offer_issuer(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; - LDKPrintableString ret_var = Offer_issuer(&this_arg_conv); +int64_t CS_LDK_NodeId_clone(int64_t orig) { + LDKNodeId orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKNodeId ret_var = NodeId_clone(&orig_conv); int64_t ret_ref = 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_Offer_paths(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; - LDKCVec_BlindedPathZ ret_var = Offer_paths(&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 n = 0; n < ret_var.datalen; n++) { - LDKBlindedPath 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_Offer_supported_quantity(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; - 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; -} - -int8_tArray CS_LDK_Offer_signing_pubkey(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; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, Offer_signing_pubkey(&this_arg_conv).compressed_form, 33); - return ret_arr; +jboolean CS_LDK_NodeId_eq(int64_t a, int64_t b) { + LDKNodeId a_conv; + 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; + LDKNodeId 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 = NodeId_eq(&a_conv, &b_conv); + return ret_conv; } -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 CS_LDK_NodeId_from_pubkey(int8_tArray pubkey) { + LDKPublicKey pubkey_ref; + CHECK(pubkey->arr_len == 33); + memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); FREE(pubkey); + LDKNodeId ret_var = NodeId_from_pubkey(pubkey_ref); int64_t ret_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); - this_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 chain_ref; - CHECK(chain->arr_len == 32); - memcpy(chain_ref.data, chain->elems, 32); FREE(chain); - jboolean ret_conv = Offer_supports_chain(&this_arg_conv, chain_ref); - return ret_conv; -} - -jboolean CS_LDK_Offer_is_expired(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; - jboolean ret_conv = Offer_is_expired(&this_arg_conv); - return ret_conv; -} - -jboolean CS_LDK_Offer_is_expired_no_std(int64_t this_arg, int64_t duration_since_epoch) { - LDKOffer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = Offer_is_expired_no_std(&this_arg_conv, duration_since_epoch); - return ret_conv; -} - -jboolean CS_LDK_Offer_is_valid_quantity(int64_t this_arg, int64_t quantity) { - LDKOffer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = Offer_is_valid_quantity(&this_arg_conv, quantity); - return ret_conv; +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); } -jboolean CS_LDK_Offer_expects_quantity(int64_t this_arg) { - LDKOffer this_arg_conv; +int8_tArray CS_LDK_NodeId_as_slice(int64_t this_arg) { + LDKNodeId this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = Offer_expects_quantity(&this_arg_conv); - return ret_conv; + LDKu8slice ret_var = NodeId_as_slice(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + return ret_arr; } -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; +int8_tArray CS_LDK_NodeId_as_array(int64_t this_arg) { + LDKNodeId this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - 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); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, *NodeId_as_array(&this_arg_conv), 33); + return ret_arr; } -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; +int64_t CS_LDK_NodeId_as_pubkey(int64_t this_arg) { + LDKNodeId this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - 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); + LDKCResult_PublicKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecp256k1ErrorZ), "LDKCResult_PublicKeySecp256k1ErrorZ"); + *ret_conv = NodeId_as_pubkey(&this_arg_conv); 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); +jstring CS_LDK_NodeId_to_str(int64_t o) { + LDKNodeId o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = NodeId_to_str(&o_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; } -int64_t CS_LDK_Offer_hash(int64_t o) { - LDKOffer o_conv; +int64_t CS_LDK_NodeId_hash(int64_t o) { + LDKNodeId o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv.is_owned = false; - int64_t ret_conv = Offer_hash(&o_conv); + int64_t ret_conv = NodeId_hash(&o_conv); return ret_conv; } -int8_tArray CS_LDK_Offer_write(int64_t obj) { - LDKOffer obj_conv; +int8_tArray CS_LDK_NodeId_write(int64_t obj) { + LDKNodeId obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = Offer_write(&obj_conv); + LDKCVec_u8Z ret_var = NodeId_write(&obj_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } -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_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 = (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 = (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_NodeId_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); + *ret_conv = NodeId_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -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; +void CS_LDK_NetworkGraph_free(int64_t this_obj) { + LDKNetworkGraph this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + NetworkGraph_free(this_obj_conv); } -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_ReadOnlyNetworkGraph_free(int64_t this_obj) { + LDKReadOnlyNetworkGraph this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ReadOnlyNetworkGraph_free(this_obj_conv); } -void CS_LDK_Quantity_free(int64_t this_ptr) { +void CS_LDK_NetworkUpdate_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); + LDKNetworkUpdate this_ptr_conv = *(LDKNetworkUpdate*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - Quantity_free(this_ptr_conv); + NetworkUpdate_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); +static inline uint64_t NetworkUpdate_clone_ptr(LDKNetworkUpdate *NONNULL_PTR arg) { + LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); + *ret_copy = NetworkUpdate_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); +int64_t CS_LDK_NetworkUpdate_clone_ptr(int64_t arg) { + LDKNetworkUpdate* arg_conv = (LDKNetworkUpdate*)untag_ptr(arg); + int64_t ret_conv = NetworkUpdate_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 CS_LDK_NetworkUpdate_clone(int64_t orig) { + LDKNetworkUpdate* orig_conv = (LDKNetworkUpdate*)untag_ptr(orig); + LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); + *ret_copy = NetworkUpdate_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 CS_LDK_NetworkUpdate_channel_failure(int64_t short_channel_id, jboolean is_permanent) { + LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); + *ret_copy = NetworkUpdate_channel_failure(short_channel_id, is_permanent); 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 CS_LDK_NetworkUpdate_node_failure(int8_tArray node_id, jboolean is_permanent) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); + *ret_copy = NetworkUpdate_node_failure(node_id_ref, is_permanent); 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; +jboolean CS_LDK_NetworkUpdate_eq(int64_t a, int64_t b) { + LDKNetworkUpdate* a_conv = (LDKNetworkUpdate*)untag_ptr(a); + LDKNetworkUpdate* b_conv = (LDKNetworkUpdate*)untag_ptr(b); + jboolean ret_conv = NetworkUpdate_eq(a_conv, b_conv); + return ret_conv; } -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); +int8_tArray CS_LDK_NetworkUpdate_write(int64_t obj) { + LDKNetworkUpdate* obj_conv = (LDKNetworkUpdate*)untag_ptr(obj); + LDKCVec_u8Z ret_var = NetworkUpdate_write(obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -jstring CS_LDK_Offer_to_str(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; - LDKStr ret_str = Offer_to_str(&o_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; +int64_t CS_LDK_NetworkUpdate_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = NetworkUpdate_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -void CS_LDK_InvoiceWithExplicitSigningPubkeyBuilder_free(int64_t this_obj) { - LDKInvoiceWithExplicitSigningPubkeyBuilder this_obj_conv; +void CS_LDK_P2PGossipSync_free(int64_t this_obj) { + LDKP2PGossipSync this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InvoiceWithExplicitSigningPubkeyBuilder_free(this_obj_conv); + P2PGossipSync_free(this_obj_conv); } -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_P2PGossipSync_new(int64_t network_graph, int64_t utxo_lookup, int64_t logger) { + LDKNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; + void* utxo_lookup_ptr = untag_ptr(utxo_lookup); + CHECK_ACCESS(utxo_lookup_ptr); + LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr); + // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ + if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) { + // Manually implement clone for Java trait instances + if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some); + } + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKP2PGossipSync ret_var = P2PGossipSync_new(&network_graph_conv, utxo_lookup_conv, logger_conv); + int64_t ret_ref = 0; + 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_InvoiceWithExplicitSigningPubkeyBuilder_build(int64_t this_arg) { - LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; +void CS_LDK_P2PGossipSync_add_utxo_lookup(int64_t this_arg, int64_t utxo_lookup) { + LDKP2PGossipSync this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // 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); + this_arg_conv.is_owned = false; + void* utxo_lookup_ptr = untag_ptr(utxo_lookup); + CHECK_ACCESS(utxo_lookup_ptr); + LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr); + // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ + if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) { + // Manually implement clone for Java trait instances + if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some); + } + } + P2PGossipSync_add_utxo_lookup(&this_arg_conv, utxo_lookup_conv); } -void CS_LDK_InvoiceWithExplicitSigningPubkeyBuilder_relative_expiry(int64_t this_arg, int32_t relative_expiry_secs) { - LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; +void CS_LDK_NetworkGraph_handle_network_update(int64_t this_arg, int64_t network_update) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder - - InvoiceWithExplicitSigningPubkeyBuilder_relative_expiry(this_arg_conv, relative_expiry_secs); + this_arg_conv.is_owned = false; + LDKNetworkUpdate* network_update_conv = (LDKNetworkUpdate*)untag_ptr(network_update); + NetworkGraph_handle_network_update(&this_arg_conv, network_update_conv); } -void CS_LDK_InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wsh(int64_t this_arg, int8_tArray script_hash) { - LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; +int8_tArray CS_LDK_NetworkGraph_get_chain_hash(int64_t this_arg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // 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); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, NetworkGraph_get_chain_hash(&this_arg_conv).data, 32); + return ret_arr; } -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); +int64_t CS_LDK_verify_node_announcement(int64_t msg) { + LDKNodeAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = verify_node_announcement(&msg_conv); + return tag_ptr(ret_conv, true); } -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_verify_channel_announcement(int64_t msg) { + LDKChannelAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = verify_channel_announcement(&msg_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_InvoiceWithDerivedSigningPubkeyBuilder_build_and_sign(int64_t this_arg) { - LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; +int64_t CS_LDK_P2PGossipSync_as_RoutingMessageHandler(int64_t this_arg) { + LDKP2PGossipSync this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // 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); + this_arg_conv.is_owned = false; + LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler"); + *ret_ret = P2PGossipSync_as_RoutingMessageHandler(&this_arg_conv); + return tag_ptr(ret_ret, true); } -void CS_LDK_InvoiceWithDerivedSigningPubkeyBuilder_relative_expiry(int64_t this_arg, int32_t relative_expiry_secs) { - LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; +int64_t CS_LDK_P2PGossipSync_as_MessageSendEventsProvider(int64_t this_arg) { + LDKP2PGossipSync this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder - - InvoiceWithDerivedSigningPubkeyBuilder_relative_expiry(this_arg_conv, relative_expiry_secs); + this_arg_conv.is_owned = false; + LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); + *ret_ret = P2PGossipSync_as_MessageSendEventsProvider(&this_arg_conv); + return tag_ptr(ret_ret, true); } -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_ChannelUpdateInfo_free(int64_t this_obj) { + LDKChannelUpdateInfo this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelUpdateInfo_free(this_obj_conv); } -void 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); +int64_t CS_LDK_ChannelUpdateInfo_get_htlc_minimum_msat(int64_t this_ptr) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ChannelUpdateInfo_get_htlc_minimum_msat(&this_ptr_conv); + return ret_conv; } -void 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_ChannelUpdateInfo_set_htlc_minimum_msat(int64_t this_ptr, int64_t val) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelUpdateInfo_set_htlc_minimum_msat(&this_ptr_conv, val); } -void 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); +int64_t CS_LDK_ChannelUpdateInfo_get_htlc_maximum_msat(int64_t this_ptr) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ChannelUpdateInfo_get_htlc_maximum_msat(&this_ptr_conv); + return ret_conv; } -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_ChannelUpdateInfo_set_htlc_maximum_msat(int64_t this_ptr, int64_t val) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelUpdateInfo_set_htlc_maximum_msat(&this_ptr_conv, val); } -static inline uint64_t UnsignedBolt12Invoice_clone_ptr(LDKUnsignedBolt12Invoice *NONNULL_PTR arg) { - LDKUnsignedBolt12Invoice ret_var = UnsignedBolt12Invoice_clone(arg); +int64_t CS_LDK_ChannelUpdateInfo_get_fees(int64_t this_ptr) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKRoutingFees ret_var = ChannelUpdateInfo_get_fees(&this_ptr_conv); int64_t ret_ref = 0; 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_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 = UnsignedBolt12Invoice_clone_ptr(&arg_conv); + +void CS_LDK_ChannelUpdateInfo_set_fees(int64_t this_ptr, int64_t val) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKRoutingFees val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = RoutingFees_clone(&val_conv); + ChannelUpdateInfo_set_fees(&this_ptr_conv, val_conv); +} + +int32_t CS_LDK_ChannelUpdateInfo_get_last_update(int64_t this_ptr) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = ChannelUpdateInfo_get_last_update(&this_ptr_conv); return ret_conv; } -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; - LDKUnsignedBolt12Invoice ret_var = UnsignedBolt12Invoice_clone(&orig_conv); +void CS_LDK_ChannelUpdateInfo_set_last_update(int64_t this_ptr, int32_t val) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelUpdateInfo_set_last_update(&this_ptr_conv, val); +} + +int16_t CS_LDK_ChannelUpdateInfo_get_cltv_expiry_delta(int64_t this_ptr) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int16_t ret_conv = ChannelUpdateInfo_get_cltv_expiry_delta(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_ChannelUpdateInfo_set_cltv_expiry_delta(int64_t this_ptr, int16_t val) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelUpdateInfo_set_cltv_expiry_delta(&this_ptr_conv, val); +} + +jboolean CS_LDK_ChannelUpdateInfo_get_enabled(int64_t this_ptr) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + jboolean ret_conv = ChannelUpdateInfo_get_enabled(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_ChannelUpdateInfo_set_enabled(int64_t this_ptr, jboolean val) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelUpdateInfo_set_enabled(&this_ptr_conv, val); +} + +int64_t CS_LDK_ChannelUpdateInfo_get_last_update_message(int64_t this_ptr) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelUpdate ret_var = ChannelUpdateInfo_get_last_update_message(&this_ptr_conv); int64_t ret_ref = 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_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); +void CS_LDK_ChannelUpdateInfo_set_last_update_message(int64_t this_ptr, int64_t val) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelUpdate val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelUpdate_clone(&val_conv); + ChannelUpdateInfo_set_last_update_message(&this_ptr_conv, val_conv); } -int64_t CS_LDK_UnsignedBolt12Invoice_tagged_hash(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKTaggedHash ret_var = UnsignedBolt12Invoice_tagged_hash(&this_arg_conv); +int64_t CS_LDK_ChannelUpdateInfo_new(int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg, int64_t fees_arg, int32_t last_update_arg, int16_t cltv_expiry_delta_arg, jboolean enabled_arg, int64_t last_update_message_arg) { + LDKRoutingFees fees_arg_conv; + fees_arg_conv.inner = untag_ptr(fees_arg); + fees_arg_conv.is_owned = ptr_is_owned(fees_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv); + fees_arg_conv = RoutingFees_clone(&fees_arg_conv); + LDKChannelUpdate last_update_message_arg_conv; + last_update_message_arg_conv.inner = untag_ptr(last_update_message_arg); + last_update_message_arg_conv.is_owned = ptr_is_owned(last_update_message_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(last_update_message_arg_conv); + last_update_message_arg_conv = ChannelUpdate_clone(&last_update_message_arg_conv); + LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_new(htlc_minimum_msat_arg, htlc_maximum_msat_arg, fees_arg_conv, last_update_arg, cltv_expiry_delta_arg, enabled_arg, last_update_message_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_Bolt12Invoice_free(int64_t this_obj) { - LDKBolt12Invoice this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Bolt12Invoice_free(this_obj_conv); -} - -static inline uint64_t Bolt12Invoice_clone_ptr(LDKBolt12Invoice *NONNULL_PTR arg) { - LDKBolt12Invoice ret_var = Bolt12Invoice_clone(arg); +static inline uint64_t ChannelUpdateInfo_clone_ptr(LDKChannelUpdateInfo *NONNULL_PTR arg) { + LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_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_Bolt12Invoice_clone_ptr(int64_t arg) { - LDKBolt12Invoice arg_conv; +int64_t CS_LDK_ChannelUpdateInfo_clone_ptr(int64_t arg) { + LDKChannelUpdateInfo arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Bolt12Invoice_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelUpdateInfo_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_Bolt12Invoice_clone(int64_t orig) { - LDKBolt12Invoice orig_conv; +int64_t CS_LDK_ChannelUpdateInfo_clone(int64_t orig) { + LDKChannelUpdateInfo orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBolt12Invoice ret_var = Bolt12Invoice_clone(&orig_conv); + LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_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_UnsignedBolt12Invoice_offer_chains(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_CVec_ThirtyTwoBytesZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_ThirtyTwoBytesZZ), "LDKCOption_CVec_ThirtyTwoBytesZZ"); - *ret_copy = UnsignedBolt12Invoice_offer_chains(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_ChannelUpdateInfo_eq(int64_t a, int64_t b) { + LDKChannelUpdateInfo a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKChannelUpdateInfo b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ChannelUpdateInfo_eq(&a_conv, &b_conv); + return ret_conv; } -int8_tArray CS_LDK_UnsignedBolt12Invoice_chain(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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, UnsignedBolt12Invoice_chain(&this_arg_conv).data, 32); +jstring CS_LDK_ChannelUpdateInfo_to_str(int64_t o) { + LDKChannelUpdateInfo o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = ChannelUpdateInfo_to_str(&o_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +int8_tArray CS_LDK_ChannelUpdateInfo_write(int64_t obj) { + LDKChannelUpdateInfo obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ChannelUpdateInfo_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_UnsignedBolt12Invoice_metadata(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = UnsignedBolt12Invoice_metadata(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_ChannelUpdateInfo_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ"); + *ret_conv = ChannelUpdateInfo_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_UnsignedBolt12Invoice_amount(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_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; +void CS_LDK_ChannelInfo_free(int64_t this_obj) { + LDKChannelInfo this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelInfo_free(this_obj_conv); } -int64_t CS_LDK_UnsignedBolt12Invoice_offer_features(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOfferFeatures ret_var = UnsignedBolt12Invoice_offer_features(&this_arg_conv); +int64_t CS_LDK_ChannelInfo_get_features(int64_t this_ptr) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelFeatures ret_var = ChannelInfo_get_features(&this_ptr_conv); int64_t ret_ref = 0; 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_UnsignedBolt12Invoice_description(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = UnsignedBolt12Invoice_description(&this_arg_conv); +void CS_LDK_ChannelInfo_set_features(int64_t this_ptr, int64_t val) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelFeatures val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelFeatures_clone(&val_conv); + ChannelInfo_set_features(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_ChannelInfo_get_node_one(int64_t this_ptr) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKNodeId ret_var = ChannelInfo_get_node_one(&this_ptr_conv); int64_t ret_ref = 0; 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_UnsignedBolt12Invoice_absolute_expiry(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = UnsignedBolt12Invoice_absolute_expiry(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_ChannelInfo_set_node_one(int64_t this_ptr, int64_t val) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKNodeId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = NodeId_clone(&val_conv); + ChannelInfo_set_node_one(&this_ptr_conv, val_conv); } -int64_t CS_LDK_UnsignedBolt12Invoice_issuer(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = UnsignedBolt12Invoice_issuer(&this_arg_conv); +int64_t CS_LDK_ChannelInfo_get_node_two(int64_t this_ptr) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKNodeId ret_var = ChannelInfo_get_node_two(&this_ptr_conv); int64_t ret_ref = 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_UnsignedBolt12Invoice_message_paths(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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_BlindedPathZ ret_var = UnsignedBolt12Invoice_message_paths(&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 n = 0; n < ret_var.datalen; n++) { - LDKBlindedPath 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; +void CS_LDK_ChannelInfo_set_node_two(int64_t this_ptr, int64_t val) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKNodeId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = NodeId_clone(&val_conv); + ChannelInfo_set_node_two(&this_ptr_conv, val_conv); } -int64_t CS_LDK_UnsignedBolt12Invoice_supported_quantity(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_QuantityZ *ret_copy = MALLOC(sizeof(LDKCOption_QuantityZ), "LDKCOption_QuantityZ"); - *ret_copy = UnsignedBolt12Invoice_supported_quantity(&this_arg_conv); +int64_t CS_LDK_ChannelInfo_get_capacity_sats(int64_t this_ptr) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelInfo_get_capacity_sats(&this_ptr_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int8_tArray CS_LDK_UnsignedBolt12Invoice_payer_metadata(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKu8slice ret_var = UnsignedBolt12Invoice_payer_metadata(&this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - return ret_arr; +void CS_LDK_ChannelInfo_set_capacity_sats(int64_t this_ptr, int64_t val) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + ChannelInfo_set_capacity_sats(&this_ptr_conv, val_conv); } -int64_t CS_LDK_UnsignedBolt12Invoice_invoice_request_features(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKInvoiceRequestFeatures ret_var = UnsignedBolt12Invoice_invoice_request_features(&this_arg_conv); +int64_t CS_LDK_ChannelInfo_get_one_to_two(int64_t this_ptr) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelUpdateInfo ret_var = ChannelInfo_get_one_to_two(&this_ptr_conv); int64_t ret_ref = 0; 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_UnsignedBolt12Invoice_quantity(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = UnsignedBolt12Invoice_quantity(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +void CS_LDK_ChannelInfo_set_one_to_two(int64_t this_ptr, int64_t val) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelUpdateInfo val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelUpdateInfo_clone(&val_conv); + ChannelInfo_set_one_to_two(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_ChannelInfo_get_two_to_one(int64_t this_ptr) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelUpdateInfo ret_var = ChannelInfo_get_two_to_one(&this_ptr_conv); + int64_t ret_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_UnsignedBolt12Invoice_payer_id(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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, UnsignedBolt12Invoice_payer_id(&this_arg_conv).compressed_form, 33); - return ret_arr; +void CS_LDK_ChannelInfo_set_two_to_one(int64_t this_ptr, int64_t val) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelUpdateInfo val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelUpdateInfo_clone(&val_conv); + ChannelInfo_set_two_to_one(&this_ptr_conv, val_conv); } -int64_t CS_LDK_UnsignedBolt12Invoice_payer_note(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = UnsignedBolt12Invoice_payer_note(&this_arg_conv); +int64_t CS_LDK_ChannelInfo_get_announcement_message(int64_t this_ptr) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelAnnouncement ret_var = ChannelInfo_get_announcement_message(&this_ptr_conv); int64_t ret_ref = 0; 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_UnsignedBolt12Invoice_created_at(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = UnsignedBolt12Invoice_created_at(&this_arg_conv); - return ret_conv; +void CS_LDK_ChannelInfo_set_announcement_message(int64_t this_ptr, int64_t val) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelAnnouncement val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelAnnouncement_clone(&val_conv); + ChannelInfo_set_announcement_message(&this_ptr_conv, val_conv); } -int64_t CS_LDK_UnsignedBolt12Invoice_relative_expiry(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = UnsignedBolt12Invoice_relative_expiry(&this_arg_conv); - return ret_conv; +static inline uint64_t ChannelInfo_clone_ptr(LDKChannelInfo *NONNULL_PTR arg) { + LDKChannelInfo ret_var = ChannelInfo_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; } - -jboolean CS_LDK_UnsignedBolt12Invoice_is_expired(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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 = UnsignedBolt12Invoice_is_expired(&this_arg_conv); +int64_t CS_LDK_ChannelInfo_clone_ptr(int64_t arg) { + LDKChannelInfo arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = ChannelInfo_clone_ptr(&arg_conv); return ret_conv; } -int8_tArray CS_LDK_UnsignedBolt12Invoice_payment_hash(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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, UnsignedBolt12Invoice_payment_hash(&this_arg_conv).data, 32); - return ret_arr; +int64_t CS_LDK_ChannelInfo_clone(int64_t orig) { + LDKChannelInfo orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKChannelInfo ret_var = ChannelInfo_clone(&orig_conv); + int64_t ret_ref = 0; + 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_UnsignedBolt12Invoice_amount_msats(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = UnsignedBolt12Invoice_amount_msats(&this_arg_conv); +jboolean CS_LDK_ChannelInfo_eq(int64_t a, int64_t b) { + LDKChannelInfo a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKChannelInfo b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ChannelInfo_eq(&a_conv, &b_conv); return ret_conv; } -int64_t CS_LDK_UnsignedBolt12Invoice_invoice_features(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; +int64_t CS_LDK_ChannelInfo_get_directional_info(int64_t this_arg, int8_t channel_flags) { + LDKChannelInfo this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKBolt12InvoiceFeatures ret_var = UnsignedBolt12Invoice_invoice_features(&this_arg_conv); + LDKChannelUpdateInfo ret_var = ChannelInfo_get_directional_info(&this_arg_conv, channel_flags); int64_t ret_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_UnsignedBolt12Invoice_signing_pubkey(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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, UnsignedBolt12Invoice_signing_pubkey(&this_arg_conv).compressed_form, 33); - return ret_arr; +jstring CS_LDK_ChannelInfo_to_str(int64_t o) { + LDKChannelInfo o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = ChannelInfo_to_str(&o_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; } -int64_t CS_LDK_Bolt12Invoice_offer_chains(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_CVec_ThirtyTwoBytesZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_ThirtyTwoBytesZZ), "LDKCOption_CVec_ThirtyTwoBytesZZ"); - *ret_copy = Bolt12Invoice_offer_chains(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int8_tArray CS_LDK_ChannelInfo_write(int64_t obj) { + LDKChannelInfo obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ChannelInfo_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -int8_tArray CS_LDK_Bolt12Invoice_chain(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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, Bolt12Invoice_chain(&this_arg_conv).data, 32); - return ret_arr; +int64_t CS_LDK_ChannelInfo_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); + *ret_conv = ChannelInfo_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_Bolt12Invoice_metadata(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = Bolt12Invoice_metadata(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_DirectedChannelInfo_free(int64_t this_obj) { + LDKDirectedChannelInfo this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + DirectedChannelInfo_free(this_obj_conv); } -int64_t CS_LDK_Bolt12Invoice_amount(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_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); +static inline uint64_t DirectedChannelInfo_clone_ptr(LDKDirectedChannelInfo *NONNULL_PTR arg) { + LDKDirectedChannelInfo ret_var = DirectedChannelInfo_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_DirectedChannelInfo_clone_ptr(int64_t arg) { + LDKDirectedChannelInfo arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = DirectedChannelInfo_clone_ptr(&arg_conv); + return ret_conv; +} -int64_t CS_LDK_Bolt12Invoice_offer_features(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOfferFeatures ret_var = Bolt12Invoice_offer_features(&this_arg_conv); +int64_t CS_LDK_DirectedChannelInfo_clone(int64_t orig) { + LDKDirectedChannelInfo orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKDirectedChannelInfo ret_var = DirectedChannelInfo_clone(&orig_conv); int64_t ret_ref = 0; 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_Bolt12Invoice_description(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; +int64_t CS_LDK_DirectedChannelInfo_channel(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; - LDKPrintableString ret_var = Bolt12Invoice_description(&this_arg_conv); + LDKChannelInfo ret_var = DirectedChannelInfo_channel(&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_Bolt12Invoice_absolute_expiry(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; +int64_t CS_LDK_DirectedChannelInfo_effective_capacity(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; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = Bolt12Invoice_absolute_expiry(&this_arg_conv); + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = DirectedChannelInfo_effective_capacity(&this_arg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Bolt12Invoice_issuer(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; +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; - LDKPrintableString ret_var = Bolt12Invoice_issuer(&this_arg_conv); + 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_tArray CS_LDK_Bolt12Invoice_message_paths(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; +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; - LDKCVec_BlindedPathZ ret_var = Bolt12Invoice_message_paths(&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 n = 0; n < ret_var.datalen; n++) { - LDKBlindedPath 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; + 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; } -int64_t CS_LDK_Bolt12Invoice_supported_quantity(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_QuantityZ *ret_copy = MALLOC(sizeof(LDKCOption_QuantityZ), "LDKCOption_QuantityZ"); - *ret_copy = Bolt12Invoice_supported_quantity(&this_arg_conv); +void CS_LDK_EffectiveCapacity_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); + LDKEffectiveCapacity this_ptr_conv = *(LDKEffectiveCapacity*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + EffectiveCapacity_free(this_ptr_conv); +} + +static inline uint64_t EffectiveCapacity_clone_ptr(LDKEffectiveCapacity *NONNULL_PTR arg) { + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } +int64_t CS_LDK_EffectiveCapacity_clone_ptr(int64_t arg) { + LDKEffectiveCapacity* arg_conv = (LDKEffectiveCapacity*)untag_ptr(arg); + int64_t ret_conv = EffectiveCapacity_clone_ptr(arg_conv); + return ret_conv; +} -int8_tArray CS_LDK_Bolt12Invoice_payer_metadata(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKu8slice ret_var = Bolt12Invoice_payer_metadata(&this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - return ret_arr; +int64_t CS_LDK_EffectiveCapacity_clone(int64_t orig) { + LDKEffectiveCapacity* orig_conv = (LDKEffectiveCapacity*)untag_ptr(orig); + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_Bolt12Invoice_invoice_request_features(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKInvoiceRequestFeatures ret_var = Bolt12Invoice_invoice_request_features(&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); +int64_t CS_LDK_EffectiveCapacity_exact_liquidity(int64_t liquidity_msat) { + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_exact_liquidity(liquidity_msat); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Bolt12Invoice_quantity(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = Bolt12Invoice_quantity(&this_arg_conv); +int64_t CS_LDK_EffectiveCapacity_advertised_max_htlc(int64_t amount_msat) { + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_advertised_max_htlc(amount_msat); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int8_tArray CS_LDK_Bolt12Invoice_payer_id(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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, Bolt12Invoice_payer_id(&this_arg_conv).compressed_form, 33); - return ret_arr; +int64_t CS_LDK_EffectiveCapacity_total(int64_t capacity_msat, int64_t htlc_maximum_msat) { + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_total(capacity_msat, htlc_maximum_msat); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_Bolt12Invoice_payer_note(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = Bolt12Invoice_payer_note(&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); +int64_t CS_LDK_EffectiveCapacity_infinite() { + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_infinite(); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Bolt12Invoice_created_at(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = Bolt12Invoice_created_at(&this_arg_conv); - return ret_conv; +int64_t CS_LDK_EffectiveCapacity_hint_max_htlc(int64_t amount_msat) { + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_hint_max_htlc(amount_msat); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_Bolt12Invoice_relative_expiry(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = Bolt12Invoice_relative_expiry(&this_arg_conv); - return ret_conv; +int64_t CS_LDK_EffectiveCapacity_unknown() { + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_unknown(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_Bolt12Invoice_is_expired(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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 = Bolt12Invoice_is_expired(&this_arg_conv); +int64_t CS_LDK_EffectiveCapacity_as_msat(int64_t this_arg) { + LDKEffectiveCapacity* this_arg_conv = (LDKEffectiveCapacity*)untag_ptr(this_arg); + int64_t ret_conv = EffectiveCapacity_as_msat(this_arg_conv); return ret_conv; } -int8_tArray CS_LDK_Bolt12Invoice_payment_hash(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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, Bolt12Invoice_payment_hash(&this_arg_conv).data, 32); +int8_tArray CS_LDK_RoutingFees_write(int64_t obj) { + LDKRoutingFees obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = RoutingFees_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_Bolt12Invoice_amount_msats(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = Bolt12Invoice_amount_msats(&this_arg_conv); - return ret_conv; +int64_t CS_LDK_RoutingFees_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); + *ret_conv = RoutingFees_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_Bolt12Invoice_invoice_features(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKBolt12InvoiceFeatures ret_var = Bolt12Invoice_invoice_features(&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; -} - -int8_tArray CS_LDK_Bolt12Invoice_signing_pubkey(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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, Bolt12Invoice_signing_pubkey(&this_arg_conv).compressed_form, 33); - return ret_arr; -} - -int8_tArray CS_LDK_Bolt12Invoice_signature(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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, Bolt12Invoice_signature(&this_arg_conv).compact_form, 64); - return ret_arr; -} - -int8_tArray CS_LDK_Bolt12Invoice_signable_hash(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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, Bolt12Invoice_signable_hash(&this_arg_conv).data, 32); - return ret_arr; -} - -int64_t CS_LDK_Bolt12Invoice_verify(int64_t this_arg, int64_t key) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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 key_conv; - key_conv.inner = untag_ptr(key); - key_conv.is_owned = ptr_is_owned(key); - CHECK_INNER_FIELD_ACCESS_OR_NULL(key_conv); - key_conv.is_owned = false; - LDKCResult_ThirtyTwoBytesNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesNoneZ), "LDKCResult_ThirtyTwoBytesNoneZ"); - *ret_conv = Bolt12Invoice_verify(&this_arg_conv, &key_conv); - 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); - 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 = UnsignedBolt12Invoice_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_Bolt12Invoice_write(int64_t obj) { - LDKBolt12Invoice 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 = Bolt12Invoice_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -void CS_LDK_BlindedPayInfo_free(int64_t this_obj) { - LDKBlindedPayInfo this_obj_conv; +void CS_LDK_NodeAnnouncementDetails_free(int64_t this_obj) { + LDKNodeAnnouncementDetails this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BlindedPayInfo_free(this_obj_conv); + NodeAnnouncementDetails_free(this_obj_conv); } -int32_t CS_LDK_BlindedPayInfo_get_fee_base_msat(int64_t this_ptr) { - LDKBlindedPayInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int32_t ret_conv = BlindedPayInfo_get_fee_base_msat(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_BlindedPayInfo_set_fee_base_msat(int64_t this_ptr, int32_t val) { - LDKBlindedPayInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - BlindedPayInfo_set_fee_base_msat(&this_ptr_conv, val); -} - -int32_t CS_LDK_BlindedPayInfo_get_fee_proportional_millionths(int64_t this_ptr) { - LDKBlindedPayInfo this_ptr_conv; +int64_t CS_LDK_NodeAnnouncementDetails_get_features(int64_t this_ptr) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int32_t ret_conv = BlindedPayInfo_get_fee_proportional_millionths(&this_ptr_conv); - return ret_conv; + LDKNodeFeatures ret_var = NodeAnnouncementDetails_get_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_BlindedPayInfo_set_fee_proportional_millionths(int64_t this_ptr, int32_t val) { - LDKBlindedPayInfo this_ptr_conv; +void CS_LDK_NodeAnnouncementDetails_set_features(int64_t this_ptr, int64_t val) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - BlindedPayInfo_set_fee_proportional_millionths(&this_ptr_conv, val); + LDKNodeFeatures val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = NodeFeatures_clone(&val_conv); + NodeAnnouncementDetails_set_features(&this_ptr_conv, val_conv); } -int16_t CS_LDK_BlindedPayInfo_get_cltv_expiry_delta(int64_t this_ptr) { - LDKBlindedPayInfo this_ptr_conv; +int32_t CS_LDK_NodeAnnouncementDetails_get_last_update(int64_t this_ptr) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int16_t ret_conv = BlindedPayInfo_get_cltv_expiry_delta(&this_ptr_conv); + int32_t ret_conv = NodeAnnouncementDetails_get_last_update(&this_ptr_conv); return ret_conv; } -void CS_LDK_BlindedPayInfo_set_cltv_expiry_delta(int64_t this_ptr, int16_t val) { - LDKBlindedPayInfo this_ptr_conv; +void CS_LDK_NodeAnnouncementDetails_set_last_update(int64_t this_ptr, int32_t val) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - BlindedPayInfo_set_cltv_expiry_delta(&this_ptr_conv, val); + NodeAnnouncementDetails_set_last_update(&this_ptr_conv, val); } -int64_t CS_LDK_BlindedPayInfo_get_htlc_minimum_msat(int64_t this_ptr) { - LDKBlindedPayInfo this_ptr_conv; +int8_tArray CS_LDK_NodeAnnouncementDetails_get_rgb(int64_t this_ptr) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = BlindedPayInfo_get_htlc_minimum_msat(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(3, __LINE__); + memcpy(ret_arr->elems, *NodeAnnouncementDetails_get_rgb(&this_ptr_conv), 3); + return ret_arr; } -void CS_LDK_BlindedPayInfo_set_htlc_minimum_msat(int64_t this_ptr, int64_t val) { - LDKBlindedPayInfo this_ptr_conv; +void CS_LDK_NodeAnnouncementDetails_set_rgb(int64_t this_ptr, int8_tArray val) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - BlindedPayInfo_set_htlc_minimum_msat(&this_ptr_conv, val); + LDKThreeBytes val_ref; + CHECK(val->arr_len == 3); + memcpy(val_ref.data, val->elems, 3); FREE(val); + NodeAnnouncementDetails_set_rgb(&this_ptr_conv, val_ref); } -int64_t CS_LDK_BlindedPayInfo_get_htlc_maximum_msat(int64_t this_ptr) { - LDKBlindedPayInfo this_ptr_conv; +int64_t CS_LDK_NodeAnnouncementDetails_get_alias(int64_t this_ptr) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = BlindedPayInfo_get_htlc_maximum_msat(&this_ptr_conv); - return ret_conv; + LDKNodeAlias ret_var = NodeAnnouncementDetails_get_alias(&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_BlindedPayInfo_set_htlc_maximum_msat(int64_t this_ptr, int64_t val) { - LDKBlindedPayInfo this_ptr_conv; +void CS_LDK_NodeAnnouncementDetails_set_alias(int64_t this_ptr, int64_t val) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - BlindedPayInfo_set_htlc_maximum_msat(&this_ptr_conv, val); + LDKNodeAlias val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = NodeAlias_clone(&val_conv); + NodeAnnouncementDetails_set_alias(&this_ptr_conv, val_conv); } -int64_t CS_LDK_BlindedPayInfo_get_features(int64_t this_ptr) { - LDKBlindedPayInfo this_ptr_conv; +int64_tArray CS_LDK_NodeAnnouncementDetails_get_addresses(int64_t this_ptr) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKBlindedHopFeatures ret_var = BlindedPayInfo_get_features(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + LDKCVec_SocketAddressZ ret_var = NodeAnnouncementDetails_get_addresses(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t p = 0; p < ret_var.datalen; p++) { + LDKSocketAddress *ret_conv_15_copy = MALLOC(sizeof(LDKSocketAddress), "LDKSocketAddress"); + *ret_conv_15_copy = ret_var.data[p]; + int64_t ret_conv_15_ref = tag_ptr(ret_conv_15_copy, true); + ret_arr_ptr[p] = ret_conv_15_ref; + } + + FREE(ret_var.data); + return ret_arr; } -void CS_LDK_BlindedPayInfo_set_features(int64_t this_ptr, int64_t val) { - LDKBlindedPayInfo this_ptr_conv; +void CS_LDK_NodeAnnouncementDetails_set_addresses(int64_t this_ptr, int64_tArray val) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKBlindedHopFeatures val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = BlindedHopFeatures_clone(&val_conv); - BlindedPayInfo_set_features(&this_ptr_conv, val_conv); + LDKCVec_SocketAddressZ val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSocketAddress), "LDKCVec_SocketAddressZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = val->elems; + for (size_t p = 0; p < val_constr.datalen; p++) { + int64_t val_conv_15 = val_vals[p]; + void* val_conv_15_ptr = untag_ptr(val_conv_15); + CHECK_ACCESS(val_conv_15_ptr); + LDKSocketAddress val_conv_15_conv = *(LDKSocketAddress*)(val_conv_15_ptr); + val_conv_15_conv = SocketAddress_clone((LDKSocketAddress*)untag_ptr(val_conv_15)); + val_constr.data[p] = val_conv_15_conv; + } + FREE(val); + NodeAnnouncementDetails_set_addresses(&this_ptr_conv, val_constr); } -int64_t CS_LDK_BlindedPayInfo_new(int32_t fee_base_msat_arg, int32_t fee_proportional_millionths_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg, int64_t features_arg) { - LDKBlindedHopFeatures features_arg_conv; +int64_t CS_LDK_NodeAnnouncementDetails_new(int64_t features_arg, int32_t last_update_arg, int8_tArray rgb_arg, int64_t alias_arg, int64_tArray addresses_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 = BlindedHopFeatures_clone(&features_arg_conv); - LDKBlindedPayInfo ret_var = BlindedPayInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, features_arg_conv); + features_arg_conv = NodeFeatures_clone(&features_arg_conv); + LDKThreeBytes rgb_arg_ref; + CHECK(rgb_arg->arr_len == 3); + memcpy(rgb_arg_ref.data, rgb_arg->elems, 3); FREE(rgb_arg); + LDKNodeAlias alias_arg_conv; + alias_arg_conv.inner = untag_ptr(alias_arg); + alias_arg_conv.is_owned = ptr_is_owned(alias_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(alias_arg_conv); + alias_arg_conv = NodeAlias_clone(&alias_arg_conv); + LDKCVec_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_conv_15_conv = SocketAddress_clone((LDKSocketAddress*)untag_ptr(addresses_arg_conv_15)); + addresses_arg_constr.data[p] = addresses_arg_conv_15_conv; + } + FREE(addresses_arg); + LDKNodeAnnouncementDetails ret_var = NodeAnnouncementDetails_new(features_arg_conv, last_update_arg, rgb_arg_ref, alias_arg_conv, addresses_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); return ret_ref; } -static inline uint64_t BlindedPayInfo_clone_ptr(LDKBlindedPayInfo *NONNULL_PTR arg) { - LDKBlindedPayInfo ret_var = BlindedPayInfo_clone(arg); +static inline uint64_t NodeAnnouncementDetails_clone_ptr(LDKNodeAnnouncementDetails *NONNULL_PTR arg) { + LDKNodeAnnouncementDetails ret_var = NodeAnnouncementDetails_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_BlindedPayInfo_clone_ptr(int64_t arg) { - LDKBlindedPayInfo arg_conv; +int64_t CS_LDK_NodeAnnouncementDetails_clone_ptr(int64_t arg) { + LDKNodeAnnouncementDetails arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = BlindedPayInfo_clone_ptr(&arg_conv); + int64_t ret_conv = NodeAnnouncementDetails_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_BlindedPayInfo_clone(int64_t orig) { - LDKBlindedPayInfo orig_conv; +int64_t CS_LDK_NodeAnnouncementDetails_clone(int64_t orig) { + LDKNodeAnnouncementDetails orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBlindedPayInfo ret_var = BlindedPayInfo_clone(&orig_conv); + LDKNodeAnnouncementDetails ret_var = NodeAnnouncementDetails_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_BlindedPayInfo_hash(int64_t o) { - LDKBlindedPayInfo o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = BlindedPayInfo_hash(&o_conv); - return ret_conv; -} - -jboolean CS_LDK_BlindedPayInfo_eq(int64_t a, int64_t b) { - LDKBlindedPayInfo a_conv; +jboolean CS_LDK_NodeAnnouncementDetails_eq(int64_t a, int64_t b) { + LDKNodeAnnouncementDetails a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKBlindedPayInfo b_conv; + LDKNodeAnnouncementDetails b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = BlindedPayInfo_eq(&a_conv, &b_conv); + jboolean ret_conv = NodeAnnouncementDetails_eq(&a_conv, &b_conv); return ret_conv; } -int8_tArray CS_LDK_BlindedPayInfo_write(int64_t obj) { - LDKBlindedPayInfo obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = BlindedPayInfo_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +void CS_LDK_NodeAnnouncementInfo_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); + LDKNodeAnnouncementInfo this_ptr_conv = *(LDKNodeAnnouncementInfo*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + NodeAnnouncementInfo_free(this_ptr_conv); } -int64_t CS_LDK_BlindedPayInfo_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); - *ret_conv = BlindedPayInfo_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +static inline uint64_t NodeAnnouncementInfo_clone_ptr(LDKNodeAnnouncementInfo *NONNULL_PTR arg) { + LDKNodeAnnouncementInfo *ret_copy = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo"); + *ret_copy = NodeAnnouncementInfo_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } - -void CS_LDK_InvoiceError_free(int64_t this_obj) { - LDKInvoiceError this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InvoiceError_free(this_obj_conv); +int64_t CS_LDK_NodeAnnouncementInfo_clone_ptr(int64_t arg) { + LDKNodeAnnouncementInfo* arg_conv = (LDKNodeAnnouncementInfo*)untag_ptr(arg); + int64_t ret_conv = NodeAnnouncementInfo_clone_ptr(arg_conv); + return ret_conv; } -int64_t CS_LDK_InvoiceError_get_erroneous_field(int64_t this_ptr) { - LDKInvoiceError this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKErroneousField ret_var = InvoiceError_get_erroneous_field(&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); +int64_t CS_LDK_NodeAnnouncementInfo_clone(int64_t orig) { + LDKNodeAnnouncementInfo* orig_conv = (LDKNodeAnnouncementInfo*)untag_ptr(orig); + LDKNodeAnnouncementInfo *ret_copy = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo"); + *ret_copy = NodeAnnouncementInfo_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void CS_LDK_InvoiceError_set_erroneous_field(int64_t this_ptr, int64_t val) { - LDKInvoiceError this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKErroneousField 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 = ErroneousField_clone(&val_conv); - InvoiceError_set_erroneous_field(&this_ptr_conv, val_conv); +int64_t CS_LDK_NodeAnnouncementInfo_relayed(int64_t a) { + LDKNodeAnnouncement a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = NodeAnnouncement_clone(&a_conv); + LDKNodeAnnouncementInfo *ret_copy = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo"); + *ret_copy = NodeAnnouncementInfo_relayed(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_InvoiceError_get_message(int64_t this_ptr) { - LDKInvoiceError this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = InvoiceError_get_message(&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); +int64_t CS_LDK_NodeAnnouncementInfo_local(int64_t a) { + LDKNodeAnnouncementDetails a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = NodeAnnouncementDetails_clone(&a_conv); + LDKNodeAnnouncementInfo *ret_copy = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo"); + *ret_copy = NodeAnnouncementInfo_local(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void CS_LDK_InvoiceError_set_message(int64_t this_ptr, int64_t val) { - LDKInvoiceError this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - InvoiceError_set_message(&this_ptr_conv, val_conv); +jboolean CS_LDK_NodeAnnouncementInfo_eq(int64_t a, int64_t b) { + LDKNodeAnnouncementInfo* a_conv = (LDKNodeAnnouncementInfo*)untag_ptr(a); + LDKNodeAnnouncementInfo* b_conv = (LDKNodeAnnouncementInfo*)untag_ptr(b); + jboolean ret_conv = NodeAnnouncementInfo_eq(a_conv, b_conv); + return ret_conv; } -int64_t CS_LDK_InvoiceError_new(int64_t erroneous_field_arg, int64_t message_arg) { - LDKErroneousField erroneous_field_arg_conv; - erroneous_field_arg_conv.inner = untag_ptr(erroneous_field_arg); - erroneous_field_arg_conv.is_owned = ptr_is_owned(erroneous_field_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(erroneous_field_arg_conv); - erroneous_field_arg_conv = ErroneousField_clone(&erroneous_field_arg_conv); - LDKUntrustedString message_arg_conv; - message_arg_conv.inner = untag_ptr(message_arg); - message_arg_conv.is_owned = ptr_is_owned(message_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(message_arg_conv); - message_arg_conv = UntrustedString_clone(&message_arg_conv); - LDKInvoiceError ret_var = InvoiceError_new(erroneous_field_arg_conv, message_arg_conv); +int64_t CS_LDK_NodeAnnouncementInfo_features(int64_t this_arg) { + LDKNodeAnnouncementInfo* this_arg_conv = (LDKNodeAnnouncementInfo*)untag_ptr(this_arg); + LDKNodeFeatures ret_var = NodeAnnouncementInfo_features(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; } -static inline uint64_t InvoiceError_clone_ptr(LDKInvoiceError *NONNULL_PTR arg) { - LDKInvoiceError ret_var = InvoiceError_clone(arg); +int32_t CS_LDK_NodeAnnouncementInfo_last_update(int64_t this_arg) { + LDKNodeAnnouncementInfo* this_arg_conv = (LDKNodeAnnouncementInfo*)untag_ptr(this_arg); + int32_t ret_conv = NodeAnnouncementInfo_last_update(this_arg_conv); + return ret_conv; +} + +int8_tArray CS_LDK_NodeAnnouncementInfo_rgb(int64_t this_arg) { + LDKNodeAnnouncementInfo* this_arg_conv = (LDKNodeAnnouncementInfo*)untag_ptr(this_arg); + int8_tArray ret_arr = init_int8_tArray(3, __LINE__); + memcpy(ret_arr->elems, NodeAnnouncementInfo_rgb(this_arg_conv).data, 3); + return ret_arr; +} + +int64_t CS_LDK_NodeAnnouncementInfo_alias(int64_t this_arg) { + LDKNodeAnnouncementInfo* this_arg_conv = (LDKNodeAnnouncementInfo*)untag_ptr(this_arg); + LDKNodeAlias ret_var = NodeAnnouncementInfo_alias(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_InvoiceError_clone_ptr(int64_t arg) { - LDKInvoiceError 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 = InvoiceError_clone_ptr(&arg_conv); - return ret_conv; + +int64_tArray CS_LDK_NodeAnnouncementInfo_addresses(int64_t this_arg) { + LDKNodeAnnouncementInfo* this_arg_conv = (LDKNodeAnnouncementInfo*)untag_ptr(this_arg); + LDKCVec_SocketAddressZ ret_var = NodeAnnouncementInfo_addresses(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 p = 0; p < ret_var.datalen; p++) { + LDKSocketAddress *ret_conv_15_copy = MALLOC(sizeof(LDKSocketAddress), "LDKSocketAddress"); + *ret_conv_15_copy = ret_var.data[p]; + int64_t ret_conv_15_ref = tag_ptr(ret_conv_15_copy, true); + ret_arr_ptr[p] = ret_conv_15_ref; + } + + FREE(ret_var.data); + return ret_arr; } -int64_t CS_LDK_InvoiceError_clone(int64_t orig) { - LDKInvoiceError 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; - LDKInvoiceError ret_var = InvoiceError_clone(&orig_conv); +int64_t CS_LDK_NodeAnnouncementInfo_announcement_message(int64_t this_arg) { + LDKNodeAnnouncementInfo* this_arg_conv = (LDKNodeAnnouncementInfo*)untag_ptr(this_arg); + LDKNodeAnnouncement ret_var = NodeAnnouncementInfo_announcement_message(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_ErroneousField_free(int64_t this_obj) { - LDKErroneousField this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ErroneousField_free(this_obj_conv); +int8_tArray CS_LDK_NodeAnnouncementInfo_write(int64_t obj) { + LDKNodeAnnouncementInfo* obj_conv = (LDKNodeAnnouncementInfo*)untag_ptr(obj); + LDKCVec_u8Z ret_var = NodeAnnouncementInfo_write(obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -int64_t CS_LDK_ErroneousField_get_tlv_fieldnum(int64_t this_ptr) { - LDKErroneousField this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = ErroneousField_get_tlv_fieldnum(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_NodeAnnouncementInfo_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); + *ret_conv = NodeAnnouncementInfo_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -void CS_LDK_ErroneousField_set_tlv_fieldnum(int64_t this_ptr, int64_t val) { - LDKErroneousField this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ErroneousField_set_tlv_fieldnum(&this_ptr_conv, val); +void CS_LDK_NodeAlias_free(int64_t this_obj) { + LDKNodeAlias this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + NodeAlias_free(this_obj_conv); } -int64_t CS_LDK_ErroneousField_get_suggested_value(int64_t this_ptr) { - LDKErroneousField this_ptr_conv; +int8_tArray CS_LDK_NodeAlias_get_a(int64_t this_ptr) { + LDKNodeAlias this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = ErroneousField_get_suggested_value(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *NodeAlias_get_a(&this_ptr_conv), 32); + return ret_arr; } -void CS_LDK_ErroneousField_set_suggested_value(int64_t this_ptr, int64_t val) { - LDKErroneousField this_ptr_conv; +void CS_LDK_NodeAlias_set_a(int64_t this_ptr, int8_tArray val) { + LDKNodeAlias this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - 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)); - ErroneousField_set_suggested_value(&this_ptr_conv, val_conv); + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + NodeAlias_set_a(&this_ptr_conv, val_ref); } -int64_t CS_LDK_ErroneousField_new(int64_t tlv_fieldnum_arg, int64_t suggested_value_arg) { - void* suggested_value_arg_ptr = untag_ptr(suggested_value_arg); - CHECK_ACCESS(suggested_value_arg_ptr); - LDKCOption_CVec_u8ZZ suggested_value_arg_conv = *(LDKCOption_CVec_u8ZZ*)(suggested_value_arg_ptr); - suggested_value_arg_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(suggested_value_arg)); - LDKErroneousField ret_var = ErroneousField_new(tlv_fieldnum_arg, suggested_value_arg_conv); +int64_t CS_LDK_NodeAlias_new(int8_tArray a_arg) { + LDKThirtyTwoBytes a_arg_ref; + CHECK(a_arg->arr_len == 32); + memcpy(a_arg_ref.data, a_arg->elems, 32); FREE(a_arg); + LDKNodeAlias ret_var = NodeAlias_new(a_arg_ref); int64_t ret_ref = 0; 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 ErroneousField_clone_ptr(LDKErroneousField *NONNULL_PTR arg) { - LDKErroneousField ret_var = ErroneousField_clone(arg); +static inline uint64_t NodeAlias_clone_ptr(LDKNodeAlias *NONNULL_PTR arg) { + LDKNodeAlias ret_var = NodeAlias_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_ErroneousField_clone_ptr(int64_t arg) { - LDKErroneousField arg_conv; +int64_t CS_LDK_NodeAlias_clone_ptr(int64_t arg) { + LDKNodeAlias arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = ErroneousField_clone_ptr(&arg_conv); + int64_t ret_conv = NodeAlias_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_ErroneousField_clone(int64_t orig) { - LDKErroneousField orig_conv; +int64_t CS_LDK_NodeAlias_clone(int64_t orig) { + LDKNodeAlias orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKErroneousField ret_var = ErroneousField_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_InvoiceError_from_string(jstring s) { - LDKStr s_conv = str_ref_to_owned_c(s); - LDKInvoiceError ret_var = InvoiceError_from_string(s_conv); + LDKNodeAlias ret_var = NodeAlias_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; } -jstring CS_LDK_InvoiceError_to_str(int64_t o) { - LDKInvoiceError o_conv; +int64_t CS_LDK_NodeAlias_hash(int64_t o) { + LDKNodeAlias o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv.is_owned = false; - LDKStr ret_str = InvoiceError_to_str(&o_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); + int64_t ret_conv = NodeAlias_hash(&o_conv); return ret_conv; } -int8_tArray CS_LDK_InvoiceError_write(int64_t obj) { - LDKInvoiceError obj_conv; +jboolean CS_LDK_NodeAlias_eq(int64_t a, int64_t b) { + LDKNodeAlias a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKNodeAlias b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = NodeAlias_eq(&a_conv, &b_conv); + return ret_conv; +} + +jstring CS_LDK_NodeAlias_to_str(int64_t o) { + LDKNodeAlias o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = NodeAlias_to_str(&o_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +int8_tArray CS_LDK_NodeAlias_write(int64_t obj) { + LDKNodeAlias obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = InvoiceError_write(&obj_conv); + LDKCVec_u8Z ret_var = NodeAlias_write(&obj_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_InvoiceError_read(int8_tArray ser) { +int64_t CS_LDK_NodeAlias_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); - *ret_conv = InvoiceError_read(ser_ref); + LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ"); + *ret_conv = NodeAlias_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -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); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - 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); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKTaggedHash ret_var = UnsignedInvoiceRequest_tagged_hash(&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_InvoiceRequest_free(int64_t this_obj) { - LDKInvoiceRequest this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InvoiceRequest_free(this_obj_conv); -} - -static inline uint64_t InvoiceRequest_clone_ptr(LDKInvoiceRequest *NONNULL_PTR arg) { - LDKInvoiceRequest ret_var = InvoiceRequest_clone(arg); - int64_t ret_ref = 0; - 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_InvoiceRequest_clone_ptr(int64_t arg) { - LDKInvoiceRequest arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = InvoiceRequest_clone_ptr(&arg_conv); - return ret_conv; -} - -int64_t CS_LDK_InvoiceRequest_clone(int64_t orig) { - LDKInvoiceRequest orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKInvoiceRequest ret_var = InvoiceRequest_clone(&orig_conv); - int64_t ret_ref = 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_free(int64_t this_obj) { - LDKVerifiedInvoiceRequest this_obj_conv; +void CS_LDK_NodeInfo_free(int64_t this_obj) { + LDKNodeInfo this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - VerifiedInvoiceRequest_free(this_obj_conv); + NodeInfo_free(this_obj_conv); } -int64_t CS_LDK_VerifiedInvoiceRequest_get_offer_id(int64_t this_ptr) { - LDKVerifiedInvoiceRequest this_ptr_conv; +int64_tArray CS_LDK_NodeInfo_get_channels(int64_t this_ptr) { + LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - 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; + LDKCVec_u64Z ret_var = NodeInfo_get_channels(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + + FREE(ret_var.data); + return ret_arr; } -void CS_LDK_VerifiedInvoiceRequest_set_offer_id(int64_t this_ptr, int64_t val) { - LDKVerifiedInvoiceRequest this_ptr_conv; +void CS_LDK_NodeInfo_set_channels(int64_t this_ptr, int64_tArray val) { + LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - 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); + LDKCVec_u64Z val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = val->elems; + for (size_t g = 0; g < val_constr.datalen; g++) { + int64_t val_conv_6 = val_vals[g]; + val_constr.data[g] = val_conv_6; + } + FREE(val); + NodeInfo_set_channels(&this_ptr_conv, val_constr); } -int64_t CS_LDK_VerifiedInvoiceRequest_get_keys(int64_t this_ptr) { - LDKVerifiedInvoiceRequest this_ptr_conv; +int64_t CS_LDK_NodeInfo_get_announcement_info(int64_t this_ptr) { + LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_SecretKeyZ *ret_copy = MALLOC(sizeof(LDKCOption_SecretKeyZ), "LDKCOption_SecretKeyZ"); - *ret_copy = VerifiedInvoiceRequest_get_keys(&this_ptr_conv); + LDKCOption_NodeAnnouncementInfoZ *ret_copy = MALLOC(sizeof(LDKCOption_NodeAnnouncementInfoZ), "LDKCOption_NodeAnnouncementInfoZ"); + *ret_copy = NodeInfo_get_announcement_info(&this_ptr_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void CS_LDK_VerifiedInvoiceRequest_set_keys(int64_t this_ptr, int64_t val) { - LDKVerifiedInvoiceRequest this_ptr_conv; +void CS_LDK_NodeInfo_set_announcement_info(int64_t this_ptr, int64_t val) { + LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; void* val_ptr = untag_ptr(val); CHECK_ACCESS(val_ptr); - LDKCOption_SecretKeyZ val_conv = *(LDKCOption_SecretKeyZ*)(val_ptr); - val_conv = COption_SecretKeyZ_clone((LDKCOption_SecretKeyZ*)untag_ptr(val)); - VerifiedInvoiceRequest_set_keys(&this_ptr_conv, val_conv); + LDKCOption_NodeAnnouncementInfoZ val_conv = *(LDKCOption_NodeAnnouncementInfoZ*)(val_ptr); + val_conv = COption_NodeAnnouncementInfoZ_clone((LDKCOption_NodeAnnouncementInfoZ*)untag_ptr(val)); + NodeInfo_set_announcement_info(&this_ptr_conv, val_conv); } -static inline uint64_t VerifiedInvoiceRequest_clone_ptr(LDKVerifiedInvoiceRequest *NONNULL_PTR arg) { - LDKVerifiedInvoiceRequest ret_var = VerifiedInvoiceRequest_clone(arg); +static inline uint64_t NodeInfo_clone_ptr(LDKNodeInfo *NONNULL_PTR arg) { + LDKNodeInfo ret_var = NodeInfo_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_VerifiedInvoiceRequest_clone_ptr(int64_t arg) { - LDKVerifiedInvoiceRequest arg_conv; +int64_t CS_LDK_NodeInfo_clone_ptr(int64_t arg) { + LDKNodeInfo arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = VerifiedInvoiceRequest_clone_ptr(&arg_conv); + int64_t ret_conv = NodeInfo_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_VerifiedInvoiceRequest_clone(int64_t orig) { - LDKVerifiedInvoiceRequest orig_conv; +int64_t CS_LDK_NodeInfo_clone(int64_t orig) { + LDKNodeInfo orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKVerifiedInvoiceRequest ret_var = VerifiedInvoiceRequest_clone(&orig_conv); + LDKNodeInfo ret_var = NodeInfo_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; } -ptrArray CS_LDK_UnsignedInvoiceRequest_chains(int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +jboolean CS_LDK_NodeInfo_eq(int64_t a, int64_t b) { + LDKNodeInfo a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKNodeInfo b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = NodeInfo_eq(&a_conv, &b_conv); + return ret_conv; +} + +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; - LDKCVec_ThirtyTwoBytesZ ret_var = UnsignedInvoiceRequest_chains(&this_arg_conv); - ptrArray ret_arr = NULL; - ret_arr = init_ptrArray(ret_var.datalen, __LINE__); - int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8); - for (size_t i = 0; i < ret_var.datalen; i++) { - int8_tArray ret_conv_8_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_conv_8_arr->elems, ret_var.data[i].data, 32); - ret_arr_ptr[i] = ret_conv_8_arr; - } - - FREE(ret_var.data); + jboolean ret_conv = NodeInfo_is_tor_only(&this_arg_conv); + return ret_conv; +} + +jstring CS_LDK_NodeInfo_to_str(int64_t o) { + LDKNodeInfo o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = NodeInfo_to_str(&o_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +int8_tArray CS_LDK_NodeInfo_write(int64_t obj) { + LDKNodeInfo obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = NodeInfo_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_UnsignedInvoiceRequest_metadata(int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = UnsignedInvoiceRequest_metadata(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_NodeInfo_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); + *ret_conv = NodeInfo_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_UnsignedInvoiceRequest_amount(int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_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; +int8_tArray CS_LDK_NetworkGraph_write(int64_t obj) { + LDKNetworkGraph obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = NetworkGraph_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -int64_t CS_LDK_UnsignedInvoiceRequest_description(int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = UnsignedInvoiceRequest_description(&this_arg_conv); +int64_t CS_LDK_NetworkGraph_read(int8_tArray ser, int64_t arg) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + void* arg_ptr = untag_ptr(arg); + CHECK_ACCESS(arg_ptr); + LDKLogger arg_conv = *(LDKLogger*)(arg_ptr); + if (arg_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&arg_conv); + } + LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); + *ret_conv = NetworkGraph_read(ser_ref, arg_conv); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +jstring CS_LDK_NetworkGraph_to_str(int64_t o) { + LDKNetworkGraph o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = NetworkGraph_to_str(&o_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +int64_t CS_LDK_NetworkGraph_new(int32_t network, int64_t logger) { + LDKNetwork network_conv = LDKNetwork_from_cs(network); + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKNetworkGraph ret_var = NetworkGraph_new(network_conv, logger_conv); int64_t ret_ref = 0; 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_offer_features(int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +int64_t CS_LDK_NetworkGraph_read_only(int64_t this_arg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKOfferFeatures ret_var = UnsignedInvoiceRequest_offer_features(&this_arg_conv); + LDKReadOnlyNetworkGraph ret_var = NetworkGraph_read_only(&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_UnsignedInvoiceRequest_absolute_expiry(int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +int64_t CS_LDK_NetworkGraph_get_last_rapid_gossip_sync_timestamp(int64_t this_arg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = UnsignedInvoiceRequest_absolute_expiry(&this_arg_conv); + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = NetworkGraph_get_last_rapid_gossip_sync_timestamp(&this_arg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_UnsignedInvoiceRequest_issuer(int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +void CS_LDK_NetworkGraph_set_last_rapid_gossip_sync_timestamp(int64_t this_arg, int32_t last_rapid_gossip_sync_timestamp) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKPrintableString ret_var = UnsignedInvoiceRequest_issuer(&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; + NetworkGraph_set_last_rapid_gossip_sync_timestamp(&this_arg_conv, last_rapid_gossip_sync_timestamp); } -int64_tArray CS_LDK_UnsignedInvoiceRequest_paths(int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +int64_t CS_LDK_NetworkGraph_update_node_from_announcement(int64_t this_arg, int64_t msg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_BlindedPathZ ret_var = UnsignedInvoiceRequest_paths(&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 n = 0; n < ret_var.datalen; n++) { - LDKBlindedPath 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_UnsignedInvoiceRequest_supported_quantity(int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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_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; + LDKNodeAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_node_from_announcement(&this_arg_conv, &msg_conv); + return tag_ptr(ret_conv, true); } -int8_tArray CS_LDK_UnsignedInvoiceRequest_signing_pubkey(int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +int64_t CS_LDK_NetworkGraph_update_node_from_unsigned_announcement(int64_t this_arg, int64_t msg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, UnsignedInvoiceRequest_signing_pubkey(&this_arg_conv).compressed_form, 33); - return ret_arr; + LDKUnsignedNodeAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_node_from_unsigned_announcement(&this_arg_conv, &msg_conv); + return tag_ptr(ret_conv, true); } -int8_tArray CS_LDK_UnsignedInvoiceRequest_payer_metadata(int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +int64_t CS_LDK_NetworkGraph_update_channel_from_announcement(int64_t this_arg, int64_t msg, int64_t utxo_lookup) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKu8slice ret_var = UnsignedInvoiceRequest_payer_metadata(&this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - return ret_arr; + LDKChannelAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + void* utxo_lookup_ptr = untag_ptr(utxo_lookup); + CHECK_ACCESS(utxo_lookup_ptr); + LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr); + // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ + if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) { + // Manually implement clone for Java trait instances + if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some); + } + } + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_channel_from_announcement(&this_arg_conv, &msg_conv, utxo_lookup_conv); + return tag_ptr(ret_conv, true); } -int8_tArray CS_LDK_UnsignedInvoiceRequest_chain(int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +int64_t CS_LDK_NetworkGraph_update_channel_from_announcement_no_lookup(int64_t this_arg, int64_t msg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, UnsignedInvoiceRequest_chain(&this_arg_conv).data, 32); - return ret_arr; + LDKChannelAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_channel_from_announcement_no_lookup(&this_arg_conv, &msg_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_UnsignedInvoiceRequest_amount_msats(int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +int64_t CS_LDK_NetworkGraph_update_channel_from_unsigned_announcement(int64_t this_arg, int64_t msg, int64_t utxo_lookup) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = UnsignedInvoiceRequest_amount_msats(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKUnsignedChannelAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + void* utxo_lookup_ptr = untag_ptr(utxo_lookup); + CHECK_ACCESS(utxo_lookup_ptr); + LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr); + // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ + if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) { + // Manually implement clone for Java trait instances + if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some); + } + } + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_channel_from_unsigned_announcement(&this_arg_conv, &msg_conv, utxo_lookup_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_UnsignedInvoiceRequest_invoice_request_features(int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +int64_t CS_LDK_NetworkGraph_add_channel_from_partial_announcement(int64_t this_arg, int64_t short_channel_id, int64_t timestamp, int64_t features, int8_tArray node_id_1, int8_tArray node_id_2) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKInvoiceRequestFeatures ret_var = UnsignedInvoiceRequest_invoice_request_features(&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; + LDKChannelFeatures features_conv; + features_conv.inner = untag_ptr(features); + features_conv.is_owned = ptr_is_owned(features); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); + features_conv = ChannelFeatures_clone(&features_conv); + LDKPublicKey node_id_1_ref; + CHECK(node_id_1->arr_len == 33); + memcpy(node_id_1_ref.compressed_form, node_id_1->elems, 33); FREE(node_id_1); + LDKPublicKey node_id_2_ref; + CHECK(node_id_2->arr_len == 33); + memcpy(node_id_2_ref.compressed_form, node_id_2->elems, 33); FREE(node_id_2); + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_add_channel_from_partial_announcement(&this_arg_conv, short_channel_id, timestamp, features_conv, node_id_1_ref, node_id_2_ref); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_UnsignedInvoiceRequest_quantity(int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +void CS_LDK_NetworkGraph_channel_failed_permanent(int64_t this_arg, int64_t short_channel_id) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = UnsignedInvoiceRequest_quantity(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + NetworkGraph_channel_failed_permanent(&this_arg_conv, short_channel_id); } -int8_tArray CS_LDK_UnsignedInvoiceRequest_payer_id(int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +void CS_LDK_NetworkGraph_node_failed_permanent(int64_t this_arg, int8_tArray node_id) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, UnsignedInvoiceRequest_payer_id(&this_arg_conv).compressed_form, 33); - return ret_arr; + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + NetworkGraph_node_failed_permanent(&this_arg_conv, node_id_ref); } -int64_t CS_LDK_UnsignedInvoiceRequest_payer_note(int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +void CS_LDK_NetworkGraph_remove_stale_channels_and_tracking(int64_t this_arg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKPrintableString ret_var = UnsignedInvoiceRequest_payer_note(&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; + NetworkGraph_remove_stale_channels_and_tracking(&this_arg_conv); } -ptrArray CS_LDK_InvoiceRequest_chains(int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +void CS_LDK_NetworkGraph_remove_stale_channels_and_tracking_with_time(int64_t this_arg, int64_t current_time_unix) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_ThirtyTwoBytesZ ret_var = InvoiceRequest_chains(&this_arg_conv); - ptrArray ret_arr = NULL; - ret_arr = init_ptrArray(ret_var.datalen, __LINE__); - int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8); - for (size_t i = 0; i < ret_var.datalen; i++) { - int8_tArray ret_conv_8_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_conv_8_arr->elems, ret_var.data[i].data, 32); - ret_arr_ptr[i] = ret_conv_8_arr; - } - - FREE(ret_var.data); - return ret_arr; + NetworkGraph_remove_stale_channels_and_tracking_with_time(&this_arg_conv, current_time_unix); } -int64_t CS_LDK_InvoiceRequest_metadata(int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +int64_t CS_LDK_NetworkGraph_update_channel(int64_t this_arg, int64_t msg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = InvoiceRequest_metadata(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKChannelUpdate msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_channel(&this_arg_conv, &msg_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_InvoiceRequest_amount(int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +int64_t CS_LDK_NetworkGraph_update_channel_unsigned(int64_t this_arg, int64_t msg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - 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; + LDKUnsignedChannelUpdate msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_channel_unsigned(&this_arg_conv, &msg_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_InvoiceRequest_description(int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +int64_t CS_LDK_NetworkGraph_verify_channel_update(int64_t this_arg, int64_t msg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKPrintableString ret_var = InvoiceRequest_description(&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; + LDKChannelUpdate msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_verify_channel_update(&this_arg_conv, &msg_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_InvoiceRequest_offer_features(int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +int64_t CS_LDK_ReadOnlyNetworkGraph_channel(int64_t this_arg, int64_t short_channel_id) { + LDKReadOnlyNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKOfferFeatures ret_var = InvoiceRequest_offer_features(&this_arg_conv); + LDKChannelInfo ret_var = ReadOnlyNetworkGraph_channel(&this_arg_conv, short_channel_id); int64_t ret_ref = 0; 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_InvoiceRequest_absolute_expiry(int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +int64_tArray CS_LDK_ReadOnlyNetworkGraph_list_channels(int64_t this_arg) { + LDKReadOnlyNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = InvoiceRequest_absolute_expiry(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKCVec_u64Z ret_var = ReadOnlyNetworkGraph_list_channels(&this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + + FREE(ret_var.data); + return ret_arr; } -int64_t CS_LDK_InvoiceRequest_issuer(int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +int64_t CS_LDK_ReadOnlyNetworkGraph_node(int64_t this_arg, int64_t node_id) { + LDKReadOnlyNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKPrintableString ret_var = InvoiceRequest_issuer(&this_arg_conv); + LDKNodeId node_id_conv; + node_id_conv.inner = untag_ptr(node_id); + node_id_conv.is_owned = ptr_is_owned(node_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); + node_id_conv.is_owned = false; + LDKNodeInfo ret_var = ReadOnlyNetworkGraph_node(&this_arg_conv, &node_id_conv); int64_t ret_ref = 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_InvoiceRequest_paths(int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +int64_tArray CS_LDK_ReadOnlyNetworkGraph_list_nodes(int64_t this_arg) { + LDKReadOnlyNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_BlindedPathZ ret_var = InvoiceRequest_paths(&this_arg_conv); + LDKCVec_NodeIdZ ret_var = ReadOnlyNetworkGraph_list_nodes(&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 n = 0; n < ret_var.datalen; n++) { - LDKBlindedPath 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; + for (size_t i = 0; i < ret_var.datalen; i++) { + LDKNodeId ret_conv_8_var = ret_var.data[i]; + int64_t ret_conv_8_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_8_var); + ret_conv_8_ref = tag_ptr(ret_conv_8_var.inner, ret_conv_8_var.is_owned); + ret_arr_ptr[i] = ret_conv_8_ref; } FREE(ret_var.data); return ret_arr; } -int64_t CS_LDK_InvoiceRequest_supported_quantity(int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +int64_t CS_LDK_ReadOnlyNetworkGraph_get_addresses(int64_t this_arg, int8_tArray pubkey) { + LDKReadOnlyNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); - *ret_copy = InvoiceRequest_supported_quantity(&this_arg_conv); + LDKPublicKey pubkey_ref; + CHECK(pubkey->arr_len == 33); + memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); FREE(pubkey); + LDKCOption_CVec_SocketAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_SocketAddressZZ), "LDKCOption_CVec_SocketAddressZZ"); + *ret_copy = ReadOnlyNetworkGraph_get_addresses(&this_arg_conv, pubkey_ref); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int8_tArray CS_LDK_InvoiceRequest_signing_pubkey(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(33, __LINE__); - memcpy(ret_arr->elems, InvoiceRequest_signing_pubkey(&this_arg_conv).compressed_form, 33); - return ret_arr; +void CS_LDK_DefaultRouter_free(int64_t this_obj) { + LDKDefaultRouter this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + DefaultRouter_free(this_obj_conv); } -int8_tArray CS_LDK_InvoiceRequest_payer_metadata(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; - LDKu8slice ret_var = InvoiceRequest_payer_metadata(&this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - return ret_arr; +int64_t CS_LDK_DefaultRouter_new(int64_t network_graph, int64_t logger, int64_t entropy_source, int64_t scorer, int64_t score_params) { + LDKNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + void* scorer_ptr = untag_ptr(scorer); + CHECK_ACCESS(scorer_ptr); + LDKLockableScore scorer_conv = *(LDKLockableScore*)(scorer_ptr); + if (scorer_conv.free == LDKLockableScore_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLockableScore_JCalls_cloned(&scorer_conv); + } + LDKProbabilisticScoringFeeParameters score_params_conv; + score_params_conv.inner = untag_ptr(score_params); + score_params_conv.is_owned = ptr_is_owned(score_params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(score_params_conv); + score_params_conv = ProbabilisticScoringFeeParameters_clone(&score_params_conv); + LDKDefaultRouter ret_var = DefaultRouter_new(&network_graph_conv, logger_conv, entropy_source_conv, scorer_conv, score_params_conv); + int64_t ret_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_InvoiceRequest_chain(int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +int64_t CS_LDK_DefaultRouter_as_Router(int64_t this_arg) { + LDKDefaultRouter this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, InvoiceRequest_chain(&this_arg_conv).data, 32); - return ret_arr; + LDKRouter* ret_ret = MALLOC(sizeof(LDKRouter), "LDKRouter"); + *ret_ret = DefaultRouter_as_Router(&this_arg_conv); + return tag_ptr(ret_ret, true); } -int64_t CS_LDK_InvoiceRequest_amount_msats(int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +int64_t CS_LDK_DefaultRouter_as_MessageRouter(int64_t this_arg) { + LDKDefaultRouter this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = InvoiceRequest_amount_msats(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKMessageRouter* ret_ret = MALLOC(sizeof(LDKMessageRouter), "LDKMessageRouter"); + *ret_ret = DefaultRouter_as_MessageRouter(&this_arg_conv); + return tag_ptr(ret_ret, true); } -int64_t CS_LDK_InvoiceRequest_invoice_request_features(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; - LDKInvoiceRequestFeatures ret_var = InvoiceRequest_invoice_request_features(&this_arg_conv); +void CS_LDK_Router_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); + LDKRouter this_ptr_conv = *(LDKRouter*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Router_free(this_ptr_conv); +} + +void CS_LDK_ScorerAccountingForInFlightHtlcs_free(int64_t this_obj) { + LDKScorerAccountingForInFlightHtlcs this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ScorerAccountingForInFlightHtlcs_free(this_obj_conv); +} + +int64_t CS_LDK_ScorerAccountingForInFlightHtlcs_new(int64_t scorer, int64_t inflight_htlcs) { + void* scorer_ptr = untag_ptr(scorer); + CHECK_ACCESS(scorer_ptr); + LDKScoreLookUp scorer_conv = *(LDKScoreLookUp*)(scorer_ptr); + if (scorer_conv.free == LDKScoreLookUp_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKScoreLookUp_JCalls_cloned(&scorer_conv); + } + LDKInFlightHtlcs inflight_htlcs_conv; + inflight_htlcs_conv.inner = untag_ptr(inflight_htlcs); + inflight_htlcs_conv.is_owned = ptr_is_owned(inflight_htlcs); + CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_conv); + inflight_htlcs_conv.is_owned = false; + LDKScorerAccountingForInFlightHtlcs ret_var = ScorerAccountingForInFlightHtlcs_new(scorer_conv, &inflight_htlcs_conv); int64_t ret_ref = 0; 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_InvoiceRequest_quantity(int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +int64_t CS_LDK_ScorerAccountingForInFlightHtlcs_as_ScoreLookUp(int64_t this_arg) { + LDKScorerAccountingForInFlightHtlcs this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = InvoiceRequest_quantity(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); + LDKScoreLookUp* ret_ret = MALLOC(sizeof(LDKScoreLookUp), "LDKScoreLookUp"); + *ret_ret = ScorerAccountingForInFlightHtlcs_as_ScoreLookUp(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +void CS_LDK_InFlightHtlcs_free(int64_t this_obj) { + LDKInFlightHtlcs this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InFlightHtlcs_free(this_obj_conv); +} + +static inline uint64_t InFlightHtlcs_clone_ptr(LDKInFlightHtlcs *NONNULL_PTR arg) { + LDKInFlightHtlcs ret_var = InFlightHtlcs_clone(arg); + int64_t ret_ref = 0; + 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_InFlightHtlcs_clone_ptr(int64_t arg) { + LDKInFlightHtlcs arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = InFlightHtlcs_clone_ptr(&arg_conv); + return ret_conv; +} -int8_tArray CS_LDK_InvoiceRequest_payer_id(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(33, __LINE__); - memcpy(ret_arr->elems, InvoiceRequest_payer_id(&this_arg_conv).compressed_form, 33); - return ret_arr; +int64_t CS_LDK_InFlightHtlcs_clone(int64_t orig) { + LDKInFlightHtlcs orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKInFlightHtlcs ret_var = InFlightHtlcs_clone(&orig_conv); + int64_t ret_ref = 0; + 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_InvoiceRequest_payer_note(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; - LDKPrintableString ret_var = InvoiceRequest_payer_note(&this_arg_conv); +int64_t CS_LDK_InFlightHtlcs_new() { + LDKInFlightHtlcs ret_var = InFlightHtlcs_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_InvoiceRequest_respond_with(int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash) { - LDKInvoiceRequest this_arg_conv; +void CS_LDK_InFlightHtlcs_process_path(int64_t this_arg, int64_t path, int8_tArray payer_node_id) { + LDKInFlightHtlcs this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - 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); + LDKPath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv.is_owned = false; + LDKPublicKey payer_node_id_ref; + CHECK(payer_node_id->arr_len == 33); + memcpy(payer_node_id_ref.compressed_form, payer_node_id->elems, 33); FREE(payer_node_id); + InFlightHtlcs_process_path(&this_arg_conv, &path_conv, payer_node_id_ref); } -int64_t 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; +void CS_LDK_InFlightHtlcs_add_inflight_htlc(int64_t this_arg, int64_t source, int64_t target, int64_t channel_scid, int64_t used_msat) { + LDKInFlightHtlcs this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - 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) { - 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 = InvoiceRequest_clone(&this_arg_conv); - LDKExpandedKey key_conv; - key_conv.inner = untag_ptr(key); - key_conv.is_owned = ptr_is_owned(key); - CHECK_INNER_FIELD_ACCESS_OR_NULL(key_conv); - key_conv.is_owned = false; - LDKCResult_VerifiedInvoiceRequestNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_VerifiedInvoiceRequestNoneZ), "LDKCResult_VerifiedInvoiceRequestNoneZ"); - *ret_conv = InvoiceRequest_verify(this_arg_conv, &key_conv); - 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); - this_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_ThirtyTwoBytesZ ret_var = VerifiedInvoiceRequest_chains(&this_arg_conv); - ptrArray ret_arr = NULL; - ret_arr = init_ptrArray(ret_var.datalen, __LINE__); - int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8); - for (size_t i = 0; i < ret_var.datalen; i++) { - int8_tArray ret_conv_8_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_conv_8_arr->elems, ret_var.data[i].data, 32); - ret_arr_ptr[i] = ret_conv_8_arr; - } - - FREE(ret_var.data); - return ret_arr; -} - -int64_t CS_LDK_VerifiedInvoiceRequest_metadata(int64_t this_arg) { - 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; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = VerifiedInvoiceRequest_metadata(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_VerifiedInvoiceRequest_amount(int64_t this_arg) { - 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; - 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; -} - -int64_t CS_LDK_VerifiedInvoiceRequest_description(int64_t this_arg) { - 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; - LDKPrintableString ret_var = VerifiedInvoiceRequest_description(&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_VerifiedInvoiceRequest_offer_features(int64_t this_arg) { - 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; - LDKOfferFeatures ret_var = VerifiedInvoiceRequest_offer_features(&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_VerifiedInvoiceRequest_absolute_expiry(int64_t this_arg) { - 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; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = VerifiedInvoiceRequest_absolute_expiry(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_VerifiedInvoiceRequest_issuer(int64_t this_arg) { - 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; - LDKPrintableString ret_var = VerifiedInvoiceRequest_issuer(&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_VerifiedInvoiceRequest_paths(int64_t this_arg) { - 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_BlindedPathZ ret_var = VerifiedInvoiceRequest_paths(&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 n = 0; n < ret_var.datalen; n++) { - LDKBlindedPath 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_VerifiedInvoiceRequest_supported_quantity(int64_t this_arg) { - 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; - 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; -} - -int8_tArray CS_LDK_VerifiedInvoiceRequest_signing_pubkey(int64_t this_arg) { - 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; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, VerifiedInvoiceRequest_signing_pubkey(&this_arg_conv).compressed_form, 33); - return ret_arr; -} - -int8_tArray CS_LDK_VerifiedInvoiceRequest_payer_metadata(int64_t this_arg) { - 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; - LDKu8slice ret_var = VerifiedInvoiceRequest_payer_metadata(&this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - return ret_arr; -} - -int8_tArray CS_LDK_VerifiedInvoiceRequest_chain(int64_t this_arg) { - 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; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, VerifiedInvoiceRequest_chain(&this_arg_conv).data, 32); - return ret_arr; -} - -int64_t CS_LDK_VerifiedInvoiceRequest_amount_msats(int64_t this_arg) { - 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; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = VerifiedInvoiceRequest_amount_msats(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_VerifiedInvoiceRequest_invoice_request_features(int64_t this_arg) { - 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; - LDKInvoiceRequestFeatures ret_var = VerifiedInvoiceRequest_invoice_request_features(&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; + LDKNodeId source_conv; + source_conv.inner = untag_ptr(source); + source_conv.is_owned = ptr_is_owned(source); + CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv); + source_conv.is_owned = false; + LDKNodeId target_conv; + target_conv.inner = untag_ptr(target); + target_conv.is_owned = ptr_is_owned(target); + CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); + target_conv.is_owned = false; + InFlightHtlcs_add_inflight_htlc(&this_arg_conv, &source_conv, &target_conv, channel_scid, used_msat); } -int64_t CS_LDK_VerifiedInvoiceRequest_quantity(int64_t this_arg) { - LDKVerifiedInvoiceRequest this_arg_conv; +int64_t CS_LDK_InFlightHtlcs_used_liquidity_msat(int64_t this_arg, int64_t source, int64_t target, int64_t channel_scid) { + LDKInFlightHtlcs this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; + LDKNodeId source_conv; + source_conv.inner = untag_ptr(source); + source_conv.is_owned = ptr_is_owned(source); + CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv); + source_conv.is_owned = false; + LDKNodeId target_conv; + target_conv.inner = untag_ptr(target); + target_conv.is_owned = ptr_is_owned(target); + CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); + target_conv.is_owned = false; LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = VerifiedInvoiceRequest_quantity(&this_arg_conv); + *ret_copy = InFlightHtlcs_used_liquidity_msat(&this_arg_conv, &source_conv, &target_conv, channel_scid); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int8_tArray CS_LDK_VerifiedInvoiceRequest_payer_id(int64_t this_arg) { - 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; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, VerifiedInvoiceRequest_payer_id(&this_arg_conv).compressed_form, 33); - return ret_arr; -} - -int64_t CS_LDK_VerifiedInvoiceRequest_payer_note(int64_t this_arg) { - 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; - LDKPrintableString ret_var = VerifiedInvoiceRequest_payer_note(&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_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; +int8_tArray CS_LDK_InFlightHtlcs_write(int64_t obj) { + LDKInFlightHtlcs obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = UnsignedInvoiceRequest_write(&obj_conv); + LDKCVec_u8Z ret_var = InFlightHtlcs_write(&obj_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } -int8_tArray CS_LDK_InvoiceRequest_write(int64_t obj) { - LDKInvoiceRequest obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = InvoiceRequest_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +int64_t CS_LDK_InFlightHtlcs_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ"); + *ret_conv = InFlightHtlcs_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -void CS_LDK_InvoiceRequestFields_free(int64_t this_obj) { - LDKInvoiceRequestFields this_obj_conv; +void CS_LDK_RouteHop_free(int64_t this_obj) { + LDKRouteHop this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InvoiceRequestFields_free(this_obj_conv); + RouteHop_free(this_obj_conv); } -int8_tArray CS_LDK_InvoiceRequestFields_get_payer_id(int64_t this_ptr) { - LDKInvoiceRequestFields this_ptr_conv; +int8_tArray CS_LDK_RouteHop_get_pubkey(int64_t this_ptr) { + LDKRouteHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, InvoiceRequestFields_get_payer_id(&this_ptr_conv).compressed_form, 33); + memcpy(ret_arr->elems, RouteHop_get_pubkey(&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; +void CS_LDK_RouteHop_set_pubkey(int64_t this_ptr, int8_tArray val) { + LDKRouteHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -68537,1273 +71559,2007 @@ void CS_LDK_InvoiceRequestFields_set_payer_id(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); - InvoiceRequestFields_set_payer_id(&this_ptr_conv, val_ref); + RouteHop_set_pubkey(&this_ptr_conv, val_ref); } -int64_t CS_LDK_InvoiceRequestFields_get_quantity(int64_t this_ptr) { - LDKInvoiceRequestFields this_ptr_conv; +int64_t CS_LDK_RouteHop_get_node_features(int64_t this_ptr) { + LDKRouteHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - 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); + LDKNodeFeatures ret_var = RouteHop_get_node_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_InvoiceRequestFields_set_quantity(int64_t this_ptr, int64_t val) { - LDKInvoiceRequestFields this_ptr_conv; +void CS_LDK_RouteHop_set_node_features(int64_t this_ptr, int64_t val) { + LDKRouteHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - 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); + LDKNodeFeatures val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = NodeFeatures_clone(&val_conv); + RouteHop_set_node_features(&this_ptr_conv, val_conv); } -int64_t CS_LDK_InvoiceRequestFields_get_payer_note_truncated(int64_t this_ptr) { - LDKInvoiceRequestFields this_ptr_conv; +int64_t CS_LDK_RouteHop_get_short_channel_id(int64_t this_ptr) { + LDKRouteHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKUntrustedString ret_var = InvoiceRequestFields_get_payer_note_truncated(&this_ptr_conv); + int64_t ret_conv = RouteHop_get_short_channel_id(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_RouteHop_set_short_channel_id(int64_t this_ptr, int64_t val) { + LDKRouteHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + RouteHop_set_short_channel_id(&this_ptr_conv, val); +} + +int64_t CS_LDK_RouteHop_get_channel_features(int64_t this_ptr) { + LDKRouteHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelFeatures ret_var = RouteHop_get_channel_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_InvoiceRequestFields_set_payer_note_truncated(int64_t this_ptr, int64_t val) { - LDKInvoiceRequestFields this_ptr_conv; +void CS_LDK_RouteHop_set_channel_features(int64_t this_ptr, int64_t val) { + LDKRouteHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKUntrustedString val_conv; + LDKChannelFeatures val_conv; val_conv.inner = untag_ptr(val); val_conv.is_owned = ptr_is_owned(val); CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = UntrustedString_clone(&val_conv); - InvoiceRequestFields_set_payer_note_truncated(&this_ptr_conv, val_conv); + val_conv = ChannelFeatures_clone(&val_conv); + RouteHop_set_channel_features(&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; +int64_t CS_LDK_RouteHop_get_fee_msat(int64_t this_ptr) { + LDKRouteHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = RouteHop_get_fee_msat(&this_ptr_conv); + return ret_conv; } -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; +void CS_LDK_RouteHop_set_fee_msat(int64_t this_ptr, int64_t val) { + LDKRouteHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + RouteHop_set_fee_msat(&this_ptr_conv, val); } -int64_t CS_LDK_InvoiceRequestFields_clone(int64_t orig) { - LDKInvoiceRequestFields orig_conv; +int32_t CS_LDK_RouteHop_get_cltv_expiry_delta(int64_t this_ptr) { + LDKRouteHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = RouteHop_get_cltv_expiry_delta(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_RouteHop_set_cltv_expiry_delta(int64_t this_ptr, int32_t val) { + LDKRouteHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + RouteHop_set_cltv_expiry_delta(&this_ptr_conv, val); +} + +jboolean CS_LDK_RouteHop_get_maybe_announced_channel(int64_t this_ptr) { + LDKRouteHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + jboolean ret_conv = RouteHop_get_maybe_announced_channel(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_RouteHop_set_maybe_announced_channel(int64_t this_ptr, jboolean val) { + LDKRouteHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + RouteHop_set_maybe_announced_channel(&this_ptr_conv, val); +} + +int64_t CS_LDK_RouteHop_new(int8_tArray pubkey_arg, int64_t node_features_arg, int64_t short_channel_id_arg, int64_t channel_features_arg, int64_t fee_msat_arg, int32_t cltv_expiry_delta_arg, jboolean maybe_announced_channel_arg) { + LDKPublicKey pubkey_arg_ref; + CHECK(pubkey_arg->arr_len == 33); + memcpy(pubkey_arg_ref.compressed_form, pubkey_arg->elems, 33); FREE(pubkey_arg); + LDKNodeFeatures node_features_arg_conv; + node_features_arg_conv.inner = untag_ptr(node_features_arg); + node_features_arg_conv.is_owned = ptr_is_owned(node_features_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_features_arg_conv); + node_features_arg_conv = NodeFeatures_clone(&node_features_arg_conv); + LDKChannelFeatures channel_features_arg_conv; + channel_features_arg_conv.inner = untag_ptr(channel_features_arg); + channel_features_arg_conv.is_owned = ptr_is_owned(channel_features_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_features_arg_conv); + channel_features_arg_conv = ChannelFeatures_clone(&channel_features_arg_conv); + LDKRouteHop ret_var = RouteHop_new(pubkey_arg_ref, node_features_arg_conv, short_channel_id_arg, channel_features_arg_conv, fee_msat_arg, cltv_expiry_delta_arg, maybe_announced_channel_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 RouteHop_clone_ptr(LDKRouteHop *NONNULL_PTR arg) { + LDKRouteHop ret_var = RouteHop_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_RouteHop_clone_ptr(int64_t arg) { + LDKRouteHop arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = RouteHop_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_RouteHop_clone(int64_t orig) { + LDKRouteHop orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKInvoiceRequestFields ret_var = InvoiceRequestFields_clone(&orig_conv); + LDKRouteHop ret_var = RouteHop_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; +int64_t CS_LDK_RouteHop_hash(int64_t o) { + LDKRouteHop o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = RouteHop_hash(&o_conv); + return ret_conv; +} + +jboolean CS_LDK_RouteHop_eq(int64_t a, int64_t b) { + LDKRouteHop a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKInvoiceRequestFields b_conv; + LDKRouteHop b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = InvoiceRequestFields_eq(&a_conv, &b_conv); + jboolean ret_conv = RouteHop_eq(&a_conv, &b_conv); return ret_conv; } -int8_tArray CS_LDK_InvoiceRequestFields_write(int64_t obj) { - LDKInvoiceRequestFields obj_conv; +int8_tArray CS_LDK_RouteHop_write(int64_t obj) { + LDKRouteHop obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = InvoiceRequestFields_write(&obj_conv); + LDKCVec_u8Z ret_var = RouteHop_write(&obj_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_InvoiceRequestFields_read(int8_tArray ser) { +int64_t CS_LDK_RouteHop_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); + LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); + *ret_conv = RouteHop_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_TaggedHash_free(int64_t this_obj) { - LDKTaggedHash this_obj_conv; +void CS_LDK_BlindedTail_free(int64_t this_obj) { + LDKBlindedTail this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - TaggedHash_free(this_obj_conv); + BlindedTail_free(this_obj_conv); } -static inline uint64_t TaggedHash_clone_ptr(LDKTaggedHash *NONNULL_PTR arg) { - LDKTaggedHash ret_var = TaggedHash_clone(arg); +int64_tArray CS_LDK_BlindedTail_get_hops(int64_t this_ptr) { + LDKBlindedTail this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_BlindedHopZ ret_var = BlindedTail_get_hops(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t m = 0; m < ret_var.datalen; m++) { + LDKBlindedHop ret_conv_12_var = ret_var.data[m]; + int64_t ret_conv_12_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_var); + ret_conv_12_ref = tag_ptr(ret_conv_12_var.inner, ret_conv_12_var.is_owned); + ret_arr_ptr[m] = ret_conv_12_ref; + } + + FREE(ret_var.data); + return ret_arr; +} + +void CS_LDK_BlindedTail_set_hops(int64_t this_ptr, int64_tArray val) { + LDKBlindedTail this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_BlindedHopZ val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKBlindedHop), "LDKCVec_BlindedHopZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = val->elems; + for (size_t m = 0; m < val_constr.datalen; m++) { + int64_t val_conv_12 = val_vals[m]; + LDKBlindedHop val_conv_12_conv; + val_conv_12_conv.inner = untag_ptr(val_conv_12); + val_conv_12_conv.is_owned = ptr_is_owned(val_conv_12); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_12_conv); + val_conv_12_conv = BlindedHop_clone(&val_conv_12_conv); + val_constr.data[m] = val_conv_12_conv; + } + FREE(val); + BlindedTail_set_hops(&this_ptr_conv, val_constr); +} + +int8_tArray CS_LDK_BlindedTail_get_blinding_point(int64_t this_ptr) { + LDKBlindedTail this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, BlindedTail_get_blinding_point(&this_ptr_conv).compressed_form, 33); + return ret_arr; +} + +void CS_LDK_BlindedTail_set_blinding_point(int64_t this_ptr, int8_tArray val) { + LDKBlindedTail this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + BlindedTail_set_blinding_point(&this_ptr_conv, val_ref); +} + +int32_t CS_LDK_BlindedTail_get_excess_final_cltv_expiry_delta(int64_t this_ptr) { + LDKBlindedTail this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = BlindedTail_get_excess_final_cltv_expiry_delta(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_BlindedTail_set_excess_final_cltv_expiry_delta(int64_t this_ptr, int32_t val) { + LDKBlindedTail this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + BlindedTail_set_excess_final_cltv_expiry_delta(&this_ptr_conv, val); +} + +int64_t CS_LDK_BlindedTail_get_final_value_msat(int64_t this_ptr) { + LDKBlindedTail this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = BlindedTail_get_final_value_msat(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_BlindedTail_set_final_value_msat(int64_t this_ptr, int64_t val) { + LDKBlindedTail this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + BlindedTail_set_final_value_msat(&this_ptr_conv, val); +} + +int64_t CS_LDK_BlindedTail_new(int64_tArray hops_arg, int8_tArray blinding_point_arg, int32_t excess_final_cltv_expiry_delta_arg, int64_t final_value_msat_arg) { + LDKCVec_BlindedHopZ hops_arg_constr; + hops_arg_constr.datalen = hops_arg->arr_len; + if (hops_arg_constr.datalen > 0) + hops_arg_constr.data = MALLOC(hops_arg_constr.datalen * sizeof(LDKBlindedHop), "LDKCVec_BlindedHopZ Elements"); + else + hops_arg_constr.data = NULL; + int64_t* hops_arg_vals = hops_arg->elems; + for (size_t m = 0; m < hops_arg_constr.datalen; m++) { + int64_t hops_arg_conv_12 = hops_arg_vals[m]; + LDKBlindedHop hops_arg_conv_12_conv; + hops_arg_conv_12_conv.inner = untag_ptr(hops_arg_conv_12); + hops_arg_conv_12_conv.is_owned = ptr_is_owned(hops_arg_conv_12); + CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_arg_conv_12_conv); + hops_arg_conv_12_conv = BlindedHop_clone(&hops_arg_conv_12_conv); + hops_arg_constr.data[m] = hops_arg_conv_12_conv; + } + FREE(hops_arg); + LDKPublicKey blinding_point_arg_ref; + CHECK(blinding_point_arg->arr_len == 33); + memcpy(blinding_point_arg_ref.compressed_form, blinding_point_arg->elems, 33); FREE(blinding_point_arg); + LDKBlindedTail ret_var = BlindedTail_new(hops_arg_constr, blinding_point_arg_ref, excess_final_cltv_expiry_delta_arg, final_value_msat_arg); int64_t ret_ref = 0; 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_TaggedHash_clone_ptr(int64_t arg) { - LDKTaggedHash arg_conv; + +static inline uint64_t BlindedTail_clone_ptr(LDKBlindedTail *NONNULL_PTR arg) { + LDKBlindedTail ret_var = BlindedTail_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_BlindedTail_clone_ptr(int64_t arg) { + LDKBlindedTail arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = TaggedHash_clone_ptr(&arg_conv); + int64_t ret_conv = BlindedTail_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_TaggedHash_clone(int64_t orig) { - LDKTaggedHash orig_conv; +int64_t CS_LDK_BlindedTail_clone(int64_t orig) { + LDKBlindedTail orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKTaggedHash ret_var = TaggedHash_clone(&orig_conv); + LDKBlindedTail ret_var = BlindedTail_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; } -int8_tArray CS_LDK_TaggedHash_as_digest(int64_t this_arg) { - LDKTaggedHash this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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, *TaggedHash_as_digest(&this_arg_conv), 32); - return ret_arr; +int64_t CS_LDK_BlindedTail_hash(int64_t o) { + LDKBlindedTail o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = BlindedTail_hash(&o_conv); + return ret_conv; } -jstring CS_LDK_TaggedHash_tag(int64_t this_arg) { - LDKTaggedHash this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKStr ret_str = TaggedHash_tag(&this_arg_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); +jboolean CS_LDK_BlindedTail_eq(int64_t a, int64_t b) { + LDKBlindedTail a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKBlindedTail b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = BlindedTail_eq(&a_conv, &b_conv); return ret_conv; } -int8_tArray CS_LDK_TaggedHash_merkle_root(int64_t this_arg) { - LDKTaggedHash this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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, TaggedHash_merkle_root(&this_arg_conv).data, 32); +int8_tArray CS_LDK_BlindedTail_write(int64_t obj) { + LDKBlindedTail obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = BlindedTail_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); return ret_arr; } -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); +int64_t CS_LDK_BlindedTail_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_BlindedTailDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedTailDecodeErrorZ), "LDKCResult_BlindedTailDecodeErrorZ"); + *ret_conv = BlindedTail_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -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; +void CS_LDK_Path_free(int64_t this_obj) { + LDKPath this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Path_free(this_obj_conv); } -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_tArray CS_LDK_Path_get_hops(int64_t this_ptr) { + LDKPath this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_RouteHopZ ret_var = Path_get_hops(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t k = 0; k < ret_var.datalen; k++) { + LDKRouteHop 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; + } + + FREE(ret_var.data); + return ret_arr; } -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; +void CS_LDK_Path_set_hops(int64_t this_ptr, int64_tArray val) { + LDKPath this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_RouteHopZ val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = val->elems; + for (size_t k = 0; k < val_constr.datalen; k++) { + int64_t val_conv_10 = val_vals[k]; + LDKRouteHop val_conv_10_conv; + val_conv_10_conv.inner = untag_ptr(val_conv_10); + val_conv_10_conv.is_owned = ptr_is_owned(val_conv_10); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_10_conv); + val_conv_10_conv = RouteHop_clone(&val_conv_10_conv); + val_constr.data[k] = val_conv_10_conv; + } + FREE(val); + Path_set_hops(&this_ptr_conv, val_constr); } -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); +int64_t CS_LDK_Path_get_blinded_tail(int64_t this_ptr) { + LDKPath this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBlindedTail ret_var = Path_get_blinded_tail(&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; } -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_Path_set_blinded_tail(int64_t this_ptr, int64_t val) { + LDKPath this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBlindedTail val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = BlindedTail_clone(&val_conv); + Path_set_blinded_tail(&this_ptr_conv, val_conv); } -void CS_LDK_Bolt12ParseError_free(int64_t this_obj) { - LDKBolt12ParseError this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Bolt12ParseError_free(this_obj_conv); +int64_t CS_LDK_Path_new(int64_tArray hops_arg, int64_t blinded_tail_arg) { + LDKCVec_RouteHopZ hops_arg_constr; + hops_arg_constr.datalen = hops_arg->arr_len; + if (hops_arg_constr.datalen > 0) + hops_arg_constr.data = MALLOC(hops_arg_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); + else + hops_arg_constr.data = NULL; + int64_t* hops_arg_vals = hops_arg->elems; + for (size_t k = 0; k < hops_arg_constr.datalen; k++) { + int64_t hops_arg_conv_10 = hops_arg_vals[k]; + LDKRouteHop hops_arg_conv_10_conv; + hops_arg_conv_10_conv.inner = untag_ptr(hops_arg_conv_10); + hops_arg_conv_10_conv.is_owned = ptr_is_owned(hops_arg_conv_10); + CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_arg_conv_10_conv); + hops_arg_conv_10_conv = RouteHop_clone(&hops_arg_conv_10_conv); + hops_arg_constr.data[k] = hops_arg_conv_10_conv; + } + FREE(hops_arg); + LDKBlindedTail blinded_tail_arg_conv; + blinded_tail_arg_conv.inner = untag_ptr(blinded_tail_arg); + blinded_tail_arg_conv.is_owned = ptr_is_owned(blinded_tail_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_tail_arg_conv); + blinded_tail_arg_conv = BlindedTail_clone(&blinded_tail_arg_conv); + LDKPath ret_var = Path_new(hops_arg_constr, blinded_tail_arg_conv); + int64_t ret_ref = 0; + 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 Bolt12ParseError_clone_ptr(LDKBolt12ParseError *NONNULL_PTR arg) { - LDKBolt12ParseError ret_var = Bolt12ParseError_clone(arg); +static inline uint64_t Path_clone_ptr(LDKPath *NONNULL_PTR arg) { + LDKPath ret_var = Path_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_Bolt12ParseError_clone_ptr(int64_t arg) { - LDKBolt12ParseError arg_conv; +int64_t CS_LDK_Path_clone_ptr(int64_t arg) { + LDKPath arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Bolt12ParseError_clone_ptr(&arg_conv); + int64_t ret_conv = Path_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_Bolt12ParseError_clone(int64_t orig) { - LDKBolt12ParseError orig_conv; +int64_t CS_LDK_Path_clone(int64_t orig) { + LDKPath orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBolt12ParseError ret_var = Bolt12ParseError_clone(&orig_conv); + LDKPath ret_var = Path_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; } -int32_t CS_LDK_Bolt12SemanticError_clone(int64_t orig) { - LDKBolt12SemanticError* orig_conv = (LDKBolt12SemanticError*)untag_ptr(orig); - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_clone(orig_conv)); - return ret_conv; -} - -int32_t CS_LDK_Bolt12SemanticError_already_expired() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_already_expired()); - return ret_conv; -} - -int32_t CS_LDK_Bolt12SemanticError_unsupported_chain() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unsupported_chain()); +int64_t CS_LDK_Path_hash(int64_t o) { + LDKPath o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = Path_hash(&o_conv); return ret_conv; } -int32_t CS_LDK_Bolt12SemanticError_unexpected_chain() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unexpected_chain()); - return ret_conv; +jboolean CS_LDK_Path_eq(int64_t a, int64_t b) { + LDKPath a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKPath b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = Path_eq(&a_conv, &b_conv); + return ret_conv; } -int32_t CS_LDK_Bolt12SemanticError_missing_amount() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_amount()); +int64_t CS_LDK_Path_fee_msat(int64_t this_arg) { + LDKPath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int64_t ret_conv = Path_fee_msat(&this_arg_conv); return ret_conv; } -int32_t CS_LDK_Bolt12SemanticError_invalid_amount() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_invalid_amount()); +int64_t CS_LDK_Path_final_value_msat(int64_t this_arg) { + LDKPath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int64_t ret_conv = Path_final_value_msat(&this_arg_conv); return ret_conv; } -int32_t CS_LDK_Bolt12SemanticError_insufficient_amount() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_insufficient_amount()); - return ret_conv; +int64_t CS_LDK_Path_final_cltv_expiry_delta(int64_t this_arg) { + LDKPath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = Path_final_cltv_expiry_delta(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int32_t CS_LDK_Bolt12SemanticError_unexpected_amount() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unexpected_amount()); - return ret_conv; +void CS_LDK_Route_free(int64_t this_obj) { + LDKRoute this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Route_free(this_obj_conv); } -int32_t CS_LDK_Bolt12SemanticError_unsupported_currency() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unsupported_currency()); - return ret_conv; +int64_tArray CS_LDK_Route_get_paths(int64_t this_ptr) { + LDKRoute this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_PathZ ret_var = Route_get_paths(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t g = 0; g < ret_var.datalen; g++) { + LDKPath ret_conv_6_var = ret_var.data[g]; + int64_t ret_conv_6_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_6_var); + ret_conv_6_ref = tag_ptr(ret_conv_6_var.inner, ret_conv_6_var.is_owned); + ret_arr_ptr[g] = ret_conv_6_ref; + } + + FREE(ret_var.data); + return ret_arr; } -int32_t CS_LDK_Bolt12SemanticError_unknown_required_features() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unknown_required_features()); - return ret_conv; +void CS_LDK_Route_set_paths(int64_t this_ptr, int64_tArray val) { + LDKRoute this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_PathZ val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKPath), "LDKCVec_PathZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = val->elems; + for (size_t g = 0; g < val_constr.datalen; g++) { + int64_t val_conv_6 = val_vals[g]; + LDKPath val_conv_6_conv; + val_conv_6_conv.inner = untag_ptr(val_conv_6); + val_conv_6_conv.is_owned = ptr_is_owned(val_conv_6); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_6_conv); + val_conv_6_conv = Path_clone(&val_conv_6_conv); + val_constr.data[g] = val_conv_6_conv; + } + FREE(val); + Route_set_paths(&this_ptr_conv, val_constr); } -int32_t CS_LDK_Bolt12SemanticError_unexpected_features() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unexpected_features()); - return ret_conv; +int64_t CS_LDK_Route_get_route_params(int64_t this_ptr) { + LDKRoute this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKRouteParameters ret_var = Route_get_route_params(&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; } -int32_t CS_LDK_Bolt12SemanticError_missing_description() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_description()); - return ret_conv; +void CS_LDK_Route_set_route_params(int64_t this_ptr, int64_t val) { + LDKRoute this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKRouteParameters 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 = RouteParameters_clone(&val_conv); + Route_set_route_params(&this_ptr_conv, val_conv); } -int32_t CS_LDK_Bolt12SemanticError_missing_signing_pubkey() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_signing_pubkey()); - return ret_conv; +int64_t CS_LDK_Route_new(int64_tArray paths_arg, int64_t route_params_arg) { + LDKCVec_PathZ paths_arg_constr; + paths_arg_constr.datalen = paths_arg->arr_len; + if (paths_arg_constr.datalen > 0) + paths_arg_constr.data = MALLOC(paths_arg_constr.datalen * sizeof(LDKPath), "LDKCVec_PathZ Elements"); + else + paths_arg_constr.data = NULL; + int64_t* paths_arg_vals = paths_arg->elems; + for (size_t g = 0; g < paths_arg_constr.datalen; g++) { + int64_t paths_arg_conv_6 = paths_arg_vals[g]; + LDKPath paths_arg_conv_6_conv; + paths_arg_conv_6_conv.inner = untag_ptr(paths_arg_conv_6); + paths_arg_conv_6_conv.is_owned = ptr_is_owned(paths_arg_conv_6); + CHECK_INNER_FIELD_ACCESS_OR_NULL(paths_arg_conv_6_conv); + paths_arg_conv_6_conv = Path_clone(&paths_arg_conv_6_conv); + paths_arg_constr.data[g] = paths_arg_conv_6_conv; + } + FREE(paths_arg); + LDKRouteParameters route_params_arg_conv; + route_params_arg_conv.inner = untag_ptr(route_params_arg); + route_params_arg_conv.is_owned = ptr_is_owned(route_params_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_arg_conv); + route_params_arg_conv = RouteParameters_clone(&route_params_arg_conv); + LDKRoute ret_var = Route_new(paths_arg_constr, route_params_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; } -int32_t CS_LDK_Bolt12SemanticError_invalid_signing_pubkey() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_invalid_signing_pubkey()); +static inline uint64_t Route_clone_ptr(LDKRoute *NONNULL_PTR arg) { + LDKRoute ret_var = Route_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_Route_clone_ptr(int64_t arg) { + LDKRoute arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = Route_clone_ptr(&arg_conv); return ret_conv; } -int32_t CS_LDK_Bolt12SemanticError_unexpected_signing_pubkey() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unexpected_signing_pubkey()); - return ret_conv; +int64_t CS_LDK_Route_clone(int64_t orig) { + LDKRoute orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKRoute ret_var = Route_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; } -int32_t CS_LDK_Bolt12SemanticError_missing_quantity() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_quantity()); +int64_t CS_LDK_Route_hash(int64_t o) { + LDKRoute o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = Route_hash(&o_conv); return ret_conv; } -int32_t CS_LDK_Bolt12SemanticError_invalid_quantity() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_invalid_quantity()); +jboolean CS_LDK_Route_eq(int64_t a, int64_t b) { + LDKRoute a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKRoute b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = Route_eq(&a_conv, &b_conv); return ret_conv; } -int32_t CS_LDK_Bolt12SemanticError_unexpected_quantity() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unexpected_quantity()); +int64_t CS_LDK_Route_get_total_fees(int64_t this_arg) { + LDKRoute this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int64_t ret_conv = Route_get_total_fees(&this_arg_conv); return ret_conv; } -int32_t CS_LDK_Bolt12SemanticError_invalid_metadata() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_invalid_metadata()); +int64_t CS_LDK_Route_get_total_amount(int64_t this_arg) { + LDKRoute this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int64_t ret_conv = Route_get_total_amount(&this_arg_conv); return ret_conv; } -int32_t CS_LDK_Bolt12SemanticError_unexpected_metadata() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unexpected_metadata()); +jstring CS_LDK_Route_to_str(int64_t o) { + LDKRoute o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = Route_to_str(&o_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); return ret_conv; } -int32_t CS_LDK_Bolt12SemanticError_missing_payer_metadata() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_payer_metadata()); - return ret_conv; +int8_tArray CS_LDK_Route_write(int64_t obj) { + LDKRoute obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = Route_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -int32_t CS_LDK_Bolt12SemanticError_missing_payer_id() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_payer_id()); - return ret_conv; +int64_t CS_LDK_Route_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); + *ret_conv = Route_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -int32_t CS_LDK_Bolt12SemanticError_duplicate_payment_id() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_duplicate_payment_id()); - return ret_conv; +void CS_LDK_RouteParameters_free(int64_t this_obj) { + LDKRouteParameters this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + RouteParameters_free(this_obj_conv); } -int32_t CS_LDK_Bolt12SemanticError_missing_paths() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_paths()); - return ret_conv; +int64_t CS_LDK_RouteParameters_get_payment_params(int64_t this_ptr) { + LDKRouteParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPaymentParameters ret_var = RouteParameters_get_payment_params(&this_ptr_conv); + int64_t ret_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_Bolt12SemanticError_unexpected_paths() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unexpected_paths()); - return ret_conv; +void CS_LDK_RouteParameters_set_payment_params(int64_t this_ptr, int64_t val) { + LDKRouteParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPaymentParameters val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = PaymentParameters_clone(&val_conv); + RouteParameters_set_payment_params(&this_ptr_conv, val_conv); } -int32_t CS_LDK_Bolt12SemanticError_invalid_pay_info() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_invalid_pay_info()); +int64_t CS_LDK_RouteParameters_get_final_value_msat(int64_t this_ptr) { + LDKRouteParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = RouteParameters_get_final_value_msat(&this_ptr_conv); return ret_conv; } -int32_t CS_LDK_Bolt12SemanticError_missing_creation_time() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_creation_time()); - return ret_conv; +void CS_LDK_RouteParameters_set_final_value_msat(int64_t this_ptr, int64_t val) { + LDKRouteParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + RouteParameters_set_final_value_msat(&this_ptr_conv, val); } -int32_t CS_LDK_Bolt12SemanticError_missing_payment_hash() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_payment_hash()); - return ret_conv; +int64_t CS_LDK_RouteParameters_get_max_total_routing_fee_msat(int64_t this_ptr) { + LDKRouteParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = RouteParameters_get_max_total_routing_fee_msat(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int32_t CS_LDK_Bolt12SemanticError_missing_signature() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_signature()); - return ret_conv; +void CS_LDK_RouteParameters_set_max_total_routing_fee_msat(int64_t this_ptr, int64_t val) { + LDKRouteParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + 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)); + RouteParameters_set_max_total_routing_fee_msat(&this_ptr_conv, val_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); +int64_t CS_LDK_RouteParameters_new(int64_t payment_params_arg, int64_t final_value_msat_arg, int64_t max_total_routing_fee_msat_arg) { + LDKPaymentParameters payment_params_arg_conv; + payment_params_arg_conv.inner = untag_ptr(payment_params_arg); + payment_params_arg_conv.is_owned = ptr_is_owned(payment_params_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_params_arg_conv); + payment_params_arg_conv = PaymentParameters_clone(&payment_params_arg_conv); + void* max_total_routing_fee_msat_arg_ptr = untag_ptr(max_total_routing_fee_msat_arg); + CHECK_ACCESS(max_total_routing_fee_msat_arg_ptr); + LDKCOption_u64Z max_total_routing_fee_msat_arg_conv = *(LDKCOption_u64Z*)(max_total_routing_fee_msat_arg_ptr); + max_total_routing_fee_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(max_total_routing_fee_msat_arg)); + LDKRouteParameters ret_var = RouteParameters_new(payment_params_arg_conv, final_value_msat_arg, max_total_routing_fee_msat_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 RefundMaybeWithDerivedMetadataBuilder_clone_ptr(LDKRefundMaybeWithDerivedMetadataBuilder *NONNULL_PTR arg) { - LDKRefundMaybeWithDerivedMetadataBuilder ret_var = RefundMaybeWithDerivedMetadataBuilder_clone(arg); +static inline uint64_t RouteParameters_clone_ptr(LDKRouteParameters *NONNULL_PTR arg) { + LDKRouteParameters ret_var = RouteParameters_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; +int64_t CS_LDK_RouteParameters_clone_ptr(int64_t arg) { + LDKRouteParameters arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = RefundMaybeWithDerivedMetadataBuilder_clone_ptr(&arg_conv); + int64_t ret_conv = RouteParameters_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_RefundMaybeWithDerivedMetadataBuilder_clone(int64_t orig) { - LDKRefundMaybeWithDerivedMetadataBuilder orig_conv; +int64_t CS_LDK_RouteParameters_clone(int64_t orig) { + LDKRouteParameters orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKRefundMaybeWithDerivedMetadataBuilder ret_var = RefundMaybeWithDerivedMetadataBuilder_clone(&orig_conv); + LDKRouteParameters ret_var = RouteParameters_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_RouteParameters_hash(int64_t o) { + LDKRouteParameters o_conv; + 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 = RouteParameters_hash(&o_conv); + return ret_conv; } -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); +jboolean CS_LDK_RouteParameters_eq(int64_t a, int64_t b) { + LDKRouteParameters a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKRouteParameters b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = RouteParameters_eq(&a_conv, &b_conv); + return ret_conv; } -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); +int64_t CS_LDK_RouteParameters_from_payment_params_and_value(int64_t payment_params, int64_t final_value_msat) { + LDKPaymentParameters payment_params_conv; + payment_params_conv.inner = untag_ptr(payment_params); + payment_params_conv.is_owned = ptr_is_owned(payment_params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_params_conv); + payment_params_conv = PaymentParameters_clone(&payment_params_conv); + LDKRouteParameters ret_var = RouteParameters_from_payment_params_and_value(payment_params_conv, final_value_msat); + int64_t ret_ref = 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_RefundMaybeWithDerivedMetadataBuilder_absolute_expiry(int64_t this_arg, int64_t absolute_expiry) { - LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; +int64_t CS_LDK_RouteParameters_set_max_path_length(int64_t this_arg, int64_t recipient_onion, jboolean is_keysend, int32_t best_block_height) { + LDKRouteParameters this_arg_conv; this_arg_conv.inner = untag_ptr(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); + this_arg_conv.is_owned = false; + LDKRecipientOnionFields recipient_onion_conv; + recipient_onion_conv.inner = untag_ptr(recipient_onion); + recipient_onion_conv.is_owned = ptr_is_owned(recipient_onion); + CHECK_INNER_FIELD_ACCESS_OR_NULL(recipient_onion_conv); + recipient_onion_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = RouteParameters_set_max_path_length(&this_arg_conv, &recipient_onion_conv, is_keysend, best_block_height); + return tag_ptr(ret_conv, true); } -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); +int8_tArray CS_LDK_RouteParameters_write(int64_t obj) { + LDKRouteParameters obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = RouteParameters_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -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); +int64_t CS_LDK_RouteParameters_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); + *ret_conv = RouteParameters_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -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_PaymentParameters_free(int64_t this_obj) { + LDKPaymentParameters this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + PaymentParameters_free(this_obj_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); +int64_t CS_LDK_PaymentParameters_get_payee(int64_t this_ptr) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); + *ret_copy = PaymentParameters_get_payee(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -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); +void CS_LDK_PaymentParameters_set_payee(int64_t this_ptr, int64_t val) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKPayee val_conv = *(LDKPayee*)(val_ptr); + val_conv = Payee_clone((LDKPayee*)untag_ptr(val)); + PaymentParameters_set_payee(&this_ptr_conv, val_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); +int64_t CS_LDK_PaymentParameters_get_expiry_time(int64_t this_ptr) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = PaymentParameters_get_expiry_time(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_Refund_free(int64_t this_obj) { - LDKRefund this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Refund_free(this_obj_conv); +void CS_LDK_PaymentParameters_set_expiry_time(int64_t this_ptr, int64_t val) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + PaymentParameters_set_expiry_time(&this_ptr_conv, val_conv); } -static inline uint64_t Refund_clone_ptr(LDKRefund *NONNULL_PTR arg) { - LDKRefund ret_var = Refund_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_Refund_clone_ptr(int64_t arg) { - LDKRefund arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = Refund_clone_ptr(&arg_conv); +int32_t CS_LDK_PaymentParameters_get_max_total_cltv_expiry_delta(int64_t this_ptr) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = PaymentParameters_get_max_total_cltv_expiry_delta(&this_ptr_conv); return ret_conv; } -int64_t CS_LDK_Refund_clone(int64_t orig) { - LDKRefund orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKRefund ret_var = Refund_clone(&orig_conv); - int64_t ret_ref = 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_PaymentParameters_set_max_total_cltv_expiry_delta(int64_t this_ptr, int32_t val) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + PaymentParameters_set_max_total_cltv_expiry_delta(&this_ptr_conv, val); } -int64_t CS_LDK_Refund_description(int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = Refund_description(&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; +int8_t CS_LDK_PaymentParameters_get_max_path_count(int64_t this_ptr) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_t ret_conv = PaymentParameters_get_max_path_count(&this_ptr_conv); + return ret_conv; } -int64_t CS_LDK_Refund_absolute_expiry(int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = Refund_absolute_expiry(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_PaymentParameters_set_max_path_count(int64_t this_ptr, int8_t val) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + PaymentParameters_set_max_path_count(&this_ptr_conv, val); } -jboolean CS_LDK_Refund_is_expired(int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = Refund_is_expired(&this_arg_conv); +int8_t CS_LDK_PaymentParameters_get_max_path_length(int64_t this_ptr) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_t ret_conv = PaymentParameters_get_max_path_length(&this_ptr_conv); return ret_conv; } -jboolean CS_LDK_Refund_is_expired_no_std(int64_t this_arg, int64_t duration_since_epoch) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = Refund_is_expired_no_std(&this_arg_conv, duration_since_epoch); +void CS_LDK_PaymentParameters_set_max_path_length(int64_t this_ptr, int8_t val) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + PaymentParameters_set_max_path_length(&this_ptr_conv, val); +} + +int8_t CS_LDK_PaymentParameters_get_max_channel_saturation_power_of_half(int64_t this_ptr) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_t ret_conv = PaymentParameters_get_max_channel_saturation_power_of_half(&this_ptr_conv); return ret_conv; } -int64_t CS_LDK_Refund_issuer(int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = Refund_issuer(&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_PaymentParameters_set_max_channel_saturation_power_of_half(int64_t this_ptr, int8_t val) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + PaymentParameters_set_max_channel_saturation_power_of_half(&this_ptr_conv, val); } -int64_tArray CS_LDK_Refund_paths(int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_BlindedPathZ ret_var = Refund_paths(&this_arg_conv); +int64_tArray CS_LDK_PaymentParameters_get_previously_failed_channels(int64_t this_ptr) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u64Z ret_var = PaymentParameters_get_previously_failed_channels(&this_ptr_conv); int64_tArray ret_arr = NULL; ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t n = 0; n < ret_var.datalen; n++) { - LDKBlindedPath 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; + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; } FREE(ret_var.data); return ret_arr; } -int8_tArray CS_LDK_Refund_payer_metadata(int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKu8slice ret_var = Refund_payer_metadata(&this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - return ret_arr; +void CS_LDK_PaymentParameters_set_previously_failed_channels(int64_t this_ptr, int64_tArray val) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u64Z val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = val->elems; + for (size_t g = 0; g < val_constr.datalen; g++) { + int64_t val_conv_6 = val_vals[g]; + val_constr.data[g] = val_conv_6; + } + FREE(val); + PaymentParameters_set_previously_failed_channels(&this_ptr_conv, val_constr); } -int8_tArray CS_LDK_Refund_chain(int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, Refund_chain(&this_arg_conv).data, 32); +int64_tArray CS_LDK_PaymentParameters_get_previously_failed_blinded_path_idxs(int64_t this_ptr) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u64Z ret_var = PaymentParameters_get_previously_failed_blinded_path_idxs(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + + FREE(ret_var.data); return ret_arr; } -int64_t CS_LDK_Refund_amount_msats(int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = Refund_amount_msats(&this_arg_conv); - return ret_conv; +void CS_LDK_PaymentParameters_set_previously_failed_blinded_path_idxs(int64_t this_ptr, int64_tArray val) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u64Z val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = val->elems; + for (size_t g = 0; g < val_constr.datalen; g++) { + int64_t val_conv_6 = val_vals[g]; + val_constr.data[g] = val_conv_6; + } + FREE(val); + PaymentParameters_set_previously_failed_blinded_path_idxs(&this_ptr_conv, val_constr); } -int64_t CS_LDK_Refund_features(int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKInvoiceRequestFeatures ret_var = Refund_features(&this_arg_conv); +int64_t CS_LDK_PaymentParameters_new(int64_t payee_arg, int64_t expiry_time_arg, int32_t max_total_cltv_expiry_delta_arg, int8_t max_path_count_arg, int8_t max_path_length_arg, int8_t max_channel_saturation_power_of_half_arg, int64_tArray previously_failed_channels_arg, int64_tArray previously_failed_blinded_path_idxs_arg) { + void* payee_arg_ptr = untag_ptr(payee_arg); + CHECK_ACCESS(payee_arg_ptr); + LDKPayee payee_arg_conv = *(LDKPayee*)(payee_arg_ptr); + payee_arg_conv = Payee_clone((LDKPayee*)untag_ptr(payee_arg)); + void* expiry_time_arg_ptr = untag_ptr(expiry_time_arg); + CHECK_ACCESS(expiry_time_arg_ptr); + LDKCOption_u64Z expiry_time_arg_conv = *(LDKCOption_u64Z*)(expiry_time_arg_ptr); + expiry_time_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(expiry_time_arg)); + LDKCVec_u64Z previously_failed_channels_arg_constr; + previously_failed_channels_arg_constr.datalen = previously_failed_channels_arg->arr_len; + if (previously_failed_channels_arg_constr.datalen > 0) + previously_failed_channels_arg_constr.data = MALLOC(previously_failed_channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + else + previously_failed_channels_arg_constr.data = NULL; + int64_t* previously_failed_channels_arg_vals = previously_failed_channels_arg->elems; + for (size_t g = 0; g < previously_failed_channels_arg_constr.datalen; g++) { + int64_t previously_failed_channels_arg_conv_6 = previously_failed_channels_arg_vals[g]; + previously_failed_channels_arg_constr.data[g] = previously_failed_channels_arg_conv_6; + } + FREE(previously_failed_channels_arg); + LDKCVec_u64Z previously_failed_blinded_path_idxs_arg_constr; + previously_failed_blinded_path_idxs_arg_constr.datalen = previously_failed_blinded_path_idxs_arg->arr_len; + if (previously_failed_blinded_path_idxs_arg_constr.datalen > 0) + previously_failed_blinded_path_idxs_arg_constr.data = MALLOC(previously_failed_blinded_path_idxs_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + else + previously_failed_blinded_path_idxs_arg_constr.data = NULL; + int64_t* previously_failed_blinded_path_idxs_arg_vals = previously_failed_blinded_path_idxs_arg->elems; + for (size_t g = 0; g < previously_failed_blinded_path_idxs_arg_constr.datalen; g++) { + int64_t previously_failed_blinded_path_idxs_arg_conv_6 = previously_failed_blinded_path_idxs_arg_vals[g]; + previously_failed_blinded_path_idxs_arg_constr.data[g] = previously_failed_blinded_path_idxs_arg_conv_6; + } + FREE(previously_failed_blinded_path_idxs_arg); + LDKPaymentParameters ret_var = PaymentParameters_new(payee_arg_conv, expiry_time_arg_conv, max_total_cltv_expiry_delta_arg, max_path_count_arg, max_path_length_arg, max_channel_saturation_power_of_half_arg, previously_failed_channels_arg_constr, previously_failed_blinded_path_idxs_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); return ret_ref; } -int64_t CS_LDK_Refund_quantity(int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = Refund_quantity(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +static inline uint64_t PaymentParameters_clone_ptr(LDKPaymentParameters *NONNULL_PTR arg) { + LDKPaymentParameters ret_var = PaymentParameters_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; } - -int8_tArray CS_LDK_Refund_payer_id(int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, Refund_payer_id(&this_arg_conv).compressed_form, 33); - return ret_arr; +int64_t CS_LDK_PaymentParameters_clone_ptr(int64_t arg) { + LDKPaymentParameters arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = PaymentParameters_clone_ptr(&arg_conv); + return ret_conv; } -int64_t CS_LDK_Refund_payer_note(int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = Refund_payer_note(&this_arg_conv); +int64_t CS_LDK_PaymentParameters_clone(int64_t orig) { + LDKPaymentParameters orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKPaymentParameters ret_var = PaymentParameters_clone(&orig_conv); int64_t ret_ref = 0; 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_Refund_hash(int64_t o) { - LDKRefund o_conv; +int64_t CS_LDK_PaymentParameters_hash(int64_t o) { + LDKPaymentParameters o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv.is_owned = false; - int64_t ret_conv = Refund_hash(&o_conv); + int64_t ret_conv = PaymentParameters_hash(&o_conv); return ret_conv; } -int8_tArray CS_LDK_Refund_write(int64_t obj) { - LDKRefund obj_conv; +jboolean CS_LDK_PaymentParameters_eq(int64_t a, int64_t b) { + LDKPaymentParameters a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKPaymentParameters b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = PaymentParameters_eq(&a_conv, &b_conv); + return ret_conv; +} + +int8_tArray CS_LDK_PaymentParameters_write(int64_t obj) { + LDKPaymentParameters obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = Refund_write(&obj_conv); + LDKCVec_u8Z ret_var = PaymentParameters_write(&obj_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_Refund_from_str(jstring s) { - LDKStr s_conv = str_ref_to_owned_c(s); - LDKCResult_RefundBolt12ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundBolt12ParseErrorZ), "LDKCResult_RefundBolt12ParseErrorZ"); - *ret_conv = Refund_from_str(s_conv); +int64_t CS_LDK_PaymentParameters_read(int8_tArray ser, int32_t arg) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ"); + *ret_conv = PaymentParameters_read(ser_ref, arg); + FREE(ser); return tag_ptr(ret_conv, true); } -jstring CS_LDK_Refund_to_str(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; - LDKStr ret_str = Refund_to_str(&o_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; +int64_t CS_LDK_PaymentParameters_from_node_id(int8_tArray payee_pubkey, int32_t final_cltv_expiry_delta) { + LDKPublicKey payee_pubkey_ref; + CHECK(payee_pubkey->arr_len == 33); + memcpy(payee_pubkey_ref.compressed_form, payee_pubkey->elems, 33); FREE(payee_pubkey); + LDKPaymentParameters ret_var = PaymentParameters_from_node_id(payee_pubkey_ref, final_cltv_expiry_delta); + int64_t ret_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_UtxoLookupError_clone(int64_t orig) { - LDKUtxoLookupError* orig_conv = (LDKUtxoLookupError*)untag_ptr(orig); - int32_t ret_conv = LDKUtxoLookupError_to_cs(UtxoLookupError_clone(orig_conv)); - return ret_conv; +int64_t CS_LDK_PaymentParameters_for_keysend(int8_tArray payee_pubkey, int32_t final_cltv_expiry_delta, jboolean allow_mpp) { + LDKPublicKey payee_pubkey_ref; + CHECK(payee_pubkey->arr_len == 33); + memcpy(payee_pubkey_ref.compressed_form, payee_pubkey->elems, 33); FREE(payee_pubkey); + LDKPaymentParameters ret_var = PaymentParameters_for_keysend(payee_pubkey_ref, final_cltv_expiry_delta, allow_mpp); + int64_t ret_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_UtxoLookupError_unknown_chain() { - int32_t ret_conv = LDKUtxoLookupError_to_cs(UtxoLookupError_unknown_chain()); - return ret_conv; +int64_t CS_LDK_PaymentParameters_from_bolt12_invoice(int64_t invoice) { + LDKBolt12Invoice invoice_conv; + invoice_conv.inner = untag_ptr(invoice); + invoice_conv.is_owned = ptr_is_owned(invoice); + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); + invoice_conv.is_owned = false; + LDKPaymentParameters ret_var = PaymentParameters_from_bolt12_invoice(&invoice_conv); + int64_t ret_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_UtxoLookupError_unknown_tx() { - int32_t ret_conv = LDKUtxoLookupError_to_cs(UtxoLookupError_unknown_tx()); - return ret_conv; +int64_t CS_LDK_PaymentParameters_blinded(int64_tArray blinded_route_hints) { + LDKCVec_BlindedPaymentPathZ blinded_route_hints_constr; + blinded_route_hints_constr.datalen = blinded_route_hints->arr_len; + if (blinded_route_hints_constr.datalen > 0) + blinded_route_hints_constr.data = MALLOC(blinded_route_hints_constr.datalen * sizeof(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); + else + blinded_route_hints_constr.data = NULL; + int64_t* blinded_route_hints_vals = blinded_route_hints->elems; + for (size_t u = 0; u < blinded_route_hints_constr.datalen; u++) { + int64_t blinded_route_hints_conv_20 = blinded_route_hints_vals[u]; + LDKBlindedPaymentPath blinded_route_hints_conv_20_conv; + blinded_route_hints_conv_20_conv.inner = untag_ptr(blinded_route_hints_conv_20); + blinded_route_hints_conv_20_conv.is_owned = ptr_is_owned(blinded_route_hints_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_route_hints_conv_20_conv); + blinded_route_hints_conv_20_conv = BlindedPaymentPath_clone(&blinded_route_hints_conv_20_conv); + blinded_route_hints_constr.data[u] = blinded_route_hints_conv_20_conv; + } + FREE(blinded_route_hints); + LDKPaymentParameters ret_var = PaymentParameters_blinded(blinded_route_hints_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); + return ret_ref; } -void CS_LDK_UtxoResult_free(int64_t this_ptr) { +void CS_LDK_Payee_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); - LDKUtxoResult this_ptr_conv = *(LDKUtxoResult*)(this_ptr_ptr); + LDKPayee this_ptr_conv = *(LDKPayee*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - UtxoResult_free(this_ptr_conv); + Payee_free(this_ptr_conv); } -static inline uint64_t UtxoResult_clone_ptr(LDKUtxoResult *NONNULL_PTR arg) { - LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult"); - *ret_copy = UtxoResult_clone(arg); +static inline uint64_t Payee_clone_ptr(LDKPayee *NONNULL_PTR arg) { + LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); + *ret_copy = Payee_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_UtxoResult_clone_ptr(int64_t arg) { - LDKUtxoResult* arg_conv = (LDKUtxoResult*)untag_ptr(arg); - int64_t ret_conv = UtxoResult_clone_ptr(arg_conv); - return ret_conv; +int64_t CS_LDK_Payee_clone_ptr(int64_t arg) { + LDKPayee* arg_conv = (LDKPayee*)untag_ptr(arg); + int64_t ret_conv = Payee_clone_ptr(arg_conv); + return ret_conv; } -int64_t CS_LDK_UtxoResult_clone(int64_t orig) { - LDKUtxoResult* orig_conv = (LDKUtxoResult*)untag_ptr(orig); - LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult"); - *ret_copy = UtxoResult_clone(orig_conv); +int64_t CS_LDK_Payee_clone(int64_t orig) { + LDKPayee* orig_conv = (LDKPayee*)untag_ptr(orig); + LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); + *ret_copy = Payee_clone(orig_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_UtxoResult_sync(int64_t a) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKCResult_TxOutUtxoLookupErrorZ a_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(a_ptr); - a_conv = CResult_TxOutUtxoLookupErrorZ_clone((LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(a)); - LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult"); - *ret_copy = UtxoResult_sync(a_conv); +int64_t CS_LDK_Payee_blinded(int64_tArray route_hints, int64_t features) { + LDKCVec_BlindedPaymentPathZ route_hints_constr; + route_hints_constr.datalen = route_hints->arr_len; + if (route_hints_constr.datalen > 0) + route_hints_constr.data = MALLOC(route_hints_constr.datalen * sizeof(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); + else + route_hints_constr.data = NULL; + int64_t* route_hints_vals = route_hints->elems; + for (size_t u = 0; u < route_hints_constr.datalen; u++) { + int64_t route_hints_conv_20 = route_hints_vals[u]; + LDKBlindedPaymentPath route_hints_conv_20_conv; + route_hints_conv_20_conv.inner = untag_ptr(route_hints_conv_20); + route_hints_conv_20_conv.is_owned = ptr_is_owned(route_hints_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_hints_conv_20_conv); + route_hints_conv_20_conv = BlindedPaymentPath_clone(&route_hints_conv_20_conv); + route_hints_constr.data[u] = route_hints_conv_20_conv; + } + FREE(route_hints); + LDKBolt12InvoiceFeatures features_conv; + features_conv.inner = untag_ptr(features); + features_conv.is_owned = ptr_is_owned(features); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); + features_conv = Bolt12InvoiceFeatures_clone(&features_conv); + LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); + *ret_copy = Payee_blinded(route_hints_constr, features_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_UtxoResult_async(int64_t a) { - LDKUtxoFuture a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = UtxoFuture_clone(&a_conv); - LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult"); - *ret_copy = UtxoResult_async(a_conv); +int64_t CS_LDK_Payee_clear(int8_tArray node_id, int64_tArray route_hints, int64_t features, int32_t final_cltv_expiry_delta) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKCVec_RouteHintZ route_hints_constr; + route_hints_constr.datalen = route_hints->arr_len; + if (route_hints_constr.datalen > 0) + route_hints_constr.data = MALLOC(route_hints_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements"); + else + route_hints_constr.data = NULL; + int64_t* route_hints_vals = route_hints->elems; + for (size_t l = 0; l < route_hints_constr.datalen; l++) { + int64_t route_hints_conv_11 = route_hints_vals[l]; + LDKRouteHint route_hints_conv_11_conv; + route_hints_conv_11_conv.inner = untag_ptr(route_hints_conv_11); + route_hints_conv_11_conv.is_owned = ptr_is_owned(route_hints_conv_11); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_hints_conv_11_conv); + route_hints_conv_11_conv = RouteHint_clone(&route_hints_conv_11_conv); + route_hints_constr.data[l] = route_hints_conv_11_conv; + } + FREE(route_hints); + LDKBolt11InvoiceFeatures features_conv; + features_conv.inner = untag_ptr(features); + features_conv.is_owned = ptr_is_owned(features); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); + features_conv = Bolt11InvoiceFeatures_clone(&features_conv); + LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); + *ret_copy = Payee_clear(node_id_ref, route_hints_constr, features_conv, final_cltv_expiry_delta); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void CS_LDK_UtxoLookup_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); - LDKUtxoLookup this_ptr_conv = *(LDKUtxoLookup*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - UtxoLookup_free(this_ptr_conv); +int64_t CS_LDK_Payee_hash(int64_t o) { + LDKPayee* o_conv = (LDKPayee*)untag_ptr(o); + int64_t ret_conv = Payee_hash(o_conv); + return ret_conv; } -void CS_LDK_UtxoFuture_free(int64_t this_obj) { - LDKUtxoFuture this_obj_conv; +jboolean CS_LDK_Payee_eq(int64_t a, int64_t b) { + LDKPayee* a_conv = (LDKPayee*)untag_ptr(a); + LDKPayee* b_conv = (LDKPayee*)untag_ptr(b); + jboolean ret_conv = Payee_eq(a_conv, b_conv); + return ret_conv; +} + +int8_tArray CS_LDK_RouteHint_write(int64_t obj) { + LDKRouteHint obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = RouteHint_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_RouteHint_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); + *ret_conv = RouteHint_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray CS_LDK_RouteHintHop_write(int64_t obj) { + LDKRouteHintHop obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = RouteHintHop_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_RouteHintHop_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); + *ret_conv = RouteHintHop_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_FirstHopCandidate_free(int64_t this_obj) { + LDKFirstHopCandidate this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - UtxoFuture_free(this_obj_conv); + FirstHopCandidate_free(this_obj_conv); } -static inline uint64_t UtxoFuture_clone_ptr(LDKUtxoFuture *NONNULL_PTR arg) { - LDKUtxoFuture ret_var = UtxoFuture_clone(arg); +static inline uint64_t FirstHopCandidate_clone_ptr(LDKFirstHopCandidate *NONNULL_PTR arg) { + LDKFirstHopCandidate ret_var = FirstHopCandidate_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_UtxoFuture_clone_ptr(int64_t arg) { - LDKUtxoFuture arg_conv; +int64_t CS_LDK_FirstHopCandidate_clone_ptr(int64_t arg) { + LDKFirstHopCandidate arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = UtxoFuture_clone_ptr(&arg_conv); + int64_t ret_conv = FirstHopCandidate_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_UtxoFuture_clone(int64_t orig) { - LDKUtxoFuture orig_conv; +int64_t CS_LDK_FirstHopCandidate_clone(int64_t orig) { + LDKFirstHopCandidate orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKUtxoFuture ret_var = UtxoFuture_clone(&orig_conv); + LDKFirstHopCandidate ret_var = FirstHopCandidate_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_UtxoFuture_new() { - LDKUtxoFuture ret_var = UtxoFuture_new(); +void CS_LDK_PublicHopCandidate_free(int64_t this_obj) { + LDKPublicHopCandidate this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + PublicHopCandidate_free(this_obj_conv); +} + +int64_t CS_LDK_PublicHopCandidate_get_short_channel_id(int64_t this_ptr) { + LDKPublicHopCandidate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = PublicHopCandidate_get_short_channel_id(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_PublicHopCandidate_set_short_channel_id(int64_t this_ptr, int64_t val) { + LDKPublicHopCandidate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + PublicHopCandidate_set_short_channel_id(&this_ptr_conv, val); +} + +static inline uint64_t PublicHopCandidate_clone_ptr(LDKPublicHopCandidate *NONNULL_PTR arg) { + LDKPublicHopCandidate ret_var = PublicHopCandidate_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; } - -void CS_LDK_UtxoFuture_resolve_without_forwarding(int64_t this_arg, int64_t graph, int64_t result) { - LDKUtxoFuture this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNetworkGraph graph_conv; - graph_conv.inner = untag_ptr(graph); - graph_conv.is_owned = ptr_is_owned(graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(graph_conv); - graph_conv.is_owned = false; - void* result_ptr = untag_ptr(result); - CHECK_ACCESS(result_ptr); - LDKCResult_TxOutUtxoLookupErrorZ result_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(result_ptr); - UtxoFuture_resolve_without_forwarding(&this_arg_conv, &graph_conv, result_conv); +int64_t CS_LDK_PublicHopCandidate_clone_ptr(int64_t arg) { + LDKPublicHopCandidate 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 = PublicHopCandidate_clone_ptr(&arg_conv); + return ret_conv; } -void CS_LDK_UtxoFuture_resolve(int64_t this_arg, int64_t graph, int64_t gossip, int64_t result) { - LDKUtxoFuture this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNetworkGraph graph_conv; - graph_conv.inner = untag_ptr(graph); - graph_conv.is_owned = ptr_is_owned(graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(graph_conv); - graph_conv.is_owned = false; - LDKP2PGossipSync gossip_conv; - gossip_conv.inner = untag_ptr(gossip); - gossip_conv.is_owned = ptr_is_owned(gossip); - CHECK_INNER_FIELD_ACCESS_OR_NULL(gossip_conv); - gossip_conv.is_owned = false; - void* result_ptr = untag_ptr(result); - CHECK_ACCESS(result_ptr); - LDKCResult_TxOutUtxoLookupErrorZ result_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(result_ptr); - UtxoFuture_resolve(&this_arg_conv, &graph_conv, &gossip_conv, result_conv); +int64_t CS_LDK_PublicHopCandidate_clone(int64_t orig) { + LDKPublicHopCandidate 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; + LDKPublicHopCandidate ret_var = PublicHopCandidate_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_NodeId_free(int64_t this_obj) { - LDKNodeId this_obj_conv; +void CS_LDK_PrivateHopCandidate_free(int64_t this_obj) { + LDKPrivateHopCandidate this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - NodeId_free(this_obj_conv); + PrivateHopCandidate_free(this_obj_conv); } -static inline uint64_t NodeId_clone_ptr(LDKNodeId *NONNULL_PTR arg) { - LDKNodeId ret_var = NodeId_clone(arg); +static inline uint64_t PrivateHopCandidate_clone_ptr(LDKPrivateHopCandidate *NONNULL_PTR arg) { + LDKPrivateHopCandidate ret_var = PrivateHopCandidate_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_NodeId_clone_ptr(int64_t arg) { - LDKNodeId arg_conv; +int64_t CS_LDK_PrivateHopCandidate_clone_ptr(int64_t arg) { + LDKPrivateHopCandidate arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = NodeId_clone_ptr(&arg_conv); + int64_t ret_conv = PrivateHopCandidate_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_NodeId_clone(int64_t orig) { - LDKNodeId orig_conv; +int64_t CS_LDK_PrivateHopCandidate_clone(int64_t orig) { + LDKPrivateHopCandidate orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKNodeId ret_var = NodeId_clone(&orig_conv); + LDKPrivateHopCandidate ret_var = PrivateHopCandidate_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_NodeId_from_pubkey(int8_tArray pubkey) { - LDKPublicKey pubkey_ref; - CHECK(pubkey->arr_len == 33); - memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); FREE(pubkey); - LDKNodeId ret_var = NodeId_from_pubkey(pubkey_ref); +void CS_LDK_BlindedPathCandidate_free(int64_t this_obj) { + LDKBlindedPathCandidate this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + BlindedPathCandidate_free(this_obj_conv); +} + +static inline uint64_t BlindedPathCandidate_clone_ptr(LDKBlindedPathCandidate *NONNULL_PTR arg) { + LDKBlindedPathCandidate ret_var = BlindedPathCandidate_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_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); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKu8slice ret_var = NodeId_as_slice(&this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - return ret_arr; -} - -int8_tArray CS_LDK_NodeId_as_array(int64_t this_arg) { - LDKNodeId this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, *NodeId_as_array(&this_arg_conv), 33); - return ret_arr; -} - -int64_t CS_LDK_NodeId_as_pubkey(int64_t this_arg) { - LDKNodeId this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_PublicKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecp256k1ErrorZ), "LDKCResult_PublicKeySecp256k1ErrorZ"); - *ret_conv = NodeId_as_pubkey(&this_arg_conv); - return tag_ptr(ret_conv, true); -} - -jstring CS_LDK_NodeId_to_str(int64_t o) { - LDKNodeId o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = NodeId_to_str(&o_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; -} - -int64_t CS_LDK_NodeId_hash(int64_t o) { - LDKNodeId o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = NodeId_hash(&o_conv); +int64_t CS_LDK_BlindedPathCandidate_clone_ptr(int64_t arg) { + LDKBlindedPathCandidate 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 = BlindedPathCandidate_clone_ptr(&arg_conv); return ret_conv; } -int8_tArray CS_LDK_NodeId_write(int64_t obj) { - LDKNodeId obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = NodeId_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -int64_t CS_LDK_NodeId_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); - *ret_conv = NodeId_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_BlindedPathCandidate_clone(int64_t orig) { + LDKBlindedPathCandidate 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; + LDKBlindedPathCandidate ret_var = BlindedPathCandidate_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_NetworkGraph_free(int64_t this_obj) { - LDKNetworkGraph this_obj_conv; +void CS_LDK_OneHopBlindedPathCandidate_free(int64_t this_obj) { + LDKOneHopBlindedPathCandidate this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - NetworkGraph_free(this_obj_conv); + OneHopBlindedPathCandidate_free(this_obj_conv); } -void CS_LDK_ReadOnlyNetworkGraph_free(int64_t this_obj) { - LDKReadOnlyNetworkGraph this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ReadOnlyNetworkGraph_free(this_obj_conv); +static inline uint64_t OneHopBlindedPathCandidate_clone_ptr(LDKOneHopBlindedPathCandidate *NONNULL_PTR arg) { + LDKOneHopBlindedPathCandidate ret_var = OneHopBlindedPathCandidate_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_OneHopBlindedPathCandidate_clone_ptr(int64_t arg) { + LDKOneHopBlindedPathCandidate 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 = OneHopBlindedPathCandidate_clone_ptr(&arg_conv); + return ret_conv; } -void CS_LDK_NetworkUpdate_free(int64_t this_ptr) { +int64_t CS_LDK_OneHopBlindedPathCandidate_clone(int64_t orig) { + LDKOneHopBlindedPathCandidate 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; + LDKOneHopBlindedPathCandidate ret_var = OneHopBlindedPathCandidate_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_CandidateRouteHop_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); - LDKNetworkUpdate this_ptr_conv = *(LDKNetworkUpdate*)(this_ptr_ptr); + LDKCandidateRouteHop this_ptr_conv = *(LDKCandidateRouteHop*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - NetworkUpdate_free(this_ptr_conv); + CandidateRouteHop_free(this_ptr_conv); } -static inline uint64_t NetworkUpdate_clone_ptr(LDKNetworkUpdate *NONNULL_PTR arg) { - LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); - *ret_copy = NetworkUpdate_clone(arg); +static inline uint64_t CandidateRouteHop_clone_ptr(LDKCandidateRouteHop *NONNULL_PTR arg) { + LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); + *ret_copy = CandidateRouteHop_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_NetworkUpdate_clone_ptr(int64_t arg) { - LDKNetworkUpdate* arg_conv = (LDKNetworkUpdate*)untag_ptr(arg); - int64_t ret_conv = NetworkUpdate_clone_ptr(arg_conv); +int64_t CS_LDK_CandidateRouteHop_clone_ptr(int64_t arg) { + LDKCandidateRouteHop* arg_conv = (LDKCandidateRouteHop*)untag_ptr(arg); + int64_t ret_conv = CandidateRouteHop_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_NetworkUpdate_clone(int64_t orig) { - LDKNetworkUpdate* orig_conv = (LDKNetworkUpdate*)untag_ptr(orig); - LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); - *ret_copy = NetworkUpdate_clone(orig_conv); +int64_t CS_LDK_CandidateRouteHop_clone(int64_t orig) { + LDKCandidateRouteHop* orig_conv = (LDKCandidateRouteHop*)untag_ptr(orig); + LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); + *ret_copy = CandidateRouteHop_clone(orig_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_NetworkUpdate_channel_update_message(int64_t msg) { - LDKChannelUpdate msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ChannelUpdate_clone(&msg_conv); - LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); - *ret_copy = NetworkUpdate_channel_update_message(msg_conv); +int64_t CS_LDK_CandidateRouteHop_first_hop(int64_t a) { + LDKFirstHopCandidate a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = FirstHopCandidate_clone(&a_conv); + LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); + *ret_copy = CandidateRouteHop_first_hop(a_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_NetworkUpdate_channel_failure(int64_t short_channel_id, jboolean is_permanent) { - LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); - *ret_copy = NetworkUpdate_channel_failure(short_channel_id, is_permanent); +int64_t CS_LDK_CandidateRouteHop_public_hop(int64_t a) { + LDKPublicHopCandidate a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = PublicHopCandidate_clone(&a_conv); + LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); + *ret_copy = CandidateRouteHop_public_hop(a_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_NetworkUpdate_node_failure(int8_tArray node_id, jboolean is_permanent) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); - *ret_copy = NetworkUpdate_node_failure(node_id_ref, is_permanent); +int64_t CS_LDK_CandidateRouteHop_private_hop(int64_t a) { + LDKPrivateHopCandidate a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = PrivateHopCandidate_clone(&a_conv); + LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); + *ret_copy = CandidateRouteHop_private_hop(a_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -jboolean CS_LDK_NetworkUpdate_eq(int64_t a, int64_t b) { - LDKNetworkUpdate* a_conv = (LDKNetworkUpdate*)untag_ptr(a); - LDKNetworkUpdate* b_conv = (LDKNetworkUpdate*)untag_ptr(b); - jboolean ret_conv = NetworkUpdate_eq(a_conv, b_conv); - return ret_conv; -} - -int8_tArray CS_LDK_NetworkUpdate_write(int64_t obj) { - LDKNetworkUpdate* obj_conv = (LDKNetworkUpdate*)untag_ptr(obj); - LDKCVec_u8Z ret_var = NetworkUpdate_write(obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +int64_t CS_LDK_CandidateRouteHop_blinded(int64_t a) { + LDKBlindedPathCandidate a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = BlindedPathCandidate_clone(&a_conv); + LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); + *ret_copy = CandidateRouteHop_blinded(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_NetworkUpdate_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); - *ret_conv = NetworkUpdate_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_CandidateRouteHop_one_hop_blinded(int64_t a) { + LDKOneHopBlindedPathCandidate a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = OneHopBlindedPathCandidate_clone(&a_conv); + LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); + *ret_copy = CandidateRouteHop_one_hop_blinded(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_P2PGossipSync_free(int64_t this_obj) { - LDKP2PGossipSync this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - P2PGossipSync_free(this_obj_conv); +int64_t CS_LDK_CandidateRouteHop_globally_unique_short_channel_id(int64_t this_arg) { + LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = CandidateRouteHop_globally_unique_short_channel_id(this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_P2PGossipSync_new(int64_t network_graph, int64_t utxo_lookup, int64_t logger) { +int32_t CS_LDK_CandidateRouteHop_cltv_expiry_delta(int64_t this_arg) { + LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); + int32_t ret_conv = CandidateRouteHop_cltv_expiry_delta(this_arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CandidateRouteHop_htlc_minimum_msat(int64_t this_arg) { + LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); + int64_t ret_conv = CandidateRouteHop_htlc_minimum_msat(this_arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CandidateRouteHop_fees(int64_t this_arg) { + LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); + LDKRoutingFees ret_var = CandidateRouteHop_fees(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_CandidateRouteHop_source(int64_t this_arg) { + LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); + LDKNodeId ret_var = CandidateRouteHop_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_CandidateRouteHop_target(int64_t this_arg) { + LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); + LDKNodeId ret_var = CandidateRouteHop_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; +} + +int64_t CS_LDK_find_route(int8_tArray our_node_pubkey, int64_t route_params, int64_t network_graph, int64_tArray first_hops, int64_t logger, int64_t scorer, int64_t score_params, int8_tArray random_seed_bytes) { + LDKPublicKey our_node_pubkey_ref; + CHECK(our_node_pubkey->arr_len == 33); + memcpy(our_node_pubkey_ref.compressed_form, our_node_pubkey->elems, 33); FREE(our_node_pubkey); + LDKRouteParameters route_params_conv; + route_params_conv.inner = untag_ptr(route_params); + route_params_conv.is_owned = ptr_is_owned(route_params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); + route_params_conv.is_owned = false; LDKNetworkGraph network_graph_conv; network_graph_conv.inner = untag_ptr(network_graph); network_graph_conv.is_owned = ptr_is_owned(network_graph); CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); network_graph_conv.is_owned = false; - void* utxo_lookup_ptr = untag_ptr(utxo_lookup); - CHECK_ACCESS(utxo_lookup_ptr); - LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr); - // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ - if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) { - // Manually implement clone for Java trait instances - if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some); + LDKCVec_ChannelDetailsZ first_hops_constr; + LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL; + if (first_hops != NULL) { + first_hops_constr.datalen = first_hops->arr_len; + if (first_hops_constr.datalen > 0) + first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); + else + first_hops_constr.data = NULL; + int64_t* first_hops_vals = first_hops->elems; + for (size_t q = 0; q < first_hops_constr.datalen; q++) { + int64_t first_hops_conv_16 = first_hops_vals[q]; + LDKChannelDetails first_hops_conv_16_conv; + first_hops_conv_16_conv.inner = untag_ptr(first_hops_conv_16); + first_hops_conv_16_conv.is_owned = ptr_is_owned(first_hops_conv_16); + CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv); + first_hops_conv_16_conv.is_owned = false; + first_hops_constr.data[q] = first_hops_conv_16_conv; } + FREE(first_hops); + first_hops_ptr = &first_hops_constr; } void* logger_ptr = untag_ptr(logger); CHECK_ACCESS(logger_ptr); @@ -69812,1206 +73568,1378 @@ int64_t CS_LDK_P2PGossipSync_new(int64_t network_graph, int64_t utxo_lookup, in // If this_arg is a JCalls struct, then we need to increment the refcnt in it. LDKLogger_JCalls_cloned(&logger_conv); } - LDKP2PGossipSync ret_var = P2PGossipSync_new(&network_graph_conv, utxo_lookup_conv, logger_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + void* scorer_ptr = untag_ptr(scorer); + if (ptr_is_owned(scorer)) { CHECK_ACCESS(scorer_ptr); } + LDKScoreLookUp* scorer_conv = (LDKScoreLookUp*)scorer_ptr; + LDKProbabilisticScoringFeeParameters score_params_conv; + score_params_conv.inner = untag_ptr(score_params); + score_params_conv.is_owned = ptr_is_owned(score_params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(score_params_conv); + score_params_conv.is_owned = false; + uint8_t random_seed_bytes_arr[32]; + CHECK(random_seed_bytes->arr_len == 32); + memcpy(random_seed_bytes_arr, random_seed_bytes->elems, 32); FREE(random_seed_bytes); + uint8_t (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr; + LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); + *ret_conv = find_route(our_node_pubkey_ref, &route_params_conv, &network_graph_conv, first_hops_ptr, logger_conv, scorer_conv, &score_params_conv, random_seed_bytes_ref); + if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); } + return tag_ptr(ret_conv, true); } -void CS_LDK_P2PGossipSync_add_utxo_lookup(int64_t this_arg, int64_t utxo_lookup) { - LDKP2PGossipSync this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - void* utxo_lookup_ptr = untag_ptr(utxo_lookup); - CHECK_ACCESS(utxo_lookup_ptr); - LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr); - // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ - if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) { - // Manually implement clone for Java trait instances - if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some); - } +int64_t CS_LDK_build_route_from_hops(int8_tArray our_node_pubkey, ptrArray hops, int64_t route_params, int64_t network_graph, int64_t logger, int8_tArray random_seed_bytes) { + LDKPublicKey our_node_pubkey_ref; + CHECK(our_node_pubkey->arr_len == 33); + memcpy(our_node_pubkey_ref.compressed_form, our_node_pubkey->elems, 33); FREE(our_node_pubkey); + LDKCVec_PublicKeyZ hops_constr; + hops_constr.datalen = hops->arr_len; + if (hops_constr.datalen > 0) + hops_constr.data = MALLOC(hops_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); + else + hops_constr.data = NULL; + int8_tArray* hops_vals = (void*) hops->elems; + for (size_t i = 0; i < hops_constr.datalen; i++) { + int8_tArray hops_conv_8 = hops_vals[i]; + LDKPublicKey hops_conv_8_ref; + CHECK(hops_conv_8->arr_len == 33); + memcpy(hops_conv_8_ref.compressed_form, hops_conv_8->elems, 33); FREE(hops_conv_8); + hops_constr.data[i] = hops_conv_8_ref; } - P2PGossipSync_add_utxo_lookup(&this_arg_conv, utxo_lookup_conv); + FREE(hops); + LDKRouteParameters route_params_conv; + route_params_conv.inner = untag_ptr(route_params); + route_params_conv.is_owned = ptr_is_owned(route_params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); + route_params_conv.is_owned = false; + LDKNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + uint8_t random_seed_bytes_arr[32]; + CHECK(random_seed_bytes->arr_len == 32); + memcpy(random_seed_bytes_arr, random_seed_bytes->elems, 32); FREE(random_seed_bytes); + uint8_t (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr; + LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); + *ret_conv = build_route_from_hops(our_node_pubkey_ref, hops_constr, &route_params_conv, &network_graph_conv, logger_conv, random_seed_bytes_ref); + return tag_ptr(ret_conv, true); } -void CS_LDK_NetworkGraph_handle_network_update(int64_t this_arg, int64_t network_update) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNetworkUpdate* network_update_conv = (LDKNetworkUpdate*)untag_ptr(network_update); - NetworkGraph_handle_network_update(&this_arg_conv, network_update_conv); +void CS_LDK_ScoreLookUp_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); + LDKScoreLookUp this_ptr_conv = *(LDKScoreLookUp*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + ScoreLookUp_free(this_ptr_conv); } -int8_tArray CS_LDK_NetworkGraph_get_chain_hash(int64_t this_arg) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, NetworkGraph_get_chain_hash(&this_arg_conv).data, 32); - return ret_arr; +void CS_LDK_ScoreUpdate_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); + LDKScoreUpdate this_ptr_conv = *(LDKScoreUpdate*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + ScoreUpdate_free(this_ptr_conv); } -int64_t CS_LDK_verify_node_announcement(int64_t msg) { - LDKNodeAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = verify_node_announcement(&msg_conv); - return tag_ptr(ret_conv, true); +void CS_LDK_Score_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); + LDKScore this_ptr_conv = *(LDKScore*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Score_free(this_ptr_conv); } -int64_t CS_LDK_verify_channel_announcement(int64_t msg) { - LDKChannelAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = verify_channel_announcement(&msg_conv); - return tag_ptr(ret_conv, true); +void CS_LDK_LockableScore_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); + LDKLockableScore this_ptr_conv = *(LDKLockableScore*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + LockableScore_free(this_ptr_conv); } -int64_t CS_LDK_P2PGossipSync_as_RoutingMessageHandler(int64_t this_arg) { - LDKP2PGossipSync this_arg_conv; +void CS_LDK_WriteableScore_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); + LDKWriteableScore this_ptr_conv = *(LDKWriteableScore*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + WriteableScore_free(this_ptr_conv); +} + +void CS_LDK_MultiThreadedLockableScore_free(int64_t this_obj) { + LDKMultiThreadedLockableScore this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + MultiThreadedLockableScore_free(this_obj_conv); +} + +int64_t CS_LDK_MultiThreadedLockableScore_as_LockableScore(int64_t this_arg) { + LDKMultiThreadedLockableScore this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler"); - *ret_ret = P2PGossipSync_as_RoutingMessageHandler(&this_arg_conv); + LDKLockableScore* ret_ret = MALLOC(sizeof(LDKLockableScore), "LDKLockableScore"); + *ret_ret = MultiThreadedLockableScore_as_LockableScore(&this_arg_conv); return tag_ptr(ret_ret, true); } -int64_t CS_LDK_P2PGossipSync_as_MessageSendEventsProvider(int64_t this_arg) { - LDKP2PGossipSync this_arg_conv; +int8_tArray CS_LDK_MultiThreadedLockableScore_write(int64_t obj) { + LDKMultiThreadedLockableScore obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = MultiThreadedLockableScore_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_MultiThreadedLockableScore_as_WriteableScore(int64_t this_arg) { + LDKMultiThreadedLockableScore this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); - *ret_ret = P2PGossipSync_as_MessageSendEventsProvider(&this_arg_conv); + LDKWriteableScore* ret_ret = MALLOC(sizeof(LDKWriteableScore), "LDKWriteableScore"); + *ret_ret = MultiThreadedLockableScore_as_WriteableScore(&this_arg_conv); return tag_ptr(ret_ret, true); } -void CS_LDK_ChannelUpdateInfo_free(int64_t this_obj) { - LDKChannelUpdateInfo this_obj_conv; +int64_t CS_LDK_MultiThreadedLockableScore_new(int64_t score) { + void* score_ptr = untag_ptr(score); + CHECK_ACCESS(score_ptr); + LDKScore score_conv = *(LDKScore*)(score_ptr); + if (score_conv.free == LDKScore_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKScore_JCalls_cloned(&score_conv); + } + LDKMultiThreadedLockableScore ret_var = MultiThreadedLockableScore_new(score_conv); + int64_t ret_ref = 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_MultiThreadedScoreLockRead_free(int64_t this_obj) { + LDKMultiThreadedScoreLockRead this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelUpdateInfo_free(this_obj_conv); -} - -int32_t CS_LDK_ChannelUpdateInfo_get_last_update(int64_t this_ptr) { - LDKChannelUpdateInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int32_t ret_conv = ChannelUpdateInfo_get_last_update(&this_ptr_conv); - return ret_conv; + MultiThreadedScoreLockRead_free(this_obj_conv); } -void CS_LDK_ChannelUpdateInfo_set_last_update(int64_t this_ptr, int32_t val) { - LDKChannelUpdateInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelUpdateInfo_set_last_update(&this_ptr_conv, val); +void CS_LDK_MultiThreadedScoreLockWrite_free(int64_t this_obj) { + LDKMultiThreadedScoreLockWrite this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + MultiThreadedScoreLockWrite_free(this_obj_conv); } -jboolean CS_LDK_ChannelUpdateInfo_get_enabled(int64_t this_ptr) { - LDKChannelUpdateInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - jboolean ret_conv = ChannelUpdateInfo_get_enabled(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_MultiThreadedScoreLockRead_as_ScoreLookUp(int64_t this_arg) { + LDKMultiThreadedScoreLockRead this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKScoreLookUp* ret_ret = MALLOC(sizeof(LDKScoreLookUp), "LDKScoreLookUp"); + *ret_ret = MultiThreadedScoreLockRead_as_ScoreLookUp(&this_arg_conv); + return tag_ptr(ret_ret, true); } -void CS_LDK_ChannelUpdateInfo_set_enabled(int64_t this_ptr, jboolean val) { - LDKChannelUpdateInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelUpdateInfo_set_enabled(&this_ptr_conv, val); +int8_tArray CS_LDK_MultiThreadedScoreLockWrite_write(int64_t obj) { + LDKMultiThreadedScoreLockWrite 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 = MultiThreadedScoreLockWrite_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -int16_t CS_LDK_ChannelUpdateInfo_get_cltv_expiry_delta(int64_t this_ptr) { - LDKChannelUpdateInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int16_t ret_conv = ChannelUpdateInfo_get_cltv_expiry_delta(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_MultiThreadedScoreLockWrite_as_ScoreUpdate(int64_t this_arg) { + LDKMultiThreadedScoreLockWrite this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKScoreUpdate* ret_ret = MALLOC(sizeof(LDKScoreUpdate), "LDKScoreUpdate"); + *ret_ret = MultiThreadedScoreLockWrite_as_ScoreUpdate(&this_arg_conv); + return tag_ptr(ret_ret, true); } -void CS_LDK_ChannelUpdateInfo_set_cltv_expiry_delta(int64_t this_ptr, int16_t val) { - LDKChannelUpdateInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelUpdateInfo_set_cltv_expiry_delta(&this_ptr_conv, val); +void CS_LDK_ChannelUsage_free(int64_t this_obj) { + LDKChannelUsage this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelUsage_free(this_obj_conv); } -int64_t CS_LDK_ChannelUpdateInfo_get_htlc_minimum_msat(int64_t this_ptr) { - LDKChannelUpdateInfo this_ptr_conv; +int64_t CS_LDK_ChannelUsage_get_amount_msat(int64_t this_ptr) { + LDKChannelUsage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelUpdateInfo_get_htlc_minimum_msat(&this_ptr_conv); + int64_t ret_conv = ChannelUsage_get_amount_msat(&this_ptr_conv); return ret_conv; } -void CS_LDK_ChannelUpdateInfo_set_htlc_minimum_msat(int64_t this_ptr, int64_t val) { - LDKChannelUpdateInfo this_ptr_conv; +void CS_LDK_ChannelUsage_set_amount_msat(int64_t this_ptr, int64_t val) { + LDKChannelUsage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelUpdateInfo_set_htlc_minimum_msat(&this_ptr_conv, val); + ChannelUsage_set_amount_msat(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelUpdateInfo_get_htlc_maximum_msat(int64_t this_ptr) { - LDKChannelUpdateInfo this_ptr_conv; +int64_t CS_LDK_ChannelUsage_get_inflight_htlc_msat(int64_t this_ptr) { + LDKChannelUsage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelUpdateInfo_get_htlc_maximum_msat(&this_ptr_conv); + int64_t ret_conv = ChannelUsage_get_inflight_htlc_msat(&this_ptr_conv); return ret_conv; } -void CS_LDK_ChannelUpdateInfo_set_htlc_maximum_msat(int64_t this_ptr, int64_t val) { - LDKChannelUpdateInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelUpdateInfo_set_htlc_maximum_msat(&this_ptr_conv, val); -} - -int64_t CS_LDK_ChannelUpdateInfo_get_fees(int64_t this_ptr) { - LDKChannelUpdateInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKRoutingFees ret_var = ChannelUpdateInfo_get_fees(&this_ptr_conv); - int64_t ret_ref = 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_ChannelUpdateInfo_set_fees(int64_t this_ptr, int64_t val) { - LDKChannelUpdateInfo this_ptr_conv; +void CS_LDK_ChannelUsage_set_inflight_htlc_msat(int64_t this_ptr, int64_t val) { + LDKChannelUsage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKRoutingFees val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = RoutingFees_clone(&val_conv); - ChannelUpdateInfo_set_fees(&this_ptr_conv, val_conv); + ChannelUsage_set_inflight_htlc_msat(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelUpdateInfo_get_last_update_message(int64_t this_ptr) { - LDKChannelUpdateInfo this_ptr_conv; +int64_t CS_LDK_ChannelUsage_get_effective_capacity(int64_t this_ptr) { + LDKChannelUsage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelUpdate ret_var = ChannelUpdateInfo_get_last_update_message(&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); + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = ChannelUsage_get_effective_capacity(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void CS_LDK_ChannelUpdateInfo_set_last_update_message(int64_t this_ptr, int64_t val) { - LDKChannelUpdateInfo this_ptr_conv; +void CS_LDK_ChannelUsage_set_effective_capacity(int64_t this_ptr, int64_t val) { + LDKChannelUsage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelUpdate val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelUpdate_clone(&val_conv); - ChannelUpdateInfo_set_last_update_message(&this_ptr_conv, val_conv); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKEffectiveCapacity val_conv = *(LDKEffectiveCapacity*)(val_ptr); + val_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(val)); + ChannelUsage_set_effective_capacity(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelUpdateInfo_new(int32_t last_update_arg, jboolean enabled_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg, int64_t fees_arg, int64_t last_update_message_arg) { - LDKRoutingFees fees_arg_conv; - fees_arg_conv.inner = untag_ptr(fees_arg); - fees_arg_conv.is_owned = ptr_is_owned(fees_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv); - fees_arg_conv = RoutingFees_clone(&fees_arg_conv); - LDKChannelUpdate last_update_message_arg_conv; - last_update_message_arg_conv.inner = untag_ptr(last_update_message_arg); - last_update_message_arg_conv.is_owned = ptr_is_owned(last_update_message_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(last_update_message_arg_conv); - last_update_message_arg_conv = ChannelUpdate_clone(&last_update_message_arg_conv); - LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_new(last_update_arg, enabled_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, fees_arg_conv, last_update_message_arg_conv); +int64_t CS_LDK_ChannelUsage_new(int64_t amount_msat_arg, int64_t inflight_htlc_msat_arg, int64_t effective_capacity_arg) { + void* effective_capacity_arg_ptr = untag_ptr(effective_capacity_arg); + CHECK_ACCESS(effective_capacity_arg_ptr); + LDKEffectiveCapacity effective_capacity_arg_conv = *(LDKEffectiveCapacity*)(effective_capacity_arg_ptr); + effective_capacity_arg_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(effective_capacity_arg)); + LDKChannelUsage ret_var = ChannelUsage_new(amount_msat_arg, inflight_htlc_msat_arg, effective_capacity_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t ChannelUpdateInfo_clone_ptr(LDKChannelUpdateInfo *NONNULL_PTR arg) { - LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_clone(arg); +static inline uint64_t ChannelUsage_clone_ptr(LDKChannelUsage *NONNULL_PTR arg) { + LDKChannelUsage ret_var = ChannelUsage_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_ChannelUpdateInfo_clone_ptr(int64_t arg) { - LDKChannelUpdateInfo arg_conv; +int64_t CS_LDK_ChannelUsage_clone_ptr(int64_t arg) { + LDKChannelUsage arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = ChannelUpdateInfo_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelUsage_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_ChannelUpdateInfo_clone(int64_t orig) { - LDKChannelUpdateInfo orig_conv; +int64_t CS_LDK_ChannelUsage_clone(int64_t orig) { + LDKChannelUsage orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_clone(&orig_conv); + LDKChannelUsage ret_var = ChannelUsage_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_ChannelUpdateInfo_eq(int64_t a, int64_t b) { - LDKChannelUpdateInfo a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKChannelUpdateInfo b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = ChannelUpdateInfo_eq(&a_conv, &b_conv); - return ret_conv; +void CS_LDK_FixedPenaltyScorer_free(int64_t this_obj) { + LDKFixedPenaltyScorer this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + FixedPenaltyScorer_free(this_obj_conv); } -jstring CS_LDK_ChannelUpdateInfo_to_str(int64_t o) { - LDKChannelUpdateInfo o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = ChannelUpdateInfo_to_str(&o_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); +static inline uint64_t FixedPenaltyScorer_clone_ptr(LDKFixedPenaltyScorer *NONNULL_PTR arg) { + LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_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_FixedPenaltyScorer_clone_ptr(int64_t arg) { + LDKFixedPenaltyScorer arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = FixedPenaltyScorer_clone_ptr(&arg_conv); return ret_conv; } -int8_tArray CS_LDK_ChannelUpdateInfo_write(int64_t obj) { - LDKChannelUpdateInfo obj_conv; +int64_t CS_LDK_FixedPenaltyScorer_clone(int64_t orig) { + LDKFixedPenaltyScorer orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(&orig_conv); + int64_t ret_ref = 0; + 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_FixedPenaltyScorer_with_penalty(int64_t penalty_msat) { + LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_with_penalty(penalty_msat); + int64_t ret_ref = 0; + 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_FixedPenaltyScorer_as_ScoreLookUp(int64_t this_arg) { + LDKFixedPenaltyScorer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKScoreLookUp* ret_ret = MALLOC(sizeof(LDKScoreLookUp), "LDKScoreLookUp"); + *ret_ret = FixedPenaltyScorer_as_ScoreLookUp(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +int64_t CS_LDK_FixedPenaltyScorer_as_ScoreUpdate(int64_t this_arg) { + LDKFixedPenaltyScorer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKScoreUpdate* ret_ret = MALLOC(sizeof(LDKScoreUpdate), "LDKScoreUpdate"); + *ret_ret = FixedPenaltyScorer_as_ScoreUpdate(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +int8_tArray CS_LDK_FixedPenaltyScorer_write(int64_t obj) { + LDKFixedPenaltyScorer obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ChannelUpdateInfo_write(&obj_conv); + LDKCVec_u8Z ret_var = FixedPenaltyScorer_write(&obj_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_ChannelUpdateInfo_read(int8_tArray ser) { +int64_t CS_LDK_FixedPenaltyScorer_read(int8_tArray ser, int64_t arg) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ"); - *ret_conv = ChannelUpdateInfo_read(ser_ref); + LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); + *ret_conv = FixedPenaltyScorer_read(ser_ref, arg); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_ChannelInfo_free(int64_t this_obj) { - LDKChannelInfo this_obj_conv; +void CS_LDK_ProbabilisticScorer_free(int64_t this_obj) { + LDKProbabilisticScorer this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelInfo_free(this_obj_conv); + ProbabilisticScorer_free(this_obj_conv); } -int64_t CS_LDK_ChannelInfo_get_features(int64_t this_ptr) { - LDKChannelInfo this_ptr_conv; +void CS_LDK_ProbabilisticScoringFeeParameters_free(int64_t this_obj) { + LDKProbabilisticScoringFeeParameters this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ProbabilisticScoringFeeParameters_free(this_obj_conv); +} + +int64_t CS_LDK_ProbabilisticScoringFeeParameters_get_base_penalty_msat(int64_t this_ptr) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelFeatures ret_var = ChannelInfo_get_features(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + int64_t ret_conv = ProbabilisticScoringFeeParameters_get_base_penalty_msat(&this_ptr_conv); + return ret_conv; } -void CS_LDK_ChannelInfo_set_features(int64_t this_ptr, int64_t val) { - LDKChannelInfo this_ptr_conv; +void CS_LDK_ProbabilisticScoringFeeParameters_set_base_penalty_msat(int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelFeatures val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelFeatures_clone(&val_conv); - ChannelInfo_set_features(&this_ptr_conv, val_conv); + ProbabilisticScoringFeeParameters_set_base_penalty_msat(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelInfo_get_node_one(int64_t this_ptr) { - LDKChannelInfo this_ptr_conv; +int64_t CS_LDK_ProbabilisticScoringFeeParameters_get_base_penalty_amount_multiplier_msat(int64_t this_ptr) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeId ret_var = ChannelInfo_get_node_one(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + int64_t ret_conv = ProbabilisticScoringFeeParameters_get_base_penalty_amount_multiplier_msat(&this_ptr_conv); + return ret_conv; } -void CS_LDK_ChannelInfo_set_node_one(int64_t this_ptr, int64_t val) { - LDKChannelInfo this_ptr_conv; +void CS_LDK_ProbabilisticScoringFeeParameters_set_base_penalty_amount_multiplier_msat(int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeId val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = NodeId_clone(&val_conv); - ChannelInfo_set_node_one(&this_ptr_conv, val_conv); + ProbabilisticScoringFeeParameters_set_base_penalty_amount_multiplier_msat(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelInfo_get_one_to_two(int64_t this_ptr) { - LDKChannelInfo this_ptr_conv; +int64_t CS_LDK_ProbabilisticScoringFeeParameters_get_liquidity_penalty_multiplier_msat(int64_t this_ptr) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelUpdateInfo ret_var = ChannelInfo_get_one_to_two(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + int64_t ret_conv = ProbabilisticScoringFeeParameters_get_liquidity_penalty_multiplier_msat(&this_ptr_conv); + return ret_conv; } -void CS_LDK_ChannelInfo_set_one_to_two(int64_t this_ptr, int64_t val) { - LDKChannelInfo this_ptr_conv; +void CS_LDK_ProbabilisticScoringFeeParameters_set_liquidity_penalty_multiplier_msat(int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelUpdateInfo val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelUpdateInfo_clone(&val_conv); - ChannelInfo_set_one_to_two(&this_ptr_conv, val_conv); + ProbabilisticScoringFeeParameters_set_liquidity_penalty_multiplier_msat(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelInfo_get_node_two(int64_t this_ptr) { - LDKChannelInfo this_ptr_conv; +int64_t CS_LDK_ProbabilisticScoringFeeParameters_get_liquidity_penalty_amount_multiplier_msat(int64_t this_ptr) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeId ret_var = ChannelInfo_get_node_two(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + int64_t ret_conv = ProbabilisticScoringFeeParameters_get_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv); + return ret_conv; } -void CS_LDK_ChannelInfo_set_node_two(int64_t this_ptr, int64_t val) { - LDKChannelInfo this_ptr_conv; +void CS_LDK_ProbabilisticScoringFeeParameters_set_liquidity_penalty_amount_multiplier_msat(int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeId val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = NodeId_clone(&val_conv); - ChannelInfo_set_node_two(&this_ptr_conv, val_conv); + ProbabilisticScoringFeeParameters_set_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelInfo_get_two_to_one(int64_t this_ptr) { - LDKChannelInfo this_ptr_conv; +int64_t CS_LDK_ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_multiplier_msat(int64_t this_ptr) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelUpdateInfo ret_var = ChannelInfo_get_two_to_one(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + int64_t ret_conv = ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_multiplier_msat(&this_ptr_conv); + return ret_conv; } -void CS_LDK_ChannelInfo_set_two_to_one(int64_t this_ptr, int64_t val) { - LDKChannelInfo this_ptr_conv; +void CS_LDK_ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_multiplier_msat(int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelUpdateInfo val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelUpdateInfo_clone(&val_conv); - ChannelInfo_set_two_to_one(&this_ptr_conv, val_conv); + ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_multiplier_msat(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelInfo_get_capacity_sats(int64_t this_ptr) { - LDKChannelInfo this_ptr_conv; +int64_t CS_LDK_ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_amount_multiplier_msat(int64_t this_ptr) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelInfo_get_capacity_sats(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + int64_t ret_conv = ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv); + return ret_conv; } -void CS_LDK_ChannelInfo_set_capacity_sats(int64_t this_ptr, int64_t val) { - LDKChannelInfo this_ptr_conv; +void CS_LDK_ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_amount_multiplier_msat(int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - ChannelInfo_set_capacity_sats(&this_ptr_conv, val_conv); + ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelInfo_get_announcement_message(int64_t this_ptr) { - LDKChannelInfo this_ptr_conv; +int64_t CS_LDK_ProbabilisticScoringFeeParameters_get_anti_probing_penalty_msat(int64_t this_ptr) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelAnnouncement ret_var = ChannelInfo_get_announcement_message(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + int64_t ret_conv = ProbabilisticScoringFeeParameters_get_anti_probing_penalty_msat(&this_ptr_conv); + return ret_conv; } -void CS_LDK_ChannelInfo_set_announcement_message(int64_t this_ptr, int64_t val) { - LDKChannelInfo this_ptr_conv; +void CS_LDK_ProbabilisticScoringFeeParameters_set_anti_probing_penalty_msat(int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelAnnouncement val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelAnnouncement_clone(&val_conv); - ChannelInfo_set_announcement_message(&this_ptr_conv, val_conv); -} - -static inline uint64_t ChannelInfo_clone_ptr(LDKChannelInfo *NONNULL_PTR arg) { - LDKChannelInfo ret_var = ChannelInfo_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_ChannelInfo_clone_ptr(int64_t arg) { - LDKChannelInfo arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = ChannelInfo_clone_ptr(&arg_conv); - return ret_conv; -} - -int64_t CS_LDK_ChannelInfo_clone(int64_t orig) { - LDKChannelInfo orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKChannelInfo ret_var = ChannelInfo_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + ProbabilisticScoringFeeParameters_set_anti_probing_penalty_msat(&this_ptr_conv, val); } -jboolean CS_LDK_ChannelInfo_eq(int64_t a, int64_t b) { - LDKChannelInfo a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKChannelInfo b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = ChannelInfo_eq(&a_conv, &b_conv); +int64_t CS_LDK_ProbabilisticScoringFeeParameters_get_considered_impossible_penalty_msat(int64_t this_ptr) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = ProbabilisticScoringFeeParameters_get_considered_impossible_penalty_msat(&this_ptr_conv); return ret_conv; } -int64_t CS_LDK_ChannelInfo_get_directional_info(int64_t this_arg, int8_t channel_flags) { - LDKChannelInfo this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelUpdateInfo ret_var = ChannelInfo_get_directional_info(&this_arg_conv, channel_flags); - int64_t ret_ref = 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_ProbabilisticScoringFeeParameters_set_considered_impossible_penalty_msat(int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ProbabilisticScoringFeeParameters_set_considered_impossible_penalty_msat(&this_ptr_conv, val); } -jstring CS_LDK_ChannelInfo_to_str(int64_t o) { - LDKChannelInfo o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = ChannelInfo_to_str(&o_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); +jboolean CS_LDK_ProbabilisticScoringFeeParameters_get_linear_success_probability(int64_t this_ptr) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = ProbabilisticScoringFeeParameters_get_linear_success_probability(&this_ptr_conv); return ret_conv; } -int8_tArray CS_LDK_ChannelInfo_write(int64_t obj) { - LDKChannelInfo obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ChannelInfo_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -int64_t CS_LDK_ChannelInfo_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); - *ret_conv = ChannelInfo_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -void CS_LDK_DirectedChannelInfo_free(int64_t this_obj) { - LDKDirectedChannelInfo this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - DirectedChannelInfo_free(this_obj_conv); +void CS_LDK_ProbabilisticScoringFeeParameters_set_linear_success_probability(int64_t this_ptr, jboolean val) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ProbabilisticScoringFeeParameters_set_linear_success_probability(&this_ptr_conv, val); } -static inline uint64_t DirectedChannelInfo_clone_ptr(LDKDirectedChannelInfo *NONNULL_PTR arg) { - LDKDirectedChannelInfo ret_var = DirectedChannelInfo_clone(arg); +static inline uint64_t ProbabilisticScoringFeeParameters_clone_ptr(LDKProbabilisticScoringFeeParameters *NONNULL_PTR arg) { + LDKProbabilisticScoringFeeParameters ret_var = ProbabilisticScoringFeeParameters_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_DirectedChannelInfo_clone_ptr(int64_t arg) { - LDKDirectedChannelInfo arg_conv; +int64_t CS_LDK_ProbabilisticScoringFeeParameters_clone_ptr(int64_t arg) { + LDKProbabilisticScoringFeeParameters arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = DirectedChannelInfo_clone_ptr(&arg_conv); + int64_t ret_conv = ProbabilisticScoringFeeParameters_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_DirectedChannelInfo_clone(int64_t orig) { - LDKDirectedChannelInfo orig_conv; +int64_t CS_LDK_ProbabilisticScoringFeeParameters_clone(int64_t orig) { + LDKProbabilisticScoringFeeParameters orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKDirectedChannelInfo ret_var = DirectedChannelInfo_clone(&orig_conv); + LDKProbabilisticScoringFeeParameters ret_var = ProbabilisticScoringFeeParameters_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_DirectedChannelInfo_channel(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; - LDKChannelInfo ret_var = DirectedChannelInfo_channel(&this_arg_conv); +int64_t CS_LDK_ProbabilisticScoringFeeParameters_default() { + LDKProbabilisticScoringFeeParameters ret_var = ProbabilisticScoringFeeParameters_default(); int64_t ret_ref = 0; 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_effective_capacity(int64_t this_arg) { - LDKDirectedChannelInfo this_arg_conv; +void CS_LDK_ProbabilisticScoringFeeParameters_add_banned(int64_t this_arg, int64_t node_id) { + LDKProbabilisticScoringFeeParameters this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = DirectedChannelInfo_effective_capacity(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKNodeId node_id_conv; + node_id_conv.inner = untag_ptr(node_id); + node_id_conv.is_owned = ptr_is_owned(node_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); + node_id_conv.is_owned = false; + ProbabilisticScoringFeeParameters_add_banned(&this_arg_conv, &node_id_conv); } -int64_t CS_LDK_DirectedChannelInfo_source(int64_t this_arg) { - LDKDirectedChannelInfo this_arg_conv; +void CS_LDK_ProbabilisticScoringFeeParameters_add_banned_from_list(int64_t this_arg, int64_tArray node_ids) { + LDKProbabilisticScoringFeeParameters this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_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; + LDKCVec_NodeIdZ node_ids_constr; + node_ids_constr.datalen = node_ids->arr_len; + if (node_ids_constr.datalen > 0) + node_ids_constr.data = MALLOC(node_ids_constr.datalen * sizeof(LDKNodeId), "LDKCVec_NodeIdZ Elements"); + else + node_ids_constr.data = NULL; + int64_t* node_ids_vals = node_ids->elems; + for (size_t i = 0; i < node_ids_constr.datalen; i++) { + int64_t node_ids_conv_8 = node_ids_vals[i]; + LDKNodeId node_ids_conv_8_conv; + node_ids_conv_8_conv.inner = untag_ptr(node_ids_conv_8); + node_ids_conv_8_conv.is_owned = ptr_is_owned(node_ids_conv_8); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_ids_conv_8_conv); + node_ids_conv_8_conv = NodeId_clone(&node_ids_conv_8_conv); + node_ids_constr.data[i] = node_ids_conv_8_conv; + } + FREE(node_ids); + ProbabilisticScoringFeeParameters_add_banned_from_list(&this_arg_conv, node_ids_constr); } -int64_t CS_LDK_DirectedChannelInfo_target(int64_t this_arg) { - LDKDirectedChannelInfo this_arg_conv; +void CS_LDK_ProbabilisticScoringFeeParameters_remove_banned(int64_t this_arg, int64_t node_id) { + LDKProbabilisticScoringFeeParameters this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_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; + LDKNodeId node_id_conv; + node_id_conv.inner = untag_ptr(node_id); + node_id_conv.is_owned = ptr_is_owned(node_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); + node_id_conv.is_owned = false; + ProbabilisticScoringFeeParameters_remove_banned(&this_arg_conv, &node_id_conv); } -void CS_LDK_EffectiveCapacity_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); - LDKEffectiveCapacity this_ptr_conv = *(LDKEffectiveCapacity*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - EffectiveCapacity_free(this_ptr_conv); +void CS_LDK_ProbabilisticScoringFeeParameters_set_manual_penalty(int64_t this_arg, int64_t node_id, int64_t penalty) { + LDKProbabilisticScoringFeeParameters this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeId node_id_conv; + node_id_conv.inner = untag_ptr(node_id); + node_id_conv.is_owned = ptr_is_owned(node_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); + node_id_conv.is_owned = false; + ProbabilisticScoringFeeParameters_set_manual_penalty(&this_arg_conv, &node_id_conv, penalty); } -static inline uint64_t EffectiveCapacity_clone_ptr(LDKEffectiveCapacity *NONNULL_PTR arg) { - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_ProbabilisticScoringFeeParameters_remove_manual_penalty(int64_t this_arg, int64_t node_id) { + LDKProbabilisticScoringFeeParameters this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeId node_id_conv; + node_id_conv.inner = untag_ptr(node_id); + node_id_conv.is_owned = ptr_is_owned(node_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); + node_id_conv.is_owned = false; + ProbabilisticScoringFeeParameters_remove_manual_penalty(&this_arg_conv, &node_id_conv); } -int64_t CS_LDK_EffectiveCapacity_clone_ptr(int64_t arg) { - LDKEffectiveCapacity* arg_conv = (LDKEffectiveCapacity*)untag_ptr(arg); - int64_t ret_conv = EffectiveCapacity_clone_ptr(arg_conv); - return ret_conv; + +void CS_LDK_ProbabilisticScoringFeeParameters_clear_manual_penalties(int64_t this_arg) { + LDKProbabilisticScoringFeeParameters this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ProbabilisticScoringFeeParameters_clear_manual_penalties(&this_arg_conv); } -int64_t CS_LDK_EffectiveCapacity_clone(int64_t orig) { - LDKEffectiveCapacity* orig_conv = (LDKEffectiveCapacity*)untag_ptr(orig); - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_EffectiveCapacity_exact_liquidity(int64_t liquidity_msat) { - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_exact_liquidity(liquidity_msat); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_EffectiveCapacity_advertised_max_htlc(int64_t amount_msat) { - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_advertised_max_htlc(amount_msat); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_EffectiveCapacity_total(int64_t capacity_msat, int64_t htlc_maximum_msat) { - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_total(capacity_msat, htlc_maximum_msat); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_EffectiveCapacity_infinite() { - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_infinite(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_EffectiveCapacity_hint_max_htlc(int64_t amount_msat) { - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_hint_max_htlc(amount_msat); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_EffectiveCapacity_unknown() { - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_unknown(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_EffectiveCapacity_as_msat(int64_t this_arg) { - LDKEffectiveCapacity* this_arg_conv = (LDKEffectiveCapacity*)untag_ptr(this_arg); - int64_t ret_conv = EffectiveCapacity_as_msat(this_arg_conv); - return ret_conv; -} - -void CS_LDK_RoutingFees_free(int64_t this_obj) { - LDKRoutingFees this_obj_conv; +void CS_LDK_ProbabilisticScoringDecayParameters_free(int64_t this_obj) { + LDKProbabilisticScoringDecayParameters this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - RoutingFees_free(this_obj_conv); + ProbabilisticScoringDecayParameters_free(this_obj_conv); } -int32_t CS_LDK_RoutingFees_get_base_msat(int64_t this_ptr) { - LDKRoutingFees this_ptr_conv; +int64_t CS_LDK_ProbabilisticScoringDecayParameters_get_historical_no_updates_half_life(int64_t this_ptr) { + LDKProbabilisticScoringDecayParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int32_t ret_conv = RoutingFees_get_base_msat(&this_ptr_conv); + int64_t ret_conv = ProbabilisticScoringDecayParameters_get_historical_no_updates_half_life(&this_ptr_conv); return ret_conv; } -void CS_LDK_RoutingFees_set_base_msat(int64_t this_ptr, int32_t val) { - LDKRoutingFees this_ptr_conv; +void CS_LDK_ProbabilisticScoringDecayParameters_set_historical_no_updates_half_life(int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringDecayParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - RoutingFees_set_base_msat(&this_ptr_conv, val); + ProbabilisticScoringDecayParameters_set_historical_no_updates_half_life(&this_ptr_conv, val); } -int32_t CS_LDK_RoutingFees_get_proportional_millionths(int64_t this_ptr) { - LDKRoutingFees this_ptr_conv; +int64_t CS_LDK_ProbabilisticScoringDecayParameters_get_liquidity_offset_half_life(int64_t this_ptr) { + LDKProbabilisticScoringDecayParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int32_t ret_conv = RoutingFees_get_proportional_millionths(&this_ptr_conv); + int64_t ret_conv = ProbabilisticScoringDecayParameters_get_liquidity_offset_half_life(&this_ptr_conv); return ret_conv; } -void CS_LDK_RoutingFees_set_proportional_millionths(int64_t this_ptr, int32_t val) { - LDKRoutingFees this_ptr_conv; +void CS_LDK_ProbabilisticScoringDecayParameters_set_liquidity_offset_half_life(int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringDecayParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - RoutingFees_set_proportional_millionths(&this_ptr_conv, val); + ProbabilisticScoringDecayParameters_set_liquidity_offset_half_life(&this_ptr_conv, val); } -int64_t CS_LDK_RoutingFees_new(int32_t base_msat_arg, int32_t proportional_millionths_arg) { - LDKRoutingFees ret_var = RoutingFees_new(base_msat_arg, proportional_millionths_arg); +int64_t CS_LDK_ProbabilisticScoringDecayParameters_new(int64_t historical_no_updates_half_life_arg, int64_t liquidity_offset_half_life_arg) { + LDKProbabilisticScoringDecayParameters ret_var = ProbabilisticScoringDecayParameters_new(historical_no_updates_half_life_arg, liquidity_offset_half_life_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; } -jboolean CS_LDK_RoutingFees_eq(int64_t a, int64_t b) { - LDKRoutingFees a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKRoutingFees b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = RoutingFees_eq(&a_conv, &b_conv); - return ret_conv; -} - -static inline uint64_t RoutingFees_clone_ptr(LDKRoutingFees *NONNULL_PTR arg) { - LDKRoutingFees ret_var = RoutingFees_clone(arg); +static inline uint64_t ProbabilisticScoringDecayParameters_clone_ptr(LDKProbabilisticScoringDecayParameters *NONNULL_PTR arg) { + LDKProbabilisticScoringDecayParameters ret_var = ProbabilisticScoringDecayParameters_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_RoutingFees_clone_ptr(int64_t arg) { - LDKRoutingFees arg_conv; +int64_t CS_LDK_ProbabilisticScoringDecayParameters_clone_ptr(int64_t arg) { + LDKProbabilisticScoringDecayParameters arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = RoutingFees_clone_ptr(&arg_conv); + int64_t ret_conv = ProbabilisticScoringDecayParameters_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_RoutingFees_clone(int64_t orig) { - LDKRoutingFees orig_conv; +int64_t CS_LDK_ProbabilisticScoringDecayParameters_clone(int64_t orig) { + LDKProbabilisticScoringDecayParameters orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKRoutingFees ret_var = RoutingFees_clone(&orig_conv); + LDKProbabilisticScoringDecayParameters ret_var = ProbabilisticScoringDecayParameters_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_RoutingFees_hash(int64_t o) { - LDKRoutingFees o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = RoutingFees_hash(&o_conv); - return ret_conv; +int64_t CS_LDK_ProbabilisticScoringDecayParameters_default() { + LDKProbabilisticScoringDecayParameters ret_var = ProbabilisticScoringDecayParameters_default(); + int64_t ret_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_RoutingFees_write(int64_t obj) { - LDKRoutingFees obj_conv; +int64_t CS_LDK_ProbabilisticScorer_new(int64_t decay_params, int64_t network_graph, int64_t logger) { + LDKProbabilisticScoringDecayParameters decay_params_conv; + decay_params_conv.inner = untag_ptr(decay_params); + decay_params_conv.is_owned = ptr_is_owned(decay_params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(decay_params_conv); + decay_params_conv = ProbabilisticScoringDecayParameters_clone(&decay_params_conv); + LDKNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKProbabilisticScorer ret_var = ProbabilisticScorer_new(decay_params_conv, &network_graph_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; +} + +void CS_LDK_ProbabilisticScorer_debug_log_liquidity_stats(int64_t this_arg) { + LDKProbabilisticScorer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ProbabilisticScorer_debug_log_liquidity_stats(&this_arg_conv); +} + +int64_t CS_LDK_ProbabilisticScorer_estimated_channel_liquidity_range(int64_t this_arg, int64_t scid, int64_t target) { + LDKProbabilisticScorer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeId target_conv; + target_conv.inner = untag_ptr(target); + target_conv.is_owned = ptr_is_owned(target); + CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); + target_conv.is_owned = false; + LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ"); + *ret_copy = ProbabilisticScorer_estimated_channel_liquidity_range(&this_arg_conv, scid, &target_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_ProbabilisticScorer_historical_estimated_channel_liquidity_probabilities(int64_t this_arg, int64_t scid, int64_t target) { + LDKProbabilisticScorer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeId target_conv; + target_conv.inner = untag_ptr(target); + target_conv.is_owned = ptr_is_owned(target); + CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); + target_conv.is_owned = false; + LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ), "LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ"); + *ret_copy = ProbabilisticScorer_historical_estimated_channel_liquidity_probabilities(&this_arg_conv, scid, &target_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_ProbabilisticScorer_historical_estimated_payment_success_probability(int64_t this_arg, int64_t scid, int64_t target, int64_t amount_msat, int64_t params) { + LDKProbabilisticScorer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeId target_conv; + target_conv.inner = untag_ptr(target); + target_conv.is_owned = ptr_is_owned(target); + CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); + target_conv.is_owned = false; + LDKProbabilisticScoringFeeParameters params_conv; + params_conv.inner = untag_ptr(params); + params_conv.is_owned = ptr_is_owned(params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); + params_conv.is_owned = false; + LDKCOption_f64Z *ret_copy = MALLOC(sizeof(LDKCOption_f64Z), "LDKCOption_f64Z"); + *ret_copy = ProbabilisticScorer_historical_estimated_payment_success_probability(&this_arg_conv, scid, &target_conv, amount_msat, ¶ms_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_ProbabilisticScorer_as_ScoreLookUp(int64_t this_arg) { + LDKProbabilisticScorer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKScoreLookUp* ret_ret = MALLOC(sizeof(LDKScoreLookUp), "LDKScoreLookUp"); + *ret_ret = ProbabilisticScorer_as_ScoreLookUp(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +int64_t CS_LDK_ProbabilisticScorer_as_ScoreUpdate(int64_t this_arg) { + LDKProbabilisticScorer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKScoreUpdate* ret_ret = MALLOC(sizeof(LDKScoreUpdate), "LDKScoreUpdate"); + *ret_ret = ProbabilisticScorer_as_ScoreUpdate(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +int64_t CS_LDK_ProbabilisticScorer_as_Score(int64_t this_arg) { + LDKProbabilisticScorer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore"); + *ret_ret = ProbabilisticScorer_as_Score(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +int8_tArray CS_LDK_ProbabilisticScorer_write(int64_t obj) { + LDKProbabilisticScorer obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = RoutingFees_write(&obj_conv); + LDKCVec_u8Z ret_var = ProbabilisticScorer_write(&obj_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_RoutingFees_read(int8_tArray ser) { +int64_t CS_LDK_ProbabilisticScorer_read(int8_tArray ser, int64_t arg_a, int64_t arg_b, int64_t arg_c) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); - *ret_conv = RoutingFees_read(ser_ref); + LDKProbabilisticScoringDecayParameters arg_a_conv; + arg_a_conv.inner = untag_ptr(arg_a); + arg_a_conv.is_owned = ptr_is_owned(arg_a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_a_conv); + arg_a_conv = ProbabilisticScoringDecayParameters_clone(&arg_a_conv); + LDKNetworkGraph arg_b_conv; + arg_b_conv.inner = untag_ptr(arg_b); + arg_b_conv.is_owned = ptr_is_owned(arg_b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_b_conv); + arg_b_conv.is_owned = false; + void* arg_c_ptr = untag_ptr(arg_c); + CHECK_ACCESS(arg_c_ptr); + LDKLogger arg_c_conv = *(LDKLogger*)(arg_c_ptr); + if (arg_c_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&arg_c_conv); + } + LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ"); + *ret_conv = ProbabilisticScorer_read(ser_ref, arg_a_conv, &arg_b_conv, arg_c_conv); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_NodeAnnouncementInfo_free(int64_t this_obj) { - LDKNodeAnnouncementInfo this_obj_conv; +void CS_LDK_DelayedPaymentOutputDescriptor_free(int64_t this_obj) { + LDKDelayedPaymentOutputDescriptor this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - NodeAnnouncementInfo_free(this_obj_conv); + DelayedPaymentOutputDescriptor_free(this_obj_conv); } -int64_t CS_LDK_NodeAnnouncementInfo_get_features(int64_t this_ptr) { - LDKNodeAnnouncementInfo this_ptr_conv; +int64_t CS_LDK_DelayedPaymentOutputDescriptor_get_outpoint(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; - LDKNodeFeatures ret_var = NodeAnnouncementInfo_get_features(&this_ptr_conv); + LDKOutPoint ret_var = DelayedPaymentOutputDescriptor_get_outpoint(&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_NodeAnnouncementInfo_set_features(int64_t this_ptr, int64_t val) { - LDKNodeAnnouncementInfo this_ptr_conv; +void CS_LDK_DelayedPaymentOutputDescriptor_set_outpoint(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; - LDKNodeFeatures val_conv; + LDKOutPoint val_conv; val_conv.inner = untag_ptr(val); val_conv.is_owned = ptr_is_owned(val); CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = NodeFeatures_clone(&val_conv); - NodeAnnouncementInfo_set_features(&this_ptr_conv, val_conv); + val_conv = OutPoint_clone(&val_conv); + DelayedPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv); +} + +int8_tArray CS_LDK_DelayedPaymentOutputDescriptor_get_per_commitment_point(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; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, DelayedPaymentOutputDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form, 33); + return ret_arr; +} + +void CS_LDK_DelayedPaymentOutputDescriptor_set_per_commitment_point(int64_t this_ptr, int8_tArray 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; + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + DelayedPaymentOutputDescriptor_set_per_commitment_point(&this_ptr_conv, val_ref); } -int32_t CS_LDK_NodeAnnouncementInfo_get_last_update(int64_t this_ptr) { - LDKNodeAnnouncementInfo this_ptr_conv; +int16_t CS_LDK_DelayedPaymentOutputDescriptor_get_to_self_delay(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; - int32_t ret_conv = NodeAnnouncementInfo_get_last_update(&this_ptr_conv); + int16_t ret_conv = DelayedPaymentOutputDescriptor_get_to_self_delay(&this_ptr_conv); return ret_conv; } -void CS_LDK_NodeAnnouncementInfo_set_last_update(int64_t this_ptr, int32_t val) { - LDKNodeAnnouncementInfo this_ptr_conv; +void CS_LDK_DelayedPaymentOutputDescriptor_set_to_self_delay(int64_t this_ptr, int16_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; - NodeAnnouncementInfo_set_last_update(&this_ptr_conv, val); + DelayedPaymentOutputDescriptor_set_to_self_delay(&this_ptr_conv, val); } -int8_tArray CS_LDK_NodeAnnouncementInfo_get_rgb(int64_t this_ptr) { - LDKNodeAnnouncementInfo this_ptr_conv; +int64_t CS_LDK_DelayedPaymentOutputDescriptor_get_output(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; - int8_tArray ret_arr = init_int8_tArray(3, __LINE__); - memcpy(ret_arr->elems, *NodeAnnouncementInfo_get_rgb(&this_ptr_conv), 3); - return ret_arr; + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = DelayedPaymentOutputDescriptor_get_output(&this_ptr_conv); + return tag_ptr(ret_ref, true); } -void CS_LDK_NodeAnnouncementInfo_set_rgb(int64_t this_ptr, int8_tArray val) { - LDKNodeAnnouncementInfo this_ptr_conv; +void CS_LDK_DelayedPaymentOutputDescriptor_set_output(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; - LDKThreeBytes val_ref; - CHECK(val->arr_len == 3); - memcpy(val_ref.data, val->elems, 3); FREE(val); - NodeAnnouncementInfo_set_rgb(&this_ptr_conv, val_ref); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); + val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val)); + DelayedPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv); } -int64_t CS_LDK_NodeAnnouncementInfo_get_alias(int64_t this_ptr) { - LDKNodeAnnouncementInfo this_ptr_conv; +int64_t CS_LDK_DelayedPaymentOutputDescriptor_get_revocation_pubkey(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; - LDKNodeAlias ret_var = NodeAnnouncementInfo_get_alias(&this_ptr_conv); + LDKRevocationKey ret_var = DelayedPaymentOutputDescriptor_get_revocation_pubkey(&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_NodeAnnouncementInfo_set_alias(int64_t this_ptr, int64_t val) { - LDKNodeAnnouncementInfo this_ptr_conv; +void CS_LDK_DelayedPaymentOutputDescriptor_set_revocation_pubkey(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; - LDKNodeAlias val_conv; + LDKRevocationKey val_conv; val_conv.inner = untag_ptr(val); val_conv.is_owned = ptr_is_owned(val); CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = NodeAlias_clone(&val_conv); - NodeAnnouncementInfo_set_alias(&this_ptr_conv, val_conv); + val_conv = RevocationKey_clone(&val_conv); + DelayedPaymentOutputDescriptor_set_revocation_pubkey(&this_ptr_conv, val_conv); +} + +int8_tArray CS_LDK_DelayedPaymentOutputDescriptor_get_channel_keys_id(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; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *DelayedPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv), 32); + return ret_arr; +} + +void CS_LDK_DelayedPaymentOutputDescriptor_set_channel_keys_id(int64_t this_ptr, int8_tArray 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; + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + DelayedPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref); +} + +int64_t CS_LDK_DelayedPaymentOutputDescriptor_get_channel_value_satoshis(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; + int64_t ret_conv = DelayedPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_DelayedPaymentOutputDescriptor_set_channel_value_satoshis(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; + DelayedPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); } -int64_t CS_LDK_NodeAnnouncementInfo_get_announcement_message(int64_t this_ptr) { - LDKNodeAnnouncementInfo this_ptr_conv; +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; - LDKNodeAnnouncement ret_var = NodeAnnouncementInfo_get_announcement_message(&this_ptr_conv); + 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_NodeAnnouncementInfo_set_announcement_message(int64_t this_ptr, int64_t val) { - LDKNodeAnnouncementInfo this_ptr_conv; +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; - LDKNodeAnnouncement val_conv; + 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 = NodeAnnouncement_clone(&val_conv); - NodeAnnouncementInfo_set_announcement_message(&this_ptr_conv, val_conv); + val_conv = ChannelTransactionParameters_clone(&val_conv); + DelayedPaymentOutputDescriptor_set_channel_transaction_parameters(&this_ptr_conv, val_conv); } -int64_t CS_LDK_NodeAnnouncementInfo_new(int64_t features_arg, int32_t last_update_arg, int8_tArray rgb_arg, int64_t alias_arg, int64_t announcement_message_arg) { - LDKNodeFeatures features_arg_conv; - features_arg_conv.inner = untag_ptr(features_arg); - features_arg_conv.is_owned = ptr_is_owned(features_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); - features_arg_conv = NodeFeatures_clone(&features_arg_conv); - LDKThreeBytes rgb_arg_ref; - CHECK(rgb_arg->arr_len == 3); - memcpy(rgb_arg_ref.data, rgb_arg->elems, 3); FREE(rgb_arg); - LDKNodeAlias alias_arg_conv; - alias_arg_conv.inner = untag_ptr(alias_arg); - alias_arg_conv.is_owned = ptr_is_owned(alias_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(alias_arg_conv); - alias_arg_conv = NodeAlias_clone(&alias_arg_conv); - LDKNodeAnnouncement announcement_message_arg_conv; - announcement_message_arg_conv.inner = untag_ptr(announcement_message_arg); - announcement_message_arg_conv.is_owned = ptr_is_owned(announcement_message_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_message_arg_conv); - announcement_message_arg_conv = NodeAnnouncement_clone(&announcement_message_arg_conv); - LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_new(features_arg_conv, last_update_arg, rgb_arg_ref, alias_arg_conv, announcement_message_arg_conv); +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); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); + outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); + 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); + void* output_arg_ptr = untag_ptr(output_arg); + CHECK_ACCESS(output_arg_ptr); + LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr); + output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg)); + LDKRevocationKey revocation_pubkey_arg_conv; + revocation_pubkey_arg_conv.inner = untag_ptr(revocation_pubkey_arg); + revocation_pubkey_arg_conv.is_owned = ptr_is_owned(revocation_pubkey_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(revocation_pubkey_arg_conv); + revocation_pubkey_arg_conv = RevocationKey_clone(&revocation_pubkey_arg_conv); + 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); + 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); return ret_ref; } -static inline uint64_t NodeAnnouncementInfo_clone_ptr(LDKNodeAnnouncementInfo *NONNULL_PTR arg) { - LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(arg); +static inline uint64_t DelayedPaymentOutputDescriptor_clone_ptr(LDKDelayedPaymentOutputDescriptor *NONNULL_PTR arg) { + LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_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_NodeAnnouncementInfo_clone_ptr(int64_t arg) { - LDKNodeAnnouncementInfo arg_conv; +int64_t CS_LDK_DelayedPaymentOutputDescriptor_clone_ptr(int64_t arg) { + LDKDelayedPaymentOutputDescriptor arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = NodeAnnouncementInfo_clone_ptr(&arg_conv); + int64_t ret_conv = DelayedPaymentOutputDescriptor_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_NodeAnnouncementInfo_clone(int64_t orig) { - LDKNodeAnnouncementInfo orig_conv; +int64_t CS_LDK_DelayedPaymentOutputDescriptor_clone(int64_t orig) { + LDKDelayedPaymentOutputDescriptor orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(&orig_conv); + LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_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_NodeAnnouncementInfo_eq(int64_t a, int64_t b) { - LDKNodeAnnouncementInfo a_conv; +int64_t CS_LDK_DelayedPaymentOutputDescriptor_hash(int64_t o) { + LDKDelayedPaymentOutputDescriptor o_conv; + 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 = DelayedPaymentOutputDescriptor_hash(&o_conv); + return ret_conv; +} + +jboolean CS_LDK_DelayedPaymentOutputDescriptor_eq(int64_t a, int64_t b) { + LDKDelayedPaymentOutputDescriptor a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKNodeAnnouncementInfo b_conv; + LDKDelayedPaymentOutputDescriptor b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = NodeAnnouncementInfo_eq(&a_conv, &b_conv); + jboolean ret_conv = DelayedPaymentOutputDescriptor_eq(&a_conv, &b_conv); return ret_conv; } -int64_tArray CS_LDK_NodeAnnouncementInfo_addresses(int64_t this_arg) { - LDKNodeAnnouncementInfo this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_SocketAddressZ ret_var = NodeAnnouncementInfo_addresses(&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 p = 0; p < ret_var.datalen; p++) { - LDKSocketAddress *ret_conv_15_copy = MALLOC(sizeof(LDKSocketAddress), "LDKSocketAddress"); - *ret_conv_15_copy = ret_var.data[p]; - int64_t ret_conv_15_ref = tag_ptr(ret_conv_15_copy, true); - ret_arr_ptr[p] = ret_conv_15_ref; - } - - FREE(ret_var.data); - return ret_arr; -} - -int8_tArray CS_LDK_NodeAnnouncementInfo_write(int64_t obj) { - LDKNodeAnnouncementInfo obj_conv; +int8_tArray CS_LDK_DelayedPaymentOutputDescriptor_write(int64_t obj) { + LDKDelayedPaymentOutputDescriptor obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = NodeAnnouncementInfo_write(&obj_conv); + LDKCVec_u8Z ret_var = DelayedPaymentOutputDescriptor_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_NodeAnnouncementInfo_read(int8_tArray ser) { +int64_t CS_LDK_DelayedPaymentOutputDescriptor_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); - *ret_conv = NodeAnnouncementInfo_read(ser_ref); + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = DelayedPaymentOutputDescriptor_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_NodeAlias_free(int64_t this_obj) { - LDKNodeAlias this_obj_conv; +void CS_LDK_StaticPaymentOutputDescriptor_free(int64_t this_obj) { + LDKStaticPaymentOutputDescriptor this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - NodeAlias_free(this_obj_conv); + StaticPaymentOutputDescriptor_free(this_obj_conv); } -int8_tArray CS_LDK_NodeAlias_get_a(int64_t this_ptr) { - LDKNodeAlias this_ptr_conv; +int64_t CS_LDK_StaticPaymentOutputDescriptor_get_outpoint(int64_t this_ptr) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *NodeAlias_get_a(&this_ptr_conv), 32); + LDKOutPoint ret_var = StaticPaymentOutputDescriptor_get_outpoint(&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_StaticPaymentOutputDescriptor_set_outpoint(int64_t this_ptr, int64_t val) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKOutPoint val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = OutPoint_clone(&val_conv); + StaticPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_StaticPaymentOutputDescriptor_get_output(int64_t this_ptr) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = StaticPaymentOutputDescriptor_get_output(&this_ptr_conv); + return tag_ptr(ret_ref, true); +} + +void CS_LDK_StaticPaymentOutputDescriptor_set_output(int64_t this_ptr, int64_t val) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); + val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val)); + StaticPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv); +} + +int8_tArray CS_LDK_StaticPaymentOutputDescriptor_get_channel_keys_id(int64_t this_ptr) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(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, *StaticPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv), 32); return ret_arr; } -void CS_LDK_NodeAlias_set_a(int64_t this_ptr, int8_tArray val) { - LDKNodeAlias this_ptr_conv; +void CS_LDK_StaticPaymentOutputDescriptor_set_channel_keys_id(int64_t this_ptr, int8_tArray val) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -71019,11951 +74947,13271 @@ void CS_LDK_NodeAlias_set_a(int64_t this_ptr, int8_tArray val) { LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); memcpy(val_ref.data, val->elems, 32); FREE(val); - NodeAlias_set_a(&this_ptr_conv, val_ref); + StaticPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref); } -int64_t CS_LDK_NodeAlias_new(int8_tArray a_arg) { - LDKThirtyTwoBytes a_arg_ref; - CHECK(a_arg->arr_len == 32); - memcpy(a_arg_ref.data, a_arg->elems, 32); FREE(a_arg); - LDKNodeAlias ret_var = NodeAlias_new(a_arg_ref); +int64_t CS_LDK_StaticPaymentOutputDescriptor_get_channel_value_satoshis(int64_t this_ptr) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = StaticPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_StaticPaymentOutputDescriptor_set_channel_value_satoshis(int64_t this_ptr, int64_t val) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + StaticPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); +} + +int64_t CS_LDK_StaticPaymentOutputDescriptor_get_channel_transaction_parameters(int64_t this_ptr) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = StaticPaymentOutputDescriptor_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; } -static inline uint64_t NodeAlias_clone_ptr(LDKNodeAlias *NONNULL_PTR arg) { - LDKNodeAlias ret_var = NodeAlias_clone(arg); +void CS_LDK_StaticPaymentOutputDescriptor_set_channel_transaction_parameters(int64_t this_ptr, int64_t val) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + StaticPaymentOutputDescriptor_set_channel_transaction_parameters(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_StaticPaymentOutputDescriptor_new(int64_t outpoint_arg, int64_t output_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); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); + outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); + void* output_arg_ptr = untag_ptr(output_arg); + CHECK_ACCESS(output_arg_ptr); + LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr); + output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg)); + 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); + 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); + LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_new(outpoint_arg_conv, output_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); return ret_ref; } -int64_t CS_LDK_NodeAlias_clone_ptr(int64_t arg) { - LDKNodeAlias arg_conv; + +static inline uint64_t StaticPaymentOutputDescriptor_clone_ptr(LDKStaticPaymentOutputDescriptor *NONNULL_PTR arg) { + LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_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_StaticPaymentOutputDescriptor_clone_ptr(int64_t arg) { + LDKStaticPaymentOutputDescriptor arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = NodeAlias_clone_ptr(&arg_conv); + int64_t ret_conv = StaticPaymentOutputDescriptor_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_NodeAlias_clone(int64_t orig) { - LDKNodeAlias orig_conv; +int64_t CS_LDK_StaticPaymentOutputDescriptor_clone(int64_t orig) { + LDKStaticPaymentOutputDescriptor orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKNodeAlias ret_var = NodeAlias_clone(&orig_conv); + LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_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_NodeAlias_hash(int64_t o) { - LDKNodeAlias o_conv; +int64_t CS_LDK_StaticPaymentOutputDescriptor_hash(int64_t o) { + LDKStaticPaymentOutputDescriptor o_conv; 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 = NodeAlias_hash(&o_conv); + int64_t ret_conv = StaticPaymentOutputDescriptor_hash(&o_conv); return ret_conv; } -jboolean CS_LDK_NodeAlias_eq(int64_t a, int64_t b) { - LDKNodeAlias a_conv; +jboolean CS_LDK_StaticPaymentOutputDescriptor_eq(int64_t a, int64_t b) { + LDKStaticPaymentOutputDescriptor a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKNodeAlias b_conv; + LDKStaticPaymentOutputDescriptor b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = NodeAlias_eq(&a_conv, &b_conv); + jboolean ret_conv = StaticPaymentOutputDescriptor_eq(&a_conv, &b_conv); return ret_conv; } -jstring CS_LDK_NodeAlias_to_str(int64_t o) { - LDKNodeAlias o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = NodeAlias_to_str(&o_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); +int64_t CS_LDK_StaticPaymentOutputDescriptor_witness_script(int64_t this_arg) { + LDKStaticPaymentOutputDescriptor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = StaticPaymentOutputDescriptor_witness_script(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_StaticPaymentOutputDescriptor_max_witness_length(int64_t this_arg) { + LDKStaticPaymentOutputDescriptor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int64_t ret_conv = StaticPaymentOutputDescriptor_max_witness_length(&this_arg_conv); return ret_conv; } -int8_tArray CS_LDK_NodeAlias_write(int64_t obj) { - LDKNodeAlias obj_conv; +int8_tArray CS_LDK_StaticPaymentOutputDescriptor_write(int64_t obj) { + LDKStaticPaymentOutputDescriptor obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = NodeAlias_write(&obj_conv); + LDKCVec_u8Z ret_var = StaticPaymentOutputDescriptor_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_NodeAlias_read(int8_tArray ser) { +int64_t CS_LDK_StaticPaymentOutputDescriptor_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ"); - *ret_conv = NodeAlias_read(ser_ref); + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = StaticPaymentOutputDescriptor_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_NodeInfo_free(int64_t this_obj) { - LDKNodeInfo this_obj_conv; +void CS_LDK_SpendableOutputDescriptor_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); + LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + SpendableOutputDescriptor_free(this_ptr_conv); +} + +static inline uint64_t SpendableOutputDescriptor_clone_ptr(LDKSpendableOutputDescriptor *NONNULL_PTR arg) { + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = SpendableOutputDescriptor_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_SpendableOutputDescriptor_clone_ptr(int64_t arg) { + LDKSpendableOutputDescriptor* arg_conv = (LDKSpendableOutputDescriptor*)untag_ptr(arg); + int64_t ret_conv = SpendableOutputDescriptor_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_SpendableOutputDescriptor_clone(int64_t orig) { + LDKSpendableOutputDescriptor* orig_conv = (LDKSpendableOutputDescriptor*)untag_ptr(orig); + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = SpendableOutputDescriptor_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_SpendableOutputDescriptor_static_output(int64_t outpoint, int64_t output, int8_tArray channel_keys_id) { + 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); + void* output_ptr = untag_ptr(output); + CHECK_ACCESS(output_ptr); + LDKTxOut output_conv = *(LDKTxOut*)(output_ptr); + output_conv = TxOut_clone((LDKTxOut*)untag_ptr(output)); + LDKThirtyTwoBytes channel_keys_id_ref; + CHECK(channel_keys_id->arr_len == 32); + memcpy(channel_keys_id_ref.data, channel_keys_id->elems, 32); FREE(channel_keys_id); + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = SpendableOutputDescriptor_static_output(outpoint_conv, output_conv, channel_keys_id_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_SpendableOutputDescriptor_delayed_payment_output(int64_t a) { + LDKDelayedPaymentOutputDescriptor a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = DelayedPaymentOutputDescriptor_clone(&a_conv); + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = SpendableOutputDescriptor_delayed_payment_output(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_SpendableOutputDescriptor_static_payment_output(int64_t a) { + LDKStaticPaymentOutputDescriptor a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = StaticPaymentOutputDescriptor_clone(&a_conv); + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = SpendableOutputDescriptor_static_payment_output(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_SpendableOutputDescriptor_hash(int64_t o) { + LDKSpendableOutputDescriptor* o_conv = (LDKSpendableOutputDescriptor*)untag_ptr(o); + int64_t ret_conv = SpendableOutputDescriptor_hash(o_conv); + return ret_conv; +} + +jboolean CS_LDK_SpendableOutputDescriptor_eq(int64_t a, int64_t b) { + LDKSpendableOutputDescriptor* a_conv = (LDKSpendableOutputDescriptor*)untag_ptr(a); + LDKSpendableOutputDescriptor* b_conv = (LDKSpendableOutputDescriptor*)untag_ptr(b); + jboolean ret_conv = SpendableOutputDescriptor_eq(a_conv, b_conv); + return ret_conv; +} + +int8_tArray CS_LDK_SpendableOutputDescriptor_write(int64_t obj) { + LDKSpendableOutputDescriptor* obj_conv = (LDKSpendableOutputDescriptor*)untag_ptr(obj); + LDKCVec_u8Z ret_var = SpendableOutputDescriptor_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_SpendableOutputDescriptor_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); + *ret_conv = SpendableOutputDescriptor_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_SpendableOutputDescriptor_create_spendable_outputs_psbt(int64_tArray descriptors, int64_tArray outputs, int8_tArray change_destination_script, int32_t feerate_sat_per_1000_weight, int64_t locktime) { + 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_C2Tuple_CVec_u8Zu64ZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ), "LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ"); + *ret_conv = SpendableOutputDescriptor_create_spendable_outputs_psbt(descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight, locktime_conv); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_ChannelDerivationParameters_free(int64_t this_obj) { + LDKChannelDerivationParameters this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - NodeInfo_free(this_obj_conv); + ChannelDerivationParameters_free(this_obj_conv); } -int64_tArray CS_LDK_NodeInfo_get_channels(int64_t this_ptr) { - LDKNodeInfo this_ptr_conv; +int64_t CS_LDK_ChannelDerivationParameters_get_value_satoshis(int64_t this_ptr) { + LDKChannelDerivationParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u64Z ret_var = NodeInfo_get_channels(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t g = 0; g < ret_var.datalen; g++) { - int64_t ret_conv_6_conv = ret_var.data[g]; - ret_arr_ptr[g] = ret_conv_6_conv; - } - - FREE(ret_var.data); + int64_t ret_conv = ChannelDerivationParameters_get_value_satoshis(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_ChannelDerivationParameters_set_value_satoshis(int64_t this_ptr, int64_t val) { + LDKChannelDerivationParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelDerivationParameters_set_value_satoshis(&this_ptr_conv, val); +} + +int8_tArray CS_LDK_ChannelDerivationParameters_get_keys_id(int64_t this_ptr) { + LDKChannelDerivationParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(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, *ChannelDerivationParameters_get_keys_id(&this_ptr_conv), 32); return ret_arr; } -void CS_LDK_NodeInfo_set_channels(int64_t this_ptr, int64_tArray val) { - LDKNodeInfo this_ptr_conv; +void CS_LDK_ChannelDerivationParameters_set_keys_id(int64_t this_ptr, int8_tArray val) { + LDKChannelDerivationParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u64Z val_constr; - val_constr.datalen = val->arr_len; - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = val->elems; - for (size_t g = 0; g < val_constr.datalen; g++) { - int64_t val_conv_6 = val_vals[g]; - val_constr.data[g] = val_conv_6; - } - FREE(val); - NodeInfo_set_channels(&this_ptr_conv, val_constr); + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + ChannelDerivationParameters_set_keys_id(&this_ptr_conv, val_ref); } -int64_t CS_LDK_NodeInfo_get_announcement_info(int64_t this_ptr) { - LDKNodeInfo this_ptr_conv; +int64_t CS_LDK_ChannelDerivationParameters_get_transaction_parameters(int64_t this_ptr) { + LDKChannelDerivationParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeAnnouncementInfo ret_var = NodeInfo_get_announcement_info(&this_ptr_conv); + LDKChannelTransactionParameters ret_var = ChannelDerivationParameters_get_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_NodeInfo_set_announcement_info(int64_t this_ptr, int64_t val) { - LDKNodeInfo this_ptr_conv; +void CS_LDK_ChannelDerivationParameters_set_transaction_parameters(int64_t this_ptr, int64_t val) { + LDKChannelDerivationParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeAnnouncementInfo val_conv; + 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 = NodeAnnouncementInfo_clone(&val_conv); - NodeInfo_set_announcement_info(&this_ptr_conv, val_conv); + val_conv = ChannelTransactionParameters_clone(&val_conv); + ChannelDerivationParameters_set_transaction_parameters(&this_ptr_conv, val_conv); } -int64_t CS_LDK_NodeInfo_new(int64_tArray channels_arg, int64_t announcement_info_arg) { - LDKCVec_u64Z channels_arg_constr; - channels_arg_constr.datalen = channels_arg->arr_len; - if (channels_arg_constr.datalen > 0) - channels_arg_constr.data = MALLOC(channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); - else - channels_arg_constr.data = NULL; - int64_t* channels_arg_vals = channels_arg->elems; - for (size_t g = 0; g < channels_arg_constr.datalen; g++) { - int64_t channels_arg_conv_6 = channels_arg_vals[g]; - channels_arg_constr.data[g] = channels_arg_conv_6; - } - FREE(channels_arg); - LDKNodeAnnouncementInfo announcement_info_arg_conv; - announcement_info_arg_conv.inner = untag_ptr(announcement_info_arg); - announcement_info_arg_conv.is_owned = ptr_is_owned(announcement_info_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_info_arg_conv); - announcement_info_arg_conv = NodeAnnouncementInfo_clone(&announcement_info_arg_conv); - LDKNodeInfo ret_var = NodeInfo_new(channels_arg_constr, announcement_info_arg_conv); +int64_t CS_LDK_ChannelDerivationParameters_new(int64_t value_satoshis_arg, int8_tArray keys_id_arg, int64_t transaction_parameters_arg) { + LDKThirtyTwoBytes keys_id_arg_ref; + CHECK(keys_id_arg->arr_len == 32); + memcpy(keys_id_arg_ref.data, keys_id_arg->elems, 32); FREE(keys_id_arg); + LDKChannelTransactionParameters transaction_parameters_arg_conv; + transaction_parameters_arg_conv.inner = untag_ptr(transaction_parameters_arg); + transaction_parameters_arg_conv.is_owned = ptr_is_owned(transaction_parameters_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(transaction_parameters_arg_conv); + transaction_parameters_arg_conv = ChannelTransactionParameters_clone(&transaction_parameters_arg_conv); + LDKChannelDerivationParameters ret_var = ChannelDerivationParameters_new(value_satoshis_arg, keys_id_arg_ref, 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); return ret_ref; } -static inline uint64_t NodeInfo_clone_ptr(LDKNodeInfo *NONNULL_PTR arg) { - LDKNodeInfo ret_var = NodeInfo_clone(arg); +static inline uint64_t ChannelDerivationParameters_clone_ptr(LDKChannelDerivationParameters *NONNULL_PTR arg) { + LDKChannelDerivationParameters ret_var = ChannelDerivationParameters_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_NodeInfo_clone_ptr(int64_t arg) { - LDKNodeInfo arg_conv; +int64_t CS_LDK_ChannelDerivationParameters_clone_ptr(int64_t arg) { + LDKChannelDerivationParameters arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = NodeInfo_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelDerivationParameters_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_NodeInfo_clone(int64_t orig) { - LDKNodeInfo orig_conv; +int64_t CS_LDK_ChannelDerivationParameters_clone(int64_t orig) { + LDKChannelDerivationParameters orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKNodeInfo ret_var = NodeInfo_clone(&orig_conv); + LDKChannelDerivationParameters ret_var = ChannelDerivationParameters_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_NodeInfo_eq(int64_t a, int64_t b) { - LDKNodeInfo a_conv; +jboolean CS_LDK_ChannelDerivationParameters_eq(int64_t a, int64_t b) { + LDKChannelDerivationParameters a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKNodeInfo b_conv; + LDKChannelDerivationParameters b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = NodeInfo_eq(&a_conv, &b_conv); - return ret_conv; -} - -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; -} - -jstring CS_LDK_NodeInfo_to_str(int64_t o) { - LDKNodeInfo o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = NodeInfo_to_str(&o_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); + jboolean ret_conv = ChannelDerivationParameters_eq(&a_conv, &b_conv); return ret_conv; } -int8_tArray CS_LDK_NodeInfo_write(int64_t obj) { - LDKNodeInfo obj_conv; +int8_tArray CS_LDK_ChannelDerivationParameters_write(int64_t obj) { + LDKChannelDerivationParameters obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = NodeInfo_write(&obj_conv); + LDKCVec_u8Z ret_var = ChannelDerivationParameters_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_NodeInfo_read(int8_tArray ser) { +int64_t CS_LDK_ChannelDerivationParameters_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); - *ret_conv = NodeInfo_read(ser_ref); + LDKCResult_ChannelDerivationParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDerivationParametersDecodeErrorZ), "LDKCResult_ChannelDerivationParametersDecodeErrorZ"); + *ret_conv = ChannelDerivationParameters_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -int8_tArray CS_LDK_NetworkGraph_write(int64_t obj) { - LDKNetworkGraph obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = NetworkGraph_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; -} +void CS_LDK_HTLCDescriptor_free(int64_t this_obj) { + LDKHTLCDescriptor this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + HTLCDescriptor_free(this_obj_conv); +} -int64_t CS_LDK_NetworkGraph_read(int8_tArray ser, int64_t arg) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - void* arg_ptr = untag_ptr(arg); - CHECK_ACCESS(arg_ptr); - LDKLogger arg_conv = *(LDKLogger*)(arg_ptr); - if (arg_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&arg_conv); - } - LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); - *ret_conv = NetworkGraph_read(ser_ref, arg_conv); - FREE(ser); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_HTLCDescriptor_get_channel_derivation_parameters(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; + LDKChannelDerivationParameters ret_var = HTLCDescriptor_get_channel_derivation_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; } -jstring CS_LDK_NetworkGraph_to_str(int64_t o) { - LDKNetworkGraph o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = NetworkGraph_to_str(&o_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); +void CS_LDK_HTLCDescriptor_set_channel_derivation_parameters(int64_t this_ptr, int64_t 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; + LDKChannelDerivationParameters 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 = ChannelDerivationParameters_clone(&val_conv); + 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); + this_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 = HTLCDescriptor_get_per_commitment_number(&this_ptr_conv); return ret_conv; } -int64_t CS_LDK_NetworkGraph_new(int32_t network, int64_t logger) { - LDKNetwork network_conv = LDKNetwork_from_cs(network); - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKNetworkGraph ret_var = NetworkGraph_new(network_conv, logger_conv); +void CS_LDK_HTLCDescriptor_set_per_commitment_number(int64_t this_ptr, int64_t 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; + HTLCDescriptor_set_per_commitment_number(&this_ptr_conv, val); +} + +int8_tArray CS_LDK_HTLCDescriptor_get_per_commitment_point(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(33, __LINE__); + memcpy(ret_arr->elems, HTLCDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form, 33); + return ret_arr; +} + +void CS_LDK_HTLCDescriptor_set_per_commitment_point(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; + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + HTLCDescriptor_set_per_commitment_point(&this_ptr_conv, val_ref); +} + +int32_t CS_LDK_HTLCDescriptor_get_feerate_per_kw(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; + int32_t ret_conv = HTLCDescriptor_get_feerate_per_kw(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_HTLCDescriptor_set_feerate_per_kw(int64_t this_ptr, int32_t 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; + HTLCDescriptor_set_feerate_per_kw(&this_ptr_conv, val); +} + +int64_t CS_LDK_HTLCDescriptor_get_htlc(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; + LDKHTLCOutputInCommitment ret_var = HTLCDescriptor_get_htlc(&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; } -int64_t CS_LDK_NetworkGraph_read_only(int64_t this_arg) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKReadOnlyNetworkGraph ret_var = NetworkGraph_read_only(&this_arg_conv); +void CS_LDK_HTLCDescriptor_set_htlc(int64_t this_ptr, int64_t 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; + LDKHTLCOutputInCommitment 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 = HTLCOutputInCommitment_clone(&val_conv); + HTLCDescriptor_set_htlc(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_HTLCDescriptor_get_preimage(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; + LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); + *ret_copy = HTLCDescriptor_get_preimage(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_HTLCDescriptor_set_preimage(int64_t this_ptr, int64_t 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; + 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)); + HTLCDescriptor_set_preimage(&this_ptr_conv, val_conv); +} + +int8_tArray CS_LDK_HTLCDescriptor_get_counterparty_sig(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(64, __LINE__); + memcpy(ret_arr->elems, HTLCDescriptor_get_counterparty_sig(&this_ptr_conv).compact_form, 64); + return ret_arr; +} + +void CS_LDK_HTLCDescriptor_set_counterparty_sig(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; + LDKECDSASignature val_ref; + CHECK(val->arr_len == 64); + memcpy(val_ref.compact_form, val->elems, 64); FREE(val); + 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; } -int64_t CS_LDK_NetworkGraph_get_last_rapid_gossip_sync_timestamp(int64_t this_arg) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); - *ret_copy = NetworkGraph_get_last_rapid_gossip_sync_timestamp(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +static inline uint64_t HTLCDescriptor_clone_ptr(LDKHTLCDescriptor *NONNULL_PTR arg) { + LDKHTLCDescriptor ret_var = HTLCDescriptor_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_HTLCDescriptor_clone_ptr(int64_t arg) { + LDKHTLCDescriptor 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 = HTLCDescriptor_clone_ptr(&arg_conv); + return ret_conv; +} -void CS_LDK_NetworkGraph_set_last_rapid_gossip_sync_timestamp(int64_t this_arg, int32_t last_rapid_gossip_sync_timestamp) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - NetworkGraph_set_last_rapid_gossip_sync_timestamp(&this_arg_conv, last_rapid_gossip_sync_timestamp); +int64_t CS_LDK_HTLCDescriptor_clone(int64_t orig) { + LDKHTLCDescriptor 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; + LDKHTLCDescriptor ret_var = HTLCDescriptor_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_NetworkGraph_update_node_from_announcement(int64_t this_arg, int64_t msg) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_update_node_from_announcement(&this_arg_conv, &msg_conv); - return tag_ptr(ret_conv, true); +jboolean CS_LDK_HTLCDescriptor_eq(int64_t a, int64_t b) { + LDKHTLCDescriptor a_conv; + 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; + LDKHTLCDescriptor 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 = HTLCDescriptor_eq(&a_conv, &b_conv); + return ret_conv; } -int64_t CS_LDK_NetworkGraph_update_node_from_unsigned_announcement(int64_t this_arg, int64_t msg) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKUnsignedNodeAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_update_node_from_unsigned_announcement(&this_arg_conv, &msg_conv); - return tag_ptr(ret_conv, true); +int8_tArray CS_LDK_HTLCDescriptor_write(int64_t obj) { + LDKHTLCDescriptor 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 = HTLCDescriptor_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_NetworkGraph_update_channel_from_announcement(int64_t this_arg, int64_t msg, int64_t utxo_lookup) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - void* utxo_lookup_ptr = untag_ptr(utxo_lookup); - CHECK_ACCESS(utxo_lookup_ptr); - LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr); - // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ - if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) { - // Manually implement clone for Java trait instances - if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some); - } - } - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_update_channel_from_announcement(&this_arg_conv, &msg_conv, utxo_lookup_conv); +int64_t CS_LDK_HTLCDescriptor_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_HTLCDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCDescriptorDecodeErrorZ), "LDKCResult_HTLCDescriptorDecodeErrorZ"); + *ret_conv = HTLCDescriptor_read(ser_ref); + FREE(ser); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_NetworkGraph_update_channel_from_announcement_no_lookup(int64_t this_arg, int64_t msg) { - LDKNetworkGraph this_arg_conv; +int64_t CS_LDK_HTLCDescriptor_outpoint(int64_t this_arg) { + LDKHTLCDescriptor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKChannelAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_update_channel_from_announcement_no_lookup(&this_arg_conv, &msg_conv); - return tag_ptr(ret_conv, true); + LDKOutPoint ret_var = HTLCDescriptor_outpoint(&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_NetworkGraph_update_channel_from_unsigned_announcement(int64_t this_arg, int64_t msg, int64_t utxo_lookup) { - LDKNetworkGraph this_arg_conv; +int64_t CS_LDK_HTLCDescriptor_previous_utxo(int64_t this_arg) { + LDKHTLCDescriptor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKUnsignedChannelAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - void* utxo_lookup_ptr = untag_ptr(utxo_lookup); - CHECK_ACCESS(utxo_lookup_ptr); - LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr); - // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ - if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) { - // Manually implement clone for Java trait instances - if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some); - } - } - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_update_channel_from_unsigned_announcement(&this_arg_conv, &msg_conv, utxo_lookup_conv); - return tag_ptr(ret_conv, true); + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = HTLCDescriptor_previous_utxo(&this_arg_conv); + return tag_ptr(ret_ref, true); } -int64_t CS_LDK_NetworkGraph_add_channel_from_partial_announcement(int64_t this_arg, int64_t short_channel_id, int64_t timestamp, int64_t features, int8_tArray node_id_1, int8_tArray node_id_2) { - LDKNetworkGraph this_arg_conv; +int64_t CS_LDK_HTLCDescriptor_unsigned_tx_input(int64_t this_arg) { + LDKHTLCDescriptor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKChannelFeatures features_conv; - features_conv.inner = untag_ptr(features); - features_conv.is_owned = ptr_is_owned(features); - CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); - features_conv = ChannelFeatures_clone(&features_conv); - LDKPublicKey node_id_1_ref; - CHECK(node_id_1->arr_len == 33); - memcpy(node_id_1_ref.compressed_form, node_id_1->elems, 33); FREE(node_id_1); - LDKPublicKey node_id_2_ref; - CHECK(node_id_2->arr_len == 33); - memcpy(node_id_2_ref.compressed_form, node_id_2->elems, 33); FREE(node_id_2); - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_add_channel_from_partial_announcement(&this_arg_conv, short_channel_id, timestamp, features_conv, node_id_1_ref, node_id_2_ref); - return tag_ptr(ret_conv, true); + LDKTxIn* ret_ref = MALLOC(sizeof(LDKTxIn), "LDKTxIn"); + *ret_ref = HTLCDescriptor_unsigned_tx_input(&this_arg_conv); + return tag_ptr(ret_ref, true); } -void CS_LDK_NetworkGraph_channel_failed_permanent(int64_t this_arg, int64_t short_channel_id) { - LDKNetworkGraph this_arg_conv; +int64_t CS_LDK_HTLCDescriptor_tx_output(int64_t this_arg) { + LDKHTLCDescriptor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NetworkGraph_channel_failed_permanent(&this_arg_conv, short_channel_id); + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = HTLCDescriptor_tx_output(&this_arg_conv); + return tag_ptr(ret_ref, true); } -void CS_LDK_NetworkGraph_node_failed_permanent(int64_t this_arg, int8_tArray node_id) { - LDKNetworkGraph this_arg_conv; +int8_tArray CS_LDK_HTLCDescriptor_witness_script(int64_t this_arg) { + LDKHTLCDescriptor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - NetworkGraph_node_failed_permanent(&this_arg_conv, node_id_ref); + LDKCVec_u8Z ret_var = HTLCDescriptor_witness_script(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -void CS_LDK_NetworkGraph_remove_stale_channels_and_tracking(int64_t this_arg) { - LDKNetworkGraph this_arg_conv; +int8_tArray CS_LDK_HTLCDescriptor_tx_input_witness(int64_t this_arg, int8_tArray signature, int8_tArray witness_script) { + LDKHTLCDescriptor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NetworkGraph_remove_stale_channels_and_tracking(&this_arg_conv); + LDKECDSASignature signature_ref; + CHECK(signature->arr_len == 64); + memcpy(signature_ref.compact_form, signature->elems, 64); FREE(signature); + LDKu8slice witness_script_ref; + witness_script_ref.datalen = witness_script->arr_len; + witness_script_ref.data = witness_script->elems; + LDKWitness ret_var = HTLCDescriptor_tx_input_witness(&this_arg_conv, signature_ref, witness_script_ref); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + Witness_free(ret_var); + FREE(witness_script); + return ret_arr; } -void CS_LDK_NetworkGraph_remove_stale_channels_and_tracking_with_time(int64_t this_arg, int64_t current_time_unix) { - LDKNetworkGraph this_arg_conv; +int64_t CS_LDK_HTLCDescriptor_derive_channel_signer(int64_t this_arg, int64_t signer_provider) { + LDKHTLCDescriptor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NetworkGraph_remove_stale_channels_and_tracking_with_time(&this_arg_conv, current_time_unix); + void* signer_provider_ptr = untag_ptr(signer_provider); + if (ptr_is_owned(signer_provider)) { CHECK_ACCESS(signer_provider_ptr); } + LDKSignerProvider* signer_provider_conv = (LDKSignerProvider*)signer_provider_ptr; + LDKEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner"); + *ret_ret = HTLCDescriptor_derive_channel_signer(&this_arg_conv, signer_provider_conv); + return tag_ptr(ret_ret, true); } -int64_t CS_LDK_NetworkGraph_update_channel(int64_t this_arg, int64_t msg) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelUpdate msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_update_channel(&this_arg_conv, &msg_conv); - return tag_ptr(ret_conv, true); +void CS_LDK_ChannelSigner_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); + LDKChannelSigner this_ptr_conv = *(LDKChannelSigner*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + ChannelSigner_free(this_ptr_conv); } -int64_t CS_LDK_NetworkGraph_update_channel_unsigned(int64_t this_arg, int64_t msg) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKUnsignedChannelUpdate msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_update_channel_unsigned(&this_arg_conv, &msg_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_NetworkGraph_verify_channel_update(int64_t this_arg, int64_t msg) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelUpdate msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_verify_channel_update(&this_arg_conv, &msg_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_ReadOnlyNetworkGraph_channel(int64_t this_arg, int64_t short_channel_id) { - LDKReadOnlyNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelInfo ret_var = ReadOnlyNetworkGraph_channel(&this_arg_conv, short_channel_id); - int64_t ret_ref = 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_ReadOnlyNetworkGraph_list_channels(int64_t this_arg) { - LDKReadOnlyNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_u64Z ret_var = ReadOnlyNetworkGraph_list_channels(&this_arg_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t g = 0; g < ret_var.datalen; g++) { - int64_t ret_conv_6_conv = ret_var.data[g]; - ret_arr_ptr[g] = ret_conv_6_conv; - } - - FREE(ret_var.data); - return ret_arr; -} - -int64_t CS_LDK_ReadOnlyNetworkGraph_node(int64_t this_arg, int64_t node_id) { - LDKReadOnlyNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId node_id_conv; - node_id_conv.inner = untag_ptr(node_id); - node_id_conv.is_owned = ptr_is_owned(node_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); - node_id_conv.is_owned = false; - LDKNodeInfo ret_var = ReadOnlyNetworkGraph_node(&this_arg_conv, &node_id_conv); - int64_t ret_ref = 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_ReadOnlyNetworkGraph_list_nodes(int64_t this_arg) { - LDKReadOnlyNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_NodeIdZ ret_var = ReadOnlyNetworkGraph_list_nodes(&this_arg_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t i = 0; i < ret_var.datalen; i++) { - LDKNodeId ret_conv_8_var = ret_var.data[i]; - int64_t ret_conv_8_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_8_var); - ret_conv_8_ref = tag_ptr(ret_conv_8_var.inner, ret_conv_8_var.is_owned); - ret_arr_ptr[i] = ret_conv_8_ref; - } - - FREE(ret_var.data); - return ret_arr; -} - -int64_t CS_LDK_ReadOnlyNetworkGraph_get_addresses(int64_t this_arg, int8_tArray pubkey) { - LDKReadOnlyNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPublicKey pubkey_ref; - CHECK(pubkey->arr_len == 33); - memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); FREE(pubkey); - LDKCOption_CVec_SocketAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_SocketAddressZZ), "LDKCOption_CVec_SocketAddressZZ"); - *ret_copy = ReadOnlyNetworkGraph_get_addresses(&this_arg_conv, pubkey_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -void CS_LDK_DefaultRouter_free(int64_t this_obj) { - LDKDefaultRouter this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - DefaultRouter_free(this_obj_conv); -} - -int64_t CS_LDK_DefaultRouter_new(int64_t network_graph, int64_t logger, int64_t entropy_source, int64_t scorer, int64_t score_params) { - LDKNetworkGraph network_graph_conv; - network_graph_conv.inner = untag_ptr(network_graph); - network_graph_conv.is_owned = ptr_is_owned(network_graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - network_graph_conv.is_owned = false; - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - void* scorer_ptr = untag_ptr(scorer); - CHECK_ACCESS(scorer_ptr); - LDKLockableScore scorer_conv = *(LDKLockableScore*)(scorer_ptr); - if (scorer_conv.free == LDKLockableScore_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLockableScore_JCalls_cloned(&scorer_conv); - } - LDKProbabilisticScoringFeeParameters score_params_conv; - score_params_conv.inner = untag_ptr(score_params); - score_params_conv.is_owned = ptr_is_owned(score_params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(score_params_conv); - score_params_conv = ProbabilisticScoringFeeParameters_clone(&score_params_conv); - LDKDefaultRouter ret_var = DefaultRouter_new(&network_graph_conv, logger_conv, entropy_source_conv, scorer_conv, score_params_conv); - int64_t ret_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_Recipient_clone(int64_t orig) { + LDKRecipient* orig_conv = (LDKRecipient*)untag_ptr(orig); + int32_t ret_conv = LDKRecipient_to_cs(Recipient_clone(orig_conv)); + return ret_conv; } -int64_t CS_LDK_DefaultRouter_as_Router(int64_t this_arg) { - LDKDefaultRouter this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKRouter* ret_ret = MALLOC(sizeof(LDKRouter), "LDKRouter"); - *ret_ret = DefaultRouter_as_Router(&this_arg_conv); - return tag_ptr(ret_ret, true); +int32_t CS_LDK_Recipient_node() { + int32_t ret_conv = LDKRecipient_to_cs(Recipient_node()); + return ret_conv; } -int64_t CS_LDK_DefaultRouter_as_MessageRouter(int64_t this_arg) { - LDKDefaultRouter this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKMessageRouter* ret_ret = MALLOC(sizeof(LDKMessageRouter), "LDKMessageRouter"); - *ret_ret = DefaultRouter_as_MessageRouter(&this_arg_conv); - return tag_ptr(ret_ret, true); +int32_t CS_LDK_Recipient_phantom_node() { + int32_t ret_conv = LDKRecipient_to_cs(Recipient_phantom_node()); + return ret_conv; } -void CS_LDK_Router_free(int64_t this_ptr) { +void CS_LDK_EntropySource_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); - LDKRouter this_ptr_conv = *(LDKRouter*)(this_ptr_ptr); + LDKEntropySource this_ptr_conv = *(LDKEntropySource*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - Router_free(this_ptr_conv); -} - -void CS_LDK_ScorerAccountingForInFlightHtlcs_free(int64_t this_obj) { - LDKScorerAccountingForInFlightHtlcs this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ScorerAccountingForInFlightHtlcs_free(this_obj_conv); -} - -int64_t CS_LDK_ScorerAccountingForInFlightHtlcs_new(int64_t scorer, int64_t inflight_htlcs) { - void* scorer_ptr = untag_ptr(scorer); - CHECK_ACCESS(scorer_ptr); - LDKScoreLookUp scorer_conv = *(LDKScoreLookUp*)(scorer_ptr); - if (scorer_conv.free == LDKScoreLookUp_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKScoreLookUp_JCalls_cloned(&scorer_conv); - } - LDKInFlightHtlcs inflight_htlcs_conv; - inflight_htlcs_conv.inner = untag_ptr(inflight_htlcs); - inflight_htlcs_conv.is_owned = ptr_is_owned(inflight_htlcs); - CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_conv); - inflight_htlcs_conv.is_owned = false; - LDKScorerAccountingForInFlightHtlcs ret_var = ScorerAccountingForInFlightHtlcs_new(scorer_conv, &inflight_htlcs_conv); - int64_t ret_ref = 0; - 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_ScorerAccountingForInFlightHtlcs_as_ScoreLookUp(int64_t this_arg) { - LDKScorerAccountingForInFlightHtlcs this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKScoreLookUp* ret_ret = MALLOC(sizeof(LDKScoreLookUp), "LDKScoreLookUp"); - *ret_ret = ScorerAccountingForInFlightHtlcs_as_ScoreLookUp(&this_arg_conv); - return tag_ptr(ret_ret, true); -} - -void CS_LDK_InFlightHtlcs_free(int64_t this_obj) { - LDKInFlightHtlcs this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InFlightHtlcs_free(this_obj_conv); -} - -static inline uint64_t InFlightHtlcs_clone_ptr(LDKInFlightHtlcs *NONNULL_PTR arg) { - LDKInFlightHtlcs ret_var = InFlightHtlcs_clone(arg); - int64_t ret_ref = 0; - 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_InFlightHtlcs_clone_ptr(int64_t arg) { - LDKInFlightHtlcs arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = InFlightHtlcs_clone_ptr(&arg_conv); - return ret_conv; -} - -int64_t CS_LDK_InFlightHtlcs_clone(int64_t orig) { - LDKInFlightHtlcs orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKInFlightHtlcs ret_var = InFlightHtlcs_clone(&orig_conv); - int64_t ret_ref = 0; - 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_InFlightHtlcs_new() { - LDKInFlightHtlcs ret_var = InFlightHtlcs_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; -} - -void CS_LDK_InFlightHtlcs_process_path(int64_t this_arg, int64_t path, int8_tArray payer_node_id) { - LDKInFlightHtlcs this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPath path_conv; - path_conv.inner = untag_ptr(path); - path_conv.is_owned = ptr_is_owned(path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); - path_conv.is_owned = false; - LDKPublicKey payer_node_id_ref; - CHECK(payer_node_id->arr_len == 33); - memcpy(payer_node_id_ref.compressed_form, payer_node_id->elems, 33); FREE(payer_node_id); - InFlightHtlcs_process_path(&this_arg_conv, &path_conv, payer_node_id_ref); + EntropySource_free(this_ptr_conv); } -void CS_LDK_InFlightHtlcs_add_inflight_htlc(int64_t this_arg, int64_t source, int64_t target, int64_t channel_scid, int64_t used_msat) { - LDKInFlightHtlcs this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId source_conv; - source_conv.inner = untag_ptr(source); - source_conv.is_owned = ptr_is_owned(source); - CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv); - source_conv.is_owned = false; - LDKNodeId target_conv; - target_conv.inner = untag_ptr(target); - target_conv.is_owned = ptr_is_owned(target); - CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); - target_conv.is_owned = false; - InFlightHtlcs_add_inflight_htlc(&this_arg_conv, &source_conv, &target_conv, channel_scid, used_msat); +void CS_LDK_NodeSigner_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); + LDKNodeSigner this_ptr_conv = *(LDKNodeSigner*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + NodeSigner_free(this_ptr_conv); } -int64_t CS_LDK_InFlightHtlcs_used_liquidity_msat(int64_t this_arg, int64_t source, int64_t target, int64_t channel_scid) { - LDKInFlightHtlcs this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId source_conv; - source_conv.inner = untag_ptr(source); - source_conv.is_owned = ptr_is_owned(source); - CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv); - source_conv.is_owned = false; - LDKNodeId target_conv; - target_conv.inner = untag_ptr(target); - target_conv.is_owned = ptr_is_owned(target); - CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); - target_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = InFlightHtlcs_used_liquidity_msat(&this_arg_conv, &source_conv, &target_conv, channel_scid); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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); } -int8_tArray CS_LDK_InFlightHtlcs_write(int64_t obj) { - LDKInFlightHtlcs obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = InFlightHtlcs_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +void CS_LDK_SignerProvider_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); + LDKSignerProvider this_ptr_conv = *(LDKSignerProvider*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + SignerProvider_free(this_ptr_conv); } -int64_t CS_LDK_InFlightHtlcs_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ"); - *ret_conv = InFlightHtlcs_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void 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_RouteHop_free(int64_t this_obj) { - LDKRouteHop this_obj_conv; +void CS_LDK_InMemorySigner_free(int64_t this_obj) { + LDKInMemorySigner this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - RouteHop_free(this_obj_conv); + InMemorySigner_free(this_obj_conv); } -int8_tArray CS_LDK_RouteHop_get_pubkey(int64_t this_ptr) { - LDKRouteHop this_ptr_conv; +int8_tArray CS_LDK_InMemorySigner_get_funding_key(int64_t this_ptr) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, RouteHop_get_pubkey(&this_ptr_conv).compressed_form, 33); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *InMemorySigner_get_funding_key(&this_ptr_conv), 32); return ret_arr; } -void CS_LDK_RouteHop_set_pubkey(int64_t this_ptr, int8_tArray val) { - LDKRouteHop this_ptr_conv; +void CS_LDK_InMemorySigner_set_funding_key(int64_t this_ptr, int8_tArray val) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - RouteHop_set_pubkey(&this_ptr_conv, val_ref); + LDKSecretKey val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.bytes, val->elems, 32); FREE(val); + InMemorySigner_set_funding_key(&this_ptr_conv, val_ref); } -int64_t CS_LDK_RouteHop_get_node_features(int64_t this_ptr) { - LDKRouteHop this_ptr_conv; +int8_tArray CS_LDK_InMemorySigner_get_revocation_base_key(int64_t this_ptr) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeFeatures ret_var = RouteHop_get_node_features(&this_ptr_conv); - int64_t ret_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 ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *InMemorySigner_get_revocation_base_key(&this_ptr_conv), 32); + return ret_arr; } -void CS_LDK_RouteHop_set_node_features(int64_t this_ptr, int64_t val) { - LDKRouteHop this_ptr_conv; +void CS_LDK_InMemorySigner_set_revocation_base_key(int64_t this_ptr, int8_tArray val) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeFeatures val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = NodeFeatures_clone(&val_conv); - RouteHop_set_node_features(&this_ptr_conv, val_conv); + LDKSecretKey val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.bytes, val->elems, 32); FREE(val); + InMemorySigner_set_revocation_base_key(&this_ptr_conv, val_ref); } -int64_t CS_LDK_RouteHop_get_short_channel_id(int64_t this_ptr) { - LDKRouteHop this_ptr_conv; +int8_tArray CS_LDK_InMemorySigner_get_payment_key(int64_t this_ptr) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = RouteHop_get_short_channel_id(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *InMemorySigner_get_payment_key(&this_ptr_conv), 32); + return ret_arr; } -void CS_LDK_RouteHop_set_short_channel_id(int64_t this_ptr, int64_t val) { - LDKRouteHop this_ptr_conv; +void CS_LDK_InMemorySigner_set_payment_key(int64_t this_ptr, int8_tArray val) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - RouteHop_set_short_channel_id(&this_ptr_conv, val); + LDKSecretKey val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.bytes, val->elems, 32); FREE(val); + InMemorySigner_set_payment_key(&this_ptr_conv, val_ref); } -int64_t CS_LDK_RouteHop_get_channel_features(int64_t this_ptr) { - LDKRouteHop this_ptr_conv; +int8_tArray CS_LDK_InMemorySigner_get_delayed_payment_base_key(int64_t this_ptr) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelFeatures ret_var = RouteHop_get_channel_features(&this_ptr_conv); - int64_t ret_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 ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *InMemorySigner_get_delayed_payment_base_key(&this_ptr_conv), 32); + return ret_arr; } -void CS_LDK_RouteHop_set_channel_features(int64_t this_ptr, int64_t val) { - LDKRouteHop this_ptr_conv; +void CS_LDK_InMemorySigner_set_delayed_payment_base_key(int64_t this_ptr, int8_tArray val) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelFeatures val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelFeatures_clone(&val_conv); - RouteHop_set_channel_features(&this_ptr_conv, val_conv); + LDKSecretKey val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.bytes, val->elems, 32); FREE(val); + InMemorySigner_set_delayed_payment_base_key(&this_ptr_conv, val_ref); } -int64_t CS_LDK_RouteHop_get_fee_msat(int64_t this_ptr) { - LDKRouteHop this_ptr_conv; +int8_tArray CS_LDK_InMemorySigner_get_htlc_base_key(int64_t this_ptr) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = RouteHop_get_fee_msat(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *InMemorySigner_get_htlc_base_key(&this_ptr_conv), 32); + return ret_arr; } -void CS_LDK_RouteHop_set_fee_msat(int64_t this_ptr, int64_t val) { - LDKRouteHop this_ptr_conv; +void CS_LDK_InMemorySigner_set_htlc_base_key(int64_t this_ptr, int8_tArray val) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - RouteHop_set_fee_msat(&this_ptr_conv, val); + LDKSecretKey val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.bytes, val->elems, 32); FREE(val); + InMemorySigner_set_htlc_base_key(&this_ptr_conv, val_ref); } -int32_t CS_LDK_RouteHop_get_cltv_expiry_delta(int64_t this_ptr) { - LDKRouteHop this_ptr_conv; +int8_tArray CS_LDK_InMemorySigner_get_commitment_seed(int64_t this_ptr) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int32_t ret_conv = RouteHop_get_cltv_expiry_delta(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *InMemorySigner_get_commitment_seed(&this_ptr_conv), 32); + return ret_arr; } -void CS_LDK_RouteHop_set_cltv_expiry_delta(int64_t this_ptr, int32_t val) { - LDKRouteHop this_ptr_conv; +void CS_LDK_InMemorySigner_set_commitment_seed(int64_t this_ptr, int8_tArray val) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - RouteHop_set_cltv_expiry_delta(&this_ptr_conv, val); + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + InMemorySigner_set_commitment_seed(&this_ptr_conv, val_ref); } -jboolean CS_LDK_RouteHop_get_maybe_announced_channel(int64_t this_ptr) { - LDKRouteHop this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - jboolean ret_conv = RouteHop_get_maybe_announced_channel(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_RouteHop_set_maybe_announced_channel(int64_t this_ptr, jboolean val) { - LDKRouteHop this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - RouteHop_set_maybe_announced_channel(&this_ptr_conv, val); -} - -int64_t CS_LDK_RouteHop_new(int8_tArray pubkey_arg, int64_t node_features_arg, int64_t short_channel_id_arg, int64_t channel_features_arg, int64_t fee_msat_arg, int32_t cltv_expiry_delta_arg, jboolean maybe_announced_channel_arg) { - LDKPublicKey pubkey_arg_ref; - CHECK(pubkey_arg->arr_len == 33); - memcpy(pubkey_arg_ref.compressed_form, pubkey_arg->elems, 33); FREE(pubkey_arg); - LDKNodeFeatures node_features_arg_conv; - node_features_arg_conv.inner = untag_ptr(node_features_arg); - node_features_arg_conv.is_owned = ptr_is_owned(node_features_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(node_features_arg_conv); - node_features_arg_conv = NodeFeatures_clone(&node_features_arg_conv); - LDKChannelFeatures channel_features_arg_conv; - channel_features_arg_conv.inner = untag_ptr(channel_features_arg); - channel_features_arg_conv.is_owned = ptr_is_owned(channel_features_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_features_arg_conv); - channel_features_arg_conv = ChannelFeatures_clone(&channel_features_arg_conv); - LDKRouteHop ret_var = RouteHop_new(pubkey_arg_ref, node_features_arg_conv, short_channel_id_arg, channel_features_arg_conv, fee_msat_arg, cltv_expiry_delta_arg, maybe_announced_channel_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 RouteHop_clone_ptr(LDKRouteHop *NONNULL_PTR arg) { - LDKRouteHop ret_var = RouteHop_clone(arg); +static inline uint64_t InMemorySigner_clone_ptr(LDKInMemorySigner *NONNULL_PTR arg) { + LDKInMemorySigner ret_var = InMemorySigner_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_RouteHop_clone_ptr(int64_t arg) { - LDKRouteHop arg_conv; +int64_t CS_LDK_InMemorySigner_clone_ptr(int64_t arg) { + LDKInMemorySigner arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = RouteHop_clone_ptr(&arg_conv); + int64_t ret_conv = InMemorySigner_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_RouteHop_clone(int64_t orig) { - LDKRouteHop orig_conv; +int64_t CS_LDK_InMemorySigner_clone(int64_t orig) { + LDKInMemorySigner orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKRouteHop ret_var = RouteHop_clone(&orig_conv); + LDKInMemorySigner ret_var = InMemorySigner_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_RouteHop_hash(int64_t o) { - LDKRouteHop o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = RouteHop_hash(&o_conv); - return ret_conv; -} - -jboolean CS_LDK_RouteHop_eq(int64_t a, int64_t b) { - LDKRouteHop a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKRouteHop b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = RouteHop_eq(&a_conv, &b_conv); - return ret_conv; -} - -int8_tArray CS_LDK_RouteHop_write(int64_t obj) { - LDKRouteHop obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = RouteHop_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -int64_t CS_LDK_RouteHop_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); - *ret_conv = RouteHop_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -void CS_LDK_BlindedTail_free(int64_t this_obj) { - LDKBlindedTail this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BlindedTail_free(this_obj_conv); -} - -int64_tArray CS_LDK_BlindedTail_get_hops(int64_t this_ptr) { - LDKBlindedTail this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_BlindedHopZ ret_var = BlindedTail_get_hops(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t m = 0; m < ret_var.datalen; m++) { - LDKBlindedHop ret_conv_12_var = ret_var.data[m]; - int64_t ret_conv_12_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_var); - ret_conv_12_ref = tag_ptr(ret_conv_12_var.inner, ret_conv_12_var.is_owned); - ret_arr_ptr[m] = ret_conv_12_ref; - } - - FREE(ret_var.data); - return ret_arr; -} - -void CS_LDK_BlindedTail_set_hops(int64_t this_ptr, int64_tArray val) { - LDKBlindedTail this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_BlindedHopZ val_constr; - val_constr.datalen = val->arr_len; - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKBlindedHop), "LDKCVec_BlindedHopZ Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = val->elems; - for (size_t m = 0; m < val_constr.datalen; m++) { - int64_t val_conv_12 = val_vals[m]; - LDKBlindedHop val_conv_12_conv; - val_conv_12_conv.inner = untag_ptr(val_conv_12); - val_conv_12_conv.is_owned = ptr_is_owned(val_conv_12); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_12_conv); - val_conv_12_conv = BlindedHop_clone(&val_conv_12_conv); - val_constr.data[m] = val_conv_12_conv; - } - FREE(val); - BlindedTail_set_hops(&this_ptr_conv, val_constr); -} - -int8_tArray CS_LDK_BlindedTail_get_blinding_point(int64_t this_ptr) { - LDKBlindedTail this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, BlindedTail_get_blinding_point(&this_ptr_conv).compressed_form, 33); - return ret_arr; -} - -void CS_LDK_BlindedTail_set_blinding_point(int64_t this_ptr, int8_tArray val) { - LDKBlindedTail this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - BlindedTail_set_blinding_point(&this_ptr_conv, val_ref); +int64_t CS_LDK_InMemorySigner_new(int8_tArray funding_key, int8_tArray revocation_base_key, int8_tArray payment_key, int8_tArray delayed_payment_base_key, int8_tArray htlc_base_key, int8_tArray commitment_seed, int64_t channel_value_satoshis, int8_tArray channel_keys_id, int8_tArray rand_bytes_unique_start) { + LDKSecretKey funding_key_ref; + CHECK(funding_key->arr_len == 32); + memcpy(funding_key_ref.bytes, funding_key->elems, 32); FREE(funding_key); + LDKSecretKey revocation_base_key_ref; + CHECK(revocation_base_key->arr_len == 32); + memcpy(revocation_base_key_ref.bytes, revocation_base_key->elems, 32); FREE(revocation_base_key); + LDKSecretKey payment_key_ref; + CHECK(payment_key->arr_len == 32); + memcpy(payment_key_ref.bytes, payment_key->elems, 32); FREE(payment_key); + LDKSecretKey delayed_payment_base_key_ref; + CHECK(delayed_payment_base_key->arr_len == 32); + memcpy(delayed_payment_base_key_ref.bytes, delayed_payment_base_key->elems, 32); FREE(delayed_payment_base_key); + LDKSecretKey htlc_base_key_ref; + CHECK(htlc_base_key->arr_len == 32); + memcpy(htlc_base_key_ref.bytes, htlc_base_key->elems, 32); FREE(htlc_base_key); + LDKThirtyTwoBytes commitment_seed_ref; + CHECK(commitment_seed->arr_len == 32); + memcpy(commitment_seed_ref.data, commitment_seed->elems, 32); FREE(commitment_seed); + LDKThirtyTwoBytes channel_keys_id_ref; + CHECK(channel_keys_id->arr_len == 32); + memcpy(channel_keys_id_ref.data, channel_keys_id->elems, 32); FREE(channel_keys_id); + LDKThirtyTwoBytes rand_bytes_unique_start_ref; + CHECK(rand_bytes_unique_start->arr_len == 32); + memcpy(rand_bytes_unique_start_ref.data, rand_bytes_unique_start->elems, 32); FREE(rand_bytes_unique_start); + LDKInMemorySigner ret_var = InMemorySigner_new(funding_key_ref, revocation_base_key_ref, payment_key_ref, delayed_payment_base_key_ref, htlc_base_key_ref, commitment_seed_ref, channel_value_satoshis, channel_keys_id_ref, rand_bytes_unique_start_ref); + int64_t ret_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_BlindedTail_get_excess_final_cltv_expiry_delta(int64_t this_ptr) { - LDKBlindedTail this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int32_t ret_conv = BlindedTail_get_excess_final_cltv_expiry_delta(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_InMemorySigner_counterparty_pubkeys(int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelPublicKeys ret_var = InMemorySigner_counterparty_pubkeys(&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_BlindedTail_set_excess_final_cltv_expiry_delta(int64_t this_ptr, int32_t val) { - LDKBlindedTail this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - BlindedTail_set_excess_final_cltv_expiry_delta(&this_ptr_conv, val); +int64_t CS_LDK_InMemorySigner_counterparty_selected_contest_delay(int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); + *ret_copy = InMemorySigner_counterparty_selected_contest_delay(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_BlindedTail_get_final_value_msat(int64_t this_ptr) { - LDKBlindedTail this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = BlindedTail_get_final_value_msat(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_InMemorySigner_holder_selected_contest_delay(int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); + *ret_copy = InMemorySigner_holder_selected_contest_delay(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_BlindedTail_set_final_value_msat(int64_t this_ptr, int64_t val) { - LDKBlindedTail this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - BlindedTail_set_final_value_msat(&this_ptr_conv, val); +int64_t CS_LDK_InMemorySigner_is_outbound(int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCOption_boolZ *ret_copy = MALLOC(sizeof(LDKCOption_boolZ), "LDKCOption_boolZ"); + *ret_copy = InMemorySigner_is_outbound(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_BlindedTail_new(int64_tArray hops_arg, int8_tArray blinding_point_arg, int32_t excess_final_cltv_expiry_delta_arg, int64_t final_value_msat_arg) { - LDKCVec_BlindedHopZ hops_arg_constr; - hops_arg_constr.datalen = hops_arg->arr_len; - if (hops_arg_constr.datalen > 0) - hops_arg_constr.data = MALLOC(hops_arg_constr.datalen * sizeof(LDKBlindedHop), "LDKCVec_BlindedHopZ Elements"); - else - hops_arg_constr.data = NULL; - int64_t* hops_arg_vals = hops_arg->elems; - for (size_t m = 0; m < hops_arg_constr.datalen; m++) { - int64_t hops_arg_conv_12 = hops_arg_vals[m]; - LDKBlindedHop hops_arg_conv_12_conv; - hops_arg_conv_12_conv.inner = untag_ptr(hops_arg_conv_12); - hops_arg_conv_12_conv.is_owned = ptr_is_owned(hops_arg_conv_12); - CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_arg_conv_12_conv); - hops_arg_conv_12_conv = BlindedHop_clone(&hops_arg_conv_12_conv); - hops_arg_constr.data[m] = hops_arg_conv_12_conv; - } - FREE(hops_arg); - LDKPublicKey blinding_point_arg_ref; - CHECK(blinding_point_arg->arr_len == 33); - memcpy(blinding_point_arg_ref.compressed_form, blinding_point_arg->elems, 33); FREE(blinding_point_arg); - LDKBlindedTail ret_var = BlindedTail_new(hops_arg_constr, blinding_point_arg_ref, excess_final_cltv_expiry_delta_arg, final_value_msat_arg); +int64_t CS_LDK_InMemorySigner_funding_outpoint(int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKOutPoint ret_var = InMemorySigner_funding_outpoint(&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; } -static inline uint64_t BlindedTail_clone_ptr(LDKBlindedTail *NONNULL_PTR arg) { - LDKBlindedTail ret_var = BlindedTail_clone(arg); +int64_t CS_LDK_InMemorySigner_get_channel_parameters(int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelTransactionParameters ret_var = InMemorySigner_get_channel_parameters(&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_BlindedTail_clone_ptr(int64_t arg) { - LDKBlindedTail arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = BlindedTail_clone_ptr(&arg_conv); - return ret_conv; -} -int64_t CS_LDK_BlindedTail_clone(int64_t orig) { - LDKBlindedTail orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKBlindedTail ret_var = BlindedTail_clone(&orig_conv); +int64_t CS_LDK_InMemorySigner_channel_type_features(int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelTypeFeatures ret_var = InMemorySigner_channel_type_features(&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_BlindedTail_hash(int64_t o) { - LDKBlindedTail o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = BlindedTail_hash(&o_conv); - return ret_conv; +int64_t CS_LDK_InMemorySigner_sign_counterparty_payment_input(int64_t this_arg, int8_tArray spend_tx, int64_t input_idx, int64_t descriptor) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKTransaction spend_tx_ref; + spend_tx_ref.datalen = spend_tx->arr_len; + spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); + memcpy(spend_tx_ref.data, spend_tx->elems, spend_tx_ref.datalen); FREE(spend_tx); + spend_tx_ref.data_is_owned = true; + LDKStaticPaymentOutputDescriptor descriptor_conv; + descriptor_conv.inner = untag_ptr(descriptor); + descriptor_conv.is_owned = ptr_is_owned(descriptor); + CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); + descriptor_conv.is_owned = false; + LDKCResult_WitnessNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_WitnessNoneZ), "LDKCResult_WitnessNoneZ"); + *ret_conv = InMemorySigner_sign_counterparty_payment_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_BlindedTail_eq(int64_t a, int64_t b) { - LDKBlindedTail a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKBlindedTail b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = BlindedTail_eq(&a_conv, &b_conv); - return ret_conv; +int64_t CS_LDK_InMemorySigner_sign_dynamic_p2wsh_input(int64_t this_arg, int8_tArray spend_tx, int64_t input_idx, int64_t descriptor) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKTransaction spend_tx_ref; + spend_tx_ref.datalen = spend_tx->arr_len; + spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); + memcpy(spend_tx_ref.data, spend_tx->elems, spend_tx_ref.datalen); FREE(spend_tx); + spend_tx_ref.data_is_owned = true; + LDKDelayedPaymentOutputDescriptor descriptor_conv; + descriptor_conv.inner = untag_ptr(descriptor); + descriptor_conv.is_owned = ptr_is_owned(descriptor); + CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); + descriptor_conv.is_owned = false; + LDKCResult_WitnessNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_WitnessNoneZ), "LDKCResult_WitnessNoneZ"); + *ret_conv = InMemorySigner_sign_dynamic_p2wsh_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); + return tag_ptr(ret_conv, true); } -int8_tArray CS_LDK_BlindedTail_write(int64_t obj) { - LDKBlindedTail obj_conv; +int64_t CS_LDK_InMemorySigner_as_EntropySource(int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource"); + *ret_ret = InMemorySigner_as_EntropySource(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +int64_t CS_LDK_InMemorySigner_as_ChannelSigner(int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelSigner* ret_ret = MALLOC(sizeof(LDKChannelSigner), "LDKChannelSigner"); + *ret_ret = InMemorySigner_as_ChannelSigner(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +int64_t CS_LDK_InMemorySigner_as_EcdsaChannelSigner(int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner"); + *ret_ret = InMemorySigner_as_EcdsaChannelSigner(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +int8_tArray CS_LDK_InMemorySigner_write(int64_t obj) { + LDKInMemorySigner 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 = BlindedTail_write(&obj_conv); + LDKCVec_u8Z ret_var = InMemorySigner_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_BlindedTail_read(int8_tArray ser) { +int64_t CS_LDK_InMemorySigner_read(int8_tArray ser, int64_t arg) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_BlindedTailDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedTailDecodeErrorZ), "LDKCResult_BlindedTailDecodeErrorZ"); - *ret_conv = BlindedTail_read(ser_ref); + void* arg_ptr = untag_ptr(arg); + CHECK_ACCESS(arg_ptr); + LDKEntropySource arg_conv = *(LDKEntropySource*)(arg_ptr); + if (arg_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&arg_conv); + } + LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); + *ret_conv = InMemorySigner_read(ser_ref, arg_conv); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_Path_free(int64_t this_obj) { - LDKPath this_obj_conv; +void CS_LDK_KeysManager_free(int64_t this_obj) { + LDKKeysManager this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Path_free(this_obj_conv); + KeysManager_free(this_obj_conv); } -int64_tArray CS_LDK_Path_get_hops(int64_t this_ptr) { - LDKPath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_RouteHopZ ret_var = Path_get_hops(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t k = 0; k < ret_var.datalen; k++) { - LDKRouteHop 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; - } - - FREE(ret_var.data); +int64_t CS_LDK_KeysManager_new(int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos) { + uint8_t seed_arr[32]; + CHECK(seed->arr_len == 32); + memcpy(seed_arr, seed->elems, 32); FREE(seed); + uint8_t (*seed_ref)[32] = &seed_arr; + LDKKeysManager ret_var = KeysManager_new(seed_ref, starting_time_secs, starting_time_nanos); + int64_t ret_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_KeysManager_get_node_secret_key(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; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, KeysManager_get_node_secret_key(&this_arg_conv).bytes, 32); return ret_arr; } -void CS_LDK_Path_set_hops(int64_t this_ptr, int64_tArray val) { - LDKPath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_RouteHopZ val_constr; - val_constr.datalen = val->arr_len; - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = val->elems; - for (size_t k = 0; k < val_constr.datalen; k++) { - int64_t val_conv_10 = val_vals[k]; - LDKRouteHop val_conv_10_conv; - val_conv_10_conv.inner = untag_ptr(val_conv_10); - val_conv_10_conv.is_owned = ptr_is_owned(val_conv_10); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_10_conv); - val_conv_10_conv = RouteHop_clone(&val_conv_10_conv); - val_constr.data[k] = val_conv_10_conv; - } - FREE(val); - Path_set_hops(&this_ptr_conv, val_constr); -} - -int64_t CS_LDK_Path_get_blinded_tail(int64_t this_ptr) { - LDKPath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKBlindedTail ret_var = Path_get_blinded_tail(&this_ptr_conv); +int64_t CS_LDK_KeysManager_derive_channel_keys(int64_t this_arg, int64_t channel_value_satoshis, int8_tArray params) { + LDKKeysManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + uint8_t params_arr[32]; + CHECK(params->arr_len == 32); + memcpy(params_arr, params->elems, 32); FREE(params); + uint8_t (*params_ref)[32] = ¶ms_arr; + LDKInMemorySigner ret_var = KeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_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; } -void CS_LDK_Path_set_blinded_tail(int64_t this_ptr, int64_t val) { - LDKPath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKBlindedTail val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = BlindedTail_clone(&val_conv); - Path_set_blinded_tail(&this_ptr_conv, val_conv); -} - -int64_t CS_LDK_Path_new(int64_tArray hops_arg, int64_t blinded_tail_arg) { - LDKCVec_RouteHopZ hops_arg_constr; - hops_arg_constr.datalen = hops_arg->arr_len; - if (hops_arg_constr.datalen > 0) - hops_arg_constr.data = MALLOC(hops_arg_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); +int64_t CS_LDK_KeysManager_sign_spendable_outputs_psbt(int64_t this_arg, int64_tArray descriptors, int8_tArray psbt) { + 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 - hops_arg_constr.data = NULL; - int64_t* hops_arg_vals = hops_arg->elems; - for (size_t k = 0; k < hops_arg_constr.datalen; k++) { - int64_t hops_arg_conv_10 = hops_arg_vals[k]; - LDKRouteHop hops_arg_conv_10_conv; - hops_arg_conv_10_conv.inner = untag_ptr(hops_arg_conv_10); - hops_arg_conv_10_conv.is_owned = ptr_is_owned(hops_arg_conv_10); - CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_arg_conv_10_conv); - hops_arg_conv_10_conv = RouteHop_clone(&hops_arg_conv_10_conv); - hops_arg_constr.data[k] = hops_arg_conv_10_conv; + 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(hops_arg); - LDKBlindedTail blinded_tail_arg_conv; - blinded_tail_arg_conv.inner = untag_ptr(blinded_tail_arg); - blinded_tail_arg_conv.is_owned = ptr_is_owned(blinded_tail_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_tail_arg_conv); - blinded_tail_arg_conv = BlindedTail_clone(&blinded_tail_arg_conv); - LDKPath ret_var = Path_new(hops_arg_constr, blinded_tail_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + FREE(descriptors); + LDKCVec_u8Z psbt_ref; + psbt_ref.datalen = psbt->arr_len; + psbt_ref.data = MALLOC(psbt_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(psbt_ref.data, psbt->elems, psbt_ref.datalen); FREE(psbt); + LDKCResult_CVec_u8ZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZNoneZ), "LDKCResult_CVec_u8ZNoneZ"); + *ret_conv = KeysManager_sign_spendable_outputs_psbt(&this_arg_conv, descriptors_constr, psbt_ref); + return tag_ptr(ret_conv, true); } -static inline uint64_t Path_clone_ptr(LDKPath *NONNULL_PTR arg) { - LDKPath ret_var = Path_clone(arg); +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; + 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_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; + 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_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; + LDKOutputSpender* ret_ret = MALLOC(sizeof(LDKOutputSpender), "LDKOutputSpender"); + *ret_ret = KeysManager_as_OutputSpender(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +int64_t CS_LDK_KeysManager_as_SignerProvider(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; + LDKSignerProvider* ret_ret = MALLOC(sizeof(LDKSignerProvider), "LDKSignerProvider"); + *ret_ret = KeysManager_as_SignerProvider(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +void CS_LDK_PhantomKeysManager_free(int64_t this_obj) { + LDKPhantomKeysManager this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + PhantomKeysManager_free(this_obj_conv); +} + +int64_t CS_LDK_PhantomKeysManager_as_EntropySource(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; + LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource"); + *ret_ret = PhantomKeysManager_as_EntropySource(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +int64_t CS_LDK_PhantomKeysManager_as_NodeSigner(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; + LDKNodeSigner* ret_ret = MALLOC(sizeof(LDKNodeSigner), "LDKNodeSigner"); + *ret_ret = PhantomKeysManager_as_NodeSigner(&this_arg_conv); + 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); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKSignerProvider* ret_ret = MALLOC(sizeof(LDKSignerProvider), "LDKSignerProvider"); + *ret_ret = PhantomKeysManager_as_SignerProvider(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +int64_t CS_LDK_PhantomKeysManager_new(int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos, int8_tArray cross_node_seed) { + uint8_t seed_arr[32]; + CHECK(seed->arr_len == 32); + memcpy(seed_arr, seed->elems, 32); FREE(seed); + uint8_t (*seed_ref)[32] = &seed_arr; + uint8_t cross_node_seed_arr[32]; + CHECK(cross_node_seed->arr_len == 32); + memcpy(cross_node_seed_arr, cross_node_seed->elems, 32); FREE(cross_node_seed); + uint8_t (*cross_node_seed_ref)[32] = &cross_node_seed_arr; + LDKPhantomKeysManager ret_var = PhantomKeysManager_new(seed_ref, starting_time_secs, starting_time_nanos, cross_node_seed_ref); int64_t ret_ref = 0; 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_Path_clone_ptr(int64_t arg) { - LDKPath arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = Path_clone_ptr(&arg_conv); - return ret_conv; -} -int64_t CS_LDK_Path_clone(int64_t orig) { - LDKPath orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKPath ret_var = Path_clone(&orig_conv); +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); + this_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 params_arr[32]; + CHECK(params->arr_len == 32); + memcpy(params_arr, params->elems, 32); FREE(params); + uint8_t (*params_ref)[32] = ¶ms_arr; + LDKInMemorySigner ret_var = PhantomKeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_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_Path_hash(int64_t o) { - LDKPath o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = Path_hash(&o_conv); - return ret_conv; -} - -jboolean CS_LDK_Path_eq(int64_t a, int64_t b) { - LDKPath a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKPath b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = Path_eq(&a_conv, &b_conv); - return ret_conv; -} - -int64_t CS_LDK_Path_fee_msat(int64_t this_arg) { - LDKPath this_arg_conv; +int8_tArray CS_LDK_PhantomKeysManager_get_node_secret_key(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; - int64_t ret_conv = Path_fee_msat(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, PhantomKeysManager_get_node_secret_key(&this_arg_conv).bytes, 32); + return ret_arr; } -int64_t CS_LDK_Path_final_value_msat(int64_t this_arg) { - LDKPath this_arg_conv; +int8_tArray CS_LDK_PhantomKeysManager_get_phantom_node_secret_key(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; - int64_t ret_conv = Path_final_value_msat(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, PhantomKeysManager_get_phantom_node_secret_key(&this_arg_conv).bytes, 32); + return ret_arr; } -int64_t CS_LDK_Path_final_cltv_expiry_delta(int64_t this_arg) { - LDKPath this_arg_conv; +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; - LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); - *ret_copy = Path_final_cltv_expiry_delta(&this_arg_conv); + LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource"); + *ret_ret = RandomBytes_as_EntropySource(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +static inline uint64_t EcdsaChannelSigner_clone_ptr(LDKEcdsaChannelSigner *NONNULL_PTR arg) { + LDKEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner"); + *ret_ret = EcdsaChannelSigner_clone(arg); + return tag_ptr(ret_ret, true); +} +int64_t CS_LDK_EcdsaChannelSigner_clone_ptr(int64_t arg) { + void* arg_ptr = untag_ptr(arg); + if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); } + LDKEcdsaChannelSigner* arg_conv = (LDKEcdsaChannelSigner*)arg_ptr; + int64_t ret_conv = EcdsaChannelSigner_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_EcdsaChannelSigner_clone(int64_t orig) { + void* orig_ptr = untag_ptr(orig); + if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); } + LDKEcdsaChannelSigner* orig_conv = (LDKEcdsaChannelSigner*)orig_ptr; + LDKEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner"); + *ret_ret = EcdsaChannelSigner_clone(orig_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); + CHECK_ACCESS(this_ptr_ptr); + LDKEcdsaChannelSigner this_ptr_conv = *(LDKEcdsaChannelSigner*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + EcdsaChannelSigner_free(this_ptr_conv); +} + +void CS_LDK_AsyncPaymentsMessageHandler_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); + LDKAsyncPaymentsMessageHandler this_ptr_conv = *(LDKAsyncPaymentsMessageHandler*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + AsyncPaymentsMessageHandler_free(this_ptr_conv); +} + +void CS_LDK_AsyncPaymentsMessage_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); + LDKAsyncPaymentsMessage this_ptr_conv = *(LDKAsyncPaymentsMessage*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + AsyncPaymentsMessage_free(this_ptr_conv); +} + +static inline uint64_t AsyncPaymentsMessage_clone_ptr(LDKAsyncPaymentsMessage *NONNULL_PTR arg) { + LDKAsyncPaymentsMessage *ret_copy = MALLOC(sizeof(LDKAsyncPaymentsMessage), "LDKAsyncPaymentsMessage"); + *ret_copy = AsyncPaymentsMessage_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } +int64_t CS_LDK_AsyncPaymentsMessage_clone_ptr(int64_t arg) { + LDKAsyncPaymentsMessage* arg_conv = (LDKAsyncPaymentsMessage*)untag_ptr(arg); + int64_t ret_conv = AsyncPaymentsMessage_clone_ptr(arg_conv); + return ret_conv; +} -void CS_LDK_Route_free(int64_t this_obj) { - LDKRoute this_obj_conv; +int64_t CS_LDK_AsyncPaymentsMessage_clone(int64_t orig) { + LDKAsyncPaymentsMessage* orig_conv = (LDKAsyncPaymentsMessage*)untag_ptr(orig); + LDKAsyncPaymentsMessage *ret_copy = MALLOC(sizeof(LDKAsyncPaymentsMessage), "LDKAsyncPaymentsMessage"); + *ret_copy = AsyncPaymentsMessage_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_AsyncPaymentsMessage_held_htlc_available(int64_t a) { + LDKHeldHtlcAvailable a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = HeldHtlcAvailable_clone(&a_conv); + LDKAsyncPaymentsMessage *ret_copy = MALLOC(sizeof(LDKAsyncPaymentsMessage), "LDKAsyncPaymentsMessage"); + *ret_copy = AsyncPaymentsMessage_held_htlc_available(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_AsyncPaymentsMessage_release_held_htlc(int64_t a) { + LDKReleaseHeldHtlc a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = ReleaseHeldHtlc_clone(&a_conv); + LDKAsyncPaymentsMessage *ret_copy = MALLOC(sizeof(LDKAsyncPaymentsMessage), "LDKAsyncPaymentsMessage"); + *ret_copy = AsyncPaymentsMessage_release_held_htlc(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_HeldHtlcAvailable_free(int64_t this_obj) { + LDKHeldHtlcAvailable this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Route_free(this_obj_conv); + HeldHtlcAvailable_free(this_obj_conv); } -int64_tArray CS_LDK_Route_get_paths(int64_t this_ptr) { - LDKRoute this_ptr_conv; +int8_tArray CS_LDK_HeldHtlcAvailable_get_payment_release_secret(int64_t this_ptr) { + LDKHeldHtlcAvailable this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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_PathZ ret_var = Route_get_paths(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t g = 0; g < ret_var.datalen; g++) { - LDKPath ret_conv_6_var = ret_var.data[g]; - int64_t ret_conv_6_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_6_var); - ret_conv_6_ref = tag_ptr(ret_conv_6_var.inner, ret_conv_6_var.is_owned); - ret_arr_ptr[g] = ret_conv_6_ref; - } - - FREE(ret_var.data); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *HeldHtlcAvailable_get_payment_release_secret(&this_ptr_conv), 32); return ret_arr; } -void CS_LDK_Route_set_paths(int64_t this_ptr, int64_tArray val) { - LDKRoute this_ptr_conv; +void CS_LDK_HeldHtlcAvailable_set_payment_release_secret(int64_t this_ptr, int8_tArray val) { + LDKHeldHtlcAvailable this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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_PathZ val_constr; - val_constr.datalen = val->arr_len; - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKPath), "LDKCVec_PathZ Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = val->elems; - for (size_t g = 0; g < val_constr.datalen; g++) { - int64_t val_conv_6 = val_vals[g]; - LDKPath val_conv_6_conv; - val_conv_6_conv.inner = untag_ptr(val_conv_6); - val_conv_6_conv.is_owned = ptr_is_owned(val_conv_6); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_6_conv); - val_conv_6_conv = Path_clone(&val_conv_6_conv); - val_constr.data[g] = val_conv_6_conv; - } - FREE(val); - Route_set_paths(&this_ptr_conv, val_constr); + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + HeldHtlcAvailable_set_payment_release_secret(&this_ptr_conv, val_ref); } -int64_t CS_LDK_Route_get_route_params(int64_t this_ptr) { - LDKRoute this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKRouteParameters ret_var = Route_get_route_params(&this_ptr_conv); +int64_t CS_LDK_HeldHtlcAvailable_new(int8_tArray payment_release_secret_arg) { + LDKThirtyTwoBytes payment_release_secret_arg_ref; + CHECK(payment_release_secret_arg->arr_len == 32); + memcpy(payment_release_secret_arg_ref.data, payment_release_secret_arg->elems, 32); FREE(payment_release_secret_arg); + LDKHeldHtlcAvailable ret_var = HeldHtlcAvailable_new(payment_release_secret_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; } -void CS_LDK_Route_set_route_params(int64_t this_ptr, int64_t val) { - LDKRoute this_ptr_conv; +static inline uint64_t HeldHtlcAvailable_clone_ptr(LDKHeldHtlcAvailable *NONNULL_PTR arg) { + LDKHeldHtlcAvailable ret_var = HeldHtlcAvailable_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_HeldHtlcAvailable_clone_ptr(int64_t arg) { + LDKHeldHtlcAvailable 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 = HeldHtlcAvailable_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_HeldHtlcAvailable_clone(int64_t orig) { + LDKHeldHtlcAvailable 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; + LDKHeldHtlcAvailable ret_var = HeldHtlcAvailable_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_ReleaseHeldHtlc_free(int64_t this_obj) { + LDKReleaseHeldHtlc this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ReleaseHeldHtlc_free(this_obj_conv); +} + +int8_tArray CS_LDK_ReleaseHeldHtlc_get_payment_release_secret(int64_t this_ptr) { + LDKReleaseHeldHtlc this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKRouteParameters 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 = RouteParameters_clone(&val_conv); - Route_set_route_params(&this_ptr_conv, val_conv); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *ReleaseHeldHtlc_get_payment_release_secret(&this_ptr_conv), 32); + return ret_arr; } -int64_t CS_LDK_Route_new(int64_tArray paths_arg, int64_t route_params_arg) { - LDKCVec_PathZ paths_arg_constr; - paths_arg_constr.datalen = paths_arg->arr_len; - if (paths_arg_constr.datalen > 0) - paths_arg_constr.data = MALLOC(paths_arg_constr.datalen * sizeof(LDKPath), "LDKCVec_PathZ Elements"); - else - paths_arg_constr.data = NULL; - int64_t* paths_arg_vals = paths_arg->elems; - for (size_t g = 0; g < paths_arg_constr.datalen; g++) { - int64_t paths_arg_conv_6 = paths_arg_vals[g]; - LDKPath paths_arg_conv_6_conv; - paths_arg_conv_6_conv.inner = untag_ptr(paths_arg_conv_6); - paths_arg_conv_6_conv.is_owned = ptr_is_owned(paths_arg_conv_6); - CHECK_INNER_FIELD_ACCESS_OR_NULL(paths_arg_conv_6_conv); - paths_arg_conv_6_conv = Path_clone(&paths_arg_conv_6_conv); - paths_arg_constr.data[g] = paths_arg_conv_6_conv; - } - FREE(paths_arg); - LDKRouteParameters route_params_arg_conv; - route_params_arg_conv.inner = untag_ptr(route_params_arg); - route_params_arg_conv.is_owned = ptr_is_owned(route_params_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_arg_conv); - route_params_arg_conv = RouteParameters_clone(&route_params_arg_conv); - LDKRoute ret_var = Route_new(paths_arg_constr, route_params_arg_conv); +void CS_LDK_ReleaseHeldHtlc_set_payment_release_secret(int64_t this_ptr, int8_tArray val) { + LDKReleaseHeldHtlc this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + ReleaseHeldHtlc_set_payment_release_secret(&this_ptr_conv, val_ref); +} + +int64_t CS_LDK_ReleaseHeldHtlc_new(int8_tArray payment_release_secret_arg) { + LDKThirtyTwoBytes payment_release_secret_arg_ref; + CHECK(payment_release_secret_arg->arr_len == 32); + memcpy(payment_release_secret_arg_ref.data, payment_release_secret_arg->elems, 32); FREE(payment_release_secret_arg); + LDKReleaseHeldHtlc ret_var = ReleaseHeldHtlc_new(payment_release_secret_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 Route_clone_ptr(LDKRoute *NONNULL_PTR arg) { - LDKRoute ret_var = Route_clone(arg); +static inline uint64_t ReleaseHeldHtlc_clone_ptr(LDKReleaseHeldHtlc *NONNULL_PTR arg) { + LDKReleaseHeldHtlc ret_var = ReleaseHeldHtlc_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_Route_clone_ptr(int64_t arg) { - LDKRoute arg_conv; +int64_t CS_LDK_ReleaseHeldHtlc_clone_ptr(int64_t arg) { + LDKReleaseHeldHtlc arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Route_clone_ptr(&arg_conv); + int64_t ret_conv = ReleaseHeldHtlc_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_Route_clone(int64_t orig) { - LDKRoute orig_conv; +int64_t CS_LDK_ReleaseHeldHtlc_clone(int64_t orig) { + LDKReleaseHeldHtlc orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKRoute ret_var = Route_clone(&orig_conv); + LDKReleaseHeldHtlc ret_var = ReleaseHeldHtlc_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_Route_hash(int64_t o) { - LDKRoute o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = Route_hash(&o_conv); - return ret_conv; +int64_t CS_LDK_ReleaseHeldHtlc_as_OnionMessageContents(int64_t this_arg) { + LDKReleaseHeldHtlc this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *ret_ret = ReleaseHeldHtlc_as_OnionMessageContents(&this_arg_conv); + return tag_ptr(ret_ret, true); } -jboolean CS_LDK_Route_eq(int64_t a, int64_t b) { - LDKRoute a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKRoute b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = Route_eq(&a_conv, &b_conv); - return ret_conv; -} - -int64_t CS_LDK_Route_get_total_fees(int64_t this_arg) { - LDKRoute this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = Route_get_total_fees(&this_arg_conv); - return ret_conv; -} - -int64_t CS_LDK_Route_get_total_amount(int64_t this_arg) { - LDKRoute this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = Route_get_total_amount(&this_arg_conv); - return ret_conv; -} - -jstring CS_LDK_Route_to_str(int64_t o) { - LDKRoute o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = Route_to_str(&o_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; -} - -int8_tArray CS_LDK_Route_write(int64_t obj) { - LDKRoute obj_conv; +int8_tArray CS_LDK_HeldHtlcAvailable_write(int64_t obj) { + LDKHeldHtlcAvailable obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = Route_write(&obj_conv); + LDKCVec_u8Z ret_var = HeldHtlcAvailable_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_Route_read(int8_tArray ser) { +int64_t CS_LDK_HeldHtlcAvailable_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); - *ret_conv = Route_read(ser_ref); + LDKCResult_HeldHtlcAvailableDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HeldHtlcAvailableDecodeErrorZ), "LDKCResult_HeldHtlcAvailableDecodeErrorZ"); + *ret_conv = HeldHtlcAvailable_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_RouteParameters_free(int64_t this_obj) { - LDKRouteParameters this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - RouteParameters_free(this_obj_conv); +int8_tArray CS_LDK_ReleaseHeldHtlc_write(int64_t obj) { + LDKReleaseHeldHtlc 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 = ReleaseHeldHtlc_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_RouteParameters_get_payment_params(int64_t this_ptr) { - LDKRouteParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPaymentParameters ret_var = RouteParameters_get_payment_params(&this_ptr_conv); - int64_t ret_ref = 0; - 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_ReleaseHeldHtlc_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReleaseHeldHtlcDecodeErrorZ), "LDKCResult_ReleaseHeldHtlcDecodeErrorZ"); + *ret_conv = ReleaseHeldHtlc_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -void CS_LDK_RouteParameters_set_payment_params(int64_t this_ptr, int64_t val) { - LDKRouteParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPaymentParameters val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = PaymentParameters_clone(&val_conv); - RouteParameters_set_payment_params(&this_ptr_conv, val_conv); +jboolean CS_LDK_AsyncPaymentsMessage_is_known_type(int64_t tlv_type) { + jboolean ret_conv = AsyncPaymentsMessage_is_known_type(tlv_type); + return ret_conv; } -int64_t CS_LDK_RouteParameters_get_final_value_msat(int64_t this_ptr) { - LDKRouteParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = RouteParameters_get_final_value_msat(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_AsyncPaymentsMessage_as_OnionMessageContents(int64_t this_arg) { + LDKAsyncPaymentsMessage* this_arg_conv = (LDKAsyncPaymentsMessage*)untag_ptr(this_arg); + LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *ret_ret = AsyncPaymentsMessage_as_OnionMessageContents(this_arg_conv); + return tag_ptr(ret_ret, true); } -void CS_LDK_RouteParameters_set_final_value_msat(int64_t this_ptr, int64_t val) { - LDKRouteParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - RouteParameters_set_final_value_msat(&this_ptr_conv, val); +int8_tArray CS_LDK_AsyncPaymentsMessage_write(int64_t obj) { + LDKAsyncPaymentsMessage* obj_conv = (LDKAsyncPaymentsMessage*)untag_ptr(obj); + LDKCVec_u8Z ret_var = AsyncPaymentsMessage_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_RouteParameters_get_max_total_routing_fee_msat(int64_t this_ptr) { - LDKRouteParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = RouteParameters_get_max_total_routing_fee_msat(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_AsyncPaymentsMessage_read(int8_tArray ser, int64_t arg) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AsyncPaymentsMessageDecodeErrorZ), "LDKCResult_AsyncPaymentsMessageDecodeErrorZ"); + *ret_conv = AsyncPaymentsMessage_read(ser_ref, arg); + FREE(ser); + return tag_ptr(ret_conv, true); } -void CS_LDK_RouteParameters_set_max_total_routing_fee_msat(int64_t this_ptr, int64_t val) { - LDKRouteParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - 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)); - RouteParameters_set_max_total_routing_fee_msat(&this_ptr_conv, val_conv); +void CS_LDK_OnionMessenger_free(int64_t this_obj) { + LDKOnionMessenger this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OnionMessenger_free(this_obj_conv); } -int64_t CS_LDK_RouteParameters_new(int64_t payment_params_arg, int64_t final_value_msat_arg, int64_t max_total_routing_fee_msat_arg) { - LDKPaymentParameters payment_params_arg_conv; - payment_params_arg_conv.inner = untag_ptr(payment_params_arg); - payment_params_arg_conv.is_owned = ptr_is_owned(payment_params_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_params_arg_conv); - payment_params_arg_conv = PaymentParameters_clone(&payment_params_arg_conv); - void* max_total_routing_fee_msat_arg_ptr = untag_ptr(max_total_routing_fee_msat_arg); - CHECK_ACCESS(max_total_routing_fee_msat_arg_ptr); - LDKCOption_u64Z max_total_routing_fee_msat_arg_conv = *(LDKCOption_u64Z*)(max_total_routing_fee_msat_arg_ptr); - max_total_routing_fee_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(max_total_routing_fee_msat_arg)); - LDKRouteParameters ret_var = RouteParameters_new(payment_params_arg_conv, final_value_msat_arg, max_total_routing_fee_msat_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_Responder_free(int64_t this_obj) { + LDKResponder this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Responder_free(this_obj_conv); } -static inline uint64_t RouteParameters_clone_ptr(LDKRouteParameters *NONNULL_PTR arg) { - LDKRouteParameters ret_var = RouteParameters_clone(arg); +static inline uint64_t Responder_clone_ptr(LDKResponder *NONNULL_PTR arg) { + LDKResponder ret_var = Responder_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_RouteParameters_clone_ptr(int64_t arg) { - LDKRouteParameters arg_conv; +int64_t CS_LDK_Responder_clone_ptr(int64_t arg) { + LDKResponder arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = RouteParameters_clone_ptr(&arg_conv); + int64_t ret_conv = Responder_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_RouteParameters_clone(int64_t orig) { - LDKRouteParameters orig_conv; +int64_t CS_LDK_Responder_clone(int64_t orig) { + LDKResponder orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKRouteParameters ret_var = RouteParameters_clone(&orig_conv); + LDKResponder ret_var = Responder_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_RouteParameters_hash(int64_t o) { - LDKRouteParameters o_conv; - 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 = RouteParameters_hash(&o_conv); - return ret_conv; -} - -jboolean CS_LDK_RouteParameters_eq(int64_t a, int64_t b) { - LDKRouteParameters a_conv; +jboolean CS_LDK_Responder_eq(int64_t a, int64_t b) { + LDKResponder a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKRouteParameters b_conv; + LDKResponder b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = RouteParameters_eq(&a_conv, &b_conv); + jboolean ret_conv = Responder_eq(&a_conv, &b_conv); return ret_conv; } -int64_t CS_LDK_RouteParameters_from_payment_params_and_value(int64_t payment_params, int64_t final_value_msat) { - LDKPaymentParameters payment_params_conv; - payment_params_conv.inner = untag_ptr(payment_params); - payment_params_conv.is_owned = ptr_is_owned(payment_params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_params_conv); - payment_params_conv = PaymentParameters_clone(&payment_params_conv); - LDKRouteParameters ret_var = RouteParameters_from_payment_params_and_value(payment_params_conv, final_value_msat); - int64_t ret_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_RouteParameters_write(int64_t obj) { - LDKRouteParameters obj_conv; +int8_tArray CS_LDK_Responder_write(int64_t obj) { + LDKResponder obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = RouteParameters_write(&obj_conv); + LDKCVec_u8Z ret_var = Responder_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_RouteParameters_read(int8_tArray ser) { +int64_t CS_LDK_Responder_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); - *ret_conv = RouteParameters_read(ser_ref); + LDKCResult_ResponderDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ResponderDecodeErrorZ), "LDKCResult_ResponderDecodeErrorZ"); + *ret_conv = Responder_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_PaymentParameters_free(int64_t this_obj) { - LDKPaymentParameters this_obj_conv; +int64_t CS_LDK_Responder_respond(int64_t this_arg) { + LDKResponder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = Responder_clone(&this_arg_conv); + LDKResponseInstruction ret_var = Responder_respond(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_Responder_respond_with_reply_path(int64_t this_arg, int64_t context) { + LDKResponder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = Responder_clone(&this_arg_conv); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKMessageContext context_conv = *(LDKMessageContext*)(context_ptr); + context_conv = MessageContext_clone((LDKMessageContext*)untag_ptr(context)); + LDKResponseInstruction ret_var = Responder_respond_with_reply_path(this_arg_conv, context_conv); + int64_t ret_ref = 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_ResponseInstruction_free(int64_t this_obj) { + LDKResponseInstruction this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PaymentParameters_free(this_obj_conv); + ResponseInstruction_free(this_obj_conv); } -int64_t CS_LDK_PaymentParameters_get_payee(int64_t this_ptr) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); - *ret_copy = PaymentParameters_get_payee(&this_ptr_conv); +static inline uint64_t ResponseInstruction_clone_ptr(LDKResponseInstruction *NONNULL_PTR arg) { + LDKResponseInstruction ret_var = ResponseInstruction_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_ResponseInstruction_clone_ptr(int64_t arg) { + LDKResponseInstruction 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 = ResponseInstruction_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_ResponseInstruction_clone(int64_t orig) { + LDKResponseInstruction 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; + LDKResponseInstruction ret_var = ResponseInstruction_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_MessageSendInstructions_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); + LDKMessageSendInstructions this_ptr_conv = *(LDKMessageSendInstructions*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + MessageSendInstructions_free(this_ptr_conv); +} + +static inline uint64_t MessageSendInstructions_clone_ptr(LDKMessageSendInstructions *NONNULL_PTR arg) { + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = MessageSendInstructions_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } +int64_t CS_LDK_MessageSendInstructions_clone_ptr(int64_t arg) { + LDKMessageSendInstructions* arg_conv = (LDKMessageSendInstructions*)untag_ptr(arg); + int64_t ret_conv = MessageSendInstructions_clone_ptr(arg_conv); + return ret_conv; +} -void CS_LDK_PaymentParameters_set_payee(int64_t this_ptr, int64_t val) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKPayee val_conv = *(LDKPayee*)(val_ptr); - val_conv = Payee_clone((LDKPayee*)untag_ptr(val)); - PaymentParameters_set_payee(&this_ptr_conv, val_conv); +int64_t CS_LDK_MessageSendInstructions_clone(int64_t orig) { + LDKMessageSendInstructions* orig_conv = (LDKMessageSendInstructions*)untag_ptr(orig); + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = MessageSendInstructions_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_PaymentParameters_get_expiry_time(int64_t this_ptr) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = PaymentParameters_get_expiry_time(&this_ptr_conv); +int64_t CS_LDK_MessageSendInstructions_with_specified_reply_path(int64_t destination, int64_t reply_path) { + void* destination_ptr = untag_ptr(destination); + CHECK_ACCESS(destination_ptr); + LDKDestination destination_conv = *(LDKDestination*)(destination_ptr); + destination_conv = Destination_clone((LDKDestination*)untag_ptr(destination)); + LDKBlindedMessagePath 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 = BlindedMessagePath_clone(&reply_path_conv); + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = MessageSendInstructions_with_specified_reply_path(destination_conv, reply_path_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void CS_LDK_PaymentParameters_set_expiry_time(int64_t this_ptr, int64_t val) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - PaymentParameters_set_expiry_time(&this_ptr_conv, val_conv); +int64_t CS_LDK_MessageSendInstructions_with_reply_path(int64_t destination, int64_t context) { + void* destination_ptr = untag_ptr(destination); + CHECK_ACCESS(destination_ptr); + LDKDestination destination_conv = *(LDKDestination*)(destination_ptr); + destination_conv = Destination_clone((LDKDestination*)untag_ptr(destination)); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKMessageContext context_conv = *(LDKMessageContext*)(context_ptr); + context_conv = MessageContext_clone((LDKMessageContext*)untag_ptr(context)); + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = MessageSendInstructions_with_reply_path(destination_conv, context_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int32_t CS_LDK_PaymentParameters_get_max_total_cltv_expiry_delta(int64_t this_ptr) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int32_t ret_conv = PaymentParameters_get_max_total_cltv_expiry_delta(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_MessageSendInstructions_without_reply_path(int64_t destination) { + void* destination_ptr = untag_ptr(destination); + CHECK_ACCESS(destination_ptr); + LDKDestination destination_conv = *(LDKDestination*)(destination_ptr); + destination_conv = Destination_clone((LDKDestination*)untag_ptr(destination)); + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = MessageSendInstructions_without_reply_path(destination_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_PaymentParameters_set_max_total_cltv_expiry_delta(int64_t this_ptr, int32_t val) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - PaymentParameters_set_max_total_cltv_expiry_delta(&this_ptr_conv, val); +int64_t CS_LDK_MessageSendInstructions_for_reply(int64_t instructions) { + LDKResponseInstruction instructions_conv; + instructions_conv.inner = untag_ptr(instructions); + instructions_conv.is_owned = ptr_is_owned(instructions); + CHECK_INNER_FIELD_ACCESS_OR_NULL(instructions_conv); + instructions_conv = ResponseInstruction_clone(&instructions_conv); + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = MessageSendInstructions_for_reply(instructions_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int8_t CS_LDK_PaymentParameters_get_max_path_count(int64_t this_ptr) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_t ret_conv = PaymentParameters_get_max_path_count(&this_ptr_conv); - return ret_conv; +void CS_LDK_MessageRouter_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); + LDKMessageRouter this_ptr_conv = *(LDKMessageRouter*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + MessageRouter_free(this_ptr_conv); } -void CS_LDK_PaymentParameters_set_max_path_count(int64_t this_ptr, int8_t val) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - PaymentParameters_set_max_path_count(&this_ptr_conv, val); +void CS_LDK_DefaultMessageRouter_free(int64_t this_obj) { + LDKDefaultMessageRouter this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + DefaultMessageRouter_free(this_obj_conv); } -int8_t CS_LDK_PaymentParameters_get_max_channel_saturation_power_of_half(int64_t this_ptr) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_t ret_conv = PaymentParameters_get_max_channel_saturation_power_of_half(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_DefaultMessageRouter_new(int64_t network_graph, int64_t entropy_source) { + LDKNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; + void* 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); + } + LDKDefaultMessageRouter ret_var = DefaultMessageRouter_new(&network_graph_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_PaymentParameters_set_max_channel_saturation_power_of_half(int64_t this_ptr, int8_t val) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - PaymentParameters_set_max_channel_saturation_power_of_half(&this_ptr_conv, val); +int64_t CS_LDK_DefaultMessageRouter_as_MessageRouter(int64_t this_arg) { + LDKDefaultMessageRouter this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKMessageRouter* ret_ret = MALLOC(sizeof(LDKMessageRouter), "LDKMessageRouter"); + *ret_ret = DefaultMessageRouter_as_MessageRouter(&this_arg_conv); + return tag_ptr(ret_ret, true); } -int64_tArray CS_LDK_PaymentParameters_get_previously_failed_channels(int64_t this_ptr) { - LDKPaymentParameters this_ptr_conv; +void CS_LDK_OnionMessagePath_free(int64_t this_obj) { + LDKOnionMessagePath this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OnionMessagePath_free(this_obj_conv); +} + +ptrArray CS_LDK_OnionMessagePath_get_intermediate_nodes(int64_t this_ptr) { + LDKOnionMessagePath this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u64Z ret_var = PaymentParameters_get_previously_failed_channels(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t g = 0; g < ret_var.datalen; g++) { - int64_t ret_conv_6_conv = ret_var.data[g]; - ret_arr_ptr[g] = ret_conv_6_conv; + LDKCVec_PublicKeyZ ret_var = OnionMessagePath_get_intermediate_nodes(&this_ptr_conv); + ptrArray ret_arr = NULL; + ret_arr = init_ptrArray(ret_var.datalen, __LINE__); + int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8); + for (size_t i = 0; i < ret_var.datalen; i++) { + int8_tArray ret_conv_8_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_conv_8_arr->elems, ret_var.data[i].compressed_form, 33); + ret_arr_ptr[i] = ret_conv_8_arr; } FREE(ret_var.data); return ret_arr; } -void CS_LDK_PaymentParameters_set_previously_failed_channels(int64_t this_ptr, int64_tArray val) { - LDKPaymentParameters this_ptr_conv; +void CS_LDK_OnionMessagePath_set_intermediate_nodes(int64_t this_ptr, ptrArray val) { + LDKOnionMessagePath this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u64Z val_constr; + LDKCVec_PublicKeyZ val_constr; val_constr.datalen = val->arr_len; if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); else val_constr.data = NULL; - int64_t* val_vals = val->elems; - for (size_t g = 0; g < val_constr.datalen; g++) { - int64_t val_conv_6 = val_vals[g]; - val_constr.data[g] = val_conv_6; + int8_tArray* val_vals = (void*) val->elems; + for (size_t i = 0; i < val_constr.datalen; i++) { + int8_tArray val_conv_8 = val_vals[i]; + LDKPublicKey val_conv_8_ref; + CHECK(val_conv_8->arr_len == 33); + memcpy(val_conv_8_ref.compressed_form, val_conv_8->elems, 33); FREE(val_conv_8); + val_constr.data[i] = val_conv_8_ref; } FREE(val); - PaymentParameters_set_previously_failed_channels(&this_ptr_conv, val_constr); + OnionMessagePath_set_intermediate_nodes(&this_ptr_conv, val_constr); } -int64_tArray CS_LDK_PaymentParameters_get_previously_failed_blinded_path_idxs(int64_t this_ptr) { - LDKPaymentParameters this_ptr_conv; +int64_t CS_LDK_OnionMessagePath_get_destination(int64_t this_ptr) { + LDKOnionMessagePath this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u64Z ret_var = PaymentParameters_get_previously_failed_blinded_path_idxs(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t g = 0; g < ret_var.datalen; g++) { - int64_t ret_conv_6_conv = ret_var.data[g]; - ret_arr_ptr[g] = ret_conv_6_conv; - } - - FREE(ret_var.data); - return ret_arr; + LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); + *ret_copy = OnionMessagePath_get_destination(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_PaymentParameters_set_previously_failed_blinded_path_idxs(int64_t this_ptr, int64_tArray val) { - LDKPaymentParameters this_ptr_conv; +void CS_LDK_OnionMessagePath_set_destination(int64_t this_ptr, int64_t val) { + LDKOnionMessagePath this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u64Z val_constr; - val_constr.datalen = val->arr_len; - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = val->elems; - for (size_t g = 0; g < val_constr.datalen; g++) { - int64_t val_conv_6 = val_vals[g]; - val_constr.data[g] = val_conv_6; - } - FREE(val); - PaymentParameters_set_previously_failed_blinded_path_idxs(&this_ptr_conv, val_constr); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKDestination val_conv = *(LDKDestination*)(val_ptr); + val_conv = Destination_clone((LDKDestination*)untag_ptr(val)); + OnionMessagePath_set_destination(&this_ptr_conv, val_conv); } -int64_t CS_LDK_PaymentParameters_new(int64_t payee_arg, int64_t expiry_time_arg, int32_t max_total_cltv_expiry_delta_arg, int8_t max_path_count_arg, int8_t max_channel_saturation_power_of_half_arg, int64_tArray previously_failed_channels_arg, int64_tArray previously_failed_blinded_path_idxs_arg) { - void* payee_arg_ptr = untag_ptr(payee_arg); - CHECK_ACCESS(payee_arg_ptr); - LDKPayee payee_arg_conv = *(LDKPayee*)(payee_arg_ptr); - payee_arg_conv = Payee_clone((LDKPayee*)untag_ptr(payee_arg)); - void* expiry_time_arg_ptr = untag_ptr(expiry_time_arg); - CHECK_ACCESS(expiry_time_arg_ptr); - LDKCOption_u64Z expiry_time_arg_conv = *(LDKCOption_u64Z*)(expiry_time_arg_ptr); - expiry_time_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(expiry_time_arg)); - LDKCVec_u64Z previously_failed_channels_arg_constr; - previously_failed_channels_arg_constr.datalen = previously_failed_channels_arg->arr_len; - if (previously_failed_channels_arg_constr.datalen > 0) - previously_failed_channels_arg_constr.data = MALLOC(previously_failed_channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); - else - previously_failed_channels_arg_constr.data = NULL; - int64_t* previously_failed_channels_arg_vals = previously_failed_channels_arg->elems; - for (size_t g = 0; g < previously_failed_channels_arg_constr.datalen; g++) { - int64_t previously_failed_channels_arg_conv_6 = previously_failed_channels_arg_vals[g]; - previously_failed_channels_arg_constr.data[g] = previously_failed_channels_arg_conv_6; - } - FREE(previously_failed_channels_arg); - LDKCVec_u64Z previously_failed_blinded_path_idxs_arg_constr; - previously_failed_blinded_path_idxs_arg_constr.datalen = previously_failed_blinded_path_idxs_arg->arr_len; - if (previously_failed_blinded_path_idxs_arg_constr.datalen > 0) - previously_failed_blinded_path_idxs_arg_constr.data = MALLOC(previously_failed_blinded_path_idxs_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); - else - previously_failed_blinded_path_idxs_arg_constr.data = NULL; - int64_t* previously_failed_blinded_path_idxs_arg_vals = previously_failed_blinded_path_idxs_arg->elems; - for (size_t g = 0; g < previously_failed_blinded_path_idxs_arg_constr.datalen; g++) { - int64_t previously_failed_blinded_path_idxs_arg_conv_6 = previously_failed_blinded_path_idxs_arg_vals[g]; - previously_failed_blinded_path_idxs_arg_constr.data[g] = previously_failed_blinded_path_idxs_arg_conv_6; +int64_t CS_LDK_OnionMessagePath_get_first_node_addresses(int64_t this_ptr) { + LDKOnionMessagePath this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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_SocketAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_SocketAddressZZ), "LDKCOption_CVec_SocketAddressZZ"); + *ret_copy = OnionMessagePath_get_first_node_addresses(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_OnionMessagePath_set_first_node_addresses(int64_t this_ptr, int64_t val) { + LDKOnionMessagePath this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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_SocketAddressZZ val_conv = *(LDKCOption_CVec_SocketAddressZZ*)(val_ptr); + val_conv = COption_CVec_SocketAddressZZ_clone((LDKCOption_CVec_SocketAddressZZ*)untag_ptr(val)); + OnionMessagePath_set_first_node_addresses(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_OnionMessagePath_new(ptrArray intermediate_nodes_arg, int64_t destination_arg, int64_t first_node_addresses_arg) { + LDKCVec_PublicKeyZ intermediate_nodes_arg_constr; + intermediate_nodes_arg_constr.datalen = intermediate_nodes_arg->arr_len; + if (intermediate_nodes_arg_constr.datalen > 0) + intermediate_nodes_arg_constr.data = MALLOC(intermediate_nodes_arg_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); + else + intermediate_nodes_arg_constr.data = NULL; + int8_tArray* intermediate_nodes_arg_vals = (void*) intermediate_nodes_arg->elems; + for (size_t i = 0; i < intermediate_nodes_arg_constr.datalen; i++) { + int8_tArray intermediate_nodes_arg_conv_8 = intermediate_nodes_arg_vals[i]; + LDKPublicKey intermediate_nodes_arg_conv_8_ref; + CHECK(intermediate_nodes_arg_conv_8->arr_len == 33); + memcpy(intermediate_nodes_arg_conv_8_ref.compressed_form, intermediate_nodes_arg_conv_8->elems, 33); FREE(intermediate_nodes_arg_conv_8); + intermediate_nodes_arg_constr.data[i] = intermediate_nodes_arg_conv_8_ref; } - FREE(previously_failed_blinded_path_idxs_arg); - LDKPaymentParameters ret_var = PaymentParameters_new(payee_arg_conv, expiry_time_arg_conv, max_total_cltv_expiry_delta_arg, max_path_count_arg, max_channel_saturation_power_of_half_arg, previously_failed_channels_arg_constr, previously_failed_blinded_path_idxs_arg_constr); + FREE(intermediate_nodes_arg); + void* destination_arg_ptr = untag_ptr(destination_arg); + CHECK_ACCESS(destination_arg_ptr); + LDKDestination destination_arg_conv = *(LDKDestination*)(destination_arg_ptr); + destination_arg_conv = Destination_clone((LDKDestination*)untag_ptr(destination_arg)); + void* first_node_addresses_arg_ptr = untag_ptr(first_node_addresses_arg); + CHECK_ACCESS(first_node_addresses_arg_ptr); + LDKCOption_CVec_SocketAddressZZ first_node_addresses_arg_conv = *(LDKCOption_CVec_SocketAddressZZ*)(first_node_addresses_arg_ptr); + first_node_addresses_arg_conv = COption_CVec_SocketAddressZZ_clone((LDKCOption_CVec_SocketAddressZZ*)untag_ptr(first_node_addresses_arg)); + LDKOnionMessagePath ret_var = OnionMessagePath_new(intermediate_nodes_arg_constr, destination_arg_conv, first_node_addresses_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 PaymentParameters_clone_ptr(LDKPaymentParameters *NONNULL_PTR arg) { - LDKPaymentParameters ret_var = PaymentParameters_clone(arg); +static inline uint64_t OnionMessagePath_clone_ptr(LDKOnionMessagePath *NONNULL_PTR arg) { + LDKOnionMessagePath ret_var = OnionMessagePath_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_PaymentParameters_clone_ptr(int64_t arg) { - LDKPaymentParameters arg_conv; +int64_t CS_LDK_OnionMessagePath_clone_ptr(int64_t arg) { + LDKOnionMessagePath arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = PaymentParameters_clone_ptr(&arg_conv); + int64_t ret_conv = OnionMessagePath_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_PaymentParameters_clone(int64_t orig) { - LDKPaymentParameters orig_conv; +int64_t CS_LDK_OnionMessagePath_clone(int64_t orig) { + LDKOnionMessagePath orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKPaymentParameters ret_var = PaymentParameters_clone(&orig_conv); + LDKOnionMessagePath ret_var = OnionMessagePath_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_PaymentParameters_hash(int64_t o) { - LDKPaymentParameters o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = PaymentParameters_hash(&o_conv); +int8_tArray CS_LDK_OnionMessagePath_first_node(int64_t this_arg) { + LDKOnionMessagePath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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, OnionMessagePath_first_node(&this_arg_conv).compressed_form, 33); + return ret_arr; +} + +void CS_LDK_Destination_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); + LDKDestination this_ptr_conv = *(LDKDestination*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Destination_free(this_ptr_conv); +} + +static inline uint64_t Destination_clone_ptr(LDKDestination *NONNULL_PTR arg) { + LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); + *ret_copy = Destination_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_Destination_clone_ptr(int64_t arg) { + LDKDestination* arg_conv = (LDKDestination*)untag_ptr(arg); + int64_t ret_conv = Destination_clone_ptr(arg_conv); return ret_conv; } -jboolean CS_LDK_PaymentParameters_eq(int64_t a, int64_t b) { - LDKPaymentParameters a_conv; +int64_t CS_LDK_Destination_clone(int64_t orig) { + LDKDestination* orig_conv = (LDKDestination*)untag_ptr(orig); + LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); + *ret_copy = Destination_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_Destination_node(int8_tArray a) { + LDKPublicKey a_ref; + CHECK(a->arr_len == 33); + memcpy(a_ref.compressed_form, a->elems, 33); FREE(a); + LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); + *ret_copy = Destination_node(a_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_Destination_blinded_path(int64_t a) { + LDKBlindedMessagePath a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKPaymentParameters b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = PaymentParameters_eq(&a_conv, &b_conv); + a_conv = BlindedMessagePath_clone(&a_conv); + LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); + *ret_copy = Destination_blinded_path(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + 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; } -int8_tArray CS_LDK_PaymentParameters_write(int64_t obj) { - LDKPaymentParameters obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = PaymentParameters_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +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; } -int64_t CS_LDK_PaymentParameters_read(int8_tArray ser, int32_t arg) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ"); - *ret_conv = PaymentParameters_read(ser_ref, arg); - FREE(ser); - return tag_ptr(ret_conv, true); +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); } -int64_t CS_LDK_PaymentParameters_from_node_id(int8_tArray payee_pubkey, int32_t final_cltv_expiry_delta) { - LDKPublicKey payee_pubkey_ref; - CHECK(payee_pubkey->arr_len == 33); - memcpy(payee_pubkey_ref.compressed_form, payee_pubkey->elems, 33); FREE(payee_pubkey); - LDKPaymentParameters ret_var = PaymentParameters_from_node_id(payee_pubkey_ref, final_cltv_expiry_delta); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +void CS_LDK_SendSuccess_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); + LDKSendSuccess this_ptr_conv = *(LDKSendSuccess*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + SendSuccess_free(this_ptr_conv); +} + +static inline uint64_t SendSuccess_clone_ptr(LDKSendSuccess *NONNULL_PTR arg) { + LDKSendSuccess *ret_copy = MALLOC(sizeof(LDKSendSuccess), "LDKSendSuccess"); + *ret_copy = SendSuccess_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } +int64_t CS_LDK_SendSuccess_clone_ptr(int64_t arg) { + LDKSendSuccess* arg_conv = (LDKSendSuccess*)untag_ptr(arg); + int64_t ret_conv = SendSuccess_clone_ptr(arg_conv); + return ret_conv; +} -int64_t CS_LDK_PaymentParameters_for_keysend(int8_tArray payee_pubkey, int32_t final_cltv_expiry_delta, jboolean allow_mpp) { - LDKPublicKey payee_pubkey_ref; - CHECK(payee_pubkey->arr_len == 33); - memcpy(payee_pubkey_ref.compressed_form, payee_pubkey->elems, 33); FREE(payee_pubkey); - LDKPaymentParameters ret_var = PaymentParameters_for_keysend(payee_pubkey_ref, final_cltv_expiry_delta, allow_mpp); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +int64_t CS_LDK_SendSuccess_clone(int64_t orig) { + LDKSendSuccess* orig_conv = (LDKSendSuccess*)untag_ptr(orig); + LDKSendSuccess *ret_copy = MALLOC(sizeof(LDKSendSuccess), "LDKSendSuccess"); + *ret_copy = SendSuccess_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_PaymentParameters_from_bolt12_invoice(int64_t invoice) { - LDKBolt12Invoice invoice_conv; - invoice_conv.inner = untag_ptr(invoice); - invoice_conv.is_owned = ptr_is_owned(invoice); - CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); - invoice_conv.is_owned = false; - LDKPaymentParameters ret_var = PaymentParameters_from_bolt12_invoice(&invoice_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +int64_t CS_LDK_SendSuccess_buffered() { + LDKSendSuccess *ret_copy = MALLOC(sizeof(LDKSendSuccess), "LDKSendSuccess"); + *ret_copy = SendSuccess_buffered(); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_PaymentParameters_blinded(int64_tArray blinded_route_hints) { - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ blinded_route_hints_constr; - blinded_route_hints_constr.datalen = blinded_route_hints->arr_len; - if (blinded_route_hints_constr.datalen > 0) - blinded_route_hints_constr.data = MALLOC(blinded_route_hints_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); - else - blinded_route_hints_constr.data = NULL; - int64_t* blinded_route_hints_vals = blinded_route_hints->elems; - for (size_t l = 0; l < blinded_route_hints_constr.datalen; l++) { - int64_t blinded_route_hints_conv_37 = blinded_route_hints_vals[l]; - void* blinded_route_hints_conv_37_ptr = untag_ptr(blinded_route_hints_conv_37); - CHECK_ACCESS(blinded_route_hints_conv_37_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ blinded_route_hints_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(blinded_route_hints_conv_37_ptr); - blinded_route_hints_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(blinded_route_hints_conv_37)); - blinded_route_hints_constr.data[l] = blinded_route_hints_conv_37_conv; - } - FREE(blinded_route_hints); - LDKPaymentParameters ret_var = PaymentParameters_blinded(blinded_route_hints_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); +int64_t CS_LDK_SendSuccess_buffered_awaiting_connection(int8_tArray a) { + LDKPublicKey a_ref; + CHECK(a->arr_len == 33); + memcpy(a_ref.compressed_form, a->elems, 33); FREE(a); + LDKSendSuccess *ret_copy = MALLOC(sizeof(LDKSendSuccess), "LDKSendSuccess"); + *ret_copy = SendSuccess_buffered_awaiting_connection(a_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void CS_LDK_Payee_free(int64_t this_ptr) { +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); + jboolean ret_conv = SendSuccess_eq(a_conv, b_conv); + return ret_conv; +} + +void CS_LDK_SendError_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); - LDKPayee this_ptr_conv = *(LDKPayee*)(this_ptr_ptr); + LDKSendError this_ptr_conv = *(LDKSendError*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - Payee_free(this_ptr_conv); + SendError_free(this_ptr_conv); } -static inline uint64_t Payee_clone_ptr(LDKPayee *NONNULL_PTR arg) { - LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); - *ret_copy = Payee_clone(arg); +static inline uint64_t SendError_clone_ptr(LDKSendError *NONNULL_PTR arg) { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Payee_clone_ptr(int64_t arg) { - LDKPayee* arg_conv = (LDKPayee*)untag_ptr(arg); - int64_t ret_conv = Payee_clone_ptr(arg_conv); +int64_t CS_LDK_SendError_clone_ptr(int64_t arg) { + LDKSendError* arg_conv = (LDKSendError*)untag_ptr(arg); + int64_t ret_conv = SendError_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_Payee_clone(int64_t orig) { - LDKPayee* orig_conv = (LDKPayee*)untag_ptr(orig); - LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); - *ret_copy = Payee_clone(orig_conv); +int64_t CS_LDK_SendError_clone(int64_t orig) { + LDKSendError* orig_conv = (LDKSendError*)untag_ptr(orig); + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_clone(orig_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Payee_blinded(int64_tArray route_hints, int64_t features) { - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ route_hints_constr; - route_hints_constr.datalen = route_hints->arr_len; - if (route_hints_constr.datalen > 0) - route_hints_constr.data = MALLOC(route_hints_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); - else - route_hints_constr.data = NULL; - int64_t* route_hints_vals = route_hints->elems; - for (size_t l = 0; l < route_hints_constr.datalen; l++) { - int64_t route_hints_conv_37 = route_hints_vals[l]; - void* route_hints_conv_37_ptr = untag_ptr(route_hints_conv_37); - CHECK_ACCESS(route_hints_conv_37_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ route_hints_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(route_hints_conv_37_ptr); - route_hints_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(route_hints_conv_37)); - route_hints_constr.data[l] = route_hints_conv_37_conv; - } - FREE(route_hints); - LDKBolt12InvoiceFeatures features_conv; - features_conv.inner = untag_ptr(features); - features_conv.is_owned = ptr_is_owned(features); - CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); - features_conv = Bolt12InvoiceFeatures_clone(&features_conv); - LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); - *ret_copy = Payee_blinded(route_hints_constr, features_conv); +int64_t CS_LDK_SendError_secp256k1(int32_t a) { + LDKSecp256k1Error a_conv = LDKSecp256k1Error_from_cs(a); + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_secp256k1(a_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Payee_clear(int8_tArray node_id, int64_tArray route_hints, int64_t features, int32_t final_cltv_expiry_delta) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKCVec_RouteHintZ route_hints_constr; - route_hints_constr.datalen = route_hints->arr_len; - if (route_hints_constr.datalen > 0) - route_hints_constr.data = MALLOC(route_hints_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements"); - else - route_hints_constr.data = NULL; - int64_t* route_hints_vals = route_hints->elems; - for (size_t l = 0; l < route_hints_constr.datalen; l++) { - int64_t route_hints_conv_11 = route_hints_vals[l]; - LDKRouteHint route_hints_conv_11_conv; - route_hints_conv_11_conv.inner = untag_ptr(route_hints_conv_11); - route_hints_conv_11_conv.is_owned = ptr_is_owned(route_hints_conv_11); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_hints_conv_11_conv); - route_hints_conv_11_conv = RouteHint_clone(&route_hints_conv_11_conv); - route_hints_constr.data[l] = route_hints_conv_11_conv; - } - FREE(route_hints); - LDKBolt11InvoiceFeatures features_conv; - features_conv.inner = untag_ptr(features); - features_conv.is_owned = ptr_is_owned(features); - CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); - features_conv = Bolt11InvoiceFeatures_clone(&features_conv); - LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); - *ret_copy = Payee_clear(node_id_ref, route_hints_constr, features_conv, final_cltv_expiry_delta); +int64_t CS_LDK_SendError_too_big_packet() { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_too_big_packet(); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Payee_hash(int64_t o) { - LDKPayee* o_conv = (LDKPayee*)untag_ptr(o); - int64_t ret_conv = Payee_hash(o_conv); - return ret_conv; +int64_t CS_LDK_SendError_too_few_blinded_hops() { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_too_few_blinded_hops(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_Payee_eq(int64_t a, int64_t b) { - LDKPayee* a_conv = (LDKPayee*)untag_ptr(a); - LDKPayee* b_conv = (LDKPayee*)untag_ptr(b); - jboolean ret_conv = Payee_eq(a_conv, b_conv); - return ret_conv; +int64_t CS_LDK_SendError_invalid_first_hop(int8_tArray a) { + LDKPublicKey a_ref; + CHECK(a->arr_len == 33); + memcpy(a_ref.compressed_form, a->elems, 33); FREE(a); + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_invalid_first_hop(a_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_RouteHint_free(int64_t this_obj) { - LDKRouteHint this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - RouteHint_free(this_obj_conv); +int64_t CS_LDK_SendError_path_not_found() { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_path_not_found(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_tArray CS_LDK_RouteHint_get_a(int64_t this_ptr) { - LDKRouteHint this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_RouteHintHopZ ret_var = RouteHint_get_a(&this_ptr_conv); - 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 o = 0; o < ret_var.datalen; o++) { - LDKRouteHintHop ret_conv_14_var = ret_var.data[o]; - int64_t ret_conv_14_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var); - ret_conv_14_ref = tag_ptr(ret_conv_14_var.inner, ret_conv_14_var.is_owned); - ret_arr_ptr[o] = ret_conv_14_ref; - } - - FREE(ret_var.data); - return ret_arr; +int64_t CS_LDK_SendError_invalid_message() { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_invalid_message(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_RouteHint_set_a(int64_t this_ptr, int64_tArray val) { - LDKRouteHint this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_RouteHintHopZ val_constr; - val_constr.datalen = val->arr_len; - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = val->elems; - for (size_t o = 0; o < val_constr.datalen; o++) { - int64_t val_conv_14 = val_vals[o]; - LDKRouteHintHop val_conv_14_conv; - val_conv_14_conv.inner = untag_ptr(val_conv_14); - val_conv_14_conv.is_owned = ptr_is_owned(val_conv_14); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_14_conv); - val_conv_14_conv = RouteHintHop_clone(&val_conv_14_conv); - val_constr.data[o] = val_conv_14_conv; - } - FREE(val); - RouteHint_set_a(&this_ptr_conv, val_constr); +int64_t CS_LDK_SendError_buffer_full() { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_buffer_full(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_RouteHint_new(int64_tArray a_arg) { - LDKCVec_RouteHintHopZ a_arg_constr; - a_arg_constr.datalen = a_arg->arr_len; - if (a_arg_constr.datalen > 0) - a_arg_constr.data = MALLOC(a_arg_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements"); - else - a_arg_constr.data = NULL; - int64_t* a_arg_vals = a_arg->elems; - for (size_t o = 0; o < a_arg_constr.datalen; o++) { - int64_t a_arg_conv_14 = a_arg_vals[o]; - LDKRouteHintHop a_arg_conv_14_conv; - a_arg_conv_14_conv.inner = untag_ptr(a_arg_conv_14); - a_arg_conv_14_conv.is_owned = ptr_is_owned(a_arg_conv_14); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_arg_conv_14_conv); - a_arg_conv_14_conv = RouteHintHop_clone(&a_arg_conv_14_conv); - a_arg_constr.data[o] = a_arg_conv_14_conv; - } - FREE(a_arg); - LDKRouteHint ret_var = RouteHint_new(a_arg_constr); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +int64_t CS_LDK_SendError_get_node_id_failed() { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_get_node_id_failed(); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline uint64_t RouteHint_clone_ptr(LDKRouteHint *NONNULL_PTR arg) { - LDKRouteHint ret_var = RouteHint_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); +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_RouteHint_clone_ptr(int64_t arg) { - LDKRouteHint arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = RouteHint_clone_ptr(&arg_conv); - return ret_conv; -} -int64_t CS_LDK_RouteHint_clone(int64_t orig) { - LDKRouteHint orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKRouteHint ret_var = RouteHint_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); +int64_t CS_LDK_SendError_blinded_path_advance_failed() { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_blinded_path_advance_failed(); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_RouteHint_hash(int64_t o) { - LDKRouteHint o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = RouteHint_hash(&o_conv); +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_RouteHint_eq(int64_t a, int64_t b) { - LDKRouteHint a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKRouteHint b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = RouteHint_eq(&a_conv, &b_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); + jboolean ret_conv = SendError_eq(a_conv, b_conv); return ret_conv; } -int8_tArray CS_LDK_RouteHint_write(int64_t obj) { - LDKRouteHint obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = RouteHint_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); +void CS_LDK_CustomOnionMessageHandler_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); + LDKCustomOnionMessageHandler this_ptr_conv = *(LDKCustomOnionMessageHandler*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + CustomOnionMessageHandler_free(this_ptr_conv); +} + +void CS_LDK_PeeledOnion_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); + LDKPeeledOnion this_ptr_conv = *(LDKPeeledOnion*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + PeeledOnion_free(this_ptr_conv); +} + +static inline uint64_t PeeledOnion_clone_ptr(LDKPeeledOnion *NONNULL_PTR arg) { + LDKPeeledOnion *ret_copy = MALLOC(sizeof(LDKPeeledOnion), "LDKPeeledOnion"); + *ret_copy = PeeledOnion_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_PeeledOnion_clone_ptr(int64_t arg) { + LDKPeeledOnion* arg_conv = (LDKPeeledOnion*)untag_ptr(arg); + int64_t ret_conv = PeeledOnion_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_PeeledOnion_clone(int64_t orig) { + LDKPeeledOnion* orig_conv = (LDKPeeledOnion*)untag_ptr(orig); + LDKPeeledOnion *ret_copy = MALLOC(sizeof(LDKPeeledOnion), "LDKPeeledOnion"); + *ret_copy = PeeledOnion_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +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_conv, b_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_PeeledOnion_receive(int64_t a, int64_t b, int64_t c) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKParsedOnionMessageContents a_conv = *(LDKParsedOnionMessageContents*)(a_ptr); + a_conv = ParsedOnionMessageContents_clone((LDKParsedOnionMessageContents*)untag_ptr(a)); + void* b_ptr = untag_ptr(b); + CHECK_ACCESS(b_ptr); + LDKCOption_MessageContextZ b_conv = *(LDKCOption_MessageContextZ*)(b_ptr); + b_conv = COption_MessageContextZ_clone((LDKCOption_MessageContextZ*)untag_ptr(b)); + LDKBlindedMessagePath 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 = BlindedMessagePath_clone(&c_conv); + LDKPeeledOnion *ret_copy = MALLOC(sizeof(LDKPeeledOnion), "LDKPeeledOnion"); + *ret_copy = PeeledOnion_receive(a_conv, b_conv, c_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +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); + } + LDKBlindedMessagePath 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 = BlindedMessagePath_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); + 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); + } + LDKBlindedMessagePath 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 = BlindedMessagePath_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, node_id_lookup_conv, path_conv, contents_conv, reply_path_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_peel_onion_message(int64_t msg, int64_t node_signer, int64_t logger, int64_t custom_handler) { + LDKOnionMessage msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + void* custom_handler_ptr = untag_ptr(custom_handler); + CHECK_ACCESS(custom_handler_ptr); + LDKCustomOnionMessageHandler custom_handler_conv = *(LDKCustomOnionMessageHandler*)(custom_handler_ptr); + if (custom_handler_conv.free == LDKCustomOnionMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKCustomOnionMessageHandler_JCalls_cloned(&custom_handler_conv); + } + LDKCResult_PeeledOnionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PeeledOnionNoneZ), "LDKCResult_PeeledOnionNoneZ"); + *ret_conv = peel_onion_message(&msg_conv, node_signer_conv, logger_conv, custom_handler_conv); + 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 node_id_lookup, int64_t message_router, int64_t offers_handler, int64_t async_payments_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); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + void* 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); + if (message_router_conv.free == LDKMessageRouter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKMessageRouter_JCalls_cloned(&message_router_conv); + } + void* offers_handler_ptr = untag_ptr(offers_handler); + CHECK_ACCESS(offers_handler_ptr); + LDKOffersMessageHandler offers_handler_conv = *(LDKOffersMessageHandler*)(offers_handler_ptr); + if (offers_handler_conv.free == LDKOffersMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOffersMessageHandler_JCalls_cloned(&offers_handler_conv); + } + void* async_payments_handler_ptr = untag_ptr(async_payments_handler); + CHECK_ACCESS(async_payments_handler_ptr); + LDKAsyncPaymentsMessageHandler async_payments_handler_conv = *(LDKAsyncPaymentsMessageHandler*)(async_payments_handler_ptr); + if (async_payments_handler_conv.free == LDKAsyncPaymentsMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKAsyncPaymentsMessageHandler_JCalls_cloned(&async_payments_handler_conv); + } + void* custom_handler_ptr = untag_ptr(custom_handler); + CHECK_ACCESS(custom_handler_ptr); + LDKCustomOnionMessageHandler custom_handler_conv = *(LDKCustomOnionMessageHandler*)(custom_handler_ptr); + if (custom_handler_conv.free == LDKCustomOnionMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKCustomOnionMessageHandler_JCalls_cloned(&custom_handler_conv); + } + LDKOnionMessenger ret_var = OnionMessenger_new(entropy_source_conv, node_signer_conv, logger_conv, node_id_lookup_conv, message_router_conv, offers_handler_conv, async_payments_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); + return ret_ref; +} + +int64_t CS_LDK_OnionMessenger_new_with_offline_peer_interception(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 async_payments_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); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + void* 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); + if (message_router_conv.free == LDKMessageRouter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKMessageRouter_JCalls_cloned(&message_router_conv); + } + void* offers_handler_ptr = untag_ptr(offers_handler); + CHECK_ACCESS(offers_handler_ptr); + LDKOffersMessageHandler offers_handler_conv = *(LDKOffersMessageHandler*)(offers_handler_ptr); + if (offers_handler_conv.free == LDKOffersMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOffersMessageHandler_JCalls_cloned(&offers_handler_conv); + } + void* async_payments_handler_ptr = untag_ptr(async_payments_handler); + CHECK_ACCESS(async_payments_handler_ptr); + LDKAsyncPaymentsMessageHandler async_payments_handler_conv = *(LDKAsyncPaymentsMessageHandler*)(async_payments_handler_ptr); + if (async_payments_handler_conv.free == LDKAsyncPaymentsMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKAsyncPaymentsMessageHandler_JCalls_cloned(&async_payments_handler_conv); + } + void* custom_handler_ptr = untag_ptr(custom_handler); + CHECK_ACCESS(custom_handler_ptr); + LDKCustomOnionMessageHandler custom_handler_conv = *(LDKCustomOnionMessageHandler*)(custom_handler_ptr); + if (custom_handler_conv.free == LDKCustomOnionMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKCustomOnionMessageHandler_JCalls_cloned(&custom_handler_conv); + } + LDKOnionMessenger ret_var = OnionMessenger_new_with_offline_peer_interception(entropy_source_conv, node_signer_conv, logger_conv, node_id_lookup_conv, message_router_conv, offers_handler_conv, async_payments_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); + return ret_ref; +} + +int64_t CS_LDK_OnionMessenger_send_onion_message(int64_t this_arg, int64_t contents, int64_t instructions) { + LDKOnionMessenger this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + 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); + } + void* instructions_ptr = untag_ptr(instructions); + CHECK_ACCESS(instructions_ptr); + LDKMessageSendInstructions instructions_conv = *(LDKMessageSendInstructions*)(instructions_ptr); + instructions_conv = MessageSendInstructions_clone((LDKMessageSendInstructions*)untag_ptr(instructions)); + LDKCResult_SendSuccessSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SendSuccessSendErrorZ), "LDKCResult_SendSuccessSendErrorZ"); + *ret_conv = OnionMessenger_send_onion_message(&this_arg_conv, contents_conv, instructions_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_OnionMessenger_forward_onion_message(int64_t this_arg, int64_t message, int8_tArray peer_node_id) { + LDKOnionMessenger this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKOnionMessage 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 = OnionMessage_clone(&message_conv); + LDKPublicKey peer_node_id_ref; + CHECK(peer_node_id->arr_len == 33); + memcpy(peer_node_id_ref.compressed_form, peer_node_id->elems, 33); FREE(peer_node_id); + LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ"); + *ret_conv = OnionMessenger_forward_onion_message(&this_arg_conv, message_conv, peer_node_id_ref); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_OnionMessenger_handle_onion_message_response(int64_t this_arg, int64_t response, int64_t instructions) { + LDKOnionMessenger this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + void* response_ptr = untag_ptr(response); + CHECK_ACCESS(response_ptr); + LDKOnionMessageContents response_conv = *(LDKOnionMessageContents*)(response_ptr); + if (response_conv.free == LDKOnionMessageContents_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOnionMessageContents_JCalls_cloned(&response_conv); + } + LDKResponseInstruction instructions_conv; + instructions_conv.inner = untag_ptr(instructions); + instructions_conv.is_owned = ptr_is_owned(instructions); + CHECK_INNER_FIELD_ACCESS_OR_NULL(instructions_conv); + instructions_conv = ResponseInstruction_clone(&instructions_conv); + LDKCResult_SendSuccessSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SendSuccessSendErrorZ), "LDKCResult_SendSuccessSendErrorZ"); + *ret_conv = OnionMessenger_handle_onion_message_response(&this_arg_conv, response_conv, instructions_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_OnionMessenger_get_update_future(int64_t this_arg) { + LDKOnionMessenger this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKFuture ret_var = OnionMessenger_get_update_future(&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_OnionMessenger_as_EventsProvider(int64_t this_arg) { + LDKOnionMessenger this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); + *ret_ret = OnionMessenger_as_EventsProvider(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +int64_t CS_LDK_OnionMessenger_as_OnionMessageHandler(int64_t this_arg) { + LDKOnionMessenger this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKOnionMessageHandler* ret_ret = MALLOC(sizeof(LDKOnionMessageHandler), "LDKOnionMessageHandler"); + *ret_ret = OnionMessenger_as_OnionMessageHandler(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +void CS_LDK_OffersMessageHandler_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); + LDKOffersMessageHandler this_ptr_conv = *(LDKOffersMessageHandler*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + OffersMessageHandler_free(this_ptr_conv); +} + +void CS_LDK_OffersMessage_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); + LDKOffersMessage this_ptr_conv = *(LDKOffersMessage*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + OffersMessage_free(this_ptr_conv); +} + +static inline uint64_t OffersMessage_clone_ptr(LDKOffersMessage *NONNULL_PTR arg) { + LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); + *ret_copy = OffersMessage_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_OffersMessage_clone_ptr(int64_t arg) { + LDKOffersMessage* arg_conv = (LDKOffersMessage*)untag_ptr(arg); + int64_t ret_conv = OffersMessage_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_OffersMessage_clone(int64_t orig) { + LDKOffersMessage* orig_conv = (LDKOffersMessage*)untag_ptr(orig); + LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); + *ret_copy = OffersMessage_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_OffersMessage_invoice_request(int64_t a) { + LDKInvoiceRequest a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = InvoiceRequest_clone(&a_conv); + LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); + *ret_copy = OffersMessage_invoice_request(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_OffersMessage_invoice(int64_t a) { + LDKBolt12Invoice a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = Bolt12Invoice_clone(&a_conv); + LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); + *ret_copy = OffersMessage_invoice(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_OffersMessage_invoice_error(int64_t a) { + LDKInvoiceError a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = InvoiceError_clone(&a_conv); + LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); + *ret_copy = OffersMessage_invoice_error(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +jboolean CS_LDK_OffersMessage_is_known_type(int64_t tlv_type) { + jboolean ret_conv = OffersMessage_is_known_type(tlv_type); + return ret_conv; +} + +int64_t CS_LDK_OffersMessage_as_OnionMessageContents(int64_t this_arg) { + LDKOffersMessage* this_arg_conv = (LDKOffersMessage*)untag_ptr(this_arg); + LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *ret_ret = OffersMessage_as_OnionMessageContents(this_arg_conv); + return tag_ptr(ret_ret, true); +} + +int8_tArray CS_LDK_OffersMessage_write(int64_t obj) { + LDKOffersMessage* obj_conv = (LDKOffersMessage*)untag_ptr(obj); + LDKCVec_u8Z ret_var = OffersMessage_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_RouteHint_read(int8_tArray ser) { +int64_t CS_LDK_OffersMessage_read(int8_tArray ser, int64_t arg_a, int64_t arg_b) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); - *ret_conv = RouteHint_read(ser_ref); + void* arg_b_ptr = untag_ptr(arg_b); + if (ptr_is_owned(arg_b)) { CHECK_ACCESS(arg_b_ptr); } + LDKLogger* arg_b_conv = (LDKLogger*)arg_b_ptr; + LDKCResult_OffersMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersMessageDecodeErrorZ), "LDKCResult_OffersMessageDecodeErrorZ"); + *ret_conv = OffersMessage_read(ser_ref, arg_a, arg_b_conv); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_RouteHintHop_free(int64_t this_obj) { - LDKRouteHintHop this_obj_conv; +void CS_LDK_Packet_free(int64_t this_obj) { + LDKPacket this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - RouteHintHop_free(this_obj_conv); + Packet_free(this_obj_conv); } -int8_tArray CS_LDK_RouteHintHop_get_src_node_id(int64_t this_ptr) { - LDKRouteHintHop this_ptr_conv; +int8_t CS_LDK_Packet_get_version(int64_t this_ptr) { + LDKPacket this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, RouteHintHop_get_src_node_id(&this_ptr_conv).compressed_form, 33); - return ret_arr; + int8_t ret_conv = Packet_get_version(&this_ptr_conv); + return ret_conv; } -void CS_LDK_RouteHintHop_set_src_node_id(int64_t this_ptr, int8_tArray val) { - LDKRouteHintHop this_ptr_conv; +void CS_LDK_Packet_set_version(int64_t this_ptr, int8_t val) { + LDKPacket this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - RouteHintHop_set_src_node_id(&this_ptr_conv, val_ref); + Packet_set_version(&this_ptr_conv, val); } -int64_t CS_LDK_RouteHintHop_get_short_channel_id(int64_t this_ptr) { - LDKRouteHintHop this_ptr_conv; +int8_tArray CS_LDK_Packet_get_public_key(int64_t this_ptr) { + LDKPacket this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = RouteHintHop_get_short_channel_id(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, Packet_get_public_key(&this_ptr_conv).compressed_form, 33); + return ret_arr; } -void CS_LDK_RouteHintHop_set_short_channel_id(int64_t this_ptr, int64_t val) { - LDKRouteHintHop this_ptr_conv; +void CS_LDK_Packet_set_public_key(int64_t this_ptr, int8_tArray val) { + LDKPacket this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - RouteHintHop_set_short_channel_id(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + Packet_set_public_key(&this_ptr_conv, val_ref); } -int64_t CS_LDK_RouteHintHop_get_fees(int64_t this_ptr) { - LDKRouteHintHop this_ptr_conv; +int8_tArray CS_LDK_Packet_get_hop_data(int64_t this_ptr) { + LDKPacket this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKRoutingFees ret_var = RouteHintHop_get_fees(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + LDKCVec_u8Z ret_var = Packet_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_RouteHintHop_set_fees(int64_t this_ptr, int64_t val) { - LDKRouteHintHop this_ptr_conv; +void CS_LDK_Packet_set_hop_data(int64_t this_ptr, int8_tArray val) { + LDKPacket this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKRoutingFees val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = RoutingFees_clone(&val_conv); - RouteHintHop_set_fees(&this_ptr_conv, val_conv); -} - -int16_t CS_LDK_RouteHintHop_get_cltv_expiry_delta(int64_t this_ptr) { - LDKRouteHintHop this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int16_t ret_conv = RouteHintHop_get_cltv_expiry_delta(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_RouteHintHop_set_cltv_expiry_delta(int64_t this_ptr, int16_t val) { - LDKRouteHintHop this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - RouteHintHop_set_cltv_expiry_delta(&this_ptr_conv, val); -} - -int64_t CS_LDK_RouteHintHop_get_htlc_minimum_msat(int64_t this_ptr) { - LDKRouteHintHop this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = RouteHintHop_get_htlc_minimum_msat(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -void CS_LDK_RouteHintHop_set_htlc_minimum_msat(int64_t this_ptr, int64_t val) { - LDKRouteHintHop this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - RouteHintHop_set_htlc_minimum_msat(&this_ptr_conv, val_conv); + 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); + Packet_set_hop_data(&this_ptr_conv, val_ref); } -int64_t CS_LDK_RouteHintHop_get_htlc_maximum_msat(int64_t this_ptr) { - LDKRouteHintHop this_ptr_conv; +int8_tArray CS_LDK_Packet_get_hmac(int64_t this_ptr) { + LDKPacket this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = RouteHintHop_get_htlc_maximum_msat(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *Packet_get_hmac(&this_ptr_conv), 32); + return ret_arr; } -void CS_LDK_RouteHintHop_set_htlc_maximum_msat(int64_t this_ptr, int64_t val) { - LDKRouteHintHop this_ptr_conv; +void CS_LDK_Packet_set_hmac(int64_t this_ptr, int8_tArray val) { + LDKPacket this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - RouteHintHop_set_htlc_maximum_msat(&this_ptr_conv, val_conv); + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + Packet_set_hmac(&this_ptr_conv, val_ref); } -int64_t CS_LDK_RouteHintHop_new(int8_tArray src_node_id_arg, int64_t short_channel_id_arg, int64_t fees_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg) { - LDKPublicKey src_node_id_arg_ref; - CHECK(src_node_id_arg->arr_len == 33); - memcpy(src_node_id_arg_ref.compressed_form, src_node_id_arg->elems, 33); FREE(src_node_id_arg); - LDKRoutingFees fees_arg_conv; - fees_arg_conv.inner = untag_ptr(fees_arg); - fees_arg_conv.is_owned = ptr_is_owned(fees_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv); - fees_arg_conv = RoutingFees_clone(&fees_arg_conv); - void* htlc_minimum_msat_arg_ptr = untag_ptr(htlc_minimum_msat_arg); - CHECK_ACCESS(htlc_minimum_msat_arg_ptr); - LDKCOption_u64Z htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_minimum_msat_arg_ptr); - htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_minimum_msat_arg)); - void* htlc_maximum_msat_arg_ptr = untag_ptr(htlc_maximum_msat_arg); - CHECK_ACCESS(htlc_maximum_msat_arg_ptr); - LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_arg_ptr); - htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_maximum_msat_arg)); - LDKRouteHintHop ret_var = RouteHintHop_new(src_node_id_arg_ref, short_channel_id_arg, fees_arg_conv, cltv_expiry_delta_arg, htlc_minimum_msat_arg_conv, htlc_maximum_msat_arg_conv); +int64_t CS_LDK_Packet_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); + LDKPacket ret_var = Packet_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 RouteHintHop_clone_ptr(LDKRouteHintHop *NONNULL_PTR arg) { - LDKRouteHintHop ret_var = RouteHintHop_clone(arg); +static inline uint64_t Packet_clone_ptr(LDKPacket *NONNULL_PTR arg) { + LDKPacket ret_var = Packet_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_RouteHintHop_clone_ptr(int64_t arg) { - LDKRouteHintHop arg_conv; +int64_t CS_LDK_Packet_clone_ptr(int64_t arg) { + LDKPacket arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = RouteHintHop_clone_ptr(&arg_conv); + int64_t ret_conv = Packet_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_RouteHintHop_clone(int64_t orig) { - LDKRouteHintHop orig_conv; +int64_t CS_LDK_Packet_clone(int64_t orig) { + LDKPacket orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKRouteHintHop ret_var = RouteHintHop_clone(&orig_conv); + LDKPacket ret_var = Packet_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_RouteHintHop_hash(int64_t o) { - LDKRouteHintHop o_conv; +int64_t CS_LDK_Packet_hash(int64_t o) { + LDKPacket o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv.is_owned = false; - int64_t ret_conv = RouteHintHop_hash(&o_conv); + int64_t ret_conv = Packet_hash(&o_conv); return ret_conv; } -jboolean CS_LDK_RouteHintHop_eq(int64_t a, int64_t b) { - LDKRouteHintHop a_conv; +jboolean CS_LDK_Packet_eq(int64_t a, int64_t b) { + LDKPacket a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKRouteHintHop b_conv; + LDKPacket b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = RouteHintHop_eq(&a_conv, &b_conv); + jboolean ret_conv = Packet_eq(&a_conv, &b_conv); return ret_conv; } -int8_tArray CS_LDK_RouteHintHop_write(int64_t obj) { - LDKRouteHintHop obj_conv; +int8_tArray CS_LDK_Packet_write(int64_t obj) { + LDKPacket obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = RouteHintHop_write(&obj_conv); + LDKCVec_u8Z ret_var = Packet_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_RouteHintHop_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); - *ret_conv = RouteHintHop_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void CS_LDK_ParsedOnionMessageContents_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); + LDKParsedOnionMessageContents this_ptr_conv = *(LDKParsedOnionMessageContents*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + ParsedOnionMessageContents_free(this_ptr_conv); } -void CS_LDK_FirstHopCandidate_free(int64_t this_obj) { - LDKFirstHopCandidate this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - FirstHopCandidate_free(this_obj_conv); +static inline uint64_t ParsedOnionMessageContents_clone_ptr(LDKParsedOnionMessageContents *NONNULL_PTR arg) { + LDKParsedOnionMessageContents *ret_copy = MALLOC(sizeof(LDKParsedOnionMessageContents), "LDKParsedOnionMessageContents"); + *ret_copy = ParsedOnionMessageContents_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_ParsedOnionMessageContents_clone_ptr(int64_t arg) { + LDKParsedOnionMessageContents* arg_conv = (LDKParsedOnionMessageContents*)untag_ptr(arg); + int64_t ret_conv = ParsedOnionMessageContents_clone_ptr(arg_conv); + return ret_conv; } -static inline uint64_t FirstHopCandidate_clone_ptr(LDKFirstHopCandidate *NONNULL_PTR arg) { - LDKFirstHopCandidate ret_var = FirstHopCandidate_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); +int64_t CS_LDK_ParsedOnionMessageContents_clone(int64_t orig) { + LDKParsedOnionMessageContents* orig_conv = (LDKParsedOnionMessageContents*)untag_ptr(orig); + LDKParsedOnionMessageContents *ret_copy = MALLOC(sizeof(LDKParsedOnionMessageContents), "LDKParsedOnionMessageContents"); + *ret_copy = ParsedOnionMessageContents_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_FirstHopCandidate_clone_ptr(int64_t arg) { - LDKFirstHopCandidate 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 = FirstHopCandidate_clone_ptr(&arg_conv); + +int64_t CS_LDK_ParsedOnionMessageContents_offers(int64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKOffersMessage a_conv = *(LDKOffersMessage*)(a_ptr); + a_conv = OffersMessage_clone((LDKOffersMessage*)untag_ptr(a)); + LDKParsedOnionMessageContents *ret_copy = MALLOC(sizeof(LDKParsedOnionMessageContents), "LDKParsedOnionMessageContents"); + *ret_copy = ParsedOnionMessageContents_offers(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_ParsedOnionMessageContents_custom(int64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKOnionMessageContents a_conv = *(LDKOnionMessageContents*)(a_ptr); + if (a_conv.free == LDKOnionMessageContents_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOnionMessageContents_JCalls_cloned(&a_conv); + } + LDKParsedOnionMessageContents *ret_copy = MALLOC(sizeof(LDKParsedOnionMessageContents), "LDKParsedOnionMessageContents"); + *ret_copy = ParsedOnionMessageContents_custom(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_ParsedOnionMessageContents_as_OnionMessageContents(int64_t this_arg) { + LDKParsedOnionMessageContents* this_arg_conv = (LDKParsedOnionMessageContents*)untag_ptr(this_arg); + LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *ret_ret = ParsedOnionMessageContents_as_OnionMessageContents(this_arg_conv); + return tag_ptr(ret_ret, true); +} + +int8_tArray CS_LDK_ParsedOnionMessageContents_write(int64_t obj) { + LDKParsedOnionMessageContents* obj_conv = (LDKParsedOnionMessageContents*)untag_ptr(obj); + LDKCVec_u8Z ret_var = ParsedOnionMessageContents_write(obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +static inline uint64_t OnionMessageContents_clone_ptr(LDKOnionMessageContents *NONNULL_PTR arg) { + LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *ret_ret = OnionMessageContents_clone(arg); + return tag_ptr(ret_ret, true); +} +int64_t CS_LDK_OnionMessageContents_clone_ptr(int64_t arg) { + void* arg_ptr = untag_ptr(arg); + if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); } + LDKOnionMessageContents* arg_conv = (LDKOnionMessageContents*)arg_ptr; + int64_t ret_conv = OnionMessageContents_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_FirstHopCandidate_clone(int64_t orig) { - LDKFirstHopCandidate 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; - LDKFirstHopCandidate ret_var = FirstHopCandidate_clone(&orig_conv); +int64_t CS_LDK_OnionMessageContents_clone(int64_t orig) { + void* orig_ptr = untag_ptr(orig); + if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); } + LDKOnionMessageContents* orig_conv = (LDKOnionMessageContents*)orig_ptr; + LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *ret_ret = OnionMessageContents_clone(orig_conv); + return tag_ptr(ret_ret, true); +} + +void CS_LDK_OnionMessageContents_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); + LDKOnionMessageContents this_ptr_conv = *(LDKOnionMessageContents*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + OnionMessageContents_free(this_ptr_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; } -void CS_LDK_PublicHopCandidate_free(int64_t this_obj) { - LDKPublicHopCandidate this_obj_conv; +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); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PublicHopCandidate_free(this_obj_conv); + BlindedHop_free(this_obj_conv); } -int64_t CS_LDK_PublicHopCandidate_get_short_channel_id(int64_t this_ptr) { - LDKPublicHopCandidate this_ptr_conv; +int8_tArray CS_LDK_BlindedHop_get_blinded_node_id(int64_t this_ptr) { + LDKBlindedHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = PublicHopCandidate_get_short_channel_id(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, BlindedHop_get_blinded_node_id(&this_ptr_conv).compressed_form, 33); + return ret_arr; } -void CS_LDK_PublicHopCandidate_set_short_channel_id(int64_t this_ptr, int64_t val) { - LDKPublicHopCandidate this_ptr_conv; +void CS_LDK_BlindedHop_set_blinded_node_id(int64_t this_ptr, int8_tArray val) { + LDKBlindedHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - PublicHopCandidate_set_short_channel_id(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + BlindedHop_set_blinded_node_id(&this_ptr_conv, val_ref); } -static inline uint64_t PublicHopCandidate_clone_ptr(LDKPublicHopCandidate *NONNULL_PTR arg) { - LDKPublicHopCandidate ret_var = PublicHopCandidate_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; +int8_tArray CS_LDK_BlindedHop_get_encrypted_payload(int64_t this_ptr) { + LDKBlindedHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = BlindedHop_get_encrypted_payload(&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; } -int64_t CS_LDK_PublicHopCandidate_clone_ptr(int64_t arg) { - LDKPublicHopCandidate 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 = PublicHopCandidate_clone_ptr(&arg_conv); - return ret_conv; + +void CS_LDK_BlindedHop_set_encrypted_payload(int64_t this_ptr, int8_tArray val) { + LDKBlindedHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + BlindedHop_set_encrypted_payload(&this_ptr_conv, val_ref); } -int64_t CS_LDK_PublicHopCandidate_clone(int64_t orig) { - LDKPublicHopCandidate 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; - LDKPublicHopCandidate ret_var = PublicHopCandidate_clone(&orig_conv); +int64_t CS_LDK_BlindedHop_new(int8_tArray blinded_node_id_arg, int8_tArray encrypted_payload_arg) { + LDKPublicKey blinded_node_id_arg_ref; + CHECK(blinded_node_id_arg->arr_len == 33); + memcpy(blinded_node_id_arg_ref.compressed_form, blinded_node_id_arg->elems, 33); FREE(blinded_node_id_arg); + LDKCVec_u8Z encrypted_payload_arg_ref; + encrypted_payload_arg_ref.datalen = encrypted_payload_arg->arr_len; + encrypted_payload_arg_ref.data = MALLOC(encrypted_payload_arg_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(encrypted_payload_arg_ref.data, encrypted_payload_arg->elems, encrypted_payload_arg_ref.datalen); FREE(encrypted_payload_arg); + LDKBlindedHop ret_var = BlindedHop_new(blinded_node_id_arg_ref, encrypted_payload_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; } -void CS_LDK_PrivateHopCandidate_free(int64_t this_obj) { - LDKPrivateHopCandidate this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PrivateHopCandidate_free(this_obj_conv); -} - -static inline uint64_t PrivateHopCandidate_clone_ptr(LDKPrivateHopCandidate *NONNULL_PTR arg) { - LDKPrivateHopCandidate ret_var = PrivateHopCandidate_clone(arg); +static inline uint64_t BlindedHop_clone_ptr(LDKBlindedHop *NONNULL_PTR arg) { + LDKBlindedHop ret_var = BlindedHop_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_PrivateHopCandidate_clone_ptr(int64_t arg) { - LDKPrivateHopCandidate arg_conv; +int64_t CS_LDK_BlindedHop_clone_ptr(int64_t arg) { + LDKBlindedHop arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = PrivateHopCandidate_clone_ptr(&arg_conv); + int64_t ret_conv = BlindedHop_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_PrivateHopCandidate_clone(int64_t orig) { - LDKPrivateHopCandidate orig_conv; +int64_t CS_LDK_BlindedHop_clone(int64_t orig) { + LDKBlindedHop orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKPrivateHopCandidate ret_var = PrivateHopCandidate_clone(&orig_conv); + LDKBlindedHop ret_var = BlindedHop_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_BlindedPathCandidate_free(int64_t this_obj) { - LDKBlindedPathCandidate this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BlindedPathCandidate_free(this_obj_conv); +int64_t CS_LDK_BlindedHop_hash(int64_t o) { + LDKBlindedHop o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = BlindedHop_hash(&o_conv); + return ret_conv; } -static inline uint64_t BlindedPathCandidate_clone_ptr(LDKBlindedPathCandidate *NONNULL_PTR arg) { - LDKBlindedPathCandidate ret_var = BlindedPathCandidate_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_BlindedPathCandidate_clone_ptr(int64_t arg) { - LDKBlindedPathCandidate arg_conv; +jboolean CS_LDK_BlindedHop_eq(int64_t a, int64_t b) { + LDKBlindedHop a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKBlindedHop b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = BlindedHop_eq(&a_conv, &b_conv); + return ret_conv; +} + +int8_tArray CS_LDK_BlindedHop_write(int64_t obj) { + LDKBlindedHop obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = BlindedHop_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_BlindedHop_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); + *ret_conv = BlindedHop_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_BlindedPayInfo_free(int64_t this_obj) { + LDKBlindedPayInfo this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + BlindedPayInfo_free(this_obj_conv); +} + +int32_t CS_LDK_BlindedPayInfo_get_fee_base_msat(int64_t this_ptr) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = BlindedPayInfo_get_fee_base_msat(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_BlindedPayInfo_set_fee_base_msat(int64_t this_ptr, int32_t val) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + BlindedPayInfo_set_fee_base_msat(&this_ptr_conv, val); +} + +int32_t CS_LDK_BlindedPayInfo_get_fee_proportional_millionths(int64_t this_ptr) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = BlindedPayInfo_get_fee_proportional_millionths(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_BlindedPayInfo_set_fee_proportional_millionths(int64_t this_ptr, int32_t val) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + BlindedPayInfo_set_fee_proportional_millionths(&this_ptr_conv, val); +} + +int16_t CS_LDK_BlindedPayInfo_get_cltv_expiry_delta(int64_t this_ptr) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int16_t ret_conv = BlindedPayInfo_get_cltv_expiry_delta(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_BlindedPayInfo_set_cltv_expiry_delta(int64_t this_ptr, int16_t val) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + BlindedPayInfo_set_cltv_expiry_delta(&this_ptr_conv, val); +} + +int64_t CS_LDK_BlindedPayInfo_get_htlc_minimum_msat(int64_t this_ptr) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = BlindedPayInfo_get_htlc_minimum_msat(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_BlindedPayInfo_set_htlc_minimum_msat(int64_t this_ptr, int64_t val) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + BlindedPayInfo_set_htlc_minimum_msat(&this_ptr_conv, val); +} + +int64_t CS_LDK_BlindedPayInfo_get_htlc_maximum_msat(int64_t this_ptr) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = BlindedPayInfo_get_htlc_maximum_msat(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_BlindedPayInfo_set_htlc_maximum_msat(int64_t this_ptr, int64_t val) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + BlindedPayInfo_set_htlc_maximum_msat(&this_ptr_conv, val); +} + +int64_t CS_LDK_BlindedPayInfo_get_features(int64_t this_ptr) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBlindedHopFeatures ret_var = BlindedPayInfo_get_features(&this_ptr_conv); + int64_t ret_ref = 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_BlindedPayInfo_set_features(int64_t this_ptr, int64_t val) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBlindedHopFeatures val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = BlindedHopFeatures_clone(&val_conv); + BlindedPayInfo_set_features(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_BlindedPayInfo_new(int32_t fee_base_msat_arg, int32_t fee_proportional_millionths_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg, int64_t features_arg) { + LDKBlindedHopFeatures features_arg_conv; + features_arg_conv.inner = untag_ptr(features_arg); + features_arg_conv.is_owned = ptr_is_owned(features_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); + features_arg_conv = BlindedHopFeatures_clone(&features_arg_conv); + LDKBlindedPayInfo ret_var = BlindedPayInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, features_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t BlindedPayInfo_clone_ptr(LDKBlindedPayInfo *NONNULL_PTR arg) { + LDKBlindedPayInfo ret_var = BlindedPayInfo_clone(arg); + int64_t ret_ref = 0; + 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_BlindedPayInfo_clone_ptr(int64_t arg) { + LDKBlindedPayInfo arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = BlindedPathCandidate_clone_ptr(&arg_conv); + int64_t ret_conv = BlindedPayInfo_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_BlindedPathCandidate_clone(int64_t orig) { - LDKBlindedPathCandidate orig_conv; +int64_t CS_LDK_BlindedPayInfo_clone(int64_t orig) { + LDKBlindedPayInfo orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBlindedPathCandidate ret_var = BlindedPathCandidate_clone(&orig_conv); + LDKBlindedPayInfo ret_var = BlindedPayInfo_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_OneHopBlindedPathCandidate_free(int64_t this_obj) { - LDKOneHopBlindedPathCandidate this_obj_conv; +int64_t CS_LDK_BlindedPayInfo_hash(int64_t o) { + LDKBlindedPayInfo o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = BlindedPayInfo_hash(&o_conv); + return ret_conv; +} + +jboolean CS_LDK_BlindedPayInfo_eq(int64_t a, int64_t b) { + LDKBlindedPayInfo a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKBlindedPayInfo b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = BlindedPayInfo_eq(&a_conv, &b_conv); + return ret_conv; +} + +int8_tArray CS_LDK_BlindedPayInfo_write(int64_t obj) { + LDKBlindedPayInfo obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = BlindedPayInfo_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_BlindedPayInfo_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); + *ret_conv = BlindedPayInfo_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_BlindedPaymentPath_free(int64_t this_obj) { + LDKBlindedPaymentPath this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - OneHopBlindedPathCandidate_free(this_obj_conv); + BlindedPaymentPath_free(this_obj_conv); } -static inline uint64_t OneHopBlindedPathCandidate_clone_ptr(LDKOneHopBlindedPathCandidate *NONNULL_PTR arg) { - LDKOneHopBlindedPathCandidate ret_var = OneHopBlindedPathCandidate_clone(arg); +int64_t CS_LDK_BlindedPaymentPath_get_payinfo(int64_t this_ptr) { + LDKBlindedPaymentPath this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBlindedPayInfo ret_var = BlindedPaymentPath_get_payinfo(&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; } -int64_t CS_LDK_OneHopBlindedPathCandidate_clone_ptr(int64_t arg) { - LDKOneHopBlindedPathCandidate arg_conv; + +void CS_LDK_BlindedPaymentPath_set_payinfo(int64_t this_ptr, int64_t val) { + LDKBlindedPaymentPath this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBlindedPayInfo 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 = BlindedPayInfo_clone(&val_conv); + BlindedPaymentPath_set_payinfo(&this_ptr_conv, val_conv); +} + +static inline uint64_t BlindedPaymentPath_clone_ptr(LDKBlindedPaymentPath *NONNULL_PTR arg) { + LDKBlindedPaymentPath ret_var = BlindedPaymentPath_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_BlindedPaymentPath_clone_ptr(int64_t arg) { + LDKBlindedPaymentPath 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 = OneHopBlindedPathCandidate_clone_ptr(&arg_conv); + int64_t ret_conv = BlindedPaymentPath_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_OneHopBlindedPathCandidate_clone(int64_t orig) { - LDKOneHopBlindedPathCandidate orig_conv; +int64_t CS_LDK_BlindedPaymentPath_clone(int64_t orig) { + LDKBlindedPaymentPath 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; - LDKOneHopBlindedPathCandidate ret_var = OneHopBlindedPathCandidate_clone(&orig_conv); + LDKBlindedPaymentPath ret_var = BlindedPaymentPath_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_CandidateRouteHop_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); - LDKCandidateRouteHop this_ptr_conv = *(LDKCandidateRouteHop*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - CandidateRouteHop_free(this_ptr_conv); -} - -static inline uint64_t CandidateRouteHop_clone_ptr(LDKCandidateRouteHop *NONNULL_PTR arg) { - LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); - *ret_copy = CandidateRouteHop_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -int64_t CS_LDK_CandidateRouteHop_clone_ptr(int64_t arg) { - LDKCandidateRouteHop* arg_conv = (LDKCandidateRouteHop*)untag_ptr(arg); - int64_t ret_conv = CandidateRouteHop_clone_ptr(arg_conv); +int64_t CS_LDK_BlindedPaymentPath_hash(int64_t o) { + LDKBlindedPaymentPath o_conv; + 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 = BlindedPaymentPath_hash(&o_conv); return ret_conv; } -int64_t CS_LDK_CandidateRouteHop_clone(int64_t orig) { - LDKCandidateRouteHop* orig_conv = (LDKCandidateRouteHop*)untag_ptr(orig); - LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); - *ret_copy = CandidateRouteHop_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_CandidateRouteHop_first_hop(int64_t a) { - LDKFirstHopCandidate a_conv; +jboolean CS_LDK_BlindedPaymentPath_eq(int64_t a, int64_t b) { + LDKBlindedPaymentPath a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = FirstHopCandidate_clone(&a_conv); - LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); - *ret_copy = CandidateRouteHop_first_hop(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + a_conv.is_owned = false; + LDKBlindedPaymentPath 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 = BlindedPaymentPath_eq(&a_conv, &b_conv); + return ret_conv; } -int64_t CS_LDK_CandidateRouteHop_public_hop(int64_t a) { - LDKPublicHopCandidate a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = PublicHopCandidate_clone(&a_conv); - LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); - *ret_copy = CandidateRouteHop_public_hop(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_BlindedPaymentPath_one_hop(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); + LDKReceiveTlvs payee_tlvs_conv; + payee_tlvs_conv.inner = untag_ptr(payee_tlvs); + payee_tlvs_conv.is_owned = ptr_is_owned(payee_tlvs); + 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); + 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_BlindedPaymentPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPaymentPathNoneZ), "LDKCResult_BlindedPaymentPathNoneZ"); + *ret_conv = BlindedPaymentPath_one_hop(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_CandidateRouteHop_private_hop(int64_t a) { - LDKPrivateHopCandidate a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = PrivateHopCandidate_clone(&a_conv); - LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); - *ret_copy = CandidateRouteHop_private_hop(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_BlindedPaymentPath_new(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_PaymentForwardNodeZ intermediate_nodes_constr; + intermediate_nodes_constr.datalen = intermediate_nodes->arr_len; + if (intermediate_nodes_constr.datalen > 0) + intermediate_nodes_constr.data = MALLOC(intermediate_nodes_constr.datalen * sizeof(LDKPaymentForwardNode), "LDKCVec_PaymentForwardNodeZ Elements"); + else + intermediate_nodes_constr.data = NULL; + int64_t* intermediate_nodes_vals = intermediate_nodes->elems; + for (size_t u = 0; u < intermediate_nodes_constr.datalen; u++) { + int64_t intermediate_nodes_conv_20 = intermediate_nodes_vals[u]; + LDKPaymentForwardNode intermediate_nodes_conv_20_conv; + intermediate_nodes_conv_20_conv.inner = untag_ptr(intermediate_nodes_conv_20); + intermediate_nodes_conv_20_conv.is_owned = ptr_is_owned(intermediate_nodes_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(intermediate_nodes_conv_20_conv); + intermediate_nodes_conv_20_conv = PaymentForwardNode_clone(&intermediate_nodes_conv_20_conv); + intermediate_nodes_constr.data[u] = intermediate_nodes_conv_20_conv; + } + FREE(intermediate_nodes); + 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); + LDKReceiveTlvs payee_tlvs_conv; + payee_tlvs_conv.inner = untag_ptr(payee_tlvs); + payee_tlvs_conv.is_owned = ptr_is_owned(payee_tlvs); + 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); + 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_BlindedPaymentPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPaymentPathNoneZ), "LDKCResult_BlindedPaymentPathNoneZ"); + *ret_conv = BlindedPaymentPath_new(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_CandidateRouteHop_blinded(int64_t a) { - LDKBlindedPathCandidate a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = BlindedPathCandidate_clone(&a_conv); - LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); - *ret_copy = CandidateRouteHop_blinded(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +int64_t CS_LDK_BlindedPaymentPath_public_introduction_node_id(int64_t this_arg, int64_t network_graph) { + LDKBlindedPaymentPath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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 = BlindedPaymentPath_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; } -int64_t CS_LDK_CandidateRouteHop_one_hop_blinded(int64_t a) { - LDKOneHopBlindedPathCandidate a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = OneHopBlindedPathCandidate_clone(&a_conv); - LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); - *ret_copy = CandidateRouteHop_one_hop_blinded(a_conv); +int64_t CS_LDK_BlindedPaymentPath_introduction_node(int64_t this_arg) { + LDKBlindedPaymentPath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); + *ret_copy = BlindedPaymentPath_introduction_node(&this_arg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_CandidateRouteHop_globally_unique_short_channel_id(int64_t this_arg) { - LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = CandidateRouteHop_globally_unique_short_channel_id(this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int8_tArray CS_LDK_BlindedPaymentPath_blinding_point(int64_t this_arg) { + LDKBlindedPaymentPath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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, BlindedPaymentPath_blinding_point(&this_arg_conv).compressed_form, 33); + return ret_arr; } -int32_t CS_LDK_CandidateRouteHop_cltv_expiry_delta(int64_t this_arg) { - LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); - int32_t ret_conv = CandidateRouteHop_cltv_expiry_delta(this_arg_conv); - return ret_conv; +int64_tArray CS_LDK_BlindedPaymentPath_blinded_hops(int64_t this_arg) { + LDKBlindedPaymentPath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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_BlindedHopZ ret_var = BlindedPaymentPath_blinded_hops(&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 m = 0; m < ret_var.datalen; m++) { + LDKBlindedHop ret_conv_12_var = ret_var.data[m]; + int64_t ret_conv_12_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_var); + ret_conv_12_ref = tag_ptr(ret_conv_12_var.inner, ret_conv_12_var.is_owned); + ret_arr_ptr[m] = ret_conv_12_ref; + } + + FREE(ret_var.data); + return ret_arr; } -int64_t CS_LDK_CandidateRouteHop_htlc_minimum_msat(int64_t this_arg) { - LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); - int64_t ret_conv = CandidateRouteHop_htlc_minimum_msat(this_arg_conv); - return ret_conv; +int64_t CS_LDK_BlindedPaymentPath_advance_path_by_one(int64_t this_arg, int64_t node_signer, int64_t node_id_lookup) { + LDKBlindedPaymentPath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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* 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; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = BlindedPaymentPath_advance_path_by_one(&this_arg_conv, node_signer_conv, node_id_lookup_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CandidateRouteHop_fees(int64_t this_arg) { - LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); - LDKRoutingFees ret_var = CandidateRouteHop_fees(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_PaymentForwardNode_free(int64_t this_obj) { + LDKPaymentForwardNode this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + PaymentForwardNode_free(this_obj_conv); } -int64_t CS_LDK_CandidateRouteHop_source(int64_t this_arg) { - LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); - LDKNodeId ret_var = CandidateRouteHop_source(this_arg_conv); +int64_t CS_LDK_PaymentForwardNode_get_tlvs(int64_t this_ptr) { + LDKPaymentForwardNode this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKForwardTlvs ret_var = PaymentForwardNode_get_tlvs(&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; } -int64_t CS_LDK_CandidateRouteHop_target(int64_t this_arg) { - LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); - LDKNodeId ret_var = CandidateRouteHop_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_PaymentForwardNode_set_tlvs(int64_t this_ptr, int64_t val) { + LDKPaymentForwardNode this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKForwardTlvs 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 = ForwardTlvs_clone(&val_conv); + PaymentForwardNode_set_tlvs(&this_ptr_conv, val_conv); } -int64_t CS_LDK_find_route(int8_tArray our_node_pubkey, int64_t route_params, int64_t network_graph, int64_tArray first_hops, int64_t logger, int64_t scorer, int64_t score_params, int8_tArray random_seed_bytes) { - LDKPublicKey our_node_pubkey_ref; - CHECK(our_node_pubkey->arr_len == 33); - memcpy(our_node_pubkey_ref.compressed_form, our_node_pubkey->elems, 33); FREE(our_node_pubkey); - LDKRouteParameters route_params_conv; - route_params_conv.inner = untag_ptr(route_params); - route_params_conv.is_owned = ptr_is_owned(route_params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); - route_params_conv.is_owned = false; - LDKNetworkGraph network_graph_conv; - network_graph_conv.inner = untag_ptr(network_graph); - network_graph_conv.is_owned = ptr_is_owned(network_graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - network_graph_conv.is_owned = false; - LDKCVec_ChannelDetailsZ first_hops_constr; - LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL; - if (first_hops != NULL) { - first_hops_constr.datalen = first_hops->arr_len; - if (first_hops_constr.datalen > 0) - first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); - else - first_hops_constr.data = NULL; - int64_t* first_hops_vals = first_hops->elems; - for (size_t q = 0; q < first_hops_constr.datalen; q++) { - int64_t first_hops_conv_16 = first_hops_vals[q]; - LDKChannelDetails first_hops_conv_16_conv; - first_hops_conv_16_conv.inner = untag_ptr(first_hops_conv_16); - first_hops_conv_16_conv.is_owned = ptr_is_owned(first_hops_conv_16); - CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv); - first_hops_conv_16_conv.is_owned = false; - first_hops_constr.data[q] = first_hops_conv_16_conv; - } - FREE(first_hops); - first_hops_ptr = &first_hops_constr; - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - void* scorer_ptr = untag_ptr(scorer); - if (ptr_is_owned(scorer)) { CHECK_ACCESS(scorer_ptr); } - LDKScoreLookUp* scorer_conv = (LDKScoreLookUp*)scorer_ptr; - LDKProbabilisticScoringFeeParameters score_params_conv; - score_params_conv.inner = untag_ptr(score_params); - score_params_conv.is_owned = ptr_is_owned(score_params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(score_params_conv); - score_params_conv.is_owned = false; - uint8_t random_seed_bytes_arr[32]; - CHECK(random_seed_bytes->arr_len == 32); - memcpy(random_seed_bytes_arr, random_seed_bytes->elems, 32); FREE(random_seed_bytes); - uint8_t (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr; - LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); - *ret_conv = find_route(our_node_pubkey_ref, &route_params_conv, &network_graph_conv, first_hops_ptr, logger_conv, scorer_conv, &score_params_conv, random_seed_bytes_ref); - if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); } - return tag_ptr(ret_conv, true); +int8_tArray CS_LDK_PaymentForwardNode_get_node_id(int64_t this_ptr) { + LDKPaymentForwardNode this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(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, PaymentForwardNode_get_node_id(&this_ptr_conv).compressed_form, 33); + return ret_arr; } -int64_t CS_LDK_build_route_from_hops(int8_tArray our_node_pubkey, ptrArray hops, int64_t route_params, int64_t network_graph, int64_t logger, int8_tArray random_seed_bytes) { - LDKPublicKey our_node_pubkey_ref; - CHECK(our_node_pubkey->arr_len == 33); - memcpy(our_node_pubkey_ref.compressed_form, our_node_pubkey->elems, 33); FREE(our_node_pubkey); - LDKCVec_PublicKeyZ hops_constr; - hops_constr.datalen = hops->arr_len; - if (hops_constr.datalen > 0) - hops_constr.data = MALLOC(hops_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); - else - hops_constr.data = NULL; - int8_tArray* hops_vals = (void*) hops->elems; - for (size_t i = 0; i < hops_constr.datalen; i++) { - int8_tArray hops_conv_8 = hops_vals[i]; - LDKPublicKey hops_conv_8_ref; - CHECK(hops_conv_8->arr_len == 33); - memcpy(hops_conv_8_ref.compressed_form, hops_conv_8->elems, 33); FREE(hops_conv_8); - hops_constr.data[i] = hops_conv_8_ref; - } - FREE(hops); - LDKRouteParameters route_params_conv; - route_params_conv.inner = untag_ptr(route_params); - route_params_conv.is_owned = ptr_is_owned(route_params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); - route_params_conv.is_owned = false; - LDKNetworkGraph network_graph_conv; - network_graph_conv.inner = untag_ptr(network_graph); - network_graph_conv.is_owned = ptr_is_owned(network_graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - network_graph_conv.is_owned = false; - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - uint8_t random_seed_bytes_arr[32]; - CHECK(random_seed_bytes->arr_len == 32); - memcpy(random_seed_bytes_arr, random_seed_bytes->elems, 32); FREE(random_seed_bytes); - uint8_t (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr; - LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); - *ret_conv = build_route_from_hops(our_node_pubkey_ref, hops_constr, &route_params_conv, &network_graph_conv, logger_conv, random_seed_bytes_ref); - return tag_ptr(ret_conv, true); +void CS_LDK_PaymentForwardNode_set_node_id(int64_t this_ptr, int8_tArray val) { + LDKPaymentForwardNode this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + PaymentForwardNode_set_node_id(&this_ptr_conv, val_ref); } -void CS_LDK_ScoreLookUp_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); - LDKScoreLookUp this_ptr_conv = *(LDKScoreLookUp*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - ScoreLookUp_free(this_ptr_conv); +int64_t CS_LDK_PaymentForwardNode_get_htlc_maximum_msat(int64_t this_ptr) { + LDKPaymentForwardNode this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = PaymentForwardNode_get_htlc_maximum_msat(&this_ptr_conv); + return ret_conv; } -void CS_LDK_ScoreUpdate_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); - LDKScoreUpdate this_ptr_conv = *(LDKScoreUpdate*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - ScoreUpdate_free(this_ptr_conv); +void CS_LDK_PaymentForwardNode_set_htlc_maximum_msat(int64_t this_ptr, int64_t val) { + LDKPaymentForwardNode this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + PaymentForwardNode_set_htlc_maximum_msat(&this_ptr_conv, val); } -void CS_LDK_Score_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); - LDKScore this_ptr_conv = *(LDKScore*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Score_free(this_ptr_conv); +int64_t CS_LDK_PaymentForwardNode_new(int64_t tlvs_arg, int8_tArray node_id_arg, int64_t htlc_maximum_msat_arg) { + LDKForwardTlvs tlvs_arg_conv; + tlvs_arg_conv.inner = untag_ptr(tlvs_arg); + tlvs_arg_conv.is_owned = ptr_is_owned(tlvs_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(tlvs_arg_conv); + tlvs_arg_conv = ForwardTlvs_clone(&tlvs_arg_conv); + LDKPublicKey node_id_arg_ref; + CHECK(node_id_arg->arr_len == 33); + memcpy(node_id_arg_ref.compressed_form, node_id_arg->elems, 33); FREE(node_id_arg); + LDKPaymentForwardNode ret_var = PaymentForwardNode_new(tlvs_arg_conv, node_id_arg_ref, htlc_maximum_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); + return ret_ref; } -void CS_LDK_LockableScore_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); - LDKLockableScore this_ptr_conv = *(LDKLockableScore*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - LockableScore_free(this_ptr_conv); +static inline uint64_t PaymentForwardNode_clone_ptr(LDKPaymentForwardNode *NONNULL_PTR arg) { + LDKPaymentForwardNode ret_var = PaymentForwardNode_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_PaymentForwardNode_clone_ptr(int64_t arg) { + LDKPaymentForwardNode 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 = PaymentForwardNode_clone_ptr(&arg_conv); + return ret_conv; } -void CS_LDK_WriteableScore_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); - LDKWriteableScore this_ptr_conv = *(LDKWriteableScore*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - WriteableScore_free(this_ptr_conv); +int64_t CS_LDK_PaymentForwardNode_clone(int64_t orig) { + LDKPaymentForwardNode 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; + LDKPaymentForwardNode ret_var = PaymentForwardNode_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_MultiThreadedLockableScore_free(int64_t this_obj) { - LDKMultiThreadedLockableScore this_obj_conv; +void CS_LDK_ForwardTlvs_free(int64_t this_obj) { + LDKForwardTlvs this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - MultiThreadedLockableScore_free(this_obj_conv); + ForwardTlvs_free(this_obj_conv); } -int64_t CS_LDK_MultiThreadedLockableScore_as_LockableScore(int64_t this_arg) { - LDKMultiThreadedLockableScore this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKLockableScore* ret_ret = MALLOC(sizeof(LDKLockableScore), "LDKLockableScore"); - *ret_ret = MultiThreadedLockableScore_as_LockableScore(&this_arg_conv); - return tag_ptr(ret_ret, true); +int64_t CS_LDK_ForwardTlvs_get_short_channel_id(int64_t this_ptr) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = ForwardTlvs_get_short_channel_id(&this_ptr_conv); + return ret_conv; } -int8_tArray CS_LDK_MultiThreadedLockableScore_write(int64_t obj) { - LDKMultiThreadedLockableScore obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = MultiThreadedLockableScore_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +void CS_LDK_ForwardTlvs_set_short_channel_id(int64_t this_ptr, int64_t val) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ForwardTlvs_set_short_channel_id(&this_ptr_conv, val); } -int64_t CS_LDK_MultiThreadedLockableScore_as_WriteableScore(int64_t this_arg) { - LDKMultiThreadedLockableScore this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKWriteableScore* ret_ret = MALLOC(sizeof(LDKWriteableScore), "LDKWriteableScore"); - *ret_ret = MultiThreadedLockableScore_as_WriteableScore(&this_arg_conv); - return tag_ptr(ret_ret, true); +int64_t CS_LDK_ForwardTlvs_get_payment_relay(int64_t this_ptr) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPaymentRelay ret_var = ForwardTlvs_get_payment_relay(&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; } -int64_t CS_LDK_MultiThreadedLockableScore_new(int64_t score) { - void* score_ptr = untag_ptr(score); - CHECK_ACCESS(score_ptr); - LDKScore score_conv = *(LDKScore*)(score_ptr); - if (score_conv.free == LDKScore_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKScore_JCalls_cloned(&score_conv); - } - LDKMultiThreadedLockableScore ret_var = MultiThreadedLockableScore_new(score_conv); +void CS_LDK_ForwardTlvs_set_payment_relay(int64_t this_ptr, int64_t val) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPaymentRelay 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 = PaymentRelay_clone(&val_conv); + ForwardTlvs_set_payment_relay(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_ForwardTlvs_get_payment_constraints(int64_t this_ptr) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPaymentConstraints ret_var = ForwardTlvs_get_payment_constraints(&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_MultiThreadedScoreLockRead_free(int64_t this_obj) { - LDKMultiThreadedScoreLockRead this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - MultiThreadedScoreLockRead_free(this_obj_conv); +void CS_LDK_ForwardTlvs_set_payment_constraints(int64_t this_ptr, int64_t val) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPaymentConstraints 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 = PaymentConstraints_clone(&val_conv); + ForwardTlvs_set_payment_constraints(&this_ptr_conv, val_conv); } -void CS_LDK_MultiThreadedScoreLockWrite_free(int64_t this_obj) { - LDKMultiThreadedScoreLockWrite this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - MultiThreadedScoreLockWrite_free(this_obj_conv); +int64_t CS_LDK_ForwardTlvs_get_features(int64_t this_ptr) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBlindedHopFeatures ret_var = ForwardTlvs_get_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; } -int64_t CS_LDK_MultiThreadedScoreLockRead_as_ScoreLookUp(int64_t this_arg) { - LDKMultiThreadedScoreLockRead this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKScoreLookUp* ret_ret = MALLOC(sizeof(LDKScoreLookUp), "LDKScoreLookUp"); - *ret_ret = MultiThreadedScoreLockRead_as_ScoreLookUp(&this_arg_conv); - return tag_ptr(ret_ret, true); +void CS_LDK_ForwardTlvs_set_features(int64_t this_ptr, int64_t val) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBlindedHopFeatures val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = BlindedHopFeatures_clone(&val_conv); + ForwardTlvs_set_features(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_MultiThreadedScoreLockWrite_write(int64_t obj) { - LDKMultiThreadedScoreLockWrite 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 = MultiThreadedScoreLockWrite_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); +int8_tArray CS_LDK_ForwardTlvs_get_next_blinding_override(int64_t this_ptr) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(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, ForwardTlvs_get_next_blinding_override(&this_ptr_conv).compressed_form, 33); return ret_arr; } -int64_t CS_LDK_MultiThreadedScoreLockWrite_as_ScoreUpdate(int64_t this_arg) { - LDKMultiThreadedScoreLockWrite this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKScoreUpdate* ret_ret = MALLOC(sizeof(LDKScoreUpdate), "LDKScoreUpdate"); - *ret_ret = MultiThreadedScoreLockWrite_as_ScoreUpdate(&this_arg_conv); - return tag_ptr(ret_ret, true); +void CS_LDK_ForwardTlvs_set_next_blinding_override(int64_t this_ptr, int8_tArray val) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + ForwardTlvs_set_next_blinding_override(&this_ptr_conv, val_ref); } -void CS_LDK_ChannelUsage_free(int64_t this_obj) { - LDKChannelUsage this_obj_conv; +int64_t CS_LDK_ForwardTlvs_new(int64_t short_channel_id_arg, int64_t payment_relay_arg, int64_t payment_constraints_arg, int64_t features_arg, int8_tArray next_blinding_override_arg) { + LDKPaymentRelay payment_relay_arg_conv; + payment_relay_arg_conv.inner = untag_ptr(payment_relay_arg); + payment_relay_arg_conv.is_owned = ptr_is_owned(payment_relay_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_relay_arg_conv); + payment_relay_arg_conv = PaymentRelay_clone(&payment_relay_arg_conv); + LDKPaymentConstraints payment_constraints_arg_conv; + payment_constraints_arg_conv.inner = untag_ptr(payment_constraints_arg); + 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); + LDKBlindedHopFeatures features_arg_conv; + features_arg_conv.inner = untag_ptr(features_arg); + features_arg_conv.is_owned = ptr_is_owned(features_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); + features_arg_conv = BlindedHopFeatures_clone(&features_arg_conv); + LDKPublicKey next_blinding_override_arg_ref; + CHECK(next_blinding_override_arg->arr_len == 33); + memcpy(next_blinding_override_arg_ref.compressed_form, next_blinding_override_arg->elems, 33); FREE(next_blinding_override_arg); + LDKForwardTlvs ret_var = ForwardTlvs_new(short_channel_id_arg, payment_relay_arg_conv, payment_constraints_arg_conv, features_arg_conv, next_blinding_override_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 ForwardTlvs_clone_ptr(LDKForwardTlvs *NONNULL_PTR arg) { + LDKForwardTlvs ret_var = ForwardTlvs_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_ForwardTlvs_clone_ptr(int64_t arg) { + LDKForwardTlvs 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 = ForwardTlvs_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_ForwardTlvs_clone(int64_t orig) { + LDKForwardTlvs 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; + LDKForwardTlvs ret_var = ForwardTlvs_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_ReceiveTlvs_free(int64_t this_obj) { + LDKReceiveTlvs this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelUsage_free(this_obj_conv); + ReceiveTlvs_free(this_obj_conv); } -int64_t CS_LDK_ChannelUsage_get_amount_msat(int64_t this_ptr) { - LDKChannelUsage this_ptr_conv; +int8_tArray CS_LDK_ReceiveTlvs_get_payment_secret(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; - int64_t ret_conv = ChannelUsage_get_amount_msat(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *ReceiveTlvs_get_payment_secret(&this_ptr_conv), 32); + return ret_arr; } -void CS_LDK_ChannelUsage_set_amount_msat(int64_t this_ptr, int64_t val) { - LDKChannelUsage this_ptr_conv; +void CS_LDK_ReceiveTlvs_set_payment_secret(int64_t this_ptr, int8_tArray 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; - ChannelUsage_set_amount_msat(&this_ptr_conv, val); + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + ReceiveTlvs_set_payment_secret(&this_ptr_conv, val_ref); } -int64_t CS_LDK_ChannelUsage_get_inflight_htlc_msat(int64_t this_ptr) { - LDKChannelUsage this_ptr_conv; +int64_t CS_LDK_ReceiveTlvs_get_payment_constraints(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; - int64_t ret_conv = ChannelUsage_get_inflight_htlc_msat(&this_ptr_conv); - return ret_conv; + LDKPaymentConstraints ret_var = ReceiveTlvs_get_payment_constraints(&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_ChannelUsage_set_inflight_htlc_msat(int64_t this_ptr, int64_t val) { - LDKChannelUsage this_ptr_conv; +void CS_LDK_ReceiveTlvs_set_payment_constraints(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; - ChannelUsage_set_inflight_htlc_msat(&this_ptr_conv, val); + LDKPaymentConstraints 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 = PaymentConstraints_clone(&val_conv); + ReceiveTlvs_set_payment_constraints(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelUsage_get_effective_capacity(int64_t this_ptr) { - LDKChannelUsage this_ptr_conv; +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; - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = ChannelUsage_get_effective_capacity(&this_ptr_conv); + 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_ChannelUsage_set_effective_capacity(int64_t this_ptr, int64_t val) { - LDKChannelUsage this_ptr_conv; +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); - LDKEffectiveCapacity val_conv = *(LDKEffectiveCapacity*)(val_ptr); - val_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(val)); - ChannelUsage_set_effective_capacity(&this_ptr_conv, val_conv); + 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_ChannelUsage_new(int64_t amount_msat_arg, int64_t inflight_htlc_msat_arg, int64_t effective_capacity_arg) { - void* effective_capacity_arg_ptr = untag_ptr(effective_capacity_arg); - CHECK_ACCESS(effective_capacity_arg_ptr); - LDKEffectiveCapacity effective_capacity_arg_conv = *(LDKEffectiveCapacity*)(effective_capacity_arg_ptr); - effective_capacity_arg_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(effective_capacity_arg)); - LDKChannelUsage ret_var = ChannelUsage_new(amount_msat_arg, inflight_htlc_msat_arg, effective_capacity_arg_conv); +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); + LDKPaymentConstraints payment_constraints_arg_conv; + payment_constraints_arg_conv.inner = untag_ptr(payment_constraints_arg); + 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); + 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); return ret_ref; } -static inline uint64_t ChannelUsage_clone_ptr(LDKChannelUsage *NONNULL_PTR arg) { - LDKChannelUsage ret_var = ChannelUsage_clone(arg); +static inline uint64_t ReceiveTlvs_clone_ptr(LDKReceiveTlvs *NONNULL_PTR arg) { + LDKReceiveTlvs ret_var = ReceiveTlvs_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_ChannelUsage_clone_ptr(int64_t arg) { - LDKChannelUsage arg_conv; +int64_t CS_LDK_ReceiveTlvs_clone_ptr(int64_t arg) { + LDKReceiveTlvs arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = ChannelUsage_clone_ptr(&arg_conv); + int64_t ret_conv = ReceiveTlvs_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_ChannelUsage_clone(int64_t orig) { - LDKChannelUsage orig_conv; +int64_t CS_LDK_ReceiveTlvs_clone(int64_t orig) { + LDKReceiveTlvs orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKChannelUsage ret_var = ChannelUsage_clone(&orig_conv); + LDKReceiveTlvs ret_var = ReceiveTlvs_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_FixedPenaltyScorer_free(int64_t this_obj) { - LDKFixedPenaltyScorer this_obj_conv; +void CS_LDK_PaymentRelay_free(int64_t this_obj) { + LDKPaymentRelay this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - FixedPenaltyScorer_free(this_obj_conv); + PaymentRelay_free(this_obj_conv); } -static inline uint64_t FixedPenaltyScorer_clone_ptr(LDKFixedPenaltyScorer *NONNULL_PTR arg) { - LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_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_FixedPenaltyScorer_clone_ptr(int64_t arg) { - LDKFixedPenaltyScorer arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = FixedPenaltyScorer_clone_ptr(&arg_conv); - return ret_conv; -} - -int64_t CS_LDK_FixedPenaltyScorer_clone(int64_t orig) { - LDKFixedPenaltyScorer orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(&orig_conv); - int64_t ret_ref = 0; - 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_FixedPenaltyScorer_with_penalty(int64_t penalty_msat) { - LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_with_penalty(penalty_msat); - int64_t ret_ref = 0; - 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_FixedPenaltyScorer_as_ScoreLookUp(int64_t this_arg) { - LDKFixedPenaltyScorer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKScoreLookUp* ret_ret = MALLOC(sizeof(LDKScoreLookUp), "LDKScoreLookUp"); - *ret_ret = FixedPenaltyScorer_as_ScoreLookUp(&this_arg_conv); - return tag_ptr(ret_ret, true); -} - -int64_t CS_LDK_FixedPenaltyScorer_as_ScoreUpdate(int64_t this_arg) { - LDKFixedPenaltyScorer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKScoreUpdate* ret_ret = MALLOC(sizeof(LDKScoreUpdate), "LDKScoreUpdate"); - *ret_ret = FixedPenaltyScorer_as_ScoreUpdate(&this_arg_conv); - return tag_ptr(ret_ret, true); -} - -int8_tArray CS_LDK_FixedPenaltyScorer_write(int64_t obj) { - LDKFixedPenaltyScorer obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = FixedPenaltyScorer_write(&obj_conv); - int8_tArray 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_FixedPenaltyScorer_read(int8_tArray ser, int64_t arg) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); - *ret_conv = FixedPenaltyScorer_read(ser_ref, arg); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -void CS_LDK_ProbabilisticScorer_free(int64_t this_obj) { - LDKProbabilisticScorer this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ProbabilisticScorer_free(this_obj_conv); -} - -void CS_LDK_ProbabilisticScoringFeeParameters_free(int64_t this_obj) { - LDKProbabilisticScoringFeeParameters this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ProbabilisticScoringFeeParameters_free(this_obj_conv); -} - -int64_t CS_LDK_ProbabilisticScoringFeeParameters_get_base_penalty_msat(int64_t this_ptr) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +int16_t CS_LDK_PaymentRelay_get_cltv_expiry_delta(int64_t this_ptr) { + LDKPaymentRelay this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = ProbabilisticScoringFeeParameters_get_base_penalty_msat(&this_ptr_conv); + int16_t ret_conv = PaymentRelay_get_cltv_expiry_delta(&this_ptr_conv); return ret_conv; } -void CS_LDK_ProbabilisticScoringFeeParameters_set_base_penalty_msat(int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +void CS_LDK_PaymentRelay_set_cltv_expiry_delta(int64_t this_ptr, int16_t val) { + LDKPaymentRelay this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_base_penalty_msat(&this_ptr_conv, val); + PaymentRelay_set_cltv_expiry_delta(&this_ptr_conv, val); } -int64_t CS_LDK_ProbabilisticScoringFeeParameters_get_base_penalty_amount_multiplier_msat(int64_t this_ptr) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +int32_t CS_LDK_PaymentRelay_get_fee_proportional_millionths(int64_t this_ptr) { + LDKPaymentRelay this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = ProbabilisticScoringFeeParameters_get_base_penalty_amount_multiplier_msat(&this_ptr_conv); + int32_t ret_conv = PaymentRelay_get_fee_proportional_millionths(&this_ptr_conv); return ret_conv; } -void CS_LDK_ProbabilisticScoringFeeParameters_set_base_penalty_amount_multiplier_msat(int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +void CS_LDK_PaymentRelay_set_fee_proportional_millionths(int64_t this_ptr, int32_t val) { + LDKPaymentRelay this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_base_penalty_amount_multiplier_msat(&this_ptr_conv, val); + PaymentRelay_set_fee_proportional_millionths(&this_ptr_conv, val); } -int64_t CS_LDK_ProbabilisticScoringFeeParameters_get_liquidity_penalty_multiplier_msat(int64_t this_ptr) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +int32_t CS_LDK_PaymentRelay_get_fee_base_msat(int64_t this_ptr) { + LDKPaymentRelay this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = ProbabilisticScoringFeeParameters_get_liquidity_penalty_multiplier_msat(&this_ptr_conv); + int32_t ret_conv = PaymentRelay_get_fee_base_msat(&this_ptr_conv); return ret_conv; } -void CS_LDK_ProbabilisticScoringFeeParameters_set_liquidity_penalty_multiplier_msat(int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +void CS_LDK_PaymentRelay_set_fee_base_msat(int64_t this_ptr, int32_t val) { + LDKPaymentRelay this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_liquidity_penalty_multiplier_msat(&this_ptr_conv, val); + PaymentRelay_set_fee_base_msat(&this_ptr_conv, val); } -int64_t CS_LDK_ProbabilisticScoringFeeParameters_get_liquidity_penalty_amount_multiplier_msat(int64_t this_ptr) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = ProbabilisticScoringFeeParameters_get_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_PaymentRelay_new(int16_t cltv_expiry_delta_arg, int32_t fee_proportional_millionths_arg, int32_t fee_base_msat_arg) { + LDKPaymentRelay ret_var = PaymentRelay_new(cltv_expiry_delta_arg, fee_proportional_millionths_arg, fee_base_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); + return ret_ref; } -void CS_LDK_ProbabilisticScoringFeeParameters_set_liquidity_penalty_amount_multiplier_msat(int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val); +static inline uint64_t PaymentRelay_clone_ptr(LDKPaymentRelay *NONNULL_PTR arg) { + LDKPaymentRelay ret_var = PaymentRelay_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_ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_multiplier_msat(int64_t this_ptr) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_multiplier_msat(&this_ptr_conv); +int64_t CS_LDK_PaymentRelay_clone_ptr(int64_t arg) { + LDKPaymentRelay 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 = PaymentRelay_clone_ptr(&arg_conv); return ret_conv; } -void CS_LDK_ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_multiplier_msat(int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_multiplier_msat(&this_ptr_conv, val); -} - -int64_t CS_LDK_ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_amount_multiplier_msat(int64_t this_ptr) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_PaymentRelay_clone(int64_t orig) { + LDKPaymentRelay 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; + LDKPaymentRelay ret_var = PaymentRelay_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_ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_amount_multiplier_msat(int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val); +void CS_LDK_PaymentConstraints_free(int64_t this_obj) { + LDKPaymentConstraints this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + PaymentConstraints_free(this_obj_conv); } -int64_t CS_LDK_ProbabilisticScoringFeeParameters_get_anti_probing_penalty_msat(int64_t this_ptr) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +int32_t CS_LDK_PaymentConstraints_get_max_cltv_expiry(int64_t this_ptr) { + LDKPaymentConstraints this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = ProbabilisticScoringFeeParameters_get_anti_probing_penalty_msat(&this_ptr_conv); + int32_t ret_conv = PaymentConstraints_get_max_cltv_expiry(&this_ptr_conv); return ret_conv; } -void CS_LDK_ProbabilisticScoringFeeParameters_set_anti_probing_penalty_msat(int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +void CS_LDK_PaymentConstraints_set_max_cltv_expiry(int64_t this_ptr, int32_t val) { + LDKPaymentConstraints this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_anti_probing_penalty_msat(&this_ptr_conv, val); + PaymentConstraints_set_max_cltv_expiry(&this_ptr_conv, val); } -int64_t CS_LDK_ProbabilisticScoringFeeParameters_get_considered_impossible_penalty_msat(int64_t this_ptr) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +int64_t CS_LDK_PaymentConstraints_get_htlc_minimum_msat(int64_t this_ptr) { + LDKPaymentConstraints this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = ProbabilisticScoringFeeParameters_get_considered_impossible_penalty_msat(&this_ptr_conv); + int64_t ret_conv = PaymentConstraints_get_htlc_minimum_msat(&this_ptr_conv); return ret_conv; } -void CS_LDK_ProbabilisticScoringFeeParameters_set_considered_impossible_penalty_msat(int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_considered_impossible_penalty_msat(&this_ptr_conv, val); -} - -jboolean CS_LDK_ProbabilisticScoringFeeParameters_get_linear_success_probability(int64_t this_ptr) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +void CS_LDK_PaymentConstraints_set_htlc_minimum_msat(int64_t this_ptr, int64_t val) { + LDKPaymentConstraints this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = ProbabilisticScoringFeeParameters_get_linear_success_probability(&this_ptr_conv); - return ret_conv; + PaymentConstraints_set_htlc_minimum_msat(&this_ptr_conv, val); } -void CS_LDK_ProbabilisticScoringFeeParameters_set_linear_success_probability(int64_t this_ptr, jboolean val) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_linear_success_probability(&this_ptr_conv, val); +int64_t CS_LDK_PaymentConstraints_new(int32_t max_cltv_expiry_arg, int64_t htlc_minimum_msat_arg) { + LDKPaymentConstraints ret_var = PaymentConstraints_new(max_cltv_expiry_arg, htlc_minimum_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); + return ret_ref; } -static inline uint64_t ProbabilisticScoringFeeParameters_clone_ptr(LDKProbabilisticScoringFeeParameters *NONNULL_PTR arg) { - LDKProbabilisticScoringFeeParameters ret_var = ProbabilisticScoringFeeParameters_clone(arg); +static inline uint64_t PaymentConstraints_clone_ptr(LDKPaymentConstraints *NONNULL_PTR arg) { + LDKPaymentConstraints ret_var = PaymentConstraints_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_ProbabilisticScoringFeeParameters_clone_ptr(int64_t arg) { - LDKProbabilisticScoringFeeParameters arg_conv; +int64_t CS_LDK_PaymentConstraints_clone_ptr(int64_t arg) { + LDKPaymentConstraints 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 = ProbabilisticScoringFeeParameters_clone_ptr(&arg_conv); + int64_t ret_conv = PaymentConstraints_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_ProbabilisticScoringFeeParameters_clone(int64_t orig) { - LDKProbabilisticScoringFeeParameters orig_conv; +int64_t CS_LDK_PaymentConstraints_clone(int64_t orig) { + LDKPaymentConstraints 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; - LDKProbabilisticScoringFeeParameters ret_var = ProbabilisticScoringFeeParameters_clone(&orig_conv); + LDKPaymentConstraints ret_var = PaymentConstraints_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_ProbabilisticScoringFeeParameters_default() { - LDKProbabilisticScoringFeeParameters ret_var = ProbabilisticScoringFeeParameters_default(); - int64_t ret_ref = 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_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); } -void CS_LDK_ProbabilisticScoringFeeParameters_add_banned(int64_t this_arg, int64_t node_id) { - LDKProbabilisticScoringFeeParameters this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId node_id_conv; - node_id_conv.inner = untag_ptr(node_id); - node_id_conv.is_owned = ptr_is_owned(node_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); - node_id_conv.is_owned = false; - ProbabilisticScoringFeeParameters_add_banned(&this_arg_conv, &node_id_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; } -void CS_LDK_ProbabilisticScoringFeeParameters_add_banned_from_list(int64_t this_arg, int64_tArray node_ids) { - LDKProbabilisticScoringFeeParameters this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_NodeIdZ node_ids_constr; - node_ids_constr.datalen = node_ids->arr_len; - if (node_ids_constr.datalen > 0) - node_ids_constr.data = MALLOC(node_ids_constr.datalen * sizeof(LDKNodeId), "LDKCVec_NodeIdZ Elements"); - else - node_ids_constr.data = NULL; - int64_t* node_ids_vals = node_ids->elems; - for (size_t i = 0; i < node_ids_constr.datalen; i++) { - int64_t node_ids_conv_8 = node_ids_vals[i]; - LDKNodeId node_ids_conv_8_conv; - node_ids_conv_8_conv.inner = untag_ptr(node_ids_conv_8); - node_ids_conv_8_conv.is_owned = ptr_is_owned(node_ids_conv_8); - CHECK_INNER_FIELD_ACCESS_OR_NULL(node_ids_conv_8_conv); - node_ids_conv_8_conv = NodeId_clone(&node_ids_conv_8_conv); - node_ids_constr.data[i] = node_ids_conv_8_conv; - } - FREE(node_ids); - ProbabilisticScoringFeeParameters_add_banned_from_list(&this_arg_conv, node_ids_constr); +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; } -void CS_LDK_ProbabilisticScoringFeeParameters_remove_banned(int64_t this_arg, int64_t node_id) { - LDKProbabilisticScoringFeeParameters this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId node_id_conv; - node_id_conv.inner = untag_ptr(node_id); - node_id_conv.is_owned = ptr_is_owned(node_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); - node_id_conv.is_owned = false; - ProbabilisticScoringFeeParameters_remove_banned(&this_arg_conv, &node_id_conv); +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; } -void CS_LDK_ProbabilisticScoringFeeParameters_set_manual_penalty(int64_t this_arg, int64_t node_id, int64_t penalty) { - LDKProbabilisticScoringFeeParameters this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId node_id_conv; - node_id_conv.inner = untag_ptr(node_id); - node_id_conv.is_owned = ptr_is_owned(node_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); - node_id_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_manual_penalty(&this_arg_conv, &node_id_conv, penalty); +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; } -void CS_LDK_ProbabilisticScoringFeeParameters_remove_manual_penalty(int64_t this_arg, int64_t node_id) { - LDKProbabilisticScoringFeeParameters this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId node_id_conv; - node_id_conv.inner = untag_ptr(node_id); - node_id_conv.is_owned = ptr_is_owned(node_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); - node_id_conv.is_owned = false; - ProbabilisticScoringFeeParameters_remove_manual_penalty(&this_arg_conv, &node_id_conv); +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; } -void CS_LDK_ProbabilisticScoringFeeParameters_clear_manual_penalties(int64_t this_arg) { - LDKProbabilisticScoringFeeParameters this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - ProbabilisticScoringFeeParameters_clear_manual_penalties(&this_arg_conv); +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_ProbabilisticScoringDecayParameters_free(int64_t this_obj) { - LDKProbabilisticScoringDecayParameters this_obj_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); - ProbabilisticScoringDecayParameters_free(this_obj_conv); -} - -int64_t CS_LDK_ProbabilisticScoringDecayParameters_get_historical_no_updates_half_life(int64_t this_ptr) { - LDKProbabilisticScoringDecayParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = ProbabilisticScoringDecayParameters_get_historical_no_updates_half_life(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_ProbabilisticScoringDecayParameters_set_historical_no_updates_half_life(int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringDecayParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ProbabilisticScoringDecayParameters_set_historical_no_updates_half_life(&this_ptr_conv, val); -} - -int64_t CS_LDK_ProbabilisticScoringDecayParameters_get_liquidity_offset_half_life(int64_t this_ptr) { - LDKProbabilisticScoringDecayParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = ProbabilisticScoringDecayParameters_get_liquidity_offset_half_life(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_ProbabilisticScoringDecayParameters_set_liquidity_offset_half_life(int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringDecayParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ProbabilisticScoringDecayParameters_set_liquidity_offset_half_life(&this_ptr_conv, val); -} - -int64_t CS_LDK_ProbabilisticScoringDecayParameters_new(int64_t historical_no_updates_half_life_arg, int64_t liquidity_offset_half_life_arg) { - LDKProbabilisticScoringDecayParameters ret_var = ProbabilisticScoringDecayParameters_new(historical_no_updates_half_life_arg, liquidity_offset_half_life_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; + UnknownPaymentContext_free(this_obj_conv); } -static inline uint64_t ProbabilisticScoringDecayParameters_clone_ptr(LDKProbabilisticScoringDecayParameters *NONNULL_PTR arg) { - LDKProbabilisticScoringDecayParameters ret_var = ProbabilisticScoringDecayParameters_clone(arg); +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_ProbabilisticScoringDecayParameters_clone_ptr(int64_t arg) { - LDKProbabilisticScoringDecayParameters arg_conv; +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 = ProbabilisticScoringDecayParameters_clone_ptr(&arg_conv); + int64_t ret_conv = UnknownPaymentContext_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_ProbabilisticScoringDecayParameters_clone(int64_t orig) { - LDKProbabilisticScoringDecayParameters orig_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; - LDKProbabilisticScoringDecayParameters ret_var = ProbabilisticScoringDecayParameters_clone(&orig_conv); + 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; } -int64_t CS_LDK_ProbabilisticScoringDecayParameters_default() { - LDKProbabilisticScoringDecayParameters ret_var = ProbabilisticScoringDecayParameters_default(); - int64_t ret_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; } -int64_t CS_LDK_ProbabilisticScorer_new(int64_t decay_params, int64_t network_graph, int64_t logger) { - LDKProbabilisticScoringDecayParameters decay_params_conv; - decay_params_conv.inner = untag_ptr(decay_params); - decay_params_conv.is_owned = ptr_is_owned(decay_params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(decay_params_conv); - decay_params_conv = ProbabilisticScoringDecayParameters_clone(&decay_params_conv); - LDKNetworkGraph network_graph_conv; - network_graph_conv.inner = untag_ptr(network_graph); - network_graph_conv.is_owned = ptr_is_owned(network_graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - network_graph_conv.is_owned = false; - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKProbabilisticScorer ret_var = ProbabilisticScorer_new(decay_params_conv, &network_graph_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; -} - -void CS_LDK_ProbabilisticScorer_debug_log_liquidity_stats(int64_t this_arg) { - LDKProbabilisticScorer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - ProbabilisticScorer_debug_log_liquidity_stats(&this_arg_conv); -} - -int64_t CS_LDK_ProbabilisticScorer_estimated_channel_liquidity_range(int64_t this_arg, int64_t scid, int64_t target) { - LDKProbabilisticScorer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId target_conv; - target_conv.inner = untag_ptr(target); - target_conv.is_owned = ptr_is_owned(target); - CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); - target_conv.is_owned = false; - LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ"); - *ret_copy = ProbabilisticScorer_estimated_channel_liquidity_range(&this_arg_conv, scid, &target_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_ProbabilisticScorer_historical_estimated_channel_liquidity_probabilities(int64_t this_arg, int64_t scid, int64_t target) { - LDKProbabilisticScorer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId target_conv; - target_conv.inner = untag_ptr(target); - target_conv.is_owned = ptr_is_owned(target); - CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); - target_conv.is_owned = false; - LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ), "LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ"); - *ret_copy = ProbabilisticScorer_historical_estimated_channel_liquidity_probabilities(&this_arg_conv, scid, &target_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_ProbabilisticScorer_historical_estimated_payment_success_probability(int64_t this_arg, int64_t scid, int64_t target, int64_t amount_msat, int64_t params) { - LDKProbabilisticScorer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId target_conv; - target_conv.inner = untag_ptr(target); - target_conv.is_owned = ptr_is_owned(target); - CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); - target_conv.is_owned = false; - LDKProbabilisticScoringFeeParameters params_conv; - params_conv.inner = untag_ptr(params); - params_conv.is_owned = ptr_is_owned(params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); - params_conv.is_owned = false; - LDKCOption_f64Z *ret_copy = MALLOC(sizeof(LDKCOption_f64Z), "LDKCOption_f64Z"); - *ret_copy = ProbabilisticScorer_historical_estimated_payment_success_probability(&this_arg_conv, scid, &target_conv, amount_msat, ¶ms_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_ProbabilisticScorer_as_ScoreLookUp(int64_t this_arg) { - LDKProbabilisticScorer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKScoreLookUp* ret_ret = MALLOC(sizeof(LDKScoreLookUp), "LDKScoreLookUp"); - *ret_ret = ProbabilisticScorer_as_ScoreLookUp(&this_arg_conv); - return tag_ptr(ret_ret, true); -} - -int64_t CS_LDK_ProbabilisticScorer_as_ScoreUpdate(int64_t this_arg) { - LDKProbabilisticScorer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKScoreUpdate* ret_ret = MALLOC(sizeof(LDKScoreUpdate), "LDKScoreUpdate"); - *ret_ret = ProbabilisticScorer_as_ScoreUpdate(&this_arg_conv); - return tag_ptr(ret_ret, true); -} - -int64_t CS_LDK_ProbabilisticScorer_as_Score(int64_t this_arg) { - LDKProbabilisticScorer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore"); - *ret_ret = ProbabilisticScorer_as_Score(&this_arg_conv); - return tag_ptr(ret_ret, true); -} - -int8_tArray CS_LDK_ProbabilisticScorer_write(int64_t obj) { - LDKProbabilisticScorer obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ProbabilisticScorer_write(&obj_conv); - int8_tArray 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_ProbabilisticScorer_read(int8_tArray ser, int64_t arg_a, int64_t arg_b, int64_t arg_c) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKProbabilisticScoringDecayParameters arg_a_conv; - arg_a_conv.inner = untag_ptr(arg_a); - arg_a_conv.is_owned = ptr_is_owned(arg_a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_a_conv); - arg_a_conv = ProbabilisticScoringDecayParameters_clone(&arg_a_conv); - LDKNetworkGraph arg_b_conv; - arg_b_conv.inner = untag_ptr(arg_b); - arg_b_conv.is_owned = ptr_is_owned(arg_b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_b_conv); - arg_b_conv.is_owned = false; - void* arg_c_ptr = untag_ptr(arg_c); - CHECK_ACCESS(arg_c_ptr); - LDKLogger arg_c_conv = *(LDKLogger*)(arg_c_ptr); - if (arg_c_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&arg_c_conv); - } - LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ"); - *ret_conv = ProbabilisticScorer_read(ser_ref, arg_a_conv, &arg_b_conv, arg_c_conv); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -void CS_LDK_DelayedPaymentOutputDescriptor_free(int64_t this_obj) { - LDKDelayedPaymentOutputDescriptor this_obj_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); - DelayedPaymentOutputDescriptor_free(this_obj_conv); + Bolt12OfferContext_free(this_obj_conv); } -int64_t CS_LDK_DelayedPaymentOutputDescriptor_get_outpoint(int64_t this_ptr) { - LDKDelayedPaymentOutputDescriptor this_ptr_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; - LDKOutPoint ret_var = DelayedPaymentOutputDescriptor_get_outpoint(&this_ptr_conv); + 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_DelayedPaymentOutputDescriptor_set_outpoint(int64_t this_ptr, int64_t val) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; +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; - LDKOutPoint val_conv; + 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 = OutPoint_clone(&val_conv); - DelayedPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv); -} - -int8_tArray CS_LDK_DelayedPaymentOutputDescriptor_get_per_commitment_point(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; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, DelayedPaymentOutputDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form, 33); - return ret_arr; -} - -void CS_LDK_DelayedPaymentOutputDescriptor_set_per_commitment_point(int64_t this_ptr, int8_tArray 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; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - DelayedPaymentOutputDescriptor_set_per_commitment_point(&this_ptr_conv, val_ref); -} - -int16_t CS_LDK_DelayedPaymentOutputDescriptor_get_to_self_delay(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; - int16_t ret_conv = DelayedPaymentOutputDescriptor_get_to_self_delay(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_DelayedPaymentOutputDescriptor_set_to_self_delay(int64_t this_ptr, int16_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; - DelayedPaymentOutputDescriptor_set_to_self_delay(&this_ptr_conv, val); -} - -int64_t CS_LDK_DelayedPaymentOutputDescriptor_get_output(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; - LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); - *ret_ref = DelayedPaymentOutputDescriptor_get_output(&this_ptr_conv); - return tag_ptr(ret_ref, true); -} - -void CS_LDK_DelayedPaymentOutputDescriptor_set_output(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; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); - val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val)); - DelayedPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv); + val_conv = OfferId_clone(&val_conv); + Bolt12OfferContext_set_offer_id(&this_ptr_conv, val_conv); } -int64_t CS_LDK_DelayedPaymentOutputDescriptor_get_revocation_pubkey(int64_t this_ptr) { - LDKDelayedPaymentOutputDescriptor this_ptr_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; - LDKRevocationKey ret_var = DelayedPaymentOutputDescriptor_get_revocation_pubkey(&this_ptr_conv); + 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_DelayedPaymentOutputDescriptor_set_revocation_pubkey(int64_t this_ptr, int64_t val) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; +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; - LDKRevocationKey val_conv; + 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 = RevocationKey_clone(&val_conv); - DelayedPaymentOutputDescriptor_set_revocation_pubkey(&this_ptr_conv, val_conv); + val_conv = InvoiceRequestFields_clone(&val_conv); + Bolt12OfferContext_set_invoice_request(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_DelayedPaymentOutputDescriptor_get_channel_keys_id(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; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *DelayedPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv), 32); - return ret_arr; +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; } -void CS_LDK_DelayedPaymentOutputDescriptor_set_channel_keys_id(int64_t this_ptr, int8_tArray 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; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - DelayedPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_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_DelayedPaymentOutputDescriptor_get_channel_value_satoshis(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; - int64_t ret_conv = DelayedPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv); +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; } -void CS_LDK_DelayedPaymentOutputDescriptor_set_channel_value_satoshis(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; - DelayedPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); -} - -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 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; } -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); +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; } -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); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); - outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); - 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); - void* output_arg_ptr = untag_ptr(output_arg); - CHECK_ACCESS(output_arg_ptr); - LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr); - output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg)); - LDKRevocationKey revocation_pubkey_arg_conv; - revocation_pubkey_arg_conv.inner = untag_ptr(revocation_pubkey_arg); - revocation_pubkey_arg_conv.is_owned = ptr_is_owned(revocation_pubkey_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(revocation_pubkey_arg_conv); - revocation_pubkey_arg_conv = RevocationKey_clone(&revocation_pubkey_arg_conv); - 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); - 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); +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 DelayedPaymentOutputDescriptor_clone_ptr(LDKDelayedPaymentOutputDescriptor *NONNULL_PTR arg) { - LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(arg); +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_DelayedPaymentOutputDescriptor_clone_ptr(int64_t arg) { - LDKDelayedPaymentOutputDescriptor arg_conv; +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 = DelayedPaymentOutputDescriptor_clone_ptr(&arg_conv); + int64_t ret_conv = Bolt12RefundContext_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_DelayedPaymentOutputDescriptor_clone(int64_t orig) { - LDKDelayedPaymentOutputDescriptor orig_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; - LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(&orig_conv); + 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; } -int64_t CS_LDK_DelayedPaymentOutputDescriptor_hash(int64_t o) { - LDKDelayedPaymentOutputDescriptor o_conv; - 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 = DelayedPaymentOutputDescriptor_hash(&o_conv); - return ret_conv; -} - -jboolean CS_LDK_DelayedPaymentOutputDescriptor_eq(int64_t a, int64_t b) { - LDKDelayedPaymentOutputDescriptor a_conv; +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; - LDKDelayedPaymentOutputDescriptor b_conv; + 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 = DelayedPaymentOutputDescriptor_eq(&a_conv, &b_conv); + jboolean ret_conv = Bolt12RefundContext_eq(&a_conv, &b_conv); return ret_conv; } -int8_tArray CS_LDK_DelayedPaymentOutputDescriptor_write(int64_t obj) { - LDKDelayedPaymentOutputDescriptor obj_conv; +int8_tArray CS_LDK_ForwardTlvs_write(int64_t obj) { + LDKForwardTlvs 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 = DelayedPaymentOutputDescriptor_write(&obj_conv); + LDKCVec_u8Z ret_var = ForwardTlvs_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_DelayedPaymentOutputDescriptor_read(int8_tArray ser) { +int8_tArray CS_LDK_ReceiveTlvs_write(int64_t obj) { + LDKReceiveTlvs 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 = ReceiveTlvs_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_PaymentRelay_write(int64_t obj) { + LDKPaymentRelay 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 = PaymentRelay_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_PaymentRelay_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); - *ret_conv = DelayedPaymentOutputDescriptor_read(ser_ref); + LDKCResult_PaymentRelayDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentRelayDecodeErrorZ), "LDKCResult_PaymentRelayDecodeErrorZ"); + *ret_conv = PaymentRelay_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_StaticPaymentOutputDescriptor_free(int64_t this_obj) { - LDKStaticPaymentOutputDescriptor this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - StaticPaymentOutputDescriptor_free(this_obj_conv); +int8_tArray CS_LDK_PaymentConstraints_write(int64_t obj) { + LDKPaymentConstraints 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 = PaymentConstraints_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_StaticPaymentOutputDescriptor_get_outpoint(int64_t this_ptr) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKOutPoint ret_var = StaticPaymentOutputDescriptor_get_outpoint(&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; +int64_t CS_LDK_PaymentConstraints_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_PaymentConstraintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentConstraintsDecodeErrorZ), "LDKCResult_PaymentConstraintsDecodeErrorZ"); + *ret_conv = PaymentConstraints_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -void CS_LDK_StaticPaymentOutputDescriptor_set_outpoint(int64_t this_ptr, int64_t val) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKOutPoint val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = OutPoint_clone(&val_conv); - StaticPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv); -} - -int64_t CS_LDK_StaticPaymentOutputDescriptor_get_output(int64_t this_ptr) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); - *ret_ref = StaticPaymentOutputDescriptor_get_output(&this_ptr_conv); - return tag_ptr(ret_ref, 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; } -void CS_LDK_StaticPaymentOutputDescriptor_set_output(int64_t this_ptr, int64_t val) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); - val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val)); - StaticPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv); +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_StaticPaymentOutputDescriptor_get_channel_keys_id(int64_t this_ptr) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(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, *StaticPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv), 32); +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; } -void CS_LDK_StaticPaymentOutputDescriptor_set_channel_keys_id(int64_t this_ptr, int8_tArray val) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - StaticPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref); +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); } -int64_t CS_LDK_StaticPaymentOutputDescriptor_get_channel_value_satoshis(int64_t this_ptr) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = StaticPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv); - return ret_conv; +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; } -void CS_LDK_StaticPaymentOutputDescriptor_set_channel_value_satoshis(int64_t this_ptr, int64_t val) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - StaticPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); +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); } -int64_t CS_LDK_StaticPaymentOutputDescriptor_get_channel_transaction_parameters(int64_t this_ptr) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = StaticPaymentOutputDescriptor_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; +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; } -void CS_LDK_StaticPaymentOutputDescriptor_set_channel_transaction_parameters(int64_t this_ptr, int64_t val) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - StaticPaymentOutputDescriptor_set_channel_transaction_parameters(&this_ptr_conv, val_conv); +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); } -int64_t CS_LDK_StaticPaymentOutputDescriptor_new(int64_t outpoint_arg, int64_t output_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); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); - outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); - void* output_arg_ptr = untag_ptr(output_arg); - CHECK_ACCESS(output_arg_ptr); - LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr); - output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg)); - 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); - 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); - LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_new(outpoint_arg_conv, output_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); - return ret_ref; +void CS_LDK_BlindedMessagePath_free(int64_t this_obj) { + LDKBlindedMessagePath this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + BlindedMessagePath_free(this_obj_conv); } -static inline uint64_t StaticPaymentOutputDescriptor_clone_ptr(LDKStaticPaymentOutputDescriptor *NONNULL_PTR arg) { - LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(arg); +static inline uint64_t BlindedMessagePath_clone_ptr(LDKBlindedMessagePath *NONNULL_PTR arg) { + LDKBlindedMessagePath ret_var = BlindedMessagePath_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_StaticPaymentOutputDescriptor_clone_ptr(int64_t arg) { - LDKStaticPaymentOutputDescriptor arg_conv; +int64_t CS_LDK_BlindedMessagePath_clone_ptr(int64_t arg) { + LDKBlindedMessagePath 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 = StaticPaymentOutputDescriptor_clone_ptr(&arg_conv); + int64_t ret_conv = BlindedMessagePath_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_StaticPaymentOutputDescriptor_clone(int64_t orig) { - LDKStaticPaymentOutputDescriptor orig_conv; +int64_t CS_LDK_BlindedMessagePath_clone(int64_t orig) { + LDKBlindedMessagePath 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; - LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(&orig_conv); + LDKBlindedMessagePath ret_var = BlindedMessagePath_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_StaticPaymentOutputDescriptor_hash(int64_t o) { - LDKStaticPaymentOutputDescriptor o_conv; +int64_t CS_LDK_BlindedMessagePath_hash(int64_t o) { + LDKBlindedMessagePath o_conv; 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 = StaticPaymentOutputDescriptor_hash(&o_conv); + int64_t ret_conv = BlindedMessagePath_hash(&o_conv); return ret_conv; } -jboolean CS_LDK_StaticPaymentOutputDescriptor_eq(int64_t a, int64_t b) { - LDKStaticPaymentOutputDescriptor a_conv; +jboolean CS_LDK_BlindedMessagePath_eq(int64_t a, int64_t b) { + LDKBlindedMessagePath a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKStaticPaymentOutputDescriptor b_conv; + LDKBlindedMessagePath b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = StaticPaymentOutputDescriptor_eq(&a_conv, &b_conv); + jboolean ret_conv = BlindedMessagePath_eq(&a_conv, &b_conv); return ret_conv; } -int64_t CS_LDK_StaticPaymentOutputDescriptor_witness_script(int64_t this_arg) { - LDKStaticPaymentOutputDescriptor this_arg_conv; +int8_tArray CS_LDK_BlindedMessagePath_write(int64_t obj) { + LDKBlindedMessagePath 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 = BlindedMessagePath_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_BlindedMessagePath_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_BlindedMessagePathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathDecodeErrorZ), "LDKCResult_BlindedMessagePathDecodeErrorZ"); + *ret_conv = BlindedMessagePath_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_BlindedMessagePath_one_hop(int8_tArray recipient_node_id, int64_t context, int64_t entropy_source) { + LDKPublicKey recipient_node_id_ref; + CHECK(recipient_node_id->arr_len == 33); + memcpy(recipient_node_id_ref.compressed_form, recipient_node_id->elems, 33); FREE(recipient_node_id); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKMessageContext context_conv = *(LDKMessageContext*)(context_ptr); + context_conv = MessageContext_clone((LDKMessageContext*)untag_ptr(context)); + 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); + } + LDKCResult_BlindedMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathNoneZ), "LDKCResult_BlindedMessagePathNoneZ"); + *ret_conv = BlindedMessagePath_one_hop(recipient_node_id_ref, context_conv, entropy_source_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_BlindedMessagePath_new(int64_tArray intermediate_nodes, int8_tArray recipient_node_id, int64_t context, int64_t entropy_source) { + LDKCVec_MessageForwardNodeZ intermediate_nodes_constr; + intermediate_nodes_constr.datalen = intermediate_nodes->arr_len; + if (intermediate_nodes_constr.datalen > 0) + intermediate_nodes_constr.data = MALLOC(intermediate_nodes_constr.datalen * sizeof(LDKMessageForwardNode), "LDKCVec_MessageForwardNodeZ Elements"); + else + intermediate_nodes_constr.data = NULL; + int64_t* intermediate_nodes_vals = intermediate_nodes->elems; + for (size_t u = 0; u < intermediate_nodes_constr.datalen; u++) { + int64_t intermediate_nodes_conv_20 = intermediate_nodes_vals[u]; + LDKMessageForwardNode intermediate_nodes_conv_20_conv; + intermediate_nodes_conv_20_conv.inner = untag_ptr(intermediate_nodes_conv_20); + intermediate_nodes_conv_20_conv.is_owned = ptr_is_owned(intermediate_nodes_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(intermediate_nodes_conv_20_conv); + intermediate_nodes_conv_20_conv = MessageForwardNode_clone(&intermediate_nodes_conv_20_conv); + intermediate_nodes_constr.data[u] = intermediate_nodes_conv_20_conv; + } + FREE(intermediate_nodes); + LDKPublicKey recipient_node_id_ref; + CHECK(recipient_node_id->arr_len == 33); + memcpy(recipient_node_id_ref.compressed_form, recipient_node_id->elems, 33); FREE(recipient_node_id); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKMessageContext context_conv = *(LDKMessageContext*)(context_ptr); + context_conv = MessageContext_clone((LDKMessageContext*)untag_ptr(context)); + 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); + } + LDKCResult_BlindedMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathNoneZ), "LDKCResult_BlindedMessagePathNoneZ"); + *ret_conv = BlindedMessagePath_new(intermediate_nodes_constr, recipient_node_id_ref, context_conv, entropy_source_conv); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_BlindedMessagePath_use_compact_introduction_node(int64_t this_arg, int64_t network_graph) { + LDKBlindedMessagePath this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = StaticPaymentOutputDescriptor_witness_script(&this_arg_conv); + 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; + BlindedMessagePath_use_compact_introduction_node(&this_arg_conv, &network_graph_conv); +} + +int64_t CS_LDK_BlindedMessagePath_public_introduction_node_id(int64_t this_arg, int64_t network_graph) { + LDKBlindedMessagePath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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 = BlindedMessagePath_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; +} + +int64_t CS_LDK_BlindedMessagePath_introduction_node(int64_t this_arg) { + LDKBlindedMessagePath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); + *ret_copy = BlindedMessagePath_introduction_node(&this_arg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_StaticPaymentOutputDescriptor_max_witness_length(int64_t this_arg) { - LDKStaticPaymentOutputDescriptor this_arg_conv; +int8_tArray CS_LDK_BlindedMessagePath_blinding_point(int64_t this_arg) { + LDKBlindedMessagePath this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - int64_t ret_conv = StaticPaymentOutputDescriptor_max_witness_length(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, BlindedMessagePath_blinding_point(&this_arg_conv).compressed_form, 33); + return ret_arr; } -int8_tArray CS_LDK_StaticPaymentOutputDescriptor_write(int64_t obj) { - LDKStaticPaymentOutputDescriptor 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 = StaticPaymentOutputDescriptor_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); +int64_tArray CS_LDK_BlindedMessagePath_blinded_hops(int64_t this_arg) { + LDKBlindedMessagePath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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_BlindedHopZ ret_var = BlindedMessagePath_blinded_hops(&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 m = 0; m < ret_var.datalen; m++) { + LDKBlindedHop ret_conv_12_var = ret_var.data[m]; + int64_t ret_conv_12_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_var); + ret_conv_12_ref = tag_ptr(ret_conv_12_var.inner, ret_conv_12_var.is_owned); + ret_arr_ptr[m] = ret_conv_12_ref; + } + + FREE(ret_var.data); return ret_arr; } -int64_t CS_LDK_StaticPaymentOutputDescriptor_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); - *ret_conv = StaticPaymentOutputDescriptor_read(ser_ref); - FREE(ser); +int64_t CS_LDK_BlindedMessagePath_advance_path_by_one(int64_t this_arg, int64_t node_signer, int64_t node_id_lookup) { + LDKBlindedMessagePath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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* 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; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = BlindedMessagePath_advance_path_by_one(&this_arg_conv, node_signer_conv, node_id_lookup_conv); return tag_ptr(ret_conv, true); } -void CS_LDK_SpendableOutputDescriptor_free(int64_t this_ptr) { +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); - LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)(this_ptr_ptr); + LDKNextMessageHop this_ptr_conv = *(LDKNextMessageHop*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - SpendableOutputDescriptor_free(this_ptr_conv); + NextMessageHop_free(this_ptr_conv); } -static inline uint64_t SpendableOutputDescriptor_clone_ptr(LDKSpendableOutputDescriptor *NONNULL_PTR arg) { - LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_copy = SpendableOutputDescriptor_clone(arg); +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_SpendableOutputDescriptor_clone_ptr(int64_t arg) { - LDKSpendableOutputDescriptor* arg_conv = (LDKSpendableOutputDescriptor*)untag_ptr(arg); - int64_t ret_conv = SpendableOutputDescriptor_clone_ptr(arg_conv); +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_SpendableOutputDescriptor_clone(int64_t orig) { - LDKSpendableOutputDescriptor* orig_conv = (LDKSpendableOutputDescriptor*)untag_ptr(orig); - LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_copy = SpendableOutputDescriptor_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_SpendableOutputDescriptor_static_output(int64_t outpoint, int64_t output, int8_tArray channel_keys_id) { - 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); - void* output_ptr = untag_ptr(output); - CHECK_ACCESS(output_ptr); - LDKTxOut output_conv = *(LDKTxOut*)(output_ptr); - output_conv = TxOut_clone((LDKTxOut*)untag_ptr(output)); - LDKThirtyTwoBytes channel_keys_id_ref; - CHECK(channel_keys_id->arr_len == 32); - memcpy(channel_keys_id_ref.data, channel_keys_id->elems, 32); FREE(channel_keys_id); - LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_copy = SpendableOutputDescriptor_static_output(outpoint_conv, output_conv, channel_keys_id_ref); +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_SpendableOutputDescriptor_delayed_payment_output(int64_t a) { - LDKDelayedPaymentOutputDescriptor a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = DelayedPaymentOutputDescriptor_clone(&a_conv); - LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_copy = SpendableOutputDescriptor_delayed_payment_output(a_conv); +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_SpendableOutputDescriptor_static_payment_output(int64_t a) { - LDKStaticPaymentOutputDescriptor a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = StaticPaymentOutputDescriptor_clone(&a_conv); - LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_copy = SpendableOutputDescriptor_static_payment_output(a_conv); +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_SpendableOutputDescriptor_hash(int64_t o) { - LDKSpendableOutputDescriptor* o_conv = (LDKSpendableOutputDescriptor*)untag_ptr(o); - int64_t ret_conv = SpendableOutputDescriptor_hash(o_conv); +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_SpendableOutputDescriptor_eq(int64_t a, int64_t b) { - LDKSpendableOutputDescriptor* a_conv = (LDKSpendableOutputDescriptor*)untag_ptr(a); - LDKSpendableOutputDescriptor* b_conv = (LDKSpendableOutputDescriptor*)untag_ptr(b); - jboolean ret_conv = SpendableOutputDescriptor_eq(a_conv, b_conv); +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; } -int8_tArray CS_LDK_SpendableOutputDescriptor_write(int64_t obj) { - LDKSpendableOutputDescriptor* obj_conv = (LDKSpendableOutputDescriptor*)untag_ptr(obj); - LDKCVec_u8Z ret_var = SpendableOutputDescriptor_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_SpendableOutputDescriptor_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); - *ret_conv = SpendableOutputDescriptor_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_SpendableOutputDescriptor_create_spendable_outputs_psbt(int64_tArray descriptors, int64_tArray outputs, int8_tArray change_destination_script, int32_t feerate_sat_per_1000_weight, int64_t locktime) { - 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_C2Tuple_CVec_u8Zu64ZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ), "LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ"); - *ret_conv = SpendableOutputDescriptor_create_spendable_outputs_psbt(descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight, locktime_conv); - return tag_ptr(ret_conv, true); -} - -void CS_LDK_ChannelDerivationParameters_free(int64_t this_obj) { - LDKChannelDerivationParameters this_obj_conv; +void CS_LDK_MessageForwardNode_free(int64_t this_obj) { + LDKMessageForwardNode this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelDerivationParameters_free(this_obj_conv); + MessageForwardNode_free(this_obj_conv); } -int64_t CS_LDK_ChannelDerivationParameters_get_value_satoshis(int64_t this_ptr) { - LDKChannelDerivationParameters this_ptr_conv; +int8_tArray CS_LDK_MessageForwardNode_get_node_id(int64_t this_ptr) { + LDKMessageForwardNode this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = ChannelDerivationParameters_get_value_satoshis(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, MessageForwardNode_get_node_id(&this_ptr_conv).compressed_form, 33); + return ret_arr; } -void CS_LDK_ChannelDerivationParameters_set_value_satoshis(int64_t this_ptr, int64_t val) { - LDKChannelDerivationParameters this_ptr_conv; +void CS_LDK_MessageForwardNode_set_node_id(int64_t this_ptr, int8_tArray val) { + LDKMessageForwardNode this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelDerivationParameters_set_value_satoshis(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + MessageForwardNode_set_node_id(&this_ptr_conv, val_ref); } -int8_tArray CS_LDK_ChannelDerivationParameters_get_keys_id(int64_t this_ptr) { - LDKChannelDerivationParameters this_ptr_conv; +int64_t CS_LDK_MessageForwardNode_get_short_channel_id(int64_t this_ptr) { + LDKMessageForwardNode this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(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, *ChannelDerivationParameters_get_keys_id(&this_ptr_conv), 32); - return ret_arr; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = MessageForwardNode_get_short_channel_id(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_ChannelDerivationParameters_set_keys_id(int64_t this_ptr, int8_tArray val) { - LDKChannelDerivationParameters this_ptr_conv; +void CS_LDK_MessageForwardNode_set_short_channel_id(int64_t this_ptr, int64_t val) { + LDKMessageForwardNode this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - ChannelDerivationParameters_set_keys_id(&this_ptr_conv, val_ref); -} - -int64_t CS_LDK_ChannelDerivationParameters_get_transaction_parameters(int64_t this_ptr) { - LDKChannelDerivationParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = ChannelDerivationParameters_get_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_ChannelDerivationParameters_set_transaction_parameters(int64_t this_ptr, int64_t val) { - LDKChannelDerivationParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - ChannelDerivationParameters_set_transaction_parameters(&this_ptr_conv, val_conv); + 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)); + MessageForwardNode_set_short_channel_id(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelDerivationParameters_new(int64_t value_satoshis_arg, int8_tArray keys_id_arg, int64_t transaction_parameters_arg) { - LDKThirtyTwoBytes keys_id_arg_ref; - CHECK(keys_id_arg->arr_len == 32); - memcpy(keys_id_arg_ref.data, keys_id_arg->elems, 32); FREE(keys_id_arg); - LDKChannelTransactionParameters transaction_parameters_arg_conv; - transaction_parameters_arg_conv.inner = untag_ptr(transaction_parameters_arg); - transaction_parameters_arg_conv.is_owned = ptr_is_owned(transaction_parameters_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(transaction_parameters_arg_conv); - transaction_parameters_arg_conv = ChannelTransactionParameters_clone(&transaction_parameters_arg_conv); - LDKChannelDerivationParameters ret_var = ChannelDerivationParameters_new(value_satoshis_arg, keys_id_arg_ref, transaction_parameters_arg_conv); +int64_t CS_LDK_MessageForwardNode_new(int8_tArray node_id_arg, int64_t short_channel_id_arg) { + LDKPublicKey node_id_arg_ref; + CHECK(node_id_arg->arr_len == 33); + memcpy(node_id_arg_ref.compressed_form, node_id_arg->elems, 33); FREE(node_id_arg); + 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)); + LDKMessageForwardNode ret_var = MessageForwardNode_new(node_id_arg_ref, short_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); return ret_ref; } -static inline uint64_t ChannelDerivationParameters_clone_ptr(LDKChannelDerivationParameters *NONNULL_PTR arg) { - LDKChannelDerivationParameters ret_var = ChannelDerivationParameters_clone(arg); +static inline uint64_t MessageForwardNode_clone_ptr(LDKMessageForwardNode *NONNULL_PTR arg) { + LDKMessageForwardNode ret_var = MessageForwardNode_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_ChannelDerivationParameters_clone_ptr(int64_t arg) { - LDKChannelDerivationParameters arg_conv; +int64_t CS_LDK_MessageForwardNode_clone_ptr(int64_t arg) { + LDKMessageForwardNode 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 = ChannelDerivationParameters_clone_ptr(&arg_conv); + int64_t ret_conv = MessageForwardNode_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_ChannelDerivationParameters_clone(int64_t orig) { - LDKChannelDerivationParameters orig_conv; +int64_t CS_LDK_MessageForwardNode_clone(int64_t orig) { + LDKMessageForwardNode 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; - LDKChannelDerivationParameters ret_var = ChannelDerivationParameters_clone(&orig_conv); + LDKMessageForwardNode ret_var = MessageForwardNode_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_ChannelDerivationParameters_eq(int64_t a, int64_t b) { - LDKChannelDerivationParameters a_conv; +int64_t CS_LDK_MessageForwardNode_hash(int64_t o) { + LDKMessageForwardNode o_conv; + 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 = MessageForwardNode_hash(&o_conv); + return ret_conv; +} + +jboolean CS_LDK_MessageForwardNode_eq(int64_t a, int64_t b) { + LDKMessageForwardNode a_conv; 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; - LDKChannelDerivationParameters b_conv; + LDKMessageForwardNode 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 = ChannelDerivationParameters_eq(&a_conv, &b_conv); + jboolean ret_conv = MessageForwardNode_eq(&a_conv, &b_conv); return ret_conv; } -int8_tArray CS_LDK_ChannelDerivationParameters_write(int64_t obj) { - LDKChannelDerivationParameters 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 = ChannelDerivationParameters_write(&obj_conv); +void CS_LDK_MessageContext_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); + LDKMessageContext this_ptr_conv = *(LDKMessageContext*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + MessageContext_free(this_ptr_conv); +} + +static inline uint64_t MessageContext_clone_ptr(LDKMessageContext *NONNULL_PTR arg) { + LDKMessageContext *ret_copy = MALLOC(sizeof(LDKMessageContext), "LDKMessageContext"); + *ret_copy = MessageContext_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_MessageContext_clone_ptr(int64_t arg) { + LDKMessageContext* arg_conv = (LDKMessageContext*)untag_ptr(arg); + int64_t ret_conv = MessageContext_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_MessageContext_clone(int64_t orig) { + LDKMessageContext* orig_conv = (LDKMessageContext*)untag_ptr(orig); + LDKMessageContext *ret_copy = MALLOC(sizeof(LDKMessageContext), "LDKMessageContext"); + *ret_copy = MessageContext_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_MessageContext_offers(int64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKOffersContext a_conv = *(LDKOffersContext*)(a_ptr); + a_conv = OffersContext_clone((LDKOffersContext*)untag_ptr(a)); + LDKMessageContext *ret_copy = MALLOC(sizeof(LDKMessageContext), "LDKMessageContext"); + *ret_copy = MessageContext_offers(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_MessageContext_custom(int8_tArray a) { + LDKCVec_u8Z a_ref; + a_ref.datalen = a->arr_len; + a_ref.data = MALLOC(a_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(a_ref.data, a->elems, a_ref.datalen); FREE(a); + LDKMessageContext *ret_copy = MALLOC(sizeof(LDKMessageContext), "LDKMessageContext"); + *ret_copy = MessageContext_custom(a_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_OffersContext_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); + LDKOffersContext this_ptr_conv = *(LDKOffersContext*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + OffersContext_free(this_ptr_conv); +} + +static inline uint64_t OffersContext_clone_ptr(LDKOffersContext *NONNULL_PTR arg) { + LDKOffersContext *ret_copy = MALLOC(sizeof(LDKOffersContext), "LDKOffersContext"); + *ret_copy = OffersContext_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_OffersContext_clone_ptr(int64_t arg) { + LDKOffersContext* arg_conv = (LDKOffersContext*)untag_ptr(arg); + int64_t ret_conv = OffersContext_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_OffersContext_clone(int64_t orig) { + LDKOffersContext* orig_conv = (LDKOffersContext*)untag_ptr(orig); + LDKOffersContext *ret_copy = MALLOC(sizeof(LDKOffersContext), "LDKOffersContext"); + *ret_copy = OffersContext_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_OffersContext_invoice_request(int64_t nonce) { + LDKNonce nonce_conv; + nonce_conv.inner = untag_ptr(nonce); + nonce_conv.is_owned = ptr_is_owned(nonce); + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_conv); + nonce_conv = Nonce_clone(&nonce_conv); + LDKOffersContext *ret_copy = MALLOC(sizeof(LDKOffersContext), "LDKOffersContext"); + *ret_copy = OffersContext_invoice_request(nonce_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_OffersContext_outbound_payment(int8_tArray payment_id, int64_t nonce, int8_tArray hmac) { + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + LDKNonce nonce_conv; + nonce_conv.inner = untag_ptr(nonce); + nonce_conv.is_owned = ptr_is_owned(nonce); + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_conv); + nonce_conv = Nonce_clone(&nonce_conv); + LDKThirtyTwoBytes hmac_ref; + CHECK(hmac->arr_len == 32); + memcpy(hmac_ref.data, hmac->elems, 32); FREE(hmac); + LDKOffersContext *ret_copy = MALLOC(sizeof(LDKOffersContext), "LDKOffersContext"); + *ret_copy = OffersContext_outbound_payment(payment_id_ref, nonce_conv, hmac_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_OffersContext_inbound_payment(int8_tArray payment_hash) { + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKOffersContext *ret_copy = MALLOC(sizeof(LDKOffersContext), "LDKOffersContext"); + *ret_copy = OffersContext_inbound_payment(payment_hash_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +jboolean CS_LDK_OffersContext_eq(int64_t a, int64_t b) { + LDKOffersContext* a_conv = (LDKOffersContext*)untag_ptr(a); + LDKOffersContext* b_conv = (LDKOffersContext*)untag_ptr(b); + jboolean ret_conv = OffersContext_eq(a_conv, b_conv); + return ret_conv; +} + +int8_tArray CS_LDK_MessageContext_write(int64_t obj) { + LDKMessageContext* obj_conv = (LDKMessageContext*)untag_ptr(obj); + LDKCVec_u8Z ret_var = MessageContext_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_ChannelDerivationParameters_read(int8_tArray ser) { +int64_t CS_LDK_MessageContext_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_ChannelDerivationParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDerivationParametersDecodeErrorZ), "LDKCResult_ChannelDerivationParametersDecodeErrorZ"); - *ret_conv = ChannelDerivationParameters_read(ser_ref); + LDKCResult_MessageContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_MessageContextDecodeErrorZ), "LDKCResult_MessageContextDecodeErrorZ"); + *ret_conv = MessageContext_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_HTLCDescriptor_free(int64_t this_obj) { - LDKHTLCDescriptor this_obj_conv; +int8_tArray CS_LDK_OffersContext_write(int64_t obj) { + LDKOffersContext* obj_conv = (LDKOffersContext*)untag_ptr(obj); + LDKCVec_u8Z ret_var = OffersContext_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_OffersContext_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_OffersContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersContextDecodeErrorZ), "LDKCResult_OffersContextDecodeErrorZ"); + *ret_conv = OffersContext_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_FundingInfo_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); + LDKFundingInfo this_ptr_conv = *(LDKFundingInfo*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + FundingInfo_free(this_ptr_conv); +} + +static inline uint64_t FundingInfo_clone_ptr(LDKFundingInfo *NONNULL_PTR arg) { + LDKFundingInfo *ret_copy = MALLOC(sizeof(LDKFundingInfo), "LDKFundingInfo"); + *ret_copy = FundingInfo_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_FundingInfo_clone_ptr(int64_t arg) { + LDKFundingInfo* arg_conv = (LDKFundingInfo*)untag_ptr(arg); + int64_t ret_conv = FundingInfo_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_FundingInfo_clone(int64_t orig) { + LDKFundingInfo* orig_conv = (LDKFundingInfo*)untag_ptr(orig); + LDKFundingInfo *ret_copy = MALLOC(sizeof(LDKFundingInfo), "LDKFundingInfo"); + *ret_copy = FundingInfo_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_FundingInfo_tx(int8_tArray transaction) { + LDKTransaction transaction_ref; + transaction_ref.datalen = transaction->arr_len; + transaction_ref.data = MALLOC(transaction_ref.datalen, "LDKTransaction Bytes"); + memcpy(transaction_ref.data, transaction->elems, transaction_ref.datalen); FREE(transaction); + transaction_ref.data_is_owned = true; + LDKFundingInfo *ret_copy = MALLOC(sizeof(LDKFundingInfo), "LDKFundingInfo"); + *ret_copy = FundingInfo_tx(transaction_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_FundingInfo_out_point(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); + LDKFundingInfo *ret_copy = MALLOC(sizeof(LDKFundingInfo), "LDKFundingInfo"); + *ret_copy = FundingInfo_out_point(outpoint_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +jboolean CS_LDK_FundingInfo_eq(int64_t a, int64_t b) { + LDKFundingInfo* a_conv = (LDKFundingInfo*)untag_ptr(a); + LDKFundingInfo* b_conv = (LDKFundingInfo*)untag_ptr(b); + jboolean ret_conv = FundingInfo_eq(a_conv, b_conv); + return ret_conv; +} + +int8_tArray CS_LDK_FundingInfo_write(int64_t obj) { + LDKFundingInfo* obj_conv = (LDKFundingInfo*)untag_ptr(obj); + LDKCVec_u8Z ret_var = FundingInfo_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_FundingInfo_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_FundingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingInfoDecodeErrorZ), "LDKCResult_FundingInfoDecodeErrorZ"); + *ret_conv = FundingInfo_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); + CHECK_ACCESS(this_ptr_ptr); + LDKPaymentPurpose this_ptr_conv = *(LDKPaymentPurpose*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + PaymentPurpose_free(this_ptr_conv); +} + +static inline uint64_t PaymentPurpose_clone_ptr(LDKPaymentPurpose *NONNULL_PTR arg) { + LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); + *ret_copy = PaymentPurpose_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_PaymentPurpose_clone_ptr(int64_t arg) { + LDKPaymentPurpose* arg_conv = (LDKPaymentPurpose*)untag_ptr(arg); + int64_t ret_conv = PaymentPurpose_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_PaymentPurpose_clone(int64_t orig) { + LDKPaymentPurpose* orig_conv = (LDKPaymentPurpose*)untag_ptr(orig); + LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); + *ret_copy = PaymentPurpose_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +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); + 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); + 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_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; +} + +int64_t CS_LDK_PaymentPurpose_spontaneous_payment(int8_tArray a) { + LDKThirtyTwoBytes a_ref; + CHECK(a->arr_len == 32); + memcpy(a_ref.data, a->elems, 32); FREE(a); + LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); + *ret_copy = PaymentPurpose_spontaneous_payment(a_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +jboolean CS_LDK_PaymentPurpose_eq(int64_t a, int64_t b) { + LDKPaymentPurpose* a_conv = (LDKPaymentPurpose*)untag_ptr(a); + LDKPaymentPurpose* b_conv = (LDKPaymentPurpose*)untag_ptr(b); + jboolean ret_conv = PaymentPurpose_eq(a_conv, b_conv); + return ret_conv; +} + +int64_t CS_LDK_PaymentPurpose_preimage(int64_t this_arg) { + LDKPaymentPurpose* this_arg_conv = (LDKPaymentPurpose*)untag_ptr(this_arg); + LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); + *ret_copy = PaymentPurpose_preimage(this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int8_tArray CS_LDK_PaymentPurpose_write(int64_t obj) { + LDKPaymentPurpose* obj_conv = (LDKPaymentPurpose*)untag_ptr(obj); + LDKCVec_u8Z ret_var = PaymentPurpose_write(obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_PaymentPurpose_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); + *ret_conv = PaymentPurpose_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_ClaimedHTLC_free(int64_t this_obj) { + LDKClaimedHTLC this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - HTLCDescriptor_free(this_obj_conv); + ClaimedHTLC_free(this_obj_conv); } -int64_t CS_LDK_HTLCDescriptor_get_channel_derivation_parameters(int64_t this_ptr) { - LDKHTLCDescriptor this_ptr_conv; +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; - LDKChannelDerivationParameters ret_var = HTLCDescriptor_get_channel_derivation_parameters(&this_ptr_conv); + 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_HTLCDescriptor_set_channel_derivation_parameters(int64_t this_ptr, int64_t val) { - LDKHTLCDescriptor this_ptr_conv; +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; - LDKChannelDerivationParameters 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 = ChannelDerivationParameters_clone(&val_conv); - HTLCDescriptor_set_channel_derivation_parameters(&this_ptr_conv, val_conv); + val_conv = ChannelId_clone(&val_conv); + ClaimedHTLC_set_channel_id(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_HTLCDescriptor_get_commitment_txid(int64_t this_ptr) { - LDKHTLCDescriptor this_ptr_conv; +int8_tArray CS_LDK_ClaimedHTLC_get_user_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, *HTLCDescriptor_get_commitment_txid(&this_ptr_conv), 32); + int8_tArray ret_arr = init_int8_tArray(16, __LINE__); + memcpy(ret_arr->elems, ClaimedHTLC_get_user_channel_id(&this_ptr_conv).le_bytes, 16); return ret_arr; } -void CS_LDK_HTLCDescriptor_set_commitment_txid(int64_t this_ptr, int8_tArray val) { - LDKHTLCDescriptor this_ptr_conv; +void CS_LDK_ClaimedHTLC_set_user_channel_id(int64_t this_ptr, int8_tArray 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); - HTLCDescriptor_set_commitment_txid(&this_ptr_conv, val_ref); + LDKU128 val_ref; + CHECK(val->arr_len == 16); + memcpy(val_ref.le_bytes, val->elems, 16); FREE(val); + ClaimedHTLC_set_user_channel_id(&this_ptr_conv, val_ref); } -int64_t CS_LDK_HTLCDescriptor_get_per_commitment_number(int64_t this_ptr) { - LDKHTLCDescriptor this_ptr_conv; +int32_t CS_LDK_ClaimedHTLC_get_cltv_expiry(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; - int64_t ret_conv = HTLCDescriptor_get_per_commitment_number(&this_ptr_conv); + int32_t ret_conv = ClaimedHTLC_get_cltv_expiry(&this_ptr_conv); return ret_conv; } -void CS_LDK_HTLCDescriptor_set_per_commitment_number(int64_t this_ptr, int64_t val) { - LDKHTLCDescriptor this_ptr_conv; +void CS_LDK_ClaimedHTLC_set_cltv_expiry(int64_t this_ptr, int32_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; - HTLCDescriptor_set_per_commitment_number(&this_ptr_conv, val); + ClaimedHTLC_set_cltv_expiry(&this_ptr_conv, val); } -int8_tArray CS_LDK_HTLCDescriptor_get_per_commitment_point(int64_t this_ptr) { - LDKHTLCDescriptor this_ptr_conv; +int64_t CS_LDK_ClaimedHTLC_get_value_msat(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(33, __LINE__); - memcpy(ret_arr->elems, HTLCDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form, 33); - return ret_arr; + int64_t ret_conv = ClaimedHTLC_get_value_msat(&this_ptr_conv); + return ret_conv; } -void CS_LDK_HTLCDescriptor_set_per_commitment_point(int64_t this_ptr, int8_tArray val) { - LDKHTLCDescriptor this_ptr_conv; +void CS_LDK_ClaimedHTLC_set_value_msat(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; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - HTLCDescriptor_set_per_commitment_point(&this_ptr_conv, val_ref); + ClaimedHTLC_set_value_msat(&this_ptr_conv, val); } -int32_t CS_LDK_HTLCDescriptor_get_feerate_per_kw(int64_t this_ptr) { - LDKHTLCDescriptor this_ptr_conv; +int64_t CS_LDK_ClaimedHTLC_get_counterparty_skimmed_fee_msat(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; - int32_t ret_conv = HTLCDescriptor_get_feerate_per_kw(&this_ptr_conv); + int64_t ret_conv = ClaimedHTLC_get_counterparty_skimmed_fee_msat(&this_ptr_conv); return ret_conv; } -void CS_LDK_HTLCDescriptor_set_feerate_per_kw(int64_t this_ptr, int32_t val) { - LDKHTLCDescriptor this_ptr_conv; +void CS_LDK_ClaimedHTLC_set_counterparty_skimmed_fee_msat(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; - HTLCDescriptor_set_feerate_per_kw(&this_ptr_conv, val); + ClaimedHTLC_set_counterparty_skimmed_fee_msat(&this_ptr_conv, val); } -int64_t CS_LDK_HTLCDescriptor_get_htlc(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; - LDKHTLCOutputInCommitment ret_var = HTLCDescriptor_get_htlc(&this_ptr_conv); +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_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); return ret_ref; } -void CS_LDK_HTLCDescriptor_set_htlc(int64_t this_ptr, int64_t 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; - LDKHTLCOutputInCommitment 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 = HTLCOutputInCommitment_clone(&val_conv); - HTLCDescriptor_set_htlc(&this_ptr_conv, val_conv); -} - -int64_t CS_LDK_HTLCDescriptor_get_preimage(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; - LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); - *ret_copy = HTLCDescriptor_get_preimage(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +static inline uint64_t ClaimedHTLC_clone_ptr(LDKClaimedHTLC *NONNULL_PTR arg) { + LDKClaimedHTLC ret_var = ClaimedHTLC_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_ClaimedHTLC_clone_ptr(int64_t arg) { + LDKClaimedHTLC 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 = ClaimedHTLC_clone_ptr(&arg_conv); + return ret_conv; +} -void CS_LDK_HTLCDescriptor_set_preimage(int64_t this_ptr, int64_t 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; - 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)); - HTLCDescriptor_set_preimage(&this_ptr_conv, val_conv); +int64_t CS_LDK_ClaimedHTLC_clone(int64_t orig) { + LDKClaimedHTLC 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; + LDKClaimedHTLC ret_var = ClaimedHTLC_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; } -int8_tArray CS_LDK_HTLCDescriptor_get_counterparty_sig(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(64, __LINE__); - memcpy(ret_arr->elems, HTLCDescriptor_get_counterparty_sig(&this_ptr_conv).compact_form, 64); - return ret_arr; +jboolean CS_LDK_ClaimedHTLC_eq(int64_t a, int64_t b) { + LDKClaimedHTLC a_conv; + 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; + LDKClaimedHTLC 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 = ClaimedHTLC_eq(&a_conv, &b_conv); + return ret_conv; } -void CS_LDK_HTLCDescriptor_set_counterparty_sig(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; - LDKECDSASignature val_ref; - CHECK(val->arr_len == 64); - memcpy(val_ref.compact_form, val->elems, 64); FREE(val); - 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; - 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_HTLCDescriptor_clone_ptr(int64_t arg) { - LDKHTLCDescriptor 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 = HTLCDescriptor_clone_ptr(&arg_conv); - return ret_conv; -} - -int64_t CS_LDK_HTLCDescriptor_clone(int64_t orig) { - LDKHTLCDescriptor 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; - LDKHTLCDescriptor ret_var = HTLCDescriptor_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_HTLCDescriptor_eq(int64_t a, int64_t b) { - LDKHTLCDescriptor a_conv; - 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; - LDKHTLCDescriptor 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 = HTLCDescriptor_eq(&a_conv, &b_conv); - return ret_conv; -} - -int8_tArray CS_LDK_HTLCDescriptor_write(int64_t obj) { - LDKHTLCDescriptor obj_conv; +int8_tArray CS_LDK_ClaimedHTLC_write(int64_t obj) { + LDKClaimedHTLC 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 = HTLCDescriptor_write(&obj_conv); + LDKCVec_u8Z ret_var = ClaimedHTLC_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_HTLCDescriptor_read(int8_tArray ser) { +int64_t CS_LDK_ClaimedHTLC_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_HTLCDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCDescriptorDecodeErrorZ), "LDKCResult_HTLCDescriptorDecodeErrorZ"); - *ret_conv = HTLCDescriptor_read(ser_ref); + LDKCResult_ClaimedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClaimedHTLCDecodeErrorZ), "LDKCResult_ClaimedHTLCDecodeErrorZ"); + *ret_conv = ClaimedHTLC_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_HTLCDescriptor_outpoint(int64_t this_arg) { - LDKHTLCDescriptor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOutPoint ret_var = HTLCDescriptor_outpoint(&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); +void CS_LDK_PathFailure_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); + LDKPathFailure this_ptr_conv = *(LDKPathFailure*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + PathFailure_free(this_ptr_conv); +} + +static inline uint64_t PathFailure_clone_ptr(LDKPathFailure *NONNULL_PTR arg) { + LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure"); + *ret_copy = PathFailure_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } +int64_t CS_LDK_PathFailure_clone_ptr(int64_t arg) { + LDKPathFailure* arg_conv = (LDKPathFailure*)untag_ptr(arg); + int64_t ret_conv = PathFailure_clone_ptr(arg_conv); + return ret_conv; +} -int64_t CS_LDK_HTLCDescriptor_previous_utxo(int64_t this_arg) { - LDKHTLCDescriptor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); - *ret_ref = HTLCDescriptor_previous_utxo(&this_arg_conv); - return tag_ptr(ret_ref, true); +int64_t CS_LDK_PathFailure_clone(int64_t orig) { + LDKPathFailure* orig_conv = (LDKPathFailure*)untag_ptr(orig); + LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure"); + *ret_copy = PathFailure_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_HTLCDescriptor_unsigned_tx_input(int64_t this_arg) { - LDKHTLCDescriptor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKTxIn* ret_ref = MALLOC(sizeof(LDKTxIn), "LDKTxIn"); - *ret_ref = HTLCDescriptor_unsigned_tx_input(&this_arg_conv); - return tag_ptr(ret_ref, true); +int64_t CS_LDK_PathFailure_initial_send(int64_t err) { + void* err_ptr = untag_ptr(err); + CHECK_ACCESS(err_ptr); + LDKAPIError err_conv = *(LDKAPIError*)(err_ptr); + err_conv = APIError_clone((LDKAPIError*)untag_ptr(err)); + LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure"); + *ret_copy = PathFailure_initial_send(err_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_HTLCDescriptor_tx_output(int64_t this_arg) { - LDKHTLCDescriptor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); - *ret_ref = HTLCDescriptor_tx_output(&this_arg_conv); - return tag_ptr(ret_ref, true); +int64_t CS_LDK_PathFailure_on_path(int64_t network_update) { + void* network_update_ptr = untag_ptr(network_update); + CHECK_ACCESS(network_update_ptr); + LDKCOption_NetworkUpdateZ network_update_conv = *(LDKCOption_NetworkUpdateZ*)(network_update_ptr); + network_update_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)untag_ptr(network_update)); + LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure"); + *ret_copy = PathFailure_on_path(network_update_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int8_tArray CS_LDK_HTLCDescriptor_witness_script(int64_t this_arg) { - LDKHTLCDescriptor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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 ret_var = HTLCDescriptor_witness_script(&this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +jboolean CS_LDK_PathFailure_eq(int64_t a, int64_t b) { + LDKPathFailure* a_conv = (LDKPathFailure*)untag_ptr(a); + LDKPathFailure* b_conv = (LDKPathFailure*)untag_ptr(b); + jboolean ret_conv = PathFailure_eq(a_conv, b_conv); + return ret_conv; } -int8_tArray CS_LDK_HTLCDescriptor_tx_input_witness(int64_t this_arg, int8_tArray signature, int8_tArray witness_script) { - LDKHTLCDescriptor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKECDSASignature signature_ref; - CHECK(signature->arr_len == 64); - memcpy(signature_ref.compact_form, signature->elems, 64); FREE(signature); - LDKu8slice witness_script_ref; - witness_script_ref.datalen = witness_script->arr_len; - witness_script_ref.data = witness_script->elems; - LDKWitness ret_var = HTLCDescriptor_tx_input_witness(&this_arg_conv, signature_ref, witness_script_ref); +int8_tArray CS_LDK_PathFailure_write(int64_t obj) { + LDKPathFailure* obj_conv = (LDKPathFailure*)untag_ptr(obj); + LDKCVec_u8Z ret_var = PathFailure_write(obj_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - Witness_free(ret_var); - FREE(witness_script); + CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_HTLCDescriptor_derive_channel_signer(int64_t this_arg, int64_t signer_provider) { - LDKHTLCDescriptor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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* signer_provider_ptr = untag_ptr(signer_provider); - if (ptr_is_owned(signer_provider)) { CHECK_ACCESS(signer_provider_ptr); } - LDKSignerProvider* signer_provider_conv = (LDKSignerProvider*)signer_provider_ptr; - LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner"); - *ret_ret = HTLCDescriptor_derive_channel_signer(&this_arg_conv, signer_provider_conv); - return tag_ptr(ret_ret, true); +int64_t CS_LDK_PathFailure_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ"); + *ret_conv = PathFailure_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -void CS_LDK_ChannelSigner_free(int64_t this_ptr) { +void CS_LDK_ClosureReason_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); - LDKChannelSigner this_ptr_conv = *(LDKChannelSigner*)(this_ptr_ptr); + LDKClosureReason this_ptr_conv = *(LDKClosureReason*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - ChannelSigner_free(this_ptr_conv); + ClosureReason_free(this_ptr_conv); } -int32_t CS_LDK_Recipient_clone(int64_t orig) { - LDKRecipient* orig_conv = (LDKRecipient*)untag_ptr(orig); - int32_t ret_conv = LDKRecipient_to_cs(Recipient_clone(orig_conv)); +static inline uint64_t ClosureReason_clone_ptr(LDKClosureReason *NONNULL_PTR arg) { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_ClosureReason_clone_ptr(int64_t arg) { + LDKClosureReason* arg_conv = (LDKClosureReason*)untag_ptr(arg); + int64_t ret_conv = ClosureReason_clone_ptr(arg_conv); return ret_conv; } -int32_t CS_LDK_Recipient_node() { - int32_t ret_conv = LDKRecipient_to_cs(Recipient_node()); - return ret_conv; +int64_t CS_LDK_ClosureReason_clone(int64_t orig) { + LDKClosureReason* orig_conv = (LDKClosureReason*)untag_ptr(orig); + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int32_t CS_LDK_Recipient_phantom_node() { - int32_t ret_conv = LDKRecipient_to_cs(Recipient_phantom_node()); - return ret_conv; +int64_t CS_LDK_ClosureReason_counterparty_force_closed(int64_t peer_msg) { + LDKUntrustedString peer_msg_conv; + peer_msg_conv.inner = untag_ptr(peer_msg); + peer_msg_conv.is_owned = ptr_is_owned(peer_msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(peer_msg_conv); + peer_msg_conv = UntrustedString_clone(&peer_msg_conv); + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_counterparty_force_closed(peer_msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_EntropySource_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); - LDKEntropySource this_ptr_conv = *(LDKEntropySource*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - EntropySource_free(this_ptr_conv); +int64_t CS_LDK_ClosureReason_holder_force_closed(int64_t broadcasted_latest_txn) { + void* broadcasted_latest_txn_ptr = untag_ptr(broadcasted_latest_txn); + CHECK_ACCESS(broadcasted_latest_txn_ptr); + LDKCOption_boolZ broadcasted_latest_txn_conv = *(LDKCOption_boolZ*)(broadcasted_latest_txn_ptr); + broadcasted_latest_txn_conv = COption_boolZ_clone((LDKCOption_boolZ*)untag_ptr(broadcasted_latest_txn)); + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_holder_force_closed(broadcasted_latest_txn_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_NodeSigner_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); - LDKNodeSigner this_ptr_conv = *(LDKNodeSigner*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - NodeSigner_free(this_ptr_conv); +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; } -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); +int64_t CS_LDK_ClosureReason_counterparty_initiated_cooperative_closure() { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_counterparty_initiated_cooperative_closure(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_SignerProvider_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); - LDKSignerProvider this_ptr_conv = *(LDKSignerProvider*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - SignerProvider_free(this_ptr_conv); +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; } -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); +int64_t CS_LDK_ClosureReason_commitment_tx_confirmed() { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_commitment_tx_confirmed(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_InMemorySigner_free(int64_t this_obj) { - LDKInMemorySigner this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InMemorySigner_free(this_obj_conv); +int64_t CS_LDK_ClosureReason_funding_timed_out() { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_funding_timed_out(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int8_tArray CS_LDK_InMemorySigner_get_funding_key(int64_t this_ptr) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(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, *InMemorySigner_get_funding_key(&this_ptr_conv), 32); - return ret_arr; +int64_t CS_LDK_ClosureReason_processing_error(jstring err) { + LDKStr err_conv = str_ref_to_owned_c(err); + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_processing_error(err_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_InMemorySigner_set_funding_key(int64_t this_ptr, int8_tArray val) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKSecretKey val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.bytes, val->elems, 32); FREE(val); - InMemorySigner_set_funding_key(&this_ptr_conv, val_ref); +int64_t CS_LDK_ClosureReason_disconnected_peer() { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_disconnected_peer(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int8_tArray CS_LDK_InMemorySigner_get_revocation_base_key(int64_t this_ptr) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(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, *InMemorySigner_get_revocation_base_key(&this_ptr_conv), 32); - return ret_arr; +int64_t CS_LDK_ClosureReason_outdated_channel_manager() { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_outdated_channel_manager(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_InMemorySigner_set_revocation_base_key(int64_t this_ptr, int8_tArray val) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKSecretKey val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.bytes, val->elems, 32); FREE(val); - InMemorySigner_set_revocation_base_key(&this_ptr_conv, val_ref); +int64_t CS_LDK_ClosureReason_counterparty_coop_closed_unfunded_channel() { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_counterparty_coop_closed_unfunded_channel(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int8_tArray CS_LDK_InMemorySigner_get_payment_key(int64_t this_ptr) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(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, *InMemorySigner_get_payment_key(&this_ptr_conv), 32); - return ret_arr; +int64_t CS_LDK_ClosureReason_funding_batch_closure() { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_funding_batch_closure(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_InMemorySigner_set_payment_key(int64_t this_ptr, int8_tArray val) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKSecretKey val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.bytes, val->elems, 32); FREE(val); - InMemorySigner_set_payment_key(&this_ptr_conv, val_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; } -int8_tArray CS_LDK_InMemorySigner_get_delayed_payment_base_key(int64_t this_ptr) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(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, *InMemorySigner_get_delayed_payment_base_key(&this_ptr_conv), 32); - return ret_arr; +int64_t CS_LDK_ClosureReason_peer_feerate_too_low(int32_t peer_feerate_sat_per_kw, int32_t required_feerate_sat_per_kw) { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_peer_feerate_too_low(peer_feerate_sat_per_kw, required_feerate_sat_per_kw); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_InMemorySigner_set_delayed_payment_base_key(int64_t this_ptr, int8_tArray val) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKSecretKey val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.bytes, val->elems, 32); FREE(val); - InMemorySigner_set_delayed_payment_base_key(&this_ptr_conv, val_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); + jboolean ret_conv = ClosureReason_eq(a_conv, b_conv); + return ret_conv; } -int8_tArray CS_LDK_InMemorySigner_get_htlc_base_key(int64_t this_ptr) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(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, *InMemorySigner_get_htlc_base_key(&this_ptr_conv), 32); +jstring CS_LDK_ClosureReason_to_str(int64_t o) { + LDKClosureReason* o_conv = (LDKClosureReason*)untag_ptr(o); + LDKStr ret_str = ClosureReason_to_str(o_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +int8_tArray CS_LDK_ClosureReason_write(int64_t obj) { + LDKClosureReason* obj_conv = (LDKClosureReason*)untag_ptr(obj); + LDKCVec_u8Z ret_var = ClosureReason_write(obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); return ret_arr; } -void CS_LDK_InMemorySigner_set_htlc_base_key(int64_t this_ptr, int8_tArray val) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKSecretKey val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.bytes, val->elems, 32); FREE(val); - InMemorySigner_set_htlc_base_key(&this_ptr_conv, val_ref); +int64_t CS_LDK_ClosureReason_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = ClosureReason_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -int8_tArray CS_LDK_InMemorySigner_get_commitment_seed(int64_t this_ptr) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(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, *InMemorySigner_get_commitment_seed(&this_ptr_conv), 32); - return ret_arr; +void CS_LDK_HTLCDestination_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); + LDKHTLCDestination this_ptr_conv = *(LDKHTLCDestination*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + HTLCDestination_free(this_ptr_conv); } -void CS_LDK_InMemorySigner_set_commitment_seed(int64_t this_ptr, int8_tArray val) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - InMemorySigner_set_commitment_seed(&this_ptr_conv, val_ref); -} - -static inline uint64_t InMemorySigner_clone_ptr(LDKInMemorySigner *NONNULL_PTR arg) { - LDKInMemorySigner ret_var = InMemorySigner_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); +static inline uint64_t HTLCDestination_clone_ptr(LDKHTLCDestination *NONNULL_PTR arg) { + LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); + *ret_copy = HTLCDestination_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_InMemorySigner_clone_ptr(int64_t arg) { - LDKInMemorySigner 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 = InMemorySigner_clone_ptr(&arg_conv); +int64_t CS_LDK_HTLCDestination_clone_ptr(int64_t arg) { + LDKHTLCDestination* arg_conv = (LDKHTLCDestination*)untag_ptr(arg); + int64_t ret_conv = HTLCDestination_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_InMemorySigner_clone(int64_t orig) { - LDKInMemorySigner 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; - LDKInMemorySigner ret_var = InMemorySigner_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_InMemorySigner_new(int8_tArray funding_key, int8_tArray revocation_base_key, int8_tArray payment_key, int8_tArray delayed_payment_base_key, int8_tArray htlc_base_key, int8_tArray commitment_seed, int64_t channel_value_satoshis, int8_tArray channel_keys_id, int8_tArray rand_bytes_unique_start) { - LDKSecretKey funding_key_ref; - CHECK(funding_key->arr_len == 32); - memcpy(funding_key_ref.bytes, funding_key->elems, 32); FREE(funding_key); - LDKSecretKey revocation_base_key_ref; - CHECK(revocation_base_key->arr_len == 32); - memcpy(revocation_base_key_ref.bytes, revocation_base_key->elems, 32); FREE(revocation_base_key); - LDKSecretKey payment_key_ref; - CHECK(payment_key->arr_len == 32); - memcpy(payment_key_ref.bytes, payment_key->elems, 32); FREE(payment_key); - LDKSecretKey delayed_payment_base_key_ref; - CHECK(delayed_payment_base_key->arr_len == 32); - memcpy(delayed_payment_base_key_ref.bytes, delayed_payment_base_key->elems, 32); FREE(delayed_payment_base_key); - LDKSecretKey htlc_base_key_ref; - CHECK(htlc_base_key->arr_len == 32); - memcpy(htlc_base_key_ref.bytes, htlc_base_key->elems, 32); FREE(htlc_base_key); - LDKThirtyTwoBytes commitment_seed_ref; - CHECK(commitment_seed->arr_len == 32); - memcpy(commitment_seed_ref.data, commitment_seed->elems, 32); FREE(commitment_seed); - LDKThirtyTwoBytes channel_keys_id_ref; - CHECK(channel_keys_id->arr_len == 32); - memcpy(channel_keys_id_ref.data, channel_keys_id->elems, 32); FREE(channel_keys_id); - LDKThirtyTwoBytes rand_bytes_unique_start_ref; - CHECK(rand_bytes_unique_start->arr_len == 32); - memcpy(rand_bytes_unique_start_ref.data, rand_bytes_unique_start->elems, 32); FREE(rand_bytes_unique_start); - LDKInMemorySigner ret_var = InMemorySigner_new(funding_key_ref, revocation_base_key_ref, payment_key_ref, delayed_payment_base_key_ref, htlc_base_key_ref, commitment_seed_ref, channel_value_satoshis, channel_keys_id_ref, rand_bytes_unique_start_ref); - int64_t ret_ref = 0; - 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_InMemorySigner_counterparty_pubkeys(int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelPublicKeys ret_var = InMemorySigner_counterparty_pubkeys(&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_InMemorySigner_counterparty_selected_contest_delay(int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); - *ret_copy = InMemorySigner_counterparty_selected_contest_delay(&this_arg_conv); +int64_t CS_LDK_HTLCDestination_clone(int64_t orig) { + LDKHTLCDestination* orig_conv = (LDKHTLCDestination*)untag_ptr(orig); + LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); + *ret_copy = HTLCDestination_clone(orig_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_InMemorySigner_holder_selected_contest_delay(int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); - *ret_copy = InMemorySigner_holder_selected_contest_delay(&this_arg_conv); +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); + 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_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_InMemorySigner_is_outbound(int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_boolZ *ret_copy = MALLOC(sizeof(LDKCOption_boolZ), "LDKCOption_boolZ"); - *ret_copy = InMemorySigner_is_outbound(&this_arg_conv); +int64_t CS_LDK_HTLCDestination_unknown_next_hop(int64_t requested_forward_scid) { + LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); + *ret_copy = HTLCDestination_unknown_next_hop(requested_forward_scid); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_InMemorySigner_funding_outpoint(int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOutPoint ret_var = InMemorySigner_funding_outpoint(&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); +int64_t CS_LDK_HTLCDestination_invalid_forward(int64_t requested_forward_scid) { + LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); + *ret_copy = HTLCDestination_invalid_forward(requested_forward_scid); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_InMemorySigner_get_channel_parameters(int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelTransactionParameters ret_var = InMemorySigner_get_channel_parameters(&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); +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_InMemorySigner_channel_type_features(int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelTypeFeatures ret_var = InMemorySigner_channel_type_features(&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); +int64_t CS_LDK_HTLCDestination_failed_payment(int8_tArray payment_hash) { + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); + *ret_copy = HTLCDestination_failed_payment(payment_hash_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_InMemorySigner_sign_counterparty_payment_input(int64_t this_arg, int8_tArray spend_tx, int64_t input_idx, int64_t descriptor) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKTransaction spend_tx_ref; - spend_tx_ref.datalen = spend_tx->arr_len; - spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); - memcpy(spend_tx_ref.data, spend_tx->elems, spend_tx_ref.datalen); FREE(spend_tx); - spend_tx_ref.data_is_owned = true; - LDKStaticPaymentOutputDescriptor descriptor_conv; - descriptor_conv.inner = untag_ptr(descriptor); - descriptor_conv.is_owned = ptr_is_owned(descriptor); - CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); - descriptor_conv.is_owned = false; - LDKCResult_WitnessNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_WitnessNoneZ), "LDKCResult_WitnessNoneZ"); - *ret_conv = InMemorySigner_sign_counterparty_payment_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_InMemorySigner_sign_dynamic_p2wsh_input(int64_t this_arg, int8_tArray spend_tx, int64_t input_idx, int64_t descriptor) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKTransaction spend_tx_ref; - spend_tx_ref.datalen = spend_tx->arr_len; - spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); - memcpy(spend_tx_ref.data, spend_tx->elems, spend_tx_ref.datalen); FREE(spend_tx); - spend_tx_ref.data_is_owned = true; - LDKDelayedPaymentOutputDescriptor descriptor_conv; - descriptor_conv.inner = untag_ptr(descriptor); - descriptor_conv.is_owned = ptr_is_owned(descriptor); - CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); - descriptor_conv.is_owned = false; - LDKCResult_WitnessNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_WitnessNoneZ), "LDKCResult_WitnessNoneZ"); - *ret_conv = InMemorySigner_sign_dynamic_p2wsh_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_InMemorySigner_as_EntropySource(int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource"); - *ret_ret = InMemorySigner_as_EntropySource(&this_arg_conv); - return tag_ptr(ret_ret, true); -} - -int64_t CS_LDK_InMemorySigner_as_ChannelSigner(int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelSigner* ret_ret = MALLOC(sizeof(LDKChannelSigner), "LDKChannelSigner"); - *ret_ret = InMemorySigner_as_ChannelSigner(&this_arg_conv); - return tag_ptr(ret_ret, true); -} - -int64_t CS_LDK_InMemorySigner_as_EcdsaChannelSigner(int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner"); - *ret_ret = InMemorySigner_as_EcdsaChannelSigner(&this_arg_conv); - return tag_ptr(ret_ret, true); -} - -int64_t CS_LDK_InMemorySigner_as_WriteableEcdsaChannelSigner(int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner"); - *ret_ret = InMemorySigner_as_WriteableEcdsaChannelSigner(&this_arg_conv); - return tag_ptr(ret_ret, true); +jboolean CS_LDK_HTLCDestination_eq(int64_t a, int64_t b) { + LDKHTLCDestination* a_conv = (LDKHTLCDestination*)untag_ptr(a); + LDKHTLCDestination* b_conv = (LDKHTLCDestination*)untag_ptr(b); + jboolean ret_conv = HTLCDestination_eq(a_conv, b_conv); + return ret_conv; } -int8_tArray CS_LDK_InMemorySigner_write(int64_t obj) { - LDKInMemorySigner 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 = InMemorySigner_write(&obj_conv); +int8_tArray CS_LDK_HTLCDestination_write(int64_t obj) { + LDKHTLCDestination* obj_conv = (LDKHTLCDestination*)untag_ptr(obj); + LDKCVec_u8Z ret_var = HTLCDestination_write(obj_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_InMemorySigner_read(int8_tArray ser, int64_t arg) { +int64_t CS_LDK_HTLCDestination_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - void* arg_ptr = untag_ptr(arg); - CHECK_ACCESS(arg_ptr); - LDKEntropySource arg_conv = *(LDKEntropySource*)(arg_ptr); - if (arg_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&arg_conv); - } - LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); - *ret_conv = InMemorySigner_read(ser_ref, arg_conv); + LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ"); + *ret_conv = HTLCDestination_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_KeysManager_free(int64_t this_obj) { - LDKKeysManager this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - KeysManager_free(this_obj_conv); +int32_t CS_LDK_PaymentFailureReason_clone(int64_t orig) { + LDKPaymentFailureReason* orig_conv = (LDKPaymentFailureReason*)untag_ptr(orig); + int32_t ret_conv = LDKPaymentFailureReason_to_cs(PaymentFailureReason_clone(orig_conv)); + return ret_conv; } -int64_t CS_LDK_KeysManager_new(int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos) { - uint8_t seed_arr[32]; - CHECK(seed->arr_len == 32); - memcpy(seed_arr, seed->elems, 32); FREE(seed); - uint8_t (*seed_ref)[32] = &seed_arr; - LDKKeysManager ret_var = KeysManager_new(seed_ref, starting_time_secs, starting_time_nanos); - int64_t ret_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_PaymentFailureReason_recipient_rejected() { + int32_t ret_conv = LDKPaymentFailureReason_to_cs(PaymentFailureReason_recipient_rejected()); + return ret_conv; } -int8_tArray CS_LDK_KeysManager_get_node_secret_key(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; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, KeysManager_get_node_secret_key(&this_arg_conv).bytes, 32); - return ret_arr; +int32_t CS_LDK_PaymentFailureReason_user_abandoned() { + int32_t ret_conv = LDKPaymentFailureReason_to_cs(PaymentFailureReason_user_abandoned()); + return ret_conv; } -int64_t CS_LDK_KeysManager_derive_channel_keys(int64_t this_arg, int64_t channel_value_satoshis, int8_tArray params) { - LDKKeysManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - uint8_t params_arr[32]; - CHECK(params->arr_len == 32); - memcpy(params_arr, params->elems, 32); FREE(params); - uint8_t (*params_ref)[32] = ¶ms_arr; - LDKInMemorySigner ret_var = KeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_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; +int32_t CS_LDK_PaymentFailureReason_retries_exhausted() { + int32_t ret_conv = LDKPaymentFailureReason_to_cs(PaymentFailureReason_retries_exhausted()); + return ret_conv; } -int64_t CS_LDK_KeysManager_sign_spendable_outputs_psbt(int64_t this_arg, int64_tArray descriptors, int8_tArray psbt) { - 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_u8Z psbt_ref; - psbt_ref.datalen = psbt->arr_len; - psbt_ref.data = MALLOC(psbt_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(psbt_ref.data, psbt->elems, psbt_ref.datalen); FREE(psbt); - LDKCResult_CVec_u8ZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZNoneZ), "LDKCResult_CVec_u8ZNoneZ"); - *ret_conv = KeysManager_sign_spendable_outputs_psbt(&this_arg_conv, descriptors_constr, psbt_ref); - return tag_ptr(ret_conv, true); +int32_t CS_LDK_PaymentFailureReason_payment_expired() { + int32_t ret_conv = LDKPaymentFailureReason_to_cs(PaymentFailureReason_payment_expired()); + return ret_conv; } -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; - LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource"); - *ret_ret = KeysManager_as_EntropySource(&this_arg_conv); - return tag_ptr(ret_ret, true); +int32_t CS_LDK_PaymentFailureReason_route_not_found() { + int32_t ret_conv = LDKPaymentFailureReason_to_cs(PaymentFailureReason_route_not_found()); + return ret_conv; } -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; - LDKNodeSigner* ret_ret = MALLOC(sizeof(LDKNodeSigner), "LDKNodeSigner"); - *ret_ret = KeysManager_as_NodeSigner(&this_arg_conv); - return tag_ptr(ret_ret, true); +int32_t CS_LDK_PaymentFailureReason_unexpected_error() { + int32_t ret_conv = LDKPaymentFailureReason_to_cs(PaymentFailureReason_unexpected_error()); + return ret_conv; } -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; - LDKOutputSpender* ret_ret = MALLOC(sizeof(LDKOutputSpender), "LDKOutputSpender"); - *ret_ret = KeysManager_as_OutputSpender(&this_arg_conv); - return tag_ptr(ret_ret, true); +int32_t CS_LDK_PaymentFailureReason_unknown_required_features() { + int32_t ret_conv = LDKPaymentFailureReason_to_cs(PaymentFailureReason_unknown_required_features()); + return ret_conv; } -int64_t CS_LDK_KeysManager_as_SignerProvider(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; - LDKSignerProvider* ret_ret = MALLOC(sizeof(LDKSignerProvider), "LDKSignerProvider"); - *ret_ret = KeysManager_as_SignerProvider(&this_arg_conv); - return tag_ptr(ret_ret, true); +int32_t CS_LDK_PaymentFailureReason_invoice_request_expired() { + int32_t ret_conv = LDKPaymentFailureReason_to_cs(PaymentFailureReason_invoice_request_expired()); + return ret_conv; } -void CS_LDK_PhantomKeysManager_free(int64_t this_obj) { - LDKPhantomKeysManager this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PhantomKeysManager_free(this_obj_conv); +int32_t CS_LDK_PaymentFailureReason_invoice_request_rejected() { + int32_t ret_conv = LDKPaymentFailureReason_to_cs(PaymentFailureReason_invoice_request_rejected()); + return ret_conv; } -int64_t CS_LDK_PhantomKeysManager_as_EntropySource(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; - LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource"); - *ret_ret = PhantomKeysManager_as_EntropySource(&this_arg_conv); - return tag_ptr(ret_ret, true); +jboolean CS_LDK_PaymentFailureReason_eq(int64_t a, int64_t b) { + LDKPaymentFailureReason* a_conv = (LDKPaymentFailureReason*)untag_ptr(a); + LDKPaymentFailureReason* b_conv = (LDKPaymentFailureReason*)untag_ptr(b); + jboolean ret_conv = PaymentFailureReason_eq(a_conv, b_conv); + return ret_conv; } -int64_t CS_LDK_PhantomKeysManager_as_NodeSigner(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; - LDKNodeSigner* ret_ret = MALLOC(sizeof(LDKNodeSigner), "LDKNodeSigner"); - *ret_ret = PhantomKeysManager_as_NodeSigner(&this_arg_conv); - return tag_ptr(ret_ret, true); +int8_tArray CS_LDK_PaymentFailureReason_write(int64_t obj) { + LDKPaymentFailureReason* obj_conv = (LDKPaymentFailureReason*)untag_ptr(obj); + LDKCVec_u8Z ret_var = PaymentFailureReason_write(obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -int64_t 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_PaymentFailureReason_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ), "LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ"); + *ret_conv = PaymentFailureReason_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_PhantomKeysManager_as_SignerProvider(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; - LDKSignerProvider* ret_ret = MALLOC(sizeof(LDKSignerProvider), "LDKSignerProvider"); - *ret_ret = PhantomKeysManager_as_SignerProvider(&this_arg_conv); - return tag_ptr(ret_ret, true); +void CS_LDK_Event_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); + LDKEvent this_ptr_conv = *(LDKEvent*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Event_free(this_ptr_conv); } -int64_t CS_LDK_PhantomKeysManager_new(int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos, int8_tArray cross_node_seed) { - uint8_t seed_arr[32]; - CHECK(seed->arr_len == 32); - memcpy(seed_arr, seed->elems, 32); FREE(seed); - uint8_t (*seed_ref)[32] = &seed_arr; - uint8_t cross_node_seed_arr[32]; - CHECK(cross_node_seed->arr_len == 32); - memcpy(cross_node_seed_arr, cross_node_seed->elems, 32); FREE(cross_node_seed); - uint8_t (*cross_node_seed_ref)[32] = &cross_node_seed_arr; - LDKPhantomKeysManager ret_var = PhantomKeysManager_new(seed_ref, starting_time_secs, starting_time_nanos, cross_node_seed_ref); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +static inline uint64_t Event_clone_ptr(LDKEvent *NONNULL_PTR arg) { + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } +int64_t CS_LDK_Event_clone_ptr(int64_t arg) { + LDKEvent* arg_conv = (LDKEvent*)untag_ptr(arg); + int64_t ret_conv = Event_clone_ptr(arg_conv); + return ret_conv; +} -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); - this_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 params_arr[32]; - CHECK(params->arr_len == 32); - memcpy(params_arr, params->elems, 32); FREE(params); - uint8_t (*params_ref)[32] = ¶ms_arr; - LDKInMemorySigner ret_var = PhantomKeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_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); +int64_t CS_LDK_Event_clone(int64_t orig) { + LDKEvent* orig_conv = (LDKEvent*)untag_ptr(orig); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int8_tArray CS_LDK_PhantomKeysManager_get_node_secret_key(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; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, PhantomKeysManager_get_node_secret_key(&this_arg_conv).bytes, 32); - return ret_arr; -} - -int8_tArray CS_LDK_PhantomKeysManager_get_phantom_node_secret_key(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; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, PhantomKeysManager_get_phantom_node_secret_key(&this_arg_conv).bytes, 32); - return ret_arr; -} - -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_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); + LDKCVec_u8Z output_script_ref; + output_script_ref.datalen = output_script->arr_len; + output_script_ref.data = MALLOC(output_script_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(output_script_ref.data, output_script->elems, output_script_ref.datalen); FREE(output_script); + LDKU128 user_channel_id_ref; + CHECK(user_channel_id->arr_len == 16); + memcpy(user_channel_id_ref.le_bytes, user_channel_id->elems, 16); FREE(user_channel_id); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_funding_generation_ready(temporary_channel_id_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; } -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); +int64_t CS_LDK_Event_funding_tx_broadcast_safe(int64_t channel_id, int8_tArray user_channel_id, int64_t funding_txo, int8_tArray counterparty_node_id, int64_t former_temporary_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); + 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); + 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); + 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); + 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); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_funding_tx_broadcast_safe(channel_id_conv, user_channel_id_ref, funding_txo_conv, counterparty_node_id_ref, former_temporary_channel_id_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); 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); +int64_t CS_LDK_Event_payment_claimable(int8_tArray receiver_node_id, int8_tArray payment_hash, int64_t onion_fields, int64_t amount_msat, int64_t counterparty_skimmed_fee_msat, int64_t purpose, int64_t via_channel_id, int64_t via_user_channel_id, int64_t claim_deadline) { + LDKPublicKey receiver_node_id_ref; + CHECK(receiver_node_id->arr_len == 33); + memcpy(receiver_node_id_ref.compressed_form, receiver_node_id->elems, 33); FREE(receiver_node_id); + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKRecipientOnionFields onion_fields_conv; + onion_fields_conv.inner = untag_ptr(onion_fields); + onion_fields_conv.is_owned = ptr_is_owned(onion_fields); + CHECK_INNER_FIELD_ACCESS_OR_NULL(onion_fields_conv); + onion_fields_conv = RecipientOnionFields_clone(&onion_fields_conv); + void* purpose_ptr = untag_ptr(purpose); + CHECK_ACCESS(purpose_ptr); + LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr); + purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose)); + 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); + via_user_channel_id_conv = COption_U128Z_clone((LDKCOption_U128Z*)untag_ptr(via_user_channel_id)); + void* claim_deadline_ptr = untag_ptr(claim_deadline); + CHECK_ACCESS(claim_deadline_ptr); + LDKCOption_u32Z claim_deadline_conv = *(LDKCOption_u32Z*)(claim_deadline_ptr); + claim_deadline_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(claim_deadline)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_claimable(receiver_node_id_ref, payment_hash_ref, onion_fields_conv, amount_msat, counterparty_skimmed_fee_msat, purpose_conv, via_channel_id_conv, via_user_channel_id_conv, claim_deadline_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_EcdsaChannelSigner_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); - LDKEcdsaChannelSigner this_ptr_conv = *(LDKEcdsaChannelSigner*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - EcdsaChannelSigner_free(this_ptr_conv); +int64_t CS_LDK_Event_payment_claimed(int8_tArray receiver_node_id, int8_tArray payment_hash, int64_t amount_msat, int64_t purpose, int64_tArray htlcs, int64_t sender_intended_total_msat, int64_t onion_fields) { + LDKPublicKey receiver_node_id_ref; + CHECK(receiver_node_id->arr_len == 33); + memcpy(receiver_node_id_ref.compressed_form, receiver_node_id->elems, 33); FREE(receiver_node_id); + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + void* purpose_ptr = untag_ptr(purpose); + CHECK_ACCESS(purpose_ptr); + LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr); + purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose)); + LDKCVec_ClaimedHTLCZ htlcs_constr; + htlcs_constr.datalen = htlcs->arr_len; + if (htlcs_constr.datalen > 0) + htlcs_constr.data = MALLOC(htlcs_constr.datalen * sizeof(LDKClaimedHTLC), "LDKCVec_ClaimedHTLCZ Elements"); + else + htlcs_constr.data = NULL; + int64_t* htlcs_vals = htlcs->elems; + for (size_t n = 0; n < htlcs_constr.datalen; n++) { + int64_t htlcs_conv_13 = htlcs_vals[n]; + LDKClaimedHTLC htlcs_conv_13_conv; + htlcs_conv_13_conv.inner = untag_ptr(htlcs_conv_13); + htlcs_conv_13_conv.is_owned = ptr_is_owned(htlcs_conv_13); + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlcs_conv_13_conv); + htlcs_conv_13_conv = ClaimedHTLC_clone(&htlcs_conv_13_conv); + htlcs_constr.data[n] = htlcs_conv_13_conv; + } + FREE(htlcs); + void* sender_intended_total_msat_ptr = untag_ptr(sender_intended_total_msat); + CHECK_ACCESS(sender_intended_total_msat_ptr); + LDKCOption_u64Z sender_intended_total_msat_conv = *(LDKCOption_u64Z*)(sender_intended_total_msat_ptr); + sender_intended_total_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(sender_intended_total_msat)); + LDKRecipientOnionFields onion_fields_conv; + onion_fields_conv.inner = untag_ptr(onion_fields); + onion_fields_conv.is_owned = ptr_is_owned(onion_fields); + CHECK_INNER_FIELD_ACCESS_OR_NULL(onion_fields_conv); + onion_fields_conv = RecipientOnionFields_clone(&onion_fields_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_claimed(receiver_node_id_ref, payment_hash_ref, amount_msat, purpose_conv, htlcs_constr, sender_intended_total_msat_conv, onion_fields_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -static inline uint64_t WriteableEcdsaChannelSigner_clone_ptr(LDKWriteableEcdsaChannelSigner *NONNULL_PTR arg) { - LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner"); - *ret_ret = WriteableEcdsaChannelSigner_clone(arg); - return tag_ptr(ret_ret, true); -} -int64_t CS_LDK_WriteableEcdsaChannelSigner_clone_ptr(int64_t arg) { - void* arg_ptr = untag_ptr(arg); - if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); } - LDKWriteableEcdsaChannelSigner* arg_conv = (LDKWriteableEcdsaChannelSigner*)arg_ptr; - int64_t ret_conv = WriteableEcdsaChannelSigner_clone_ptr(arg_conv); - return ret_conv; +int64_t CS_LDK_Event_connection_needed(int8_tArray node_id, int64_tArray addresses) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKCVec_SocketAddressZ addresses_constr; + addresses_constr.datalen = addresses->arr_len; + if (addresses_constr.datalen > 0) + addresses_constr.data = MALLOC(addresses_constr.datalen * sizeof(LDKSocketAddress), "LDKCVec_SocketAddressZ Elements"); + else + addresses_constr.data = NULL; + int64_t* addresses_vals = addresses->elems; + for (size_t p = 0; p < addresses_constr.datalen; p++) { + int64_t addresses_conv_15 = addresses_vals[p]; + void* addresses_conv_15_ptr = untag_ptr(addresses_conv_15); + CHECK_ACCESS(addresses_conv_15_ptr); + LDKSocketAddress addresses_conv_15_conv = *(LDKSocketAddress*)(addresses_conv_15_ptr); + addresses_conv_15_conv = SocketAddress_clone((LDKSocketAddress*)untag_ptr(addresses_conv_15)); + addresses_constr.data[p] = addresses_conv_15_conv; + } + FREE(addresses); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_connection_needed(node_id_ref, addresses_constr); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_WriteableEcdsaChannelSigner_clone(int64_t orig) { - void* orig_ptr = untag_ptr(orig); - if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); } - LDKWriteableEcdsaChannelSigner* orig_conv = (LDKWriteableEcdsaChannelSigner*)orig_ptr; - LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner"); - *ret_ret = WriteableEcdsaChannelSigner_clone(orig_conv); - return tag_ptr(ret_ret, true); +int64_t CS_LDK_Event_invoice_received(int8_tArray payment_id, int64_t invoice, int64_t context, int64_t responder) { + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + LDKBolt12Invoice invoice_conv; + invoice_conv.inner = untag_ptr(invoice); + invoice_conv.is_owned = ptr_is_owned(invoice); + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); + invoice_conv = Bolt12Invoice_clone(&invoice_conv); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKCOption_OffersContextZ context_conv = *(LDKCOption_OffersContextZ*)(context_ptr); + context_conv = COption_OffersContextZ_clone((LDKCOption_OffersContextZ*)untag_ptr(context)); + LDKResponder responder_conv; + responder_conv.inner = untag_ptr(responder); + responder_conv.is_owned = ptr_is_owned(responder); + CHECK_INNER_FIELD_ACCESS_OR_NULL(responder_conv); + responder_conv = Responder_clone(&responder_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_invoice_received(payment_id_ref, invoice_conv, context_conv, responder_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_WriteableEcdsaChannelSigner_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); - LDKWriteableEcdsaChannelSigner this_ptr_conv = *(LDKWriteableEcdsaChannelSigner*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - WriteableEcdsaChannelSigner_free(this_ptr_conv); +int64_t CS_LDK_Event_payment_sent(int64_t payment_id, int8_tArray payment_preimage, int8_tArray payment_hash, int64_t fee_paid_msat) { + void* payment_id_ptr = untag_ptr(payment_id); + CHECK_ACCESS(payment_id_ptr); + LDKCOption_ThirtyTwoBytesZ payment_id_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_id_ptr); + payment_id_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_id)); + LDKThirtyTwoBytes payment_preimage_ref; + CHECK(payment_preimage->arr_len == 32); + memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + void* fee_paid_msat_ptr = untag_ptr(fee_paid_msat); + CHECK_ACCESS(fee_paid_msat_ptr); + LDKCOption_u64Z fee_paid_msat_conv = *(LDKCOption_u64Z*)(fee_paid_msat_ptr); + fee_paid_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(fee_paid_msat)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_sent(payment_id_conv, payment_preimage_ref, payment_hash_ref, fee_paid_msat_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_OnionMessenger_free(int64_t this_obj) { - LDKOnionMessenger this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - OnionMessenger_free(this_obj_conv); +int64_t CS_LDK_Event_payment_failed(int8_tArray payment_id, int64_t payment_hash, int64_t reason) { + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + void* payment_hash_ptr = untag_ptr(payment_hash); + CHECK_ACCESS(payment_hash_ptr); + LDKCOption_ThirtyTwoBytesZ payment_hash_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_ptr); + payment_hash_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash)); + void* reason_ptr = untag_ptr(reason); + CHECK_ACCESS(reason_ptr); + LDKCOption_PaymentFailureReasonZ reason_conv = *(LDKCOption_PaymentFailureReasonZ*)(reason_ptr); + reason_conv = COption_PaymentFailureReasonZ_clone((LDKCOption_PaymentFailureReasonZ*)untag_ptr(reason)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_failed(payment_id_ref, payment_hash_conv, reason_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_MessageRouter_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); - LDKMessageRouter this_ptr_conv = *(LDKMessageRouter*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - MessageRouter_free(this_ptr_conv); +int64_t CS_LDK_Event_payment_path_successful(int8_tArray payment_id, int64_t payment_hash, int64_t path) { + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + void* payment_hash_ptr = untag_ptr(payment_hash); + CHECK_ACCESS(payment_hash_ptr); + LDKCOption_ThirtyTwoBytesZ payment_hash_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_ptr); + payment_hash_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash)); + LDKPath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv = Path_clone(&path_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_path_successful(payment_id_ref, payment_hash_conv, path_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_DefaultMessageRouter_free(int64_t this_obj) { - LDKDefaultMessageRouter this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - DefaultMessageRouter_free(this_obj_conv); +int64_t CS_LDK_Event_payment_path_failed(int64_t payment_id, int8_tArray payment_hash, jboolean payment_failed_permanently, int64_t failure, int64_t path, int64_t short_channel_id) { + void* payment_id_ptr = untag_ptr(payment_id); + CHECK_ACCESS(payment_id_ptr); + LDKCOption_ThirtyTwoBytesZ payment_id_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_id_ptr); + payment_id_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_id)); + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + void* failure_ptr = untag_ptr(failure); + CHECK_ACCESS(failure_ptr); + LDKPathFailure failure_conv = *(LDKPathFailure*)(failure_ptr); + failure_conv = PathFailure_clone((LDKPathFailure*)untag_ptr(failure)); + LDKPath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv = Path_clone(&path_conv); + void* short_channel_id_ptr = untag_ptr(short_channel_id); + CHECK_ACCESS(short_channel_id_ptr); + LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr); + short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_path_failed(payment_id_conv, payment_hash_ref, payment_failed_permanently, failure_conv, path_conv, short_channel_id_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_DefaultMessageRouter_new(int64_t network_graph, int64_t entropy_source) { - LDKNetworkGraph network_graph_conv; - network_graph_conv.inner = untag_ptr(network_graph); - network_graph_conv.is_owned = ptr_is_owned(network_graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - network_graph_conv.is_owned = false; - void* 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); - } - LDKDefaultMessageRouter ret_var = DefaultMessageRouter_new(&network_graph_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); +int64_t CS_LDK_Event_probe_successful(int8_tArray payment_id, int8_tArray payment_hash, int64_t path) { + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKPath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv = Path_clone(&path_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_probe_successful(payment_id_ref, payment_hash_ref, path_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_DefaultMessageRouter_as_MessageRouter(int64_t this_arg) { - LDKDefaultMessageRouter this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKMessageRouter* ret_ret = MALLOC(sizeof(LDKMessageRouter), "LDKMessageRouter"); - *ret_ret = DefaultMessageRouter_as_MessageRouter(&this_arg_conv); - return tag_ptr(ret_ret, true); +int64_t CS_LDK_Event_probe_failed(int8_tArray payment_id, int8_tArray payment_hash, int64_t path, int64_t short_channel_id) { + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKPath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv = Path_clone(&path_conv); + void* short_channel_id_ptr = untag_ptr(short_channel_id); + CHECK_ACCESS(short_channel_id_ptr); + LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr); + short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_probe_failed(payment_id_ref, payment_hash_ref, path_conv, short_channel_id_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_OnionMessagePath_free(int64_t this_obj) { - LDKOnionMessagePath this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - OnionMessagePath_free(this_obj_conv); +int64_t CS_LDK_Event_pending_htlcs_forwardable(int64_t time_forwardable) { + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_pending_htlcs_forwardable(time_forwardable); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -ptrArray CS_LDK_OnionMessagePath_get_intermediate_nodes(int64_t this_ptr) { - LDKOnionMessagePath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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_PublicKeyZ ret_var = OnionMessagePath_get_intermediate_nodes(&this_ptr_conv); - ptrArray ret_arr = NULL; - ret_arr = init_ptrArray(ret_var.datalen, __LINE__); - int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8); - for (size_t i = 0; i < ret_var.datalen; i++) { - int8_tArray ret_conv_8_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_conv_8_arr->elems, ret_var.data[i].compressed_form, 33); - ret_arr_ptr[i] = ret_conv_8_arr; - } - - FREE(ret_var.data); - return ret_arr; +int64_t CS_LDK_Event_htlcintercepted(int8_tArray intercept_id, int64_t requested_next_hop_scid, int8_tArray payment_hash, int64_t inbound_amount_msat, int64_t expected_outbound_amount_msat) { + LDKThirtyTwoBytes intercept_id_ref; + CHECK(intercept_id->arr_len == 32); + memcpy(intercept_id_ref.data, intercept_id->elems, 32); FREE(intercept_id); + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_htlcintercepted(intercept_id_ref, requested_next_hop_scid, payment_hash_ref, inbound_amount_msat, expected_outbound_amount_msat); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_OnionMessagePath_set_intermediate_nodes(int64_t this_ptr, ptrArray val) { - LDKOnionMessagePath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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_PublicKeyZ val_constr; - val_constr.datalen = val->arr_len; - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); +int64_t CS_LDK_Event_spendable_outputs(int64_tArray outputs, int64_t channel_id) { + LDKCVec_SpendableOutputDescriptorZ outputs_constr; + outputs_constr.datalen = outputs->arr_len; + if (outputs_constr.datalen > 0) + outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); else - val_constr.data = NULL; - int8_tArray* val_vals = (void*) val->elems; - for (size_t i = 0; i < val_constr.datalen; i++) { - int8_tArray val_conv_8 = val_vals[i]; - LDKPublicKey val_conv_8_ref; - CHECK(val_conv_8->arr_len == 33); - memcpy(val_conv_8_ref.compressed_form, val_conv_8->elems, 33); FREE(val_conv_8); - val_constr.data[i] = val_conv_8_ref; + outputs_constr.data = NULL; + int64_t* outputs_vals = outputs->elems; + for (size_t b = 0; b < outputs_constr.datalen; b++) { + int64_t outputs_conv_27 = outputs_vals[b]; + void* outputs_conv_27_ptr = untag_ptr(outputs_conv_27); + CHECK_ACCESS(outputs_conv_27_ptr); + LDKSpendableOutputDescriptor outputs_conv_27_conv = *(LDKSpendableOutputDescriptor*)(outputs_conv_27_ptr); + outputs_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(outputs_conv_27)); + outputs_constr.data[b] = outputs_conv_27_conv; } - FREE(val); - OnionMessagePath_set_intermediate_nodes(&this_ptr_conv, val_constr); + FREE(outputs); + 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_OnionMessagePath_get_destination(int64_t this_ptr) { - LDKOnionMessagePath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); - *ret_copy = OnionMessagePath_get_destination(&this_ptr_conv); +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, 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; } -void CS_LDK_OnionMessagePath_set_destination(int64_t this_ptr, int64_t val) { - LDKOnionMessagePath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - LDKDestination val_conv = *(LDKDestination*)(val_ptr); - val_conv = Destination_clone((LDKDestination*)untag_ptr(val)); - OnionMessagePath_set_destination(&this_ptr_conv, val_conv); -} - -int64_t CS_LDK_OnionMessagePath_get_first_node_addresses(int64_t this_ptr) { - LDKOnionMessagePath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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_SocketAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_SocketAddressZZ), "LDKCOption_CVec_SocketAddressZZ"); - *ret_copy = OnionMessagePath_get_first_node_addresses(&this_ptr_conv); +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); + 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); + 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); + 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_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; } -void CS_LDK_OnionMessagePath_set_first_node_addresses(int64_t this_ptr, int64_t val) { - LDKOnionMessagePath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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_SocketAddressZZ val_conv = *(LDKCOption_CVec_SocketAddressZZ*)(val_ptr); - val_conv = COption_CVec_SocketAddressZZ_clone((LDKCOption_CVec_SocketAddressZZ*)untag_ptr(val)); - OnionMessagePath_set_first_node_addresses(&this_ptr_conv, val_conv); -} - -int64_t CS_LDK_OnionMessagePath_new(ptrArray intermediate_nodes_arg, int64_t destination_arg, int64_t first_node_addresses_arg) { - LDKCVec_PublicKeyZ intermediate_nodes_arg_constr; - intermediate_nodes_arg_constr.datalen = intermediate_nodes_arg->arr_len; - if (intermediate_nodes_arg_constr.datalen > 0) - intermediate_nodes_arg_constr.data = MALLOC(intermediate_nodes_arg_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); - else - intermediate_nodes_arg_constr.data = NULL; - int8_tArray* intermediate_nodes_arg_vals = (void*) intermediate_nodes_arg->elems; - for (size_t i = 0; i < intermediate_nodes_arg_constr.datalen; i++) { - int8_tArray intermediate_nodes_arg_conv_8 = intermediate_nodes_arg_vals[i]; - LDKPublicKey intermediate_nodes_arg_conv_8_ref; - CHECK(intermediate_nodes_arg_conv_8->arr_len == 33); - memcpy(intermediate_nodes_arg_conv_8_ref.compressed_form, intermediate_nodes_arg_conv_8->elems, 33); FREE(intermediate_nodes_arg_conv_8); - intermediate_nodes_arg_constr.data[i] = intermediate_nodes_arg_conv_8_ref; - } - FREE(intermediate_nodes_arg); - void* destination_arg_ptr = untag_ptr(destination_arg); - CHECK_ACCESS(destination_arg_ptr); - LDKDestination destination_arg_conv = *(LDKDestination*)(destination_arg_ptr); - destination_arg_conv = Destination_clone((LDKDestination*)untag_ptr(destination_arg)); - void* first_node_addresses_arg_ptr = untag_ptr(first_node_addresses_arg); - CHECK_ACCESS(first_node_addresses_arg_ptr); - LDKCOption_CVec_SocketAddressZZ first_node_addresses_arg_conv = *(LDKCOption_CVec_SocketAddressZZ*)(first_node_addresses_arg_ptr); - LDKOnionMessagePath ret_var = OnionMessagePath_new(intermediate_nodes_arg_constr, destination_arg_conv, first_node_addresses_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); +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); + LDKPublicKey counterparty_node_id_ref; + CHECK(counterparty_node_id->arr_len == 33); + memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); + LDKChannelTypeFeatures channel_type_conv; + channel_type_conv.inner = untag_ptr(channel_type); + channel_type_conv.is_owned = ptr_is_owned(channel_type); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_conv); + channel_type_conv = ChannelTypeFeatures_clone(&channel_type_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_channel_ready(channel_id_conv, user_channel_id_ref, counterparty_node_id_ref, channel_type_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline uint64_t OnionMessagePath_clone_ptr(LDKOnionMessagePath *NONNULL_PTR arg) { - LDKOnionMessagePath ret_var = OnionMessagePath_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); +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); + void* reason_ptr = untag_ptr(reason); + CHECK_ACCESS(reason_ptr); + LDKClosureReason reason_conv = *(LDKClosureReason*)(reason_ptr); + reason_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(reason)); + LDKPublicKey counterparty_node_id_ref; + CHECK(counterparty_node_id->arr_len == 33); + memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); + void* channel_capacity_sats_ptr = untag_ptr(channel_capacity_sats); + CHECK_ACCESS(channel_capacity_sats_ptr); + LDKCOption_u64Z channel_capacity_sats_conv = *(LDKCOption_u64Z*)(channel_capacity_sats_ptr); + channel_capacity_sats_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(channel_capacity_sats)); + LDKOutPoint channel_funding_txo_conv; + channel_funding_txo_conv.inner = untag_ptr(channel_funding_txo); + channel_funding_txo_conv.is_owned = ptr_is_owned(channel_funding_txo); + 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_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_OnionMessagePath_clone_ptr(int64_t arg) { - LDKOnionMessagePath 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 = OnionMessagePath_clone_ptr(&arg_conv); - return ret_conv; -} -int64_t CS_LDK_OnionMessagePath_clone(int64_t orig) { - LDKOnionMessagePath 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; - LDKOnionMessagePath ret_var = OnionMessagePath_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); +int64_t CS_LDK_Event_discard_funding(int64_t channel_id, int64_t funding_info) { + 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* funding_info_ptr = untag_ptr(funding_info); + CHECK_ACCESS(funding_info_ptr); + LDKFundingInfo funding_info_conv = *(LDKFundingInfo*)(funding_info_ptr); + funding_info_conv = FundingInfo_clone((LDKFundingInfo*)untag_ptr(funding_info)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_discard_funding(channel_id_conv, funding_info_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int8_tArray CS_LDK_OnionMessagePath_first_node(int64_t this_arg) { - LDKOnionMessagePath this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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, OnionMessagePath_first_node(&this_arg_conv).compressed_form, 33); - return ret_arr; -} - -void CS_LDK_Destination_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); - LDKDestination this_ptr_conv = *(LDKDestination*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Destination_free(this_ptr_conv); +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, jboolean is_announced, int64_t params) { + 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); + 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); + LDKChannelParameters params_conv; + params_conv.inner = untag_ptr(params); + params_conv.is_owned = ptr_is_owned(params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); + params_conv = ChannelParameters_clone(¶ms_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_open_channel_request(temporary_channel_id_conv, counterparty_node_id_ref, funding_satoshis, push_msat, channel_type_conv, is_announced, params_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -static inline uint64_t Destination_clone_ptr(LDKDestination *NONNULL_PTR arg) { - LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); - *ret_copy = Destination_clone(arg); +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_conv, failed_next_destination_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Destination_clone_ptr(int64_t arg) { - LDKDestination* arg_conv = (LDKDestination*)untag_ptr(arg); - int64_t ret_conv = Destination_clone_ptr(arg_conv); - return ret_conv; -} -int64_t CS_LDK_Destination_clone(int64_t orig) { - LDKDestination* orig_conv = (LDKDestination*)untag_ptr(orig); - LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); - *ret_copy = Destination_clone(orig_conv); +int64_t CS_LDK_Event_bump_transaction(int64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKBumpTransactionEvent a_conv = *(LDKBumpTransactionEvent*)(a_ptr); + a_conv = BumpTransactionEvent_clone((LDKBumpTransactionEvent*)untag_ptr(a)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_bump_transaction(a_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Destination_node(int8_tArray a) { - LDKPublicKey a_ref; - CHECK(a->arr_len == 33); - memcpy(a_ref.compressed_form, a->elems, 33); FREE(a); - LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); - *ret_copy = Destination_node(a_ref); +int64_t CS_LDK_Event_onion_message_intercepted(int8_tArray peer_node_id, int64_t message) { + LDKPublicKey peer_node_id_ref; + CHECK(peer_node_id->arr_len == 33); + memcpy(peer_node_id_ref.compressed_form, peer_node_id->elems, 33); FREE(peer_node_id); + LDKOnionMessage 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 = OnionMessage_clone(&message_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_onion_message_intercepted(peer_node_id_ref, message_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Destination_blinded_path(int64_t a) { - LDKBlindedPath a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = BlindedPath_clone(&a_conv); - LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); - *ret_copy = Destination_blinded_path(a_conv); +int64_t CS_LDK_Event_onion_message_peer_connected(int8_tArray peer_node_id) { + LDKPublicKey peer_node_id_ref; + CHECK(peer_node_id->arr_len == 33); + memcpy(peer_node_id_ref.compressed_form, peer_node_id->elems, 33); FREE(peer_node_id); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_onion_message_peer_connected(peer_node_id_ref); int64_t ret_ref = tag_ptr(ret_copy, true); 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); +jboolean CS_LDK_Event_eq(int64_t a, int64_t b) { + LDKEvent* a_conv = (LDKEvent*)untag_ptr(a); + LDKEvent* b_conv = (LDKEvent*)untag_ptr(b); + jboolean ret_conv = Event_eq(a_conv, b_conv); return ret_conv; } -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; +int8_tArray CS_LDK_Event_write(int64_t obj) { + LDKEvent* obj_conv = (LDKEvent*)untag_ptr(obj); + LDKCVec_u8Z ret_var = Event_write(obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -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); +int64_t CS_LDK_Event_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = Event_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -void CS_LDK_SendSuccess_free(int64_t this_ptr) { +void CS_LDK_MessageSendEvent_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); - LDKSendSuccess this_ptr_conv = *(LDKSendSuccess*)(this_ptr_ptr); + LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - SendSuccess_free(this_ptr_conv); + MessageSendEvent_free(this_ptr_conv); } -static inline uint64_t SendSuccess_clone_ptr(LDKSendSuccess *NONNULL_PTR arg) { - LDKSendSuccess *ret_copy = MALLOC(sizeof(LDKSendSuccess), "LDKSendSuccess"); - *ret_copy = SendSuccess_clone(arg); +static inline uint64_t MessageSendEvent_clone_ptr(LDKMessageSendEvent *NONNULL_PTR arg) { + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_SendSuccess_clone_ptr(int64_t arg) { - LDKSendSuccess* arg_conv = (LDKSendSuccess*)untag_ptr(arg); - int64_t ret_conv = SendSuccess_clone_ptr(arg_conv); +int64_t CS_LDK_MessageSendEvent_clone_ptr(int64_t arg) { + LDKMessageSendEvent* arg_conv = (LDKMessageSendEvent*)untag_ptr(arg); + int64_t ret_conv = MessageSendEvent_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_SendSuccess_clone(int64_t orig) { - LDKSendSuccess* orig_conv = (LDKSendSuccess*)untag_ptr(orig); - LDKSendSuccess *ret_copy = MALLOC(sizeof(LDKSendSuccess), "LDKSendSuccess"); - *ret_copy = SendSuccess_clone(orig_conv); +int64_t CS_LDK_MessageSendEvent_clone(int64_t orig) { + LDKMessageSendEvent* orig_conv = (LDKMessageSendEvent*)untag_ptr(orig); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_clone(orig_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_SendSuccess_buffered() { - LDKSendSuccess *ret_copy = MALLOC(sizeof(LDKSendSuccess), "LDKSendSuccess"); - *ret_copy = SendSuccess_buffered(); +int64_t CS_LDK_MessageSendEvent_send_accept_channel(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKAcceptChannel msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = AcceptChannel_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_accept_channel(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_SendSuccess_buffered_awaiting_connection(int8_tArray a) { - LDKPublicKey a_ref; - CHECK(a->arr_len == 33); - memcpy(a_ref.compressed_form, a->elems, 33); FREE(a); - LDKSendSuccess *ret_copy = MALLOC(sizeof(LDKSendSuccess), "LDKSendSuccess"); - *ret_copy = SendSuccess_buffered_awaiting_connection(a_ref); +int64_t CS_LDK_MessageSendEvent_send_accept_channel_v2(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKAcceptChannelV2 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 = AcceptChannelV2_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_accept_channel_v2(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); 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); - jboolean ret_conv = SendSuccess_eq(a_conv, b_conv); - return ret_conv; -} - -void CS_LDK_SendError_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); - LDKSendError this_ptr_conv = *(LDKSendError*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - SendError_free(this_ptr_conv); -} - -static inline uint64_t SendError_clone_ptr(LDKSendError *NONNULL_PTR arg) { - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_clone(arg); +int64_t CS_LDK_MessageSendEvent_send_open_channel(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKOpenChannel msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = OpenChannel_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_open_channel(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_SendError_clone_ptr(int64_t arg) { - LDKSendError* arg_conv = (LDKSendError*)untag_ptr(arg); - int64_t ret_conv = SendError_clone_ptr(arg_conv); - return ret_conv; -} -int64_t CS_LDK_SendError_clone(int64_t orig) { - LDKSendError* orig_conv = (LDKSendError*)untag_ptr(orig); - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_clone(orig_conv); +int64_t CS_LDK_MessageSendEvent_send_open_channel_v2(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKOpenChannelV2 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 = OpenChannelV2_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_open_channel_v2(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_SendError_secp256k1(int32_t a) { - LDKSecp256k1Error a_conv = LDKSecp256k1Error_from_cs(a); - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_secp256k1(a_conv); +int64_t CS_LDK_MessageSendEvent_send_funding_created(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKFundingCreated msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = FundingCreated_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_funding_created(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_SendError_too_big_packet() { - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_too_big_packet(); +int64_t CS_LDK_MessageSendEvent_send_funding_signed(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKFundingSigned msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = FundingSigned_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_funding_signed(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_SendError_too_few_blinded_hops() { - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_too_few_blinded_hops(); +int64_t CS_LDK_MessageSendEvent_send_stfu(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKStfu 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 = Stfu_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_stfu(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_SendError_invalid_first_hop(int8_tArray a) { - LDKPublicKey a_ref; - CHECK(a->arr_len == 33); - memcpy(a_ref.compressed_form, a->elems, 33); FREE(a); - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_invalid_first_hop(a_ref); +int64_t CS_LDK_MessageSendEvent_send_splice_init(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKSpliceInit 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 = SpliceInit_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_splice_init(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_SendError_path_not_found() { - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_path_not_found(); +int64_t CS_LDK_MessageSendEvent_send_splice_ack(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + 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 = SpliceAck_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_splice_ack(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_SendError_invalid_message() { - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_invalid_message(); +int64_t CS_LDK_MessageSendEvent_send_splice_locked(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + 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 = SpliceLocked_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_splice_locked(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_SendError_buffer_full() { - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_buffer_full(); +int64_t CS_LDK_MessageSendEvent_send_tx_add_input(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKTxAddInput 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 = TxAddInput_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_tx_add_input(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_SendError_get_node_id_failed() { - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_get_node_id_failed(); +int64_t CS_LDK_MessageSendEvent_send_tx_add_output(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKTxAddOutput 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 = TxAddOutput_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_tx_add_output(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); 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 CS_LDK_MessageSendEvent_send_tx_remove_input(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKTxRemoveInput 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 = TxRemoveInput_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_tx_remove_input(node_id_ref, msg_conv); 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(); +int64_t CS_LDK_MessageSendEvent_send_tx_remove_output(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKTxRemoveOutput 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 = TxRemoveOutput_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_tx_remove_output(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); 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); - jboolean ret_conv = SendError_eq(a_conv, b_conv); - return ret_conv; -} - -void CS_LDK_CustomOnionMessageHandler_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); - LDKCustomOnionMessageHandler this_ptr_conv = *(LDKCustomOnionMessageHandler*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - CustomOnionMessageHandler_free(this_ptr_conv); -} - -void CS_LDK_PeeledOnion_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); - LDKPeeledOnion this_ptr_conv = *(LDKPeeledOnion*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - PeeledOnion_free(this_ptr_conv); -} - -static inline uint64_t PeeledOnion_clone_ptr(LDKPeeledOnion *NONNULL_PTR arg) { - LDKPeeledOnion *ret_copy = MALLOC(sizeof(LDKPeeledOnion), "LDKPeeledOnion"); - *ret_copy = PeeledOnion_clone(arg); +int64_t CS_LDK_MessageSendEvent_send_tx_complete(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKTxComplete 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 = TxComplete_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_tx_complete(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_PeeledOnion_clone_ptr(int64_t arg) { - LDKPeeledOnion* arg_conv = (LDKPeeledOnion*)untag_ptr(arg); - int64_t ret_conv = PeeledOnion_clone_ptr(arg_conv); - return ret_conv; -} -int64_t CS_LDK_PeeledOnion_clone(int64_t orig) { - LDKPeeledOnion* orig_conv = (LDKPeeledOnion*)untag_ptr(orig); - LDKPeeledOnion *ret_copy = MALLOC(sizeof(LDKPeeledOnion), "LDKPeeledOnion"); - *ret_copy = PeeledOnion_clone(orig_conv); +int64_t CS_LDK_MessageSendEvent_send_tx_signatures(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKTxSignatures 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 = TxSignatures_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_tx_signatures(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -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_conv, b_conv); +int64_t CS_LDK_MessageSendEvent_send_tx_init_rbf(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKTxInitRbf 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 = TxInitRbf_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_tx_init_rbf(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_PeeledOnion_receive(int64_t a, int8_tArray b, int64_t c) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKParsedOnionMessageContents a_conv = *(LDKParsedOnionMessageContents*)(a_ptr); - a_conv = ParsedOnionMessageContents_clone((LDKParsedOnionMessageContents*)untag_ptr(a)); - LDKThirtyTwoBytes b_ref; - CHECK(b->arr_len == 32); - memcpy(b_ref.data, b->elems, 32); FREE(b); - LDKBlindedPath 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 = BlindedPath_clone(&c_conv); - LDKPeeledOnion *ret_copy = MALLOC(sizeof(LDKPeeledOnion), "LDKPeeledOnion"); - *ret_copy = PeeledOnion_receive(a_conv, b_ref, c_conv); +int64_t CS_LDK_MessageSendEvent_send_tx_ack_rbf(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKTxAckRbf 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 = TxAckRbf_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_tx_ack_rbf(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -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); - 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(entropy_source_conv, node_signer_conv, node_id_lookup_conv, path_conv, contents_conv, reply_path_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_peel_onion_message(int64_t msg, int64_t node_signer, int64_t logger, int64_t custom_handler) { - LDKOnionMessage msg_conv; +int64_t CS_LDK_MessageSendEvent_send_tx_abort(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKTxAbort msg_conv; msg_conv.inner = untag_ptr(msg); msg_conv.is_owned = ptr_is_owned(msg); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - void* custom_handler_ptr = untag_ptr(custom_handler); - CHECK_ACCESS(custom_handler_ptr); - LDKCustomOnionMessageHandler custom_handler_conv = *(LDKCustomOnionMessageHandler*)(custom_handler_ptr); - if (custom_handler_conv.free == LDKCustomOnionMessageHandler_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKCustomOnionMessageHandler_JCalls_cloned(&custom_handler_conv); - } - LDKCResult_PeeledOnionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PeeledOnionNoneZ), "LDKCResult_PeeledOnionNoneZ"); - *ret_conv = peel_onion_message(&msg_conv, node_signer_conv, logger_conv, custom_handler_conv); - return tag_ptr(ret_conv, true); + msg_conv = TxAbort_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_tx_abort(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -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); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - void* 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); - if (message_router_conv.free == LDKMessageRouter_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKMessageRouter_JCalls_cloned(&message_router_conv); - } - void* offers_handler_ptr = untag_ptr(offers_handler); - CHECK_ACCESS(offers_handler_ptr); - LDKOffersMessageHandler offers_handler_conv = *(LDKOffersMessageHandler*)(offers_handler_ptr); - if (offers_handler_conv.free == LDKOffersMessageHandler_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKOffersMessageHandler_JCalls_cloned(&offers_handler_conv); - } - void* custom_handler_ptr = untag_ptr(custom_handler); - CHECK_ACCESS(custom_handler_ptr); - LDKCustomOnionMessageHandler custom_handler_conv = *(LDKCustomOnionMessageHandler*)(custom_handler_ptr); - if (custom_handler_conv.free == LDKCustomOnionMessageHandler_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKCustomOnionMessageHandler_JCalls_cloned(&custom_handler_conv); - } - LDKOnionMessenger ret_var = OnionMessenger_new(entropy_source_conv, node_signer_conv, logger_conv, 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); +int64_t CS_LDK_MessageSendEvent_send_channel_ready(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKChannelReady msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = ChannelReady_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_channel_ready(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_OnionMessenger_send_onion_message(int64_t this_arg, int64_t contents, int64_t destination, int64_t reply_path) { - LDKOnionMessenger this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - 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); - } - void* destination_ptr = untag_ptr(destination); - CHECK_ACCESS(destination_ptr); - LDKDestination destination_conv = *(LDKDestination*)(destination_ptr); - destination_conv = Destination_clone((LDKDestination*)untag_ptr(destination)); - 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_SendSuccessSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SendSuccessSendErrorZ), "LDKCResult_SendSuccessSendErrorZ"); - *ret_conv = OnionMessenger_send_onion_message(&this_arg_conv, contents_conv, destination_conv, reply_path_conv); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_MessageSendEvent_send_announcement_signatures(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKAnnouncementSignatures msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = AnnouncementSignatures_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_announcement_signatures(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_OnionMessenger_as_OnionMessageHandler(int64_t this_arg) { - LDKOnionMessenger this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOnionMessageHandler* ret_ret = MALLOC(sizeof(LDKOnionMessageHandler), "LDKOnionMessageHandler"); - *ret_ret = OnionMessenger_as_OnionMessageHandler(&this_arg_conv); - return tag_ptr(ret_ret, true); +int64_t CS_LDK_MessageSendEvent_update_htlcs(int8_tArray node_id, int64_t updates) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKCommitmentUpdate updates_conv; + updates_conv.inner = untag_ptr(updates); + updates_conv.is_owned = ptr_is_owned(updates); + CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv); + updates_conv = CommitmentUpdate_clone(&updates_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_update_htlcs(node_id_ref, updates_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_OffersMessageHandler_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); - LDKOffersMessageHandler this_ptr_conv = *(LDKOffersMessageHandler*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - OffersMessageHandler_free(this_ptr_conv); +int64_t CS_LDK_MessageSendEvent_send_revoke_and_ack(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKRevokeAndACK msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = RevokeAndACK_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_revoke_and_ack(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_OffersMessage_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); - LDKOffersMessage this_ptr_conv = *(LDKOffersMessage*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - OffersMessage_free(this_ptr_conv); +int64_t CS_LDK_MessageSendEvent_send_closing_signed(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKClosingSigned msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = ClosingSigned_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_closing_signed(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -static inline uint64_t OffersMessage_clone_ptr(LDKOffersMessage *NONNULL_PTR arg) { - LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); - *ret_copy = OffersMessage_clone(arg); +int64_t CS_LDK_MessageSendEvent_send_shutdown(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKShutdown msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = Shutdown_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_shutdown(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_OffersMessage_clone_ptr(int64_t arg) { - LDKOffersMessage* arg_conv = (LDKOffersMessage*)untag_ptr(arg); - int64_t ret_conv = OffersMessage_clone_ptr(arg_conv); - return ret_conv; -} -int64_t CS_LDK_OffersMessage_clone(int64_t orig) { - LDKOffersMessage* orig_conv = (LDKOffersMessage*)untag_ptr(orig); - LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); - *ret_copy = OffersMessage_clone(orig_conv); +int64_t CS_LDK_MessageSendEvent_send_channel_reestablish(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKChannelReestablish msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = ChannelReestablish_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_channel_reestablish(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_OffersMessage_invoice_request(int64_t a) { - LDKInvoiceRequest a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = InvoiceRequest_clone(&a_conv); - LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); - *ret_copy = OffersMessage_invoice_request(a_conv); +int64_t CS_LDK_MessageSendEvent_send_channel_announcement(int8_tArray node_id, int64_t msg, int64_t update_msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKChannelAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = ChannelAnnouncement_clone(&msg_conv); + LDKChannelUpdate update_msg_conv; + update_msg_conv.inner = untag_ptr(update_msg); + update_msg_conv.is_owned = ptr_is_owned(update_msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv); + update_msg_conv = ChannelUpdate_clone(&update_msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_channel_announcement(node_id_ref, msg_conv, update_msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_OffersMessage_invoice(int64_t a) { - LDKBolt12Invoice a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = Bolt12Invoice_clone(&a_conv); - LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); - *ret_copy = OffersMessage_invoice(a_conv); +int64_t CS_LDK_MessageSendEvent_broadcast_channel_announcement(int64_t msg, int64_t update_msg) { + LDKChannelAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = ChannelAnnouncement_clone(&msg_conv); + LDKChannelUpdate update_msg_conv; + update_msg_conv.inner = untag_ptr(update_msg); + update_msg_conv.is_owned = ptr_is_owned(update_msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv); + update_msg_conv = ChannelUpdate_clone(&update_msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_broadcast_channel_announcement(msg_conv, update_msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_OffersMessage_invoice_error(int64_t a) { - LDKInvoiceError a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = InvoiceError_clone(&a_conv); - LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); - *ret_copy = OffersMessage_invoice_error(a_conv); +int64_t CS_LDK_MessageSendEvent_broadcast_channel_update(int64_t msg) { + LDKChannelUpdate msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = ChannelUpdate_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_broadcast_channel_update(msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -jboolean CS_LDK_OffersMessage_is_known_type(int64_t tlv_type) { - jboolean ret_conv = OffersMessage_is_known_type(tlv_type); - return ret_conv; +int64_t CS_LDK_MessageSendEvent_broadcast_node_announcement(int64_t msg) { + LDKNodeAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = NodeAnnouncement_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_broadcast_node_announcement(msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_OffersMessage_as_OnionMessageContents(int64_t this_arg) { - LDKOffersMessage* this_arg_conv = (LDKOffersMessage*)untag_ptr(this_arg); - LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); - *ret_ret = OffersMessage_as_OnionMessageContents(this_arg_conv); - return tag_ptr(ret_ret, true); +int64_t CS_LDK_MessageSendEvent_send_channel_update(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKChannelUpdate msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = ChannelUpdate_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_channel_update(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int8_tArray CS_LDK_OffersMessage_write(int64_t obj) { - LDKOffersMessage* obj_conv = (LDKOffersMessage*)untag_ptr(obj); - LDKCVec_u8Z ret_var = OffersMessage_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_MessageSendEvent_handle_error(int8_tArray node_id, int64_t action) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + void* action_ptr = untag_ptr(action); + CHECK_ACCESS(action_ptr); + LDKErrorAction action_conv = *(LDKErrorAction*)(action_ptr); + action_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(action)); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_handle_error(node_id_ref, action_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_OffersMessage_read(int8_tArray ser, int64_t arg_a, int64_t arg_b) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - void* arg_b_ptr = untag_ptr(arg_b); - if (ptr_is_owned(arg_b)) { CHECK_ACCESS(arg_b_ptr); } - LDKLogger* arg_b_conv = (LDKLogger*)arg_b_ptr; - LDKCResult_OffersMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersMessageDecodeErrorZ), "LDKCResult_OffersMessageDecodeErrorZ"); - *ret_conv = OffersMessage_read(ser_ref, arg_a, arg_b_conv); - FREE(ser); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_MessageSendEvent_send_channel_range_query(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKQueryChannelRange msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = QueryChannelRange_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_channel_range_query(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_Packet_free(int64_t this_obj) { - LDKPacket this_obj_conv; +int64_t CS_LDK_MessageSendEvent_send_short_ids_query(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKQueryShortChannelIds msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = QueryShortChannelIds_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_short_ids_query(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_MessageSendEvent_send_reply_channel_range(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKReplyChannelRange msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = ReplyChannelRange_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_reply_channel_range(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_MessageSendEvent_send_gossip_timestamp_filter(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKGossipTimestampFilter msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = GossipTimestampFilter_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_gossip_timestamp_filter(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_MessageSendEventsProvider_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); + LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + MessageSendEventsProvider_free(this_ptr_conv); +} + +void CS_LDK_EventsProvider_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); + LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + EventsProvider_free(this_ptr_conv); +} + +void CS_LDK_ReplayEvent_free(int64_t this_obj) { + LDKReplayEvent this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Packet_free(this_obj_conv); + ReplayEvent_free(this_obj_conv); } -int8_t CS_LDK_Packet_get_version(int64_t this_ptr) { - LDKPacket this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_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 = Packet_get_version(&this_ptr_conv); +int64_t CS_LDK_ReplayEvent_new() { + LDKReplayEvent ret_var = ReplayEvent_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 ReplayEvent_clone_ptr(LDKReplayEvent *NONNULL_PTR arg) { + LDKReplayEvent ret_var = ReplayEvent_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_ReplayEvent_clone_ptr(int64_t arg) { + LDKReplayEvent 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 = ReplayEvent_clone_ptr(&arg_conv); return ret_conv; } -void CS_LDK_Packet_set_version(int64_t this_ptr, int8_t val) { - LDKPacket this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - Packet_set_version(&this_ptr_conv, val); +int64_t CS_LDK_ReplayEvent_clone(int64_t orig) { + LDKReplayEvent 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; + LDKReplayEvent ret_var = ReplayEvent_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; } -int8_tArray CS_LDK_Packet_get_public_key(int64_t this_ptr) { - LDKPacket this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(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, Packet_get_public_key(&this_ptr_conv).compressed_form, 33); - return ret_arr; +void CS_LDK_EventHandler_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); + LDKEventHandler this_ptr_conv = *(LDKEventHandler*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + EventHandler_free(this_ptr_conv); } -void CS_LDK_Packet_set_public_key(int64_t this_ptr, int8_tArray val) { - LDKPacket this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - Packet_set_public_key(&this_ptr_conv, val_ref); +void CS_LDK_AnchorDescriptor_free(int64_t this_obj) { + LDKAnchorDescriptor this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + AnchorDescriptor_free(this_obj_conv); } -int8_tArray CS_LDK_Packet_get_hop_data(int64_t this_ptr) { - LDKPacket this_ptr_conv; +int64_t CS_LDK_AnchorDescriptor_get_channel_derivation_parameters(int64_t this_ptr) { + LDKAnchorDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = Packet_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; + LDKChannelDerivationParameters ret_var = AnchorDescriptor_get_channel_derivation_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_Packet_set_hop_data(int64_t this_ptr, int8_tArray val) { - LDKPacket this_ptr_conv; +void CS_LDK_AnchorDescriptor_set_channel_derivation_parameters(int64_t this_ptr, int64_t val) { + LDKAnchorDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - Packet_set_hop_data(&this_ptr_conv, val_ref); + LDKChannelDerivationParameters 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 = ChannelDerivationParameters_clone(&val_conv); + AnchorDescriptor_set_channel_derivation_parameters(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_Packet_get_hmac(int64_t this_ptr) { - LDKPacket this_ptr_conv; +int64_t CS_LDK_AnchorDescriptor_get_outpoint(int64_t this_ptr) { + LDKAnchorDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(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, *Packet_get_hmac(&this_ptr_conv), 32); - return ret_arr; + LDKOutPoint ret_var = AnchorDescriptor_get_outpoint(&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_Packet_set_hmac(int64_t this_ptr, int8_tArray val) { - LDKPacket this_ptr_conv; +void CS_LDK_AnchorDescriptor_set_outpoint(int64_t this_ptr, int64_t val) { + LDKAnchorDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - Packet_set_hmac(&this_ptr_conv, val_ref); + LDKOutPoint val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = OutPoint_clone(&val_conv); + AnchorDescriptor_set_outpoint(&this_ptr_conv, val_conv); } -int64_t CS_LDK_Packet_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); - LDKPacket ret_var = Packet_new(version_arg, public_key_arg_ref, hop_data_arg_ref, hmac_arg_ref); +int64_t CS_LDK_AnchorDescriptor_new(int64_t channel_derivation_parameters_arg, int64_t outpoint_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); + LDKOutPoint outpoint_arg_conv; + outpoint_arg_conv.inner = untag_ptr(outpoint_arg); + outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); + outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); + LDKAnchorDescriptor ret_var = AnchorDescriptor_new(channel_derivation_parameters_arg_conv, outpoint_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 Packet_clone_ptr(LDKPacket *NONNULL_PTR arg) { - LDKPacket ret_var = Packet_clone(arg); +static inline uint64_t AnchorDescriptor_clone_ptr(LDKAnchorDescriptor *NONNULL_PTR arg) { + LDKAnchorDescriptor ret_var = AnchorDescriptor_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_Packet_clone_ptr(int64_t arg) { - LDKPacket arg_conv; +int64_t CS_LDK_AnchorDescriptor_clone_ptr(int64_t arg) { + LDKAnchorDescriptor 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 = Packet_clone_ptr(&arg_conv); + int64_t ret_conv = AnchorDescriptor_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_Packet_clone(int64_t orig) { - LDKPacket orig_conv; +int64_t CS_LDK_AnchorDescriptor_clone(int64_t orig) { + LDKAnchorDescriptor 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; - LDKPacket ret_var = Packet_clone(&orig_conv); + LDKAnchorDescriptor ret_var = AnchorDescriptor_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_Packet_hash(int64_t o) { - LDKPacket o_conv; - 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 = Packet_hash(&o_conv); - return ret_conv; -} - -jboolean CS_LDK_Packet_eq(int64_t a, int64_t b) { - LDKPacket a_conv; +jboolean CS_LDK_AnchorDescriptor_eq(int64_t a, int64_t b) { + LDKAnchorDescriptor a_conv; 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; - LDKPacket b_conv; + LDKAnchorDescriptor 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 = Packet_eq(&a_conv, &b_conv); + jboolean ret_conv = AnchorDescriptor_eq(&a_conv, &b_conv); return ret_conv; } -int8_tArray CS_LDK_Packet_write(int64_t obj) { - LDKPacket 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 = Packet_write(&obj_conv); +int64_t CS_LDK_AnchorDescriptor_previous_utxo(int64_t this_arg) { + LDKAnchorDescriptor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = AnchorDescriptor_previous_utxo(&this_arg_conv); + return tag_ptr(ret_ref, true); +} + +int64_t CS_LDK_AnchorDescriptor_unsigned_tx_input(int64_t this_arg) { + LDKAnchorDescriptor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKTxIn* ret_ref = MALLOC(sizeof(LDKTxIn), "LDKTxIn"); + *ret_ref = AnchorDescriptor_unsigned_tx_input(&this_arg_conv); + return tag_ptr(ret_ref, true); +} + +int8_tArray CS_LDK_AnchorDescriptor_witness_script(int64_t this_arg) { + LDKAnchorDescriptor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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 ret_var = AnchorDescriptor_witness_script(&this_arg_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } -void CS_LDK_ParsedOnionMessageContents_free(int64_t this_ptr) { +int8_tArray CS_LDK_AnchorDescriptor_tx_input_witness(int64_t this_arg, int8_tArray signature) { + LDKAnchorDescriptor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKECDSASignature signature_ref; + CHECK(signature->arr_len == 64); + memcpy(signature_ref.compact_form, signature->elems, 64); FREE(signature); + LDKWitness ret_var = AnchorDescriptor_tx_input_witness(&this_arg_conv, signature_ref); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + Witness_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_AnchorDescriptor_derive_channel_signer(int64_t this_arg, int64_t signer_provider) { + LDKAnchorDescriptor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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* signer_provider_ptr = untag_ptr(signer_provider); + if (ptr_is_owned(signer_provider)) { CHECK_ACCESS(signer_provider_ptr); } + LDKSignerProvider* signer_provider_conv = (LDKSignerProvider*)signer_provider_ptr; + LDKEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner"); + *ret_ret = AnchorDescriptor_derive_channel_signer(&this_arg_conv, signer_provider_conv); + return tag_ptr(ret_ret, true); +} + +void CS_LDK_BumpTransactionEvent_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); - LDKParsedOnionMessageContents this_ptr_conv = *(LDKParsedOnionMessageContents*)(this_ptr_ptr); + LDKBumpTransactionEvent this_ptr_conv = *(LDKBumpTransactionEvent*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - ParsedOnionMessageContents_free(this_ptr_conv); + BumpTransactionEvent_free(this_ptr_conv); } -static inline uint64_t ParsedOnionMessageContents_clone_ptr(LDKParsedOnionMessageContents *NONNULL_PTR arg) { - LDKParsedOnionMessageContents *ret_copy = MALLOC(sizeof(LDKParsedOnionMessageContents), "LDKParsedOnionMessageContents"); - *ret_copy = ParsedOnionMessageContents_clone(arg); +static inline uint64_t BumpTransactionEvent_clone_ptr(LDKBumpTransactionEvent *NONNULL_PTR arg) { + LDKBumpTransactionEvent *ret_copy = MALLOC(sizeof(LDKBumpTransactionEvent), "LDKBumpTransactionEvent"); + *ret_copy = BumpTransactionEvent_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_ParsedOnionMessageContents_clone_ptr(int64_t arg) { - LDKParsedOnionMessageContents* arg_conv = (LDKParsedOnionMessageContents*)untag_ptr(arg); - int64_t ret_conv = ParsedOnionMessageContents_clone_ptr(arg_conv); +int64_t CS_LDK_BumpTransactionEvent_clone_ptr(int64_t arg) { + LDKBumpTransactionEvent* arg_conv = (LDKBumpTransactionEvent*)untag_ptr(arg); + int64_t ret_conv = BumpTransactionEvent_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_ParsedOnionMessageContents_clone(int64_t orig) { - LDKParsedOnionMessageContents* orig_conv = (LDKParsedOnionMessageContents*)untag_ptr(orig); - LDKParsedOnionMessageContents *ret_copy = MALLOC(sizeof(LDKParsedOnionMessageContents), "LDKParsedOnionMessageContents"); - *ret_copy = ParsedOnionMessageContents_clone(orig_conv); +int64_t CS_LDK_BumpTransactionEvent_clone(int64_t orig) { + LDKBumpTransactionEvent* orig_conv = (LDKBumpTransactionEvent*)untag_ptr(orig); + LDKBumpTransactionEvent *ret_copy = MALLOC(sizeof(LDKBumpTransactionEvent), "LDKBumpTransactionEvent"); + *ret_copy = BumpTransactionEvent_clone(orig_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_ParsedOnionMessageContents_offers(int64_t a) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKOffersMessage a_conv = *(LDKOffersMessage*)(a_ptr); - a_conv = OffersMessage_clone((LDKOffersMessage*)untag_ptr(a)); - LDKParsedOnionMessageContents *ret_copy = MALLOC(sizeof(LDKParsedOnionMessageContents), "LDKParsedOnionMessageContents"); - *ret_copy = ParsedOnionMessageContents_offers(a_conv); +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); + LDKTransaction commitment_tx_ref; + commitment_tx_ref.datalen = commitment_tx->arr_len; + commitment_tx_ref.data = MALLOC(commitment_tx_ref.datalen, "LDKTransaction Bytes"); + memcpy(commitment_tx_ref.data, commitment_tx->elems, commitment_tx_ref.datalen); FREE(commitment_tx); + commitment_tx_ref.data_is_owned = true; + LDKAnchorDescriptor anchor_descriptor_conv; + anchor_descriptor_conv.inner = untag_ptr(anchor_descriptor); + anchor_descriptor_conv.is_owned = ptr_is_owned(anchor_descriptor); + CHECK_INNER_FIELD_ACCESS_OR_NULL(anchor_descriptor_conv); + anchor_descriptor_conv = AnchorDescriptor_clone(&anchor_descriptor_conv); + LDKCVec_HTLCOutputInCommitmentZ pending_htlcs_constr; + pending_htlcs_constr.datalen = pending_htlcs->arr_len; + if (pending_htlcs_constr.datalen > 0) + pending_htlcs_constr.data = MALLOC(pending_htlcs_constr.datalen * sizeof(LDKHTLCOutputInCommitment), "LDKCVec_HTLCOutputInCommitmentZ Elements"); + else + pending_htlcs_constr.data = NULL; + int64_t* pending_htlcs_vals = pending_htlcs->elems; + for (size_t y = 0; y < pending_htlcs_constr.datalen; y++) { + int64_t pending_htlcs_conv_24 = pending_htlcs_vals[y]; + LDKHTLCOutputInCommitment pending_htlcs_conv_24_conv; + pending_htlcs_conv_24_conv.inner = untag_ptr(pending_htlcs_conv_24); + pending_htlcs_conv_24_conv.is_owned = ptr_is_owned(pending_htlcs_conv_24); + CHECK_INNER_FIELD_ACCESS_OR_NULL(pending_htlcs_conv_24_conv); + pending_htlcs_conv_24_conv = HTLCOutputInCommitment_clone(&pending_htlcs_conv_24_conv); + pending_htlcs_constr.data[y] = pending_htlcs_conv_24_conv; + } + FREE(pending_htlcs); + LDKBumpTransactionEvent *ret_copy = MALLOC(sizeof(LDKBumpTransactionEvent), "LDKBumpTransactionEvent"); + *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_ParsedOnionMessageContents_custom(int64_t a) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKOnionMessageContents a_conv = *(LDKOnionMessageContents*)(a_ptr); - if (a_conv.free == LDKOnionMessageContents_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKOnionMessageContents_JCalls_cloned(&a_conv); +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); + LDKCVec_HTLCDescriptorZ htlc_descriptors_constr; + htlc_descriptors_constr.datalen = htlc_descriptors->arr_len; + if (htlc_descriptors_constr.datalen > 0) + htlc_descriptors_constr.data = MALLOC(htlc_descriptors_constr.datalen * sizeof(LDKHTLCDescriptor), "LDKCVec_HTLCDescriptorZ Elements"); + else + htlc_descriptors_constr.data = NULL; + int64_t* htlc_descriptors_vals = htlc_descriptors->elems; + for (size_t q = 0; q < htlc_descriptors_constr.datalen; q++) { + int64_t htlc_descriptors_conv_16 = htlc_descriptors_vals[q]; + LDKHTLCDescriptor htlc_descriptors_conv_16_conv; + htlc_descriptors_conv_16_conv.inner = untag_ptr(htlc_descriptors_conv_16); + htlc_descriptors_conv_16_conv.is_owned = ptr_is_owned(htlc_descriptors_conv_16); + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_descriptors_conv_16_conv); + htlc_descriptors_conv_16_conv = HTLCDescriptor_clone(&htlc_descriptors_conv_16_conv); + htlc_descriptors_constr.data[q] = htlc_descriptors_conv_16_conv; } - LDKParsedOnionMessageContents *ret_copy = MALLOC(sizeof(LDKParsedOnionMessageContents), "LDKParsedOnionMessageContents"); - *ret_copy = ParsedOnionMessageContents_custom(a_conv); + FREE(htlc_descriptors); + LDKBumpTransactionEvent *ret_copy = MALLOC(sizeof(LDKBumpTransactionEvent), "LDKBumpTransactionEvent"); + *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; } -int64_t CS_LDK_ParsedOnionMessageContents_as_OnionMessageContents(int64_t this_arg) { - LDKParsedOnionMessageContents* this_arg_conv = (LDKParsedOnionMessageContents*)untag_ptr(this_arg); - LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); - *ret_ret = ParsedOnionMessageContents_as_OnionMessageContents(this_arg_conv); - return tag_ptr(ret_ret, true); +jboolean CS_LDK_BumpTransactionEvent_eq(int64_t a, int64_t b) { + LDKBumpTransactionEvent* a_conv = (LDKBumpTransactionEvent*)untag_ptr(a); + LDKBumpTransactionEvent* b_conv = (LDKBumpTransactionEvent*)untag_ptr(b); + jboolean ret_conv = BumpTransactionEvent_eq(a_conv, b_conv); + return ret_conv; } -int8_tArray CS_LDK_ParsedOnionMessageContents_write(int64_t obj) { - LDKParsedOnionMessageContents* obj_conv = (LDKParsedOnionMessageContents*)untag_ptr(obj); - LDKCVec_u8Z ret_var = ParsedOnionMessageContents_write(obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +void CS_LDK_Input_free(int64_t this_obj) { + LDKInput this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Input_free(this_obj_conv); } -static inline uint64_t OnionMessageContents_clone_ptr(LDKOnionMessageContents *NONNULL_PTR arg) { - LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); - *ret_ret = OnionMessageContents_clone(arg); - return tag_ptr(ret_ret, true); -} -int64_t CS_LDK_OnionMessageContents_clone_ptr(int64_t arg) { - void* arg_ptr = untag_ptr(arg); - if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); } - LDKOnionMessageContents* arg_conv = (LDKOnionMessageContents*)arg_ptr; - int64_t ret_conv = OnionMessageContents_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_OnionMessageContents_clone(int64_t orig) { - void* orig_ptr = untag_ptr(orig); - if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); } - LDKOnionMessageContents* orig_conv = (LDKOnionMessageContents*)orig_ptr; - LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); - *ret_ret = OnionMessageContents_clone(orig_conv); - return tag_ptr(ret_ret, true); -} - -void CS_LDK_OnionMessageContents_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); - LDKOnionMessageContents this_ptr_conv = *(LDKOnionMessageContents*)(this_ptr_ptr); - FREE(untag_ptr(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); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BlindedPath_free(this_obj_conv); -} - -int64_t CS_LDK_BlindedPath_get_introduction_node(int64_t this_ptr) { - LDKBlindedPath this_ptr_conv; +int64_t CS_LDK_Input_get_outpoint(int64_t this_ptr) { + LDKInput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - 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); + LDKOutPoint ret_var = Input_get_outpoint(&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_BlindedPath_set_introduction_node(int64_t this_ptr, int64_t val) { - LDKBlindedPath this_ptr_conv; +void CS_LDK_Input_set_outpoint(int64_t this_ptr, int64_t val) { + LDKInput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - LDKIntroductionNode val_conv = *(LDKIntroductionNode*)(val_ptr); - val_conv = IntroductionNode_clone((LDKIntroductionNode*)untag_ptr(val)); - BlindedPath_set_introduction_node(&this_ptr_conv, val_conv); + LDKOutPoint val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = OutPoint_clone(&val_conv); + Input_set_outpoint(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_BlindedPath_get_blinding_point(int64_t this_ptr) { - LDKBlindedPath this_ptr_conv; +int64_t CS_LDK_Input_get_previous_utxo(int64_t this_ptr) { + LDKInput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(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_blinding_point(&this_ptr_conv).compressed_form, 33); - return ret_arr; + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = Input_get_previous_utxo(&this_ptr_conv); + return tag_ptr(ret_ref, true); } -void CS_LDK_BlindedPath_set_blinding_point(int64_t this_ptr, int8_tArray val) { - LDKBlindedPath this_ptr_conv; +void CS_LDK_Input_set_previous_utxo(int64_t this_ptr, int64_t val) { + LDKInput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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_blinding_point(&this_ptr_conv, val_ref); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); + val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val)); + Input_set_previous_utxo(&this_ptr_conv, val_conv); } -int64_tArray CS_LDK_BlindedPath_get_blinded_hops(int64_t this_ptr) { - LDKBlindedPath this_ptr_conv; +int64_t CS_LDK_Input_get_satisfaction_weight(int64_t this_ptr) { + LDKInput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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_BlindedHopZ ret_var = BlindedPath_get_blinded_hops(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t m = 0; m < ret_var.datalen; m++) { - LDKBlindedHop ret_conv_12_var = ret_var.data[m]; - int64_t ret_conv_12_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_var); - ret_conv_12_ref = tag_ptr(ret_conv_12_var.inner, ret_conv_12_var.is_owned); - ret_arr_ptr[m] = ret_conv_12_ref; - } - - FREE(ret_var.data); - return ret_arr; + int64_t ret_conv = Input_get_satisfaction_weight(&this_ptr_conv); + return ret_conv; } -void CS_LDK_BlindedPath_set_blinded_hops(int64_t this_ptr, int64_tArray val) { - LDKBlindedPath this_ptr_conv; +void CS_LDK_Input_set_satisfaction_weight(int64_t this_ptr, int64_t val) { + LDKInput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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_BlindedHopZ val_constr; - val_constr.datalen = val->arr_len; - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKBlindedHop), "LDKCVec_BlindedHopZ Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = val->elems; - for (size_t m = 0; m < val_constr.datalen; m++) { - int64_t val_conv_12 = val_vals[m]; - LDKBlindedHop val_conv_12_conv; - val_conv_12_conv.inner = untag_ptr(val_conv_12); - val_conv_12_conv.is_owned = ptr_is_owned(val_conv_12); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_12_conv); - val_conv_12_conv = BlindedHop_clone(&val_conv_12_conv); - val_constr.data[m] = val_conv_12_conv; - } - FREE(val); - BlindedPath_set_blinded_hops(&this_ptr_conv, val_constr); + Input_set_satisfaction_weight(&this_ptr_conv, val); } -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); - LDKCVec_BlindedHopZ blinded_hops_arg_constr; - blinded_hops_arg_constr.datalen = blinded_hops_arg->arr_len; - if (blinded_hops_arg_constr.datalen > 0) - blinded_hops_arg_constr.data = MALLOC(blinded_hops_arg_constr.datalen * sizeof(LDKBlindedHop), "LDKCVec_BlindedHopZ Elements"); - else - blinded_hops_arg_constr.data = NULL; - int64_t* blinded_hops_arg_vals = blinded_hops_arg->elems; - for (size_t m = 0; m < blinded_hops_arg_constr.datalen; m++) { - int64_t blinded_hops_arg_conv_12 = blinded_hops_arg_vals[m]; - LDKBlindedHop blinded_hops_arg_conv_12_conv; - blinded_hops_arg_conv_12_conv.inner = untag_ptr(blinded_hops_arg_conv_12); - blinded_hops_arg_conv_12_conv.is_owned = ptr_is_owned(blinded_hops_arg_conv_12); - CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_hops_arg_conv_12_conv); - blinded_hops_arg_conv_12_conv = BlindedHop_clone(&blinded_hops_arg_conv_12_conv); - blinded_hops_arg_constr.data[m] = blinded_hops_arg_conv_12_conv; - } - FREE(blinded_hops_arg); - LDKBlindedPath ret_var = BlindedPath_new(introduction_node_arg_conv, blinding_point_arg_ref, blinded_hops_arg_constr); +int64_t CS_LDK_Input_new(int64_t outpoint_arg, int64_t previous_utxo_arg, int64_t satisfaction_weight_arg) { + LDKOutPoint outpoint_arg_conv; + outpoint_arg_conv.inner = untag_ptr(outpoint_arg); + outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); + outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); + void* previous_utxo_arg_ptr = untag_ptr(previous_utxo_arg); + CHECK_ACCESS(previous_utxo_arg_ptr); + LDKTxOut previous_utxo_arg_conv = *(LDKTxOut*)(previous_utxo_arg_ptr); + previous_utxo_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(previous_utxo_arg)); + LDKInput ret_var = Input_new(outpoint_arg_conv, previous_utxo_arg_conv, satisfaction_weight_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 BlindedPath_clone_ptr(LDKBlindedPath *NONNULL_PTR arg) { - LDKBlindedPath ret_var = BlindedPath_clone(arg); +static inline uint64_t Input_clone_ptr(LDKInput *NONNULL_PTR arg) { + LDKInput ret_var = Input_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_BlindedPath_clone_ptr(int64_t arg) { - LDKBlindedPath arg_conv; +int64_t CS_LDK_Input_clone_ptr(int64_t arg) { + LDKInput arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = BlindedPath_clone_ptr(&arg_conv); + int64_t ret_conv = Input_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_BlindedPath_clone(int64_t orig) { - LDKBlindedPath orig_conv; +int64_t CS_LDK_Input_clone(int64_t orig) { + LDKInput orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBlindedPath ret_var = BlindedPath_clone(&orig_conv); + LDKInput ret_var = Input_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_BlindedPath_hash(int64_t o) { - LDKBlindedPath o_conv; +int64_t CS_LDK_Input_hash(int64_t o) { + LDKInput o_conv; 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 = BlindedPath_hash(&o_conv); + int64_t ret_conv = Input_hash(&o_conv); return ret_conv; } -jboolean CS_LDK_BlindedPath_eq(int64_t a, int64_t b) { - LDKBlindedPath a_conv; +jboolean CS_LDK_Input_eq(int64_t a, int64_t b) { + LDKInput a_conv; 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; - LDKBlindedPath b_conv; + LDKInput 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 = BlindedPath_eq(&a_conv, &b_conv); - 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); + jboolean ret_conv = Input_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; +void CS_LDK_Utxo_free(int64_t this_obj) { + LDKUtxo this_obj_conv; this_obj_conv.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); + Utxo_free(this_obj_conv); } -int64_t CS_LDK_EmptyNodeIdLookUp_new() { - LDKEmptyNodeIdLookUp ret_var = EmptyNodeIdLookUp_new(); +int64_t CS_LDK_Utxo_get_outpoint(int64_t this_ptr) { + LDKUtxo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKOutPoint ret_var = Utxo_get_outpoint(&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; } -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); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BlindedHop_free(this_obj_conv); +void CS_LDK_Utxo_set_outpoint(int64_t this_ptr, int64_t val) { + LDKUtxo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKOutPoint val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = OutPoint_clone(&val_conv); + Utxo_set_outpoint(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_BlindedHop_get_blinded_node_id(int64_t this_ptr) { - LDKBlindedHop this_ptr_conv; +int64_t CS_LDK_Utxo_get_output(int64_t this_ptr) { + LDKUtxo this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(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, BlindedHop_get_blinded_node_id(&this_ptr_conv).compressed_form, 33); - return ret_arr; + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = Utxo_get_output(&this_ptr_conv); + return tag_ptr(ret_ref, true); } -void CS_LDK_BlindedHop_set_blinded_node_id(int64_t this_ptr, int8_tArray val) { - LDKBlindedHop this_ptr_conv; +void CS_LDK_Utxo_set_output(int64_t this_ptr, int64_t val) { + LDKUtxo this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - BlindedHop_set_blinded_node_id(&this_ptr_conv, val_ref); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); + val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val)); + Utxo_set_output(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_BlindedHop_get_encrypted_payload(int64_t this_ptr) { - LDKBlindedHop this_ptr_conv; +int64_t CS_LDK_Utxo_get_satisfaction_weight(int64_t this_ptr) { + LDKUtxo this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = BlindedHop_get_encrypted_payload(&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; + int64_t ret_conv = Utxo_get_satisfaction_weight(&this_ptr_conv); + return ret_conv; } -void CS_LDK_BlindedHop_set_encrypted_payload(int64_t this_ptr, int8_tArray val) { - LDKBlindedHop this_ptr_conv; +void CS_LDK_Utxo_set_satisfaction_weight(int64_t this_ptr, int64_t val) { + LDKUtxo this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - BlindedHop_set_encrypted_payload(&this_ptr_conv, val_ref); + Utxo_set_satisfaction_weight(&this_ptr_conv, val); } -int64_t CS_LDK_BlindedHop_new(int8_tArray blinded_node_id_arg, int8_tArray encrypted_payload_arg) { - LDKPublicKey blinded_node_id_arg_ref; - CHECK(blinded_node_id_arg->arr_len == 33); - memcpy(blinded_node_id_arg_ref.compressed_form, blinded_node_id_arg->elems, 33); FREE(blinded_node_id_arg); - LDKCVec_u8Z encrypted_payload_arg_ref; - encrypted_payload_arg_ref.datalen = encrypted_payload_arg->arr_len; - encrypted_payload_arg_ref.data = MALLOC(encrypted_payload_arg_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(encrypted_payload_arg_ref.data, encrypted_payload_arg->elems, encrypted_payload_arg_ref.datalen); FREE(encrypted_payload_arg); - LDKBlindedHop ret_var = BlindedHop_new(blinded_node_id_arg_ref, encrypted_payload_arg_ref); +int64_t CS_LDK_Utxo_new(int64_t outpoint_arg, int64_t output_arg, int64_t satisfaction_weight_arg) { + LDKOutPoint outpoint_arg_conv; + outpoint_arg_conv.inner = untag_ptr(outpoint_arg); + outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); + outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); + void* output_arg_ptr = untag_ptr(output_arg); + CHECK_ACCESS(output_arg_ptr); + LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr); + output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg)); + LDKUtxo ret_var = Utxo_new(outpoint_arg_conv, output_arg_conv, satisfaction_weight_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 BlindedHop_clone_ptr(LDKBlindedHop *NONNULL_PTR arg) { - LDKBlindedHop ret_var = BlindedHop_clone(arg); +static inline uint64_t Utxo_clone_ptr(LDKUtxo *NONNULL_PTR arg) { + LDKUtxo ret_var = Utxo_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_BlindedHop_clone_ptr(int64_t arg) { - LDKBlindedHop arg_conv; +int64_t CS_LDK_Utxo_clone_ptr(int64_t arg) { + LDKUtxo arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = BlindedHop_clone_ptr(&arg_conv); + int64_t ret_conv = Utxo_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_BlindedHop_clone(int64_t orig) { - LDKBlindedHop orig_conv; +int64_t CS_LDK_Utxo_clone(int64_t orig) { + LDKUtxo orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBlindedHop ret_var = BlindedHop_clone(&orig_conv); + LDKUtxo ret_var = Utxo_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_BlindedHop_hash(int64_t o) { - LDKBlindedHop o_conv; +int64_t CS_LDK_Utxo_hash(int64_t o) { + LDKUtxo o_conv; 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 = BlindedHop_hash(&o_conv); + int64_t ret_conv = Utxo_hash(&o_conv); return ret_conv; } -jboolean CS_LDK_BlindedHop_eq(int64_t a, int64_t b) { - LDKBlindedHop a_conv; +jboolean CS_LDK_Utxo_eq(int64_t a, int64_t b) { + LDKUtxo a_conv; 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; - LDKBlindedHop b_conv; + LDKUtxo 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 = BlindedHop_eq(&a_conv, &b_conv); + jboolean ret_conv = Utxo_eq(&a_conv, &b_conv); return ret_conv; } -int64_t CS_LDK_BlindedPath_one_hop_for_message(int8_tArray recipient_node_id, int64_t entropy_source) { - LDKPublicKey recipient_node_id_ref; - 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); - 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); +int64_t CS_LDK_Utxo_new_p2pkh(int64_t outpoint, int64_t value, int8_tArray pubkey_hash) { + 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); + 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; + LDKUtxo ret_var = Utxo_new_p2pkh(outpoint_conv, value, pubkey_hash_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_BlindedPath_new_for_message(ptrArray node_pks, int64_t entropy_source) { - LDKCVec_PublicKeyZ node_pks_constr; - node_pks_constr.datalen = node_pks->arr_len; - if (node_pks_constr.datalen > 0) - node_pks_constr.data = MALLOC(node_pks_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); - else - node_pks_constr.data = NULL; - int8_tArray* node_pks_vals = (void*) node_pks->elems; - for (size_t i = 0; i < node_pks_constr.datalen; i++) { - int8_tArray node_pks_conv_8 = node_pks_vals[i]; - LDKPublicKey node_pks_conv_8_ref; - CHECK(node_pks_conv_8->arr_len == 33); - memcpy(node_pks_conv_8_ref.compressed_form, node_pks_conv_8->elems, 33); FREE(node_pks_conv_8); - node_pks_constr.data[i] = node_pks_conv_8_ref; - } - FREE(node_pks); - 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); - } - 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); +void CS_LDK_CoinSelection_free(int64_t this_obj) { + LDKCoinSelection this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + CoinSelection_free(this_obj_conv); } -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); - LDKReceiveTlvs payee_tlvs_conv; - payee_tlvs_conv.inner = untag_ptr(payee_tlvs); - payee_tlvs_conv.is_owned = ptr_is_owned(payee_tlvs); - 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); - 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); +int64_tArray CS_LDK_CoinSelection_get_confirmed_utxos(int64_t this_ptr) { + LDKCoinSelection this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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_UtxoZ ret_var = CoinSelection_get_confirmed_utxos(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t g = 0; g < ret_var.datalen; g++) { + LDKUtxo ret_conv_6_var = ret_var.data[g]; + int64_t ret_conv_6_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_6_var); + ret_conv_6_ref = tag_ptr(ret_conv_6_var.inner, ret_conv_6_var.is_owned); + ret_arr_ptr[g] = ret_conv_6_ref; } - 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, min_final_cltv_expiry_delta, entropy_source_conv); - return tag_ptr(ret_conv, true); + + FREE(ret_var.data); + return ret_arr; } -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) - intermediate_nodes_constr.data = MALLOC(intermediate_nodes_constr.datalen * sizeof(LDKForwardNode), "LDKCVec_ForwardNodeZ Elements"); - else - intermediate_nodes_constr.data = NULL; - int64_t* intermediate_nodes_vals = intermediate_nodes->elems; - for (size_t n = 0; n < intermediate_nodes_constr.datalen; n++) { - int64_t intermediate_nodes_conv_13 = intermediate_nodes_vals[n]; - LDKForwardNode intermediate_nodes_conv_13_conv; - intermediate_nodes_conv_13_conv.inner = untag_ptr(intermediate_nodes_conv_13); - intermediate_nodes_conv_13_conv.is_owned = ptr_is_owned(intermediate_nodes_conv_13); - CHECK_INNER_FIELD_ACCESS_OR_NULL(intermediate_nodes_conv_13_conv); - intermediate_nodes_conv_13_conv = ForwardNode_clone(&intermediate_nodes_conv_13_conv); - intermediate_nodes_constr.data[n] = intermediate_nodes_conv_13_conv; - } - FREE(intermediate_nodes); - 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); - LDKReceiveTlvs payee_tlvs_conv; - payee_tlvs_conv.inner = untag_ptr(payee_tlvs); - payee_tlvs_conv.is_owned = ptr_is_owned(payee_tlvs); - 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); - 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, 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); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = BlindedPath_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -int64_t CS_LDK_BlindedPath_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ"); - *ret_conv = BlindedPath_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -int8_tArray CS_LDK_BlindedHop_write(int64_t obj) { - LDKBlindedHop obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = BlindedHop_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -int64_t CS_LDK_BlindedHop_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); - *ret_conv = BlindedHop_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -void CS_LDK_ForwardNode_free(int64_t this_obj) { - LDKForwardNode this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ForwardNode_free(this_obj_conv); -} - -int64_t CS_LDK_ForwardNode_get_tlvs(int64_t this_ptr) { - LDKForwardNode this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKForwardTlvs ret_var = ForwardNode_get_tlvs(&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_ForwardNode_set_tlvs(int64_t this_ptr, int64_t val) { - LDKForwardNode this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKForwardTlvs 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 = ForwardTlvs_clone(&val_conv); - ForwardNode_set_tlvs(&this_ptr_conv, val_conv); -} - -int8_tArray CS_LDK_ForwardNode_get_node_id(int64_t this_ptr) { - LDKForwardNode this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(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, ForwardNode_get_node_id(&this_ptr_conv).compressed_form, 33); - return ret_arr; -} - -void CS_LDK_ForwardNode_set_node_id(int64_t this_ptr, int8_tArray val) { - LDKForwardNode this_ptr_conv; +void CS_LDK_CoinSelection_set_confirmed_utxos(int64_t this_ptr, int64_tArray val) { + LDKCoinSelection this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - ForwardNode_set_node_id(&this_ptr_conv, val_ref); + LDKCVec_UtxoZ val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUtxo), "LDKCVec_UtxoZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = val->elems; + for (size_t g = 0; g < val_constr.datalen; g++) { + int64_t val_conv_6 = val_vals[g]; + LDKUtxo val_conv_6_conv; + val_conv_6_conv.inner = untag_ptr(val_conv_6); + val_conv_6_conv.is_owned = ptr_is_owned(val_conv_6); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_6_conv); + val_conv_6_conv = Utxo_clone(&val_conv_6_conv); + val_constr.data[g] = val_conv_6_conv; + } + FREE(val); + CoinSelection_set_confirmed_utxos(&this_ptr_conv, val_constr); } -int64_t CS_LDK_ForwardNode_get_htlc_maximum_msat(int64_t this_ptr) { - LDKForwardNode this_ptr_conv; +int64_t CS_LDK_CoinSelection_get_change_output(int64_t this_ptr) { + LDKCoinSelection this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = ForwardNode_get_htlc_maximum_msat(&this_ptr_conv); - return ret_conv; + LDKCOption_TxOutZ *ret_copy = MALLOC(sizeof(LDKCOption_TxOutZ), "LDKCOption_TxOutZ"); + *ret_copy = CoinSelection_get_change_output(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_ForwardNode_set_htlc_maximum_msat(int64_t this_ptr, int64_t val) { - LDKForwardNode this_ptr_conv; +void CS_LDK_CoinSelection_set_change_output(int64_t this_ptr, int64_t val) { + LDKCoinSelection this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ForwardNode_set_htlc_maximum_msat(&this_ptr_conv, val); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_TxOutZ val_conv = *(LDKCOption_TxOutZ*)(val_ptr); + val_conv = COption_TxOutZ_clone((LDKCOption_TxOutZ*)untag_ptr(val)); + CoinSelection_set_change_output(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ForwardNode_new(int64_t tlvs_arg, int8_tArray node_id_arg, int64_t htlc_maximum_msat_arg) { - LDKForwardTlvs tlvs_arg_conv; - tlvs_arg_conv.inner = untag_ptr(tlvs_arg); - tlvs_arg_conv.is_owned = ptr_is_owned(tlvs_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(tlvs_arg_conv); - tlvs_arg_conv = ForwardTlvs_clone(&tlvs_arg_conv); - LDKPublicKey node_id_arg_ref; - CHECK(node_id_arg->arr_len == 33); - memcpy(node_id_arg_ref.compressed_form, node_id_arg->elems, 33); FREE(node_id_arg); - LDKForwardNode ret_var = ForwardNode_new(tlvs_arg_conv, node_id_arg_ref, htlc_maximum_msat_arg); +int64_t CS_LDK_CoinSelection_new(int64_tArray confirmed_utxos_arg, int64_t change_output_arg) { + LDKCVec_UtxoZ confirmed_utxos_arg_constr; + confirmed_utxos_arg_constr.datalen = confirmed_utxos_arg->arr_len; + if (confirmed_utxos_arg_constr.datalen > 0) + confirmed_utxos_arg_constr.data = MALLOC(confirmed_utxos_arg_constr.datalen * sizeof(LDKUtxo), "LDKCVec_UtxoZ Elements"); + else + confirmed_utxos_arg_constr.data = NULL; + int64_t* confirmed_utxos_arg_vals = confirmed_utxos_arg->elems; + for (size_t g = 0; g < confirmed_utxos_arg_constr.datalen; g++) { + int64_t confirmed_utxos_arg_conv_6 = confirmed_utxos_arg_vals[g]; + LDKUtxo confirmed_utxos_arg_conv_6_conv; + confirmed_utxos_arg_conv_6_conv.inner = untag_ptr(confirmed_utxos_arg_conv_6); + confirmed_utxos_arg_conv_6_conv.is_owned = ptr_is_owned(confirmed_utxos_arg_conv_6); + CHECK_INNER_FIELD_ACCESS_OR_NULL(confirmed_utxos_arg_conv_6_conv); + confirmed_utxos_arg_conv_6_conv = Utxo_clone(&confirmed_utxos_arg_conv_6_conv); + confirmed_utxos_arg_constr.data[g] = confirmed_utxos_arg_conv_6_conv; + } + FREE(confirmed_utxos_arg); + void* change_output_arg_ptr = untag_ptr(change_output_arg); + CHECK_ACCESS(change_output_arg_ptr); + LDKCOption_TxOutZ change_output_arg_conv = *(LDKCOption_TxOutZ*)(change_output_arg_ptr); + change_output_arg_conv = COption_TxOutZ_clone((LDKCOption_TxOutZ*)untag_ptr(change_output_arg)); + LDKCoinSelection ret_var = CoinSelection_new(confirmed_utxos_arg_constr, change_output_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 ForwardNode_clone_ptr(LDKForwardNode *NONNULL_PTR arg) { - LDKForwardNode ret_var = ForwardNode_clone(arg); +static inline uint64_t CoinSelection_clone_ptr(LDKCoinSelection *NONNULL_PTR arg) { + LDKCoinSelection ret_var = CoinSelection_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_ForwardNode_clone_ptr(int64_t arg) { - LDKForwardNode arg_conv; +int64_t CS_LDK_CoinSelection_clone_ptr(int64_t arg) { + LDKCoinSelection 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 = ForwardNode_clone_ptr(&arg_conv); + int64_t ret_conv = CoinSelection_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_ForwardNode_clone(int64_t orig) { - LDKForwardNode orig_conv; +int64_t CS_LDK_CoinSelection_clone(int64_t orig) { + LDKCoinSelection 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; - LDKForwardNode ret_var = ForwardNode_clone(&orig_conv); + LDKCoinSelection ret_var = CoinSelection_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_ForwardTlvs_free(int64_t this_obj) { - LDKForwardTlvs this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ForwardTlvs_free(this_obj_conv); +void CS_LDK_CoinSelectionSource_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); + LDKCoinSelectionSource this_ptr_conv = *(LDKCoinSelectionSource*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + CoinSelectionSource_free(this_ptr_conv); } -int64_t CS_LDK_ForwardTlvs_get_short_channel_id(int64_t this_ptr) { - LDKForwardTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = ForwardTlvs_get_short_channel_id(&this_ptr_conv); - return ret_conv; +void CS_LDK_WalletSource_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); + LDKWalletSource this_ptr_conv = *(LDKWalletSource*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + WalletSource_free(this_ptr_conv); } -void CS_LDK_ForwardTlvs_set_short_channel_id(int64_t this_ptr, int64_t val) { - LDKForwardTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ForwardTlvs_set_short_channel_id(&this_ptr_conv, val); +void CS_LDK_Wallet_free(int64_t this_obj) { + LDKWallet this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Wallet_free(this_obj_conv); } -int64_t CS_LDK_ForwardTlvs_get_payment_relay(int64_t this_ptr) { - LDKForwardTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPaymentRelay ret_var = ForwardTlvs_get_payment_relay(&this_ptr_conv); +int64_t CS_LDK_Wallet_new(int64_t source, int64_t logger) { + void* source_ptr = untag_ptr(source); + CHECK_ACCESS(source_ptr); + LDKWalletSource source_conv = *(LDKWalletSource*)(source_ptr); + if (source_conv.free == LDKWalletSource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKWalletSource_JCalls_cloned(&source_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); + } + LDKWallet ret_var = Wallet_new(source_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; } -void CS_LDK_ForwardTlvs_set_payment_relay(int64_t this_ptr, int64_t val) { - LDKForwardTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPaymentRelay 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 = PaymentRelay_clone(&val_conv); - ForwardTlvs_set_payment_relay(&this_ptr_conv, val_conv); -} - -int64_t CS_LDK_ForwardTlvs_get_payment_constraints(int64_t this_ptr) { - LDKForwardTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPaymentConstraints ret_var = ForwardTlvs_get_payment_constraints(&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; +int64_t CS_LDK_Wallet_as_CoinSelectionSource(int64_t this_arg) { + LDKWallet this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCoinSelectionSource* ret_ret = MALLOC(sizeof(LDKCoinSelectionSource), "LDKCoinSelectionSource"); + *ret_ret = Wallet_as_CoinSelectionSource(&this_arg_conv); + return tag_ptr(ret_ret, true); } -void CS_LDK_ForwardTlvs_set_payment_constraints(int64_t this_ptr, int64_t val) { - LDKForwardTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPaymentConstraints 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 = PaymentConstraints_clone(&val_conv); - ForwardTlvs_set_payment_constraints(&this_ptr_conv, val_conv); +void CS_LDK_BumpTransactionEventHandler_free(int64_t this_obj) { + LDKBumpTransactionEventHandler this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + BumpTransactionEventHandler_free(this_obj_conv); } -int64_t CS_LDK_ForwardTlvs_get_features(int64_t this_ptr) { - LDKForwardTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKBlindedHopFeatures ret_var = ForwardTlvs_get_features(&this_ptr_conv); +int64_t CS_LDK_BumpTransactionEventHandler_new(int64_t broadcaster, int64_t utxo_source, int64_t signer_provider, int64_t logger) { + 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* utxo_source_ptr = untag_ptr(utxo_source); + CHECK_ACCESS(utxo_source_ptr); + LDKCoinSelectionSource utxo_source_conv = *(LDKCoinSelectionSource*)(utxo_source_ptr); + if (utxo_source_conv.free == LDKCoinSelectionSource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKCoinSelectionSource_JCalls_cloned(&utxo_source_conv); + } + void* signer_provider_ptr = untag_ptr(signer_provider); + CHECK_ACCESS(signer_provider_ptr); + LDKSignerProvider signer_provider_conv = *(LDKSignerProvider*)(signer_provider_ptr); + if (signer_provider_conv.free == LDKSignerProvider_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKSignerProvider_JCalls_cloned(&signer_provider_conv); + } + void* 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); + } + LDKBumpTransactionEventHandler ret_var = BumpTransactionEventHandler_new(broadcaster_conv, utxo_source_conv, signer_provider_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; } -void CS_LDK_ForwardTlvs_set_features(int64_t this_ptr, int64_t val) { - LDKForwardTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKBlindedHopFeatures val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = BlindedHopFeatures_clone(&val_conv); - ForwardTlvs_set_features(&this_ptr_conv, val_conv); +void CS_LDK_BumpTransactionEventHandler_handle_event(int64_t this_arg, int64_t event) { + LDKBumpTransactionEventHandler this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKBumpTransactionEvent* event_conv = (LDKBumpTransactionEvent*)untag_ptr(event); + BumpTransactionEventHandler_handle_event(&this_arg_conv, event_conv); } -int64_t CS_LDK_ForwardTlvs_new(int64_t short_channel_id_arg, int64_t payment_relay_arg, int64_t payment_constraints_arg, int64_t features_arg) { - LDKPaymentRelay payment_relay_arg_conv; - payment_relay_arg_conv.inner = untag_ptr(payment_relay_arg); - payment_relay_arg_conv.is_owned = ptr_is_owned(payment_relay_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_relay_arg_conv); - payment_relay_arg_conv = PaymentRelay_clone(&payment_relay_arg_conv); - LDKPaymentConstraints payment_constraints_arg_conv; - payment_constraints_arg_conv.inner = untag_ptr(payment_constraints_arg); - 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); - LDKBlindedHopFeatures features_arg_conv; - features_arg_conv.inner = untag_ptr(features_arg); - features_arg_conv.is_owned = ptr_is_owned(features_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); - features_arg_conv = BlindedHopFeatures_clone(&features_arg_conv); - LDKForwardTlvs ret_var = ForwardTlvs_new(short_channel_id_arg, payment_relay_arg_conv, payment_constraints_arg_conv, features_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_InitFeatures_eq(int64_t a, int64_t b) { + LDKInitFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKInitFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = InitFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -static inline uint64_t ForwardTlvs_clone_ptr(LDKForwardTlvs *NONNULL_PTR arg) { - LDKForwardTlvs ret_var = ForwardTlvs_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_ForwardTlvs_clone_ptr(int64_t arg) { - LDKForwardTlvs 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 = ForwardTlvs_clone_ptr(&arg_conv); +jboolean CS_LDK_NodeFeatures_eq(int64_t a, int64_t b) { + LDKNodeFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKNodeFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_eq(&a_conv, &b_conv); return ret_conv; } -int64_t CS_LDK_ForwardTlvs_clone(int64_t orig) { - LDKForwardTlvs 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; - LDKForwardTlvs ret_var = ForwardTlvs_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_ChannelFeatures_eq(int64_t a, int64_t b) { + LDKChannelFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKChannelFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ChannelFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -void CS_LDK_ReceiveTlvs_free(int64_t this_obj) { - LDKReceiveTlvs this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ReceiveTlvs_free(this_obj_conv); +jboolean CS_LDK_Bolt11InvoiceFeatures_eq(int64_t a, int64_t b) { + LDKBolt11InvoiceFeatures a_conv; + 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; + LDKBolt11InvoiceFeatures 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 = Bolt11InvoiceFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -int8_tArray CS_LDK_ReceiveTlvs_get_payment_secret(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; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *ReceiveTlvs_get_payment_secret(&this_ptr_conv), 32); - return ret_arr; +jboolean CS_LDK_OfferFeatures_eq(int64_t a, int64_t b) { + LDKOfferFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKOfferFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = OfferFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -void CS_LDK_ReceiveTlvs_set_payment_secret(int64_t this_ptr, int8_tArray 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; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - ReceiveTlvs_set_payment_secret(&this_ptr_conv, val_ref); +jboolean CS_LDK_InvoiceRequestFeatures_eq(int64_t a, int64_t b) { + LDKInvoiceRequestFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKInvoiceRequestFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = InvoiceRequestFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -int64_t CS_LDK_ReceiveTlvs_get_payment_constraints(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; - LDKPaymentConstraints ret_var = ReceiveTlvs_get_payment_constraints(&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_ReceiveTlvs_set_payment_constraints(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; - LDKPaymentConstraints 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 = PaymentConstraints_clone(&val_conv); - ReceiveTlvs_set_payment_constraints(&this_ptr_conv, val_conv); -} - -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; +jboolean CS_LDK_Bolt12InvoiceFeatures_eq(int64_t a, int64_t b) { + LDKBolt12InvoiceFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKBolt12InvoiceFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = Bolt12InvoiceFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -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); +jboolean CS_LDK_BlindedHopFeatures_eq(int64_t a, int64_t b) { + LDKBlindedHopFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKBlindedHopFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = BlindedHopFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -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); - LDKPaymentConstraints payment_constraints_arg_conv; - payment_constraints_arg_conv.inner = untag_ptr(payment_constraints_arg); - 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); - 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); - return ret_ref; +jboolean CS_LDK_ChannelTypeFeatures_eq(int64_t a, int64_t b) { + LDKChannelTypeFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKChannelTypeFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -static inline uint64_t ReceiveTlvs_clone_ptr(LDKReceiveTlvs *NONNULL_PTR arg) { - LDKReceiveTlvs ret_var = ReceiveTlvs_clone(arg); +static inline uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg) { + LDKInitFeatures ret_var = InitFeatures_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_ReceiveTlvs_clone_ptr(int64_t arg) { - LDKReceiveTlvs arg_conv; +int64_t CS_LDK_InitFeatures_clone_ptr(int64_t arg) { + LDKInitFeatures arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = ReceiveTlvs_clone_ptr(&arg_conv); + int64_t ret_conv = InitFeatures_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_ReceiveTlvs_clone(int64_t orig) { - LDKReceiveTlvs orig_conv; +int64_t CS_LDK_InitFeatures_clone(int64_t orig) { + LDKInitFeatures orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKReceiveTlvs ret_var = ReceiveTlvs_clone(&orig_conv); + LDKInitFeatures ret_var = InitFeatures_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_PaymentRelay_free(int64_t this_obj) { - LDKPaymentRelay this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PaymentRelay_free(this_obj_conv); -} - -int16_t CS_LDK_PaymentRelay_get_cltv_expiry_delta(int64_t this_ptr) { - LDKPaymentRelay this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = PaymentRelay_get_cltv_expiry_delta(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_PaymentRelay_set_cltv_expiry_delta(int64_t this_ptr, int16_t val) { - LDKPaymentRelay this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - PaymentRelay_set_cltv_expiry_delta(&this_ptr_conv, val); -} - -int32_t CS_LDK_PaymentRelay_get_fee_proportional_millionths(int64_t this_ptr) { - LDKPaymentRelay this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = PaymentRelay_get_fee_proportional_millionths(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_PaymentRelay_set_fee_proportional_millionths(int64_t this_ptr, int32_t val) { - LDKPaymentRelay this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - PaymentRelay_set_fee_proportional_millionths(&this_ptr_conv, val); +static inline uint64_t NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg) { + LDKNodeFeatures ret_var = NodeFeatures_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; } - -int32_t CS_LDK_PaymentRelay_get_fee_base_msat(int64_t this_ptr) { - LDKPaymentRelay this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = PaymentRelay_get_fee_base_msat(&this_ptr_conv); +int64_t CS_LDK_NodeFeatures_clone_ptr(int64_t arg) { + LDKNodeFeatures arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = NodeFeatures_clone_ptr(&arg_conv); return ret_conv; } -void CS_LDK_PaymentRelay_set_fee_base_msat(int64_t this_ptr, int32_t val) { - LDKPaymentRelay this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - PaymentRelay_set_fee_base_msat(&this_ptr_conv, val); -} - -int64_t CS_LDK_PaymentRelay_new(int16_t cltv_expiry_delta_arg, int32_t fee_proportional_millionths_arg, int32_t fee_base_msat_arg) { - LDKPaymentRelay ret_var = PaymentRelay_new(cltv_expiry_delta_arg, fee_proportional_millionths_arg, fee_base_msat_arg); +int64_t CS_LDK_NodeFeatures_clone(int64_t orig) { + LDKNodeFeatures orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKNodeFeatures ret_var = NodeFeatures_clone(&orig_conv); int64_t ret_ref = 0; 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 PaymentRelay_clone_ptr(LDKPaymentRelay *NONNULL_PTR arg) { - LDKPaymentRelay ret_var = PaymentRelay_clone(arg); +static inline uint64_t ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg) { + LDKChannelFeatures ret_var = ChannelFeatures_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_PaymentRelay_clone_ptr(int64_t arg) { - LDKPaymentRelay arg_conv; +int64_t CS_LDK_ChannelFeatures_clone_ptr(int64_t arg) { + LDKChannelFeatures arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = PaymentRelay_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelFeatures_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_PaymentRelay_clone(int64_t orig) { - LDKPaymentRelay orig_conv; +int64_t CS_LDK_ChannelFeatures_clone(int64_t orig) { + LDKChannelFeatures orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKPaymentRelay ret_var = PaymentRelay_clone(&orig_conv); + LDKChannelFeatures ret_var = ChannelFeatures_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_PaymentConstraints_free(int64_t this_obj) { - LDKPaymentConstraints this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PaymentConstraints_free(this_obj_conv); -} - -int32_t CS_LDK_PaymentConstraints_get_max_cltv_expiry(int64_t this_ptr) { - LDKPaymentConstraints this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = PaymentConstraints_get_max_cltv_expiry(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_PaymentConstraints_set_max_cltv_expiry(int64_t this_ptr, int32_t val) { - LDKPaymentConstraints this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - PaymentConstraints_set_max_cltv_expiry(&this_ptr_conv, val); +static inline uint64_t Bolt11InvoiceFeatures_clone_ptr(LDKBolt11InvoiceFeatures *NONNULL_PTR arg) { + LDKBolt11InvoiceFeatures ret_var = Bolt11InvoiceFeatures_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_PaymentConstraints_get_htlc_minimum_msat(int64_t this_ptr) { - LDKPaymentConstraints this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = PaymentConstraints_get_htlc_minimum_msat(&this_ptr_conv); +int64_t CS_LDK_Bolt11InvoiceFeatures_clone_ptr(int64_t arg) { + LDKBolt11InvoiceFeatures 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 = Bolt11InvoiceFeatures_clone_ptr(&arg_conv); return ret_conv; } -void CS_LDK_PaymentConstraints_set_htlc_minimum_msat(int64_t this_ptr, int64_t val) { - LDKPaymentConstraints this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - PaymentConstraints_set_htlc_minimum_msat(&this_ptr_conv, val); -} - -int64_t CS_LDK_PaymentConstraints_new(int32_t max_cltv_expiry_arg, int64_t htlc_minimum_msat_arg) { - LDKPaymentConstraints ret_var = PaymentConstraints_new(max_cltv_expiry_arg, htlc_minimum_msat_arg); +int64_t CS_LDK_Bolt11InvoiceFeatures_clone(int64_t orig) { + LDKBolt11InvoiceFeatures 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; + LDKBolt11InvoiceFeatures ret_var = Bolt11InvoiceFeatures_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; } -static inline uint64_t PaymentConstraints_clone_ptr(LDKPaymentConstraints *NONNULL_PTR arg) { - LDKPaymentConstraints ret_var = PaymentConstraints_clone(arg); +static inline uint64_t OfferFeatures_clone_ptr(LDKOfferFeatures *NONNULL_PTR arg) { + LDKOfferFeatures ret_var = OfferFeatures_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_PaymentConstraints_clone_ptr(int64_t arg) { - LDKPaymentConstraints arg_conv; +int64_t CS_LDK_OfferFeatures_clone_ptr(int64_t arg) { + LDKOfferFeatures arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = PaymentConstraints_clone_ptr(&arg_conv); + int64_t ret_conv = OfferFeatures_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_PaymentConstraints_clone(int64_t orig) { - LDKPaymentConstraints orig_conv; +int64_t CS_LDK_OfferFeatures_clone(int64_t orig) { + LDKOfferFeatures orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKPaymentConstraints ret_var = PaymentConstraints_clone(&orig_conv); + LDKOfferFeatures ret_var = OfferFeatures_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_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); +static inline uint64_t InvoiceRequestFeatures_clone_ptr(LDKInvoiceRequestFeatures *NONNULL_PTR arg) { + LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_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; +int64_t CS_LDK_InvoiceRequestFeatures_clone_ptr(int64_t arg) { + LDKInvoiceRequestFeatures arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = UnknownPaymentContext_clone_ptr(&arg_conv); + int64_t ret_conv = InvoiceRequestFeatures_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_UnknownPaymentContext_clone(int64_t orig) { - LDKUnknownPaymentContext orig_conv; +int64_t CS_LDK_InvoiceRequestFeatures_clone(int64_t orig) { + LDKInvoiceRequestFeatures orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKUnknownPaymentContext ret_var = UnknownPaymentContext_clone(&orig_conv); + LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_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; +static inline uint64_t Bolt12InvoiceFeatures_clone_ptr(LDKBolt12InvoiceFeatures *NONNULL_PTR arg) { + LDKBolt12InvoiceFeatures ret_var = Bolt12InvoiceFeatures_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; } - -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_Bolt12InvoiceFeatures_clone_ptr(int64_t arg) { + LDKBolt12InvoiceFeatures arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = Bolt12InvoiceFeatures_clone_ptr(&arg_conv); + return ret_conv; } -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 CS_LDK_Bolt12InvoiceFeatures_clone(int64_t orig) { + LDKBolt12InvoiceFeatures orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKBolt12InvoiceFeatures ret_var = Bolt12InvoiceFeatures_clone(&orig_conv); int64_t ret_ref = 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); +static inline uint64_t BlindedHopFeatures_clone_ptr(LDKBlindedHopFeatures *NONNULL_PTR arg) { + LDKBlindedHopFeatures ret_var = BlindedHopFeatures_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; } - -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_BlindedHopFeatures_clone_ptr(int64_t arg) { + LDKBlindedHopFeatures arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = BlindedHopFeatures_clone_ptr(&arg_conv); + return ret_conv; } -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 CS_LDK_BlindedHopFeatures_clone(int64_t orig) { + LDKBlindedHopFeatures orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKBlindedHopFeatures ret_var = BlindedHopFeatures_clone(&orig_conv); int64_t ret_ref = 0; 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); +static inline uint64_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg) { + LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_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; +int64_t CS_LDK_ChannelTypeFeatures_clone_ptr(int64_t arg) { + LDKChannelTypeFeatures arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Bolt12OfferContext_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelTypeFeatures_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_Bolt12OfferContext_clone(int64_t orig) { - LDKBolt12OfferContext orig_conv; +int64_t CS_LDK_ChannelTypeFeatures_clone(int64_t orig) { + LDKChannelTypeFeatures orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBolt12OfferContext ret_var = Bolt12OfferContext_clone(&orig_conv); + LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_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); +int64_t CS_LDK_InitFeatures_hash(int64_t o) { + LDKInitFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = InitFeatures_hash(&o_conv); return ret_conv; } -void CS_LDK_Bolt12RefundContext_free(int64_t this_obj) { - LDKBolt12RefundContext this_obj_conv; +int64_t CS_LDK_NodeFeatures_hash(int64_t o) { + LDKNodeFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = NodeFeatures_hash(&o_conv); + return ret_conv; +} + +int64_t CS_LDK_ChannelFeatures_hash(int64_t o) { + LDKChannelFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = ChannelFeatures_hash(&o_conv); + return ret_conv; +} + +int64_t CS_LDK_Bolt11InvoiceFeatures_hash(int64_t o) { + LDKBolt11InvoiceFeatures o_conv; + 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 = Bolt11InvoiceFeatures_hash(&o_conv); + return ret_conv; +} + +int64_t CS_LDK_OfferFeatures_hash(int64_t o) { + LDKOfferFeatures o_conv; + 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 = OfferFeatures_hash(&o_conv); + return ret_conv; +} + +int64_t CS_LDK_InvoiceRequestFeatures_hash(int64_t o) { + LDKInvoiceRequestFeatures o_conv; + 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 = InvoiceRequestFeatures_hash(&o_conv); + return ret_conv; +} + +int64_t CS_LDK_Bolt12InvoiceFeatures_hash(int64_t o) { + LDKBolt12InvoiceFeatures o_conv; + 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 = Bolt12InvoiceFeatures_hash(&o_conv); + return ret_conv; +} + +int64_t CS_LDK_BlindedHopFeatures_hash(int64_t o) { + LDKBlindedHopFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = BlindedHopFeatures_hash(&o_conv); + return ret_conv; +} + +int64_t CS_LDK_ChannelTypeFeatures_hash(int64_t o) { + LDKChannelTypeFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = ChannelTypeFeatures_hash(&o_conv); + return ret_conv; +} + +void CS_LDK_InitFeatures_free(int64_t this_obj) { + LDKInitFeatures this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Bolt12RefundContext_free(this_obj_conv); + InitFeatures_free(this_obj_conv); } -int64_t CS_LDK_Bolt12RefundContext_new() { - LDKBolt12RefundContext ret_var = Bolt12RefundContext_new(); +void CS_LDK_NodeFeatures_free(int64_t this_obj) { + LDKNodeFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + NodeFeatures_free(this_obj_conv); +} + +void CS_LDK_ChannelFeatures_free(int64_t this_obj) { + LDKChannelFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelFeatures_free(this_obj_conv); +} + +void CS_LDK_Bolt11InvoiceFeatures_free(int64_t this_obj) { + LDKBolt11InvoiceFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Bolt11InvoiceFeatures_free(this_obj_conv); +} + +void CS_LDK_OfferFeatures_free(int64_t this_obj) { + LDKOfferFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OfferFeatures_free(this_obj_conv); +} + +void CS_LDK_InvoiceRequestFeatures_free(int64_t this_obj) { + LDKInvoiceRequestFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InvoiceRequestFeatures_free(this_obj_conv); +} + +void CS_LDK_Bolt12InvoiceFeatures_free(int64_t this_obj) { + LDKBolt12InvoiceFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Bolt12InvoiceFeatures_free(this_obj_conv); +} + +void CS_LDK_BlindedHopFeatures_free(int64_t this_obj) { + LDKBlindedHopFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + BlindedHopFeatures_free(this_obj_conv); +} + +void CS_LDK_ChannelTypeFeatures_free(int64_t this_obj) { + LDKChannelTypeFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelTypeFeatures_free(this_obj_conv); +} + +int64_t CS_LDK_Bolt11InvoiceFeatures_for_keysend(jboolean allow_mpp) { + LDKBolt11InvoiceFeatures ret_var = Bolt11InvoiceFeatures_for_keysend(allow_mpp); int64_t ret_ref = 0; 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 CS_LDK_ChannelTypeFeatures_only_static_remote_key() { + LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_only_static_remote_key(); int64_t ret_ref = 0; 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 CS_LDK_ChannelTypeFeatures_anchors_zero_htlc_fee_and_dependencies() { + LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_anchors_zero_htlc_fee_and_dependencies(); int64_t ret_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); - 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 = ForwardTlvs_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_InitFeatures_empty() { + LDKInitFeatures ret_var = InitFeatures_empty(); + int64_t ret_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_ReceiveTlvs_write(int64_t obj) { - LDKReceiveTlvs 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 = ReceiveTlvs_write(&obj_conv); +int8_tArray CS_LDK_InitFeatures_le_flags(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; + LDKu8slice ret_var = InitFeatures_le_flags(&this_arg_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); return ret_arr; } -int8_tArray CS_LDK_PaymentRelay_write(int64_t obj) { - LDKPaymentRelay 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 = PaymentRelay_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +jboolean CS_LDK_InitFeatures_supports_any_optional_bits(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_any_optional_bits(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_PaymentRelay_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_PaymentRelayDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentRelayDecodeErrorZ), "LDKCResult_PaymentRelayDecodeErrorZ"); - *ret_conv = PaymentRelay_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +jboolean CS_LDK_InitFeatures_requires_unknown_bits_from(int64_t this_arg, int64_t other) { + 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; + LDKInitFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); + return ret_conv; } -int8_tArray CS_LDK_PaymentConstraints_write(int64_t obj) { - LDKPaymentConstraints 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 = PaymentConstraints_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); +int64_tArray CS_LDK_InitFeatures_required_unknown_bits_from(int64_t this_arg, int64_t other) { + 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; + LDKInitFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + LDKCVec_u64Z ret_var = InitFeatures_required_unknown_bits_from(&this_arg_conv, &other_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 g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + + FREE(ret_var.data); return ret_arr; } -int64_t CS_LDK_PaymentConstraints_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_PaymentConstraintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentConstraintsDecodeErrorZ), "LDKCResult_PaymentConstraintsDecodeErrorZ"); - *ret_conv = PaymentConstraints_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +jboolean CS_LDK_InitFeatures_requires_unknown_bits(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_unknown_bits(&this_arg_conv); + return ret_conv; } -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; +jboolean CS_LDK_InitFeatures_supports_unknown_bits(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_unknown_bits(&this_arg_conv); + return ret_conv; } -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); +int64_t CS_LDK_InitFeatures_set_required_feature_bit(int64_t this_arg, int64_t bit) { + 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; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = InitFeatures_set_required_feature_bit(&this_arg_conv, bit); 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_InitFeatures_set_optional_feature_bit(int64_t this_arg, int64_t bit) { + 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; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = InitFeatures_set_optional_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -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); +int64_t CS_LDK_InitFeatures_set_required_custom_bit(int64_t this_arg, int64_t bit) { + 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; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = InitFeatures_set_required_custom_bit(&this_arg_conv, bit); 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_InitFeatures_set_optional_custom_bit(int64_t this_arg, int64_t bit) { + 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; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = InitFeatures_set_optional_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -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); +int64_t CS_LDK_NodeFeatures_empty() { + LDKNodeFeatures ret_var = NodeFeatures_empty(); + int64_t ret_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_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 CS_LDK_NodeFeatures_le_flags(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; + LDKu8slice ret_var = NodeFeatures_le_flags(&this_arg_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); return ret_arr; } -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); +jboolean CS_LDK_NodeFeatures_supports_any_optional_bits(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_any_optional_bits(&this_arg_conv); + return ret_conv; } -void CS_LDK_PaymentPurpose_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); - LDKPaymentPurpose this_ptr_conv = *(LDKPaymentPurpose*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - PaymentPurpose_free(this_ptr_conv); +jboolean CS_LDK_NodeFeatures_requires_unknown_bits_from(int64_t this_arg, int64_t other) { + 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; + LDKNodeFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); + return ret_conv; } -static inline uint64_t PaymentPurpose_clone_ptr(LDKPaymentPurpose *NONNULL_PTR arg) { - LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); - *ret_copy = PaymentPurpose_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_tArray CS_LDK_NodeFeatures_required_unknown_bits_from(int64_t this_arg, int64_t other) { + 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; + LDKNodeFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + LDKCVec_u64Z ret_var = NodeFeatures_required_unknown_bits_from(&this_arg_conv, &other_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 g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + + FREE(ret_var.data); + return ret_arr; } -int64_t CS_LDK_PaymentPurpose_clone_ptr(int64_t arg) { - LDKPaymentPurpose* arg_conv = (LDKPaymentPurpose*)untag_ptr(arg); - int64_t ret_conv = PaymentPurpose_clone_ptr(arg_conv); + +jboolean CS_LDK_NodeFeatures_requires_unknown_bits(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_unknown_bits(&this_arg_conv); return ret_conv; } -int64_t CS_LDK_PaymentPurpose_clone(int64_t orig) { - LDKPaymentPurpose* orig_conv = (LDKPaymentPurpose*)untag_ptr(orig); - LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); - *ret_copy = PaymentPurpose_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_NodeFeatures_supports_unknown_bits(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_unknown_bits(&this_arg_conv); + return ret_conv; } -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); - 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); - 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_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; -} - -int64_t CS_LDK_PaymentPurpose_spontaneous_payment(int8_tArray a) { - LDKThirtyTwoBytes a_ref; - CHECK(a->arr_len == 32); - memcpy(a_ref.data, a->elems, 32); FREE(a); - LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); - *ret_copy = PaymentPurpose_spontaneous_payment(a_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -jboolean CS_LDK_PaymentPurpose_eq(int64_t a, int64_t b) { - LDKPaymentPurpose* a_conv = (LDKPaymentPurpose*)untag_ptr(a); - LDKPaymentPurpose* b_conv = (LDKPaymentPurpose*)untag_ptr(b); - jboolean ret_conv = PaymentPurpose_eq(a_conv, b_conv); - return ret_conv; -} - -int64_t CS_LDK_PaymentPurpose_preimage(int64_t this_arg) { - LDKPaymentPurpose* this_arg_conv = (LDKPaymentPurpose*)untag_ptr(this_arg); - LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); - *ret_copy = PaymentPurpose_preimage(this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_NodeFeatures_set_required_feature_bit(int64_t this_arg, int64_t bit) { + 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; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = NodeFeatures_set_required_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int8_tArray CS_LDK_PaymentPurpose_write(int64_t obj) { - LDKPaymentPurpose* obj_conv = (LDKPaymentPurpose*)untag_ptr(obj); - LDKCVec_u8Z ret_var = PaymentPurpose_write(obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +int64_t CS_LDK_NodeFeatures_set_optional_feature_bit(int64_t this_arg, int64_t bit) { + 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; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = NodeFeatures_set_optional_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_PaymentPurpose_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); - *ret_conv = PaymentPurpose_read(ser_ref); - FREE(ser); +int64_t CS_LDK_NodeFeatures_set_required_custom_bit(int64_t this_arg, int64_t bit) { + 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; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = NodeFeatures_set_required_custom_bit(&this_arg_conv, bit); return tag_ptr(ret_conv, true); } -void CS_LDK_ClaimedHTLC_free(int64_t this_obj) { - LDKClaimedHTLC this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ClaimedHTLC_free(this_obj_conv); +int64_t CS_LDK_NodeFeatures_set_optional_custom_bit(int64_t this_arg, int64_t bit) { + 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; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = NodeFeatures_set_optional_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -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; - LDKChannelId ret_var = ClaimedHTLC_get_channel_id(&this_ptr_conv); +int64_t CS_LDK_ChannelFeatures_empty() { + LDKChannelFeatures ret_var = ChannelFeatures_empty(); int64_t ret_ref = 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, 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; - 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) { - 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(16, __LINE__); - memcpy(ret_arr->elems, ClaimedHTLC_get_user_channel_id(&this_ptr_conv).le_bytes, 16); +int8_tArray CS_LDK_ChannelFeatures_le_flags(int64_t this_arg) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKu8slice ret_var = ChannelFeatures_le_flags(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); return ret_arr; } -void CS_LDK_ClaimedHTLC_set_user_channel_id(int64_t this_ptr, int8_tArray 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; - LDKU128 val_ref; - CHECK(val->arr_len == 16); - memcpy(val_ref.le_bytes, val->elems, 16); FREE(val); - ClaimedHTLC_set_user_channel_id(&this_ptr_conv, val_ref); +jboolean CS_LDK_ChannelFeatures_supports_any_optional_bits(int64_t this_arg) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelFeatures_supports_any_optional_bits(&this_arg_conv); + return ret_conv; } -int32_t CS_LDK_ClaimedHTLC_get_cltv_expiry(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; - int32_t ret_conv = ClaimedHTLC_get_cltv_expiry(&this_ptr_conv); +jboolean CS_LDK_ChannelFeatures_requires_unknown_bits_from(int64_t this_arg, int64_t other) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + jboolean ret_conv = ChannelFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); return ret_conv; } -void CS_LDK_ClaimedHTLC_set_cltv_expiry(int64_t this_ptr, int32_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; - ClaimedHTLC_set_cltv_expiry(&this_ptr_conv, val); +int64_tArray CS_LDK_ChannelFeatures_required_unknown_bits_from(int64_t this_arg, int64_t other) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + LDKCVec_u64Z ret_var = ChannelFeatures_required_unknown_bits_from(&this_arg_conv, &other_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 g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + + FREE(ret_var.data); + return ret_arr; } -int64_t CS_LDK_ClaimedHTLC_get_value_msat(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; - int64_t ret_conv = ClaimedHTLC_get_value_msat(&this_ptr_conv); +jboolean CS_LDK_ChannelFeatures_requires_unknown_bits(int64_t this_arg) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelFeatures_requires_unknown_bits(&this_arg_conv); return ret_conv; } -void CS_LDK_ClaimedHTLC_set_value_msat(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; - ClaimedHTLC_set_value_msat(&this_ptr_conv, val); -} - -int64_t CS_LDK_ClaimedHTLC_get_counterparty_skimmed_fee_msat(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; - int64_t ret_conv = ClaimedHTLC_get_counterparty_skimmed_fee_msat(&this_ptr_conv); +jboolean CS_LDK_ChannelFeatures_supports_unknown_bits(int64_t this_arg) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelFeatures_supports_unknown_bits(&this_arg_conv); return ret_conv; } -void CS_LDK_ClaimedHTLC_set_counterparty_skimmed_fee_msat(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; - ClaimedHTLC_set_counterparty_skimmed_fee_msat(&this_ptr_conv, val); +int64_t CS_LDK_ChannelFeatures_set_required_feature_bit(int64_t this_arg, int64_t bit) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelFeatures_set_required_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -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_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); - return ret_ref; +int64_t CS_LDK_ChannelFeatures_set_optional_feature_bit(int64_t this_arg, int64_t bit) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelFeatures_set_optional_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -static inline uint64_t ClaimedHTLC_clone_ptr(LDKClaimedHTLC *NONNULL_PTR arg) { - LDKClaimedHTLC ret_var = ClaimedHTLC_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_ChannelFeatures_set_required_custom_bit(int64_t this_arg, int64_t bit) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelFeatures_set_required_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ClaimedHTLC_clone_ptr(int64_t arg) { - LDKClaimedHTLC 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 = ClaimedHTLC_clone_ptr(&arg_conv); - return ret_conv; + +int64_t CS_LDK_ChannelFeatures_set_optional_custom_bit(int64_t this_arg, int64_t bit) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelFeatures_set_optional_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ClaimedHTLC_clone(int64_t orig) { - LDKClaimedHTLC 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; - LDKClaimedHTLC ret_var = ClaimedHTLC_clone(&orig_conv); +int64_t CS_LDK_Bolt11InvoiceFeatures_empty() { + LDKBolt11InvoiceFeatures ret_var = Bolt11InvoiceFeatures_empty(); int64_t ret_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_ClaimedHTLC_eq(int64_t a, int64_t b) { - LDKClaimedHTLC a_conv; - 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; - LDKClaimedHTLC 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 = ClaimedHTLC_eq(&a_conv, &b_conv); - return ret_conv; -} - -int8_tArray CS_LDK_ClaimedHTLC_write(int64_t obj) { - LDKClaimedHTLC 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 = ClaimedHTLC_write(&obj_conv); +int8_tArray CS_LDK_Bolt11InvoiceFeatures_le_flags(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; + LDKu8slice ret_var = Bolt11InvoiceFeatures_le_flags(&this_arg_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_ClaimedHTLC_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_ClaimedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClaimedHTLCDecodeErrorZ), "LDKCResult_ClaimedHTLCDecodeErrorZ"); - *ret_conv = ClaimedHTLC_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -void CS_LDK_PathFailure_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); - LDKPathFailure this_ptr_conv = *(LDKPathFailure*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - PathFailure_free(this_ptr_conv); -} - -static inline uint64_t PathFailure_clone_ptr(LDKPathFailure *NONNULL_PTR arg) { - LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure"); - *ret_copy = PathFailure_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -int64_t CS_LDK_PathFailure_clone_ptr(int64_t arg) { - LDKPathFailure* arg_conv = (LDKPathFailure*)untag_ptr(arg); - int64_t ret_conv = PathFailure_clone_ptr(arg_conv); +jboolean CS_LDK_Bolt11InvoiceFeatures_supports_any_optional_bits(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_any_optional_bits(&this_arg_conv); return ret_conv; } -int64_t CS_LDK_PathFailure_clone(int64_t orig) { - LDKPathFailure* orig_conv = (LDKPathFailure*)untag_ptr(orig); - LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure"); - *ret_copy = PathFailure_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_Bolt11InvoiceFeatures_requires_unknown_bits_from(int64_t this_arg, int64_t other) { + 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; + LDKBolt11InvoiceFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + jboolean ret_conv = Bolt11InvoiceFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); + return ret_conv; } -int64_t CS_LDK_PathFailure_initial_send(int64_t err) { - void* err_ptr = untag_ptr(err); - CHECK_ACCESS(err_ptr); - LDKAPIError err_conv = *(LDKAPIError*)(err_ptr); - err_conv = APIError_clone((LDKAPIError*)untag_ptr(err)); - LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure"); - *ret_copy = PathFailure_initial_send(err_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_tArray CS_LDK_Bolt11InvoiceFeatures_required_unknown_bits_from(int64_t this_arg, int64_t other) { + 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; + LDKBolt11InvoiceFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + LDKCVec_u64Z ret_var = Bolt11InvoiceFeatures_required_unknown_bits_from(&this_arg_conv, &other_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 g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + + FREE(ret_var.data); + return ret_arr; } -int64_t CS_LDK_PathFailure_on_path(int64_t network_update) { - void* network_update_ptr = untag_ptr(network_update); - CHECK_ACCESS(network_update_ptr); - LDKCOption_NetworkUpdateZ network_update_conv = *(LDKCOption_NetworkUpdateZ*)(network_update_ptr); - network_update_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)untag_ptr(network_update)); - LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure"); - *ret_copy = PathFailure_on_path(network_update_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_Bolt11InvoiceFeatures_requires_unknown_bits(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_unknown_bits(&this_arg_conv); + return ret_conv; } -jboolean CS_LDK_PathFailure_eq(int64_t a, int64_t b) { - LDKPathFailure* a_conv = (LDKPathFailure*)untag_ptr(a); - LDKPathFailure* b_conv = (LDKPathFailure*)untag_ptr(b); - jboolean ret_conv = PathFailure_eq(a_conv, b_conv); +jboolean CS_LDK_Bolt11InvoiceFeatures_supports_unknown_bits(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_unknown_bits(&this_arg_conv); return ret_conv; } -int8_tArray CS_LDK_PathFailure_write(int64_t obj) { - LDKPathFailure* obj_conv = (LDKPathFailure*)untag_ptr(obj); - LDKCVec_u8Z ret_var = PathFailure_write(obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +int64_t CS_LDK_Bolt11InvoiceFeatures_set_required_feature_bit(int64_t this_arg, int64_t bit) { + 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; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = Bolt11InvoiceFeatures_set_required_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_PathFailure_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ"); - *ret_conv = PathFailure_read(ser_ref); - FREE(ser); +int64_t CS_LDK_Bolt11InvoiceFeatures_set_optional_feature_bit(int64_t this_arg, int64_t bit) { + 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; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = Bolt11InvoiceFeatures_set_optional_feature_bit(&this_arg_conv, bit); return tag_ptr(ret_conv, true); } -void CS_LDK_ClosureReason_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); - LDKClosureReason this_ptr_conv = *(LDKClosureReason*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - ClosureReason_free(this_ptr_conv); -} - -static inline uint64_t ClosureReason_clone_ptr(LDKClosureReason *NONNULL_PTR arg) { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -int64_t CS_LDK_ClosureReason_clone_ptr(int64_t arg) { - LDKClosureReason* arg_conv = (LDKClosureReason*)untag_ptr(arg); - int64_t ret_conv = ClosureReason_clone_ptr(arg_conv); - return ret_conv; +int64_t CS_LDK_Bolt11InvoiceFeatures_set_required_custom_bit(int64_t this_arg, int64_t bit) { + 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; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = Bolt11InvoiceFeatures_set_required_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ClosureReason_clone(int64_t orig) { - LDKClosureReason* orig_conv = (LDKClosureReason*)untag_ptr(orig); - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_Bolt11InvoiceFeatures_set_optional_custom_bit(int64_t this_arg, int64_t bit) { + 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; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = Bolt11InvoiceFeatures_set_optional_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ClosureReason_counterparty_force_closed(int64_t peer_msg) { - LDKUntrustedString peer_msg_conv; - peer_msg_conv.inner = untag_ptr(peer_msg); - peer_msg_conv.is_owned = ptr_is_owned(peer_msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(peer_msg_conv); - peer_msg_conv = UntrustedString_clone(&peer_msg_conv); - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_counterparty_force_closed(peer_msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +int64_t CS_LDK_OfferFeatures_empty() { + LDKOfferFeatures ret_var = OfferFeatures_empty(); + int64_t ret_ref = 0; + 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_ClosureReason_holder_force_closed() { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_holder_force_closed(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int8_tArray CS_LDK_OfferFeatures_le_flags(int64_t this_arg) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKu8slice ret_var = OfferFeatures_le_flags(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + return ret_arr; } -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; +jboolean CS_LDK_OfferFeatures_supports_any_optional_bits(int64_t this_arg) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = OfferFeatures_supports_any_optional_bits(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_ClosureReason_counterparty_initiated_cooperative_closure() { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_counterparty_initiated_cooperative_closure(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_OfferFeatures_requires_unknown_bits_from(int64_t this_arg, int64_t other) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKOfferFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + jboolean ret_conv = OfferFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); + return ret_conv; } -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; +int64_tArray CS_LDK_OfferFeatures_required_unknown_bits_from(int64_t this_arg, int64_t other) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKOfferFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + LDKCVec_u64Z ret_var = OfferFeatures_required_unknown_bits_from(&this_arg_conv, &other_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 g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + + FREE(ret_var.data); + return ret_arr; } -int64_t CS_LDK_ClosureReason_commitment_tx_confirmed() { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_commitment_tx_confirmed(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_OfferFeatures_requires_unknown_bits(int64_t this_arg) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = OfferFeatures_requires_unknown_bits(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_ClosureReason_funding_timed_out() { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_funding_timed_out(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_OfferFeatures_supports_unknown_bits(int64_t this_arg) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = OfferFeatures_supports_unknown_bits(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_ClosureReason_processing_error(jstring err) { - LDKStr err_conv = str_ref_to_owned_c(err); - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_processing_error(err_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_OfferFeatures_set_required_feature_bit(int64_t this_arg, int64_t bit) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = OfferFeatures_set_required_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ClosureReason_disconnected_peer() { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_disconnected_peer(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_OfferFeatures_set_optional_feature_bit(int64_t this_arg, int64_t bit) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = OfferFeatures_set_optional_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ClosureReason_outdated_channel_manager() { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_outdated_channel_manager(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_OfferFeatures_set_required_custom_bit(int64_t this_arg, int64_t bit) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = OfferFeatures_set_required_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ClosureReason_counterparty_coop_closed_unfunded_channel() { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_counterparty_coop_closed_unfunded_channel(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_OfferFeatures_set_optional_custom_bit(int64_t this_arg, int64_t bit) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = OfferFeatures_set_optional_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ClosureReason_funding_batch_closure() { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_funding_batch_closure(); - int64_t ret_ref = tag_ptr(ret_copy, true); +int64_t CS_LDK_InvoiceRequestFeatures_empty() { + LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_empty(); + int64_t ret_ref = 0; + 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_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; +int8_tArray CS_LDK_InvoiceRequestFeatures_le_flags(int64_t this_arg) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKu8slice ret_var = InvoiceRequestFeatures_le_flags(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + return ret_arr; } -jboolean CS_LDK_ClosureReason_eq(int64_t a, int64_t b) { - LDKClosureReason* a_conv = (LDKClosureReason*)untag_ptr(a); - LDKClosureReason* b_conv = (LDKClosureReason*)untag_ptr(b); - jboolean ret_conv = ClosureReason_eq(a_conv, b_conv); +jboolean CS_LDK_InvoiceRequestFeatures_supports_any_optional_bits(int64_t this_arg) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InvoiceRequestFeatures_supports_any_optional_bits(&this_arg_conv); return ret_conv; } -jstring CS_LDK_ClosureReason_to_str(int64_t o) { - LDKClosureReason* o_conv = (LDKClosureReason*)untag_ptr(o); - LDKStr ret_str = ClosureReason_to_str(o_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); +jboolean CS_LDK_InvoiceRequestFeatures_requires_unknown_bits_from(int64_t this_arg, int64_t other) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKInvoiceRequestFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + jboolean ret_conv = InvoiceRequestFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); return ret_conv; } -int8_tArray CS_LDK_ClosureReason_write(int64_t obj) { - LDKClosureReason* obj_conv = (LDKClosureReason*)untag_ptr(obj); - LDKCVec_u8Z ret_var = ClosureReason_write(obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); +int64_tArray CS_LDK_InvoiceRequestFeatures_required_unknown_bits_from(int64_t this_arg, int64_t other) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKInvoiceRequestFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + LDKCVec_u64Z ret_var = InvoiceRequestFeatures_required_unknown_bits_from(&this_arg_conv, &other_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 g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + + FREE(ret_var.data); return ret_arr; } -int64_t CS_LDK_ClosureReason_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); - *ret_conv = ClosureReason_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -void CS_LDK_HTLCDestination_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); - LDKHTLCDestination this_ptr_conv = *(LDKHTLCDestination*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - HTLCDestination_free(this_ptr_conv); -} - -static inline uint64_t HTLCDestination_clone_ptr(LDKHTLCDestination *NONNULL_PTR arg) { - LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); - *ret_copy = HTLCDestination_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -int64_t CS_LDK_HTLCDestination_clone_ptr(int64_t arg) { - LDKHTLCDestination* arg_conv = (LDKHTLCDestination*)untag_ptr(arg); - int64_t ret_conv = HTLCDestination_clone_ptr(arg_conv); +jboolean CS_LDK_InvoiceRequestFeatures_requires_unknown_bits(int64_t this_arg) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InvoiceRequestFeatures_requires_unknown_bits(&this_arg_conv); return ret_conv; } -int64_t CS_LDK_HTLCDestination_clone(int64_t orig) { - LDKHTLCDestination* orig_conv = (LDKHTLCDestination*)untag_ptr(orig); - LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); - *ret_copy = HTLCDestination_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_InvoiceRequestFeatures_supports_unknown_bits(int64_t this_arg) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InvoiceRequestFeatures_supports_unknown_bits(&this_arg_conv); + return ret_conv; } -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); - 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_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_InvoiceRequestFeatures_set_required_feature_bit(int64_t this_arg, int64_t bit) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = InvoiceRequestFeatures_set_required_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_HTLCDestination_unknown_next_hop(int64_t requested_forward_scid) { - LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); - *ret_copy = HTLCDestination_unknown_next_hop(requested_forward_scid); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_InvoiceRequestFeatures_set_optional_feature_bit(int64_t this_arg, int64_t bit) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = InvoiceRequestFeatures_set_optional_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_HTLCDestination_invalid_forward(int64_t requested_forward_scid) { - LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); - *ret_copy = HTLCDestination_invalid_forward(requested_forward_scid); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_InvoiceRequestFeatures_set_required_custom_bit(int64_t this_arg, int64_t bit) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = InvoiceRequestFeatures_set_required_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -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_InvoiceRequestFeatures_set_optional_custom_bit(int64_t this_arg, int64_t bit) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = InvoiceRequestFeatures_set_optional_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_HTLCDestination_failed_payment(int8_tArray payment_hash) { - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); - *ret_copy = HTLCDestination_failed_payment(payment_hash_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); +int64_t CS_LDK_Bolt12InvoiceFeatures_empty() { + LDKBolt12InvoiceFeatures ret_var = Bolt12InvoiceFeatures_empty(); + int64_t ret_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_HTLCDestination_eq(int64_t a, int64_t b) { - LDKHTLCDestination* a_conv = (LDKHTLCDestination*)untag_ptr(a); - LDKHTLCDestination* b_conv = (LDKHTLCDestination*)untag_ptr(b); - jboolean ret_conv = HTLCDestination_eq(a_conv, b_conv); - return ret_conv; -} - -int8_tArray CS_LDK_HTLCDestination_write(int64_t obj) { - LDKHTLCDestination* obj_conv = (LDKHTLCDestination*)untag_ptr(obj); - LDKCVec_u8Z ret_var = HTLCDestination_write(obj_conv); +int8_tArray CS_LDK_Bolt12InvoiceFeatures_le_flags(int64_t this_arg) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKu8slice ret_var = Bolt12InvoiceFeatures_le_flags(&this_arg_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_HTLCDestination_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ"); - *ret_conv = HTLCDestination_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -int32_t CS_LDK_PaymentFailureReason_clone(int64_t orig) { - LDKPaymentFailureReason* orig_conv = (LDKPaymentFailureReason*)untag_ptr(orig); - int32_t ret_conv = LDKPaymentFailureReason_to_cs(PaymentFailureReason_clone(orig_conv)); +jboolean CS_LDK_Bolt12InvoiceFeatures_supports_any_optional_bits(int64_t this_arg) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt12InvoiceFeatures_supports_any_optional_bits(&this_arg_conv); return ret_conv; } -int32_t CS_LDK_PaymentFailureReason_recipient_rejected() { - int32_t ret_conv = LDKPaymentFailureReason_to_cs(PaymentFailureReason_recipient_rejected()); +jboolean CS_LDK_Bolt12InvoiceFeatures_requires_unknown_bits_from(int64_t this_arg, int64_t other) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKBolt12InvoiceFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + jboolean ret_conv = Bolt12InvoiceFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); return ret_conv; } -int32_t CS_LDK_PaymentFailureReason_user_abandoned() { - int32_t ret_conv = LDKPaymentFailureReason_to_cs(PaymentFailureReason_user_abandoned()); - return ret_conv; +int64_tArray CS_LDK_Bolt12InvoiceFeatures_required_unknown_bits_from(int64_t this_arg, int64_t other) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKBolt12InvoiceFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + LDKCVec_u64Z ret_var = Bolt12InvoiceFeatures_required_unknown_bits_from(&this_arg_conv, &other_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 g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + + FREE(ret_var.data); + return ret_arr; } -int32_t CS_LDK_PaymentFailureReason_retries_exhausted() { - int32_t ret_conv = LDKPaymentFailureReason_to_cs(PaymentFailureReason_retries_exhausted()); +jboolean CS_LDK_Bolt12InvoiceFeatures_requires_unknown_bits(int64_t this_arg) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt12InvoiceFeatures_requires_unknown_bits(&this_arg_conv); return ret_conv; } -int32_t CS_LDK_PaymentFailureReason_payment_expired() { - int32_t ret_conv = LDKPaymentFailureReason_to_cs(PaymentFailureReason_payment_expired()); +jboolean CS_LDK_Bolt12InvoiceFeatures_supports_unknown_bits(int64_t this_arg) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt12InvoiceFeatures_supports_unknown_bits(&this_arg_conv); return ret_conv; } -int32_t CS_LDK_PaymentFailureReason_route_not_found() { - int32_t ret_conv = LDKPaymentFailureReason_to_cs(PaymentFailureReason_route_not_found()); - return ret_conv; +int64_t CS_LDK_Bolt12InvoiceFeatures_set_required_feature_bit(int64_t this_arg, int64_t bit) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = Bolt12InvoiceFeatures_set_required_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int32_t CS_LDK_PaymentFailureReason_unexpected_error() { - int32_t ret_conv = LDKPaymentFailureReason_to_cs(PaymentFailureReason_unexpected_error()); - return ret_conv; +int64_t CS_LDK_Bolt12InvoiceFeatures_set_optional_feature_bit(int64_t this_arg, int64_t bit) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = Bolt12InvoiceFeatures_set_optional_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_PaymentFailureReason_eq(int64_t a, int64_t b) { - LDKPaymentFailureReason* a_conv = (LDKPaymentFailureReason*)untag_ptr(a); - LDKPaymentFailureReason* b_conv = (LDKPaymentFailureReason*)untag_ptr(b); - jboolean ret_conv = PaymentFailureReason_eq(a_conv, b_conv); - return ret_conv; +int64_t CS_LDK_Bolt12InvoiceFeatures_set_required_custom_bit(int64_t this_arg, int64_t bit) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = Bolt12InvoiceFeatures_set_required_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int8_tArray CS_LDK_PaymentFailureReason_write(int64_t obj) { - LDKPaymentFailureReason* obj_conv = (LDKPaymentFailureReason*)untag_ptr(obj); - LDKCVec_u8Z ret_var = PaymentFailureReason_write(obj_conv); +int64_t CS_LDK_Bolt12InvoiceFeatures_set_optional_custom_bit(int64_t this_arg, int64_t bit) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = Bolt12InvoiceFeatures_set_optional_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_BlindedHopFeatures_empty() { + LDKBlindedHopFeatures ret_var = BlindedHopFeatures_empty(); + int64_t ret_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_BlindedHopFeatures_le_flags(int64_t this_arg) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKu8slice ret_var = BlindedHopFeatures_le_flags(&this_arg_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_PaymentFailureReason_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_PaymentFailureReasonDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentFailureReasonDecodeErrorZ), "LDKCResult_PaymentFailureReasonDecodeErrorZ"); - *ret_conv = PaymentFailureReason_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +jboolean CS_LDK_BlindedHopFeatures_supports_any_optional_bits(int64_t this_arg) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = BlindedHopFeatures_supports_any_optional_bits(&this_arg_conv); + return ret_conv; } -void CS_LDK_Event_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); - LDKEvent this_ptr_conv = *(LDKEvent*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Event_free(this_ptr_conv); +jboolean CS_LDK_BlindedHopFeatures_requires_unknown_bits_from(int64_t this_arg, int64_t other) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKBlindedHopFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + jboolean ret_conv = BlindedHopFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); + return ret_conv; } -static inline uint64_t Event_clone_ptr(LDKEvent *NONNULL_PTR arg) { - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_tArray CS_LDK_BlindedHopFeatures_required_unknown_bits_from(int64_t this_arg, int64_t other) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKBlindedHopFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + LDKCVec_u64Z ret_var = BlindedHopFeatures_required_unknown_bits_from(&this_arg_conv, &other_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 g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + + FREE(ret_var.data); + return ret_arr; } -int64_t CS_LDK_Event_clone_ptr(int64_t arg) { - LDKEvent* arg_conv = (LDKEvent*)untag_ptr(arg); - int64_t ret_conv = Event_clone_ptr(arg_conv); + +jboolean CS_LDK_BlindedHopFeatures_requires_unknown_bits(int64_t this_arg) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = BlindedHopFeatures_requires_unknown_bits(&this_arg_conv); return ret_conv; } -int64_t CS_LDK_Event_clone(int64_t orig) { - LDKEvent* orig_conv = (LDKEvent*)untag_ptr(orig); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_BlindedHopFeatures_supports_unknown_bits(int64_t this_arg) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = BlindedHopFeatures_supports_unknown_bits(&this_arg_conv); + return ret_conv; } -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); - LDKCVec_u8Z output_script_ref; - output_script_ref.datalen = output_script->arr_len; - output_script_ref.data = MALLOC(output_script_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(output_script_ref.data, output_script->elems, output_script_ref.datalen); FREE(output_script); - LDKU128 user_channel_id_ref; - CHECK(user_channel_id->arr_len == 16); - memcpy(user_channel_id_ref.le_bytes, user_channel_id->elems, 16); FREE(user_channel_id); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_funding_generation_ready(temporary_channel_id_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; +int64_t CS_LDK_BlindedHopFeatures_set_required_feature_bit(int64_t this_arg, int64_t bit) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = BlindedHopFeatures_set_required_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_Event_payment_claimable(int8_tArray receiver_node_id, int8_tArray payment_hash, int64_t onion_fields, int64_t amount_msat, int64_t counterparty_skimmed_fee_msat, int64_t purpose, int64_t via_channel_id, int64_t via_user_channel_id, int64_t claim_deadline) { - LDKPublicKey receiver_node_id_ref; - CHECK(receiver_node_id->arr_len == 33); - memcpy(receiver_node_id_ref.compressed_form, receiver_node_id->elems, 33); FREE(receiver_node_id); - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - LDKRecipientOnionFields onion_fields_conv; - onion_fields_conv.inner = untag_ptr(onion_fields); - onion_fields_conv.is_owned = ptr_is_owned(onion_fields); - CHECK_INNER_FIELD_ACCESS_OR_NULL(onion_fields_conv); - onion_fields_conv = RecipientOnionFields_clone(&onion_fields_conv); - void* purpose_ptr = untag_ptr(purpose); - CHECK_ACCESS(purpose_ptr); - LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr); - purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose)); - 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); - via_user_channel_id_conv = COption_U128Z_clone((LDKCOption_U128Z*)untag_ptr(via_user_channel_id)); - void* claim_deadline_ptr = untag_ptr(claim_deadline); - CHECK_ACCESS(claim_deadline_ptr); - LDKCOption_u32Z claim_deadline_conv = *(LDKCOption_u32Z*)(claim_deadline_ptr); - claim_deadline_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(claim_deadline)); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_claimable(receiver_node_id_ref, payment_hash_ref, onion_fields_conv, amount_msat, counterparty_skimmed_fee_msat, purpose_conv, via_channel_id_conv, via_user_channel_id_conv, claim_deadline_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_BlindedHopFeatures_set_optional_feature_bit(int64_t this_arg, int64_t bit) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = BlindedHopFeatures_set_optional_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_Event_payment_claimed(int8_tArray receiver_node_id, int8_tArray payment_hash, int64_t amount_msat, int64_t purpose, int64_tArray htlcs, int64_t sender_intended_total_msat) { - LDKPublicKey receiver_node_id_ref; - CHECK(receiver_node_id->arr_len == 33); - memcpy(receiver_node_id_ref.compressed_form, receiver_node_id->elems, 33); FREE(receiver_node_id); - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - void* purpose_ptr = untag_ptr(purpose); - CHECK_ACCESS(purpose_ptr); - LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr); - purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose)); - LDKCVec_ClaimedHTLCZ htlcs_constr; - htlcs_constr.datalen = htlcs->arr_len; - if (htlcs_constr.datalen > 0) - htlcs_constr.data = MALLOC(htlcs_constr.datalen * sizeof(LDKClaimedHTLC), "LDKCVec_ClaimedHTLCZ Elements"); - else - htlcs_constr.data = NULL; - int64_t* htlcs_vals = htlcs->elems; - for (size_t n = 0; n < htlcs_constr.datalen; n++) { - int64_t htlcs_conv_13 = htlcs_vals[n]; - LDKClaimedHTLC htlcs_conv_13_conv; - htlcs_conv_13_conv.inner = untag_ptr(htlcs_conv_13); - htlcs_conv_13_conv.is_owned = ptr_is_owned(htlcs_conv_13); - CHECK_INNER_FIELD_ACCESS_OR_NULL(htlcs_conv_13_conv); - htlcs_conv_13_conv = ClaimedHTLC_clone(&htlcs_conv_13_conv); - htlcs_constr.data[n] = htlcs_conv_13_conv; - } - FREE(htlcs); - void* sender_intended_total_msat_ptr = untag_ptr(sender_intended_total_msat); - CHECK_ACCESS(sender_intended_total_msat_ptr); - LDKCOption_u64Z sender_intended_total_msat_conv = *(LDKCOption_u64Z*)(sender_intended_total_msat_ptr); - sender_intended_total_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(sender_intended_total_msat)); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_claimed(receiver_node_id_ref, payment_hash_ref, amount_msat, purpose_conv, htlcs_constr, sender_intended_total_msat_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_BlindedHopFeatures_set_required_custom_bit(int64_t this_arg, int64_t bit) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = BlindedHopFeatures_set_required_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_Event_connection_needed(int8_tArray node_id, int64_tArray addresses) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKCVec_SocketAddressZ addresses_constr; - addresses_constr.datalen = addresses->arr_len; - if (addresses_constr.datalen > 0) - addresses_constr.data = MALLOC(addresses_constr.datalen * sizeof(LDKSocketAddress), "LDKCVec_SocketAddressZ Elements"); - else - addresses_constr.data = NULL; - int64_t* addresses_vals = addresses->elems; - for (size_t p = 0; p < addresses_constr.datalen; p++) { - int64_t addresses_conv_15 = addresses_vals[p]; - void* addresses_conv_15_ptr = untag_ptr(addresses_conv_15); - CHECK_ACCESS(addresses_conv_15_ptr); - LDKSocketAddress addresses_conv_15_conv = *(LDKSocketAddress*)(addresses_conv_15_ptr); - addresses_constr.data[p] = addresses_conv_15_conv; - } - FREE(addresses); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_connection_needed(node_id_ref, addresses_constr); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_BlindedHopFeatures_set_optional_custom_bit(int64_t this_arg, int64_t bit) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = BlindedHopFeatures_set_optional_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_Event_invoice_request_failed(int8_tArray payment_id) { - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_invoice_request_failed(payment_id_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); +int64_t CS_LDK_ChannelTypeFeatures_empty() { + LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_empty(); + int64_t ret_ref = 0; + 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_Event_payment_sent(int64_t payment_id, int8_tArray payment_preimage, int8_tArray payment_hash, int64_t fee_paid_msat) { - void* payment_id_ptr = untag_ptr(payment_id); - CHECK_ACCESS(payment_id_ptr); - LDKCOption_ThirtyTwoBytesZ payment_id_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_id_ptr); - payment_id_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_id)); - LDKThirtyTwoBytes payment_preimage_ref; - CHECK(payment_preimage->arr_len == 32); - memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - void* fee_paid_msat_ptr = untag_ptr(fee_paid_msat); - CHECK_ACCESS(fee_paid_msat_ptr); - LDKCOption_u64Z fee_paid_msat_conv = *(LDKCOption_u64Z*)(fee_paid_msat_ptr); - fee_paid_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(fee_paid_msat)); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_sent(payment_id_conv, payment_preimage_ref, payment_hash_ref, fee_paid_msat_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int8_tArray CS_LDK_ChannelTypeFeatures_le_flags(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKu8slice ret_var = ChannelTypeFeatures_le_flags(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + return ret_arr; } -int64_t CS_LDK_Event_payment_failed(int8_tArray payment_id, int8_tArray payment_hash, int64_t reason) { - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - void* reason_ptr = untag_ptr(reason); - CHECK_ACCESS(reason_ptr); - LDKCOption_PaymentFailureReasonZ reason_conv = *(LDKCOption_PaymentFailureReasonZ*)(reason_ptr); - reason_conv = COption_PaymentFailureReasonZ_clone((LDKCOption_PaymentFailureReasonZ*)untag_ptr(reason)); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_failed(payment_id_ref, payment_hash_ref, reason_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_ChannelTypeFeatures_supports_any_optional_bits(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_supports_any_optional_bits(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_Event_payment_path_successful(int8_tArray payment_id, int64_t payment_hash, int64_t path) { - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - void* payment_hash_ptr = untag_ptr(payment_hash); - CHECK_ACCESS(payment_hash_ptr); - LDKCOption_ThirtyTwoBytesZ payment_hash_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_ptr); - payment_hash_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash)); - LDKPath path_conv; - path_conv.inner = untag_ptr(path); - path_conv.is_owned = ptr_is_owned(path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); - path_conv = Path_clone(&path_conv); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_path_successful(payment_id_ref, payment_hash_conv, path_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_ChannelTypeFeatures_requires_unknown_bits_from(int64_t this_arg, int64_t other) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelTypeFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); + return ret_conv; } -int64_t CS_LDK_Event_payment_path_failed(int64_t payment_id, int8_tArray payment_hash, jboolean payment_failed_permanently, int64_t failure, int64_t path, int64_t short_channel_id) { - void* payment_id_ptr = untag_ptr(payment_id); - CHECK_ACCESS(payment_id_ptr); - LDKCOption_ThirtyTwoBytesZ payment_id_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_id_ptr); - payment_id_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_id)); - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - void* failure_ptr = untag_ptr(failure); - CHECK_ACCESS(failure_ptr); - LDKPathFailure failure_conv = *(LDKPathFailure*)(failure_ptr); - failure_conv = PathFailure_clone((LDKPathFailure*)untag_ptr(failure)); - LDKPath path_conv; - path_conv.inner = untag_ptr(path); - path_conv.is_owned = ptr_is_owned(path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); - path_conv = Path_clone(&path_conv); - void* short_channel_id_ptr = untag_ptr(short_channel_id); - CHECK_ACCESS(short_channel_id_ptr); - LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr); - short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id)); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_path_failed(payment_id_conv, payment_hash_ref, payment_failed_permanently, failure_conv, path_conv, short_channel_id_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_tArray CS_LDK_ChannelTypeFeatures_required_unknown_bits_from(int64_t this_arg, int64_t other) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelTypeFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + LDKCVec_u64Z ret_var = ChannelTypeFeatures_required_unknown_bits_from(&this_arg_conv, &other_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 g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + + FREE(ret_var.data); + return ret_arr; } -int64_t CS_LDK_Event_probe_successful(int8_tArray payment_id, int8_tArray payment_hash, int64_t path) { - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - LDKPath path_conv; - path_conv.inner = untag_ptr(path); - path_conv.is_owned = ptr_is_owned(path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); - path_conv = Path_clone(&path_conv); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_probe_successful(payment_id_ref, payment_hash_ref, path_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_ChannelTypeFeatures_requires_unknown_bits(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_requires_unknown_bits(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_Event_probe_failed(int8_tArray payment_id, int8_tArray payment_hash, int64_t path, int64_t short_channel_id) { - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - LDKPath path_conv; - path_conv.inner = untag_ptr(path); - path_conv.is_owned = ptr_is_owned(path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); - path_conv = Path_clone(&path_conv); - void* short_channel_id_ptr = untag_ptr(short_channel_id); - CHECK_ACCESS(short_channel_id_ptr); - LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr); - short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id)); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_probe_failed(payment_id_ref, payment_hash_ref, path_conv, short_channel_id_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_ChannelTypeFeatures_supports_unknown_bits(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_supports_unknown_bits(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_Event_pending_htlcs_forwardable(int64_t time_forwardable) { - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_pending_htlcs_forwardable(time_forwardable); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_ChannelTypeFeatures_set_required_feature_bit(int64_t this_arg, int64_t bit) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelTypeFeatures_set_required_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_Event_htlcintercepted(int8_tArray intercept_id, int64_t requested_next_hop_scid, int8_tArray payment_hash, int64_t inbound_amount_msat, int64_t expected_outbound_amount_msat) { - LDKThirtyTwoBytes intercept_id_ref; - CHECK(intercept_id->arr_len == 32); - memcpy(intercept_id_ref.data, intercept_id->elems, 32); FREE(intercept_id); - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_htlcintercepted(intercept_id_ref, requested_next_hop_scid, payment_hash_ref, inbound_amount_msat, expected_outbound_amount_msat); - int64_t ret_ref = tag_ptr(ret_copy, true); +int64_t CS_LDK_ChannelTypeFeatures_set_optional_feature_bit(int64_t this_arg, int64_t bit) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelTypeFeatures_set_optional_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_ChannelTypeFeatures_set_required_custom_bit(int64_t this_arg, int64_t bit) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelTypeFeatures_set_required_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_ChannelTypeFeatures_set_optional_custom_bit(int64_t this_arg, int64_t bit) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelTypeFeatures_set_optional_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_InitFeatures_clear_upfront_shutdown_script(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 = InitFeatures_clone(&this_arg_conv); + LDKInitFeatures ret_var = InitFeatures_clear_upfront_shutdown_script(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_Event_spendable_outputs(int64_tArray outputs, int64_t channel_id) { - LDKCVec_SpendableOutputDescriptorZ outputs_constr; - outputs_constr.datalen = outputs->arr_len; - if (outputs_constr.datalen > 0) - outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); - else - outputs_constr.data = NULL; - int64_t* outputs_vals = outputs->elems; - for (size_t b = 0; b < outputs_constr.datalen; b++) { - int64_t outputs_conv_27 = outputs_vals[b]; - void* outputs_conv_27_ptr = untag_ptr(outputs_conv_27); - CHECK_ACCESS(outputs_conv_27_ptr); - LDKSpendableOutputDescriptor outputs_conv_27_conv = *(LDKSpendableOutputDescriptor*)(outputs_conv_27_ptr); - outputs_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(outputs_conv_27)); - outputs_constr.data[b] = outputs_conv_27_conv; - } - FREE(outputs); - 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); +int64_t CS_LDK_NodeFeatures_clear_upfront_shutdown_script(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 = NodeFeatures_clone(&this_arg_conv); + LDKNodeFeatures ret_var = NodeFeatures_clear_upfront_shutdown_script(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_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, 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); +int64_t CS_LDK_InitFeatures_clear_shutdown_anysegwit(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 = InitFeatures_clone(&this_arg_conv); + LDKInitFeatures ret_var = InitFeatures_clear_shutdown_anysegwit(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_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); - 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); - 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); - 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_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); +int64_t CS_LDK_NodeFeatures_clear_shutdown_anysegwit(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 = NodeFeatures_clone(&this_arg_conv); + LDKNodeFeatures ret_var = NodeFeatures_clear_shutdown_anysegwit(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_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); - LDKPublicKey counterparty_node_id_ref; - CHECK(counterparty_node_id->arr_len == 33); - memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); - LDKChannelTypeFeatures channel_type_conv; - channel_type_conv.inner = untag_ptr(channel_type); - channel_type_conv.is_owned = ptr_is_owned(channel_type); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_conv); - channel_type_conv = ChannelTypeFeatures_clone(&channel_type_conv); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_channel_ready(channel_id_conv, user_channel_id_ref, counterparty_node_id_ref, channel_type_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +int64_t CS_LDK_InitFeatures_clear_wumbo(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 = InitFeatures_clone(&this_arg_conv); + LDKInitFeatures ret_var = InitFeatures_clear_wumbo(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_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); - void* reason_ptr = untag_ptr(reason); - CHECK_ACCESS(reason_ptr); - LDKClosureReason reason_conv = *(LDKClosureReason*)(reason_ptr); - reason_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(reason)); - LDKPublicKey counterparty_node_id_ref; - CHECK(counterparty_node_id->arr_len == 33); - memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); - void* channel_capacity_sats_ptr = untag_ptr(channel_capacity_sats); - CHECK_ACCESS(channel_capacity_sats_ptr); - LDKCOption_u64Z channel_capacity_sats_conv = *(LDKCOption_u64Z*)(channel_capacity_sats_ptr); - channel_capacity_sats_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(channel_capacity_sats)); - LDKOutPoint channel_funding_txo_conv; - channel_funding_txo_conv.inner = untag_ptr(channel_funding_txo); - channel_funding_txo_conv.is_owned = ptr_is_owned(channel_funding_txo); - 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_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); +int64_t CS_LDK_NodeFeatures_clear_wumbo(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 = NodeFeatures_clone(&this_arg_conv); + LDKNodeFeatures ret_var = NodeFeatures_clear_wumbo(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_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_conv, transaction_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_InitFeatures_clear_scid_privacy(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_clear_scid_privacy(&this_arg_conv); } -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); - LDKChannelTypeFeatures channel_type_conv; - channel_type_conv.inner = untag_ptr(channel_type); - channel_type_conv.is_owned = ptr_is_owned(channel_type); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_conv); - channel_type_conv = ChannelTypeFeatures_clone(&channel_type_conv); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_open_channel_request(temporary_channel_id_conv, counterparty_node_id_ref, funding_satoshis, push_msat, channel_type_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_NodeFeatures_clear_scid_privacy(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_clear_scid_privacy(&this_arg_conv); +} + +void CS_LDK_ChannelTypeFeatures_clear_scid_privacy(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_clear_scid_privacy(&this_arg_conv); +} + +void CS_LDK_InitFeatures_clear_anchors_zero_fee_htlc_tx(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_clear_anchors_zero_fee_htlc_tx(&this_arg_conv); +} + +void CS_LDK_NodeFeatures_clear_anchors_zero_fee_htlc_tx(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_clear_anchors_zero_fee_htlc_tx(&this_arg_conv); +} + +void CS_LDK_ChannelTypeFeatures_clear_anchors_zero_fee_htlc_tx(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_clear_anchors_zero_fee_htlc_tx(&this_arg_conv); +} + +void CS_LDK_InitFeatures_clear_route_blinding(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_clear_route_blinding(&this_arg_conv); +} + +void CS_LDK_NodeFeatures_clear_route_blinding(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_clear_route_blinding(&this_arg_conv); +} + +void CS_LDK_InitFeatures_set_data_loss_protect_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_data_loss_protect_optional(&this_arg_conv); +} + +void CS_LDK_InitFeatures_set_data_loss_protect_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_data_loss_protect_required(&this_arg_conv); +} + +jboolean CS_LDK_InitFeatures_supports_data_loss_protect(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_data_loss_protect(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_NodeFeatures_set_data_loss_protect_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_data_loss_protect_optional(&this_arg_conv); +} + +void CS_LDK_NodeFeatures_set_data_loss_protect_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_data_loss_protect_required(&this_arg_conv); +} + +jboolean CS_LDK_NodeFeatures_supports_data_loss_protect(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_data_loss_protect(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_InitFeatures_requires_data_loss_protect(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_data_loss_protect(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_NodeFeatures_requires_data_loss_protect(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_data_loss_protect(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_InitFeatures_set_initial_routing_sync_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_initial_routing_sync_optional(&this_arg_conv); +} + +void CS_LDK_InitFeatures_set_initial_routing_sync_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_initial_routing_sync_required(&this_arg_conv); +} + +jboolean CS_LDK_InitFeatures_initial_routing_sync(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_initial_routing_sync(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_InitFeatures_set_upfront_shutdown_script_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_upfront_shutdown_script_optional(&this_arg_conv); +} + +void CS_LDK_InitFeatures_set_upfront_shutdown_script_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_upfront_shutdown_script_required(&this_arg_conv); +} + +jboolean CS_LDK_InitFeatures_supports_upfront_shutdown_script(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_upfront_shutdown_script(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_NodeFeatures_set_upfront_shutdown_script_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_upfront_shutdown_script_optional(&this_arg_conv); +} + +void CS_LDK_NodeFeatures_set_upfront_shutdown_script_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_upfront_shutdown_script_required(&this_arg_conv); +} + +jboolean CS_LDK_NodeFeatures_supports_upfront_shutdown_script(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_upfront_shutdown_script(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_InitFeatures_requires_upfront_shutdown_script(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_upfront_shutdown_script(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_NodeFeatures_requires_upfront_shutdown_script(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_upfront_shutdown_script(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_InitFeatures_set_gossip_queries_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_gossip_queries_optional(&this_arg_conv); +} + +void CS_LDK_InitFeatures_set_gossip_queries_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_gossip_queries_required(&this_arg_conv); +} + +jboolean CS_LDK_InitFeatures_supports_gossip_queries(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_gossip_queries(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_NodeFeatures_set_gossip_queries_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_gossip_queries_optional(&this_arg_conv); +} + +void CS_LDK_NodeFeatures_set_gossip_queries_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_gossip_queries_required(&this_arg_conv); +} + +jboolean CS_LDK_NodeFeatures_supports_gossip_queries(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_gossip_queries(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_InitFeatures_requires_gossip_queries(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_gossip_queries(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_NodeFeatures_requires_gossip_queries(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_gossip_queries(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_InitFeatures_set_variable_length_onion_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_variable_length_onion_optional(&this_arg_conv); +} + +void CS_LDK_InitFeatures_set_variable_length_onion_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_variable_length_onion_required(&this_arg_conv); +} + +jboolean CS_LDK_InitFeatures_supports_variable_length_onion(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_variable_length_onion(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_NodeFeatures_set_variable_length_onion_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_variable_length_onion_optional(&this_arg_conv); +} + +void CS_LDK_NodeFeatures_set_variable_length_onion_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_variable_length_onion_required(&this_arg_conv); +} + +jboolean CS_LDK_NodeFeatures_supports_variable_length_onion(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_variable_length_onion(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_Bolt11InvoiceFeatures_set_variable_length_onion_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_variable_length_onion_optional(&this_arg_conv); +} + +void CS_LDK_Bolt11InvoiceFeatures_set_variable_length_onion_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_variable_length_onion_required(&this_arg_conv); +} + +jboolean CS_LDK_Bolt11InvoiceFeatures_supports_variable_length_onion(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_variable_length_onion(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_InitFeatures_requires_variable_length_onion(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_variable_length_onion(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_NodeFeatures_requires_variable_length_onion(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_variable_length_onion(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_Bolt11InvoiceFeatures_requires_variable_length_onion(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_variable_length_onion(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_InitFeatures_set_static_remote_key_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_static_remote_key_optional(&this_arg_conv); +} + +void CS_LDK_InitFeatures_set_static_remote_key_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_static_remote_key_required(&this_arg_conv); +} + +jboolean CS_LDK_InitFeatures_supports_static_remote_key(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_static_remote_key(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_NodeFeatures_set_static_remote_key_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_static_remote_key_optional(&this_arg_conv); +} + +void CS_LDK_NodeFeatures_set_static_remote_key_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_static_remote_key_required(&this_arg_conv); +} + +jboolean CS_LDK_NodeFeatures_supports_static_remote_key(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_static_remote_key(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_ChannelTypeFeatures_set_static_remote_key_optional(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_static_remote_key_optional(&this_arg_conv); +} + +void CS_LDK_ChannelTypeFeatures_set_static_remote_key_required(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_static_remote_key_required(&this_arg_conv); +} + +jboolean CS_LDK_ChannelTypeFeatures_supports_static_remote_key(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_supports_static_remote_key(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_InitFeatures_requires_static_remote_key(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_static_remote_key(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_NodeFeatures_requires_static_remote_key(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_static_remote_key(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_ChannelTypeFeatures_requires_static_remote_key(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_requires_static_remote_key(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_InitFeatures_set_payment_secret_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_payment_secret_optional(&this_arg_conv); +} + +void CS_LDK_InitFeatures_set_payment_secret_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_payment_secret_required(&this_arg_conv); +} + +jboolean CS_LDK_InitFeatures_supports_payment_secret(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_payment_secret(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_NodeFeatures_set_payment_secret_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_payment_secret_optional(&this_arg_conv); +} + +void CS_LDK_NodeFeatures_set_payment_secret_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_payment_secret_required(&this_arg_conv); +} + +jboolean CS_LDK_NodeFeatures_supports_payment_secret(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_payment_secret(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_Bolt11InvoiceFeatures_set_payment_secret_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_payment_secret_optional(&this_arg_conv); +} + +void CS_LDK_Bolt11InvoiceFeatures_set_payment_secret_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_payment_secret_required(&this_arg_conv); +} + +jboolean CS_LDK_Bolt11InvoiceFeatures_supports_payment_secret(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_payment_secret(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_InitFeatures_requires_payment_secret(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_payment_secret(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_NodeFeatures_requires_payment_secret(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_payment_secret(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_Bolt11InvoiceFeatures_requires_payment_secret(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_payment_secret(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_InitFeatures_set_basic_mpp_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_basic_mpp_optional(&this_arg_conv); +} + +void CS_LDK_InitFeatures_set_basic_mpp_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_basic_mpp_required(&this_arg_conv); +} + +jboolean CS_LDK_InitFeatures_supports_basic_mpp(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_basic_mpp(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_NodeFeatures_set_basic_mpp_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_basic_mpp_optional(&this_arg_conv); +} + +void CS_LDK_NodeFeatures_set_basic_mpp_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_basic_mpp_required(&this_arg_conv); +} + +jboolean CS_LDK_NodeFeatures_supports_basic_mpp(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_basic_mpp(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_Bolt11InvoiceFeatures_set_basic_mpp_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_basic_mpp_optional(&this_arg_conv); +} + +void CS_LDK_Bolt11InvoiceFeatures_set_basic_mpp_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_basic_mpp_required(&this_arg_conv); +} + +jboolean CS_LDK_Bolt11InvoiceFeatures_supports_basic_mpp(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_basic_mpp(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_Bolt12InvoiceFeatures_set_basic_mpp_optional(int64_t this_arg) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + Bolt12InvoiceFeatures_set_basic_mpp_optional(&this_arg_conv); +} + +void CS_LDK_Bolt12InvoiceFeatures_set_basic_mpp_required(int64_t this_arg) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + Bolt12InvoiceFeatures_set_basic_mpp_required(&this_arg_conv); +} + +jboolean CS_LDK_Bolt12InvoiceFeatures_supports_basic_mpp(int64_t this_arg) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt12InvoiceFeatures_supports_basic_mpp(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_InitFeatures_requires_basic_mpp(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_basic_mpp(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_NodeFeatures_requires_basic_mpp(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_basic_mpp(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_Bolt11InvoiceFeatures_requires_basic_mpp(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_basic_mpp(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_Bolt12InvoiceFeatures_requires_basic_mpp(int64_t this_arg) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt12InvoiceFeatures_requires_basic_mpp(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_InitFeatures_set_wumbo_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_wumbo_optional(&this_arg_conv); +} + +void CS_LDK_InitFeatures_set_wumbo_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_wumbo_required(&this_arg_conv); +} + +jboolean CS_LDK_InitFeatures_supports_wumbo(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_wumbo(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_NodeFeatures_set_wumbo_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_wumbo_optional(&this_arg_conv); +} + +void CS_LDK_NodeFeatures_set_wumbo_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_wumbo_required(&this_arg_conv); +} + +jboolean CS_LDK_NodeFeatures_supports_wumbo(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_wumbo(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_InitFeatures_requires_wumbo(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_wumbo(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_NodeFeatures_requires_wumbo(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_wumbo(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_InitFeatures_set_anchors_nonzero_fee_htlc_tx_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_anchors_nonzero_fee_htlc_tx_optional(&this_arg_conv); +} + +void CS_LDK_InitFeatures_set_anchors_nonzero_fee_htlc_tx_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_anchors_nonzero_fee_htlc_tx_required(&this_arg_conv); +} + +jboolean CS_LDK_InitFeatures_supports_anchors_nonzero_fee_htlc_tx(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_anchors_nonzero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_NodeFeatures_set_anchors_nonzero_fee_htlc_tx_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_anchors_nonzero_fee_htlc_tx_optional(&this_arg_conv); +} + +void CS_LDK_NodeFeatures_set_anchors_nonzero_fee_htlc_tx_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_anchors_nonzero_fee_htlc_tx_required(&this_arg_conv); +} + +jboolean CS_LDK_NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(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_anchors_nonzero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(&this_arg_conv); +} + +void CS_LDK_ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(&this_arg_conv); +} + +jboolean CS_LDK_ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_InitFeatures_requires_anchors_nonzero_fee_htlc_tx(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_anchors_nonzero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(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_anchors_nonzero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_InitFeatures_set_anchors_zero_fee_htlc_tx_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_anchors_zero_fee_htlc_tx_optional(&this_arg_conv); +} + +void CS_LDK_InitFeatures_set_anchors_zero_fee_htlc_tx_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_anchors_zero_fee_htlc_tx_required(&this_arg_conv); +} + +jboolean CS_LDK_InitFeatures_supports_anchors_zero_fee_htlc_tx(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_anchors_zero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_NodeFeatures_set_anchors_zero_fee_htlc_tx_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_anchors_zero_fee_htlc_tx_optional(&this_arg_conv); +} + +void CS_LDK_NodeFeatures_set_anchors_zero_fee_htlc_tx_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_anchors_zero_fee_htlc_tx_required(&this_arg_conv); +} + +jboolean CS_LDK_NodeFeatures_supports_anchors_zero_fee_htlc_tx(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_anchors_zero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(&this_arg_conv); +} + +void CS_LDK_ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(&this_arg_conv); +} + +jboolean CS_LDK_ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_InitFeatures_requires_anchors_zero_fee_htlc_tx(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_anchors_zero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_NodeFeatures_requires_anchors_zero_fee_htlc_tx(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_anchors_zero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_InitFeatures_set_route_blinding_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_route_blinding_optional(&this_arg_conv); +} + +void CS_LDK_InitFeatures_set_route_blinding_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_route_blinding_required(&this_arg_conv); +} + +jboolean CS_LDK_InitFeatures_supports_route_blinding(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_route_blinding(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_NodeFeatures_set_route_blinding_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_route_blinding_optional(&this_arg_conv); +} + +void CS_LDK_NodeFeatures_set_route_blinding_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_route_blinding_required(&this_arg_conv); +} + +jboolean CS_LDK_NodeFeatures_supports_route_blinding(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_route_blinding(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_InitFeatures_requires_route_blinding(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_route_blinding(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_NodeFeatures_requires_route_blinding(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_route_blinding(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_InitFeatures_set_shutdown_any_segwit_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_shutdown_any_segwit_optional(&this_arg_conv); +} + +void CS_LDK_InitFeatures_set_shutdown_any_segwit_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_shutdown_any_segwit_required(&this_arg_conv); +} + +jboolean CS_LDK_InitFeatures_supports_shutdown_anysegwit(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_shutdown_anysegwit(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_NodeFeatures_set_shutdown_any_segwit_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_shutdown_any_segwit_optional(&this_arg_conv); +} + +void CS_LDK_NodeFeatures_set_shutdown_any_segwit_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_shutdown_any_segwit_required(&this_arg_conv); +} + +jboolean CS_LDK_NodeFeatures_supports_shutdown_anysegwit(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_shutdown_anysegwit(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_InitFeatures_requires_shutdown_anysegwit(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_shutdown_anysegwit(&this_arg_conv); + return ret_conv; } -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_conv, failed_next_destination_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_NodeFeatures_requires_shutdown_anysegwit(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_shutdown_anysegwit(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_Event_bump_transaction(int64_t a) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKBumpTransactionEvent a_conv = *(LDKBumpTransactionEvent*)(a_ptr); - a_conv = BumpTransactionEvent_clone((LDKBumpTransactionEvent*)untag_ptr(a)); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_bump_transaction(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_InitFeatures_set_taproot_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_taproot_optional(&this_arg_conv); } -jboolean CS_LDK_Event_eq(int64_t a, int64_t b) { - LDKEvent* a_conv = (LDKEvent*)untag_ptr(a); - LDKEvent* b_conv = (LDKEvent*)untag_ptr(b); - jboolean ret_conv = Event_eq(a_conv, b_conv); +void CS_LDK_InitFeatures_set_taproot_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_taproot_required(&this_arg_conv); +} + +jboolean CS_LDK_InitFeatures_supports_taproot(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_taproot(&this_arg_conv); return ret_conv; } -int8_tArray CS_LDK_Event_write(int64_t obj) { - LDKEvent* obj_conv = (LDKEvent*)untag_ptr(obj); - LDKCVec_u8Z ret_var = Event_write(obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +void CS_LDK_NodeFeatures_set_taproot_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_taproot_optional(&this_arg_conv); } -int64_t CS_LDK_Event_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); - *ret_conv = Event_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void CS_LDK_NodeFeatures_set_taproot_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_taproot_required(&this_arg_conv); } -void CS_LDK_MessageSendEvent_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); - LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - MessageSendEvent_free(this_ptr_conv); +jboolean CS_LDK_NodeFeatures_supports_taproot(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_taproot(&this_arg_conv); + return ret_conv; } -static inline uint64_t MessageSendEvent_clone_ptr(LDKMessageSendEvent *NONNULL_PTR arg) { - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_ChannelTypeFeatures_set_taproot_optional(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_taproot_optional(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_clone_ptr(int64_t arg) { - LDKMessageSendEvent* arg_conv = (LDKMessageSendEvent*)untag_ptr(arg); - int64_t ret_conv = MessageSendEvent_clone_ptr(arg_conv); - return ret_conv; + +void CS_LDK_ChannelTypeFeatures_set_taproot_required(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_taproot_required(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_clone(int64_t orig) { - LDKMessageSendEvent* orig_conv = (LDKMessageSendEvent*)untag_ptr(orig); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_ChannelTypeFeatures_supports_taproot(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_supports_taproot(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_send_accept_channel(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKAcceptChannel msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = AcceptChannel_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_accept_channel(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_InitFeatures_requires_taproot(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_taproot(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_send_accept_channel_v2(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKAcceptChannelV2 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 = AcceptChannelV2_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_accept_channel_v2(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_NodeFeatures_requires_taproot(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_taproot(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_send_open_channel(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKOpenChannel msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = OpenChannel_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_open_channel(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_ChannelTypeFeatures_requires_taproot(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_requires_taproot(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_send_open_channel_v2(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKOpenChannelV2 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 = OpenChannelV2_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_open_channel_v2(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_InitFeatures_set_onion_messages_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_onion_messages_optional(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_send_funding_created(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKFundingCreated msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = FundingCreated_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_funding_created(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_InitFeatures_set_onion_messages_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_onion_messages_required(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_send_funding_signed(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKFundingSigned msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = FundingSigned_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_funding_signed(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_InitFeatures_supports_onion_messages(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_onion_messages(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_send_stfu(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKStfu 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 = Stfu_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_stfu(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_NodeFeatures_set_onion_messages_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_onion_messages_optional(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_send_splice(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - 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 = Splice_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_splice(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_NodeFeatures_set_onion_messages_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_onion_messages_required(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_send_splice_ack(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - 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 = SpliceAck_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_splice_ack(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_NodeFeatures_supports_onion_messages(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_onion_messages(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_send_splice_locked(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - 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 = SpliceLocked_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_splice_locked(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_InitFeatures_requires_onion_messages(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_onion_messages(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_send_tx_add_input(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKTxAddInput 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 = TxAddInput_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_tx_add_input(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_NodeFeatures_requires_onion_messages(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_onion_messages(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_send_tx_add_output(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKTxAddOutput 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 = TxAddOutput_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_tx_add_output(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_InitFeatures_set_channel_type_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_channel_type_optional(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_send_tx_remove_input(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKTxRemoveInput 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 = TxRemoveInput_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_tx_remove_input(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_InitFeatures_set_channel_type_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_channel_type_required(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_send_tx_remove_output(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKTxRemoveOutput 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 = TxRemoveOutput_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_tx_remove_output(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_InitFeatures_supports_channel_type(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_channel_type(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_send_tx_complete(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKTxComplete 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 = TxComplete_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_tx_complete(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_NodeFeatures_set_channel_type_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_channel_type_optional(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_send_tx_signatures(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKTxSignatures 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 = TxSignatures_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_tx_signatures(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_NodeFeatures_set_channel_type_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_channel_type_required(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_send_tx_init_rbf(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKTxInitRbf 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 = TxInitRbf_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_tx_init_rbf(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_NodeFeatures_supports_channel_type(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_channel_type(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_send_tx_ack_rbf(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKTxAckRbf 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 = TxAckRbf_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_tx_ack_rbf(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_InitFeatures_requires_channel_type(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_channel_type(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_NodeFeatures_requires_channel_type(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_channel_type(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_send_tx_abort(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKTxAbort 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 = TxAbort_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_tx_abort(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_InitFeatures_set_scid_privacy_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_scid_privacy_optional(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_send_channel_ready(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKChannelReady msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ChannelReady_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_channel_ready(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_InitFeatures_set_scid_privacy_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_scid_privacy_required(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_send_announcement_signatures(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKAnnouncementSignatures msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = AnnouncementSignatures_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_announcement_signatures(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_InitFeatures_supports_scid_privacy(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_scid_privacy(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_update_htlcs(int8_tArray node_id, int64_t updates) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKCommitmentUpdate updates_conv; - updates_conv.inner = untag_ptr(updates); - updates_conv.is_owned = ptr_is_owned(updates); - CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv); - updates_conv = CommitmentUpdate_clone(&updates_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_update_htlcs(node_id_ref, updates_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_NodeFeatures_set_scid_privacy_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_scid_privacy_optional(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_send_revoke_and_ack(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKRevokeAndACK msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = RevokeAndACK_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_revoke_and_ack(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_NodeFeatures_set_scid_privacy_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_scid_privacy_required(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_send_closing_signed(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKClosingSigned msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ClosingSigned_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_closing_signed(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_NodeFeatures_supports_scid_privacy(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_scid_privacy(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_send_shutdown(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKShutdown msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = Shutdown_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_shutdown(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_ChannelTypeFeatures_set_scid_privacy_optional(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_scid_privacy_optional(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_send_channel_reestablish(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKChannelReestablish msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ChannelReestablish_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_channel_reestablish(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_ChannelTypeFeatures_set_scid_privacy_required(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_scid_privacy_required(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_send_channel_announcement(int8_tArray node_id, int64_t msg, int64_t update_msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKChannelAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ChannelAnnouncement_clone(&msg_conv); - LDKChannelUpdate update_msg_conv; - update_msg_conv.inner = untag_ptr(update_msg); - update_msg_conv.is_owned = ptr_is_owned(update_msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv); - update_msg_conv = ChannelUpdate_clone(&update_msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_channel_announcement(node_id_ref, msg_conv, update_msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_ChannelTypeFeatures_supports_scid_privacy(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_supports_scid_privacy(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_broadcast_channel_announcement(int64_t msg, int64_t update_msg) { - LDKChannelAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ChannelAnnouncement_clone(&msg_conv); - LDKChannelUpdate update_msg_conv; - update_msg_conv.inner = untag_ptr(update_msg); - update_msg_conv.is_owned = ptr_is_owned(update_msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv); - update_msg_conv = ChannelUpdate_clone(&update_msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_broadcast_channel_announcement(msg_conv, update_msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_InitFeatures_requires_scid_privacy(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_scid_privacy(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_broadcast_channel_update(int64_t msg) { - LDKChannelUpdate msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ChannelUpdate_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_broadcast_channel_update(msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_NodeFeatures_requires_scid_privacy(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_scid_privacy(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_broadcast_node_announcement(int64_t msg) { - LDKNodeAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = NodeAnnouncement_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_broadcast_node_announcement(msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_ChannelTypeFeatures_requires_scid_privacy(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_requires_scid_privacy(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_send_channel_update(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKChannelUpdate msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ChannelUpdate_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_channel_update(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_Bolt11InvoiceFeatures_set_payment_metadata_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_payment_metadata_optional(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_handle_error(int8_tArray node_id, int64_t action) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - void* action_ptr = untag_ptr(action); - CHECK_ACCESS(action_ptr); - LDKErrorAction action_conv = *(LDKErrorAction*)(action_ptr); - action_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(action)); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_handle_error(node_id_ref, action_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_Bolt11InvoiceFeatures_set_payment_metadata_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_payment_metadata_required(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_send_channel_range_query(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKQueryChannelRange msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = QueryChannelRange_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_channel_range_query(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_Bolt11InvoiceFeatures_supports_payment_metadata(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_payment_metadata(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_send_short_ids_query(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKQueryShortChannelIds msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = QueryShortChannelIds_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_short_ids_query(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_Bolt11InvoiceFeatures_requires_payment_metadata(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_payment_metadata(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_send_reply_channel_range(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKReplyChannelRange msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ReplyChannelRange_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_reply_channel_range(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_InitFeatures_set_zero_conf_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_zero_conf_optional(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_send_gossip_timestamp_filter(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKGossipTimestampFilter msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = GossipTimestampFilter_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_gossip_timestamp_filter(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_InitFeatures_set_zero_conf_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_zero_conf_required(&this_arg_conv); } -void CS_LDK_MessageSendEventsProvider_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); - LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - MessageSendEventsProvider_free(this_ptr_conv); +jboolean CS_LDK_InitFeatures_supports_zero_conf(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_zero_conf(&this_arg_conv); + return ret_conv; } -void CS_LDK_EventsProvider_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); - LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - EventsProvider_free(this_ptr_conv); +void CS_LDK_NodeFeatures_set_zero_conf_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_zero_conf_optional(&this_arg_conv); } -void CS_LDK_EventHandler_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); - LDKEventHandler this_ptr_conv = *(LDKEventHandler*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - EventHandler_free(this_ptr_conv); +void CS_LDK_NodeFeatures_set_zero_conf_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_zero_conf_required(&this_arg_conv); } -void CS_LDK_AnchorDescriptor_free(int64_t this_obj) { - LDKAnchorDescriptor this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - AnchorDescriptor_free(this_obj_conv); +jboolean CS_LDK_NodeFeatures_supports_zero_conf(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_zero_conf(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_AnchorDescriptor_get_channel_derivation_parameters(int64_t this_ptr) { - LDKAnchorDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelDerivationParameters ret_var = AnchorDescriptor_get_channel_derivation_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_ChannelTypeFeatures_set_zero_conf_optional(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_zero_conf_optional(&this_arg_conv); } -void CS_LDK_AnchorDescriptor_set_channel_derivation_parameters(int64_t this_ptr, int64_t val) { - LDKAnchorDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelDerivationParameters 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 = ChannelDerivationParameters_clone(&val_conv); - AnchorDescriptor_set_channel_derivation_parameters(&this_ptr_conv, val_conv); +void CS_LDK_ChannelTypeFeatures_set_zero_conf_required(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_zero_conf_required(&this_arg_conv); } -int64_t CS_LDK_AnchorDescriptor_get_outpoint(int64_t this_ptr) { - LDKAnchorDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKOutPoint ret_var = AnchorDescriptor_get_outpoint(&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; +jboolean CS_LDK_ChannelTypeFeatures_supports_zero_conf(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_supports_zero_conf(&this_arg_conv); + return ret_conv; } -void CS_LDK_AnchorDescriptor_set_outpoint(int64_t this_ptr, int64_t val) { - LDKAnchorDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKOutPoint val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = OutPoint_clone(&val_conv); - AnchorDescriptor_set_outpoint(&this_ptr_conv, val_conv); +jboolean CS_LDK_InitFeatures_requires_zero_conf(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_zero_conf(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_NodeFeatures_requires_zero_conf(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_zero_conf(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_AnchorDescriptor_new(int64_t channel_derivation_parameters_arg, int64_t outpoint_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); - LDKOutPoint outpoint_arg_conv; - outpoint_arg_conv.inner = untag_ptr(outpoint_arg); - outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); - outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); - LDKAnchorDescriptor ret_var = AnchorDescriptor_new(channel_derivation_parameters_arg_conv, outpoint_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_ChannelTypeFeatures_requires_zero_conf(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_requires_zero_conf(&this_arg_conv); + return ret_conv; } -static inline uint64_t AnchorDescriptor_clone_ptr(LDKAnchorDescriptor *NONNULL_PTR arg) { - LDKAnchorDescriptor ret_var = AnchorDescriptor_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; +void CS_LDK_NodeFeatures_set_keysend_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_keysend_optional(&this_arg_conv); } -int64_t CS_LDK_AnchorDescriptor_clone_ptr(int64_t arg) { - LDKAnchorDescriptor 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 = AnchorDescriptor_clone_ptr(&arg_conv); - return ret_conv; + +void CS_LDK_NodeFeatures_set_keysend_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_keysend_required(&this_arg_conv); } -int64_t CS_LDK_AnchorDescriptor_clone(int64_t orig) { - LDKAnchorDescriptor 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; - LDKAnchorDescriptor ret_var = AnchorDescriptor_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_NodeFeatures_supports_keysend(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_keysend(&this_arg_conv); + return ret_conv; } -jboolean CS_LDK_AnchorDescriptor_eq(int64_t a, int64_t b) { - LDKAnchorDescriptor a_conv; - 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; - LDKAnchorDescriptor 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 = AnchorDescriptor_eq(&a_conv, &b_conv); +jboolean CS_LDK_NodeFeatures_requires_keysend(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_keysend(&this_arg_conv); return ret_conv; } -int64_t CS_LDK_AnchorDescriptor_previous_utxo(int64_t this_arg) { - LDKAnchorDescriptor this_arg_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; - LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); - *ret_ref = AnchorDescriptor_previous_utxo(&this_arg_conv); - return tag_ptr(ret_ref, true); + InitFeatures_set_trampoline_routing_optional(&this_arg_conv); } -int64_t CS_LDK_AnchorDescriptor_unsigned_tx_input(int64_t this_arg) { - LDKAnchorDescriptor 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; - LDKTxIn* ret_ref = MALLOC(sizeof(LDKTxIn), "LDKTxIn"); - *ret_ref = AnchorDescriptor_unsigned_tx_input(&this_arg_conv); - return tag_ptr(ret_ref, true); + InitFeatures_set_trampoline_routing_required(&this_arg_conv); } -int8_tArray CS_LDK_AnchorDescriptor_witness_script(int64_t this_arg) { - LDKAnchorDescriptor 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; - LDKCVec_u8Z ret_var = AnchorDescriptor_witness_script(&this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; + jboolean ret_conv = InitFeatures_supports_trampoline_routing(&this_arg_conv); + return ret_conv; } -int8_tArray CS_LDK_AnchorDescriptor_tx_input_witness(int64_t this_arg, int8_tArray signature) { - LDKAnchorDescriptor this_arg_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; - LDKECDSASignature signature_ref; - CHECK(signature->arr_len == 64); - memcpy(signature_ref.compact_form, signature->elems, 64); FREE(signature); - LDKWitness ret_var = AnchorDescriptor_tx_input_witness(&this_arg_conv, signature_ref); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - Witness_free(ret_var); - return ret_arr; + NodeFeatures_set_trampoline_routing_optional(&this_arg_conv); } -int64_t CS_LDK_AnchorDescriptor_derive_channel_signer(int64_t this_arg, int64_t signer_provider) { - LDKAnchorDescriptor 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; - void* signer_provider_ptr = untag_ptr(signer_provider); - if (ptr_is_owned(signer_provider)) { CHECK_ACCESS(signer_provider_ptr); } - LDKSignerProvider* signer_provider_conv = (LDKSignerProvider*)signer_provider_ptr; - LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner"); - *ret_ret = AnchorDescriptor_derive_channel_signer(&this_arg_conv, signer_provider_conv); - return tag_ptr(ret_ret, true); + NodeFeatures_set_trampoline_routing_required(&this_arg_conv); } -void CS_LDK_BumpTransactionEvent_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); - LDKBumpTransactionEvent this_ptr_conv = *(LDKBumpTransactionEvent*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - BumpTransactionEvent_free(this_ptr_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; } -static inline uint64_t BumpTransactionEvent_clone_ptr(LDKBumpTransactionEvent *NONNULL_PTR arg) { - LDKBumpTransactionEvent *ret_copy = MALLOC(sizeof(LDKBumpTransactionEvent), "LDKBumpTransactionEvent"); - *ret_copy = BumpTransactionEvent_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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); } -int64_t CS_LDK_BumpTransactionEvent_clone_ptr(int64_t arg) { - LDKBumpTransactionEvent* arg_conv = (LDKBumpTransactionEvent*)untag_ptr(arg); - int64_t ret_conv = BumpTransactionEvent_clone_ptr(arg_conv); - return ret_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); } -int64_t CS_LDK_BumpTransactionEvent_clone(int64_t orig) { - LDKBumpTransactionEvent* orig_conv = (LDKBumpTransactionEvent*)untag_ptr(orig); - LDKBumpTransactionEvent *ret_copy = MALLOC(sizeof(LDKBumpTransactionEvent), "LDKBumpTransactionEvent"); - *ret_copy = BumpTransactionEvent_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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; } -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); - LDKTransaction commitment_tx_ref; - commitment_tx_ref.datalen = commitment_tx->arr_len; - commitment_tx_ref.data = MALLOC(commitment_tx_ref.datalen, "LDKTransaction Bytes"); - memcpy(commitment_tx_ref.data, commitment_tx->elems, commitment_tx_ref.datalen); FREE(commitment_tx); - commitment_tx_ref.data_is_owned = true; - LDKAnchorDescriptor anchor_descriptor_conv; - anchor_descriptor_conv.inner = untag_ptr(anchor_descriptor); - anchor_descriptor_conv.is_owned = ptr_is_owned(anchor_descriptor); - CHECK_INNER_FIELD_ACCESS_OR_NULL(anchor_descriptor_conv); - anchor_descriptor_conv = AnchorDescriptor_clone(&anchor_descriptor_conv); - LDKCVec_HTLCOutputInCommitmentZ pending_htlcs_constr; - pending_htlcs_constr.datalen = pending_htlcs->arr_len; - if (pending_htlcs_constr.datalen > 0) - pending_htlcs_constr.data = MALLOC(pending_htlcs_constr.datalen * sizeof(LDKHTLCOutputInCommitment), "LDKCVec_HTLCOutputInCommitmentZ Elements"); - else - pending_htlcs_constr.data = NULL; - int64_t* pending_htlcs_vals = pending_htlcs->elems; - for (size_t y = 0; y < pending_htlcs_constr.datalen; y++) { - int64_t pending_htlcs_conv_24 = pending_htlcs_vals[y]; - LDKHTLCOutputInCommitment pending_htlcs_conv_24_conv; - pending_htlcs_conv_24_conv.inner = untag_ptr(pending_htlcs_conv_24); - pending_htlcs_conv_24_conv.is_owned = ptr_is_owned(pending_htlcs_conv_24); - CHECK_INNER_FIELD_ACCESS_OR_NULL(pending_htlcs_conv_24_conv); - pending_htlcs_conv_24_conv = HTLCOutputInCommitment_clone(&pending_htlcs_conv_24_conv); - pending_htlcs_constr.data[y] = pending_htlcs_conv_24_conv; - } - FREE(pending_htlcs); - LDKBumpTransactionEvent *ret_copy = MALLOC(sizeof(LDKBumpTransactionEvent), "LDKBumpTransactionEvent"); - *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; +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; } -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); - LDKCVec_HTLCDescriptorZ htlc_descriptors_constr; - htlc_descriptors_constr.datalen = htlc_descriptors->arr_len; - if (htlc_descriptors_constr.datalen > 0) - htlc_descriptors_constr.data = MALLOC(htlc_descriptors_constr.datalen * sizeof(LDKHTLCDescriptor), "LDKCVec_HTLCDescriptorZ Elements"); - else - htlc_descriptors_constr.data = NULL; - int64_t* htlc_descriptors_vals = htlc_descriptors->elems; - for (size_t q = 0; q < htlc_descriptors_constr.datalen; q++) { - int64_t htlc_descriptors_conv_16 = htlc_descriptors_vals[q]; - LDKHTLCDescriptor htlc_descriptors_conv_16_conv; - htlc_descriptors_conv_16_conv.inner = untag_ptr(htlc_descriptors_conv_16); - htlc_descriptors_conv_16_conv.is_owned = ptr_is_owned(htlc_descriptors_conv_16); - CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_descriptors_conv_16_conv); - htlc_descriptors_conv_16_conv = HTLCDescriptor_clone(&htlc_descriptors_conv_16_conv); - htlc_descriptors_constr.data[q] = htlc_descriptors_conv_16_conv; - } - FREE(htlc_descriptors); - LDKBumpTransactionEvent *ret_copy = MALLOC(sizeof(LDKBumpTransactionEvent), "LDKBumpTransactionEvent"); - *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; +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_BumpTransactionEvent_eq(int64_t a, int64_t b) { - LDKBumpTransactionEvent* a_conv = (LDKBumpTransactionEvent*)untag_ptr(a); - LDKBumpTransactionEvent* b_conv = (LDKBumpTransactionEvent*)untag_ptr(b); - jboolean ret_conv = BumpTransactionEvent_eq(a_conv, b_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_Input_free(int64_t this_obj) { - LDKInput this_obj_conv; +void CS_LDK_RoutingFees_free(int64_t this_obj) { + LDKRoutingFees this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Input_free(this_obj_conv); + RoutingFees_free(this_obj_conv); } -int64_t CS_LDK_Input_get_outpoint(int64_t this_ptr) { - LDKInput this_ptr_conv; +int32_t CS_LDK_RoutingFees_get_base_msat(int64_t this_ptr) { + LDKRoutingFees this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKOutPoint ret_var = Input_get_outpoint(&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; + int32_t ret_conv = RoutingFees_get_base_msat(&this_ptr_conv); + return ret_conv; } -void CS_LDK_Input_set_outpoint(int64_t this_ptr, int64_t val) { - LDKInput this_ptr_conv; +void CS_LDK_RoutingFees_set_base_msat(int64_t this_ptr, int32_t val) { + LDKRoutingFees this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKOutPoint val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = OutPoint_clone(&val_conv); - Input_set_outpoint(&this_ptr_conv, val_conv); + RoutingFees_set_base_msat(&this_ptr_conv, val); } -int64_t CS_LDK_Input_get_previous_utxo(int64_t this_ptr) { - LDKInput this_ptr_conv; +int32_t CS_LDK_RoutingFees_get_proportional_millionths(int64_t this_ptr) { + LDKRoutingFees this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); - *ret_ref = Input_get_previous_utxo(&this_ptr_conv); - return tag_ptr(ret_ref, true); + int32_t ret_conv = RoutingFees_get_proportional_millionths(&this_ptr_conv); + return ret_conv; } -void CS_LDK_Input_set_previous_utxo(int64_t this_ptr, int64_t val) { - LDKInput this_ptr_conv; +void CS_LDK_RoutingFees_set_proportional_millionths(int64_t this_ptr, int32_t val) { + LDKRoutingFees this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); - val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val)); - Input_set_previous_utxo(&this_ptr_conv, val_conv); + RoutingFees_set_proportional_millionths(&this_ptr_conv, val); } -int64_t CS_LDK_Input_get_satisfaction_weight(int64_t this_ptr) { - LDKInput this_ptr_conv; +int64_t CS_LDK_RoutingFees_new(int32_t base_msat_arg, int32_t proportional_millionths_arg) { + LDKRoutingFees ret_var = RoutingFees_new(base_msat_arg, proportional_millionths_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; +} + +jboolean CS_LDK_RoutingFees_eq(int64_t a, int64_t b) { + LDKRoutingFees a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKRoutingFees b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = RoutingFees_eq(&a_conv, &b_conv); + return ret_conv; +} + +static inline uint64_t RoutingFees_clone_ptr(LDKRoutingFees *NONNULL_PTR arg) { + LDKRoutingFees ret_var = RoutingFees_clone(arg); + int64_t ret_ref = 0; + 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_RoutingFees_clone_ptr(int64_t arg) { + LDKRoutingFees arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = RoutingFees_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_RoutingFees_clone(int64_t orig) { + LDKRoutingFees orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKRoutingFees ret_var = RoutingFees_clone(&orig_conv); + int64_t ret_ref = 0; + 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_RoutingFees_hash(int64_t o) { + LDKRoutingFees o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = RoutingFees_hash(&o_conv); + return ret_conv; +} + +void CS_LDK_RouteHint_free(int64_t this_obj) { + LDKRouteHint this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + RouteHint_free(this_obj_conv); +} + +int64_tArray CS_LDK_RouteHint_get_a(int64_t this_ptr) { + LDKRouteHint this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = Input_get_satisfaction_weight(&this_ptr_conv); - return ret_conv; + LDKCVec_RouteHintHopZ ret_var = RouteHint_get_a(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t o = 0; o < ret_var.datalen; o++) { + LDKRouteHintHop ret_conv_14_var = ret_var.data[o]; + int64_t ret_conv_14_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var); + ret_conv_14_ref = tag_ptr(ret_conv_14_var.inner, ret_conv_14_var.is_owned); + ret_arr_ptr[o] = ret_conv_14_ref; + } + + FREE(ret_var.data); + return ret_arr; } -void CS_LDK_Input_set_satisfaction_weight(int64_t this_ptr, int64_t val) { - LDKInput this_ptr_conv; +void CS_LDK_RouteHint_set_a(int64_t this_ptr, int64_tArray val) { + LDKRouteHint this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - Input_set_satisfaction_weight(&this_ptr_conv, val); + LDKCVec_RouteHintHopZ val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = val->elems; + for (size_t o = 0; o < val_constr.datalen; o++) { + int64_t val_conv_14 = val_vals[o]; + LDKRouteHintHop val_conv_14_conv; + val_conv_14_conv.inner = untag_ptr(val_conv_14); + val_conv_14_conv.is_owned = ptr_is_owned(val_conv_14); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_14_conv); + val_conv_14_conv = RouteHintHop_clone(&val_conv_14_conv); + val_constr.data[o] = val_conv_14_conv; + } + FREE(val); + RouteHint_set_a(&this_ptr_conv, val_constr); } -int64_t CS_LDK_Input_new(int64_t outpoint_arg, int64_t previous_utxo_arg, int64_t satisfaction_weight_arg) { - LDKOutPoint outpoint_arg_conv; - outpoint_arg_conv.inner = untag_ptr(outpoint_arg); - outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); - outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); - void* previous_utxo_arg_ptr = untag_ptr(previous_utxo_arg); - CHECK_ACCESS(previous_utxo_arg_ptr); - LDKTxOut previous_utxo_arg_conv = *(LDKTxOut*)(previous_utxo_arg_ptr); - previous_utxo_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(previous_utxo_arg)); - LDKInput ret_var = Input_new(outpoint_arg_conv, previous_utxo_arg_conv, satisfaction_weight_arg); +int64_t CS_LDK_RouteHint_new(int64_tArray a_arg) { + LDKCVec_RouteHintHopZ a_arg_constr; + a_arg_constr.datalen = a_arg->arr_len; + if (a_arg_constr.datalen > 0) + a_arg_constr.data = MALLOC(a_arg_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements"); + else + a_arg_constr.data = NULL; + int64_t* a_arg_vals = a_arg->elems; + for (size_t o = 0; o < a_arg_constr.datalen; o++) { + int64_t a_arg_conv_14 = a_arg_vals[o]; + LDKRouteHintHop a_arg_conv_14_conv; + a_arg_conv_14_conv.inner = untag_ptr(a_arg_conv_14); + a_arg_conv_14_conv.is_owned = ptr_is_owned(a_arg_conv_14); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_arg_conv_14_conv); + a_arg_conv_14_conv = RouteHintHop_clone(&a_arg_conv_14_conv); + a_arg_constr.data[o] = a_arg_conv_14_conv; + } + FREE(a_arg); + LDKRouteHint ret_var = RouteHint_new(a_arg_constr); int64_t ret_ref = 0; 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 Input_clone_ptr(LDKInput *NONNULL_PTR arg) { - LDKInput ret_var = Input_clone(arg); +static inline uint64_t RouteHint_clone_ptr(LDKRouteHint *NONNULL_PTR arg) { + LDKRouteHint ret_var = RouteHint_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_Input_clone_ptr(int64_t arg) { - LDKInput arg_conv; +int64_t CS_LDK_RouteHint_clone_ptr(int64_t arg) { + LDKRouteHint arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Input_clone_ptr(&arg_conv); + int64_t ret_conv = RouteHint_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_Input_clone(int64_t orig) { - LDKInput orig_conv; +int64_t CS_LDK_RouteHint_clone(int64_t orig) { + LDKRouteHint orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKInput ret_var = Input_clone(&orig_conv); + LDKRouteHint ret_var = RouteHint_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_Input_hash(int64_t o) { - LDKInput o_conv; +int64_t CS_LDK_RouteHint_hash(int64_t o) { + LDKRouteHint o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv.is_owned = false; - int64_t ret_conv = Input_hash(&o_conv); + int64_t ret_conv = RouteHint_hash(&o_conv); return ret_conv; } -jboolean CS_LDK_Input_eq(int64_t a, int64_t b) { - LDKInput a_conv; +jboolean CS_LDK_RouteHint_eq(int64_t a, int64_t b) { + LDKRouteHint a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKInput b_conv; + LDKRouteHint b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = Input_eq(&a_conv, &b_conv); + jboolean ret_conv = RouteHint_eq(&a_conv, &b_conv); return ret_conv; } -void CS_LDK_Utxo_free(int64_t this_obj) { - LDKUtxo this_obj_conv; +void CS_LDK_RouteHintHop_free(int64_t this_obj) { + LDKRouteHintHop this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Utxo_free(this_obj_conv); + RouteHintHop_free(this_obj_conv); } -int64_t CS_LDK_Utxo_get_outpoint(int64_t this_ptr) { - LDKUtxo this_ptr_conv; +int8_tArray CS_LDK_RouteHintHop_get_src_node_id(int64_t this_ptr) { + LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKOutPoint ret_var = Utxo_get_outpoint(&this_ptr_conv); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, RouteHintHop_get_src_node_id(&this_ptr_conv).compressed_form, 33); + return ret_arr; +} + +void CS_LDK_RouteHintHop_set_src_node_id(int64_t this_ptr, int8_tArray val) { + LDKRouteHintHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + RouteHintHop_set_src_node_id(&this_ptr_conv, val_ref); +} + +int64_t CS_LDK_RouteHintHop_get_short_channel_id(int64_t this_ptr) { + LDKRouteHintHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = RouteHintHop_get_short_channel_id(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_RouteHintHop_set_short_channel_id(int64_t this_ptr, int64_t val) { + LDKRouteHintHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + RouteHintHop_set_short_channel_id(&this_ptr_conv, val); +} + +int64_t CS_LDK_RouteHintHop_get_fees(int64_t this_ptr) { + LDKRouteHintHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKRoutingFees ret_var = RouteHintHop_get_fees(&this_ptr_conv); int64_t ret_ref = 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_Utxo_set_outpoint(int64_t this_ptr, int64_t val) { - LDKUtxo this_ptr_conv; +void CS_LDK_RouteHintHop_set_fees(int64_t this_ptr, int64_t val) { + LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKOutPoint val_conv; + LDKRoutingFees val_conv; val_conv.inner = untag_ptr(val); val_conv.is_owned = ptr_is_owned(val); CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = OutPoint_clone(&val_conv); - Utxo_set_outpoint(&this_ptr_conv, val_conv); + val_conv = RoutingFees_clone(&val_conv); + RouteHintHop_set_fees(&this_ptr_conv, val_conv); } -int64_t CS_LDK_Utxo_get_output(int64_t this_ptr) { - LDKUtxo this_ptr_conv; +int16_t CS_LDK_RouteHintHop_get_cltv_expiry_delta(int64_t this_ptr) { + LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); - *ret_ref = Utxo_get_output(&this_ptr_conv); - return tag_ptr(ret_ref, true); + int16_t ret_conv = RouteHintHop_get_cltv_expiry_delta(&this_ptr_conv); + return ret_conv; } -void CS_LDK_Utxo_set_output(int64_t this_ptr, int64_t val) { - LDKUtxo this_ptr_conv; +void CS_LDK_RouteHintHop_set_cltv_expiry_delta(int64_t this_ptr, int16_t val) { + LDKRouteHintHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + RouteHintHop_set_cltv_expiry_delta(&this_ptr_conv, val); +} + +int64_t CS_LDK_RouteHintHop_get_htlc_minimum_msat(int64_t this_ptr) { + LDKRouteHintHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = RouteHintHop_get_htlc_minimum_msat(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_RouteHintHop_set_htlc_minimum_msat(int64_t this_ptr, int64_t val) { + LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; void* val_ptr = untag_ptr(val); CHECK_ACCESS(val_ptr); - LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); - val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val)); - Utxo_set_output(&this_ptr_conv, val_conv); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + RouteHintHop_set_htlc_minimum_msat(&this_ptr_conv, val_conv); } -int64_t CS_LDK_Utxo_get_satisfaction_weight(int64_t this_ptr) { - LDKUtxo this_ptr_conv; +int64_t CS_LDK_RouteHintHop_get_htlc_maximum_msat(int64_t this_ptr) { + LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = Utxo_get_satisfaction_weight(&this_ptr_conv); - return ret_conv; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = RouteHintHop_get_htlc_maximum_msat(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_Utxo_set_satisfaction_weight(int64_t this_ptr, int64_t val) { - LDKUtxo this_ptr_conv; +void CS_LDK_RouteHintHop_set_htlc_maximum_msat(int64_t this_ptr, int64_t val) { + LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - Utxo_set_satisfaction_weight(&this_ptr_conv, val); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + RouteHintHop_set_htlc_maximum_msat(&this_ptr_conv, val_conv); } -int64_t CS_LDK_Utxo_new(int64_t outpoint_arg, int64_t output_arg, int64_t satisfaction_weight_arg) { - LDKOutPoint outpoint_arg_conv; - outpoint_arg_conv.inner = untag_ptr(outpoint_arg); - outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); - outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); - void* output_arg_ptr = untag_ptr(output_arg); - CHECK_ACCESS(output_arg_ptr); - LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr); - output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg)); - LDKUtxo ret_var = Utxo_new(outpoint_arg_conv, output_arg_conv, satisfaction_weight_arg); +int64_t CS_LDK_RouteHintHop_new(int8_tArray src_node_id_arg, int64_t short_channel_id_arg, int64_t fees_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg) { + LDKPublicKey src_node_id_arg_ref; + CHECK(src_node_id_arg->arr_len == 33); + memcpy(src_node_id_arg_ref.compressed_form, src_node_id_arg->elems, 33); FREE(src_node_id_arg); + LDKRoutingFees fees_arg_conv; + fees_arg_conv.inner = untag_ptr(fees_arg); + fees_arg_conv.is_owned = ptr_is_owned(fees_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv); + fees_arg_conv = RoutingFees_clone(&fees_arg_conv); + void* htlc_minimum_msat_arg_ptr = untag_ptr(htlc_minimum_msat_arg); + CHECK_ACCESS(htlc_minimum_msat_arg_ptr); + LDKCOption_u64Z htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_minimum_msat_arg_ptr); + htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_minimum_msat_arg)); + void* htlc_maximum_msat_arg_ptr = untag_ptr(htlc_maximum_msat_arg); + CHECK_ACCESS(htlc_maximum_msat_arg_ptr); + LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_arg_ptr); + htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_maximum_msat_arg)); + LDKRouteHintHop ret_var = RouteHintHop_new(src_node_id_arg_ref, short_channel_id_arg, fees_arg_conv, cltv_expiry_delta_arg, htlc_minimum_msat_arg_conv, htlc_maximum_msat_arg_conv); int64_t ret_ref = 0; 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 Utxo_clone_ptr(LDKUtxo *NONNULL_PTR arg) { - LDKUtxo ret_var = Utxo_clone(arg); +static inline uint64_t RouteHintHop_clone_ptr(LDKRouteHintHop *NONNULL_PTR arg) { + LDKRouteHintHop ret_var = RouteHintHop_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_Utxo_clone_ptr(int64_t arg) { - LDKUtxo arg_conv; +int64_t CS_LDK_RouteHintHop_clone_ptr(int64_t arg) { + LDKRouteHintHop arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Utxo_clone_ptr(&arg_conv); + int64_t ret_conv = RouteHintHop_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_Utxo_clone(int64_t orig) { - LDKUtxo orig_conv; +int64_t CS_LDK_RouteHintHop_clone(int64_t orig) { + LDKRouteHintHop orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKUtxo ret_var = Utxo_clone(&orig_conv); + LDKRouteHintHop ret_var = RouteHintHop_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_Utxo_hash(int64_t o) { - LDKUtxo o_conv; +int64_t CS_LDK_RouteHintHop_hash(int64_t o) { + LDKRouteHintHop o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv.is_owned = false; - int64_t ret_conv = Utxo_hash(&o_conv); + int64_t ret_conv = RouteHintHop_hash(&o_conv); return ret_conv; } -jboolean CS_LDK_Utxo_eq(int64_t a, int64_t b) { - LDKUtxo a_conv; +jboolean CS_LDK_RouteHintHop_eq(int64_t a, int64_t b) { + LDKRouteHintHop a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKUtxo b_conv; + LDKRouteHintHop b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = Utxo_eq(&a_conv, &b_conv); + jboolean ret_conv = RouteHintHop_eq(&a_conv, &b_conv); return ret_conv; } -int64_t CS_LDK_Utxo_new_p2pkh(int64_t outpoint, int64_t value, int8_tArray pubkey_hash) { - 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); - 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; - LDKUtxo ret_var = Utxo_new_p2pkh(outpoint_conv, value, pubkey_hash_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; -} - -void CS_LDK_CoinSelection_free(int64_t this_obj) { - LDKCoinSelection this_obj_conv; +void CS_LDK_UntrustedString_free(int64_t this_obj) { + LDKUntrustedString this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - CoinSelection_free(this_obj_conv); -} - -int64_tArray CS_LDK_CoinSelection_get_confirmed_utxos(int64_t this_ptr) { - LDKCoinSelection this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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_UtxoZ ret_var = CoinSelection_get_confirmed_utxos(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t g = 0; g < ret_var.datalen; g++) { - LDKUtxo ret_conv_6_var = ret_var.data[g]; - int64_t ret_conv_6_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_6_var); - ret_conv_6_ref = tag_ptr(ret_conv_6_var.inner, ret_conv_6_var.is_owned); - ret_arr_ptr[g] = ret_conv_6_ref; - } - - FREE(ret_var.data); - return ret_arr; -} - -void CS_LDK_CoinSelection_set_confirmed_utxos(int64_t this_ptr, int64_tArray val) { - LDKCoinSelection this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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_UtxoZ val_constr; - val_constr.datalen = val->arr_len; - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUtxo), "LDKCVec_UtxoZ Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = val->elems; - for (size_t g = 0; g < val_constr.datalen; g++) { - int64_t val_conv_6 = val_vals[g]; - LDKUtxo val_conv_6_conv; - val_conv_6_conv.inner = untag_ptr(val_conv_6); - val_conv_6_conv.is_owned = ptr_is_owned(val_conv_6); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_6_conv); - val_conv_6_conv = Utxo_clone(&val_conv_6_conv); - val_constr.data[g] = val_conv_6_conv; - } - FREE(val); - CoinSelection_set_confirmed_utxos(&this_ptr_conv, val_constr); + UntrustedString_free(this_obj_conv); } -int64_t CS_LDK_CoinSelection_get_change_output(int64_t this_ptr) { - LDKCoinSelection this_ptr_conv; +jstring CS_LDK_UntrustedString_get_a(int64_t this_ptr) { + LDKUntrustedString this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_TxOutZ *ret_copy = MALLOC(sizeof(LDKCOption_TxOutZ), "LDKCOption_TxOutZ"); - *ret_copy = CoinSelection_get_change_output(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKStr ret_str = UntrustedString_get_a(&this_ptr_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; } -void CS_LDK_CoinSelection_set_change_output(int64_t this_ptr, int64_t val) { - LDKCoinSelection this_ptr_conv; +void CS_LDK_UntrustedString_set_a(int64_t this_ptr, jstring val) { + LDKUntrustedString this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_TxOutZ val_conv = *(LDKCOption_TxOutZ*)(val_ptr); - val_conv = COption_TxOutZ_clone((LDKCOption_TxOutZ*)untag_ptr(val)); - CoinSelection_set_change_output(&this_ptr_conv, val_conv); + LDKStr val_conv = str_ref_to_owned_c(val); + UntrustedString_set_a(&this_ptr_conv, val_conv); } -int64_t CS_LDK_CoinSelection_new(int64_tArray confirmed_utxos_arg, int64_t change_output_arg) { - LDKCVec_UtxoZ confirmed_utxos_arg_constr; - confirmed_utxos_arg_constr.datalen = confirmed_utxos_arg->arr_len; - if (confirmed_utxos_arg_constr.datalen > 0) - confirmed_utxos_arg_constr.data = MALLOC(confirmed_utxos_arg_constr.datalen * sizeof(LDKUtxo), "LDKCVec_UtxoZ Elements"); - else - confirmed_utxos_arg_constr.data = NULL; - int64_t* confirmed_utxos_arg_vals = confirmed_utxos_arg->elems; - for (size_t g = 0; g < confirmed_utxos_arg_constr.datalen; g++) { - int64_t confirmed_utxos_arg_conv_6 = confirmed_utxos_arg_vals[g]; - LDKUtxo confirmed_utxos_arg_conv_6_conv; - confirmed_utxos_arg_conv_6_conv.inner = untag_ptr(confirmed_utxos_arg_conv_6); - confirmed_utxos_arg_conv_6_conv.is_owned = ptr_is_owned(confirmed_utxos_arg_conv_6); - CHECK_INNER_FIELD_ACCESS_OR_NULL(confirmed_utxos_arg_conv_6_conv); - confirmed_utxos_arg_conv_6_conv = Utxo_clone(&confirmed_utxos_arg_conv_6_conv); - confirmed_utxos_arg_constr.data[g] = confirmed_utxos_arg_conv_6_conv; - } - FREE(confirmed_utxos_arg); - void* change_output_arg_ptr = untag_ptr(change_output_arg); - CHECK_ACCESS(change_output_arg_ptr); - LDKCOption_TxOutZ change_output_arg_conv = *(LDKCOption_TxOutZ*)(change_output_arg_ptr); - change_output_arg_conv = COption_TxOutZ_clone((LDKCOption_TxOutZ*)untag_ptr(change_output_arg)); - LDKCoinSelection ret_var = CoinSelection_new(confirmed_utxos_arg_constr, change_output_arg_conv); +int64_t CS_LDK_UntrustedString_new(jstring a_arg) { + LDKStr a_arg_conv = str_ref_to_owned_c(a_arg); + LDKUntrustedString ret_var = UntrustedString_new(a_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 CoinSelection_clone_ptr(LDKCoinSelection *NONNULL_PTR arg) { - LDKCoinSelection ret_var = CoinSelection_clone(arg); +static inline uint64_t UntrustedString_clone_ptr(LDKUntrustedString *NONNULL_PTR arg) { + LDKUntrustedString ret_var = UntrustedString_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_CoinSelection_clone_ptr(int64_t arg) { - LDKCoinSelection arg_conv; +int64_t CS_LDK_UntrustedString_clone_ptr(int64_t arg) { + LDKUntrustedString arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = CoinSelection_clone_ptr(&arg_conv); + int64_t ret_conv = UntrustedString_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_CoinSelection_clone(int64_t orig) { - LDKCoinSelection orig_conv; +int64_t CS_LDK_UntrustedString_clone(int64_t orig) { + LDKUntrustedString orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKCoinSelection ret_var = CoinSelection_clone(&orig_conv); + LDKUntrustedString ret_var = UntrustedString_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_CoinSelectionSource_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); - LDKCoinSelectionSource this_ptr_conv = *(LDKCoinSelectionSource*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - CoinSelectionSource_free(this_ptr_conv); +jboolean CS_LDK_UntrustedString_eq(int64_t a, int64_t b) { + LDKUntrustedString a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKUntrustedString b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = UntrustedString_eq(&a_conv, &b_conv); + return ret_conv; } -void CS_LDK_WalletSource_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); - LDKWalletSource this_ptr_conv = *(LDKWalletSource*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - WalletSource_free(this_ptr_conv); +int64_t CS_LDK_UntrustedString_hash(int64_t o) { + LDKUntrustedString o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = UntrustedString_hash(&o_conv); + return ret_conv; } -void CS_LDK_Wallet_free(int64_t this_obj) { - LDKWallet this_obj_conv; +jstring CS_LDK_UntrustedString_to_str(int64_t o) { + LDKUntrustedString o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = UntrustedString_to_str(&o_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +void CS_LDK_PrintableString_free(int64_t this_obj) { + LDKPrintableString this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Wallet_free(this_obj_conv); -} - -int64_t CS_LDK_Wallet_new(int64_t source, int64_t logger) { - void* source_ptr = untag_ptr(source); - CHECK_ACCESS(source_ptr); - LDKWalletSource source_conv = *(LDKWalletSource*)(source_ptr); - if (source_conv.free == LDKWalletSource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKWalletSource_JCalls_cloned(&source_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); - } - LDKWallet ret_var = Wallet_new(source_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; + PrintableString_free(this_obj_conv); } -int64_t CS_LDK_Wallet_as_CoinSelectionSource(int64_t this_arg) { - LDKWallet this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCoinSelectionSource* ret_ret = MALLOC(sizeof(LDKCoinSelectionSource), "LDKCoinSelectionSource"); - *ret_ret = Wallet_as_CoinSelectionSource(&this_arg_conv); - return tag_ptr(ret_ret, true); +jstring CS_LDK_PrintableString_get_a(int64_t this_ptr) { + LDKPrintableString this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKStr ret_str = PrintableString_get_a(&this_ptr_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; } -void CS_LDK_BumpTransactionEventHandler_free(int64_t this_obj) { - LDKBumpTransactionEventHandler this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BumpTransactionEventHandler_free(this_obj_conv); +void CS_LDK_PrintableString_set_a(int64_t this_ptr, jstring val) { + LDKPrintableString this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKStr val_conv = str_ref_to_owned_c(val); + PrintableString_set_a(&this_ptr_conv, val_conv); } -int64_t CS_LDK_BumpTransactionEventHandler_new(int64_t broadcaster, int64_t utxo_source, int64_t signer_provider, int64_t logger) { - 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* utxo_source_ptr = untag_ptr(utxo_source); - CHECK_ACCESS(utxo_source_ptr); - LDKCoinSelectionSource utxo_source_conv = *(LDKCoinSelectionSource*)(utxo_source_ptr); - if (utxo_source_conv.free == LDKCoinSelectionSource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKCoinSelectionSource_JCalls_cloned(&utxo_source_conv); - } - void* signer_provider_ptr = untag_ptr(signer_provider); - CHECK_ACCESS(signer_provider_ptr); - LDKSignerProvider signer_provider_conv = *(LDKSignerProvider*)(signer_provider_ptr); - if (signer_provider_conv.free == LDKSignerProvider_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKSignerProvider_JCalls_cloned(&signer_provider_conv); - } - void* 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); - } - LDKBumpTransactionEventHandler ret_var = BumpTransactionEventHandler_new(broadcaster_conv, utxo_source_conv, signer_provider_conv, logger_conv); +int64_t CS_LDK_PrintableString_new(jstring a_arg) { + LDKStr a_arg_conv = str_ref_to_owned_c(a_arg); + LDKPrintableString ret_var = PrintableString_new(a_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_BumpTransactionEventHandler_handle_event(int64_t this_arg, int64_t event) { - LDKBumpTransactionEventHandler this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKBumpTransactionEvent* event_conv = (LDKBumpTransactionEvent*)untag_ptr(event); - BumpTransactionEventHandler_handle_event(&this_arg_conv, event_conv); +jstring CS_LDK_PrintableString_to_str(int64_t o) { + LDKPrintableString o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = PrintableString_to_str(&o_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; } void CS_LDK_FilesystemStore_free(int64_t this_obj) { @@ -83054,7 +88302,7 @@ int64_t CS_LDK_GossipSync_none() { return ret_ref; } -int64_t CS_LDK_BackgroundProcessor_start(int64_t persister, int64_t event_handler, int64_t chain_monitor, int64_t channel_manager, int64_t gossip_sync, int64_t peer_manager, int64_t logger, int64_t scorer) { +int64_t CS_LDK_BackgroundProcessor_start(int64_t persister, int64_t event_handler, int64_t chain_monitor, int64_t channel_manager, int64_t onion_messenger, int64_t gossip_sync, int64_t peer_manager, int64_t logger, int64_t scorer) { void* persister_ptr = untag_ptr(persister); CHECK_ACCESS(persister_ptr); LDKPersister persister_conv = *(LDKPersister*)(persister_ptr); @@ -83079,6 +88327,11 @@ int64_t CS_LDK_BackgroundProcessor_start(int64_t persister, int64_t event_handl 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; + LDKOnionMessenger onion_messenger_conv; + onion_messenger_conv.inner = untag_ptr(onion_messenger); + onion_messenger_conv.is_owned = ptr_is_owned(onion_messenger); + CHECK_INNER_FIELD_ACCESS_OR_NULL(onion_messenger_conv); + onion_messenger_conv.is_owned = false; void* gossip_sync_ptr = untag_ptr(gossip_sync); CHECK_ACCESS(gossip_sync_ptr); LDKGossipSync gossip_sync_conv = *(LDKGossipSync*)(gossip_sync_ptr); @@ -83106,7 +88359,7 @@ int64_t CS_LDK_BackgroundProcessor_start(int64_t persister, int64_t event_handl LDKWriteableScore_JCalls_cloned(&scorer_conv.some); } } - LDKBackgroundProcessor ret_var = BackgroundProcessor_start(persister_conv, event_handler_conv, &chain_monitor_conv, &channel_manager_conv, gossip_sync_conv, &peer_manager_conv, logger_conv, scorer_conv); + LDKBackgroundProcessor ret_var = BackgroundProcessor_start(persister_conv, event_handler_conv, &chain_monitor_conv, &channel_manager_conv, &onion_messenger_conv, gossip_sync_conv, &peer_manager_conv, logger_conv, scorer_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -84290,6 +89543,40 @@ void CS_LDK_Bolt11InvoiceSignature_free(int64_t this_obj) { Bolt11InvoiceSignature_free(this_obj_conv); } +int8_tArray CS_LDK_Bolt11InvoiceSignature_get_a(int64_t this_ptr) { + LDKBolt11InvoiceSignature this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(68, __LINE__); + memcpy(ret_arr->elems, Bolt11InvoiceSignature_get_a(&this_ptr_conv).serialized_form, 68); + return ret_arr; +} + +void CS_LDK_Bolt11InvoiceSignature_set_a(int64_t this_ptr, int8_tArray val) { + LDKBolt11InvoiceSignature this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKRecoverableSignature val_ref; + CHECK(val->arr_len == 68); + memcpy(val_ref.serialized_form, val->elems, 68); FREE(val); + Bolt11InvoiceSignature_set_a(&this_ptr_conv, val_ref); +} + +int64_t CS_LDK_Bolt11InvoiceSignature_new(int8_tArray a_arg) { + LDKRecoverableSignature a_arg_ref; + CHECK(a_arg->arr_len == 68); + memcpy(a_arg_ref.serialized_form, a_arg->elems, 68); FREE(a_arg); + LDKBolt11InvoiceSignature ret_var = Bolt11InvoiceSignature_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 Bolt11InvoiceSignature_clone_ptr(LDKBolt11InvoiceSignature *NONNULL_PTR arg) { LDKBolt11InvoiceSignature ret_var = Bolt11InvoiceSignature_clone(arg); int64_t ret_ref = 0; @@ -85020,6 +90307,19 @@ int64_t CS_LDK_Description_into_inner(int64_t this_arg) { return ret_ref; } +int64_t CS_LDK_Description_as_inner(int64_t this_arg) { + LDKDescription this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKUntrustedString ret_var = Description_as_inner(&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; +} + jstring CS_LDK_Description_to_str(int64_t o) { LDKDescription o_conv; o_conv.inner = untag_ptr(o); @@ -85273,334 +90573,6 @@ jstring CS_LDK_SignOrCreationError_to_str(int64_t o) { return ret_conv; } -int64_t CS_LDK_payment_parameters_from_zero_amount_invoice(int64_t invoice, int64_t amount_msat) { - LDKBolt11Invoice invoice_conv; - invoice_conv.inner = untag_ptr(invoice); - invoice_conv.is_owned = ptr_is_owned(invoice); - CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); - invoice_conv.is_owned = false; - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); - *ret_conv = payment_parameters_from_zero_amount_invoice(&invoice_conv, amount_msat); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_payment_parameters_from_invoice(int64_t invoice) { - LDKBolt11Invoice invoice_conv; - invoice_conv.inner = untag_ptr(invoice); - invoice_conv.is_owned = ptr_is_owned(invoice); - CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); - invoice_conv.is_owned = false; - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); - *ret_conv = payment_parameters_from_invoice(&invoice_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_create_phantom_invoice(int64_t amt_msat, int64_t payment_hash, jstring description, int32_t invoice_expiry_delta_secs, int64_tArray phantom_route_hints, int64_t entropy_source, int64_t node_signer, int64_t logger, int32_t network, int64_t min_final_cltv_expiry_delta, int64_t duration_since_epoch) { - void* amt_msat_ptr = untag_ptr(amt_msat); - CHECK_ACCESS(amt_msat_ptr); - LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); - amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); - void* payment_hash_ptr = untag_ptr(payment_hash); - CHECK_ACCESS(payment_hash_ptr); - LDKCOption_ThirtyTwoBytesZ payment_hash_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_ptr); - payment_hash_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash)); - LDKStr description_conv = str_ref_to_owned_c(description); - LDKCVec_PhantomRouteHintsZ phantom_route_hints_constr; - phantom_route_hints_constr.datalen = phantom_route_hints->arr_len; - if (phantom_route_hints_constr.datalen > 0) - phantom_route_hints_constr.data = MALLOC(phantom_route_hints_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements"); - else - phantom_route_hints_constr.data = NULL; - int64_t* phantom_route_hints_vals = phantom_route_hints->elems; - for (size_t t = 0; t < phantom_route_hints_constr.datalen; t++) { - int64_t phantom_route_hints_conv_19 = phantom_route_hints_vals[t]; - LDKPhantomRouteHints phantom_route_hints_conv_19_conv; - phantom_route_hints_conv_19_conv.inner = untag_ptr(phantom_route_hints_conv_19); - phantom_route_hints_conv_19_conv.is_owned = ptr_is_owned(phantom_route_hints_conv_19); - CHECK_INNER_FIELD_ACCESS_OR_NULL(phantom_route_hints_conv_19_conv); - phantom_route_hints_conv_19_conv = PhantomRouteHints_clone(&phantom_route_hints_conv_19_conv); - phantom_route_hints_constr.data[t] = phantom_route_hints_conv_19_conv; - } - FREE(phantom_route_hints); - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKCurrency network_conv = LDKCurrency_from_cs(network); - void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); - CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); - LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); - min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = create_phantom_invoice(amt_msat_conv, payment_hash_conv, description_conv, invoice_expiry_delta_secs, phantom_route_hints_constr, entropy_source_conv, node_signer_conv, logger_conv, network_conv, min_final_cltv_expiry_delta_conv, duration_since_epoch); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_create_phantom_invoice_with_description_hash(int64_t amt_msat, int64_t payment_hash, int32_t invoice_expiry_delta_secs, int64_t description_hash, int64_tArray phantom_route_hints, int64_t entropy_source, int64_t node_signer, int64_t logger, int32_t network, int64_t min_final_cltv_expiry_delta, int64_t duration_since_epoch) { - void* amt_msat_ptr = untag_ptr(amt_msat); - CHECK_ACCESS(amt_msat_ptr); - LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); - amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); - void* payment_hash_ptr = untag_ptr(payment_hash); - CHECK_ACCESS(payment_hash_ptr); - LDKCOption_ThirtyTwoBytesZ payment_hash_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_ptr); - payment_hash_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash)); - LDKSha256 description_hash_conv; - description_hash_conv.inner = untag_ptr(description_hash); - description_hash_conv.is_owned = ptr_is_owned(description_hash); - CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv); - description_hash_conv = Sha256_clone(&description_hash_conv); - LDKCVec_PhantomRouteHintsZ phantom_route_hints_constr; - phantom_route_hints_constr.datalen = phantom_route_hints->arr_len; - if (phantom_route_hints_constr.datalen > 0) - phantom_route_hints_constr.data = MALLOC(phantom_route_hints_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements"); - else - phantom_route_hints_constr.data = NULL; - int64_t* phantom_route_hints_vals = phantom_route_hints->elems; - for (size_t t = 0; t < phantom_route_hints_constr.datalen; t++) { - int64_t phantom_route_hints_conv_19 = phantom_route_hints_vals[t]; - LDKPhantomRouteHints phantom_route_hints_conv_19_conv; - phantom_route_hints_conv_19_conv.inner = untag_ptr(phantom_route_hints_conv_19); - phantom_route_hints_conv_19_conv.is_owned = ptr_is_owned(phantom_route_hints_conv_19); - CHECK_INNER_FIELD_ACCESS_OR_NULL(phantom_route_hints_conv_19_conv); - phantom_route_hints_conv_19_conv = PhantomRouteHints_clone(&phantom_route_hints_conv_19_conv); - phantom_route_hints_constr.data[t] = phantom_route_hints_conv_19_conv; - } - FREE(phantom_route_hints); - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKCurrency network_conv = LDKCurrency_from_cs(network); - void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); - CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); - LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); - min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = create_phantom_invoice_with_description_hash(amt_msat_conv, payment_hash_conv, invoice_expiry_delta_secs, description_hash_conv, phantom_route_hints_constr, entropy_source_conv, node_signer_conv, logger_conv, network_conv, min_final_cltv_expiry_delta_conv, duration_since_epoch); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_create_invoice_from_channelmanager(int64_t channelmanager, int64_t node_signer, int64_t logger, int32_t network, int64_t amt_msat, jstring description, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { - LDKChannelManager channelmanager_conv; - channelmanager_conv.inner = untag_ptr(channelmanager); - channelmanager_conv.is_owned = ptr_is_owned(channelmanager); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); - channelmanager_conv.is_owned = false; - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKCurrency network_conv = LDKCurrency_from_cs(network); - void* amt_msat_ptr = untag_ptr(amt_msat); - CHECK_ACCESS(amt_msat_ptr); - LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); - amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); - LDKStr description_conv = str_ref_to_owned_c(description); - void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); - CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); - LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); - min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = create_invoice_from_channelmanager(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_conv, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_create_invoice_from_channelmanager_with_description_hash(int64_t channelmanager, int64_t node_signer, int64_t logger, int32_t network, int64_t amt_msat, int64_t description_hash, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { - LDKChannelManager channelmanager_conv; - channelmanager_conv.inner = untag_ptr(channelmanager); - channelmanager_conv.is_owned = ptr_is_owned(channelmanager); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); - channelmanager_conv.is_owned = false; - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKCurrency network_conv = LDKCurrency_from_cs(network); - void* amt_msat_ptr = untag_ptr(amt_msat); - CHECK_ACCESS(amt_msat_ptr); - LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); - amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); - LDKSha256 description_hash_conv; - description_hash_conv.inner = untag_ptr(description_hash); - description_hash_conv.is_owned = ptr_is_owned(description_hash); - CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv); - description_hash_conv = Sha256_clone(&description_hash_conv); - void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); - CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); - LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); - min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = create_invoice_from_channelmanager_with_description_hash(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_hash_conv, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(int64_t channelmanager, int64_t node_signer, int64_t logger, int32_t network, int64_t amt_msat, int64_t description_hash, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { - LDKChannelManager channelmanager_conv; - channelmanager_conv.inner = untag_ptr(channelmanager); - channelmanager_conv.is_owned = ptr_is_owned(channelmanager); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); - channelmanager_conv.is_owned = false; - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKCurrency network_conv = LDKCurrency_from_cs(network); - void* amt_msat_ptr = untag_ptr(amt_msat); - CHECK_ACCESS(amt_msat_ptr); - LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); - amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); - LDKSha256 description_hash_conv; - description_hash_conv.inner = untag_ptr(description_hash); - description_hash_conv.is_owned = ptr_is_owned(description_hash); - CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv); - description_hash_conv = Sha256_clone(&description_hash_conv); - void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); - CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); - LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); - min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_hash_conv, duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_create_invoice_from_channelmanager_and_duration_since_epoch(int64_t channelmanager, int64_t node_signer, int64_t logger, int32_t network, int64_t amt_msat, jstring description, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { - LDKChannelManager channelmanager_conv; - channelmanager_conv.inner = untag_ptr(channelmanager); - channelmanager_conv.is_owned = ptr_is_owned(channelmanager); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); - channelmanager_conv.is_owned = false; - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKCurrency network_conv = LDKCurrency_from_cs(network); - void* amt_msat_ptr = untag_ptr(amt_msat); - CHECK_ACCESS(amt_msat_ptr); - LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); - amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); - LDKStr description_conv = str_ref_to_owned_c(description); - void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); - CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); - LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); - min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = create_invoice_from_channelmanager_and_duration_since_epoch(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_conv, duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(int64_t channelmanager, int64_t node_signer, int64_t logger, int32_t network, int64_t amt_msat, jstring description, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs, int8_tArray payment_hash, int64_t min_final_cltv_expiry_delta) { - LDKChannelManager channelmanager_conv; - channelmanager_conv.inner = untag_ptr(channelmanager); - channelmanager_conv.is_owned = ptr_is_owned(channelmanager); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); - channelmanager_conv.is_owned = false; - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKCurrency network_conv = LDKCurrency_from_cs(network); - void* amt_msat_ptr = untag_ptr(amt_msat); - CHECK_ACCESS(amt_msat_ptr); - LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); - amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); - LDKStr description_conv = str_ref_to_owned_c(description); - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); - CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); - LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); - min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_conv, duration_since_epoch, invoice_expiry_delta_secs, payment_hash_ref, min_final_cltv_expiry_delta_conv); - return tag_ptr(ret_conv, true); -} - int64_t CS_LDK_SiPrefix_from_str(jstring s) { LDKStr s_conv = str_ref_to_owned_c(s); LDKCResult_SiPrefixBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixBolt11ParseErrorZ), "LDKCResult_SiPrefixBolt11ParseErrorZ"); diff --git a/c_sharp/bindings.c.body b/c_sharp/bindings.c.body index e50bf7d1..224be092 100644 --- a/c_sharp/bindings.c.body +++ b/c_sharp/bindings.c.body @@ -180,10 +180,10 @@ int CS_LDK_register_l_Recipientll_invoker(invoker_l_Recipientll invoker) { return 0; } -typedef int64_t (*invoker_l_llRecipient)(int obj_ptr, int fn_id, int64_t a, int64_t b, int32_t c); -static invoker_l_llRecipient js_invoke_function_l_llRecipient; -int CS_LDK_register_l_llRecipient_invoker(invoker_l_llRecipient invoker) { - js_invoke_function_l_llRecipient = invoker; +typedef int64_t (*invoker_l_lRecipient)(int obj_ptr, int fn_id, int64_t a, int32_t b); +static invoker_l_lRecipient js_invoke_function_l_lRecipient; +int CS_LDK_register_l_lRecipient_invoker(invoker_l_lRecipient invoker) { + js_invoke_function_l_lRecipient = invoker; return 0; } @@ -236,13 +236,6 @@ int CS_LDK_register_ChannelMonitorUpdateStatus_lll_invoker(invoker_ChannelMonito return 0; } -typedef int32_t (*invoker_ChannelMonitorUpdateStatus_llll)(int obj_ptr, int fn_id, int64_t a, int64_t b, int64_t c, int64_t d); -static invoker_ChannelMonitorUpdateStatus_llll js_invoke_function_ChannelMonitorUpdateStatus_llll; -int CS_LDK_register_ChannelMonitorUpdateStatus_llll_invoker(invoker_ChannelMonitorUpdateStatus_llll invoker) { - js_invoke_function_ChannelMonitorUpdateStatus_llll = 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) { @@ -362,6 +355,24 @@ static inline uint64_t tag_ptr(const void* ptr, bool is_owned) { } } +static inline LDKBalanceSource LDKBalanceSource_from_cs(int32_t ord) { + switch (ord) { + case 0: return LDKBalanceSource_HolderForceClosed; + case 1: return LDKBalanceSource_CounterpartyForceClosed; + case 2: return LDKBalanceSource_CoopClose; + case 3: return LDKBalanceSource_Htlc; + default: abort(); + } +} +static inline int32_t LDKBalanceSource_to_cs(LDKBalanceSource val) { + switch (val) { + case LDKBalanceSource_HolderForceClosed: return 0; + case LDKBalanceSource_CounterpartyForceClosed: return 1; + case LDKBalanceSource_CoopClose: return 2; + case LDKBalanceSource_Htlc: return 3; + default: abort(); + } +} static inline LDKBlindedFailure LDKBlindedFailure_from_cs(int32_t ord) { switch (ord) { case 0: return LDKBlindedFailure_FromIntroductionNode; @@ -435,7 +446,8 @@ static inline LDKBolt12SemanticError LDKBolt12SemanticError_from_cs(int32_t ord) case 24: return LDKBolt12SemanticError_InvalidPayInfo; case 25: return LDKBolt12SemanticError_MissingCreationTime; case 26: return LDKBolt12SemanticError_MissingPaymentHash; - case 27: return LDKBolt12SemanticError_MissingSignature; + case 27: return LDKBolt12SemanticError_UnexpectedPaymentHash; + case 28: return LDKBolt12SemanticError_MissingSignature; default: abort(); } } @@ -468,7 +480,8 @@ static inline int32_t LDKBolt12SemanticError_to_cs(LDKBolt12SemanticError val) { case LDKBolt12SemanticError_InvalidPayInfo: return 24; case LDKBolt12SemanticError_MissingCreationTime: return 25; case LDKBolt12SemanticError_MissingPaymentHash: return 26; - case LDKBolt12SemanticError_MissingSignature: return 27; + case LDKBolt12SemanticError_UnexpectedPaymentHash: return 27; + case LDKBolt12SemanticError_MissingSignature: return 28; default: abort(); } } @@ -524,25 +537,27 @@ static inline int32_t LDKChannelShutdownState_to_cs(LDKChannelShutdownState val) } static inline LDKConfirmationTarget LDKConfirmationTarget_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKConfirmationTarget_OnChainSweep; - case 1: return LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee; - case 2: return LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee; - case 3: return LDKConfirmationTarget_AnchorChannelFee; - case 4: return LDKConfirmationTarget_NonAnchorChannelFee; - case 5: return LDKConfirmationTarget_ChannelCloseMinimum; - case 6: return LDKConfirmationTarget_OutputSpendingFee; + case 0: return LDKConfirmationTarget_MaximumFeeEstimate; + case 1: return LDKConfirmationTarget_UrgentOnChainSweep; + case 2: return LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee; + case 3: return LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee; + case 4: return LDKConfirmationTarget_AnchorChannelFee; + case 5: return LDKConfirmationTarget_NonAnchorChannelFee; + case 6: return LDKConfirmationTarget_ChannelCloseMinimum; + case 7: return LDKConfirmationTarget_OutputSpendingFee; default: abort(); } } static inline int32_t LDKConfirmationTarget_to_cs(LDKConfirmationTarget val) { switch (val) { - case LDKConfirmationTarget_OnChainSweep: return 0; - case LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee: return 1; - case LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee: return 2; - case LDKConfirmationTarget_AnchorChannelFee: return 3; - case LDKConfirmationTarget_NonAnchorChannelFee: return 4; - case LDKConfirmationTarget_ChannelCloseMinimum: return 5; - case LDKConfirmationTarget_OutputSpendingFee: return 6; + case LDKConfirmationTarget_MaximumFeeEstimate: return 0; + case LDKConfirmationTarget_UrgentOnChainSweep: return 1; + case LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee: return 2; + case LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee: return 3; + case LDKConfirmationTarget_AnchorChannelFee: return 4; + case LDKConfirmationTarget_NonAnchorChannelFee: return 5; + case LDKConfirmationTarget_ChannelCloseMinimum: return 6; + case LDKConfirmationTarget_OutputSpendingFee: return 7; default: abort(); } } @@ -752,6 +767,9 @@ static inline LDKPaymentFailureReason LDKPaymentFailureReason_from_cs(int32_t or case 3: return LDKPaymentFailureReason_PaymentExpired; case 4: return LDKPaymentFailureReason_RouteNotFound; case 5: return LDKPaymentFailureReason_UnexpectedError; + case 6: return LDKPaymentFailureReason_UnknownRequiredFeatures; + case 7: return LDKPaymentFailureReason_InvoiceRequestExpired; + case 8: return LDKPaymentFailureReason_InvoiceRequestRejected; default: abort(); } } @@ -763,6 +781,9 @@ static inline int32_t LDKPaymentFailureReason_to_cs(LDKPaymentFailureReason val) case LDKPaymentFailureReason_PaymentExpired: return 3; case LDKPaymentFailureReason_RouteNotFound: return 4; case LDKPaymentFailureReason_UnexpectedError: return 5; + case LDKPaymentFailureReason_UnknownRequiredFeatures: return 6; + case LDKPaymentFailureReason_InvoiceRequestExpired: return 7; + case LDKPaymentFailureReason_InvoiceRequestRejected: return 8; default: abort(); } } @@ -785,6 +806,7 @@ static inline LDKRetryableSendFailure LDKRetryableSendFailure_from_cs(int32_t or case 0: return LDKRetryableSendFailure_PaymentExpired; case 1: return LDKRetryableSendFailure_RouteNotFound; case 2: return LDKRetryableSendFailure_DuplicatePayment; + case 3: return LDKRetryableSendFailure_OnionPacketSizeExceeded; default: abort(); } } @@ -793,6 +815,7 @@ static inline int32_t LDKRetryableSendFailure_to_cs(LDKRetryableSendFailure val) case LDKRetryableSendFailure_PaymentExpired: return 0; case LDKRetryableSendFailure_RouteNotFound: return 1; case LDKRetryableSendFailure_DuplicatePayment: return 2; + case LDKRetryableSendFailure_OnionPacketSizeExceeded: return 3; default: abort(); } } @@ -809,6 +832,7 @@ static inline LDKSecp256k1Error LDKSecp256k1Error_from_cs(int32_t ord) { case 8: return LDKSecp256k1Error_NotEnoughMemory; case 9: return LDKSecp256k1Error_InvalidPublicKeySum; case 10: return LDKSecp256k1Error_InvalidParityValue; + case 11: return LDKSecp256k1Error_InvalidEllSwift; default: abort(); } } @@ -825,6 +849,7 @@ static inline int32_t LDKSecp256k1Error_to_cs(LDKSecp256k1Error val) { case LDKSecp256k1Error_NotEnoughMemory: return 8; case LDKSecp256k1Error_InvalidPublicKeySum: return 9; case LDKSecp256k1Error_InvalidParityValue: return 10; + case LDKSecp256k1Error_InvalidEllSwift: return 11; default: abort(); } } @@ -1007,13 +1032,59 @@ int64_t CS_LDK_LDKCOption_u64Z_Some_get_some(int64_t ptr) { int64_t some_conv = obj->some; return some_conv; } -static inline LDKCVec_BlindedPathZ CVec_BlindedPathZ_clone(const LDKCVec_BlindedPathZ *orig) { - LDKCVec_BlindedPathZ ret = { .data = MALLOC(sizeof(LDKBlindedPath) * orig->datalen, "LDKCVec_BlindedPathZ clone bytes"), .datalen = orig->datalen }; +static inline LDKCVec_BlindedMessagePathZ CVec_BlindedMessagePathZ_clone(const LDKCVec_BlindedMessagePathZ *orig) { + LDKCVec_BlindedMessagePathZ ret = { .data = MALLOC(sizeof(LDKBlindedMessagePath) * orig->datalen, "LDKCVec_BlindedMessagePathZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = BlindedPath_clone(&orig->data[i]); + ret.data[i] = BlindedMessagePath_clone(&orig->data[i]); + } + return ret; +} +uint32_t CS_LDK_LDKDecodeError_ty_from_ptr(int64_t ptr) { + LDKDecodeError *obj = (LDKDecodeError*)untag_ptr(ptr); + switch(obj->tag) { + case LDKDecodeError_UnknownVersion: return 0; + case LDKDecodeError_UnknownRequiredFeature: return 1; + case LDKDecodeError_InvalidValue: return 2; + case LDKDecodeError_ShortRead: return 3; + case LDKDecodeError_BadLengthDescriptor: return 4; + case LDKDecodeError_Io: return 5; + case LDKDecodeError_UnsupportedCompression: return 6; + case LDKDecodeError_DangerousValue: return 7; + default: abort(); } +} +int32_t CS_LDK_LDKDecodeError_Io_get_io(int64_t ptr) { + LDKDecodeError *obj = (LDKDecodeError*)untag_ptr(ptr); + CHECK(obj->tag == LDKDecodeError_Io); + int32_t io_conv = LDKIOError_to_cs(obj->io); + return io_conv; +} +static inline struct LDKRefund CResult_RefundDecodeErrorZ_get_ok(LDKCResult_RefundDecodeErrorZ *NONNULL_PTR owner){ + LDKRefund ret = *owner->contents.result; + ret.is_owned = false; return ret; } +int64_t CS_LDK_CResult_RefundDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_RefundDecodeErrorZ* owner_conv = (LDKCResult_RefundDecodeErrorZ*)untag_ptr(owner); + LDKRefund ret_var = CResult_RefundDecodeErrorZ_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_RefundDecodeErrorZ_get_err(LDKCResult_RefundDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_RefundDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_RefundDecodeErrorZ* owner_conv = (LDKCResult_RefundDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_RefundDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline struct LDKRefund CResult_RefundBolt12ParseErrorZ_get_ok(LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR owner){ LDKRefund ret = *owner->contents.result; ret.is_owned = false; @@ -1062,26 +1133,6 @@ int64_t CS_LDK_LDKRetry_Timeout_get_timeout(int64_t ptr) { int64_t timeout_conv = obj->timeout; return timeout_conv; } -uint32_t CS_LDK_LDKDecodeError_ty_from_ptr(int64_t ptr) { - LDKDecodeError *obj = (LDKDecodeError*)untag_ptr(ptr); - switch(obj->tag) { - case LDKDecodeError_UnknownVersion: return 0; - case LDKDecodeError_UnknownRequiredFeature: return 1; - case LDKDecodeError_InvalidValue: return 2; - case LDKDecodeError_ShortRead: return 3; - case LDKDecodeError_BadLengthDescriptor: return 4; - case LDKDecodeError_Io: return 5; - case LDKDecodeError_UnsupportedCompression: return 6; - case LDKDecodeError_DangerousValue: return 7; - default: abort(); - } -} -int32_t CS_LDK_LDKDecodeError_Io_get_io(int64_t ptr) { - LDKDecodeError *obj = (LDKDecodeError*)untag_ptr(ptr); - CHECK(obj->tag == LDKDecodeError_Io); - int32_t io_conv = LDKIOError_to_cs(obj->io); - return io_conv; -} static inline struct LDKRetry CResult_RetryDecodeErrorZ_get_ok(LDKCResult_RetryDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return Retry_clone(&*owner->contents.result); @@ -1492,28 +1543,28 @@ void CS_LDK_CResult_ThirtyTwoBytesNoneZ_get_err(int64_t owner) { CResult_ThirtyTwoBytesNoneZ_get_err(owner_conv); } -static inline struct LDKBlindedPayInfo CResult_BlindedPayInfoDecodeErrorZ_get_ok(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR owner){ - LDKBlindedPayInfo ret = *owner->contents.result; +static inline struct LDKBolt12Invoice CResult_Bolt12InvoiceDecodeErrorZ_get_ok(LDKCResult_Bolt12InvoiceDecodeErrorZ *NONNULL_PTR owner){ + LDKBolt12Invoice ret = *owner->contents.result; ret.is_owned = false; return ret; } -int64_t CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_get_ok(int64_t owner) { - LDKCResult_BlindedPayInfoDecodeErrorZ* owner_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(owner); - LDKBlindedPayInfo ret_var = CResult_BlindedPayInfoDecodeErrorZ_get_ok(owner_conv); +int64_t CS_LDK_CResult_Bolt12InvoiceDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_Bolt12InvoiceDecodeErrorZ* owner_conv = (LDKCResult_Bolt12InvoiceDecodeErrorZ*)untag_ptr(owner); + LDKBolt12Invoice ret_var = CResult_Bolt12InvoiceDecodeErrorZ_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_BlindedPayInfoDecodeErrorZ_get_err(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_Bolt12InvoiceDecodeErrorZ_get_err(LDKCResult_Bolt12InvoiceDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return DecodeError_clone(&*owner->contents.err); } -int64_t CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_get_err(int64_t owner) { - LDKCResult_BlindedPayInfoDecodeErrorZ* owner_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(owner); +int64_t CS_LDK_CResult_Bolt12InvoiceDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_Bolt12InvoiceDecodeErrorZ* owner_conv = (LDKCResult_Bolt12InvoiceDecodeErrorZ*)untag_ptr(owner); LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_BlindedPayInfoDecodeErrorZ_get_err(owner_conv); + *ret_copy = CResult_Bolt12InvoiceDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -1764,24 +1815,6 @@ int64_t CS_LDK_CResult_HTLCDescriptorDecodeErrorZ_get_err(int64_t owner) { return ret_ref; } -static inline void CResult_NoneNoneZ_get_ok(LDKCResult_NoneNoneZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -void CS_LDK_CResult_NoneNoneZ_get_ok(int64_t owner) { - LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner); - CResult_NoneNoneZ_get_ok(owner_conv); -} - -static inline void CResult_NoneNoneZ_get_err(LDKCResult_NoneNoneZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; -} -void CS_LDK_CResult_NoneNoneZ_get_err(int64_t owner) { - LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner); - CResult_NoneNoneZ_get_err(owner_conv); -} - static inline struct LDKPublicKey CResult_PublicKeyNoneZ_get_ok(LDKCResult_PublicKeyNoneZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return *owner->contents.result; @@ -1802,6 +1835,44 @@ void CS_LDK_CResult_PublicKeyNoneZ_get_err(int64_t owner) { CResult_PublicKeyNoneZ_get_err(owner_conv); } +static inline struct LDKThirtyTwoBytes CResult__u832NoneZ_get_ok(LDKCResult__u832NoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return ThirtyTwoBytes_clone(&*owner->contents.result); +} +int8_tArray CS_LDK_CResult__u832NoneZ_get_ok(int64_t owner) { + LDKCResult__u832NoneZ* owner_conv = (LDKCResult__u832NoneZ*)untag_ptr(owner); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, CResult__u832NoneZ_get_ok(owner_conv).data, 32); + return ret_arr; +} + +static inline void CResult__u832NoneZ_get_err(LDKCResult__u832NoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +void CS_LDK_CResult__u832NoneZ_get_err(int64_t owner) { + LDKCResult__u832NoneZ* owner_conv = (LDKCResult__u832NoneZ*)untag_ptr(owner); + CResult__u832NoneZ_get_err(owner_conv); +} + +static inline void CResult_NoneNoneZ_get_ok(LDKCResult_NoneNoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; +} +void CS_LDK_CResult_NoneNoneZ_get_ok(int64_t owner) { + LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner); + CResult_NoneNoneZ_get_ok(owner_conv); +} + +static inline void CResult_NoneNoneZ_get_err(LDKCResult_NoneNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +void CS_LDK_CResult_NoneNoneZ_get_err(int64_t owner) { + LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner); + CResult_NoneNoneZ_get_err(owner_conv); +} + uint32_t CS_LDK_LDKCOption_BigEndianScalarZ_ty_from_ptr(int64_t ptr) { LDKCOption_BigEndianScalarZ *obj = (LDKCOption_BigEndianScalarZ*)untag_ptr(ptr); switch(obj->tag) { @@ -1935,23 +2006,25 @@ static void LDKChannelSigner_JCalls_free(void* this_arg) { FREE(j_calls); } } -LDKPublicKey get_per_commitment_point_LDKChannelSigner_jcall(const void* this_arg, uint64_t idx) { +LDKCResult_PublicKeyNoneZ get_per_commitment_point_LDKChannelSigner_jcall(const void* this_arg, uint64_t idx) { LDKChannelSigner_JCalls *j_calls = (LDKChannelSigner_JCalls*) this_arg; int64_t idx_conv = idx; - int8_tArray ret = (int8_tArray)js_invoke_function_l_l(j_calls->instance_ptr, 0, idx_conv); - LDKPublicKey ret_ref; - CHECK(ret->arr_len == 33); - memcpy(ret_ref.compressed_form, ret->elems, 33); FREE(ret); - return ret_ref; + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 0, idx_conv); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_PublicKeyNoneZ ret_conv = *(LDKCResult_PublicKeyNoneZ*)(ret_ptr); + FREE(untag_ptr(ret)); + return ret_conv; } -LDKThirtyTwoBytes release_commitment_secret_LDKChannelSigner_jcall(const void* this_arg, uint64_t idx) { +LDKCResult__u832NoneZ release_commitment_secret_LDKChannelSigner_jcall(const void* this_arg, uint64_t idx) { LDKChannelSigner_JCalls *j_calls = (LDKChannelSigner_JCalls*) this_arg; int64_t idx_conv = idx; - int8_tArray ret = (int8_tArray)js_invoke_function_l_l(j_calls->instance_ptr, 1, idx_conv); - LDKThirtyTwoBytes ret_ref; - CHECK(ret->arr_len == 32); - memcpy(ret_ref.data, ret->elems, 32); FREE(ret); - return ret_ref; + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 1, idx_conv); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult__u832NoneZ ret_conv = *(LDKCResult__u832NoneZ*)(ret_ptr); + FREE(untag_ptr(ret)); + return ret_conv; } LDKCResult_NoneNoneZ validate_holder_commitment_LDKChannelSigner_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * holder_tx, LDKCVec_ThirtyTwoBytesZ outbound_htlc_preimages) { LDKChannelSigner_JCalls *j_calls = (LDKChannelSigner_JCalls*) this_arg; @@ -2040,22 +2113,22 @@ uint64_t CS_LDK_LDKChannelSigner_new(int32_t o, int64_t pubkeys) { *res_ptr = LDKChannelSigner_init(o, pubkeys); return tag_ptr(res_ptr, true); } -int8_tArray CS_LDK_ChannelSigner_get_per_commitment_point(int64_t this_arg, int64_t idx) { +int64_t CS_LDK_ChannelSigner_get_per_commitment_point(int64_t this_arg, int64_t idx) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelSigner* this_arg_conv = (LDKChannelSigner*)this_arg_ptr; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, (this_arg_conv->get_per_commitment_point)(this_arg_conv->this_arg, idx).compressed_form, 33); - return ret_arr; + LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ"); + *ret_conv = (this_arg_conv->get_per_commitment_point)(this_arg_conv->this_arg, idx); + return tag_ptr(ret_conv, true); } -int8_tArray CS_LDK_ChannelSigner_release_commitment_secret(int64_t this_arg, int64_t idx) { +int64_t CS_LDK_ChannelSigner_release_commitment_secret(int64_t this_arg, int64_t idx) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelSigner* this_arg_conv = (LDKChannelSigner*)this_arg_ptr; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, (this_arg_conv->release_commitment_secret)(this_arg_conv->this_arg, idx).data, 32); - return ret_arr; + LDKCResult__u832NoneZ* ret_conv = MALLOC(sizeof(LDKCResult__u832NoneZ), "LDKCResult__u832NoneZ"); + *ret_conv = (this_arg_conv->release_commitment_secret)(this_arg_conv->this_arg, idx); + return tag_ptr(ret_conv, true); } int64_t CS_LDK_ChannelSigner_validate_holder_commitment(int64_t this_arg, int64_t holder_tx, ptrArray outbound_htlc_preimages) { @@ -2346,6 +2419,7 @@ static inline LDKEcdsaChannelSigner LDKEcdsaChannelSigner_init (int64_t o, int64 .sign_closing_transaction = sign_closing_transaction_LDKEcdsaChannelSigner_jcall, .sign_holder_anchor_input = sign_holder_anchor_input_LDKEcdsaChannelSigner_jcall, .sign_channel_announcement_with_funding_key = sign_channel_announcement_with_funding_key_LDKEcdsaChannelSigner_jcall, + .cloned = LDKEcdsaChannelSigner_JCalls_cloned, .free = LDKEcdsaChannelSigner_JCalls_free, .ChannelSigner = LDKChannelSigner_init(ChannelSigner, pubkeys), }; @@ -2539,89 +2613,25 @@ int64_t CS_LDK_EcdsaChannelSigner_sign_channel_announcement_with_funding_key(in return tag_ptr(ret_conv, true); } -typedef struct LDKWriteableEcdsaChannelSigner_JCalls { - atomic_size_t refcnt; - uint32_t instance_ptr; - LDKEcdsaChannelSigner_JCalls* EcdsaChannelSigner; - LDKChannelSigner_JCalls* ChannelSigner; -} LDKWriteableEcdsaChannelSigner_JCalls; -static void LDKWriteableEcdsaChannelSigner_JCalls_free(void* this_arg) { - LDKWriteableEcdsaChannelSigner_JCalls *j_calls = (LDKWriteableEcdsaChannelSigner_JCalls*) this_arg; - if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { - FREE(j_calls); - } -} -LDKCVec_u8Z write_LDKWriteableEcdsaChannelSigner_jcall(const void* this_arg) { - LDKWriteableEcdsaChannelSigner_JCalls *j_calls = (LDKWriteableEcdsaChannelSigner_JCalls*) this_arg; - int8_tArray ret = (int8_tArray)js_invoke_function_l_(j_calls->instance_ptr, 15); - LDKCVec_u8Z ret_ref; - ret_ref.datalen = ret->arr_len; - ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret); - return ret_ref; -} -static void LDKWriteableEcdsaChannelSigner_JCalls_cloned(LDKWriteableEcdsaChannelSigner* new_obj) { - LDKWriteableEcdsaChannelSigner_JCalls *j_calls = (LDKWriteableEcdsaChannelSigner_JCalls*) new_obj->this_arg; - atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); - atomic_fetch_add_explicit(&j_calls->EcdsaChannelSigner->refcnt, 1, memory_order_release); - atomic_fetch_add_explicit(&j_calls->EcdsaChannelSigner->ChannelSigner->refcnt, 1, memory_order_release); -} -static inline LDKWriteableEcdsaChannelSigner LDKWriteableEcdsaChannelSigner_init (int64_t o, int64_t EcdsaChannelSigner, int64_t ChannelSigner, int64_t pubkeys) { - LDKWriteableEcdsaChannelSigner_JCalls *calls = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner_JCalls), "LDKWriteableEcdsaChannelSigner_JCalls"); - atomic_init(&calls->refcnt, 1); - calls->instance_ptr = o; - - LDKChannelPublicKeys pubkeys_conv; - pubkeys_conv.inner = untag_ptr(pubkeys); - pubkeys_conv.is_owned = ptr_is_owned(pubkeys); - CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv); - - LDKWriteableEcdsaChannelSigner ret = { - .this_arg = (void*) calls, - .write = write_LDKWriteableEcdsaChannelSigner_jcall, - .cloned = LDKWriteableEcdsaChannelSigner_JCalls_cloned, - .free = LDKWriteableEcdsaChannelSigner_JCalls_free, - .EcdsaChannelSigner = LDKEcdsaChannelSigner_init(EcdsaChannelSigner, ChannelSigner, pubkeys), - }; - calls->EcdsaChannelSigner = ret.EcdsaChannelSigner.this_arg; - calls->ChannelSigner = ret.EcdsaChannelSigner.ChannelSigner.this_arg; - return ret; -} -uint64_t CS_LDK_LDKWriteableEcdsaChannelSigner_new(int32_t o, int32_t EcdsaChannelSigner, int32_t ChannelSigner, int64_t pubkeys) { - LDKWriteableEcdsaChannelSigner *res_ptr = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner"); - *res_ptr = LDKWriteableEcdsaChannelSigner_init(o, EcdsaChannelSigner, ChannelSigner, pubkeys); - return tag_ptr(res_ptr, true); -} -int8_tArray CS_LDK_WriteableEcdsaChannelSigner_write(int64_t this_arg) { - void* this_arg_ptr = untag_ptr(this_arg); - if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKWriteableEcdsaChannelSigner* this_arg_conv = (LDKWriteableEcdsaChannelSigner*)this_arg_ptr; - LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -static inline struct LDKWriteableEcdsaChannelSigner CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_ok(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKEcdsaChannelSigner CResult_EcdsaChannelSignerDecodeErrorZ_get_ok(LDKCResult_EcdsaChannelSignerDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return WriteableEcdsaChannelSigner_clone(&*owner->contents.result); + return EcdsaChannelSigner_clone(&*owner->contents.result); } -int64_t CS_LDK_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_ok(int64_t owner) { - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* owner_conv = (LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)untag_ptr(owner); - LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner"); - *ret_ret = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_ok(owner_conv); +int64_t CS_LDK_CResult_EcdsaChannelSignerDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_EcdsaChannelSignerDecodeErrorZ* owner_conv = (LDKCResult_EcdsaChannelSignerDecodeErrorZ*)untag_ptr(owner); + LDKEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner"); + *ret_ret = CResult_EcdsaChannelSignerDecodeErrorZ_get_ok(owner_conv); return tag_ptr(ret_ret, true); } -static inline struct LDKDecodeError CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_err(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_EcdsaChannelSignerDecodeErrorZ_get_err(LDKCResult_EcdsaChannelSignerDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return DecodeError_clone(&*owner->contents.err); } -int64_t CS_LDK_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_err(int64_t owner) { - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* owner_conv = (LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)untag_ptr(owner); +int64_t CS_LDK_CResult_EcdsaChannelSignerDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_EcdsaChannelSignerDecodeErrorZ* owner_conv = (LDKCResult_EcdsaChannelSignerDecodeErrorZ*)untag_ptr(owner); LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_err(owner_conv); + *ret_copy = CResult_EcdsaChannelSignerDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -2827,7 +2837,7 @@ uint64_t channel_penalty_msat_LDKScoreLookUp_jcall(const void* this_arg, const L score_params_var = ProbabilisticScoringFeeParameters_clone(&score_params_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(score_params_var); score_params_ref = tag_ptr(score_params_var.inner, score_params_var.is_owned); - return js_invoke_function_l_lll(j_calls->instance_ptr, 16, ref_candidate, usage_ref, score_params_ref); + return js_invoke_function_l_lll(j_calls->instance_ptr, 15, ref_candidate, usage_ref, score_params_ref); } static void LDKScoreLookUp_JCalls_cloned(LDKScoreLookUp* new_obj) { LDKScoreLookUp_JCalls *j_calls = (LDKScoreLookUp_JCalls*) new_obj->this_arg; @@ -2888,7 +2898,7 @@ void payment_path_failed_LDKScoreUpdate_jcall(void* this_arg, const LDKPath * pa path_ref = tag_ptr(path_var.inner, path_var.is_owned); int64_t short_channel_id_conv = short_channel_id; int64_t duration_since_epoch_conv = duration_since_epoch; - js_invoke_function_void_lll(j_calls->instance_ptr, 17, path_ref, short_channel_id_conv, duration_since_epoch_conv); + js_invoke_function_void_lll(j_calls->instance_ptr, 16, path_ref, short_channel_id_conv, duration_since_epoch_conv); } void payment_path_successful_LDKScoreUpdate_jcall(void* this_arg, const LDKPath * path, uint64_t duration_since_epoch) { LDKScoreUpdate_JCalls *j_calls = (LDKScoreUpdate_JCalls*) this_arg; @@ -2898,7 +2908,7 @@ void payment_path_successful_LDKScoreUpdate_jcall(void* this_arg, const LDKPath CHECK_INNER_FIELD_ACCESS_OR_NULL(path_var); path_ref = tag_ptr(path_var.inner, path_var.is_owned); int64_t duration_since_epoch_conv = duration_since_epoch; - js_invoke_function_void_ll(j_calls->instance_ptr, 18, path_ref, duration_since_epoch_conv); + js_invoke_function_void_ll(j_calls->instance_ptr, 17, path_ref, duration_since_epoch_conv); } void probe_failed_LDKScoreUpdate_jcall(void* this_arg, const LDKPath * path, uint64_t short_channel_id, uint64_t duration_since_epoch) { LDKScoreUpdate_JCalls *j_calls = (LDKScoreUpdate_JCalls*) this_arg; @@ -2909,7 +2919,7 @@ void probe_failed_LDKScoreUpdate_jcall(void* this_arg, const LDKPath * path, uin path_ref = tag_ptr(path_var.inner, path_var.is_owned); int64_t short_channel_id_conv = short_channel_id; int64_t duration_since_epoch_conv = duration_since_epoch; - js_invoke_function_void_lll(j_calls->instance_ptr, 19, path_ref, short_channel_id_conv, duration_since_epoch_conv); + js_invoke_function_void_lll(j_calls->instance_ptr, 18, path_ref, short_channel_id_conv, duration_since_epoch_conv); } void probe_successful_LDKScoreUpdate_jcall(void* this_arg, const LDKPath * path, uint64_t duration_since_epoch) { LDKScoreUpdate_JCalls *j_calls = (LDKScoreUpdate_JCalls*) this_arg; @@ -2919,12 +2929,12 @@ void probe_successful_LDKScoreUpdate_jcall(void* this_arg, const LDKPath * path, CHECK_INNER_FIELD_ACCESS_OR_NULL(path_var); path_ref = tag_ptr(path_var.inner, path_var.is_owned); int64_t duration_since_epoch_conv = duration_since_epoch; - js_invoke_function_void_ll(j_calls->instance_ptr, 20, path_ref, duration_since_epoch_conv); + js_invoke_function_void_ll(j_calls->instance_ptr, 19, path_ref, duration_since_epoch_conv); } void time_passed_LDKScoreUpdate_jcall(void* this_arg, uint64_t duration_since_epoch) { LDKScoreUpdate_JCalls *j_calls = (LDKScoreUpdate_JCalls*) this_arg; int64_t duration_since_epoch_conv = duration_since_epoch; - js_invoke_function_void_l(j_calls->instance_ptr, 21, duration_since_epoch_conv); + js_invoke_function_void_l(j_calls->instance_ptr, 20, duration_since_epoch_conv); } static void LDKScoreUpdate_JCalls_cloned(LDKScoreUpdate* new_obj) { LDKScoreUpdate_JCalls *j_calls = (LDKScoreUpdate_JCalls*) new_obj->this_arg; @@ -3018,7 +3028,7 @@ static void LDKLockableScore_JCalls_free(void* this_arg) { } LDKScoreLookUp read_lock_LDKLockableScore_jcall(const void* this_arg) { LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg; - uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 22); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 21); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKScoreLookUp ret_conv = *(LDKScoreLookUp*)(ret_ptr); @@ -3031,7 +3041,7 @@ LDKScoreLookUp read_lock_LDKLockableScore_jcall(const void* this_arg) { } LDKScoreUpdate write_lock_LDKLockableScore_jcall(const void* this_arg) { LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg; - uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 23); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 22); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKScoreUpdate ret_conv = *(LDKScoreUpdate*)(ret_ptr); @@ -3095,7 +3105,7 @@ static void LDKWriteableScore_JCalls_free(void* this_arg) { } LDKCVec_u8Z write_LDKWriteableScore_jcall(const void* this_arg) { LDKWriteableScore_JCalls *j_calls = (LDKWriteableScore_JCalls*) this_arg; - int8_tArray ret = (int8_tArray)js_invoke_function_l_(j_calls->instance_ptr, 24); + int8_tArray ret = (int8_tArray)js_invoke_function_l_(j_calls->instance_ptr, 23); LDKCVec_u8Z ret_ref; ret_ref.datalen = ret->arr_len; ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes"); @@ -3176,103 +3186,135 @@ int32_t CS_LDK_CResult_NoneIOErrorZ_get_err(int64_t owner) { return ret_conv; } -static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) { - LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = ChannelDetails_clone(&orig->data[i]); - } - return ret; +static inline struct LDKThirtyTwoBytes C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_a(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR owner){ + return ThirtyTwoBytes_clone(&owner->a); } -static inline struct LDKRoute CResult_RouteLightningErrorZ_get_ok(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){ - LDKRoute ret = *owner->contents.result; +int8_tArray CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_a(int64_t owner) { + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* owner_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(owner); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_a(owner_conv).data, 32); + return ret_arr; +} + +static inline struct LDKRecipientOnionFields C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_b(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR owner){ + LDKRecipientOnionFields ret = owner->b; ret.is_owned = false; return ret; } -int64_t CS_LDK_CResult_RouteLightningErrorZ_get_ok(int64_t owner) { - LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner); - LDKRoute ret_var = CResult_RouteLightningErrorZ_get_ok(owner_conv); +int64_t CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_b(int64_t owner) { + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* owner_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(owner); + LDKRecipientOnionFields ret_var = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_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 LDKLightningError CResult_RouteLightningErrorZ_get_err(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){ - LDKLightningError ret = *owner->contents.err; +static inline struct LDKRouteParameters C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_c(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR owner){ + LDKRouteParameters ret = owner->c; ret.is_owned = false; return ret; } -int64_t CS_LDK_CResult_RouteLightningErrorZ_get_err(int64_t owner) { - LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner); - LDKLightningError ret_var = CResult_RouteLightningErrorZ_get_err(owner_conv); +int64_t CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_c(int64_t owner) { + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* owner_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(owner); + LDKRouteParameters ret_var = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_c(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 LDKBlindedPayInfo C2Tuple_BlindedPayInfoBlindedPathZ_get_a(LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR owner){ - LDKBlindedPayInfo ret = owner->a; +static inline struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_ok(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(&*owner->contents.result); +} +int64_t CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_ok(int64_t owner) { + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* owner_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(owner); + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ), "LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ"); + *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_ok(owner_conv); + return tag_ptr(ret_conv, true); +} + +static inline void CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_err(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +void CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_err(int64_t owner) { + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* owner_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(owner); + CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_err(owner_conv); +} + +static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) { + LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = ChannelDetails_clone(&orig->data[i]); + } + return ret; +} +static inline struct LDKRoute CResult_RouteLightningErrorZ_get_ok(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){ + LDKRoute ret = *owner->contents.result; ret.is_owned = false; return ret; } -int64_t CS_LDK_C2Tuple_BlindedPayInfoBlindedPathZ_get_a(int64_t owner) { - LDKC2Tuple_BlindedPayInfoBlindedPathZ* owner_conv = (LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(owner); - LDKBlindedPayInfo ret_var = C2Tuple_BlindedPayInfoBlindedPathZ_get_a(owner_conv); +int64_t CS_LDK_CResult_RouteLightningErrorZ_get_ok(int64_t owner) { + LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner); + LDKRoute ret_var = CResult_RouteLightningErrorZ_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 LDKBlindedPath C2Tuple_BlindedPayInfoBlindedPathZ_get_b(LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR owner){ - LDKBlindedPath ret = owner->b; +static inline struct LDKLightningError CResult_RouteLightningErrorZ_get_err(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){ + LDKLightningError ret = *owner->contents.err; ret.is_owned = false; return ret; } -int64_t CS_LDK_C2Tuple_BlindedPayInfoBlindedPathZ_get_b(int64_t owner) { - LDKC2Tuple_BlindedPayInfoBlindedPathZ* owner_conv = (LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(owner); - LDKBlindedPath ret_var = C2Tuple_BlindedPayInfoBlindedPathZ_get_b(owner_conv); +int64_t CS_LDK_CResult_RouteLightningErrorZ_get_err(int64_t owner) { + LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner); + LDKLightningError ret_var = CResult_RouteLightningErrorZ_get_err(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_BlindedPayInfoBlindedPathZZ CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_clone(const LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ *orig) { - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ) * orig->datalen, "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ clone bytes"), .datalen = orig->datalen }; +static inline LDKCVec_BlindedPaymentPathZ CVec_BlindedPaymentPathZ_clone(const LDKCVec_BlindedPaymentPathZ *orig) { + LDKCVec_BlindedPaymentPathZ ret = { .data = MALLOC(sizeof(LDKBlindedPaymentPath) * orig->datalen, "LDKCVec_BlindedPaymentPathZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C2Tuple_BlindedPayInfoBlindedPathZ_clone(&orig->data[i]); + ret.data[i] = BlindedPaymentPath_clone(&orig->data[i]); } return ret; } -static inline struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_ok(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR owner){ +static inline struct LDKCVec_BlindedPaymentPathZ CResult_CVec_BlindedPaymentPathZNoneZ_get_ok(LDKCResult_CVec_BlindedPaymentPathZNoneZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_clone(&*owner->contents.result); + return CVec_BlindedPaymentPathZ_clone(&*owner->contents.result); } -int64_tArray CS_LDK_CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_ok(int64_t owner) { - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* owner_conv = (LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ*)untag_ptr(owner); - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ ret_var = CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_ok(owner_conv); +int64_tArray CS_LDK_CResult_CVec_BlindedPaymentPathZNoneZ_get_ok(int64_t owner) { + LDKCResult_CVec_BlindedPaymentPathZNoneZ* owner_conv = (LDKCResult_CVec_BlindedPaymentPathZNoneZ*)untag_ptr(owner); + LDKCVec_BlindedPaymentPathZ ret_var = CResult_CVec_BlindedPaymentPathZNoneZ_get_ok(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 l = 0; l < ret_var.datalen; l++) { - LDKC2Tuple_BlindedPayInfoBlindedPathZ* ret_conv_37_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ"); - *ret_conv_37_conv = ret_var.data[l]; - ret_arr_ptr[l] = tag_ptr(ret_conv_37_conv, true); + for (size_t u = 0; u < ret_var.datalen; u++) { + LDKBlindedPaymentPath ret_conv_20_var = ret_var.data[u]; + int64_t ret_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_20_var); + ret_conv_20_ref = tag_ptr(ret_conv_20_var.inner, ret_conv_20_var.is_owned); + ret_arr_ptr[u] = ret_conv_20_ref; } FREE(ret_var.data); return ret_arr; } -static inline void CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_err(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR owner){ +static inline void CResult_CVec_BlindedPaymentPathZNoneZ_get_err(LDKCResult_CVec_BlindedPaymentPathZNoneZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return *owner->contents.err; } -void CS_LDK_CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_err(int64_t owner) { - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* owner_conv = (LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ*)untag_ptr(owner); - CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_err(owner_conv); +void CS_LDK_CResult_CVec_BlindedPaymentPathZNoneZ_get_err(int64_t owner) { + LDKCResult_CVec_BlindedPaymentPathZNoneZ* owner_conv = (LDKCResult_CVec_BlindedPaymentPathZNoneZ*)untag_ptr(owner); + CResult_CVec_BlindedPaymentPathZNoneZ_get_err(owner_conv); } static inline struct LDKOnionMessagePath CResult_OnionMessagePathNoneZ_get_ok(LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR owner){ @@ -3298,37 +3340,44 @@ void CS_LDK_CResult_OnionMessagePathNoneZ_get_err(int64_t owner) { CResult_OnionMessagePathNoneZ_get_err(owner_conv); } -static inline struct LDKCVec_BlindedPathZ CResult_CVec_BlindedPathZNoneZ_get_ok(LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR owner){ +static inline struct LDKCVec_BlindedMessagePathZ CResult_CVec_BlindedMessagePathZNoneZ_get_ok(LDKCResult_CVec_BlindedMessagePathZNoneZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return CVec_BlindedPathZ_clone(&*owner->contents.result); + return CVec_BlindedMessagePathZ_clone(&*owner->contents.result); } -int64_tArray CS_LDK_CResult_CVec_BlindedPathZNoneZ_get_ok(int64_t owner) { - LDKCResult_CVec_BlindedPathZNoneZ* owner_conv = (LDKCResult_CVec_BlindedPathZNoneZ*)untag_ptr(owner); - LDKCVec_BlindedPathZ ret_var = CResult_CVec_BlindedPathZNoneZ_get_ok(owner_conv); +int64_tArray CS_LDK_CResult_CVec_BlindedMessagePathZNoneZ_get_ok(int64_t owner) { + LDKCResult_CVec_BlindedMessagePathZNoneZ* owner_conv = (LDKCResult_CVec_BlindedMessagePathZNoneZ*)untag_ptr(owner); + LDKCVec_BlindedMessagePathZ ret_var = CResult_CVec_BlindedMessagePathZNoneZ_get_ok(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 n = 0; n < ret_var.datalen; n++) { - LDKBlindedPath 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; + for (size_t u = 0; u < ret_var.datalen; u++) { + LDKBlindedMessagePath ret_conv_20_var = ret_var.data[u]; + int64_t ret_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_20_var); + ret_conv_20_ref = tag_ptr(ret_conv_20_var.inner, ret_conv_20_var.is_owned); + ret_arr_ptr[u] = ret_conv_20_ref; } FREE(ret_var.data); return ret_arr; } -static inline void CResult_CVec_BlindedPathZNoneZ_get_err(LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR owner){ +static inline void CResult_CVec_BlindedMessagePathZNoneZ_get_err(LDKCResult_CVec_BlindedMessagePathZNoneZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return *owner->contents.err; } -void CS_LDK_CResult_CVec_BlindedPathZNoneZ_get_err(int64_t owner) { - LDKCResult_CVec_BlindedPathZNoneZ* owner_conv = (LDKCResult_CVec_BlindedPathZNoneZ*)untag_ptr(owner); - CResult_CVec_BlindedPathZNoneZ_get_err(owner_conv); +void CS_LDK_CResult_CVec_BlindedMessagePathZNoneZ_get_err(int64_t owner) { + LDKCResult_CVec_BlindedMessagePathZNoneZ* owner_conv = (LDKCResult_CVec_BlindedMessagePathZNoneZ*)untag_ptr(owner); + CResult_CVec_BlindedMessagePathZNoneZ_get_err(owner_conv); } +static inline LDKCVec_MessageForwardNodeZ CVec_MessageForwardNodeZ_clone(const LDKCVec_MessageForwardNodeZ *orig) { + LDKCVec_MessageForwardNodeZ ret = { .data = MALLOC(sizeof(LDKMessageForwardNode) * orig->datalen, "LDKCVec_MessageForwardNodeZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = MessageForwardNode_clone(&orig->data[i]); + } + return ret; +} static inline struct LDKInFlightHtlcs CResult_InFlightHtlcsDecodeErrorZ_get_ok(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner){ LDKInFlightHtlcs ret = *owner->contents.result; ret.is_owned = false; @@ -3518,13 +3567,6 @@ static inline LDKCVec_RouteHintZ CVec_RouteHintZ_clone(const LDKCVec_RouteHintZ } return ret; } -static inline LDKCVec_RouteHintHopZ CVec_RouteHintHopZ_clone(const LDKCVec_RouteHintHopZ *orig) { - LDKCVec_RouteHintHopZ ret = { .data = MALLOC(sizeof(LDKRouteHintHop) * orig->datalen, "LDKCVec_RouteHintHopZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = RouteHintHop_clone(&orig->data[i]); - } - return ret; -} static inline struct LDKRouteHint CResult_RouteHintDecodeErrorZ_get_ok(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR owner){ LDKRouteHint ret = *owner->contents.result; ret.is_owned = false; @@ -3729,7 +3771,7 @@ void log_LDKLogger_jcall(const void* this_arg, LDKRecord record) { int64_t record_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(record_var); record_ref = tag_ptr(record_var.inner, record_var.is_owned); - js_invoke_function_void_l(j_calls->instance_ptr, 25, record_ref); + js_invoke_function_void_l(j_calls->instance_ptr, 24, record_ref); } static void LDKLogger_JCalls_cloned(LDKLogger* new_obj) { LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) new_obj->this_arg; @@ -3903,6 +3945,7 @@ uint32_t CS_LDK_LDKClosureReason_ty_from_ptr(int64_t ptr) { case LDKClosureReason_CounterpartyCoopClosedUnfundedChannel: return 10; case LDKClosureReason_FundingBatchClosure: return 11; case LDKClosureReason_HTLCsTimedOut: return 12; + case LDKClosureReason_PeerFeerateTooLow: return 13; default: abort(); } } @@ -3915,6 +3958,12 @@ int64_t CS_LDK_LDKClosureReason_CounterpartyForceClosed_get_peer_msg(int64_t ptr peer_msg_ref = tag_ptr(peer_msg_var.inner, false); return peer_msg_ref; } +int64_t CS_LDK_LDKClosureReason_HolderForceClosed_get_broadcasted_latest_txn(int64_t ptr) { + LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr); + CHECK(obj->tag == LDKClosureReason_HolderForceClosed); + int64_t broadcasted_latest_txn_ref = tag_ptr(&obj->holder_force_closed.broadcasted_latest_txn, false); + return broadcasted_latest_txn_ref; +} jstring CS_LDK_LDKClosureReason_ProcessingError_get_err(int64_t ptr) { LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr); CHECK(obj->tag == LDKClosureReason_ProcessingError); @@ -3922,6 +3971,18 @@ jstring CS_LDK_LDKClosureReason_ProcessingError_get_err(int64_t ptr) { jstring err_conv = str_ref_to_cs(err_str.chars, err_str.len); return err_conv; } +int32_t CS_LDK_LDKClosureReason_PeerFeerateTooLow_get_peer_feerate_sat_per_kw(int64_t ptr) { + LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr); + CHECK(obj->tag == LDKClosureReason_PeerFeerateTooLow); + int32_t peer_feerate_sat_per_kw_conv = obj->peer_feerate_too_low.peer_feerate_sat_per_kw; + return peer_feerate_sat_per_kw_conv; +} +int32_t CS_LDK_LDKClosureReason_PeerFeerateTooLow_get_required_feerate_sat_per_kw(int64_t ptr) { + LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr); + CHECK(obj->tag == LDKClosureReason_PeerFeerateTooLow); + int32_t required_feerate_sat_per_kw_conv = obj->peer_feerate_too_low.required_feerate_sat_per_kw; + return required_feerate_sat_per_kw_conv; +} uint32_t CS_LDK_LDKMonitorEvent_ty_from_ptr(int64_t ptr) { LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr); switch(obj->tag) { @@ -4369,6 +4430,32 @@ int32_t CS_LDK_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticEr return ret_conv; } +static inline struct LDKOffer CResult_OfferDecodeErrorZ_get_ok(LDKCResult_OfferDecodeErrorZ *NONNULL_PTR owner){ + LDKOffer ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_OfferDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_OfferDecodeErrorZ* owner_conv = (LDKCResult_OfferDecodeErrorZ*)untag_ptr(owner); + LDKOffer ret_var = CResult_OfferDecodeErrorZ_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_OfferDecodeErrorZ_get_err(LDKCResult_OfferDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_OfferDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_OfferDecodeErrorZ* owner_conv = (LDKCResult_OfferDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_OfferDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline struct LDKOffer CResult_OfferBolt12ParseErrorZ_get_ok(LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR owner){ LDKOffer ret = *owner->contents.result; ret.is_owned = false; @@ -4447,21 +4534,11 @@ int32_t CS_LDK_CResult_PublicKeySecp256k1ErrorZ_get_err(int64_t owner) { uint32_t CS_LDK_LDKNetworkUpdate_ty_from_ptr(int64_t ptr) { LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr); switch(obj->tag) { - case LDKNetworkUpdate_ChannelUpdateMessage: return 0; - case LDKNetworkUpdate_ChannelFailure: return 1; - case LDKNetworkUpdate_NodeFailure: return 2; + case LDKNetworkUpdate_ChannelFailure: return 0; + case LDKNetworkUpdate_NodeFailure: return 1; default: abort(); } } -int64_t CS_LDK_LDKNetworkUpdate_ChannelUpdateMessage_get_msg(int64_t ptr) { - LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr); - CHECK(obj->tag == LDKNetworkUpdate_ChannelUpdateMessage); - LDKChannelUpdate msg_var = obj->channel_update_message.msg; - int64_t msg_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = tag_ptr(msg_var.inner, false); - return msg_ref; -} int64_t CS_LDK_LDKNetworkUpdate_ChannelFailure_get_short_channel_id(int64_t ptr) { LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr); CHECK(obj->tag == LDKNetworkUpdate_ChannelFailure); @@ -4586,7 +4663,7 @@ LDKUtxoResult get_utxo_LDKUtxoLookup_jcall(const void* this_arg, const uint8_t ( int8_tArray chain_hash_arr = init_int8_tArray(32, __LINE__); memcpy(chain_hash_arr->elems, *chain_hash, 32); int64_t short_channel_id_conv = short_channel_id; - uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 26, (int64_t)chain_hash_arr, short_channel_id_conv); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 25, (int64_t)chain_hash_arr, short_channel_id_conv); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKUtxoResult ret_conv = *(LDKUtxoResult*)(ret_ptr); @@ -4824,7 +4901,7 @@ uint32_t CS_LDK_LDKMessageSendEvent_ty_from_ptr(int64_t ptr) { case LDKMessageSendEvent_SendFundingCreated: return 4; case LDKMessageSendEvent_SendFundingSigned: return 5; case LDKMessageSendEvent_SendStfu: return 6; - case LDKMessageSendEvent_SendSplice: return 7; + case LDKMessageSendEvent_SendSpliceInit: return 7; case LDKMessageSendEvent_SendSpliceAck: return 8; case LDKMessageSendEvent_SendSpliceLocked: return 9; case LDKMessageSendEvent_SendTxAddInput: return 10; @@ -4968,17 +5045,17 @@ int64_t CS_LDK_LDKMessageSendEvent_SendStfu_get_msg(int64_t ptr) { msg_ref = tag_ptr(msg_var.inner, false); return msg_ref; } -int8_tArray CS_LDK_LDKMessageSendEvent_SendSplice_get_node_id(int64_t ptr) { +int8_tArray CS_LDK_LDKMessageSendEvent_SendSpliceInit_get_node_id(int64_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr); - CHECK(obj->tag == LDKMessageSendEvent_SendSplice); + CHECK(obj->tag == LDKMessageSendEvent_SendSpliceInit); int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); - memcpy(node_id_arr->elems, obj->send_splice.node_id.compressed_form, 33); + memcpy(node_id_arr->elems, obj->send_splice_init.node_id.compressed_form, 33); return node_id_arr; } -int64_t CS_LDK_LDKMessageSendEvent_SendSplice_get_msg(int64_t ptr) { +int64_t CS_LDK_LDKMessageSendEvent_SendSpliceInit_get_msg(int64_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr); - CHECK(obj->tag == LDKMessageSendEvent_SendSplice); - LDKSplice msg_var = obj->send_splice.msg; + CHECK(obj->tag == LDKMessageSendEvent_SendSpliceInit); + LDKSpliceInit msg_var = obj->send_splice_init.msg; int64_t msg_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, false); @@ -5602,17 +5679,41 @@ static inline LDKCVec_SocketAddressZ CVec_SocketAddressZ_clone(const LDKCVec_Soc } return ret; } +uint32_t CS_LDK_LDKNodeAnnouncementInfo_ty_from_ptr(int64_t ptr) { + LDKNodeAnnouncementInfo *obj = (LDKNodeAnnouncementInfo*)untag_ptr(ptr); + switch(obj->tag) { + case LDKNodeAnnouncementInfo_Relayed: return 0; + case LDKNodeAnnouncementInfo_Local: return 1; + default: abort(); + } +} +int64_t CS_LDK_LDKNodeAnnouncementInfo_Relayed_get_relayed(int64_t ptr) { + LDKNodeAnnouncementInfo *obj = (LDKNodeAnnouncementInfo*)untag_ptr(ptr); + CHECK(obj->tag == LDKNodeAnnouncementInfo_Relayed); + LDKNodeAnnouncement relayed_var = obj->relayed; + int64_t relayed_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(relayed_var); + relayed_ref = tag_ptr(relayed_var.inner, false); + return relayed_ref; +} +int64_t CS_LDK_LDKNodeAnnouncementInfo_Local_get_local(int64_t ptr) { + LDKNodeAnnouncementInfo *obj = (LDKNodeAnnouncementInfo*)untag_ptr(ptr); + CHECK(obj->tag == LDKNodeAnnouncementInfo_Local); + LDKNodeAnnouncementDetails local_var = obj->local; + int64_t local_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(local_var); + local_ref = tag_ptr(local_var.inner, false); + return local_ref; +} static inline struct LDKNodeAnnouncementInfo CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner){ - LDKNodeAnnouncementInfo ret = *owner->contents.result; - ret.is_owned = false; - return ret; +CHECK(owner->result_ok); + return NodeAnnouncementInfo_clone(&*owner->contents.result); } int64_t CS_LDK_CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(int64_t owner) { LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(owner); - LDKNodeAnnouncementInfo ret_var = CResult_NodeAnnouncementInfoDecodeErrorZ_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); + LDKNodeAnnouncementInfo *ret_copy = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo"); + *ret_copy = CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -5654,6 +5755,20 @@ int64_t CS_LDK_CResult_NodeAliasDecodeErrorZ_get_err(int64_t owner) { return ret_ref; } +uint32_t CS_LDK_LDKCOption_NodeAnnouncementInfoZ_ty_from_ptr(int64_t ptr) { + LDKCOption_NodeAnnouncementInfoZ *obj = (LDKCOption_NodeAnnouncementInfoZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_NodeAnnouncementInfoZ_Some: return 0; + case LDKCOption_NodeAnnouncementInfoZ_None: return 1; + default: abort(); + } +} +int64_t CS_LDK_LDKCOption_NodeAnnouncementInfoZ_Some_get_some(int64_t ptr) { + LDKCOption_NodeAnnouncementInfoZ *obj = (LDKCOption_NodeAnnouncementInfoZ*)untag_ptr(ptr); + CHECK(obj->tag == LDKCOption_NodeAnnouncementInfoZ_Some); + int64_t some_ref = tag_ptr(&obj->some, false); + return some_ref; +} static inline struct LDKNodeInfo CResult_NodeInfoDecodeErrorZ_get_ok(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner){ LDKNodeInfo ret = *owner->contents.result; ret.is_owned = false; @@ -6432,6 +6547,68 @@ int64_t CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_get_err(int64_t owner) { return ret_ref; } +uint32_t CS_LDK_LDKOffersContext_ty_from_ptr(int64_t ptr) { + LDKOffersContext *obj = (LDKOffersContext*)untag_ptr(ptr); + switch(obj->tag) { + case LDKOffersContext_InvoiceRequest: return 0; + case LDKOffersContext_OutboundPayment: return 1; + case LDKOffersContext_InboundPayment: return 2; + default: abort(); + } +} +int64_t CS_LDK_LDKOffersContext_InvoiceRequest_get_nonce(int64_t ptr) { + LDKOffersContext *obj = (LDKOffersContext*)untag_ptr(ptr); + CHECK(obj->tag == LDKOffersContext_InvoiceRequest); + LDKNonce nonce_var = obj->invoice_request.nonce; + int64_t nonce_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_var); + nonce_ref = tag_ptr(nonce_var.inner, false); + return nonce_ref; +} +int8_tArray CS_LDK_LDKOffersContext_OutboundPayment_get_payment_id(int64_t ptr) { + LDKOffersContext *obj = (LDKOffersContext*)untag_ptr(ptr); + CHECK(obj->tag == LDKOffersContext_OutboundPayment); + int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__); + memcpy(payment_id_arr->elems, obj->outbound_payment.payment_id.data, 32); + return payment_id_arr; +} +int64_t CS_LDK_LDKOffersContext_OutboundPayment_get_nonce(int64_t ptr) { + LDKOffersContext *obj = (LDKOffersContext*)untag_ptr(ptr); + CHECK(obj->tag == LDKOffersContext_OutboundPayment); + LDKNonce nonce_var = obj->outbound_payment.nonce; + int64_t nonce_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_var); + nonce_ref = tag_ptr(nonce_var.inner, false); + return nonce_ref; +} +int8_tArray CS_LDK_LDKOffersContext_OutboundPayment_get_hmac(int64_t ptr) { + LDKOffersContext *obj = (LDKOffersContext*)untag_ptr(ptr); + CHECK(obj->tag == LDKOffersContext_OutboundPayment); + int8_tArray hmac_arr = init_int8_tArray(32, __LINE__); + memcpy(hmac_arr->elems, obj->outbound_payment.hmac.data, 32); + return hmac_arr; +} +int8_tArray CS_LDK_LDKOffersContext_InboundPayment_get_payment_hash(int64_t ptr) { + LDKOffersContext *obj = (LDKOffersContext*)untag_ptr(ptr); + CHECK(obj->tag == LDKOffersContext_InboundPayment); + int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__); + memcpy(payment_hash_arr->elems, obj->inbound_payment.payment_hash.data, 32); + return payment_hash_arr; +} +uint32_t CS_LDK_LDKCOption_OffersContextZ_ty_from_ptr(int64_t ptr) { + LDKCOption_OffersContextZ *obj = (LDKCOption_OffersContextZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_OffersContextZ_Some: return 0; + case LDKCOption_OffersContextZ_None: return 1; + default: abort(); + } +} +int64_t CS_LDK_LDKCOption_OffersContextZ_Some_get_some(int64_t ptr) { + LDKCOption_OffersContextZ *obj = (LDKCOption_OffersContextZ*)untag_ptr(ptr); + CHECK(obj->tag == LDKCOption_OffersContextZ_Some); + int64_t some_ref = tag_ptr(&obj->some, false); + return some_ref; +} uint32_t CS_LDK_LDKOffersMessage_ty_from_ptr(int64_t ptr) { LDKOffersMessage *obj = (LDKOffersMessage*)untag_ptr(ptr); switch(obj->tag) { @@ -6468,19 +6645,46 @@ int64_t CS_LDK_LDKOffersMessage_InvoiceError_get_invoice_error(int64_t ptr) { invoice_error_ref = tag_ptr(invoice_error_var.inner, false); return invoice_error_ref; } -uint32_t CS_LDK_LDKCOption_OffersMessageZ_ty_from_ptr(int64_t ptr) { - LDKCOption_OffersMessageZ *obj = (LDKCOption_OffersMessageZ*)untag_ptr(ptr); +static inline struct LDKOffersMessage C2Tuple_OffersMessageResponseInstructionZ_get_a(LDKC2Tuple_OffersMessageResponseInstructionZ *NONNULL_PTR owner){ + return OffersMessage_clone(&owner->a); +} +int64_t CS_LDK_C2Tuple_OffersMessageResponseInstructionZ_get_a(int64_t owner) { + LDKC2Tuple_OffersMessageResponseInstructionZ* owner_conv = (LDKC2Tuple_OffersMessageResponseInstructionZ*)untag_ptr(owner); + LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); + *ret_copy = C2Tuple_OffersMessageResponseInstructionZ_get_a(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKResponseInstruction C2Tuple_OffersMessageResponseInstructionZ_get_b(LDKC2Tuple_OffersMessageResponseInstructionZ *NONNULL_PTR owner){ + LDKResponseInstruction ret = owner->b; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_C2Tuple_OffersMessageResponseInstructionZ_get_b(int64_t owner) { + LDKC2Tuple_OffersMessageResponseInstructionZ* owner_conv = (LDKC2Tuple_OffersMessageResponseInstructionZ*)untag_ptr(owner); + LDKResponseInstruction ret_var = C2Tuple_OffersMessageResponseInstructionZ_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; +} + +uint32_t CS_LDK_LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_ty_from_ptr(int64_t ptr) { + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ *obj = (LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ*)untag_ptr(ptr); switch(obj->tag) { - case LDKCOption_OffersMessageZ_Some: return 0; - case LDKCOption_OffersMessageZ_None: return 1; + case LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_Some: return 0; + case LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_None: return 1; default: abort(); } } -int64_t CS_LDK_LDKCOption_OffersMessageZ_Some_get_some(int64_t ptr) { - LDKCOption_OffersMessageZ *obj = (LDKCOption_OffersMessageZ*)untag_ptr(ptr); - CHECK(obj->tag == LDKCOption_OffersMessageZ_Some); - int64_t some_ref = tag_ptr(&obj->some, false); - return some_ref; +int64_t CS_LDK_LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_Some_get_some(int64_t ptr) { + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ *obj = (LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ*)untag_ptr(ptr); + CHECK(obj->tag == LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_Some); + LDKC2Tuple_OffersMessageResponseInstructionZ* some_conv = MALLOC(sizeof(LDKC2Tuple_OffersMessageResponseInstructionZ), "LDKC2Tuple_OffersMessageResponseInstructionZ"); + *some_conv = obj->some; + *some_conv = C2Tuple_OffersMessageResponseInstructionZ_clone(some_conv); + return tag_ptr(some_conv, true); } uint32_t CS_LDK_LDKDestination_ty_from_ptr(int64_t ptr) { LDKDestination *obj = (LDKDestination*)untag_ptr(ptr); @@ -6500,52 +6704,211 @@ int8_tArray CS_LDK_LDKDestination_Node_get_node(int64_t ptr) { int64_t CS_LDK_LDKDestination_BlindedPath_get_blinded_path(int64_t ptr) { LDKDestination *obj = (LDKDestination*)untag_ptr(ptr); CHECK(obj->tag == LDKDestination_BlindedPath); - LDKBlindedPath blinded_path_var = obj->blinded_path; + LDKBlindedMessagePath blinded_path_var = obj->blinded_path; int64_t blinded_path_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_path_var); blinded_path_ref = tag_ptr(blinded_path_var.inner, false); return blinded_path_ref; } -static inline struct LDKOffersMessage C3Tuple_OffersMessageDestinationBlindedPathZ_get_a(LDKC3Tuple_OffersMessageDestinationBlindedPathZ *NONNULL_PTR owner){ +uint32_t CS_LDK_LDKMessageContext_ty_from_ptr(int64_t ptr) { + LDKMessageContext *obj = (LDKMessageContext*)untag_ptr(ptr); + switch(obj->tag) { + case LDKMessageContext_Offers: return 0; + case LDKMessageContext_Custom: return 1; + default: abort(); + } +} +int64_t CS_LDK_LDKMessageContext_Offers_get_offers(int64_t ptr) { + LDKMessageContext *obj = (LDKMessageContext*)untag_ptr(ptr); + CHECK(obj->tag == LDKMessageContext_Offers); + int64_t offers_ref = tag_ptr(&obj->offers, false); + return offers_ref; +} +int8_tArray CS_LDK_LDKMessageContext_Custom_get_custom(int64_t ptr) { + LDKMessageContext *obj = (LDKMessageContext*)untag_ptr(ptr); + CHECK(obj->tag == LDKMessageContext_Custom); + LDKCVec_u8Z custom_var = obj->custom; + int8_tArray custom_arr = init_int8_tArray(custom_var.datalen, __LINE__); + memcpy(custom_arr->elems, custom_var.data, custom_var.datalen); + return custom_arr; +} +uint32_t CS_LDK_LDKMessageSendInstructions_ty_from_ptr(int64_t ptr) { + LDKMessageSendInstructions *obj = (LDKMessageSendInstructions*)untag_ptr(ptr); + switch(obj->tag) { + case LDKMessageSendInstructions_WithSpecifiedReplyPath: return 0; + case LDKMessageSendInstructions_WithReplyPath: return 1; + case LDKMessageSendInstructions_WithoutReplyPath: return 2; + case LDKMessageSendInstructions_ForReply: return 3; + default: abort(); + } +} +int64_t CS_LDK_LDKMessageSendInstructions_WithSpecifiedReplyPath_get_destination(int64_t ptr) { + LDKMessageSendInstructions *obj = (LDKMessageSendInstructions*)untag_ptr(ptr); + CHECK(obj->tag == LDKMessageSendInstructions_WithSpecifiedReplyPath); + int64_t destination_ref = tag_ptr(&obj->with_specified_reply_path.destination, false); + return destination_ref; +} +int64_t CS_LDK_LDKMessageSendInstructions_WithSpecifiedReplyPath_get_reply_path(int64_t ptr) { + LDKMessageSendInstructions *obj = (LDKMessageSendInstructions*)untag_ptr(ptr); + CHECK(obj->tag == LDKMessageSendInstructions_WithSpecifiedReplyPath); + LDKBlindedMessagePath reply_path_var = obj->with_specified_reply_path.reply_path; + int64_t reply_path_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(reply_path_var); + reply_path_ref = tag_ptr(reply_path_var.inner, false); + return reply_path_ref; +} +int64_t CS_LDK_LDKMessageSendInstructions_WithReplyPath_get_destination(int64_t ptr) { + LDKMessageSendInstructions *obj = (LDKMessageSendInstructions*)untag_ptr(ptr); + CHECK(obj->tag == LDKMessageSendInstructions_WithReplyPath); + int64_t destination_ref = tag_ptr(&obj->with_reply_path.destination, false); + return destination_ref; +} +int64_t CS_LDK_LDKMessageSendInstructions_WithReplyPath_get_context(int64_t ptr) { + LDKMessageSendInstructions *obj = (LDKMessageSendInstructions*)untag_ptr(ptr); + CHECK(obj->tag == LDKMessageSendInstructions_WithReplyPath); + int64_t context_ref = tag_ptr(&obj->with_reply_path.context, false); + return context_ref; +} +int64_t CS_LDK_LDKMessageSendInstructions_WithoutReplyPath_get_destination(int64_t ptr) { + LDKMessageSendInstructions *obj = (LDKMessageSendInstructions*)untag_ptr(ptr); + CHECK(obj->tag == LDKMessageSendInstructions_WithoutReplyPath); + int64_t destination_ref = tag_ptr(&obj->without_reply_path.destination, false); + return destination_ref; +} +int64_t CS_LDK_LDKMessageSendInstructions_ForReply_get_instructions(int64_t ptr) { + LDKMessageSendInstructions *obj = (LDKMessageSendInstructions*)untag_ptr(ptr); + CHECK(obj->tag == LDKMessageSendInstructions_ForReply); + LDKResponseInstruction instructions_var = obj->for_reply.instructions; + int64_t instructions_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(instructions_var); + instructions_ref = tag_ptr(instructions_var.inner, false); + return instructions_ref; +} +static inline struct LDKOffersMessage C2Tuple_OffersMessageMessageSendInstructionsZ_get_a(LDKC2Tuple_OffersMessageMessageSendInstructionsZ *NONNULL_PTR owner){ return OffersMessage_clone(&owner->a); } -int64_t CS_LDK_C3Tuple_OffersMessageDestinationBlindedPathZ_get_a(int64_t owner) { - LDKC3Tuple_OffersMessageDestinationBlindedPathZ* owner_conv = (LDKC3Tuple_OffersMessageDestinationBlindedPathZ*)untag_ptr(owner); +int64_t CS_LDK_C2Tuple_OffersMessageMessageSendInstructionsZ_get_a(int64_t owner) { + LDKC2Tuple_OffersMessageMessageSendInstructionsZ* owner_conv = (LDKC2Tuple_OffersMessageMessageSendInstructionsZ*)untag_ptr(owner); LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); - *ret_copy = C3Tuple_OffersMessageDestinationBlindedPathZ_get_a(owner_conv); + *ret_copy = C2Tuple_OffersMessageMessageSendInstructionsZ_get_a(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline struct LDKDestination C3Tuple_OffersMessageDestinationBlindedPathZ_get_b(LDKC3Tuple_OffersMessageDestinationBlindedPathZ *NONNULL_PTR owner){ - return Destination_clone(&owner->b); +static inline struct LDKMessageSendInstructions C2Tuple_OffersMessageMessageSendInstructionsZ_get_b(LDKC2Tuple_OffersMessageMessageSendInstructionsZ *NONNULL_PTR owner){ + return MessageSendInstructions_clone(&owner->b); } -int64_t CS_LDK_C3Tuple_OffersMessageDestinationBlindedPathZ_get_b(int64_t owner) { - LDKC3Tuple_OffersMessageDestinationBlindedPathZ* owner_conv = (LDKC3Tuple_OffersMessageDestinationBlindedPathZ*)untag_ptr(owner); - LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); - *ret_copy = C3Tuple_OffersMessageDestinationBlindedPathZ_get_b(owner_conv); +int64_t CS_LDK_C2Tuple_OffersMessageMessageSendInstructionsZ_get_b(int64_t owner) { + LDKC2Tuple_OffersMessageMessageSendInstructionsZ* owner_conv = (LDKC2Tuple_OffersMessageMessageSendInstructionsZ*)untag_ptr(owner); + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = C2Tuple_OffersMessageMessageSendInstructionsZ_get_b(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline struct LDKBlindedPath C3Tuple_OffersMessageDestinationBlindedPathZ_get_c(LDKC3Tuple_OffersMessageDestinationBlindedPathZ *NONNULL_PTR owner){ - LDKBlindedPath ret = owner->c; +static inline LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ CVec_C2Tuple_OffersMessageMessageSendInstructionsZZ_clone(const LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ *orig) { + LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_OffersMessageMessageSendInstructionsZ) * orig->datalen, "LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = C2Tuple_OffersMessageMessageSendInstructionsZ_clone(&orig->data[i]); + } + return ret; +} +static inline struct LDKReleaseHeldHtlc C2Tuple_ReleaseHeldHtlcResponseInstructionZ_get_a(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ *NONNULL_PTR owner){ + LDKReleaseHeldHtlc ret = owner->a; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_C2Tuple_ReleaseHeldHtlcResponseInstructionZ_get_a(int64_t owner) { + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ* owner_conv = (LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ*)untag_ptr(owner); + LDKReleaseHeldHtlc ret_var = C2Tuple_ReleaseHeldHtlcResponseInstructionZ_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 LDKResponseInstruction C2Tuple_ReleaseHeldHtlcResponseInstructionZ_get_b(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ *NONNULL_PTR owner){ + LDKResponseInstruction ret = owner->b; ret.is_owned = false; return ret; } -int64_t CS_LDK_C3Tuple_OffersMessageDestinationBlindedPathZ_get_c(int64_t owner) { - LDKC3Tuple_OffersMessageDestinationBlindedPathZ* owner_conv = (LDKC3Tuple_OffersMessageDestinationBlindedPathZ*)untag_ptr(owner); - LDKBlindedPath ret_var = C3Tuple_OffersMessageDestinationBlindedPathZ_get_c(owner_conv); +int64_t CS_LDK_C2Tuple_ReleaseHeldHtlcResponseInstructionZ_get_b(int64_t owner) { + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ* owner_conv = (LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ*)untag_ptr(owner); + LDKResponseInstruction ret_var = C2Tuple_ReleaseHeldHtlcResponseInstructionZ_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_C3Tuple_OffersMessageDestinationBlindedPathZZ CVec_C3Tuple_OffersMessageDestinationBlindedPathZZ_clone(const LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ *orig) { - LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_OffersMessageDestinationBlindedPathZ) * orig->datalen, "LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ clone bytes"), .datalen = orig->datalen }; +uint32_t CS_LDK_LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_ty_from_ptr(int64_t ptr) { + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ *obj = (LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_Some: return 0; + case LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_None: return 1; + default: abort(); + } +} +int64_t CS_LDK_LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_Some_get_some(int64_t ptr) { + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ *obj = (LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ*)untag_ptr(ptr); + CHECK(obj->tag == LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_Some); + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ* some_conv = MALLOC(sizeof(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ), "LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ"); + *some_conv = obj->some; + *some_conv = C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone(some_conv); + return tag_ptr(some_conv, true); +} +uint32_t CS_LDK_LDKAsyncPaymentsMessage_ty_from_ptr(int64_t ptr) { + LDKAsyncPaymentsMessage *obj = (LDKAsyncPaymentsMessage*)untag_ptr(ptr); + switch(obj->tag) { + case LDKAsyncPaymentsMessage_HeldHtlcAvailable: return 0; + case LDKAsyncPaymentsMessage_ReleaseHeldHtlc: return 1; + default: abort(); + } +} +int64_t CS_LDK_LDKAsyncPaymentsMessage_HeldHtlcAvailable_get_held_htlc_available(int64_t ptr) { + LDKAsyncPaymentsMessage *obj = (LDKAsyncPaymentsMessage*)untag_ptr(ptr); + CHECK(obj->tag == LDKAsyncPaymentsMessage_HeldHtlcAvailable); + LDKHeldHtlcAvailable held_htlc_available_var = obj->held_htlc_available; + int64_t held_htlc_available_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(held_htlc_available_var); + held_htlc_available_ref = tag_ptr(held_htlc_available_var.inner, false); + return held_htlc_available_ref; +} +int64_t CS_LDK_LDKAsyncPaymentsMessage_ReleaseHeldHtlc_get_release_held_htlc(int64_t ptr) { + LDKAsyncPaymentsMessage *obj = (LDKAsyncPaymentsMessage*)untag_ptr(ptr); + CHECK(obj->tag == LDKAsyncPaymentsMessage_ReleaseHeldHtlc); + LDKReleaseHeldHtlc release_held_htlc_var = obj->release_held_htlc; + int64_t release_held_htlc_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(release_held_htlc_var); + release_held_htlc_ref = tag_ptr(release_held_htlc_var.inner, false); + return release_held_htlc_ref; +} +static inline struct LDKAsyncPaymentsMessage C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_get_a(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ *NONNULL_PTR owner){ + return AsyncPaymentsMessage_clone(&owner->a); +} +int64_t CS_LDK_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_get_a(int64_t owner) { + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ* owner_conv = (LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ*)untag_ptr(owner); + LDKAsyncPaymentsMessage *ret_copy = MALLOC(sizeof(LDKAsyncPaymentsMessage), "LDKAsyncPaymentsMessage"); + *ret_copy = C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_get_a(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKMessageSendInstructions C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_get_b(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ *NONNULL_PTR owner){ + return MessageSendInstructions_clone(&owner->b); +} +int64_t CS_LDK_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_get_b(int64_t owner) { + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ* owner_conv = (LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ*)untag_ptr(owner); + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_get_b(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ CVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ_clone(const LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ *orig) { + LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ) * orig->datalen, "LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C3Tuple_OffersMessageDestinationBlindedPathZ_clone(&orig->data[i]); + ret.data[i] = C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone(&orig->data[i]); } return ret; } @@ -6839,7 +7202,7 @@ LDKCResult_ChannelMonitorUpdateStatusNoneZ watch_channel_LDKWatch_jcall(const vo int64_t monitor_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_var); monitor_ref = tag_ptr(monitor_var.inner, monitor_var.is_owned); - uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 27, funding_txo_ref, monitor_ref); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 26, funding_txo_ref, monitor_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_ChannelMonitorUpdateStatusNoneZ ret_conv = *(LDKCResult_ChannelMonitorUpdateStatusNoneZ*)(ret_ptr); @@ -6857,13 +7220,13 @@ LDKChannelMonitorUpdateStatus update_channel_LDKWatch_jcall(const void* this_arg update_var = ChannelMonitorUpdate_clone(&update_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var); update_ref = tag_ptr(update_var.inner, update_var.is_owned); - uint64_t ret = js_invoke_function_ChannelMonitorUpdateStatus_ll(j_calls->instance_ptr, 28, funding_txo_ref, update_ref); + uint64_t ret = js_invoke_function_ChannelMonitorUpdateStatus_ll(j_calls->instance_ptr, 27, funding_txo_ref, update_ref); LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_cs(ret); return ret_conv; } 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); + int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 28); LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) @@ -6985,7 +7348,7 @@ void broadcast_transactions_LDKBroadcasterInterface_jcall(const void* this_arg, } FREE(txs_var.data); - js_invoke_function_void_l(j_calls->instance_ptr, 30, (int64_t)txs_arr); + js_invoke_function_void_l(j_calls->instance_ptr, 29, (int64_t)txs_arr); } static void LDKBroadcasterInterface_JCalls_cloned(LDKBroadcasterInterface* new_obj) { LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) new_obj->this_arg; @@ -7044,7 +7407,7 @@ static void LDKEntropySource_JCalls_free(void* this_arg) { } LDKThirtyTwoBytes get_secure_random_bytes_LDKEntropySource_jcall(const void* this_arg) { LDKEntropySource_JCalls *j_calls = (LDKEntropySource_JCalls*) this_arg; - int8_tArray ret = (int8_tArray)js_invoke_function_l_(j_calls->instance_ptr, 31); + int8_tArray ret = (int8_tArray)js_invoke_function_l_(j_calls->instance_ptr, 30); LDKThirtyTwoBytes ret_ref; CHECK(ret->arr_len == 32); memcpy(ret_ref.data, ret->elems, 32); FREE(ret); @@ -7128,7 +7491,7 @@ static void LDKNodeSigner_JCalls_free(void* this_arg) { } LDKThirtyTwoBytes get_inbound_payment_key_material_LDKNodeSigner_jcall(const void* this_arg) { LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg; - int8_tArray ret = (int8_tArray)js_invoke_function_l_(j_calls->instance_ptr, 32); + int8_tArray ret = (int8_tArray)js_invoke_function_l_(j_calls->instance_ptr, 31); LDKThirtyTwoBytes ret_ref; CHECK(ret->arr_len == 32); memcpy(ret_ref.data, ret->elems, 32); FREE(ret); @@ -7137,7 +7500,7 @@ LDKThirtyTwoBytes get_inbound_payment_key_material_LDKNodeSigner_jcall(const voi LDKCResult_PublicKeyNoneZ get_node_id_LDKNodeSigner_jcall(const void* this_arg, LDKRecipient recipient) { LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg; int32_t recipient_conv = LDKRecipient_to_cs(recipient); - uint64_t ret = js_invoke_function_l_Recipient(j_calls->instance_ptr, 33, recipient_conv); + uint64_t ret = js_invoke_function_l_Recipient(j_calls->instance_ptr, 32, recipient_conv); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_PublicKeyNoneZ ret_conv = *(LDKCResult_PublicKeyNoneZ*)(ret_ptr); @@ -7152,30 +7515,22 @@ LDKCResult_ThirtyTwoBytesNoneZ ecdh_LDKNodeSigner_jcall(const void* this_arg, LD LDKCOption_BigEndianScalarZ *tweak_copy = MALLOC(sizeof(LDKCOption_BigEndianScalarZ), "LDKCOption_BigEndianScalarZ"); *tweak_copy = tweak; int64_t tweak_ref = tag_ptr(tweak_copy, true); - uint64_t ret = js_invoke_function_l_Recipientll(j_calls->instance_ptr, 34, recipient_conv, (int64_t)other_key_arr, tweak_ref); + uint64_t ret = js_invoke_function_l_Recipientll(j_calls->instance_ptr, 33, recipient_conv, (int64_t)other_key_arr, tweak_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_ThirtyTwoBytesNoneZ ret_conv = *(LDKCResult_ThirtyTwoBytesNoneZ*)(ret_ptr); FREE(untag_ptr(ret)); return ret_conv; } -LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKNodeSigner_jcall(const void* this_arg, LDKu8slice hrp_bytes, LDKCVec_U5Z invoice_data, LDKRecipient recipient) { +LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKNodeSigner_jcall(const void* this_arg, const LDKRawBolt11Invoice * invoice, LDKRecipient recipient) { LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg; - LDKu8slice hrp_bytes_var = hrp_bytes; - int8_tArray hrp_bytes_arr = init_int8_tArray(hrp_bytes_var.datalen, __LINE__); - memcpy(hrp_bytes_arr->elems, hrp_bytes_var.data, hrp_bytes_var.datalen); - LDKCVec_U5Z invoice_data_var = invoice_data; - ptrArray invoice_data_arr = NULL; - invoice_data_arr = init_ptrArray(invoice_data_var.datalen, __LINE__); - int8_t *invoice_data_arr_ptr = (int8_t*)(((uint8_t*)invoice_data_arr) + 8); - for (size_t h = 0; h < invoice_data_var.datalen; h++) { - uint8_t invoice_data_conv_7_val = invoice_data_var.data[h]._0; - invoice_data_arr_ptr[h] = invoice_data_conv_7_val; - } - - FREE(invoice_data_var.data); + LDKRawBolt11Invoice invoice_var = *invoice; + int64_t invoice_ref = 0; + invoice_var = RawBolt11Invoice_clone(&invoice_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_var); + invoice_ref = tag_ptr(invoice_var.inner, invoice_var.is_owned); int32_t recipient_conv = LDKRecipient_to_cs(recipient); - uint64_t ret = js_invoke_function_l_llRecipient(j_calls->instance_ptr, 35, (int64_t)hrp_bytes_arr, (int64_t)invoice_data_arr, recipient_conv); + uint64_t ret = js_invoke_function_l_lRecipient(j_calls->instance_ptr, 34, invoice_ref, recipient_conv); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_RecoverableSignatureNoneZ ret_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(ret_ptr); @@ -7189,7 +7544,7 @@ LDKCResult_SchnorrSignatureNoneZ sign_bolt12_invoice_request_LDKNodeSigner_jcall 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); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 35, invoice_request_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_SchnorrSignatureNoneZ ret_conv = *(LDKCResult_SchnorrSignatureNoneZ*)(ret_ptr); @@ -7203,7 +7558,7 @@ LDKCResult_SchnorrSignatureNoneZ sign_bolt12_invoice_LDKNodeSigner_jcall(const v 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); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 36, invoice_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_SchnorrSignatureNoneZ ret_conv = *(LDKCResult_SchnorrSignatureNoneZ*)(ret_ptr); @@ -7215,7 +7570,7 @@ LDKCResult_ECDSASignatureNoneZ sign_gossip_message_LDKNodeSigner_jcall(const voi LDKUnsignedGossipMessage *msg_copy = MALLOC(sizeof(LDKUnsignedGossipMessage), "LDKUnsignedGossipMessage"); *msg_copy = msg; int64_t msg_ref = tag_ptr(msg_copy, true); - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 38, msg_ref); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 37, msg_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_ECDSASignatureNoneZ ret_conv = *(LDKCResult_ECDSASignatureNoneZ*)(ret_ptr); @@ -7285,30 +7640,18 @@ int64_t CS_LDK_NodeSigner_ecdh(int64_t this_arg, int32_t recipient, int8_tArray return tag_ptr(ret_conv, true); } -int64_t CS_LDK_NodeSigner_sign_invoice(int64_t this_arg, int8_tArray hrp_bytes, ptrArray invoice_data, int32_t recipient) { +int64_t CS_LDK_NodeSigner_sign_invoice(int64_t this_arg, int64_t invoice, int32_t recipient) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKNodeSigner* this_arg_conv = (LDKNodeSigner*)this_arg_ptr; - LDKu8slice hrp_bytes_ref; - hrp_bytes_ref.datalen = hrp_bytes->arr_len; - hrp_bytes_ref.data = hrp_bytes->elems; - LDKCVec_U5Z invoice_data_constr; - invoice_data_constr.datalen = invoice_data->arr_len; - if (invoice_data_constr.datalen > 0) - invoice_data_constr.data = MALLOC(invoice_data_constr.datalen * sizeof(LDKU5), "LDKCVec_U5Z Elements"); - else - invoice_data_constr.data = NULL; - int8_t* invoice_data_vals = (void*) invoice_data->elems; - for (size_t h = 0; h < invoice_data_constr.datalen; h++) { - int8_t invoice_data_conv_7 = invoice_data_vals[h]; - - invoice_data_constr.data[h] = (LDKU5){ ._0 = invoice_data_conv_7 }; - } - FREE(invoice_data); + LDKRawBolt11Invoice invoice_conv; + invoice_conv.inner = untag_ptr(invoice); + invoice_conv.is_owned = ptr_is_owned(invoice); + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); + invoice_conv.is_owned = false; LDKRecipient recipient_conv = LDKRecipient_from_cs(recipient); LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); - *ret_conv = (this_arg_conv->sign_invoice)(this_arg_conv->this_arg, hrp_bytes_ref, invoice_data_constr, recipient_conv); - FREE(hrp_bytes); + *ret_conv = (this_arg_conv->sign_invoice)(this_arg_conv->this_arg, &invoice_conv, recipient_conv); return tag_ptr(ret_conv, true); } @@ -7369,33 +7712,33 @@ LDKThirtyTwoBytes generate_channel_keys_id_LDKSignerProvider_jcall(const void* t int64_t channel_value_satoshis_conv = channel_value_satoshis; int8_tArray user_channel_id_arr = init_int8_tArray(16, __LINE__); memcpy(user_channel_id_arr->elems, user_channel_id.le_bytes, 16); - int8_tArray ret = (int8_tArray)js_invoke_function_l_bll(j_calls->instance_ptr, 39, inbound_conv, channel_value_satoshis_conv, (int64_t)user_channel_id_arr); + int8_tArray ret = (int8_tArray)js_invoke_function_l_bll(j_calls->instance_ptr, 38, inbound_conv, channel_value_satoshis_conv, (int64_t)user_channel_id_arr); LDKThirtyTwoBytes ret_ref; CHECK(ret->arr_len == 32); memcpy(ret_ref.data, ret->elems, 32); FREE(ret); return ret_ref; } -LDKWriteableEcdsaChannelSigner derive_channel_signer_LDKSignerProvider_jcall(const void* this_arg, uint64_t channel_value_satoshis, LDKThirtyTwoBytes channel_keys_id) { +LDKEcdsaChannelSigner derive_channel_signer_LDKSignerProvider_jcall(const void* this_arg, uint64_t channel_value_satoshis, LDKThirtyTwoBytes channel_keys_id) { LDKSignerProvider_JCalls *j_calls = (LDKSignerProvider_JCalls*) this_arg; int64_t channel_value_satoshis_conv = channel_value_satoshis; int8_tArray channel_keys_id_arr = init_int8_tArray(32, __LINE__); memcpy(channel_keys_id_arr->elems, channel_keys_id.data, 32); - uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 40, channel_value_satoshis_conv, (int64_t)channel_keys_id_arr); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 39, channel_value_satoshis_conv, (int64_t)channel_keys_id_arr); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); - LDKWriteableEcdsaChannelSigner ret_conv = *(LDKWriteableEcdsaChannelSigner*)(ret_ptr); + LDKEcdsaChannelSigner ret_conv = *(LDKEcdsaChannelSigner*)(ret_ptr); FREE(untag_ptr(ret)); return ret_conv; } -LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ read_chan_signer_LDKSignerProvider_jcall(const void* this_arg, LDKu8slice reader) { +LDKCResult_EcdsaChannelSignerDecodeErrorZ read_chan_signer_LDKSignerProvider_jcall(const void* this_arg, LDKu8slice reader) { LDKSignerProvider_JCalls *j_calls = (LDKSignerProvider_JCalls*) this_arg; LDKu8slice reader_var = reader; int8_tArray reader_arr = init_int8_tArray(reader_var.datalen, __LINE__); memcpy(reader_arr->elems, reader_var.data, reader_var.datalen); - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 41, (int64_t)reader_arr); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 40, (int64_t)reader_arr); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ ret_conv = *(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)(ret_ptr); + LDKCResult_EcdsaChannelSignerDecodeErrorZ ret_conv = *(LDKCResult_EcdsaChannelSignerDecodeErrorZ*)(ret_ptr); FREE(untag_ptr(ret)); return ret_conv; } @@ -7403,7 +7746,7 @@ LDKCResult_CVec_u8ZNoneZ get_destination_script_LDKSignerProvider_jcall(const vo LDKSignerProvider_JCalls *j_calls = (LDKSignerProvider_JCalls*) this_arg; int8_tArray channel_keys_id_arr = init_int8_tArray(32, __LINE__); memcpy(channel_keys_id_arr->elems, channel_keys_id.data, 32); - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 42, (int64_t)channel_keys_id_arr); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 41, (int64_t)channel_keys_id_arr); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_CVec_u8ZNoneZ ret_conv = *(LDKCResult_CVec_u8ZNoneZ*)(ret_ptr); @@ -7412,7 +7755,7 @@ LDKCResult_CVec_u8ZNoneZ get_destination_script_LDKSignerProvider_jcall(const vo } LDKCResult_ShutdownScriptNoneZ get_shutdown_scriptpubkey_LDKSignerProvider_jcall(const void* this_arg) { LDKSignerProvider_JCalls *j_calls = (LDKSignerProvider_JCalls*) this_arg; - uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 43); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 42); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_ShutdownScriptNoneZ ret_conv = *(LDKCResult_ShutdownScriptNoneZ*)(ret_ptr); @@ -7463,7 +7806,7 @@ int64_t CS_LDK_SignerProvider_derive_channel_signer(int64_t this_arg, int64_t c LDKThirtyTwoBytes channel_keys_id_ref; CHECK(channel_keys_id->arr_len == 32); memcpy(channel_keys_id_ref.data, channel_keys_id->elems, 32); FREE(channel_keys_id); - LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner"); + LDKEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner"); *ret_ret = (this_arg_conv->derive_channel_signer)(this_arg_conv->this_arg, channel_value_satoshis, channel_keys_id_ref); return tag_ptr(ret_ret, true); } @@ -7475,7 +7818,7 @@ int64_t CS_LDK_SignerProvider_read_chan_signer(int64_t this_arg, int8_tArray re LDKu8slice reader_ref; reader_ref.datalen = reader->arr_len; reader_ref.data = reader->elems; - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ), "LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ"); + LDKCResult_EcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_EcdsaChannelSignerDecodeErrorZ), "LDKCResult_EcdsaChannelSignerDecodeErrorZ"); *ret_conv = (this_arg_conv->read_chan_signer)(this_arg_conv->this_arg, reader_ref); FREE(reader); return tag_ptr(ret_conv, true); @@ -7515,7 +7858,7 @@ static void LDKFeeEstimator_JCalls_free(void* this_arg) { uint32_t get_est_sat_per_1000_weight_LDKFeeEstimator_jcall(const void* this_arg, LDKConfirmationTarget confirmation_target) { LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg; int32_t confirmation_target_conv = LDKConfirmationTarget_to_cs(confirmation_target); - return js_invoke_function_i_ConfirmationTarget(j_calls->instance_ptr, 44, confirmation_target_conv); + return js_invoke_function_i_ConfirmationTarget(j_calls->instance_ptr, 43, confirmation_target_conv); } static void LDKFeeEstimator_JCalls_cloned(LDKFeeEstimator* new_obj) { LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) new_obj->this_arg; @@ -7575,17 +7918,20 @@ LDKCResult_OnionMessagePathNoneZ find_path_LDKMessageRouter_jcall(const void* th LDKDestination *destination_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); *destination_copy = destination; int64_t destination_ref = tag_ptr(destination_copy, true); - uint64_t ret = js_invoke_function_l_lll(j_calls->instance_ptr, 45, (int64_t)sender_arr, (int64_t)peers_arr, destination_ref); + uint64_t ret = js_invoke_function_l_lll(j_calls->instance_ptr, 44, (int64_t)sender_arr, (int64_t)peers_arr, destination_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_OnionMessagePathNoneZ ret_conv = *(LDKCResult_OnionMessagePathNoneZ*)(ret_ptr); FREE(untag_ptr(ret)); return ret_conv; } -LDKCResult_CVec_BlindedPathZNoneZ create_blinded_paths_LDKMessageRouter_jcall(const void* this_arg, LDKPublicKey recipient, LDKCVec_PublicKeyZ peers) { +LDKCResult_CVec_BlindedMessagePathZNoneZ create_blinded_paths_LDKMessageRouter_jcall(const void* this_arg, LDKPublicKey recipient, LDKMessageContext context, LDKCVec_PublicKeyZ peers) { LDKMessageRouter_JCalls *j_calls = (LDKMessageRouter_JCalls*) this_arg; int8_tArray recipient_arr = init_int8_tArray(33, __LINE__); memcpy(recipient_arr->elems, recipient.compressed_form, 33); + LDKMessageContext *context_copy = MALLOC(sizeof(LDKMessageContext), "LDKMessageContext"); + *context_copy = context; + int64_t context_ref = tag_ptr(context_copy, true); LDKCVec_PublicKeyZ peers_var = peers; ptrArray peers_arr = NULL; peers_arr = init_ptrArray(peers_var.datalen, __LINE__); @@ -7597,10 +7943,37 @@ LDKCResult_CVec_BlindedPathZNoneZ create_blinded_paths_LDKMessageRouter_jcall(co } FREE(peers_var.data); - uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 46, (int64_t)recipient_arr, (int64_t)peers_arr); + uint64_t ret = js_invoke_function_l_lll(j_calls->instance_ptr, 45, (int64_t)recipient_arr, context_ref, (int64_t)peers_arr); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); - LDKCResult_CVec_BlindedPathZNoneZ ret_conv = *(LDKCResult_CVec_BlindedPathZNoneZ*)(ret_ptr); + LDKCResult_CVec_BlindedMessagePathZNoneZ ret_conv = *(LDKCResult_CVec_BlindedMessagePathZNoneZ*)(ret_ptr); + FREE(untag_ptr(ret)); + return ret_conv; +} +LDKCResult_CVec_BlindedMessagePathZNoneZ create_compact_blinded_paths_LDKMessageRouter_jcall(const void* this_arg, LDKPublicKey recipient, LDKMessageContext context, LDKCVec_MessageForwardNodeZ peers) { + LDKMessageRouter_JCalls *j_calls = (LDKMessageRouter_JCalls*) this_arg; + int8_tArray recipient_arr = init_int8_tArray(33, __LINE__); + memcpy(recipient_arr->elems, recipient.compressed_form, 33); + LDKMessageContext *context_copy = MALLOC(sizeof(LDKMessageContext), "LDKMessageContext"); + *context_copy = context; + int64_t context_ref = tag_ptr(context_copy, true); + LDKCVec_MessageForwardNodeZ peers_var = peers; + int64_tArray peers_arr = NULL; + peers_arr = init_int64_tArray(peers_var.datalen, __LINE__); + int64_t *peers_arr_ptr = (int64_t*)(((uint8_t*)peers_arr) + 8); + for (size_t u = 0; u < peers_var.datalen; u++) { + LDKMessageForwardNode peers_conv_20_var = peers_var.data[u]; + int64_t peers_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(peers_conv_20_var); + peers_conv_20_ref = tag_ptr(peers_conv_20_var.inner, peers_conv_20_var.is_owned); + peers_arr_ptr[u] = peers_conv_20_ref; + } + + FREE(peers_var.data); + uint64_t ret = js_invoke_function_l_lll(j_calls->instance_ptr, 46, (int64_t)recipient_arr, context_ref, (int64_t)peers_arr); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_CVec_BlindedMessagePathZNoneZ ret_conv = *(LDKCResult_CVec_BlindedMessagePathZNoneZ*)(ret_ptr); FREE(untag_ptr(ret)); return ret_conv; } @@ -7617,6 +7990,7 @@ static inline LDKMessageRouter LDKMessageRouter_init (int64_t o) { .this_arg = (void*) calls, .find_path = find_path_LDKMessageRouter_jcall, .create_blinded_paths = create_blinded_paths_LDKMessageRouter_jcall, + .create_compact_blinded_paths = create_compact_blinded_paths_LDKMessageRouter_jcall, .free = LDKMessageRouter_JCalls_free, }; return ret; @@ -7657,13 +8031,17 @@ int64_t CS_LDK_MessageRouter_find_path(int64_t this_arg, int8_tArray sender, pt return tag_ptr(ret_conv, true); } -int64_t CS_LDK_MessageRouter_create_blinded_paths(int64_t this_arg, int8_tArray recipient, ptrArray peers) { +int64_t CS_LDK_MessageRouter_create_blinded_paths(int64_t this_arg, int8_tArray recipient, int64_t context, ptrArray peers) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKMessageRouter* this_arg_conv = (LDKMessageRouter*)this_arg_ptr; LDKPublicKey recipient_ref; CHECK(recipient->arr_len == 33); memcpy(recipient_ref.compressed_form, recipient->elems, 33); FREE(recipient); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKMessageContext context_conv = *(LDKMessageContext*)(context_ptr); + context_conv = MessageContext_clone((LDKMessageContext*)untag_ptr(context)); LDKCVec_PublicKeyZ peers_constr; peers_constr.datalen = peers->arr_len; if (peers_constr.datalen > 0) @@ -7679,8 +8057,41 @@ int64_t CS_LDK_MessageRouter_create_blinded_paths(int64_t this_arg, int8_tArray peers_constr.data[i] = peers_conv_8_ref; } FREE(peers); - LDKCResult_CVec_BlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPathZNoneZ), "LDKCResult_CVec_BlindedPathZNoneZ"); - *ret_conv = (this_arg_conv->create_blinded_paths)(this_arg_conv->this_arg, recipient_ref, peers_constr); + LDKCResult_CVec_BlindedMessagePathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedMessagePathZNoneZ), "LDKCResult_CVec_BlindedMessagePathZNoneZ"); + *ret_conv = (this_arg_conv->create_blinded_paths)(this_arg_conv->this_arg, recipient_ref, context_conv, peers_constr); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_MessageRouter_create_compact_blinded_paths(int64_t this_arg, int8_tArray recipient, int64_t context, int64_tArray peers) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKMessageRouter* this_arg_conv = (LDKMessageRouter*)this_arg_ptr; + LDKPublicKey recipient_ref; + CHECK(recipient->arr_len == 33); + memcpy(recipient_ref.compressed_form, recipient->elems, 33); FREE(recipient); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKMessageContext context_conv = *(LDKMessageContext*)(context_ptr); + context_conv = MessageContext_clone((LDKMessageContext*)untag_ptr(context)); + LDKCVec_MessageForwardNodeZ peers_constr; + peers_constr.datalen = peers->arr_len; + if (peers_constr.datalen > 0) + peers_constr.data = MALLOC(peers_constr.datalen * sizeof(LDKMessageForwardNode), "LDKCVec_MessageForwardNodeZ Elements"); + else + peers_constr.data = NULL; + int64_t* peers_vals = peers->elems; + for (size_t u = 0; u < peers_constr.datalen; u++) { + int64_t peers_conv_20 = peers_vals[u]; + LDKMessageForwardNode peers_conv_20_conv; + peers_conv_20_conv.inner = untag_ptr(peers_conv_20); + peers_conv_20_conv.is_owned = ptr_is_owned(peers_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(peers_conv_20_conv); + peers_conv_20_conv = MessageForwardNode_clone(&peers_conv_20_conv); + peers_constr.data[u] = peers_conv_20_conv; + } + FREE(peers); + LDKCResult_CVec_BlindedMessagePathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedMessagePathZNoneZ), "LDKCResult_CVec_BlindedMessagePathZNoneZ"); + *ret_conv = (this_arg_conv->create_compact_blinded_paths)(this_arg_conv->this_arg, recipient_ref, context_conv, peers_constr); return tag_ptr(ret_conv, true); } @@ -7769,7 +8180,7 @@ LDKCResult_RouteLightningErrorZ find_route_with_id_LDKRouter_jcall(const void* t FREE(untag_ptr(ret)); return ret_conv; } -LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ create_blinded_payment_paths_LDKRouter_jcall(const void* this_arg, LDKPublicKey recipient, LDKCVec_ChannelDetailsZ first_hops, LDKReceiveTlvs tlvs, uint64_t amount_msats) { +LDKCResult_CVec_BlindedPaymentPathZNoneZ create_blinded_payment_paths_LDKRouter_jcall(const void* this_arg, LDKPublicKey recipient, LDKCVec_ChannelDetailsZ first_hops, LDKReceiveTlvs tlvs, uint64_t amount_msats) { LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg; int8_tArray recipient_arr = init_int8_tArray(33, __LINE__); memcpy(recipient_arr->elems, recipient.compressed_form, 33); @@ -7794,7 +8205,7 @@ LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ create_blinded_payment_ uint64_t ret = js_invoke_function_l_llll(j_calls->instance_ptr, 49, (int64_t)recipient_arr, (int64_t)first_hops_arr, tlvs_ref, amount_msats_conv); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ ret_conv = *(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ*)(ret_ptr); + LDKCResult_CVec_BlindedPaymentPathZNoneZ ret_conv = *(LDKCResult_CVec_BlindedPaymentPathZNoneZ*)(ret_ptr); FREE(untag_ptr(ret)); return ret_conv; } @@ -7947,7 +8358,7 @@ int64_t CS_LDK_Router_create_blinded_payment_paths(int64_t this_arg, int8_tArra tlvs_conv.is_owned = ptr_is_owned(tlvs); CHECK_INNER_FIELD_ACCESS_OR_NULL(tlvs_conv); tlvs_conv = ReceiveTlvs_clone(&tlvs_conv); - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ), "LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ"); + LDKCResult_CVec_BlindedPaymentPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPaymentPathZNoneZ), "LDKCResult_CVec_BlindedPaymentPathZNoneZ"); *ret_conv = (this_arg_conv->create_blinded_payment_paths)(this_arg_conv->this_arg, recipient_ref, first_hops_constr, tlvs_conv, amount_msats); return tag_ptr(ret_conv, true); } @@ -8300,6 +8711,29 @@ static inline LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ CVec_C2 } return ret; } +static inline void CResult_NoneReplayEventZ_get_ok(LDKCResult_NoneReplayEventZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; +} +void CS_LDK_CResult_NoneReplayEventZ_get_ok(int64_t owner) { + LDKCResult_NoneReplayEventZ* owner_conv = (LDKCResult_NoneReplayEventZ*)untag_ptr(owner); + CResult_NoneReplayEventZ_get_ok(owner_conv); +} + +static inline struct LDKReplayEvent CResult_NoneReplayEventZ_get_err(LDKCResult_NoneReplayEventZ *NONNULL_PTR owner){ + LDKReplayEvent ret = *owner->contents.err; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_NoneReplayEventZ_get_err(int64_t owner) { + LDKCResult_NoneReplayEventZ* owner_conv = (LDKCResult_NoneReplayEventZ*)untag_ptr(owner); + LDKReplayEvent ret_var = CResult_NoneReplayEventZ_get_err(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_CommitmentTransactionZ CVec_CommitmentTransactionZ_clone(const LDKCVec_CommitmentTransactionZ *orig) { LDKCVec_CommitmentTransactionZ ret = { .data = MALLOC(sizeof(LDKCommitmentTransaction) * orig->datalen, "LDKCVec_CommitmentTransactionZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -8387,6 +8821,36 @@ int64_t CS_LDK_LDKBalance_ClaimableOnChannelClose_get_amount_satoshis(int64_t pt int64_t amount_satoshis_conv = obj->claimable_on_channel_close.amount_satoshis; return amount_satoshis_conv; } +int64_t CS_LDK_LDKBalance_ClaimableOnChannelClose_get_transaction_fee_satoshis(int64_t ptr) { + LDKBalance *obj = (LDKBalance*)untag_ptr(ptr); + CHECK(obj->tag == LDKBalance_ClaimableOnChannelClose); + int64_t transaction_fee_satoshis_conv = obj->claimable_on_channel_close.transaction_fee_satoshis; + return transaction_fee_satoshis_conv; +} +int64_t CS_LDK_LDKBalance_ClaimableOnChannelClose_get_outbound_payment_htlc_rounded_msat(int64_t ptr) { + LDKBalance *obj = (LDKBalance*)untag_ptr(ptr); + CHECK(obj->tag == LDKBalance_ClaimableOnChannelClose); + int64_t outbound_payment_htlc_rounded_msat_conv = obj->claimable_on_channel_close.outbound_payment_htlc_rounded_msat; + return outbound_payment_htlc_rounded_msat_conv; +} +int64_t CS_LDK_LDKBalance_ClaimableOnChannelClose_get_outbound_forwarded_htlc_rounded_msat(int64_t ptr) { + LDKBalance *obj = (LDKBalance*)untag_ptr(ptr); + CHECK(obj->tag == LDKBalance_ClaimableOnChannelClose); + int64_t outbound_forwarded_htlc_rounded_msat_conv = obj->claimable_on_channel_close.outbound_forwarded_htlc_rounded_msat; + return outbound_forwarded_htlc_rounded_msat_conv; +} +int64_t CS_LDK_LDKBalance_ClaimableOnChannelClose_get_inbound_claiming_htlc_rounded_msat(int64_t ptr) { + LDKBalance *obj = (LDKBalance*)untag_ptr(ptr); + CHECK(obj->tag == LDKBalance_ClaimableOnChannelClose); + int64_t inbound_claiming_htlc_rounded_msat_conv = obj->claimable_on_channel_close.inbound_claiming_htlc_rounded_msat; + return inbound_claiming_htlc_rounded_msat_conv; +} +int64_t CS_LDK_LDKBalance_ClaimableOnChannelClose_get_inbound_htlc_rounded_msat(int64_t ptr) { + LDKBalance *obj = (LDKBalance*)untag_ptr(ptr); + CHECK(obj->tag == LDKBalance_ClaimableOnChannelClose); + int64_t inbound_htlc_rounded_msat_conv = obj->claimable_on_channel_close.inbound_htlc_rounded_msat; + return inbound_htlc_rounded_msat_conv; +} int64_t CS_LDK_LDKBalance_ClaimableAwaitingConfirmations_get_amount_satoshis(int64_t ptr) { LDKBalance *obj = (LDKBalance*)untag_ptr(ptr); CHECK(obj->tag == LDKBalance_ClaimableAwaitingConfirmations); @@ -8399,6 +8863,12 @@ int32_t CS_LDK_LDKBalance_ClaimableAwaitingConfirmations_get_confirmation_height int32_t confirmation_height_conv = obj->claimable_awaiting_confirmations.confirmation_height; return confirmation_height_conv; } +int32_t CS_LDK_LDKBalance_ClaimableAwaitingConfirmations_get_source(int64_t ptr) { + LDKBalance *obj = (LDKBalance*)untag_ptr(ptr); + CHECK(obj->tag == LDKBalance_ClaimableAwaitingConfirmations); + int32_t source_conv = LDKBalanceSource_to_cs(obj->claimable_awaiting_confirmations.source); + return source_conv; +} int64_t CS_LDK_LDKBalance_ContentiousClaimable_get_amount_satoshis(int64_t ptr) { LDKBalance *obj = (LDKBalance*)untag_ptr(ptr); CHECK(obj->tag == LDKBalance_ContentiousClaimable); @@ -8444,6 +8914,12 @@ int8_tArray CS_LDK_LDKBalance_MaybeTimeoutClaimableHTLC_get_payment_hash(int64_t memcpy(payment_hash_arr->elems, obj->maybe_timeout_claimable_htlc.payment_hash.data, 32); return payment_hash_arr; } +jboolean CS_LDK_LDKBalance_MaybeTimeoutClaimableHTLC_get_outbound_payment(int64_t ptr) { + LDKBalance *obj = (LDKBalance*)untag_ptr(ptr); + CHECK(obj->tag == LDKBalance_MaybeTimeoutClaimableHTLC); + jboolean outbound_payment_conv = obj->maybe_timeout_claimable_htlc.outbound_payment; + return outbound_payment_conv; +} int64_t CS_LDK_LDKBalance_MaybePreimageClaimableHTLC_get_amount_satoshis(int64_t ptr) { LDKBalance *obj = (LDKBalance*)untag_ptr(ptr); CHECK(obj->tag == LDKBalance_MaybePreimageClaimableHTLC); @@ -8632,43 +9108,6 @@ static inline LDKCVec_C2Tuple_PublicKeyTypeZZ CVec_C2Tuple_PublicKeyTypeZZ_clone } return ret; } -static inline struct LDKPublicKey C2Tuple_PublicKeyCVec_SocketAddressZZ_get_a(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *NONNULL_PTR owner){ - return owner->a; -} -int8_tArray CS_LDK_C2Tuple_PublicKeyCVec_SocketAddressZZ_get_a(int64_t owner) { - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* owner_conv = (LDKC2Tuple_PublicKeyCVec_SocketAddressZZ*)untag_ptr(owner); - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, C2Tuple_PublicKeyCVec_SocketAddressZZ_get_a(owner_conv).compressed_form, 33); - return ret_arr; -} - -static inline struct LDKCVec_SocketAddressZ C2Tuple_PublicKeyCVec_SocketAddressZZ_get_b(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *NONNULL_PTR owner){ - return CVec_SocketAddressZ_clone(&owner->b); -} -int64_tArray CS_LDK_C2Tuple_PublicKeyCVec_SocketAddressZZ_get_b(int64_t owner) { - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* owner_conv = (LDKC2Tuple_PublicKeyCVec_SocketAddressZZ*)untag_ptr(owner); - LDKCVec_SocketAddressZ ret_var = C2Tuple_PublicKeyCVec_SocketAddressZZ_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 p = 0; p < ret_var.datalen; p++) { - LDKSocketAddress *ret_conv_15_copy = MALLOC(sizeof(LDKSocketAddress), "LDKSocketAddress"); - *ret_conv_15_copy = ret_var.data[p]; - int64_t ret_conv_15_ref = tag_ptr(ret_conv_15_copy, true); - ret_arr_ptr[p] = ret_conv_15_ref; - } - - FREE(ret_var.data); - return ret_arr; -} - -static inline LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ CVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ_clone(const LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ *orig) { - LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ) * orig->datalen, "LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C2Tuple_PublicKeyCVec_SocketAddressZZ_clone(&orig->data[i]); - } - return ret; -} typedef struct LDKOnionMessageContents_JCalls { atomic_size_t refcnt; uint32_t instance_ptr; @@ -8683,9 +9122,15 @@ uint64_t tlv_type_LDKOnionMessageContents_jcall(const void* this_arg) { LDKOnionMessageContents_JCalls *j_calls = (LDKOnionMessageContents_JCalls*) this_arg; return js_invoke_function_l_(j_calls->instance_ptr, 53); } +LDKStr msg_type_LDKOnionMessageContents_jcall(const void* this_arg) { + LDKOnionMessageContents_JCalls *j_calls = (LDKOnionMessageContents_JCalls*) this_arg; + jstring ret = (jstring)js_invoke_function_l_(j_calls->instance_ptr, 54); + LDKStr ret_conv = str_ref_to_owned_c(ret); + return ret_conv; +} LDKCVec_u8Z write_LDKOnionMessageContents_jcall(const void* this_arg) { LDKOnionMessageContents_JCalls *j_calls = (LDKOnionMessageContents_JCalls*) this_arg; - int8_tArray ret = (int8_tArray)js_invoke_function_l_(j_calls->instance_ptr, 54); + int8_tArray ret = (int8_tArray)js_invoke_function_l_(j_calls->instance_ptr, 55); LDKCVec_u8Z ret_ref; ret_ref.datalen = ret->arr_len; ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes"); @@ -8694,7 +9139,7 @@ LDKCVec_u8Z write_LDKOnionMessageContents_jcall(const void* this_arg) { } LDKStr debug_str_LDKOnionMessageContents_jcall(const void* this_arg) { LDKOnionMessageContents_JCalls *j_calls = (LDKOnionMessageContents_JCalls*) this_arg; - jstring ret = (jstring)js_invoke_function_l_(j_calls->instance_ptr, 55); + jstring ret = (jstring)js_invoke_function_l_(j_calls->instance_ptr, 56); LDKStr ret_conv = str_ref_to_owned_c(ret); return ret_conv; } @@ -8710,6 +9155,7 @@ static inline LDKOnionMessageContents LDKOnionMessageContents_init (int64_t o) { LDKOnionMessageContents ret = { .this_arg = (void*) calls, .tlv_type = tlv_type_LDKOnionMessageContents_jcall, + .msg_type = msg_type_LDKOnionMessageContents_jcall, .write = write_LDKOnionMessageContents_jcall, .debug_str = debug_str_LDKOnionMessageContents_jcall, .cloned = LDKOnionMessageContents_JCalls_cloned, @@ -8730,6 +9176,16 @@ int64_t CS_LDK_OnionMessageContents_tlv_type(int64_t this_arg) { return ret_conv; } +jstring CS_LDK_OnionMessageContents_msg_type(int64_t this_arg) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKOnionMessageContents* this_arg_conv = (LDKOnionMessageContents*)this_arg_ptr; + LDKStr ret_str = (this_arg_conv->msg_type)(this_arg_conv->this_arg); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + int8_tArray CS_LDK_OnionMessageContents_write(int64_t this_arg) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } @@ -8751,6 +9207,46 @@ jstring CS_LDK_OnionMessageContents_debug_str(int64_t this_arg) { return ret_conv; } +static inline struct LDKOnionMessageContents C2Tuple_OnionMessageContentsResponseInstructionZ_get_a(LDKC2Tuple_OnionMessageContentsResponseInstructionZ *NONNULL_PTR owner){ + return OnionMessageContents_clone(&owner->a); +} +int64_t CS_LDK_C2Tuple_OnionMessageContentsResponseInstructionZ_get_a(int64_t owner) { + LDKC2Tuple_OnionMessageContentsResponseInstructionZ* owner_conv = (LDKC2Tuple_OnionMessageContentsResponseInstructionZ*)untag_ptr(owner); + LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *ret_ret = C2Tuple_OnionMessageContentsResponseInstructionZ_get_a(owner_conv); + return tag_ptr(ret_ret, true); +} + +static inline struct LDKResponseInstruction C2Tuple_OnionMessageContentsResponseInstructionZ_get_b(LDKC2Tuple_OnionMessageContentsResponseInstructionZ *NONNULL_PTR owner){ + LDKResponseInstruction ret = owner->b; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_C2Tuple_OnionMessageContentsResponseInstructionZ_get_b(int64_t owner) { + LDKC2Tuple_OnionMessageContentsResponseInstructionZ* owner_conv = (LDKC2Tuple_OnionMessageContentsResponseInstructionZ*)untag_ptr(owner); + LDKResponseInstruction ret_var = C2Tuple_OnionMessageContentsResponseInstructionZ_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; +} + +uint32_t CS_LDK_LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_ty_from_ptr(int64_t ptr) { + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ *obj = (LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Some: return 0; + case LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_None: return 1; + default: abort(); + } +} +int64_t CS_LDK_LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Some_get_some(int64_t ptr) { + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ *obj = (LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ*)untag_ptr(ptr); + CHECK(obj->tag == LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Some); + LDKC2Tuple_OnionMessageContentsResponseInstructionZ* some_conv = MALLOC(sizeof(LDKC2Tuple_OnionMessageContentsResponseInstructionZ), "LDKC2Tuple_OnionMessageContentsResponseInstructionZ"); + *some_conv = obj->some; + *some_conv = C2Tuple_OnionMessageContentsResponseInstructionZ_clone(some_conv); + return tag_ptr(some_conv, true); +} uint32_t CS_LDK_LDKCOption_OnionMessageContentsZ_ty_from_ptr(int64_t ptr) { LDKCOption_OnionMessageContentsZ *obj = (LDKCOption_OnionMessageContentsZ*)untag_ptr(ptr); switch(obj->tag) { @@ -8790,45 +9286,31 @@ int64_t CS_LDK_CResult_COption_OnionMessageContentsZDecodeErrorZ_get_err(int64_ return ret_ref; } -static inline struct LDKOnionMessageContents C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_a(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *NONNULL_PTR owner){ +static inline struct LDKOnionMessageContents C2Tuple_OnionMessageContentsMessageSendInstructionsZ_get_a(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ *NONNULL_PTR owner){ return OnionMessageContents_clone(&owner->a); } -int64_t CS_LDK_C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_a(int64_t owner) { - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ* owner_conv = (LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ*)untag_ptr(owner); +int64_t CS_LDK_C2Tuple_OnionMessageContentsMessageSendInstructionsZ_get_a(int64_t owner) { + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ* owner_conv = (LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ*)untag_ptr(owner); LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); - *ret_ret = C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_a(owner_conv); + *ret_ret = C2Tuple_OnionMessageContentsMessageSendInstructionsZ_get_a(owner_conv); return tag_ptr(ret_ret, true); } -static inline struct LDKDestination C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_b(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *NONNULL_PTR owner){ - return Destination_clone(&owner->b); +static inline struct LDKMessageSendInstructions C2Tuple_OnionMessageContentsMessageSendInstructionsZ_get_b(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ *NONNULL_PTR owner){ + return MessageSendInstructions_clone(&owner->b); } -int64_t CS_LDK_C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_b(int64_t owner) { - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ* owner_conv = (LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ*)untag_ptr(owner); - LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); - *ret_copy = C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_b(owner_conv); +int64_t CS_LDK_C2Tuple_OnionMessageContentsMessageSendInstructionsZ_get_b(int64_t owner) { + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ* owner_conv = (LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ*)untag_ptr(owner); + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = C2Tuple_OnionMessageContentsMessageSendInstructionsZ_get_b(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline struct LDKBlindedPath C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_c(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *NONNULL_PTR owner){ - LDKBlindedPath ret = owner->c; - ret.is_owned = false; - return ret; -} -int64_t CS_LDK_C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_c(int64_t owner) { - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ* owner_conv = (LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ*)untag_ptr(owner); - LDKBlindedPath ret_var = C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_c(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_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ CVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ_clone(const LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ *orig) { - LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ) * orig->datalen, "LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ clone bytes"), .datalen = orig->datalen }; +static inline LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ CVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ_clone(const LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ *orig) { + LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ) * orig->datalen, "LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone(&orig->data[i]); + ret.data[i] = C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone(&orig->data[i]); } return ret; } @@ -9162,21 +9644,6 @@ int32_t CS_LDK_CResult_InvoiceRequestBolt12SemanticErrorZ_get_err(int64_t owner 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) { - case LDKCOption_SecretKeyZ_Some: return 0; - case LDKCOption_SecretKeyZ_None: return 1; - default: abort(); - } -} -int8_tArray CS_LDK_LDKCOption_SecretKeyZ_Some_get_some(int64_t ptr) { - LDKCOption_SecretKeyZ *obj = (LDKCOption_SecretKeyZ*)untag_ptr(ptr); - CHECK(obj->tag == LDKCOption_SecretKeyZ_Some); - int8_tArray some_arr = init_int8_tArray(32, __LINE__); - 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; @@ -9462,28 +9929,28 @@ int64_t CS_LDK_CResult_StfuDecodeErrorZ_get_err(int64_t owner) { return ret_ref; } -static inline struct LDKSplice CResult_SpliceDecodeErrorZ_get_ok(LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR owner){ - LDKSplice ret = *owner->contents.result; +static inline struct LDKSpliceInit CResult_SpliceInitDecodeErrorZ_get_ok(LDKCResult_SpliceInitDecodeErrorZ *NONNULL_PTR owner){ + LDKSpliceInit ret = *owner->contents.result; ret.is_owned = false; return ret; } -int64_t CS_LDK_CResult_SpliceDecodeErrorZ_get_ok(int64_t owner) { - LDKCResult_SpliceDecodeErrorZ* owner_conv = (LDKCResult_SpliceDecodeErrorZ*)untag_ptr(owner); - LDKSplice ret_var = CResult_SpliceDecodeErrorZ_get_ok(owner_conv); +int64_t CS_LDK_CResult_SpliceInitDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_SpliceInitDecodeErrorZ* owner_conv = (LDKCResult_SpliceInitDecodeErrorZ*)untag_ptr(owner); + LDKSpliceInit ret_var = CResult_SpliceInitDecodeErrorZ_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_SpliceDecodeErrorZ_get_err(LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_SpliceInitDecodeErrorZ_get_err(LDKCResult_SpliceInitDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return DecodeError_clone(&*owner->contents.err); } -int64_t CS_LDK_CResult_SpliceDecodeErrorZ_get_err(int64_t owner) { - LDKCResult_SpliceDecodeErrorZ* owner_conv = (LDKCResult_SpliceDecodeErrorZ*)untag_ptr(owner); +int64_t CS_LDK_CResult_SpliceInitDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_SpliceInitDecodeErrorZ* owner_conv = (LDKCResult_SpliceInitDecodeErrorZ*)untag_ptr(owner); LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_SpliceDecodeErrorZ_get_err(owner_conv); + *ret_copy = CResult_SpliceInitDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -9878,6 +10345,32 @@ int64_t CS_LDK_CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(int64_t owner) return ret_ref; } +static inline struct LDKCommitmentSignedBatch CResult_CommitmentSignedBatchDecodeErrorZ_get_ok(LDKCResult_CommitmentSignedBatchDecodeErrorZ *NONNULL_PTR owner){ + LDKCommitmentSignedBatch ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_CommitmentSignedBatchDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_CommitmentSignedBatchDecodeErrorZ* owner_conv = (LDKCResult_CommitmentSignedBatchDecodeErrorZ*)untag_ptr(owner); + LDKCommitmentSignedBatch ret_var = CResult_CommitmentSignedBatchDecodeErrorZ_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_CommitmentSignedBatchDecodeErrorZ_get_err(LDKCResult_CommitmentSignedBatchDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_CommitmentSignedBatchDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_CommitmentSignedBatchDecodeErrorZ* owner_conv = (LDKCResult_CommitmentSignedBatchDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_CommitmentSignedBatchDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline struct LDKCommitmentSigned CResult_CommitmentSignedDecodeErrorZ_get_ok(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR owner){ LDKCommitmentSigned ret = *owner->contents.result; ret.is_owned = false; @@ -10710,53 +11203,6 @@ int64_t CS_LDK_CResult_GossipTimestampFilterDecodeErrorZ_get_err(int64_t owner) return ret_ref; } -static inline LDKCVec_PhantomRouteHintsZ CVec_PhantomRouteHintsZ_clone(const LDKCVec_PhantomRouteHintsZ *orig) { - LDKCVec_PhantomRouteHintsZ ret = { .data = MALLOC(sizeof(LDKPhantomRouteHints) * orig->datalen, "LDKCVec_PhantomRouteHintsZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = PhantomRouteHints_clone(&orig->data[i]); - } - return ret; -} -uint32_t CS_LDK_LDKSignOrCreationError_ty_from_ptr(int64_t ptr) { - LDKSignOrCreationError *obj = (LDKSignOrCreationError*)untag_ptr(ptr); - switch(obj->tag) { - case LDKSignOrCreationError_SignError: return 0; - case LDKSignOrCreationError_CreationError: return 1; - default: abort(); - } -} -int32_t CS_LDK_LDKSignOrCreationError_CreationError_get_creation_error(int64_t ptr) { - LDKSignOrCreationError *obj = (LDKSignOrCreationError*)untag_ptr(ptr); - CHECK(obj->tag == LDKSignOrCreationError_CreationError); - int32_t creation_error_conv = LDKCreationError_to_cs(obj->creation_error); - return creation_error_conv; -} -static inline struct LDKBolt11Invoice CResult_Bolt11InvoiceSignOrCreationErrorZ_get_ok(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){ - LDKBolt11Invoice ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -int64_t CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_get_ok(int64_t owner) { - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(owner); - LDKBolt11Invoice ret_var = CResult_Bolt11InvoiceSignOrCreationErrorZ_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 LDKSignOrCreationError CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return SignOrCreationError_clone(&*owner->contents.err); -} -int64_t CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err(int64_t owner) { - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(owner); - LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError"); - *ret_copy = CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - uint32_t CS_LDK_LDKCOption_InboundHTLCStateDetailsZ_ty_from_ptr(int64_t ptr) { LDKCOption_InboundHTLCStateDetailsZ *obj = (LDKCOption_InboundHTLCStateDetailsZ*)untag_ptr(ptr); switch(obj->tag) { @@ -11013,6 +11459,82 @@ int64_t CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_get_err(int64_t owner) return ret_ref; } +static inline struct LDKHeldHtlcAvailable CResult_HeldHtlcAvailableDecodeErrorZ_get_ok(LDKCResult_HeldHtlcAvailableDecodeErrorZ *NONNULL_PTR owner){ + LDKHeldHtlcAvailable ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_HeldHtlcAvailableDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_HeldHtlcAvailableDecodeErrorZ* owner_conv = (LDKCResult_HeldHtlcAvailableDecodeErrorZ*)untag_ptr(owner); + LDKHeldHtlcAvailable ret_var = CResult_HeldHtlcAvailableDecodeErrorZ_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_HeldHtlcAvailableDecodeErrorZ_get_err(LDKCResult_HeldHtlcAvailableDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_HeldHtlcAvailableDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_HeldHtlcAvailableDecodeErrorZ* owner_conv = (LDKCResult_HeldHtlcAvailableDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_HeldHtlcAvailableDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKReleaseHeldHtlc CResult_ReleaseHeldHtlcDecodeErrorZ_get_ok(LDKCResult_ReleaseHeldHtlcDecodeErrorZ *NONNULL_PTR owner){ + LDKReleaseHeldHtlc ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_ReleaseHeldHtlcDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* owner_conv = (LDKCResult_ReleaseHeldHtlcDecodeErrorZ*)untag_ptr(owner); + LDKReleaseHeldHtlc ret_var = CResult_ReleaseHeldHtlcDecodeErrorZ_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_ReleaseHeldHtlcDecodeErrorZ_get_err(LDKCResult_ReleaseHeldHtlcDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_ReleaseHeldHtlcDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* owner_conv = (LDKCResult_ReleaseHeldHtlcDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ReleaseHeldHtlcDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKAsyncPaymentsMessage CResult_AsyncPaymentsMessageDecodeErrorZ_get_ok(LDKCResult_AsyncPaymentsMessageDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return AsyncPaymentsMessage_clone(&*owner->contents.result); +} +int64_t CS_LDK_CResult_AsyncPaymentsMessageDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* owner_conv = (LDKCResult_AsyncPaymentsMessageDecodeErrorZ*)untag_ptr(owner); + LDKAsyncPaymentsMessage *ret_copy = MALLOC(sizeof(LDKAsyncPaymentsMessage), "LDKAsyncPaymentsMessage"); + *ret_copy = CResult_AsyncPaymentsMessageDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_AsyncPaymentsMessageDecodeErrorZ_get_err(LDKCResult_AsyncPaymentsMessageDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_AsyncPaymentsMessageDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* owner_conv = (LDKCResult_AsyncPaymentsMessageDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_AsyncPaymentsMessageDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline struct LDKOffersMessage CResult_OffersMessageDecodeErrorZ_get_ok(LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return OffersMessage_clone(&*owner->contents.result); @@ -11427,6 +11949,55 @@ int64_t CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(int64_t own return ret_ref; } +uint32_t CS_LDK_LDKFundingInfo_ty_from_ptr(int64_t ptr) { + LDKFundingInfo *obj = (LDKFundingInfo*)untag_ptr(ptr); + switch(obj->tag) { + case LDKFundingInfo_Tx: return 0; + case LDKFundingInfo_OutPoint: return 1; + default: abort(); + } +} +int8_tArray CS_LDK_LDKFundingInfo_Tx_get_transaction(int64_t ptr) { + LDKFundingInfo *obj = (LDKFundingInfo*)untag_ptr(ptr); + CHECK(obj->tag == LDKFundingInfo_Tx); + LDKTransaction transaction_var = obj->tx.transaction; + int8_tArray transaction_arr = init_int8_tArray(transaction_var.datalen, __LINE__); + memcpy(transaction_arr->elems, transaction_var.data, transaction_var.datalen); + return transaction_arr; +} +int64_t CS_LDK_LDKFundingInfo_OutPoint_get_outpoint(int64_t ptr) { + LDKFundingInfo *obj = (LDKFundingInfo*)untag_ptr(ptr); + CHECK(obj->tag == LDKFundingInfo_OutPoint); + LDKOutPoint outpoint_var = obj->out_point.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; +} +static inline struct LDKFundingInfo CResult_FundingInfoDecodeErrorZ_get_ok(LDKCResult_FundingInfoDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return FundingInfo_clone(&*owner->contents.result); +} +int64_t CS_LDK_CResult_FundingInfoDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_FundingInfoDecodeErrorZ* owner_conv = (LDKCResult_FundingInfoDecodeErrorZ*)untag_ptr(owner); + LDKFundingInfo *ret_copy = MALLOC(sizeof(LDKFundingInfo), "LDKFundingInfo"); + *ret_copy = CResult_FundingInfoDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_FundingInfoDecodeErrorZ_get_err(LDKCResult_FundingInfoDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_FundingInfoDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_FundingInfoDecodeErrorZ* owner_conv = (LDKCResult_FundingInfoDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_FundingInfoDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + uint32_t CS_LDK_LDKPaymentPurpose_ty_from_ptr(int64_t ptr) { LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); switch(obj->tag) { @@ -11731,24 +12302,40 @@ int64_t CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(int64_t own return ret_ref; } -static inline enum LDKPaymentFailureReason CResult_PaymentFailureReasonDecodeErrorZ_get_ok(LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR owner){ +uint32_t CS_LDK_LDKCOption_PaymentFailureReasonZ_ty_from_ptr(int64_t ptr) { + LDKCOption_PaymentFailureReasonZ *obj = (LDKCOption_PaymentFailureReasonZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_PaymentFailureReasonZ_Some: return 0; + case LDKCOption_PaymentFailureReasonZ_None: return 1; + default: abort(); + } +} +int32_t CS_LDK_LDKCOption_PaymentFailureReasonZ_Some_get_some(int64_t ptr) { + LDKCOption_PaymentFailureReasonZ *obj = (LDKCOption_PaymentFailureReasonZ*)untag_ptr(ptr); + CHECK(obj->tag == LDKCOption_PaymentFailureReasonZ_Some); + int32_t some_conv = LDKPaymentFailureReason_to_cs(obj->some); + return some_conv; +} +static inline struct LDKCOption_PaymentFailureReasonZ CResult_COption_PaymentFailureReasonZDecodeErrorZ_get_ok(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return PaymentFailureReason_clone(&*owner->contents.result); + return COption_PaymentFailureReasonZ_clone(&*owner->contents.result); } -int32_t CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_get_ok(int64_t owner) { - LDKCResult_PaymentFailureReasonDecodeErrorZ* owner_conv = (LDKCResult_PaymentFailureReasonDecodeErrorZ*)untag_ptr(owner); - int32_t ret_conv = LDKPaymentFailureReason_to_cs(CResult_PaymentFailureReasonDecodeErrorZ_get_ok(owner_conv)); - return ret_conv; +int64_t CS_LDK_CResult_COption_PaymentFailureReasonZDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* owner_conv = (LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ*)untag_ptr(owner); + LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); + *ret_copy = CResult_COption_PaymentFailureReasonZDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -static inline struct LDKDecodeError CResult_PaymentFailureReasonDecodeErrorZ_get_err(LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_COption_PaymentFailureReasonZDecodeErrorZ_get_err(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return DecodeError_clone(&*owner->contents.err); } -int64_t CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_get_err(int64_t owner) { - LDKCResult_PaymentFailureReasonDecodeErrorZ* owner_conv = (LDKCResult_PaymentFailureReasonDecodeErrorZ*)untag_ptr(owner); +int64_t CS_LDK_CResult_COption_PaymentFailureReasonZDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* owner_conv = (LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ*)untag_ptr(owner); LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_PaymentFailureReasonDecodeErrorZ_get_err(owner_conv); + *ret_copy = CResult_COption_PaymentFailureReasonZDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -11775,20 +12362,6 @@ static inline LDKCVec_ClaimedHTLCZ CVec_ClaimedHTLCZ_clone(const LDKCVec_Claimed } return ret; } -uint32_t CS_LDK_LDKCOption_PaymentFailureReasonZ_ty_from_ptr(int64_t ptr) { - LDKCOption_PaymentFailureReasonZ *obj = (LDKCOption_PaymentFailureReasonZ*)untag_ptr(ptr); - switch(obj->tag) { - case LDKCOption_PaymentFailureReasonZ_Some: return 0; - case LDKCOption_PaymentFailureReasonZ_None: return 1; - default: abort(); - } -} -int32_t CS_LDK_LDKCOption_PaymentFailureReasonZ_Some_get_some(int64_t ptr) { - LDKCOption_PaymentFailureReasonZ *obj = (LDKCOption_PaymentFailureReasonZ*)untag_ptr(ptr); - CHECK(obj->tag == LDKCOption_PaymentFailureReasonZ_Some); - int32_t some_conv = LDKPaymentFailureReason_to_cs(obj->some); - return some_conv; -} uint32_t CS_LDK_LDKBumpTransactionEvent_ty_from_ptr(int64_t ptr) { LDKBumpTransactionEvent *obj = (LDKBumpTransactionEvent*)untag_ptr(ptr); switch(obj->tag) { @@ -11922,27 +12495,30 @@ uint32_t CS_LDK_LDKEvent_ty_from_ptr(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); switch(obj->tag) { case LDKEvent_FundingGenerationReady: return 0; - case LDKEvent_PaymentClaimable: return 1; - case LDKEvent_PaymentClaimed: return 2; - case LDKEvent_ConnectionNeeded: return 3; - case LDKEvent_InvoiceRequestFailed: return 4; - case LDKEvent_PaymentSent: return 5; - case LDKEvent_PaymentFailed: return 6; - case LDKEvent_PaymentPathSuccessful: return 7; - case LDKEvent_PaymentPathFailed: return 8; - case LDKEvent_ProbeSuccessful: return 9; - case LDKEvent_ProbeFailed: return 10; - case LDKEvent_PendingHTLCsForwardable: return 11; - case LDKEvent_HTLCIntercepted: return 12; - case LDKEvent_SpendableOutputs: return 13; - case LDKEvent_PaymentForwarded: return 14; - case LDKEvent_ChannelPending: return 15; - case LDKEvent_ChannelReady: return 16; - case LDKEvent_ChannelClosed: return 17; - case LDKEvent_DiscardFunding: return 18; - case LDKEvent_OpenChannelRequest: return 19; - case LDKEvent_HTLCHandlingFailed: return 20; - case LDKEvent_BumpTransaction: return 21; + case LDKEvent_FundingTxBroadcastSafe: return 1; + case LDKEvent_PaymentClaimable: return 2; + case LDKEvent_PaymentClaimed: return 3; + case LDKEvent_ConnectionNeeded: return 4; + case LDKEvent_InvoiceReceived: return 5; + case LDKEvent_PaymentSent: return 6; + case LDKEvent_PaymentFailed: return 7; + case LDKEvent_PaymentPathSuccessful: return 8; + case LDKEvent_PaymentPathFailed: return 9; + case LDKEvent_ProbeSuccessful: return 10; + case LDKEvent_ProbeFailed: return 11; + case LDKEvent_PendingHTLCsForwardable: return 12; + case LDKEvent_HTLCIntercepted: return 13; + case LDKEvent_SpendableOutputs: return 14; + case LDKEvent_PaymentForwarded: return 15; + case LDKEvent_ChannelPending: return 16; + case LDKEvent_ChannelReady: return 17; + case LDKEvent_ChannelClosed: return 18; + case LDKEvent_DiscardFunding: return 19; + case LDKEvent_OpenChannelRequest: return 20; + case LDKEvent_HTLCHandlingFailed: return 21; + case LDKEvent_BumpTransaction: return 22; + case LDKEvent_OnionMessageIntercepted: return 23; + case LDKEvent_OnionMessagePeerConnected: return 24; default: abort(); } } @@ -11983,6 +12559,47 @@ int8_tArray CS_LDK_LDKEvent_FundingGenerationReady_get_user_channel_id(int64_t p memcpy(user_channel_id_arr->elems, obj->funding_generation_ready.user_channel_id.le_bytes, 16); return user_channel_id_arr; } +int64_t CS_LDK_LDKEvent_FundingTxBroadcastSafe_get_channel_id(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_FundingTxBroadcastSafe); + LDKChannelId channel_id_var = obj->funding_tx_broadcast_safe.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_FundingTxBroadcastSafe_get_user_channel_id(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_FundingTxBroadcastSafe); + int8_tArray user_channel_id_arr = init_int8_tArray(16, __LINE__); + memcpy(user_channel_id_arr->elems, obj->funding_tx_broadcast_safe.user_channel_id.le_bytes, 16); + return user_channel_id_arr; +} +int64_t CS_LDK_LDKEvent_FundingTxBroadcastSafe_get_funding_txo(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_FundingTxBroadcastSafe); + LDKOutPoint funding_txo_var = obj->funding_tx_broadcast_safe.funding_txo; + int64_t funding_txo_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var); + funding_txo_ref = tag_ptr(funding_txo_var.inner, false); + return funding_txo_ref; +} +int8_tArray CS_LDK_LDKEvent_FundingTxBroadcastSafe_get_counterparty_node_id(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_FundingTxBroadcastSafe); + int8_tArray counterparty_node_id_arr = init_int8_tArray(33, __LINE__); + memcpy(counterparty_node_id_arr->elems, obj->funding_tx_broadcast_safe.counterparty_node_id.compressed_form, 33); + return counterparty_node_id_arr; +} +int64_t CS_LDK_LDKEvent_FundingTxBroadcastSafe_get_former_temporary_channel_id(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_FundingTxBroadcastSafe); + LDKChannelId former_temporary_channel_id_var = obj->funding_tx_broadcast_safe.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_PaymentClaimable_get_receiver_node_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_PaymentClaimable); @@ -12094,6 +12711,15 @@ int64_t CS_LDK_LDKEvent_PaymentClaimed_get_sender_intended_total_msat(int64_t pt int64_t sender_intended_total_msat_ref = tag_ptr(&obj->payment_claimed.sender_intended_total_msat, false); return sender_intended_total_msat_ref; } +int64_t CS_LDK_LDKEvent_PaymentClaimed_get_onion_fields(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_PaymentClaimed); + LDKRecipientOnionFields onion_fields_var = obj->payment_claimed.onion_fields; + int64_t onion_fields_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(onion_fields_var); + onion_fields_ref = tag_ptr(onion_fields_var.inner, false); + return onion_fields_ref; +} int8_tArray CS_LDK_LDKEvent_ConnectionNeeded_get_node_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_ConnectionNeeded); @@ -12115,13 +12741,37 @@ int64_tArray CS_LDK_LDKEvent_ConnectionNeeded_get_addresses(int64_t ptr) { return addresses_arr; } -int8_tArray CS_LDK_LDKEvent_InvoiceRequestFailed_get_payment_id(int64_t ptr) { +int8_tArray CS_LDK_LDKEvent_InvoiceReceived_get_payment_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); - CHECK(obj->tag == LDKEvent_InvoiceRequestFailed); + CHECK(obj->tag == LDKEvent_InvoiceReceived); int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__); - memcpy(payment_id_arr->elems, obj->invoice_request_failed.payment_id.data, 32); + memcpy(payment_id_arr->elems, obj->invoice_received.payment_id.data, 32); return payment_id_arr; } +int64_t CS_LDK_LDKEvent_InvoiceReceived_get_invoice(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_InvoiceReceived); + LDKBolt12Invoice invoice_var = obj->invoice_received.invoice; + int64_t invoice_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_var); + invoice_ref = tag_ptr(invoice_var.inner, false); + return invoice_ref; +} +int64_t CS_LDK_LDKEvent_InvoiceReceived_get_context(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_InvoiceReceived); + int64_t context_ref = tag_ptr(&obj->invoice_received.context, false); + return context_ref; +} +int64_t CS_LDK_LDKEvent_InvoiceReceived_get_responder(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_InvoiceReceived); + LDKResponder responder_var = obj->invoice_received.responder; + int64_t responder_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(responder_var); + responder_ref = tag_ptr(responder_var.inner, false); + return responder_ref; +} int64_t CS_LDK_LDKEvent_PaymentSent_get_payment_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_PaymentSent); @@ -12155,12 +12805,11 @@ int8_tArray CS_LDK_LDKEvent_PaymentFailed_get_payment_id(int64_t ptr) { memcpy(payment_id_arr->elems, obj->payment_failed.payment_id.data, 32); return payment_id_arr; } -int8_tArray CS_LDK_LDKEvent_PaymentFailed_get_payment_hash(int64_t ptr) { +int64_t CS_LDK_LDKEvent_PaymentFailed_get_payment_hash(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_PaymentFailed); - int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__); - memcpy(payment_hash_arr->elems, obj->payment_failed.payment_hash.data, 32); - return payment_hash_arr; + int64_t payment_hash_ref = tag_ptr(&obj->payment_failed.payment_hash, false); + return payment_hash_ref; } int64_t CS_LDK_LDKEvent_PaymentFailed_get_reason(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -12532,13 +13181,11 @@ int64_t CS_LDK_LDKEvent_DiscardFunding_get_channel_id(int64_t ptr) { 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) { +int64_t CS_LDK_LDKEvent_DiscardFunding_get_funding_info(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_DiscardFunding); - LDKTransaction transaction_var = obj->discard_funding.transaction; - int8_tArray transaction_arr = init_int8_tArray(transaction_var.datalen, __LINE__); - memcpy(transaction_arr->elems, transaction_var.data, transaction_var.datalen); - return transaction_arr; + int64_t funding_info_ref = tag_ptr(&obj->discard_funding.funding_info, false); + return funding_info_ref; } int64_t CS_LDK_LDKEvent_OpenChannelRequest_get_temporary_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -12577,6 +13224,21 @@ 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; } +jboolean CS_LDK_LDKEvent_OpenChannelRequest_get_is_announced(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_OpenChannelRequest); + jboolean is_announced_conv = obj->open_channel_request.is_announced; + return is_announced_conv; +} +int64_t CS_LDK_LDKEvent_OpenChannelRequest_get_params(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_OpenChannelRequest); + LDKChannelParameters params_var = obj->open_channel_request.params; + int64_t params_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_var); + params_ref = tag_ptr(params_var.inner, false); + return params_ref; +} int64_t CS_LDK_LDKEvent_HTLCHandlingFailed_get_prev_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_HTLCHandlingFailed); @@ -12598,6 +13260,29 @@ int64_t CS_LDK_LDKEvent_BumpTransaction_get_bump_transaction(int64_t ptr) { int64_t bump_transaction_ref = tag_ptr(&obj->bump_transaction, false); return bump_transaction_ref; } +int8_tArray CS_LDK_LDKEvent_OnionMessageIntercepted_get_peer_node_id(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_OnionMessageIntercepted); + int8_tArray peer_node_id_arr = init_int8_tArray(33, __LINE__); + memcpy(peer_node_id_arr->elems, obj->onion_message_intercepted.peer_node_id.compressed_form, 33); + return peer_node_id_arr; +} +int64_t CS_LDK_LDKEvent_OnionMessageIntercepted_get_message(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_OnionMessageIntercepted); + LDKOnionMessage message_var = obj->onion_message_intercepted.message; + int64_t message_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_var); + message_ref = tag_ptr(message_var.inner, false); + return message_ref; +} +int8_tArray CS_LDK_LDKEvent_OnionMessagePeerConnected_get_peer_node_id(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_OnionMessagePeerConnected); + int8_tArray peer_node_id_arr = init_int8_tArray(33, __LINE__); + memcpy(peer_node_id_arr->elems, obj->onion_message_peer_connected.peer_node_id.compressed_form, 33); + return peer_node_id_arr; +} uint32_t CS_LDK_LDKCOption_EventZ_ty_from_ptr(int64_t ptr) { LDKCOption_EventZ *obj = (LDKCOption_EventZ*)untag_ptr(ptr); switch(obj->tag) { @@ -12636,6 +13321,39 @@ int64_t CS_LDK_CResult_COption_EventZDecodeErrorZ_get_err(int64_t owner) { return ret_ref; } +static inline struct LDKNonce CResult_NonceDecodeErrorZ_get_ok(LDKCResult_NonceDecodeErrorZ *NONNULL_PTR owner){ + LDKNonce ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_NonceDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_NonceDecodeErrorZ* owner_conv = (LDKCResult_NonceDecodeErrorZ*)untag_ptr(owner); + LDKNonce ret_var = CResult_NonceDecodeErrorZ_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_NonceDecodeErrorZ_get_err(LDKCResult_NonceDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_NonceDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_NonceDecodeErrorZ* owner_conv = (LDKCResult_NonceDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_NonceDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline LDKCVec_RouteHintHopZ CVec_RouteHintHopZ_clone(const LDKCVec_RouteHintHopZ *orig) { + LDKCVec_RouteHintHopZ ret = { .data = MALLOC(sizeof(LDKRouteHintHop) * orig->datalen, "LDKCVec_RouteHintHopZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = RouteHintHop_clone(&orig->data[i]); + } + return ret; +} uint32_t CS_LDK_LDKBolt11ParseError_ty_from_ptr(int64_t ptr) { LDKBolt11ParseError *obj = (LDKBolt11ParseError*)untag_ptr(ptr); switch(obj->tag) { @@ -13021,6 +13739,32 @@ int64_t CS_LDK_CResult_BigSizeDecodeErrorZ_get_err(int64_t owner) { return ret_ref; } +static inline struct LDKUntrustedString CResult_UntrustedStringDecodeErrorZ_get_ok(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR owner){ + LDKUntrustedString ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_UntrustedStringDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_UntrustedStringDecodeErrorZ* owner_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(owner); + LDKUntrustedString ret_var = CResult_UntrustedStringDecodeErrorZ_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_UntrustedStringDecodeErrorZ_get_err(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_UntrustedStringDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_UntrustedStringDecodeErrorZ* owner_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_UntrustedStringDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline struct LDKHostname CResult_HostnameDecodeErrorZ_get_ok(LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR owner){ LDKHostname ret = *owner->contents.result; ret.is_owned = false; @@ -13096,32 +13840,6 @@ int64_t CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_get_err(int64_t own return ret_ref; } -static inline struct LDKUntrustedString CResult_UntrustedStringDecodeErrorZ_get_ok(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR owner){ - LDKUntrustedString ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -int64_t CS_LDK_CResult_UntrustedStringDecodeErrorZ_get_ok(int64_t owner) { - LDKCResult_UntrustedStringDecodeErrorZ* owner_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(owner); - LDKUntrustedString ret_var = CResult_UntrustedStringDecodeErrorZ_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_UntrustedStringDecodeErrorZ_get_err(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -int64_t CS_LDK_CResult_UntrustedStringDecodeErrorZ_get_err(int64_t owner) { - LDKCResult_UntrustedStringDecodeErrorZ* owner_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_UntrustedStringDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - 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; @@ -13167,6 +13885,62 @@ int16_t CS_LDK_C2Tuple__u832u16Z_get_b(int64_t owner) { return ret_conv; } +static inline struct LDKBlindedPayInfo CResult_BlindedPayInfoDecodeErrorZ_get_ok(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR owner){ + LDKBlindedPayInfo ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_BlindedPayInfoDecodeErrorZ* owner_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(owner); + LDKBlindedPayInfo ret_var = CResult_BlindedPayInfoDecodeErrorZ_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_BlindedPayInfoDecodeErrorZ_get_err(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_BlindedPayInfoDecodeErrorZ* owner_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_BlindedPayInfoDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKBlindedPaymentPath CResult_BlindedPaymentPathNoneZ_get_ok(LDKCResult_BlindedPaymentPathNoneZ *NONNULL_PTR owner){ + LDKBlindedPaymentPath ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_BlindedPaymentPathNoneZ_get_ok(int64_t owner) { + LDKCResult_BlindedPaymentPathNoneZ* owner_conv = (LDKCResult_BlindedPaymentPathNoneZ*)untag_ptr(owner); + LDKBlindedPaymentPath ret_var = CResult_BlindedPaymentPathNoneZ_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_BlindedPaymentPathNoneZ_get_err(LDKCResult_BlindedPaymentPathNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +void CS_LDK_CResult_BlindedPaymentPathNoneZ_get_err(int64_t owner) { + LDKCResult_BlindedPaymentPathNoneZ* owner_conv = (LDKCResult_BlindedPaymentPathNoneZ*)untag_ptr(owner); + CResult_BlindedPaymentPathNoneZ_get_err(owner_conv); +} + +static inline LDKCVec_PaymentForwardNodeZ CVec_PaymentForwardNodeZ_clone(const LDKCVec_PaymentForwardNodeZ *orig) { + LDKCVec_PaymentForwardNodeZ ret = { .data = MALLOC(sizeof(LDKPaymentForwardNode) * orig->datalen, "LDKCVec_PaymentForwardNodeZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = PaymentForwardNode_clone(&orig->data[i]); + } + return ret; +} static inline struct LDKPaymentRelay CResult_PaymentRelayDecodeErrorZ_get_ok(LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR owner){ LDKPaymentRelay ret = *owner->contents.result; ret.is_owned = false; @@ -13321,85 +14095,46 @@ int64_t CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_get_err(int64_t owner) { 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); -} -int8_tArray CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_a(int64_t owner) { - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* owner_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(owner); - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_a(owner_conv).data, 32); - return ret_arr; -} - -static inline struct LDKRecipientOnionFields C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_b(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR owner){ - LDKRecipientOnionFields ret = owner->b; +static inline struct LDKResponder CResult_ResponderDecodeErrorZ_get_ok(LDKCResult_ResponderDecodeErrorZ *NONNULL_PTR owner){ + LDKResponder ret = *owner->contents.result; ret.is_owned = false; return ret; } -int64_t CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_b(int64_t owner) { - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* owner_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(owner); - LDKRecipientOnionFields ret_var = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_b(owner_conv); +int64_t CS_LDK_CResult_ResponderDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_ResponderDecodeErrorZ* owner_conv = (LDKCResult_ResponderDecodeErrorZ*)untag_ptr(owner); + LDKResponder ret_var = CResult_ResponderDecodeErrorZ_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 LDKRouteParameters C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_c(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR owner){ - LDKRouteParameters ret = owner->c; - ret.is_owned = false; - return ret; +static inline struct LDKDecodeError CResult_ResponderDecodeErrorZ_get_err(LDKCResult_ResponderDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } -int64_t CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_c(int64_t owner) { - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* owner_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(owner); - LDKRouteParameters ret_var = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_c(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); +int64_t CS_LDK_CResult_ResponderDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_ResponderDecodeErrorZ* owner_conv = (LDKCResult_ResponderDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ResponderDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_ok(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(&*owner->contents.result); -} -int64_t CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_ok(int64_t owner) { - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* owner_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(owner); - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ), "LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ"); - *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_ok(owner_conv); - return tag_ptr(ret_conv, true); -} - -static inline void CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_err(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; +uint32_t CS_LDK_LDKCOption_MessageContextZ_ty_from_ptr(int64_t ptr) { + LDKCOption_MessageContextZ *obj = (LDKCOption_MessageContextZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_MessageContextZ_Some: return 0; + case LDKCOption_MessageContextZ_None: return 1; + default: abort(); + } } -void CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_err(int64_t owner) { - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* owner_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(owner); - CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_err(owner_conv); +int64_t CS_LDK_LDKCOption_MessageContextZ_Some_get_some(int64_t ptr) { + LDKCOption_MessageContextZ *obj = (LDKCOption_MessageContextZ*)untag_ptr(ptr); + CHECK(obj->tag == LDKCOption_MessageContextZ_Some); + int64_t some_ref = tag_ptr(&obj->some, false); + return some_ref; } - static inline struct LDKPublicKey C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_get_a(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *NONNULL_PTR owner){ return owner->a; } @@ -13558,17 +14293,16 @@ int64_t CS_LDK_LDKPeeledOnion_Receive_get__0(int64_t ptr) { int64_t _0_ref = tag_ptr(&obj->receive._0, false); return _0_ref; } -int8_tArray CS_LDK_LDKPeeledOnion_Receive_get__1(int64_t ptr) { +int64_t CS_LDK_LDKPeeledOnion_Receive_get__1(int64_t ptr) { LDKPeeledOnion *obj = (LDKPeeledOnion*)untag_ptr(ptr); CHECK(obj->tag == LDKPeeledOnion_Receive); - int8_tArray _1_arr = init_int8_tArray(32, __LINE__); - memcpy(_1_arr->elems, obj->receive._1.data, 32); - return _1_arr; + int64_t _1_ref = tag_ptr(&obj->receive._1, false); + return _1_ref; } int64_t CS_LDK_LDKPeeledOnion_Receive_get__2(int64_t ptr) { LDKPeeledOnion *obj = (LDKPeeledOnion*)untag_ptr(ptr); CHECK(obj->tag == LDKPeeledOnion_Receive); - LDKBlindedPath _2_var = obj->receive._2; + LDKBlindedMessagePath _2_var = obj->receive._2; int64_t _2_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(_2_var); _2_ref = tag_ptr(_2_var.inner, false); @@ -13634,104 +14368,96 @@ int64_t CS_LDK_CResult_SendSuccessSendErrorZ_get_err(int64_t owner) { return ret_ref; } -static inline struct LDKBlindedPath CResult_BlindedPathNoneZ_get_ok(LDKCResult_BlindedPathNoneZ *NONNULL_PTR owner){ - LDKBlindedPath ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -int64_t CS_LDK_CResult_BlindedPathNoneZ_get_ok(int64_t owner) { - LDKCResult_BlindedPathNoneZ* owner_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(owner); - LDKBlindedPath ret_var = CResult_BlindedPathNoneZ_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_BlindedPathNoneZ_get_err(LDKCResult_BlindedPathNoneZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; -} -void CS_LDK_CResult_BlindedPathNoneZ_get_err(int64_t owner) { - LDKCResult_BlindedPathNoneZ* owner_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(owner); - CResult_BlindedPathNoneZ_get_err(owner_conv); -} - -static inline struct LDKC2Tuple_BlindedPayInfoBlindedPathZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_get_ok(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR owner){ +static inline void CResult_NoneSendErrorZ_get_ok(LDKCResult_NoneSendErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return C2Tuple_BlindedPayInfoBlindedPathZ_clone(&*owner->contents.result); + return *owner->contents.result; } -int64_t CS_LDK_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_get_ok(int64_t owner) { - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* owner_conv = (LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ*)untag_ptr(owner); - LDKC2Tuple_BlindedPayInfoBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ"); - *ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_get_ok(owner_conv); - return tag_ptr(ret_conv, true); +void CS_LDK_CResult_NoneSendErrorZ_get_ok(int64_t owner) { + LDKCResult_NoneSendErrorZ* owner_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(owner); + CResult_NoneSendErrorZ_get_ok(owner_conv); } -static inline void CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_get_err(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR owner){ +static inline struct LDKSendError CResult_NoneSendErrorZ_get_err(LDKCResult_NoneSendErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); - return *owner->contents.err; + return SendError_clone(&*owner->contents.err); } -void CS_LDK_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_get_err(int64_t owner) { - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* owner_conv = (LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ*)untag_ptr(owner); - CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_get_err(owner_conv); +int64_t CS_LDK_CResult_NoneSendErrorZ_get_err(int64_t owner) { + LDKCResult_NoneSendErrorZ* owner_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(owner); + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = CResult_NoneSendErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -static inline LDKCVec_ForwardNodeZ CVec_ForwardNodeZ_clone(const LDKCVec_ForwardNodeZ *orig) { - LDKCVec_ForwardNodeZ ret = { .data = MALLOC(sizeof(LDKForwardNode) * orig->datalen, "LDKCVec_ForwardNodeZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = ForwardNode_clone(&orig->data[i]); - } - return ret; -} -static inline struct LDKBlindedPath CResult_BlindedPathDecodeErrorZ_get_ok(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR owner){ - LDKBlindedPath ret = *owner->contents.result; +static inline struct LDKBlindedHop CResult_BlindedHopDecodeErrorZ_get_ok(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){ + LDKBlindedHop ret = *owner->contents.result; ret.is_owned = false; return ret; } -int64_t CS_LDK_CResult_BlindedPathDecodeErrorZ_get_ok(int64_t owner) { - LDKCResult_BlindedPathDecodeErrorZ* owner_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(owner); - LDKBlindedPath ret_var = CResult_BlindedPathDecodeErrorZ_get_ok(owner_conv); +int64_t CS_LDK_CResult_BlindedHopDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner); + LDKBlindedHop ret_var = CResult_BlindedHopDecodeErrorZ_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_BlindedPathDecodeErrorZ_get_err(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_BlindedHopDecodeErrorZ_get_err(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return DecodeError_clone(&*owner->contents.err); } -int64_t CS_LDK_CResult_BlindedPathDecodeErrorZ_get_err(int64_t owner) { - LDKCResult_BlindedPathDecodeErrorZ* owner_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(owner); +int64_t CS_LDK_CResult_BlindedHopDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner); LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_BlindedPathDecodeErrorZ_get_err(owner_conv); + *ret_copy = CResult_BlindedHopDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline struct LDKBlindedHop CResult_BlindedHopDecodeErrorZ_get_ok(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){ - LDKBlindedHop ret = *owner->contents.result; +static inline LDKCVec_PhantomRouteHintsZ CVec_PhantomRouteHintsZ_clone(const LDKCVec_PhantomRouteHintsZ *orig) { + LDKCVec_PhantomRouteHintsZ ret = { .data = MALLOC(sizeof(LDKPhantomRouteHints) * orig->datalen, "LDKCVec_PhantomRouteHintsZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = PhantomRouteHints_clone(&orig->data[i]); + } + return ret; +} +uint32_t CS_LDK_LDKSignOrCreationError_ty_from_ptr(int64_t ptr) { + LDKSignOrCreationError *obj = (LDKSignOrCreationError*)untag_ptr(ptr); + switch(obj->tag) { + case LDKSignOrCreationError_SignError: return 0; + case LDKSignOrCreationError_CreationError: return 1; + default: abort(); + } +} +int32_t CS_LDK_LDKSignOrCreationError_CreationError_get_creation_error(int64_t ptr) { + LDKSignOrCreationError *obj = (LDKSignOrCreationError*)untag_ptr(ptr); + CHECK(obj->tag == LDKSignOrCreationError_CreationError); + int32_t creation_error_conv = LDKCreationError_to_cs(obj->creation_error); + return creation_error_conv; +} +static inline struct LDKBolt11Invoice CResult_Bolt11InvoiceSignOrCreationErrorZ_get_ok(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){ + LDKBolt11Invoice ret = *owner->contents.result; ret.is_owned = false; return ret; } -int64_t CS_LDK_CResult_BlindedHopDecodeErrorZ_get_ok(int64_t owner) { - LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner); - LDKBlindedHop ret_var = CResult_BlindedHopDecodeErrorZ_get_ok(owner_conv); +int64_t CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_get_ok(int64_t owner) { + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(owner); + LDKBolt11Invoice ret_var = CResult_Bolt11InvoiceSignOrCreationErrorZ_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_BlindedHopDecodeErrorZ_get_err(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKSignOrCreationError CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); + return SignOrCreationError_clone(&*owner->contents.err); } -int64_t CS_LDK_CResult_BlindedHopDecodeErrorZ_get_err(int64_t owner) { - LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_BlindedHopDecodeErrorZ_get_err(owner_conv); +int64_t CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err(int64_t owner) { + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(owner); + LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError"); + *ret_copy = CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -13899,7 +14625,7 @@ void register_tx_LDKFilter_jcall(const void* this_arg, const uint8_t (* txid)[32 LDKu8slice script_pubkey_var = script_pubkey; int8_tArray script_pubkey_arr = init_int8_tArray(script_pubkey_var.datalen, __LINE__); memcpy(script_pubkey_arr->elems, script_pubkey_var.data, script_pubkey_var.datalen); - js_invoke_function_void_ll(j_calls->instance_ptr, 56, (int64_t)txid_arr, (int64_t)script_pubkey_arr); + js_invoke_function_void_ll(j_calls->instance_ptr, 57, (int64_t)txid_arr, (int64_t)script_pubkey_arr); } void register_output_LDKFilter_jcall(const void* this_arg, LDKWatchedOutput output) { LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg; @@ -13907,7 +14633,7 @@ void register_output_LDKFilter_jcall(const void* this_arg, LDKWatchedOutput outp int64_t output_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(output_var); output_ref = tag_ptr(output_var.inner, output_var.is_owned); - js_invoke_function_void_l(j_calls->instance_ptr, 57, output_ref); + js_invoke_function_void_l(j_calls->instance_ptr, 58, output_ref); } static void LDKFilter_JCalls_cloned(LDKFilter* new_obj) { LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) new_obj->this_arg; @@ -13997,7 +14723,7 @@ static void LDKChangeDestinationSource_JCalls_free(void* this_arg) { } 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); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 59); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_CVec_u8ZNoneZ ret_conv = *(LDKCResult_CVec_u8ZNoneZ*)(ret_ptr); @@ -14055,7 +14781,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, 59, (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, 60, (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); @@ -14076,7 +14802,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, 60, (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, 61, (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); @@ -14095,7 +14821,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, 61, (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, 62, (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); @@ -14110,7 +14836,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, 62, (int64_t)primary_namespace_conv, (int64_t)secondary_namespace_conv); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 63, (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); @@ -14235,7 +14961,7 @@ LDKCResult_TransactionNoneZ spend_spendable_outputs_LDKOutputSpender_jcall(const 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); + uint64_t ret = js_invoke_function_l_lllil(j_calls->instance_ptr, 64, (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_TransactionNoneZ ret_conv = *(LDKCResult_TransactionNoneZ*)(ret_ptr); @@ -14602,55 +15328,142 @@ static inline LDKCVec_C2Tuple_OutPointChannelIdZZ CVec_C2Tuple_OutPointChannelId } 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){ +static inline struct LDKOutPoint C2Tuple_OutPointCVec_u64ZZ_get_a(LDKC2Tuple_OutPointCVec_u64ZZ *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 CS_LDK_C2Tuple_OutPointCVec_u64ZZ_get_a(int64_t owner) { + LDKC2Tuple_OutPointCVec_u64ZZ* owner_conv = (LDKC2Tuple_OutPointCVec_u64ZZ*)untag_ptr(owner); + LDKOutPoint ret_var = C2Tuple_OutPointCVec_u64ZZ_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); +static inline struct LDKCVec_u64Z C2Tuple_OutPointCVec_u64ZZ_get_b(LDKC2Tuple_OutPointCVec_u64ZZ *NONNULL_PTR owner){ + return CVec_u64Z_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 CS_LDK_C2Tuple_OutPointCVec_u64ZZ_get_b(int64_t owner) { + LDKC2Tuple_OutPointCVec_u64ZZ* owner_conv = (LDKC2Tuple_OutPointCVec_u64ZZ*)untag_ptr(owner); + LDKCVec_u64Z ret_var = C2Tuple_OutPointCVec_u64ZZ_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; + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; } 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 }; +static inline LDKCVec_C2Tuple_OutPointCVec_u64ZZZ CVec_C2Tuple_OutPointCVec_u64ZZZ_clone(const LDKCVec_C2Tuple_OutPointCVec_u64ZZZ *orig) { + LDKCVec_C2Tuple_OutPointCVec_u64ZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_u64ZZ) * orig->datalen, "LDKCVec_C2Tuple_OutPointCVec_u64ZZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(&orig->data[i]); + ret.data[i] = C2Tuple_OutPointCVec_u64ZZ_clone(&orig->data[i]); } return ret; } +static inline struct LDKBlindedMessagePath CResult_BlindedMessagePathDecodeErrorZ_get_ok(LDKCResult_BlindedMessagePathDecodeErrorZ *NONNULL_PTR owner){ + LDKBlindedMessagePath ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_BlindedMessagePathDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_BlindedMessagePathDecodeErrorZ* owner_conv = (LDKCResult_BlindedMessagePathDecodeErrorZ*)untag_ptr(owner); + LDKBlindedMessagePath ret_var = CResult_BlindedMessagePathDecodeErrorZ_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_BlindedMessagePathDecodeErrorZ_get_err(LDKCResult_BlindedMessagePathDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_BlindedMessagePathDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_BlindedMessagePathDecodeErrorZ* owner_conv = (LDKCResult_BlindedMessagePathDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_BlindedMessagePathDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKBlindedMessagePath CResult_BlindedMessagePathNoneZ_get_ok(LDKCResult_BlindedMessagePathNoneZ *NONNULL_PTR owner){ + LDKBlindedMessagePath ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_BlindedMessagePathNoneZ_get_ok(int64_t owner) { + LDKCResult_BlindedMessagePathNoneZ* owner_conv = (LDKCResult_BlindedMessagePathNoneZ*)untag_ptr(owner); + LDKBlindedMessagePath ret_var = CResult_BlindedMessagePathNoneZ_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_BlindedMessagePathNoneZ_get_err(LDKCResult_BlindedMessagePathNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +void CS_LDK_CResult_BlindedMessagePathNoneZ_get_err(int64_t owner) { + LDKCResult_BlindedMessagePathNoneZ* owner_conv = (LDKCResult_BlindedMessagePathNoneZ*)untag_ptr(owner); + CResult_BlindedMessagePathNoneZ_get_err(owner_conv); +} + +static inline struct LDKMessageContext CResult_MessageContextDecodeErrorZ_get_ok(LDKCResult_MessageContextDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return MessageContext_clone(&*owner->contents.result); +} +int64_t CS_LDK_CResult_MessageContextDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_MessageContextDecodeErrorZ* owner_conv = (LDKCResult_MessageContextDecodeErrorZ*)untag_ptr(owner); + LDKMessageContext *ret_copy = MALLOC(sizeof(LDKMessageContext), "LDKMessageContext"); + *ret_copy = CResult_MessageContextDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_MessageContextDecodeErrorZ_get_err(LDKCResult_MessageContextDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_MessageContextDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_MessageContextDecodeErrorZ* owner_conv = (LDKCResult_MessageContextDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_MessageContextDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKOffersContext CResult_OffersContextDecodeErrorZ_get_ok(LDKCResult_OffersContextDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return OffersContext_clone(&*owner->contents.result); +} +int64_t CS_LDK_CResult_OffersContextDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_OffersContextDecodeErrorZ* owner_conv = (LDKCResult_OffersContextDecodeErrorZ*)untag_ptr(owner); + LDKOffersContext *ret_copy = MALLOC(sizeof(LDKOffersContext), "LDKOffersContext"); + *ret_copy = CResult_OffersContextDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_OffersContextDecodeErrorZ_get_err(LDKCResult_OffersContextDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_OffersContextDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_OffersContextDecodeErrorZ* owner_conv = (LDKCResult_OffersContextDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_OffersContextDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + typedef struct LDKPersister_JCalls { atomic_size_t refcnt; uint32_t instance_ptr; @@ -14668,7 +15481,7 @@ LDKCResult_NoneIOErrorZ persist_manager_LDKPersister_jcall(const void* this_arg, // WARNING: we may need a move here but no clone is available for LDKChannelManager CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_var); channel_manager_ref = tag_ptr(channel_manager_var.inner, channel_manager_var.is_owned); - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 64, channel_manager_ref); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 65, channel_manager_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneIOErrorZ ret_conv = *(LDKCResult_NoneIOErrorZ*)(ret_ptr); @@ -14682,7 +15495,7 @@ LDKCResult_NoneIOErrorZ persist_graph_LDKPersister_jcall(const void* this_arg, c // WARNING: we may need a move here but no clone is available for LDKNetworkGraph CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_var); network_graph_ref = tag_ptr(network_graph_var.inner, network_graph_var.is_owned); - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 65, network_graph_ref); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 66, network_graph_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneIOErrorZ ret_conv = *(LDKCResult_NoneIOErrorZ*)(ret_ptr); @@ -14693,7 +15506,7 @@ LDKCResult_NoneIOErrorZ persist_scorer_LDKPersister_jcall(const void* this_arg, LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg; // WARNING: This object doesn't live past this scope, needs clone! int64_t ret_scorer = tag_ptr(scorer, false); - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 66, ret_scorer); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 67, ret_scorer); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneIOErrorZ ret_conv = *(LDKCResult_NoneIOErrorZ*)(ret_ptr); @@ -14773,45 +15586,37 @@ static void LDKPersist_JCalls_free(void* this_arg) { FREE(j_calls); } } -LDKChannelMonitorUpdateStatus persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_funding_outpoint, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) { +LDKChannelMonitorUpdateStatus persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_funding_outpoint, const LDKChannelMonitor * monitor) { 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); + LDKChannelMonitor monitor_var = *monitor; + int64_t monitor_ref = 0; + monitor_var = ChannelMonitor_clone(&monitor_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_var); + monitor_ref = tag_ptr(monitor_var.inner, monitor_var.is_owned); + uint64_t ret = js_invoke_function_ChannelMonitorUpdateStatus_ll(j_calls->instance_ptr, 68, channel_funding_outpoint_ref, monitor_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) { +LDKChannelMonitorUpdateStatus update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_funding_outpoint, LDKChannelMonitorUpdate monitor_update, const LDKChannelMonitor * monitor) { 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); + LDKChannelMonitorUpdate monitor_update_var = monitor_update; + int64_t monitor_update_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_update_var); + monitor_update_ref = tag_ptr(monitor_update_var.inner, monitor_update_var.is_owned); + LDKChannelMonitor monitor_var = *monitor; + int64_t monitor_ref = 0; + monitor_var = ChannelMonitor_clone(&monitor_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_var); + monitor_ref = tag_ptr(monitor_var.inner, monitor_var.is_owned); + uint64_t ret = js_invoke_function_ChannelMonitorUpdateStatus_lll(j_calls->instance_ptr, 69, channel_funding_outpoint_ref, monitor_update_ref, monitor_ref); LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_cs(ret); return ret_conv; } @@ -14821,7 +15626,7 @@ void archive_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoin 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); + js_invoke_function_void_l(j_calls->instance_ptr, 70, channel_funding_outpoint_ref); } static void LDKPersist_JCalls_cloned(LDKPersist* new_obj) { LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) new_obj->this_arg; @@ -14846,7 +15651,7 @@ uint64_t CS_LDK_LDKPersist_new(int32_t o) { *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) { +int32_t CS_LDK_Persist_persist_new_channel(int64_t this_arg, int64_t channel_funding_outpoint, int64_t monitor) { 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; @@ -14855,21 +15660,16 @@ int32_t CS_LDK_Persist_persist_new_channel(int64_t this_arg, int64_t channel_fu 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)); + LDKChannelMonitor monitor_conv; + monitor_conv.inner = untag_ptr(monitor); + monitor_conv.is_owned = ptr_is_owned(monitor); + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_conv); + monitor_conv.is_owned = false; + int32_t ret_conv = LDKChannelMonitorUpdateStatus_to_cs((this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_funding_outpoint_conv, &monitor_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) { +int32_t CS_LDK_Persist_update_persisted_channel(int64_t this_arg, int64_t channel_funding_outpoint, int64_t monitor_update, int64_t monitor) { 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; @@ -14878,22 +15678,17 @@ int32_t CS_LDK_Persist_update_persisted_channel(int64_t this_arg, int64_t chann 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)); + LDKChannelMonitorUpdate monitor_update_conv; + monitor_update_conv.inner = untag_ptr(monitor_update); + monitor_update_conv.is_owned = ptr_is_owned(monitor_update); + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_update_conv); + monitor_update_conv = ChannelMonitorUpdate_clone(&monitor_update_conv); + LDKChannelMonitor monitor_conv; + monitor_conv.inner = untag_ptr(monitor); + monitor_conv.is_owned = ptr_is_owned(monitor); + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_conv); + monitor_conv.is_owned = false; + int32_t ret_conv = LDKChannelMonitorUpdateStatus_to_cs((this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_funding_outpoint_conv, monitor_update_conv, &monitor_conv)); return ret_conv; } @@ -14935,7 +15730,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, 70, (int64_t)header_arr, (int64_t)txdata_arr, height_conv); + js_invoke_function_void_lli(j_calls->instance_ptr, 71, (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; @@ -14943,14 +15738,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, 71, (int64_t)block_arr, height_conv); + js_invoke_function_void_li(j_calls->instance_ptr, 72, (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, 72, (int64_t)header_arr, height_conv); + js_invoke_function_void_li(j_calls->instance_ptr, 73, (int64_t)header_arr, height_conv); } static void LDKListen_JCalls_cloned(LDKListen* new_obj) { LDKListen_JCalls *j_calls = (LDKListen_JCalls*) new_obj->this_arg; @@ -15050,24 +15845,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, 73, (int64_t)header_arr, (int64_t)txdata_arr, height_conv); + js_invoke_function_void_lli(j_calls->instance_ptr, 74, (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, 74, (int64_t)txid_arr); + js_invoke_function_void_l(j_calls->instance_ptr, 75, (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, 75, (int64_t)header_arr, height_conv); + js_invoke_function_void_li(j_calls->instance_ptr, 76, (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, 76); + int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 77); LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) @@ -15209,7 +16004,7 @@ static void LDKFutureCallback_JCalls_free(void* this_arg) { } void call_LDKFutureCallback_jcall(const void* this_arg) { LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) this_arg; - js_invoke_function_void_(j_calls->instance_ptr, 77); + js_invoke_function_void_(j_calls->instance_ptr, 78); } static void LDKFutureCallback_JCalls_cloned(LDKFutureCallback* new_obj) { LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) new_obj->this_arg; @@ -15249,12 +16044,17 @@ static void LDKEventHandler_JCalls_free(void* this_arg) { FREE(j_calls); } } -void handle_event_LDKEventHandler_jcall(const void* this_arg, LDKEvent event) { +LDKCResult_NoneReplayEventZ handle_event_LDKEventHandler_jcall(const void* this_arg, LDKEvent event) { LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) this_arg; LDKEvent *event_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *event_copy = event; int64_t event_ref = tag_ptr(event_copy, true); - js_invoke_function_void_l(j_calls->instance_ptr, 78, event_ref); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 79, event_ref); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_NoneReplayEventZ ret_conv = *(LDKCResult_NoneReplayEventZ*)(ret_ptr); + FREE(untag_ptr(ret)); + return ret_conv; } static void LDKEventHandler_JCalls_cloned(LDKEventHandler* new_obj) { LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) new_obj->this_arg; @@ -15277,7 +16077,7 @@ uint64_t CS_LDK_LDKEventHandler_new(int32_t o) { *res_ptr = LDKEventHandler_init(o); return tag_ptr(res_ptr, true); } -void CS_LDK_EventHandler_handle_event(int64_t this_arg, int64_t event) { +int64_t CS_LDK_EventHandler_handle_event(int64_t this_arg, int64_t event) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKEventHandler* this_arg_conv = (LDKEventHandler*)this_arg_ptr; @@ -15285,7 +16085,9 @@ void CS_LDK_EventHandler_handle_event(int64_t this_arg, int64_t event) { CHECK_ACCESS(event_ptr); LDKEvent event_conv = *(LDKEvent*)(event_ptr); event_conv = Event_clone((LDKEvent*)untag_ptr(event)); - (this_arg_conv->handle_event)(this_arg_conv->this_arg, event_conv); + LDKCResult_NoneReplayEventZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneReplayEventZ), "LDKCResult_NoneReplayEventZ"); + *ret_conv = (this_arg_conv->handle_event)(this_arg_conv->this_arg, event_conv); + return tag_ptr(ret_conv, true); } typedef struct LDKEventsProvider_JCalls { @@ -15302,7 +16104,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, 79, tag_ptr(handler_ret, true)); + js_invoke_function_void_l(j_calls->instance_ptr, 80, tag_ptr(handler_ret, true)); } static void LDKEventsProvider_JCalls_cloned(LDKEventsProvider* new_obj) { LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) new_obj->this_arg; @@ -15367,7 +16169,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, 80); + int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 81); LDKCVec_MessageSendEventZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) @@ -15446,7 +16248,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, 81, (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_open_channel_v2_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKOpenChannelV2 * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15457,7 +16259,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, 82, (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_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAcceptChannel * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15468,7 +16270,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, 83, (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_accept_channel_v2_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAcceptChannelV2 * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15479,7 +16281,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, 84, (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_created_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingCreated * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15490,7 +16292,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, 85, (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_funding_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15501,7 +16303,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, 86, (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_channel_ready_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReady * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15512,7 +16314,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, 87, (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_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKShutdown * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15523,7 +16325,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, 88, (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_closing_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKClosingSigned * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15534,7 +16336,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, 89, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 90, (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; @@ -15545,7 +16347,7 @@ 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, 90, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 91, (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) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15556,7 +16358,7 @@ void handle_tx_add_input_LDKChannelMessageHandler_jcall(const void* this_arg, LD msg_var = TxAddInput_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, 91, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 92, (int64_t)their_node_id_arr, msg_ref); } void handle_tx_add_output_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKTxAddOutput * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15567,7 +16369,7 @@ void handle_tx_add_output_LDKChannelMessageHandler_jcall(const void* this_arg, L msg_var = TxAddOutput_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, 92, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 93, (int64_t)their_node_id_arr, msg_ref); } void handle_tx_remove_input_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKTxRemoveInput * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15578,7 +16380,7 @@ void handle_tx_remove_input_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = TxRemoveInput_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, 93, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 94, (int64_t)their_node_id_arr, msg_ref); } void handle_tx_remove_output_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKTxRemoveOutput * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15589,7 +16391,7 @@ void handle_tx_remove_output_LDKChannelMessageHandler_jcall(const void* this_arg msg_var = TxRemoveOutput_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, 94, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 95, (int64_t)their_node_id_arr, msg_ref); } void handle_tx_complete_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKTxComplete * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15600,7 +16402,7 @@ void handle_tx_complete_LDKChannelMessageHandler_jcall(const void* this_arg, LDK msg_var = TxComplete_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, 95, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 96, (int64_t)their_node_id_arr, msg_ref); } void handle_tx_signatures_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKTxSignatures * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15611,7 +16413,7 @@ void handle_tx_signatures_LDKChannelMessageHandler_jcall(const void* this_arg, L msg_var = TxSignatures_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, 96, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 97, (int64_t)their_node_id_arr, msg_ref); } void handle_tx_init_rbf_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKTxInitRbf * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15622,7 +16424,7 @@ void handle_tx_init_rbf_LDKChannelMessageHandler_jcall(const void* this_arg, LDK msg_var = TxInitRbf_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, 97, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 98, (int64_t)their_node_id_arr, msg_ref); } void handle_tx_ack_rbf_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKTxAckRbf * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15633,7 +16435,7 @@ void handle_tx_ack_rbf_LDKChannelMessageHandler_jcall(const void* this_arg, LDKP msg_var = TxAckRbf_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, 98, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 99, (int64_t)their_node_id_arr, msg_ref); } void handle_tx_abort_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKTxAbort * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15644,7 +16446,7 @@ void handle_tx_abort_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPub msg_var = TxAbort_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, 99, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 100, (int64_t)their_node_id_arr, msg_ref); } void handle_update_add_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateAddHTLC * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15655,7 +16457,7 @@ void handle_update_add_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = UpdateAddHTLC_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 100, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 101, (int64_t)their_node_id_arr, msg_ref); } void handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFulfillHTLC * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15666,7 +16468,7 @@ void handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_ msg_var = UpdateFulfillHTLC_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 101, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 102, (int64_t)their_node_id_arr, msg_ref); } void handle_update_fail_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailHTLC * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15677,7 +16479,7 @@ void handle_update_fail_htlc_LDKChannelMessageHandler_jcall(const void* this_arg msg_var = UpdateFailHTLC_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 102, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 103, (int64_t)their_node_id_arr, msg_ref); } void handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailMalformedHTLC * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15688,7 +16490,7 @@ void handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall(const void msg_var = UpdateFailMalformedHTLC_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 103, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 104, (int64_t)their_node_id_arr, msg_ref); } void handle_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKCommitmentSigned * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15699,7 +16501,7 @@ void handle_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_ar msg_var = CommitmentSigned_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 104, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 105, (int64_t)their_node_id_arr, msg_ref); } void handle_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKRevokeAndACK * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15710,7 +16512,7 @@ void handle_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = RevokeAndACK_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 105, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 106, (int64_t)their_node_id_arr, msg_ref); } void handle_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFee * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15721,7 +16523,7 @@ void handle_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKP msg_var = UpdateFee_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 106, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 107, (int64_t)their_node_id_arr, msg_ref); } void handle_announcement_signatures_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAnnouncementSignatures * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15732,13 +16534,13 @@ void handle_announcement_signatures_LDKChannelMessageHandler_jcall(const void* t msg_var = AnnouncementSignatures_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 107, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 108, (int64_t)their_node_id_arr, msg_ref); } void peer_disconnected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); - js_invoke_function_void_l(j_calls->instance_ptr, 108, (int64_t)their_node_id_arr); + js_invoke_function_void_l(j_calls->instance_ptr, 109, (int64_t)their_node_id_arr); } LDKCResult_NoneNoneZ peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * msg, bool inbound) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15750,7 +16552,7 @@ LDKCResult_NoneNoneZ peer_connected_LDKChannelMessageHandler_jcall(const void* t CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); jboolean inbound_conv = inbound; - uint64_t ret = js_invoke_function_l_llb(j_calls->instance_ptr, 109, (int64_t)their_node_id_arr, msg_ref, inbound_conv); + uint64_t ret = js_invoke_function_l_llb(j_calls->instance_ptr, 110, (int64_t)their_node_id_arr, msg_ref, inbound_conv); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr); @@ -15766,7 +16568,7 @@ void handle_channel_reestablish_LDKChannelMessageHandler_jcall(const void* this_ msg_var = ChannelReestablish_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 110, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 111, (int64_t)their_node_id_arr, msg_ref); } void handle_channel_update_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelUpdate * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15777,7 +16579,7 @@ void handle_channel_update_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = ChannelUpdate_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 111, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 112, (int64_t)their_node_id_arr, msg_ref); } void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKErrorMessage * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -15788,11 +16590,11 @@ void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublic msg_var = ErrorMessage_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 112, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 113, (int64_t)their_node_id_arr, msg_ref); } LDKNodeFeatures provided_node_features_LDKChannelMessageHandler_jcall(const void* this_arg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 113); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 114); LDKNodeFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -15803,7 +16605,7 @@ LDKInitFeatures provided_init_features_LDKChannelMessageHandler_jcall(const void LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 114, (int64_t)their_node_id_arr); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 115, (int64_t)their_node_id_arr); LDKInitFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -15812,7 +16614,7 @@ LDKInitFeatures provided_init_features_LDKChannelMessageHandler_jcall(const void } LDKCOption_CVec_ThirtyTwoBytesZZ get_chain_hashes_LDKChannelMessageHandler_jcall(const void* this_arg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 115); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 116); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCOption_CVec_ThirtyTwoBytesZZ ret_conv = *(LDKCOption_CVec_ThirtyTwoBytesZZ*)(ret_ptr); @@ -16399,35 +17201,42 @@ static void LDKOffersMessageHandler_JCalls_free(void* this_arg) { FREE(j_calls); } } -LDKCOption_OffersMessageZ handle_message_LDKOffersMessageHandler_jcall(const void* this_arg, LDKOffersMessage message) { +LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ handle_message_LDKOffersMessageHandler_jcall(const void* this_arg, LDKOffersMessage message, LDKCOption_OffersContextZ context, LDKResponder responder) { LDKOffersMessageHandler_JCalls *j_calls = (LDKOffersMessageHandler_JCalls*) this_arg; LDKOffersMessage *message_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); *message_copy = message; int64_t message_ref = tag_ptr(message_copy, true); - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 116, message_ref); + LDKCOption_OffersContextZ *context_copy = MALLOC(sizeof(LDKCOption_OffersContextZ), "LDKCOption_OffersContextZ"); + *context_copy = context; + int64_t context_ref = tag_ptr(context_copy, true); + LDKResponder responder_var = responder; + int64_t responder_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(responder_var); + responder_ref = tag_ptr(responder_var.inner, responder_var.is_owned); + uint64_t ret = js_invoke_function_l_lll(j_calls->instance_ptr, 117, message_ref, context_ref, responder_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); - LDKCOption_OffersMessageZ ret_conv = *(LDKCOption_OffersMessageZ*)(ret_ptr); + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ ret_conv = *(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ*)(ret_ptr); FREE(untag_ptr(ret)); return ret_conv; } -LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ release_pending_messages_LDKOffersMessageHandler_jcall(const void* this_arg) { +LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ release_pending_messages_LDKOffersMessageHandler_jcall(const void* this_arg) { LDKOffersMessageHandler_JCalls *j_calls = (LDKOffersMessageHandler_JCalls*) this_arg; - int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 117); - LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ ret_constr; + int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 118); + LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) - ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC3Tuple_OffersMessageDestinationBlindedPathZ), "LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ Elements"); + ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_OffersMessageMessageSendInstructionsZ), "LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ 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_OffersMessageDestinationBlindedPathZ ret_conv_49_conv = *(LDKC3Tuple_OffersMessageDestinationBlindedPathZ*)(ret_conv_49_ptr); - FREE(untag_ptr(ret_conv_49)); - ret_constr.data[x] = ret_conv_49_conv; + for (size_t w = 0; w < ret_constr.datalen; w++) { + int64_t ret_conv_48 = ret_vals[w]; + void* ret_conv_48_ptr = untag_ptr(ret_conv_48); + CHECK_ACCESS(ret_conv_48_ptr); + LDKC2Tuple_OffersMessageMessageSendInstructionsZ ret_conv_48_conv = *(LDKC2Tuple_OffersMessageMessageSendInstructionsZ*)(ret_conv_48_ptr); + FREE(untag_ptr(ret_conv_48)); + ret_constr.data[w] = ret_conv_48_conv; } FREE(ret); return ret_constr; @@ -16454,7 +17263,7 @@ uint64_t CS_LDK_LDKOffersMessageHandler_new(int32_t o) { *res_ptr = LDKOffersMessageHandler_init(o); return tag_ptr(res_ptr, true); } -int64_t CS_LDK_OffersMessageHandler_handle_message(int64_t this_arg, int64_t message) { +int64_t CS_LDK_OffersMessageHandler_handle_message(int64_t this_arg, int64_t message, int64_t context, int64_t responder) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKOffersMessageHandler* this_arg_conv = (LDKOffersMessageHandler*)this_arg_ptr; @@ -16462,8 +17271,17 @@ int64_t CS_LDK_OffersMessageHandler_handle_message(int64_t this_arg, int64_t me CHECK_ACCESS(message_ptr); LDKOffersMessage message_conv = *(LDKOffersMessage*)(message_ptr); message_conv = OffersMessage_clone((LDKOffersMessage*)untag_ptr(message)); - LDKCOption_OffersMessageZ *ret_copy = MALLOC(sizeof(LDKCOption_OffersMessageZ), "LDKCOption_OffersMessageZ"); - *ret_copy = (this_arg_conv->handle_message)(this_arg_conv->this_arg, message_conv); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKCOption_OffersContextZ context_conv = *(LDKCOption_OffersContextZ*)(context_ptr); + context_conv = COption_OffersContextZ_clone((LDKCOption_OffersContextZ*)untag_ptr(context)); + LDKResponder responder_conv; + responder_conv.inner = untag_ptr(responder); + responder_conv.is_owned = ptr_is_owned(responder); + CHECK_INNER_FIELD_ACCESS_OR_NULL(responder_conv); + responder_conv = Responder_clone(&responder_conv); + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ), "LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ"); + *ret_copy = (this_arg_conv->handle_message)(this_arg_conv->this_arg, message_conv, context_conv, responder_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -16472,14 +17290,143 @@ int64_tArray CS_LDK_OffersMessageHandler_release_pending_messages(int64_t this_ void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKOffersMessageHandler* this_arg_conv = (LDKOffersMessageHandler*)this_arg_ptr; - LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ ret_var = (this_arg_conv->release_pending_messages)(this_arg_conv->this_arg); + LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ ret_var = (this_arg_conv->release_pending_messages)(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_OffersMessageDestinationBlindedPathZ* ret_conv_49_conv = MALLOC(sizeof(LDKC3Tuple_OffersMessageDestinationBlindedPathZ), "LDKC3Tuple_OffersMessageDestinationBlindedPathZ"); - *ret_conv_49_conv = ret_var.data[x]; - ret_arr_ptr[x] = tag_ptr(ret_conv_49_conv, true); + for (size_t w = 0; w < ret_var.datalen; w++) { + LDKC2Tuple_OffersMessageMessageSendInstructionsZ* ret_conv_48_conv = MALLOC(sizeof(LDKC2Tuple_OffersMessageMessageSendInstructionsZ), "LDKC2Tuple_OffersMessageMessageSendInstructionsZ"); + *ret_conv_48_conv = ret_var.data[w]; + ret_arr_ptr[w] = tag_ptr(ret_conv_48_conv, true); + } + + FREE(ret_var.data); + return ret_arr; +} + +typedef struct LDKAsyncPaymentsMessageHandler_JCalls { + atomic_size_t refcnt; + uint32_t instance_ptr; +} LDKAsyncPaymentsMessageHandler_JCalls; +static void LDKAsyncPaymentsMessageHandler_JCalls_free(void* this_arg) { + LDKAsyncPaymentsMessageHandler_JCalls *j_calls = (LDKAsyncPaymentsMessageHandler_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + FREE(j_calls); + } +} +LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ held_htlc_available_LDKAsyncPaymentsMessageHandler_jcall(const void* this_arg, LDKHeldHtlcAvailable message, LDKResponder responder) { + LDKAsyncPaymentsMessageHandler_JCalls *j_calls = (LDKAsyncPaymentsMessageHandler_JCalls*) this_arg; + LDKHeldHtlcAvailable message_var = message; + int64_t message_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_var); + message_ref = tag_ptr(message_var.inner, message_var.is_owned); + LDKResponder responder_var = responder; + int64_t responder_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(responder_var); + responder_ref = tag_ptr(responder_var.inner, responder_var.is_owned); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 119, message_ref, responder_ref); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ ret_conv = *(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ*)(ret_ptr); + FREE(untag_ptr(ret)); + return ret_conv; +} +void release_held_htlc_LDKAsyncPaymentsMessageHandler_jcall(const void* this_arg, LDKReleaseHeldHtlc message) { + LDKAsyncPaymentsMessageHandler_JCalls *j_calls = (LDKAsyncPaymentsMessageHandler_JCalls*) this_arg; + LDKReleaseHeldHtlc message_var = message; + int64_t message_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_var); + message_ref = tag_ptr(message_var.inner, message_var.is_owned); + js_invoke_function_void_l(j_calls->instance_ptr, 120, message_ref); +} +LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ release_pending_messages_LDKAsyncPaymentsMessageHandler_jcall(const void* this_arg) { + LDKAsyncPaymentsMessageHandler_JCalls *j_calls = (LDKAsyncPaymentsMessageHandler_JCalls*) this_arg; + int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 121); + LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ ret_constr; + ret_constr.datalen = ret->arr_len; + if (ret_constr.datalen > 0) + ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ), "LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ Elements"); + else + ret_constr.data = NULL; + int64_t* ret_vals = ret->elems; + for (size_t d = 0; d < ret_constr.datalen; d++) { + int64_t ret_conv_55 = ret_vals[d]; + void* ret_conv_55_ptr = untag_ptr(ret_conv_55); + CHECK_ACCESS(ret_conv_55_ptr); + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ ret_conv_55_conv = *(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ*)(ret_conv_55_ptr); + FREE(untag_ptr(ret_conv_55)); + ret_constr.data[d] = ret_conv_55_conv; + } + FREE(ret); + return ret_constr; +} +static void LDKAsyncPaymentsMessageHandler_JCalls_cloned(LDKAsyncPaymentsMessageHandler* new_obj) { + LDKAsyncPaymentsMessageHandler_JCalls *j_calls = (LDKAsyncPaymentsMessageHandler_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +} +static inline LDKAsyncPaymentsMessageHandler LDKAsyncPaymentsMessageHandler_init (int64_t o) { + LDKAsyncPaymentsMessageHandler_JCalls *calls = MALLOC(sizeof(LDKAsyncPaymentsMessageHandler_JCalls), "LDKAsyncPaymentsMessageHandler_JCalls"); + atomic_init(&calls->refcnt, 1); + calls->instance_ptr = o; + + LDKAsyncPaymentsMessageHandler ret = { + .this_arg = (void*) calls, + .held_htlc_available = held_htlc_available_LDKAsyncPaymentsMessageHandler_jcall, + .release_held_htlc = release_held_htlc_LDKAsyncPaymentsMessageHandler_jcall, + .release_pending_messages = release_pending_messages_LDKAsyncPaymentsMessageHandler_jcall, + .free = LDKAsyncPaymentsMessageHandler_JCalls_free, + }; + return ret; +} +uint64_t CS_LDK_LDKAsyncPaymentsMessageHandler_new(int32_t o) { + LDKAsyncPaymentsMessageHandler *res_ptr = MALLOC(sizeof(LDKAsyncPaymentsMessageHandler), "LDKAsyncPaymentsMessageHandler"); + *res_ptr = LDKAsyncPaymentsMessageHandler_init(o); + return tag_ptr(res_ptr, true); +} +int64_t CS_LDK_AsyncPaymentsMessageHandler_held_htlc_available(int64_t this_arg, int64_t message, int64_t responder) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKAsyncPaymentsMessageHandler* this_arg_conv = (LDKAsyncPaymentsMessageHandler*)this_arg_ptr; + LDKHeldHtlcAvailable 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 = HeldHtlcAvailable_clone(&message_conv); + LDKResponder responder_conv; + responder_conv.inner = untag_ptr(responder); + responder_conv.is_owned = ptr_is_owned(responder); + CHECK_INNER_FIELD_ACCESS_OR_NULL(responder_conv); + responder_conv = Responder_clone(&responder_conv); + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ), "LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ"); + *ret_copy = (this_arg_conv->held_htlc_available)(this_arg_conv->this_arg, message_conv, responder_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_AsyncPaymentsMessageHandler_release_held_htlc(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); } + LDKAsyncPaymentsMessageHandler* this_arg_conv = (LDKAsyncPaymentsMessageHandler*)this_arg_ptr; + LDKReleaseHeldHtlc 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 = ReleaseHeldHtlc_clone(&message_conv); + (this_arg_conv->release_held_htlc)(this_arg_conv->this_arg, message_conv); +} + +int64_tArray CS_LDK_AsyncPaymentsMessageHandler_release_pending_messages(int64_t this_arg) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKAsyncPaymentsMessageHandler* this_arg_conv = (LDKAsyncPaymentsMessageHandler*)this_arg_ptr; + LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ ret_var = (this_arg_conv->release_pending_messages)(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 d = 0; d < ret_var.datalen; d++) { + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ* ret_conv_55_conv = MALLOC(sizeof(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ), "LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ"); + *ret_conv_55_conv = ret_var.data[d]; + ret_arr_ptr[d] = tag_ptr(ret_conv_55_conv, true); } FREE(ret_var.data); @@ -16499,7 +17446,7 @@ static void LDKNodeIdLookUp_JCalls_free(void* this_arg) { 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); + int8_tArray ret = (int8_tArray)js_invoke_function_l_l(j_calls->instance_ptr, 122, short_channel_id_conv); LDKPublicKey ret_ref; CHECK(ret->arr_len == 33); memcpy(ret_ref.compressed_form, ret->elems, 33); FREE(ret); @@ -16553,7 +17500,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, 119, msg_ref); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 123, msg_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr); @@ -16567,7 +17514,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, 120, msg_ref); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 124, msg_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr); @@ -16581,7 +17528,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, 121, msg_ref); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 125, msg_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr); @@ -16591,7 +17538,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, 122, starting_point_conv); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 126, starting_point_conv); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_conv = *(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)(ret_ptr); @@ -16604,7 +17551,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, 123, starting_point_ref); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 127, starting_point_ref); LDKNodeAnnouncement ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -16621,7 +17568,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, 124, (int64_t)their_node_id_arr, init_ref, inbound_conv); + uint64_t ret = js_invoke_function_l_llb(j_calls->instance_ptr, 128, (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); @@ -16636,7 +17583,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, 125, (int64_t)their_node_id_arr, msg_ref); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 129, (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); @@ -16651,7 +17598,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, 126, (int64_t)their_node_id_arr, msg_ref); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 130, (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); @@ -16666,7 +17613,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, 127, (int64_t)their_node_id_arr, msg_ref); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 131, (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); @@ -16681,7 +17628,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, 128, (int64_t)their_node_id_arr, msg_ref); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 132, (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); @@ -16690,11 +17637,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, 129); + return js_invoke_function_b_(j_calls->instance_ptr, 133); } 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, 130); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 134); LDKNodeFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -16705,7 +17652,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, 131, (int64_t)their_node_id_arr); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 135, (int64_t)their_node_id_arr); LDKInitFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -16944,27 +17891,6 @@ static void LDKOnionMessageHandler_JCalls_free(void* this_arg) { FREE(j_calls); } } -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, 132); - LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ ret_constr; - ret_constr.datalen = ret->arr_len; - if (ret_constr.datalen > 0) - ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ), "LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ Elements"); - else - ret_constr.data = NULL; - int64_t* ret_vals = ret->elems; - for (size_t o = 0; o < ret_constr.datalen; o++) { - int64_t ret_conv_40 = ret_vals[o]; - void* ret_conv_40_ptr = untag_ptr(ret_conv_40); - CHECK_ACCESS(ret_conv_40_ptr); - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ ret_conv_40_conv = *(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ*)(ret_conv_40_ptr); - FREE(untag_ptr(ret_conv_40)); - ret_constr.data[o] = ret_conv_40_conv; - } - FREE(ret); - return ret_constr; -} void handle_onion_message_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey peer_node_id, const LDKOnionMessage * msg) { LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg; int8_tArray peer_node_id_arr = init_int8_tArray(33, __LINE__); @@ -16974,13 +17900,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, 133, (int64_t)peer_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 136, (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, 134, (int64_t)peer_node_id_arr); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 137, (int64_t)peer_node_id_arr); LDKOnionMessage ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -16997,7 +17923,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, 135, (int64_t)their_node_id_arr, init_ref, inbound_conv); + uint64_t ret = js_invoke_function_l_llb(j_calls->instance_ptr, 138, (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); @@ -17008,15 +17934,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, 136, (int64_t)their_node_id_arr); + js_invoke_function_void_l(j_calls->instance_ptr, 139, (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, 137); + js_invoke_function_void_(j_calls->instance_ptr, 140); } 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, 138); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 141); LDKNodeFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -17027,7 +17953,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, 139, (int64_t)their_node_id_arr); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 142, (int64_t)their_node_id_arr); LDKInitFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -17045,7 +17971,6 @@ static inline LDKOnionMessageHandler LDKOnionMessageHandler_init (int64_t o) { LDKOnionMessageHandler ret = { .this_arg = (void*) calls, - .get_and_clear_connections_needed = get_and_clear_connections_needed_LDKOnionMessageHandler_jcall, .handle_onion_message = handle_onion_message_LDKOnionMessageHandler_jcall, .next_onion_message_for_peer = next_onion_message_for_peer_LDKOnionMessageHandler_jcall, .peer_connected = peer_connected_LDKOnionMessageHandler_jcall, @@ -17062,24 +17987,6 @@ uint64_t CS_LDK_LDKOnionMessageHandler_new(int32_t o) { *res_ptr = LDKOnionMessageHandler_init(o); return tag_ptr(res_ptr, true); } -int64_tArray CS_LDK_OnionMessageHandler_get_and_clear_connections_needed(int64_t this_arg) { - void* this_arg_ptr = untag_ptr(this_arg); - if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr; - LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ ret_var = (this_arg_conv->get_and_clear_connections_needed)(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 o = 0; o < ret_var.datalen; o++) { - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* ret_conv_40_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ), "LDKC2Tuple_PublicKeyCVec_SocketAddressZZ"); - *ret_conv_40_conv = ret_var.data[o]; - ret_arr_ptr[o] = tag_ptr(ret_conv_40_conv, true); - } - - FREE(ret_var.data); - return ret_arr; -} - void CS_LDK_OnionMessageHandler_handle_onion_message(int64_t this_arg, int8_tArray peer_node_id, int64_t msg) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } @@ -17184,7 +18091,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, 140, message_type_conv, (int64_t)buffer_arr); + uint64_t ret = js_invoke_function_l_sl(j_calls->instance_ptr, 143, 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); @@ -17242,7 +18149,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, 141, tag_ptr(msg_ret, true), (int64_t)sender_node_id_arr); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 144, 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); @@ -17251,7 +18158,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, 142); + int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 145); LDKCVec_C2Tuple_PublicKeyTypeZZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) @@ -17270,9 +18177,32 @@ LDKCVec_C2Tuple_PublicKeyTypeZZ get_and_clear_pending_msg_LDKCustomMessageHandle FREE(ret); return ret_constr; } +void peer_disconnected_LDKCustomMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id) { + 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); + js_invoke_function_void_l(j_calls->instance_ptr, 146, (int64_t)their_node_id_arr); +} +LDKCResult_NoneNoneZ peer_connected_LDKCustomMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * msg, bool inbound) { + 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); + LDKInit msg_var = *msg; + int64_t msg_ref = 0; + msg_var = Init_clone(&msg_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); + msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); + jboolean inbound_conv = inbound; + uint64_t ret = js_invoke_function_l_llb(j_calls->instance_ptr, 147, (int64_t)their_node_id_arr, msg_ref, inbound_conv); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr); + FREE(untag_ptr(ret)); + return ret_conv; +} 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, 143); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 148); LDKNodeFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -17283,7 +18213,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, 144, (int64_t)their_node_id_arr); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 149, (int64_t)their_node_id_arr); LDKInitFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -17304,6 +18234,8 @@ static inline LDKCustomMessageHandler LDKCustomMessageHandler_init (int64_t o, i .this_arg = (void*) calls, .handle_custom_message = handle_custom_message_LDKCustomMessageHandler_jcall, .get_and_clear_pending_msg = get_and_clear_pending_msg_LDKCustomMessageHandler_jcall, + .peer_disconnected = peer_disconnected_LDKCustomMessageHandler_jcall, + .peer_connected = peer_connected_LDKCustomMessageHandler_jcall, .provided_node_features = provided_node_features_LDKCustomMessageHandler_jcall, .provided_init_features = provided_init_features_LDKCustomMessageHandler_jcall, .free = LDKCustomMessageHandler_JCalls_free, @@ -17354,6 +18286,33 @@ int64_tArray CS_LDK_CustomMessageHandler_get_and_clear_pending_msg(int64_t this return ret_arr; } +void CS_LDK_CustomMessageHandler_peer_disconnected(int64_t this_arg, int8_tArray their_node_id) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr; + LDKPublicKey their_node_id_ref; + CHECK(their_node_id->arr_len == 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); + (this_arg_conv->peer_disconnected)(this_arg_conv->this_arg, their_node_id_ref); +} + +int64_t CS_LDK_CustomMessageHandler_peer_connected(int64_t this_arg, int8_tArray their_node_id, int64_t msg, jboolean inbound) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr; + LDKPublicKey their_node_id_ref; + CHECK(their_node_id->arr_len == 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); + LDKInit msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv, inbound); + return tag_ptr(ret_conv, true); +} + int64_t CS_LDK_CustomMessageHandler_provided_node_features(int64_t this_arg) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } @@ -17389,14 +18348,21 @@ static void LDKCustomOnionMessageHandler_JCalls_free(void* this_arg) { FREE(j_calls); } } -LDKCOption_OnionMessageContentsZ handle_custom_message_LDKCustomOnionMessageHandler_jcall(const void* this_arg, LDKOnionMessageContents msg) { +LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ handle_custom_message_LDKCustomOnionMessageHandler_jcall(const void* this_arg, LDKOnionMessageContents message, LDKCOption_CVec_u8ZZ context, LDKResponder responder) { 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, 145, tag_ptr(msg_ret, true)); + LDKOnionMessageContents* message_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *message_ret = message; + LDKCOption_CVec_u8ZZ *context_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *context_copy = context; + int64_t context_ref = tag_ptr(context_copy, true); + LDKResponder responder_var = responder; + int64_t responder_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(responder_var); + responder_ref = tag_ptr(responder_var.inner, responder_var.is_owned); + uint64_t ret = js_invoke_function_l_lll(j_calls->instance_ptr, 150, tag_ptr(message_ret, true), context_ref, responder_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); - LDKCOption_OnionMessageContentsZ ret_conv = *(LDKCOption_OnionMessageContentsZ*)(ret_ptr); + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ ret_conv = *(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ*)(ret_ptr); FREE(untag_ptr(ret)); return ret_conv; } @@ -17406,30 +18372,30 @@ 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, 146, message_type_conv, (int64_t)buffer_arr); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 151, 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); FREE(untag_ptr(ret)); return ret_conv; } -LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ release_pending_custom_messages_LDKCustomOnionMessageHandler_jcall(const void* this_arg) { +LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ 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, 147); - LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ ret_constr; + int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 152); + LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) - ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ), "LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ Elements"); + ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ), "LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ Elements"); else ret_constr.data = NULL; int64_t* ret_vals = ret->elems; - for (size_t e = 0; e < ret_constr.datalen; e++) { - int64_t ret_conv_56 = ret_vals[e]; - void* ret_conv_56_ptr = untag_ptr(ret_conv_56); - CHECK_ACCESS(ret_conv_56_ptr); - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ ret_conv_56_conv = *(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ*)(ret_conv_56_ptr); - FREE(untag_ptr(ret_conv_56)); - ret_constr.data[e] = ret_conv_56_conv; + for (size_t d = 0; d < ret_constr.datalen; d++) { + int64_t ret_conv_55 = ret_vals[d]; + void* ret_conv_55_ptr = untag_ptr(ret_conv_55); + CHECK_ACCESS(ret_conv_55_ptr); + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ ret_conv_55_conv = *(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ*)(ret_conv_55_ptr); + FREE(untag_ptr(ret_conv_55)); + ret_constr.data[d] = ret_conv_55_conv; } FREE(ret); return ret_constr; @@ -17457,19 +18423,28 @@ uint64_t CS_LDK_LDKCustomOnionMessageHandler_new(int32_t o) { *res_ptr = LDKCustomOnionMessageHandler_init(o); return tag_ptr(res_ptr, true); } -int64_t CS_LDK_CustomOnionMessageHandler_handle_custom_message(int64_t this_arg, int64_t msg) { +int64_t CS_LDK_CustomOnionMessageHandler_handle_custom_message(int64_t this_arg, int64_t message, int64_t context, int64_t responder) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKCustomOnionMessageHandler* this_arg_conv = (LDKCustomOnionMessageHandler*)this_arg_ptr; - void* msg_ptr = untag_ptr(msg); - CHECK_ACCESS(msg_ptr); - LDKOnionMessageContents msg_conv = *(LDKOnionMessageContents*)(msg_ptr); - if (msg_conv.free == LDKOnionMessageContents_JCalls_free) { + void* message_ptr = untag_ptr(message); + CHECK_ACCESS(message_ptr); + LDKOnionMessageContents message_conv = *(LDKOnionMessageContents*)(message_ptr); + if (message_conv.free == LDKOnionMessageContents_JCalls_free) { // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKOnionMessageContents_JCalls_cloned(&msg_conv); + LDKOnionMessageContents_JCalls_cloned(&message_conv); } - LDKCOption_OnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_OnionMessageContentsZ), "LDKCOption_OnionMessageContentsZ"); - *ret_copy = (this_arg_conv->handle_custom_message)(this_arg_conv->this_arg, msg_conv); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKCOption_CVec_u8ZZ context_conv = *(LDKCOption_CVec_u8ZZ*)(context_ptr); + context_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(context)); + LDKResponder responder_conv; + responder_conv.inner = untag_ptr(responder); + responder_conv.is_owned = ptr_is_owned(responder); + CHECK_INNER_FIELD_ACCESS_OR_NULL(responder_conv); + responder_conv = Responder_clone(&responder_conv); + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ), "LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ"); + *ret_copy = (this_arg_conv->handle_custom_message)(this_arg_conv->this_arg, message_conv, context_conv, responder_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -17491,14 +18466,14 @@ int64_tArray CS_LDK_CustomOnionMessageHandler_release_pending_custom_messages(i void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKCustomOnionMessageHandler* this_arg_conv = (LDKCustomOnionMessageHandler*)this_arg_ptr; - LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ ret_var = (this_arg_conv->release_pending_custom_messages)(this_arg_conv->this_arg); + LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ ret_var = (this_arg_conv->release_pending_custom_messages)(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 e = 0; e < ret_var.datalen; e++) { - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ* ret_conv_56_conv = MALLOC(sizeof(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ), "LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ"); - *ret_conv_56_conv = ret_var.data[e]; - ret_arr_ptr[e] = tag_ptr(ret_conv_56_conv, true); + for (size_t d = 0; d < ret_var.datalen; d++) { + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ* ret_conv_55_conv = MALLOC(sizeof(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ), "LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ"); + *ret_conv_55_conv = ret_var.data[d]; + ret_arr_ptr[d] = tag_ptr(ret_conv_55_conv, true); } FREE(ret_var.data); @@ -17521,21 +18496,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, 148, (int64_t)data_arr, resume_read_conv); + return js_invoke_function_l_lb(j_calls->instance_ptr, 153, (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, 149); + js_invoke_function_void_(j_calls->instance_ptr, 154); } 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, 150, tag_ptr(other_arg_clone, true)); + return js_invoke_function_b_l(j_calls->instance_ptr, 155, 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, 151); + return js_invoke_function_l_(j_calls->instance_ptr, 156); } static void LDKSocketDescriptor_JCalls_cloned(LDKSocketDescriptor* new_obj) { LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) new_obj->this_arg; @@ -17589,6 +18564,22 @@ int64_t CS_LDK_SocketDescriptor_hash(int64_t this_arg) { return ret_conv; } +uint32_t CS_LDK_LDKBolt12PaymentError_ty_from_ptr(int64_t ptr) { + LDKBolt12PaymentError *obj = (LDKBolt12PaymentError*)untag_ptr(ptr); + switch(obj->tag) { + case LDKBolt12PaymentError_UnexpectedInvoice: return 0; + case LDKBolt12PaymentError_DuplicateInvoice: return 1; + case LDKBolt12PaymentError_UnknownRequiredFeatures: return 2; + case LDKBolt12PaymentError_SendingFailed: return 3; + default: abort(); + } +} +int32_t CS_LDK_LDKBolt12PaymentError_SendingFailed_get_sending_failed(int64_t ptr) { + LDKBolt12PaymentError *obj = (LDKBolt12PaymentError*)untag_ptr(ptr); + CHECK(obj->tag == LDKBolt12PaymentError_SendingFailed); + int32_t sending_failed_conv = LDKRetryableSendFailure_to_cs(obj->sending_failed); + return sending_failed_conv; +} typedef struct LDKSignBolt12InvoiceFn_JCalls { atomic_size_t refcnt; uint32_t instance_ptr; @@ -17606,7 +18597,7 @@ LDKCResult_SchnorrSignatureNoneZ sign_invoice_LDKSignBolt12InvoiceFn_jcall(const 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); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 157, message_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_SchnorrSignatureNoneZ ret_conv = *(LDKCResult_SchnorrSignatureNoneZ*)(ret_ptr); @@ -17665,7 +18656,7 @@ LDKCResult_SchnorrSignatureNoneZ sign_invoice_request_LDKSignInvoiceRequestFn_jc 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); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 158, message_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_SchnorrSignatureNoneZ ret_conv = *(LDKCResult_SchnorrSignatureNoneZ*)(ret_ptr); @@ -17774,15 +18765,16 @@ uint32_t CS_LDK_LDKPayee_ty_from_ptr(int64_t ptr) { int64_tArray CS_LDK_LDKPayee_Blinded_get_route_hints(int64_t ptr) { LDKPayee *obj = (LDKPayee*)untag_ptr(ptr); CHECK(obj->tag == LDKPayee_Blinded); - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ route_hints_var = obj->blinded.route_hints; + LDKCVec_BlindedPaymentPathZ route_hints_var = obj->blinded.route_hints; int64_tArray route_hints_arr = NULL; route_hints_arr = init_int64_tArray(route_hints_var.datalen, __LINE__); int64_t *route_hints_arr_ptr = (int64_t*)(((uint8_t*)route_hints_arr) + 8); - for (size_t l = 0; l < route_hints_var.datalen; l++) { - LDKC2Tuple_BlindedPayInfoBlindedPathZ* route_hints_conv_37_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ"); - *route_hints_conv_37_conv = route_hints_var.data[l]; - *route_hints_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone(route_hints_conv_37_conv); - route_hints_arr_ptr[l] = tag_ptr(route_hints_conv_37_conv, true); + for (size_t u = 0; u < route_hints_var.datalen; u++) { + LDKBlindedPaymentPath route_hints_conv_20_var = route_hints_var.data[u]; + int64_t route_hints_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_hints_conv_20_var); + route_hints_conv_20_ref = tag_ptr(route_hints_conv_20_var.inner, false); + route_hints_arr_ptr[u] = route_hints_conv_20_ref; } return route_hints_arr; @@ -17849,7 +18841,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, 154); + int8_tArray ret = (int8_tArray)js_invoke_function_l_(j_calls->instance_ptr, 159); LDKCVec_u8Z ret_ref; ret_ref.datalen = ret->arr_len; ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes"); @@ -17960,7 +18952,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, 155, (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, 160, (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); @@ -17973,7 +18965,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, 156, (int64_t)psbt_arr); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 161, (int64_t)psbt_arr); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_TransactionNoneZ ret_conv = *(LDKCResult_TransactionNoneZ*)(ret_ptr); @@ -18072,7 +19064,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, 157); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 162); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_CVec_UtxoZNoneZ ret_conv = *(LDKCResult_CVec_UtxoZNoneZ*)(ret_ptr); @@ -18081,7 +19073,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, 158); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 163); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_CVec_u8ZNoneZ ret_conv = *(LDKCResult_CVec_u8ZNoneZ*)(ret_ptr); @@ -18094,7 +19086,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, 159, (int64_t)psbt_arr); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 164, (int64_t)psbt_arr); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_TransactionNoneZ ret_conv = *(LDKCResult_TransactionNoneZ*)(ret_ptr); @@ -18649,24 +19641,78 @@ int64_t CS_LDK_COption_u64Z_clone(int64_t orig) { return ret_ref; } -void CS_LDK_CVec_BlindedPathZ_free(int64_tArray _res) { - LDKCVec_BlindedPathZ _res_constr; +void CS_LDK_CVec_BlindedMessagePathZ_free(int64_tArray _res) { + LDKCVec_BlindedMessagePathZ _res_constr; _res_constr.datalen = _res->arr_len; if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKBlindedPath), "LDKCVec_BlindedPathZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKBlindedMessagePath), "LDKCVec_BlindedMessagePathZ Elements"); else _res_constr.data = NULL; int64_t* _res_vals = _res->elems; - for (size_t n = 0; n < _res_constr.datalen; n++) { - int64_t _res_conv_13 = _res_vals[n]; - LDKBlindedPath _res_conv_13_conv; - _res_conv_13_conv.inner = untag_ptr(_res_conv_13); - _res_conv_13_conv.is_owned = ptr_is_owned(_res_conv_13); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_13_conv); - _res_constr.data[n] = _res_conv_13_conv; + for (size_t u = 0; u < _res_constr.datalen; u++) { + int64_t _res_conv_20 = _res_vals[u]; + LDKBlindedMessagePath _res_conv_20_conv; + _res_conv_20_conv.inner = untag_ptr(_res_conv_20); + _res_conv_20_conv.is_owned = ptr_is_owned(_res_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_20_conv); + _res_constr.data[u] = _res_conv_20_conv; } FREE(_res); - CVec_BlindedPathZ_free(_res_constr); + CVec_BlindedMessagePathZ_free(_res_constr); +} + +int64_t CS_LDK_CResult_RefundDecodeErrorZ_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_RefundDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundDecodeErrorZ), "LDKCResult_RefundDecodeErrorZ"); + *ret_conv = CResult_RefundDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_RefundDecodeErrorZ_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_RefundDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundDecodeErrorZ), "LDKCResult_RefundDecodeErrorZ"); + *ret_conv = CResult_RefundDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_RefundDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_RefundDecodeErrorZ* o_conv = (LDKCResult_RefundDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_RefundDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_RefundDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_RefundDecodeErrorZ _res_conv = *(LDKCResult_RefundDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_RefundDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_RefundDecodeErrorZ_clone_ptr(LDKCResult_RefundDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RefundDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundDecodeErrorZ), "LDKCResult_RefundDecodeErrorZ"); + *ret_conv = CResult_RefundDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_RefundDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_RefundDecodeErrorZ* arg_conv = (LDKCResult_RefundDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_RefundDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_RefundDecodeErrorZ_clone(int64_t orig) { + LDKCResult_RefundDecodeErrorZ* orig_conv = (LDKCResult_RefundDecodeErrorZ*)untag_ptr(orig); + LDKCResult_RefundDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundDecodeErrorZ), "LDKCResult_RefundDecodeErrorZ"); + *ret_conv = CResult_RefundDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } int64_t CS_LDK_CResult_RefundBolt12ParseErrorZ_ok(int64_t o) { @@ -19270,6 +20316,23 @@ int64_t CS_LDK_CResult_SchnorrSignatureNoneZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +void CS_LDK_CVec_StrZ_free(ptrArray _res) { + LDKCVec_StrZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKStr), "LDKCVec_StrZ Elements"); + else + _res_constr.data = NULL; + jstring* _res_vals = (void*) _res->elems; + for (size_t i = 0; i < _res_constr.datalen; i++) { + jstring _res_conv_8 = _res_vals[i]; + LDKStr dummy = { .chars = NULL, .len = 0, .chars_is_owned = false }; + _res_constr.data[i] = dummy; + } + FREE(_res); + CVec_StrZ_free(_res_constr); +} + void CS_LDK_CVec_ThirtyTwoBytesZ_free(ptrArray _res) { LDKCVec_ThirtyTwoBytesZ _res_constr; _res_constr.datalen = _res->arr_len; @@ -19489,57 +20552,57 @@ int64_t CS_LDK_CResult_ThirtyTwoBytesNoneZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_ok(int64_t o) { - LDKBlindedPayInfo o_conv; +int64_t CS_LDK_CResult_Bolt12InvoiceDecodeErrorZ_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 = BlindedPayInfo_clone(&o_conv); - LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); - *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_ok(o_conv); + o_conv = Bolt12Invoice_clone(&o_conv); + LDKCResult_Bolt12InvoiceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceDecodeErrorZ), "LDKCResult_Bolt12InvoiceDecodeErrorZ"); + *ret_conv = CResult_Bolt12InvoiceDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_Bolt12InvoiceDecodeErrorZ_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_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); - *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_err(e_conv); + LDKCResult_Bolt12InvoiceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceDecodeErrorZ), "LDKCResult_Bolt12InvoiceDecodeErrorZ"); + *ret_conv = CResult_Bolt12InvoiceDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_BlindedPayInfoDecodeErrorZ* o_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_BlindedPayInfoDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_Bolt12InvoiceDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_Bolt12InvoiceDecodeErrorZ* o_conv = (LDKCResult_Bolt12InvoiceDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_Bolt12InvoiceDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_Bolt12InvoiceDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_BlindedPayInfoDecodeErrorZ _res_conv = *(LDKCResult_BlindedPayInfoDecodeErrorZ*)(_res_ptr); + LDKCResult_Bolt12InvoiceDecodeErrorZ _res_conv = *(LDKCResult_Bolt12InvoiceDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_BlindedPayInfoDecodeErrorZ_free(_res_conv); + CResult_Bolt12InvoiceDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_BlindedPayInfoDecodeErrorZ_clone_ptr(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); - *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_clone(arg); +static inline uint64_t CResult_Bolt12InvoiceDecodeErrorZ_clone_ptr(LDKCResult_Bolt12InvoiceDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_Bolt12InvoiceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceDecodeErrorZ), "LDKCResult_Bolt12InvoiceDecodeErrorZ"); + *ret_conv = CResult_Bolt12InvoiceDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_BlindedPayInfoDecodeErrorZ* arg_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_BlindedPayInfoDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_Bolt12InvoiceDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_Bolt12InvoiceDecodeErrorZ* arg_conv = (LDKCResult_Bolt12InvoiceDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_Bolt12InvoiceDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_clone(int64_t orig) { - LDKCResult_BlindedPayInfoDecodeErrorZ* orig_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(orig); - LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); - *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_Bolt12InvoiceDecodeErrorZ_clone(int64_t orig) { + LDKCResult_Bolt12InvoiceDecodeErrorZ* orig_conv = (LDKCResult_Bolt12InvoiceDecodeErrorZ*)untag_ptr(orig); + LDKCResult_Bolt12InvoiceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceDecodeErrorZ), "LDKCResult_Bolt12InvoiceDecodeErrorZ"); + *ret_conv = CResult_Bolt12InvoiceDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -19981,51 +21044,6 @@ int64_t CS_LDK_CResult_HTLCDescriptorDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_NoneNoneZ_ok() { - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = CResult_NoneNoneZ_ok(); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_NoneNoneZ_err() { - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = CResult_NoneNoneZ_err(); - return tag_ptr(ret_conv, true); -} - -jboolean CS_LDK_CResult_NoneNoneZ_is_ok(int64_t o) { - LDKCResult_NoneNoneZ* o_conv = (LDKCResult_NoneNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_NoneNoneZ_is_ok(o_conv); - return ret_conv; -} - -void CS_LDK_CResult_NoneNoneZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_NoneNoneZ _res_conv = *(LDKCResult_NoneNoneZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_NoneNoneZ_free(_res_conv); -} - -static inline uint64_t CResult_NoneNoneZ_clone_ptr(LDKCResult_NoneNoneZ *NONNULL_PTR arg) { - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = CResult_NoneNoneZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t CS_LDK_CResult_NoneNoneZ_clone_ptr(int64_t arg) { - LDKCResult_NoneNoneZ* arg_conv = (LDKCResult_NoneNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_NoneNoneZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_CResult_NoneNoneZ_clone(int64_t orig) { - LDKCResult_NoneNoneZ* orig_conv = (LDKCResult_NoneNoneZ*)untag_ptr(orig); - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = CResult_NoneNoneZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - int64_t CS_LDK_CResult_PublicKeyNoneZ_ok(int8_tArray o) { LDKPublicKey o_ref; CHECK(o->arr_len == 33); @@ -20074,6 +21092,99 @@ int64_t CS_LDK_CResult_PublicKeyNoneZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_CResult__u832NoneZ_ok(int8_tArray o) { + LDKThirtyTwoBytes o_ref; + CHECK(o->arr_len == 32); + memcpy(o_ref.data, o->elems, 32); FREE(o); + LDKCResult__u832NoneZ* ret_conv = MALLOC(sizeof(LDKCResult__u832NoneZ), "LDKCResult__u832NoneZ"); + *ret_conv = CResult__u832NoneZ_ok(o_ref); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult__u832NoneZ_err() { + LDKCResult__u832NoneZ* ret_conv = MALLOC(sizeof(LDKCResult__u832NoneZ), "LDKCResult__u832NoneZ"); + *ret_conv = CResult__u832NoneZ_err(); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult__u832NoneZ_is_ok(int64_t o) { + LDKCResult__u832NoneZ* o_conv = (LDKCResult__u832NoneZ*)untag_ptr(o); + jboolean ret_conv = CResult__u832NoneZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult__u832NoneZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult__u832NoneZ _res_conv = *(LDKCResult__u832NoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult__u832NoneZ_free(_res_conv); +} + +static inline uint64_t CResult__u832NoneZ_clone_ptr(LDKCResult__u832NoneZ *NONNULL_PTR arg) { + LDKCResult__u832NoneZ* ret_conv = MALLOC(sizeof(LDKCResult__u832NoneZ), "LDKCResult__u832NoneZ"); + *ret_conv = CResult__u832NoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult__u832NoneZ_clone_ptr(int64_t arg) { + LDKCResult__u832NoneZ* arg_conv = (LDKCResult__u832NoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult__u832NoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult__u832NoneZ_clone(int64_t orig) { + LDKCResult__u832NoneZ* orig_conv = (LDKCResult__u832NoneZ*)untag_ptr(orig); + LDKCResult__u832NoneZ* ret_conv = MALLOC(sizeof(LDKCResult__u832NoneZ), "LDKCResult__u832NoneZ"); + *ret_conv = CResult__u832NoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_NoneNoneZ_ok() { + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = CResult_NoneNoneZ_ok(); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_NoneNoneZ_err() { + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = CResult_NoneNoneZ_err(); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_NoneNoneZ_is_ok(int64_t o) { + LDKCResult_NoneNoneZ* o_conv = (LDKCResult_NoneNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_NoneNoneZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_NoneNoneZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_NoneNoneZ _res_conv = *(LDKCResult_NoneNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_NoneNoneZ_free(_res_conv); +} + +static inline uint64_t CResult_NoneNoneZ_clone_ptr(LDKCResult_NoneNoneZ *NONNULL_PTR arg) { + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = CResult_NoneNoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_NoneNoneZ_clone_ptr(int64_t arg) { + LDKCResult_NoneNoneZ* arg_conv = (LDKCResult_NoneNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_NoneNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_NoneNoneZ_clone(int64_t orig) { + LDKCResult_NoneNoneZ* orig_conv = (LDKCResult_NoneNoneZ*)untag_ptr(orig); + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = CResult_NoneNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + int64_t CS_LDK_COption_BigEndianScalarZ_some(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -20121,23 +21232,6 @@ int64_t CS_LDK_COption_BigEndianScalarZ_clone(int64_t orig) { return ret_ref; } -void CS_LDK_CVec_U5Z_free(ptrArray _res) { - LDKCVec_U5Z _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKU5), "LDKCVec_U5Z Elements"); - else - _res_constr.data = NULL; - int8_t* _res_vals = (void*) _res->elems; - for (size_t h = 0; h < _res_constr.datalen; h++) { - int8_t _res_conv_7 = _res_vals[h]; - - _res_constr.data[h] = (LDKU5){ ._0 = _res_conv_7 }; - } - FREE(_res); - CVec_U5Z_free(_res_constr); -} - int64_t CS_LDK_CResult_RecoverableSignatureNoneZ_ok(int8_tArray o) { LDKRecoverableSignature o_ref; CHECK(o->arr_len == 68); @@ -20284,59 +21378,59 @@ int64_t CS_LDK_CResult_TransactionNoneZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(int64_t o) { +int64_t CS_LDK_CResult_EcdsaChannelSignerDecodeErrorZ_ok(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); - LDKWriteableEcdsaChannelSigner o_conv = *(LDKWriteableEcdsaChannelSigner*)(o_ptr); - if (o_conv.free == LDKWriteableEcdsaChannelSigner_JCalls_free) { + LDKEcdsaChannelSigner o_conv = *(LDKEcdsaChannelSigner*)(o_ptr); + if (o_conv.free == LDKEcdsaChannelSigner_JCalls_free) { // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKWriteableEcdsaChannelSigner_JCalls_cloned(&o_conv); + LDKEcdsaChannelSigner_JCalls_cloned(&o_conv); } - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ), "LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ"); - *ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(o_conv); + LDKCResult_EcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_EcdsaChannelSignerDecodeErrorZ), "LDKCResult_EcdsaChannelSignerDecodeErrorZ"); + *ret_conv = CResult_EcdsaChannelSignerDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_EcdsaChannelSignerDecodeErrorZ_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_WriteableEcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ), "LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ"); - *ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err(e_conv); + LDKCResult_EcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_EcdsaChannelSignerDecodeErrorZ), "LDKCResult_EcdsaChannelSignerDecodeErrorZ"); + *ret_conv = CResult_EcdsaChannelSignerDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* o_conv = (LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_EcdsaChannelSignerDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_EcdsaChannelSignerDecodeErrorZ* o_conv = (LDKCResult_EcdsaChannelSignerDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_EcdsaChannelSignerDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_EcdsaChannelSignerDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ _res_conv = *(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)(_res_ptr); + LDKCResult_EcdsaChannelSignerDecodeErrorZ _res_conv = *(LDKCResult_EcdsaChannelSignerDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free(_res_conv); + CResult_EcdsaChannelSignerDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone_ptr(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ), "LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ"); - *ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(arg); +static inline uint64_t CResult_EcdsaChannelSignerDecodeErrorZ_clone_ptr(LDKCResult_EcdsaChannelSignerDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_EcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_EcdsaChannelSignerDecodeErrorZ), "LDKCResult_EcdsaChannelSignerDecodeErrorZ"); + *ret_conv = CResult_EcdsaChannelSignerDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* arg_conv = (LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_EcdsaChannelSignerDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_EcdsaChannelSignerDecodeErrorZ* arg_conv = (LDKCResult_EcdsaChannelSignerDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_EcdsaChannelSignerDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(int64_t orig) { - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* orig_conv = (LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)untag_ptr(orig); - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ), "LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ"); - *ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_EcdsaChannelSignerDecodeErrorZ_clone(int64_t orig) { + LDKCResult_EcdsaChannelSignerDecodeErrorZ* orig_conv = (LDKCResult_EcdsaChannelSignerDecodeErrorZ*)untag_ptr(orig); + LDKCResult_EcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_EcdsaChannelSignerDecodeErrorZ), "LDKCResult_EcdsaChannelSignerDecodeErrorZ"); + *ret_conv = CResult_EcdsaChannelSignerDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -20824,6 +21918,101 @@ int64_t CS_LDK_CResult_NoneIOErrorZ_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); +} + void CS_LDK_CVec_ChannelDetailsZ_free(int64_tArray _res) { LDKCVec_ChannelDetailsZ _res_constr; _res_constr.datalen = _res->arr_len; @@ -20899,127 +22088,85 @@ int64_t CS_LDK_CResult_RouteLightningErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -static inline uint64_t C2Tuple_BlindedPayInfoBlindedPathZ_clone_ptr(LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR arg) { - LDKC2Tuple_BlindedPayInfoBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ"); - *ret_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t CS_LDK_C2Tuple_BlindedPayInfoBlindedPathZ_clone_ptr(int64_t arg) { - LDKC2Tuple_BlindedPayInfoBlindedPathZ* arg_conv = (LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(arg); - int64_t ret_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_C2Tuple_BlindedPayInfoBlindedPathZ_clone(int64_t orig) { - LDKC2Tuple_BlindedPayInfoBlindedPathZ* orig_conv = (LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(orig); - LDKC2Tuple_BlindedPayInfoBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ"); - *ret_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_C2Tuple_BlindedPayInfoBlindedPathZ_new(int64_t a, int64_t b) { - LDKBlindedPayInfo a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = BlindedPayInfo_clone(&a_conv); - LDKBlindedPath b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv = BlindedPath_clone(&b_conv); - LDKC2Tuple_BlindedPayInfoBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ"); - *ret_conv = C2Tuple_BlindedPayInfoBlindedPathZ_new(a_conv, b_conv); - return tag_ptr(ret_conv, true); -} - -void CS_LDK_C2Tuple_BlindedPayInfoBlindedPathZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ _res_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(_res_ptr); - FREE(untag_ptr(_res)); - C2Tuple_BlindedPayInfoBlindedPathZ_free(_res_conv); -} - -void CS_LDK_CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_free(int64_tArray _res) { - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ _res_constr; +void CS_LDK_CVec_BlindedPaymentPathZ_free(int64_tArray _res) { + LDKCVec_BlindedPaymentPathZ _res_constr; _res_constr.datalen = _res->arr_len; if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ 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_37 = _res_vals[l]; - void* _res_conv_37_ptr = untag_ptr(_res_conv_37); - CHECK_ACCESS(_res_conv_37_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ _res_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(_res_conv_37_ptr); - FREE(untag_ptr(_res_conv_37)); - _res_constr.data[l] = _res_conv_37_conv; + for (size_t u = 0; u < _res_constr.datalen; u++) { + int64_t _res_conv_20 = _res_vals[u]; + LDKBlindedPaymentPath _res_conv_20_conv; + _res_conv_20_conv.inner = untag_ptr(_res_conv_20); + _res_conv_20_conv.is_owned = ptr_is_owned(_res_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_20_conv); + _res_constr.data[u] = _res_conv_20_conv; } FREE(_res); - CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_free(_res_constr); + CVec_BlindedPaymentPathZ_free(_res_constr); } -int64_t CS_LDK_CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_ok(int64_tArray o) { - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ o_constr; +int64_t CS_LDK_CResult_CVec_BlindedPaymentPathZNoneZ_ok(int64_tArray o) { + LDKCVec_BlindedPaymentPathZ o_constr; o_constr.datalen = o->arr_len; if (o_constr.datalen > 0) - o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); + o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); else o_constr.data = NULL; int64_t* o_vals = o->elems; - for (size_t l = 0; l < o_constr.datalen; l++) { - int64_t o_conv_37 = o_vals[l]; - void* o_conv_37_ptr = untag_ptr(o_conv_37); - CHECK_ACCESS(o_conv_37_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ o_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(o_conv_37_ptr); - o_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(o_conv_37)); - o_constr.data[l] = o_conv_37_conv; + for (size_t u = 0; u < o_constr.datalen; u++) { + int64_t o_conv_20 = o_vals[u]; + LDKBlindedPaymentPath o_conv_20_conv; + o_conv_20_conv.inner = untag_ptr(o_conv_20); + o_conv_20_conv.is_owned = ptr_is_owned(o_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv_20_conv); + o_conv_20_conv = BlindedPaymentPath_clone(&o_conv_20_conv); + o_constr.data[u] = o_conv_20_conv; } FREE(o); - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ), "LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ"); - *ret_conv = CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_ok(o_constr); + LDKCResult_CVec_BlindedPaymentPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPaymentPathZNoneZ), "LDKCResult_CVec_BlindedPaymentPathZNoneZ"); + *ret_conv = CResult_CVec_BlindedPaymentPathZNoneZ_ok(o_constr); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_err() { - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ), "LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ"); - *ret_conv = CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_err(); +int64_t CS_LDK_CResult_CVec_BlindedPaymentPathZNoneZ_err() { + LDKCResult_CVec_BlindedPaymentPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPaymentPathZNoneZ), "LDKCResult_CVec_BlindedPaymentPathZNoneZ"); + *ret_conv = CResult_CVec_BlindedPaymentPathZNoneZ_err(); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_is_ok(int64_t o) { - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* o_conv = (LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_is_ok(o_conv); +jboolean CS_LDK_CResult_CVec_BlindedPaymentPathZNoneZ_is_ok(int64_t o) { + LDKCResult_CVec_BlindedPaymentPathZNoneZ* o_conv = (LDKCResult_CVec_BlindedPaymentPathZNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_CVec_BlindedPaymentPathZNoneZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_free(int64_t _res) { +void CS_LDK_CResult_CVec_BlindedPaymentPathZNoneZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ _res_conv = *(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ*)(_res_ptr); + LDKCResult_CVec_BlindedPaymentPathZNoneZ _res_conv = *(LDKCResult_CVec_BlindedPaymentPathZNoneZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_free(_res_conv); + CResult_CVec_BlindedPaymentPathZNoneZ_free(_res_conv); } -static inline uint64_t CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone_ptr(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR arg) { - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ), "LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ"); - *ret_conv = CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone(arg); +static inline uint64_t CResult_CVec_BlindedPaymentPathZNoneZ_clone_ptr(LDKCResult_CVec_BlindedPaymentPathZNoneZ *NONNULL_PTR arg) { + LDKCResult_CVec_BlindedPaymentPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPaymentPathZNoneZ), "LDKCResult_CVec_BlindedPaymentPathZNoneZ"); + *ret_conv = CResult_CVec_BlindedPaymentPathZNoneZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone_ptr(int64_t arg) { - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* arg_conv = (LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_CVec_BlindedPaymentPathZNoneZ_clone_ptr(int64_t arg) { + LDKCResult_CVec_BlindedPaymentPathZNoneZ* arg_conv = (LDKCResult_CVec_BlindedPaymentPathZNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_CVec_BlindedPaymentPathZNoneZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone(int64_t orig) { - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* orig_conv = (LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ*)untag_ptr(orig); - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ), "LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ"); - *ret_conv = CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone(orig_conv); +int64_t CS_LDK_CResult_CVec_BlindedPaymentPathZNoneZ_clone(int64_t orig) { + LDKCResult_CVec_BlindedPaymentPathZNoneZ* orig_conv = (LDKCResult_CVec_BlindedPaymentPathZNoneZ*)untag_ptr(orig); + LDKCResult_CVec_BlindedPaymentPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPaymentPathZNoneZ), "LDKCResult_CVec_BlindedPaymentPathZNoneZ"); + *ret_conv = CResult_CVec_BlindedPaymentPathZNoneZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -21092,68 +22239,88 @@ int64_t CS_LDK_CResult_OnionMessagePathNoneZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_CVec_BlindedPathZNoneZ_ok(int64_tArray o) { - LDKCVec_BlindedPathZ o_constr; +int64_t CS_LDK_CResult_CVec_BlindedMessagePathZNoneZ_ok(int64_tArray o) { + LDKCVec_BlindedMessagePathZ o_constr; o_constr.datalen = o->arr_len; if (o_constr.datalen > 0) - o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKBlindedPath), "LDKCVec_BlindedPathZ Elements"); + o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKBlindedMessagePath), "LDKCVec_BlindedMessagePathZ Elements"); else o_constr.data = NULL; int64_t* o_vals = o->elems; - for (size_t n = 0; n < o_constr.datalen; n++) { - int64_t o_conv_13 = o_vals[n]; - LDKBlindedPath o_conv_13_conv; - o_conv_13_conv.inner = untag_ptr(o_conv_13); - o_conv_13_conv.is_owned = ptr_is_owned(o_conv_13); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv_13_conv); - o_conv_13_conv = BlindedPath_clone(&o_conv_13_conv); - o_constr.data[n] = o_conv_13_conv; + for (size_t u = 0; u < o_constr.datalen; u++) { + int64_t o_conv_20 = o_vals[u]; + LDKBlindedMessagePath o_conv_20_conv; + o_conv_20_conv.inner = untag_ptr(o_conv_20); + o_conv_20_conv.is_owned = ptr_is_owned(o_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv_20_conv); + o_conv_20_conv = BlindedMessagePath_clone(&o_conv_20_conv); + o_constr.data[u] = o_conv_20_conv; } FREE(o); - LDKCResult_CVec_BlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPathZNoneZ), "LDKCResult_CVec_BlindedPathZNoneZ"); - *ret_conv = CResult_CVec_BlindedPathZNoneZ_ok(o_constr); + LDKCResult_CVec_BlindedMessagePathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedMessagePathZNoneZ), "LDKCResult_CVec_BlindedMessagePathZNoneZ"); + *ret_conv = CResult_CVec_BlindedMessagePathZNoneZ_ok(o_constr); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_CVec_BlindedPathZNoneZ_err() { - LDKCResult_CVec_BlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPathZNoneZ), "LDKCResult_CVec_BlindedPathZNoneZ"); - *ret_conv = CResult_CVec_BlindedPathZNoneZ_err(); +int64_t CS_LDK_CResult_CVec_BlindedMessagePathZNoneZ_err() { + LDKCResult_CVec_BlindedMessagePathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedMessagePathZNoneZ), "LDKCResult_CVec_BlindedMessagePathZNoneZ"); + *ret_conv = CResult_CVec_BlindedMessagePathZNoneZ_err(); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_CVec_BlindedPathZNoneZ_is_ok(int64_t o) { - LDKCResult_CVec_BlindedPathZNoneZ* o_conv = (LDKCResult_CVec_BlindedPathZNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_CVec_BlindedPathZNoneZ_is_ok(o_conv); +jboolean CS_LDK_CResult_CVec_BlindedMessagePathZNoneZ_is_ok(int64_t o) { + LDKCResult_CVec_BlindedMessagePathZNoneZ* o_conv = (LDKCResult_CVec_BlindedMessagePathZNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_CVec_BlindedMessagePathZNoneZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_CVec_BlindedPathZNoneZ_free(int64_t _res) { +void CS_LDK_CResult_CVec_BlindedMessagePathZNoneZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_CVec_BlindedPathZNoneZ _res_conv = *(LDKCResult_CVec_BlindedPathZNoneZ*)(_res_ptr); + LDKCResult_CVec_BlindedMessagePathZNoneZ _res_conv = *(LDKCResult_CVec_BlindedMessagePathZNoneZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_CVec_BlindedPathZNoneZ_free(_res_conv); + CResult_CVec_BlindedMessagePathZNoneZ_free(_res_conv); } -static inline uint64_t CResult_CVec_BlindedPathZNoneZ_clone_ptr(LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR arg) { - LDKCResult_CVec_BlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPathZNoneZ), "LDKCResult_CVec_BlindedPathZNoneZ"); - *ret_conv = CResult_CVec_BlindedPathZNoneZ_clone(arg); +static inline uint64_t CResult_CVec_BlindedMessagePathZNoneZ_clone_ptr(LDKCResult_CVec_BlindedMessagePathZNoneZ *NONNULL_PTR arg) { + LDKCResult_CVec_BlindedMessagePathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedMessagePathZNoneZ), "LDKCResult_CVec_BlindedMessagePathZNoneZ"); + *ret_conv = CResult_CVec_BlindedMessagePathZNoneZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_CVec_BlindedPathZNoneZ_clone_ptr(int64_t arg) { - LDKCResult_CVec_BlindedPathZNoneZ* arg_conv = (LDKCResult_CVec_BlindedPathZNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_CVec_BlindedPathZNoneZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_CVec_BlindedMessagePathZNoneZ_clone_ptr(int64_t arg) { + LDKCResult_CVec_BlindedMessagePathZNoneZ* arg_conv = (LDKCResult_CVec_BlindedMessagePathZNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_CVec_BlindedMessagePathZNoneZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_CVec_BlindedPathZNoneZ_clone(int64_t orig) { - LDKCResult_CVec_BlindedPathZNoneZ* orig_conv = (LDKCResult_CVec_BlindedPathZNoneZ*)untag_ptr(orig); - LDKCResult_CVec_BlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPathZNoneZ), "LDKCResult_CVec_BlindedPathZNoneZ"); - *ret_conv = CResult_CVec_BlindedPathZNoneZ_clone(orig_conv); +int64_t CS_LDK_CResult_CVec_BlindedMessagePathZNoneZ_clone(int64_t orig) { + LDKCResult_CVec_BlindedMessagePathZNoneZ* orig_conv = (LDKCResult_CVec_BlindedMessagePathZNoneZ*)untag_ptr(orig); + LDKCResult_CVec_BlindedMessagePathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedMessagePathZNoneZ), "LDKCResult_CVec_BlindedMessagePathZNoneZ"); + *ret_conv = CResult_CVec_BlindedMessagePathZNoneZ_clone(orig_conv); return tag_ptr(ret_conv, true); } +void CS_LDK_CVec_MessageForwardNodeZ_free(int64_tArray _res) { + LDKCVec_MessageForwardNodeZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMessageForwardNode), "LDKCVec_MessageForwardNodeZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = _res->elems; + for (size_t u = 0; u < _res_constr.datalen; u++) { + int64_t _res_conv_20 = _res_vals[u]; + LDKMessageForwardNode _res_conv_20_conv; + _res_conv_20_conv.inner = untag_ptr(_res_conv_20); + _res_conv_20_conv.is_owned = ptr_is_owned(_res_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_20_conv); + _res_constr.data[u] = _res_conv_20_conv; + } + FREE(_res); + CVec_MessageForwardNodeZ_free(_res_constr); +} + int64_t CS_LDK_CResult_InFlightHtlcsDecodeErrorZ_ok(int64_t o) { LDKInFlightHtlcs o_conv; o_conv.inner = untag_ptr(o); @@ -21574,26 +22741,6 @@ void CS_LDK_CVec_RouteHintZ_free(int64_tArray _res) { CVec_RouteHintZ_free(_res_constr); } -void CS_LDK_CVec_RouteHintHopZ_free(int64_tArray _res) { - LDKCVec_RouteHintHopZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = _res->elems; - for (size_t o = 0; o < _res_constr.datalen; o++) { - int64_t _res_conv_14 = _res_vals[o]; - LDKRouteHintHop _res_conv_14_conv; - _res_conv_14_conv.inner = untag_ptr(_res_conv_14); - _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv); - _res_constr.data[o] = _res_conv_14_conv; - } - FREE(_res); - CVec_RouteHintHopZ_free(_res_constr); -} - int64_t CS_LDK_CResult_RouteHintDecodeErrorZ_ok(int64_t o) { LDKRouteHint o_conv; o_conv.inner = untag_ptr(o); @@ -22922,6 +24069,60 @@ void CS_LDK_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticError CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_free(_res_conv); } +int64_t CS_LDK_CResult_OfferDecodeErrorZ_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_OfferDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferDecodeErrorZ), "LDKCResult_OfferDecodeErrorZ"); + *ret_conv = CResult_OfferDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_OfferDecodeErrorZ_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_OfferDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferDecodeErrorZ), "LDKCResult_OfferDecodeErrorZ"); + *ret_conv = CResult_OfferDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_OfferDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_OfferDecodeErrorZ* o_conv = (LDKCResult_OfferDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OfferDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_OfferDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_OfferDecodeErrorZ _res_conv = *(LDKCResult_OfferDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_OfferDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_OfferDecodeErrorZ_clone_ptr(LDKCResult_OfferDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OfferDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferDecodeErrorZ), "LDKCResult_OfferDecodeErrorZ"); + *ret_conv = CResult_OfferDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_OfferDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_OfferDecodeErrorZ* arg_conv = (LDKCResult_OfferDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OfferDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_OfferDecodeErrorZ_clone(int64_t orig) { + LDKCResult_OfferDecodeErrorZ* orig_conv = (LDKCResult_OfferDecodeErrorZ*)untag_ptr(orig); + LDKCResult_OfferDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferDecodeErrorZ), "LDKCResult_OfferDecodeErrorZ"); + *ret_conv = CResult_OfferDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + int64_t CS_LDK_CResult_OfferBolt12ParseErrorZ_ok(int64_t o) { LDKOffer o_conv; o_conv.inner = untag_ptr(o); @@ -23608,11 +24809,10 @@ void CS_LDK_CVec_SocketAddressZ_free(int64_tArray _res) { } int64_t CS_LDK_CResult_NodeAnnouncementInfoDecodeErrorZ_ok(int64_t o) { - LDKNodeAnnouncementInfo o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = NodeAnnouncementInfo_clone(&o_conv); + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKNodeAnnouncementInfo o_conv = *(LDKNodeAnnouncementInfo*)(o_ptr); + o_conv = NodeAnnouncementInfo_clone((LDKNodeAnnouncementInfo*)untag_ptr(o)); LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); @@ -23715,6 +24915,53 @@ int64_t CS_LDK_CResult_NodeAliasDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_COption_NodeAnnouncementInfoZ_some(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKNodeAnnouncementInfo o_conv = *(LDKNodeAnnouncementInfo*)(o_ptr); + o_conv = NodeAnnouncementInfo_clone((LDKNodeAnnouncementInfo*)untag_ptr(o)); + LDKCOption_NodeAnnouncementInfoZ *ret_copy = MALLOC(sizeof(LDKCOption_NodeAnnouncementInfoZ), "LDKCOption_NodeAnnouncementInfoZ"); + *ret_copy = COption_NodeAnnouncementInfoZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_COption_NodeAnnouncementInfoZ_none() { + LDKCOption_NodeAnnouncementInfoZ *ret_copy = MALLOC(sizeof(LDKCOption_NodeAnnouncementInfoZ), "LDKCOption_NodeAnnouncementInfoZ"); + *ret_copy = COption_NodeAnnouncementInfoZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_COption_NodeAnnouncementInfoZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_NodeAnnouncementInfoZ _res_conv = *(LDKCOption_NodeAnnouncementInfoZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_NodeAnnouncementInfoZ_free(_res_conv); +} + +static inline uint64_t COption_NodeAnnouncementInfoZ_clone_ptr(LDKCOption_NodeAnnouncementInfoZ *NONNULL_PTR arg) { + LDKCOption_NodeAnnouncementInfoZ *ret_copy = MALLOC(sizeof(LDKCOption_NodeAnnouncementInfoZ), "LDKCOption_NodeAnnouncementInfoZ"); + *ret_copy = COption_NodeAnnouncementInfoZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_COption_NodeAnnouncementInfoZ_clone_ptr(int64_t arg) { + LDKCOption_NodeAnnouncementInfoZ* arg_conv = (LDKCOption_NodeAnnouncementInfoZ*)untag_ptr(arg); + int64_t ret_conv = COption_NodeAnnouncementInfoZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_COption_NodeAnnouncementInfoZ_clone(int64_t orig) { + LDKCOption_NodeAnnouncementInfoZ* orig_conv = (LDKCOption_NodeAnnouncementInfoZ*)untag_ptr(orig); + LDKCOption_NodeAnnouncementInfoZ *ret_copy = MALLOC(sizeof(LDKCOption_NodeAnnouncementInfoZ), "LDKCOption_NodeAnnouncementInfoZ"); + *ret_copy = COption_NodeAnnouncementInfoZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + int64_t CS_LDK_CResult_NodeInfoDecodeErrorZ_ok(int64_t o) { LDKNodeInfo o_conv; o_conv.inner = untag_ptr(o); @@ -25038,117 +26285,352 @@ int64_t CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -int64_t CS_LDK_COption_OffersMessageZ_some(int64_t o) { +int64_t CS_LDK_COption_OffersContextZ_some(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); - LDKOffersMessage o_conv = *(LDKOffersMessage*)(o_ptr); - o_conv = OffersMessage_clone((LDKOffersMessage*)untag_ptr(o)); - LDKCOption_OffersMessageZ *ret_copy = MALLOC(sizeof(LDKCOption_OffersMessageZ), "LDKCOption_OffersMessageZ"); - *ret_copy = COption_OffersMessageZ_some(o_conv); + LDKOffersContext o_conv = *(LDKOffersContext*)(o_ptr); + o_conv = OffersContext_clone((LDKOffersContext*)untag_ptr(o)); + LDKCOption_OffersContextZ *ret_copy = MALLOC(sizeof(LDKCOption_OffersContextZ), "LDKCOption_OffersContextZ"); + *ret_copy = COption_OffersContextZ_some(o_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_COption_OffersMessageZ_none() { - LDKCOption_OffersMessageZ *ret_copy = MALLOC(sizeof(LDKCOption_OffersMessageZ), "LDKCOption_OffersMessageZ"); - *ret_copy = COption_OffersMessageZ_none(); +int64_t CS_LDK_COption_OffersContextZ_none() { + LDKCOption_OffersContextZ *ret_copy = MALLOC(sizeof(LDKCOption_OffersContextZ), "LDKCOption_OffersContextZ"); + *ret_copy = COption_OffersContextZ_none(); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void CS_LDK_COption_OffersMessageZ_free(int64_t _res) { +void CS_LDK_COption_OffersContextZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCOption_OffersMessageZ _res_conv = *(LDKCOption_OffersMessageZ*)(_res_ptr); + LDKCOption_OffersContextZ _res_conv = *(LDKCOption_OffersContextZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_OffersMessageZ_free(_res_conv); + COption_OffersContextZ_free(_res_conv); } -static inline uint64_t COption_OffersMessageZ_clone_ptr(LDKCOption_OffersMessageZ *NONNULL_PTR arg) { - LDKCOption_OffersMessageZ *ret_copy = MALLOC(sizeof(LDKCOption_OffersMessageZ), "LDKCOption_OffersMessageZ"); - *ret_copy = COption_OffersMessageZ_clone(arg); +static inline uint64_t COption_OffersContextZ_clone_ptr(LDKCOption_OffersContextZ *NONNULL_PTR arg) { + LDKCOption_OffersContextZ *ret_copy = MALLOC(sizeof(LDKCOption_OffersContextZ), "LDKCOption_OffersContextZ"); + *ret_copy = COption_OffersContextZ_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_COption_OffersMessageZ_clone_ptr(int64_t arg) { - LDKCOption_OffersMessageZ* arg_conv = (LDKCOption_OffersMessageZ*)untag_ptr(arg); - int64_t ret_conv = COption_OffersMessageZ_clone_ptr(arg_conv); +int64_t CS_LDK_COption_OffersContextZ_clone_ptr(int64_t arg) { + LDKCOption_OffersContextZ* arg_conv = (LDKCOption_OffersContextZ*)untag_ptr(arg); + int64_t ret_conv = COption_OffersContextZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_COption_OffersMessageZ_clone(int64_t orig) { - LDKCOption_OffersMessageZ* orig_conv = (LDKCOption_OffersMessageZ*)untag_ptr(orig); - LDKCOption_OffersMessageZ *ret_copy = MALLOC(sizeof(LDKCOption_OffersMessageZ), "LDKCOption_OffersMessageZ"); - *ret_copy = COption_OffersMessageZ_clone(orig_conv); +int64_t CS_LDK_COption_OffersContextZ_clone(int64_t orig) { + LDKCOption_OffersContextZ* orig_conv = (LDKCOption_OffersContextZ*)untag_ptr(orig); + LDKCOption_OffersContextZ *ret_copy = MALLOC(sizeof(LDKCOption_OffersContextZ), "LDKCOption_OffersContextZ"); + *ret_copy = COption_OffersContextZ_clone(orig_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline uint64_t C3Tuple_OffersMessageDestinationBlindedPathZ_clone_ptr(LDKC3Tuple_OffersMessageDestinationBlindedPathZ *NONNULL_PTR arg) { - LDKC3Tuple_OffersMessageDestinationBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OffersMessageDestinationBlindedPathZ), "LDKC3Tuple_OffersMessageDestinationBlindedPathZ"); - *ret_conv = C3Tuple_OffersMessageDestinationBlindedPathZ_clone(arg); +static inline uint64_t C2Tuple_OffersMessageResponseInstructionZ_clone_ptr(LDKC2Tuple_OffersMessageResponseInstructionZ *NONNULL_PTR arg) { + LDKC2Tuple_OffersMessageResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OffersMessageResponseInstructionZ), "LDKC2Tuple_OffersMessageResponseInstructionZ"); + *ret_conv = C2Tuple_OffersMessageResponseInstructionZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C3Tuple_OffersMessageDestinationBlindedPathZ_clone_ptr(int64_t arg) { - LDKC3Tuple_OffersMessageDestinationBlindedPathZ* arg_conv = (LDKC3Tuple_OffersMessageDestinationBlindedPathZ*)untag_ptr(arg); - int64_t ret_conv = C3Tuple_OffersMessageDestinationBlindedPathZ_clone_ptr(arg_conv); +int64_t CS_LDK_C2Tuple_OffersMessageResponseInstructionZ_clone_ptr(int64_t arg) { + LDKC2Tuple_OffersMessageResponseInstructionZ* arg_conv = (LDKC2Tuple_OffersMessageResponseInstructionZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_OffersMessageResponseInstructionZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_C3Tuple_OffersMessageDestinationBlindedPathZ_clone(int64_t orig) { - LDKC3Tuple_OffersMessageDestinationBlindedPathZ* orig_conv = (LDKC3Tuple_OffersMessageDestinationBlindedPathZ*)untag_ptr(orig); - LDKC3Tuple_OffersMessageDestinationBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OffersMessageDestinationBlindedPathZ), "LDKC3Tuple_OffersMessageDestinationBlindedPathZ"); - *ret_conv = C3Tuple_OffersMessageDestinationBlindedPathZ_clone(orig_conv); +int64_t CS_LDK_C2Tuple_OffersMessageResponseInstructionZ_clone(int64_t orig) { + LDKC2Tuple_OffersMessageResponseInstructionZ* orig_conv = (LDKC2Tuple_OffersMessageResponseInstructionZ*)untag_ptr(orig); + LDKC2Tuple_OffersMessageResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OffersMessageResponseInstructionZ), "LDKC2Tuple_OffersMessageResponseInstructionZ"); + *ret_conv = C2Tuple_OffersMessageResponseInstructionZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C3Tuple_OffersMessageDestinationBlindedPathZ_new(int64_t a, int64_t b, int64_t c) { +int64_t CS_LDK_C2Tuple_OffersMessageResponseInstructionZ_new(int64_t a, int64_t b) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKOffersMessage a_conv = *(LDKOffersMessage*)(a_ptr); + a_conv = OffersMessage_clone((LDKOffersMessage*)untag_ptr(a)); + LDKResponseInstruction 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 = ResponseInstruction_clone(&b_conv); + LDKC2Tuple_OffersMessageResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OffersMessageResponseInstructionZ), "LDKC2Tuple_OffersMessageResponseInstructionZ"); + *ret_conv = C2Tuple_OffersMessageResponseInstructionZ_new(a_conv, b_conv); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_C2Tuple_OffersMessageResponseInstructionZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKC2Tuple_OffersMessageResponseInstructionZ _res_conv = *(LDKC2Tuple_OffersMessageResponseInstructionZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_OffersMessageResponseInstructionZ_free(_res_conv); +} + +int64_t CS_LDK_COption_C2Tuple_OffersMessageResponseInstructionZZ_some(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_OffersMessageResponseInstructionZ o_conv = *(LDKC2Tuple_OffersMessageResponseInstructionZ*)(o_ptr); + o_conv = C2Tuple_OffersMessageResponseInstructionZ_clone((LDKC2Tuple_OffersMessageResponseInstructionZ*)untag_ptr(o)); + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ), "LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_OffersMessageResponseInstructionZZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_COption_C2Tuple_OffersMessageResponseInstructionZZ_none() { + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ), "LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_OffersMessageResponseInstructionZZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_COption_C2Tuple_OffersMessageResponseInstructionZZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ _res_conv = *(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_C2Tuple_OffersMessageResponseInstructionZZ_free(_res_conv); +} + +static inline uint64_t COption_C2Tuple_OffersMessageResponseInstructionZZ_clone_ptr(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ *NONNULL_PTR arg) { + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ), "LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_OffersMessageResponseInstructionZZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_COption_C2Tuple_OffersMessageResponseInstructionZZ_clone_ptr(int64_t arg) { + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ* arg_conv = (LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ*)untag_ptr(arg); + int64_t ret_conv = COption_C2Tuple_OffersMessageResponseInstructionZZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_COption_C2Tuple_OffersMessageResponseInstructionZZ_clone(int64_t orig) { + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ* orig_conv = (LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ*)untag_ptr(orig); + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ), "LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_OffersMessageResponseInstructionZZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline uint64_t C2Tuple_OffersMessageMessageSendInstructionsZ_clone_ptr(LDKC2Tuple_OffersMessageMessageSendInstructionsZ *NONNULL_PTR arg) { + LDKC2Tuple_OffersMessageMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OffersMessageMessageSendInstructionsZ), "LDKC2Tuple_OffersMessageMessageSendInstructionsZ"); + *ret_conv = C2Tuple_OffersMessageMessageSendInstructionsZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_C2Tuple_OffersMessageMessageSendInstructionsZ_clone_ptr(int64_t arg) { + LDKC2Tuple_OffersMessageMessageSendInstructionsZ* arg_conv = (LDKC2Tuple_OffersMessageMessageSendInstructionsZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_OffersMessageMessageSendInstructionsZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_C2Tuple_OffersMessageMessageSendInstructionsZ_clone(int64_t orig) { + LDKC2Tuple_OffersMessageMessageSendInstructionsZ* orig_conv = (LDKC2Tuple_OffersMessageMessageSendInstructionsZ*)untag_ptr(orig); + LDKC2Tuple_OffersMessageMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OffersMessageMessageSendInstructionsZ), "LDKC2Tuple_OffersMessageMessageSendInstructionsZ"); + *ret_conv = C2Tuple_OffersMessageMessageSendInstructionsZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_C2Tuple_OffersMessageMessageSendInstructionsZ_new(int64_t a, int64_t b) { void* a_ptr = untag_ptr(a); CHECK_ACCESS(a_ptr); LDKOffersMessage a_conv = *(LDKOffersMessage*)(a_ptr); a_conv = OffersMessage_clone((LDKOffersMessage*)untag_ptr(a)); void* b_ptr = untag_ptr(b); CHECK_ACCESS(b_ptr); - LDKDestination b_conv = *(LDKDestination*)(b_ptr); - b_conv = Destination_clone((LDKDestination*)untag_ptr(b)); - LDKBlindedPath 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 = BlindedPath_clone(&c_conv); - LDKC3Tuple_OffersMessageDestinationBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OffersMessageDestinationBlindedPathZ), "LDKC3Tuple_OffersMessageDestinationBlindedPathZ"); - *ret_conv = C3Tuple_OffersMessageDestinationBlindedPathZ_new(a_conv, b_conv, c_conv); + LDKMessageSendInstructions b_conv = *(LDKMessageSendInstructions*)(b_ptr); + b_conv = MessageSendInstructions_clone((LDKMessageSendInstructions*)untag_ptr(b)); + LDKC2Tuple_OffersMessageMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OffersMessageMessageSendInstructionsZ), "LDKC2Tuple_OffersMessageMessageSendInstructionsZ"); + *ret_conv = C2Tuple_OffersMessageMessageSendInstructionsZ_new(a_conv, b_conv); return tag_ptr(ret_conv, true); } -void CS_LDK_C3Tuple_OffersMessageDestinationBlindedPathZ_free(int64_t _res) { +void CS_LDK_C2Tuple_OffersMessageMessageSendInstructionsZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKC3Tuple_OffersMessageDestinationBlindedPathZ _res_conv = *(LDKC3Tuple_OffersMessageDestinationBlindedPathZ*)(_res_ptr); + LDKC2Tuple_OffersMessageMessageSendInstructionsZ _res_conv = *(LDKC2Tuple_OffersMessageMessageSendInstructionsZ*)(_res_ptr); FREE(untag_ptr(_res)); - C3Tuple_OffersMessageDestinationBlindedPathZ_free(_res_conv); + C2Tuple_OffersMessageMessageSendInstructionsZ_free(_res_conv); } -void CS_LDK_CVec_C3Tuple_OffersMessageDestinationBlindedPathZZ_free(int64_tArray _res) { - LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ _res_constr; +void CS_LDK_CVec_C2Tuple_OffersMessageMessageSendInstructionsZZ_free(int64_tArray _res) { + LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ _res_constr; _res_constr.datalen = _res->arr_len; if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC3Tuple_OffersMessageDestinationBlindedPathZ), "LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OffersMessageMessageSendInstructionsZ), "LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ 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_OffersMessageDestinationBlindedPathZ _res_conv_49_conv = *(LDKC3Tuple_OffersMessageDestinationBlindedPathZ*)(_res_conv_49_ptr); - FREE(untag_ptr(_res_conv_49)); - _res_constr.data[x] = _res_conv_49_conv; + for (size_t w = 0; w < _res_constr.datalen; w++) { + int64_t _res_conv_48 = _res_vals[w]; + void* _res_conv_48_ptr = untag_ptr(_res_conv_48); + CHECK_ACCESS(_res_conv_48_ptr); + LDKC2Tuple_OffersMessageMessageSendInstructionsZ _res_conv_48_conv = *(LDKC2Tuple_OffersMessageMessageSendInstructionsZ*)(_res_conv_48_ptr); + FREE(untag_ptr(_res_conv_48)); + _res_constr.data[w] = _res_conv_48_conv; + } + FREE(_res); + CVec_C2Tuple_OffersMessageMessageSendInstructionsZZ_free(_res_constr); +} + +static inline uint64_t C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone_ptr(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ *NONNULL_PTR arg) { + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ), "LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ"); + *ret_conv = C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone_ptr(int64_t arg) { + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ* arg_conv = (LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone(int64_t orig) { + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ* orig_conv = (LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ*)untag_ptr(orig); + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ), "LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ"); + *ret_conv = C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_C2Tuple_ReleaseHeldHtlcResponseInstructionZ_new(int64_t a, int64_t b) { + LDKReleaseHeldHtlc a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = ReleaseHeldHtlc_clone(&a_conv); + LDKResponseInstruction 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 = ResponseInstruction_clone(&b_conv); + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ), "LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ"); + *ret_conv = C2Tuple_ReleaseHeldHtlcResponseInstructionZ_new(a_conv, b_conv); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_C2Tuple_ReleaseHeldHtlcResponseInstructionZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ _res_conv = *(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_ReleaseHeldHtlcResponseInstructionZ_free(_res_conv); +} + +int64_t CS_LDK_COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_some(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ o_conv = *(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ*)(o_ptr); + o_conv = C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone((LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ*)untag_ptr(o)); + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ), "LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_none() { + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ), "LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ _res_conv = *(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_free(_res_conv); +} + +static inline uint64_t COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone_ptr(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ *NONNULL_PTR arg) { + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ), "LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone_ptr(int64_t arg) { + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ* arg_conv = (LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ*)untag_ptr(arg); + int64_t ret_conv = COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone(int64_t orig) { + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ* orig_conv = (LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ*)untag_ptr(orig); + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ), "LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline uint64_t C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone_ptr(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ *NONNULL_PTR arg) { + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ), "LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ"); + *ret_conv = C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone_ptr(int64_t arg) { + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ* arg_conv = (LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone(int64_t orig) { + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ* orig_conv = (LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ*)untag_ptr(orig); + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ), "LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ"); + *ret_conv = C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_new(int64_t a, int64_t b) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKAsyncPaymentsMessage a_conv = *(LDKAsyncPaymentsMessage*)(a_ptr); + a_conv = AsyncPaymentsMessage_clone((LDKAsyncPaymentsMessage*)untag_ptr(a)); + void* b_ptr = untag_ptr(b); + CHECK_ACCESS(b_ptr); + LDKMessageSendInstructions b_conv = *(LDKMessageSendInstructions*)(b_ptr); + b_conv = MessageSendInstructions_clone((LDKMessageSendInstructions*)untag_ptr(b)); + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ), "LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ"); + *ret_conv = C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_new(a_conv, b_conv); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ _res_conv = *(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_free(_res_conv); +} + +void CS_LDK_CVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ_free(int64_tArray _res) { + LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ), "LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = _res->elems; + for (size_t d = 0; d < _res_constr.datalen; d++) { + int64_t _res_conv_55 = _res_vals[d]; + void* _res_conv_55_ptr = untag_ptr(_res_conv_55); + CHECK_ACCESS(_res_conv_55_ptr); + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ _res_conv_55_conv = *(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ*)(_res_conv_55_ptr); + FREE(untag_ptr(_res_conv_55)); + _res_constr.data[d] = _res_conv_55_conv; } FREE(_res); - CVec_C3Tuple_OffersMessageDestinationBlindedPathZZ_free(_res_constr); + CVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ_free(_res_constr); } int64_t CS_LDK_CResult_PhantomRouteHintsDecodeErrorZ_ok(int64_t o) { @@ -26128,6 +27610,56 @@ void CS_LDK_CVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ_free(int64_ CVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ_free(_res_constr); } +int64_t CS_LDK_CResult_NoneReplayEventZ_ok() { + LDKCResult_NoneReplayEventZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneReplayEventZ), "LDKCResult_NoneReplayEventZ"); + *ret_conv = CResult_NoneReplayEventZ_ok(); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_NoneReplayEventZ_err(int64_t e) { + LDKReplayEvent e_conv; + e_conv.inner = untag_ptr(e); + e_conv.is_owned = ptr_is_owned(e); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = ReplayEvent_clone(&e_conv); + LDKCResult_NoneReplayEventZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneReplayEventZ), "LDKCResult_NoneReplayEventZ"); + *ret_conv = CResult_NoneReplayEventZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_NoneReplayEventZ_is_ok(int64_t o) { + LDKCResult_NoneReplayEventZ* o_conv = (LDKCResult_NoneReplayEventZ*)untag_ptr(o); + jboolean ret_conv = CResult_NoneReplayEventZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_NoneReplayEventZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_NoneReplayEventZ _res_conv = *(LDKCResult_NoneReplayEventZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_NoneReplayEventZ_free(_res_conv); +} + +static inline uint64_t CResult_NoneReplayEventZ_clone_ptr(LDKCResult_NoneReplayEventZ *NONNULL_PTR arg) { + LDKCResult_NoneReplayEventZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneReplayEventZ), "LDKCResult_NoneReplayEventZ"); + *ret_conv = CResult_NoneReplayEventZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_NoneReplayEventZ_clone_ptr(int64_t arg) { + LDKCResult_NoneReplayEventZ* arg_conv = (LDKCResult_NoneReplayEventZ*)untag_ptr(arg); + int64_t ret_conv = CResult_NoneReplayEventZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_NoneReplayEventZ_clone(int64_t orig) { + LDKCResult_NoneReplayEventZ* orig_conv = (LDKCResult_NoneReplayEventZ*)untag_ptr(orig); + LDKCResult_NoneReplayEventZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneReplayEventZ), "LDKCResult_NoneReplayEventZ"); + *ret_conv = CResult_NoneReplayEventZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + void CS_LDK_CVec_CommitmentTransactionZ_free(int64_tArray _res) { LDKCVec_CommitmentTransactionZ _res_constr; _res_constr.datalen = _res->arr_len; @@ -26454,76 +27986,96 @@ void CS_LDK_CVec_C2Tuple_PublicKeyTypeZZ_free(int64_tArray _res) { CVec_C2Tuple_PublicKeyTypeZZ_free(_res_constr); } -static inline uint64_t C2Tuple_PublicKeyCVec_SocketAddressZZ_clone_ptr(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *NONNULL_PTR arg) { - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ), "LDKC2Tuple_PublicKeyCVec_SocketAddressZZ"); - *ret_conv = C2Tuple_PublicKeyCVec_SocketAddressZZ_clone(arg); +static inline uint64_t C2Tuple_OnionMessageContentsResponseInstructionZ_clone_ptr(LDKC2Tuple_OnionMessageContentsResponseInstructionZ *NONNULL_PTR arg) { + LDKC2Tuple_OnionMessageContentsResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OnionMessageContentsResponseInstructionZ), "LDKC2Tuple_OnionMessageContentsResponseInstructionZ"); + *ret_conv = C2Tuple_OnionMessageContentsResponseInstructionZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C2Tuple_PublicKeyCVec_SocketAddressZZ_clone_ptr(int64_t arg) { - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* arg_conv = (LDKC2Tuple_PublicKeyCVec_SocketAddressZZ*)untag_ptr(arg); - int64_t ret_conv = C2Tuple_PublicKeyCVec_SocketAddressZZ_clone_ptr(arg_conv); +int64_t CS_LDK_C2Tuple_OnionMessageContentsResponseInstructionZ_clone_ptr(int64_t arg) { + LDKC2Tuple_OnionMessageContentsResponseInstructionZ* arg_conv = (LDKC2Tuple_OnionMessageContentsResponseInstructionZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_OnionMessageContentsResponseInstructionZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_C2Tuple_PublicKeyCVec_SocketAddressZZ_clone(int64_t orig) { - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* orig_conv = (LDKC2Tuple_PublicKeyCVec_SocketAddressZZ*)untag_ptr(orig); - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ), "LDKC2Tuple_PublicKeyCVec_SocketAddressZZ"); - *ret_conv = C2Tuple_PublicKeyCVec_SocketAddressZZ_clone(orig_conv); +int64_t CS_LDK_C2Tuple_OnionMessageContentsResponseInstructionZ_clone(int64_t orig) { + LDKC2Tuple_OnionMessageContentsResponseInstructionZ* orig_conv = (LDKC2Tuple_OnionMessageContentsResponseInstructionZ*)untag_ptr(orig); + LDKC2Tuple_OnionMessageContentsResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OnionMessageContentsResponseInstructionZ), "LDKC2Tuple_OnionMessageContentsResponseInstructionZ"); + *ret_conv = C2Tuple_OnionMessageContentsResponseInstructionZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C2Tuple_PublicKeyCVec_SocketAddressZZ_new(int8_tArray a, int64_tArray b) { - LDKPublicKey a_ref; - CHECK(a->arr_len == 33); - memcpy(a_ref.compressed_form, a->elems, 33); FREE(a); - LDKCVec_SocketAddressZ b_constr; - b_constr.datalen = b->arr_len; - if (b_constr.datalen > 0) - b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKSocketAddress), "LDKCVec_SocketAddressZ Elements"); - else - b_constr.data = NULL; - int64_t* b_vals = b->elems; - for (size_t p = 0; p < b_constr.datalen; p++) { - int64_t b_conv_15 = b_vals[p]; - void* b_conv_15_ptr = untag_ptr(b_conv_15); - CHECK_ACCESS(b_conv_15_ptr); - LDKSocketAddress b_conv_15_conv = *(LDKSocketAddress*)(b_conv_15_ptr); - b_conv_15_conv = SocketAddress_clone((LDKSocketAddress*)untag_ptr(b_conv_15)); - b_constr.data[p] = b_conv_15_conv; +int64_t CS_LDK_C2Tuple_OnionMessageContentsResponseInstructionZ_new(int64_t a, int64_t b) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKOnionMessageContents a_conv = *(LDKOnionMessageContents*)(a_ptr); + if (a_conv.free == LDKOnionMessageContents_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOnionMessageContents_JCalls_cloned(&a_conv); } - FREE(b); - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ), "LDKC2Tuple_PublicKeyCVec_SocketAddressZZ"); - *ret_conv = C2Tuple_PublicKeyCVec_SocketAddressZZ_new(a_ref, b_constr); + LDKResponseInstruction 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 = ResponseInstruction_clone(&b_conv); + LDKC2Tuple_OnionMessageContentsResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OnionMessageContentsResponseInstructionZ), "LDKC2Tuple_OnionMessageContentsResponseInstructionZ"); + *ret_conv = C2Tuple_OnionMessageContentsResponseInstructionZ_new(a_conv, b_conv); return tag_ptr(ret_conv, true); } -void CS_LDK_C2Tuple_PublicKeyCVec_SocketAddressZZ_free(int64_t _res) { +void CS_LDK_C2Tuple_OnionMessageContentsResponseInstructionZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ _res_conv = *(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ*)(_res_ptr); + LDKC2Tuple_OnionMessageContentsResponseInstructionZ _res_conv = *(LDKC2Tuple_OnionMessageContentsResponseInstructionZ*)(_res_ptr); FREE(untag_ptr(_res)); - C2Tuple_PublicKeyCVec_SocketAddressZZ_free(_res_conv); + C2Tuple_OnionMessageContentsResponseInstructionZ_free(_res_conv); } -void CS_LDK_CVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ_free(int64_tArray _res) { - LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ), "LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = _res->elems; - for (size_t o = 0; o < _res_constr.datalen; o++) { - int64_t _res_conv_40 = _res_vals[o]; - void* _res_conv_40_ptr = untag_ptr(_res_conv_40); - CHECK_ACCESS(_res_conv_40_ptr); - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ _res_conv_40_conv = *(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ*)(_res_conv_40_ptr); - FREE(untag_ptr(_res_conv_40)); - _res_constr.data[o] = _res_conv_40_conv; - } - FREE(_res); - CVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ_free(_res_constr); +int64_t CS_LDK_COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_some(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_OnionMessageContentsResponseInstructionZ o_conv = *(LDKC2Tuple_OnionMessageContentsResponseInstructionZ*)(o_ptr); + o_conv = C2Tuple_OnionMessageContentsResponseInstructionZ_clone((LDKC2Tuple_OnionMessageContentsResponseInstructionZ*)untag_ptr(o)); + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ), "LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_none() { + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ), "LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ _res_conv = *(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_free(_res_conv); +} + +static inline uint64_t COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone_ptr(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ *NONNULL_PTR arg) { + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ), "LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone_ptr(int64_t arg) { + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ* arg_conv = (LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ*)untag_ptr(arg); + int64_t ret_conv = COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone(int64_t orig) { + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ* orig_conv = (LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ*)untag_ptr(orig); + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ), "LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } int64_t CS_LDK_COption_OnionMessageContentsZ_some(int64_t o) { @@ -26629,25 +28181,25 @@ int64_t CS_LDK_CResult_COption_OnionMessageContentsZDecodeErrorZ_clone(int64_t return tag_ptr(ret_conv, true); } -static inline uint64_t C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone_ptr(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *NONNULL_PTR arg) { - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ), "LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ"); - *ret_conv = C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone(arg); +static inline uint64_t C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone_ptr(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ *NONNULL_PTR arg) { + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ), "LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ"); + *ret_conv = C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone_ptr(int64_t arg) { - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ* arg_conv = (LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ*)untag_ptr(arg); - int64_t ret_conv = C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone_ptr(arg_conv); +int64_t CS_LDK_C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone_ptr(int64_t arg) { + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ* arg_conv = (LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone(int64_t orig) { - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ* orig_conv = (LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ*)untag_ptr(orig); - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ), "LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ"); - *ret_conv = C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone(orig_conv); +int64_t CS_LDK_C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone(int64_t orig) { + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ* orig_conv = (LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ*)untag_ptr(orig); + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ), "LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ"); + *ret_conv = C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C3Tuple_OnionMessageContentsDestinationBlindedPathZ_new(int64_t a, int64_t b, int64_t c) { +int64_t CS_LDK_C2Tuple_OnionMessageContentsMessageSendInstructionsZ_new(int64_t a, int64_t b) { void* a_ptr = untag_ptr(a); CHECK_ACCESS(a_ptr); LDKOnionMessageContents a_conv = *(LDKOnionMessageContents*)(a_ptr); @@ -26657,45 +28209,40 @@ int64_t CS_LDK_C3Tuple_OnionMessageContentsDestinationBlindedPathZ_new(int64_t } void* b_ptr = untag_ptr(b); CHECK_ACCESS(b_ptr); - LDKDestination b_conv = *(LDKDestination*)(b_ptr); - b_conv = Destination_clone((LDKDestination*)untag_ptr(b)); - LDKBlindedPath 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 = BlindedPath_clone(&c_conv); - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ), "LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ"); - *ret_conv = C3Tuple_OnionMessageContentsDestinationBlindedPathZ_new(a_conv, b_conv, c_conv); + LDKMessageSendInstructions b_conv = *(LDKMessageSendInstructions*)(b_ptr); + b_conv = MessageSendInstructions_clone((LDKMessageSendInstructions*)untag_ptr(b)); + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ), "LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ"); + *ret_conv = C2Tuple_OnionMessageContentsMessageSendInstructionsZ_new(a_conv, b_conv); return tag_ptr(ret_conv, true); } -void CS_LDK_C3Tuple_OnionMessageContentsDestinationBlindedPathZ_free(int64_t _res) { +void CS_LDK_C2Tuple_OnionMessageContentsMessageSendInstructionsZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ _res_conv = *(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ*)(_res_ptr); + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ _res_conv = *(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ*)(_res_ptr); FREE(untag_ptr(_res)); - C3Tuple_OnionMessageContentsDestinationBlindedPathZ_free(_res_conv); + C2Tuple_OnionMessageContentsMessageSendInstructionsZ_free(_res_conv); } -void CS_LDK_CVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ_free(int64_tArray _res) { - LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ _res_constr; +void CS_LDK_CVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ_free(int64_tArray _res) { + LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ _res_constr; _res_constr.datalen = _res->arr_len; if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ), "LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ), "LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ Elements"); else _res_constr.data = NULL; int64_t* _res_vals = _res->elems; - for (size_t e = 0; e < _res_constr.datalen; e++) { - int64_t _res_conv_56 = _res_vals[e]; - void* _res_conv_56_ptr = untag_ptr(_res_conv_56); - CHECK_ACCESS(_res_conv_56_ptr); - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ _res_conv_56_conv = *(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ*)(_res_conv_56_ptr); - FREE(untag_ptr(_res_conv_56)); - _res_constr.data[e] = _res_conv_56_conv; + for (size_t d = 0; d < _res_constr.datalen; d++) { + int64_t _res_conv_55 = _res_vals[d]; + void* _res_conv_55_ptr = untag_ptr(_res_conv_55); + CHECK_ACCESS(_res_conv_55_ptr); + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ _res_conv_55_conv = *(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ*)(_res_conv_55_ptr); + FREE(untag_ptr(_res_conv_55)); + _res_constr.data[d] = _res_conv_55_conv; } FREE(_res); - CVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ_free(_res_constr); + CVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ_free(_res_constr); } int64_t CS_LDK_COption_TypeZ_some(int64_t o) { @@ -27103,23 +28650,6 @@ int64_t CS_LDK_CResult_CVec_u8ZIOErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -void CS_LDK_CVec_StrZ_free(ptrArray _res) { - LDKCVec_StrZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKStr), "LDKCVec_StrZ Elements"); - else - _res_constr.data = NULL; - jstring* _res_vals = (void*) _res->elems; - for (size_t i = 0; i < _res_constr.datalen; i++) { - jstring _res_conv_8 = _res_vals[i]; - LDKStr dummy = { .chars = NULL, .len = 0, .chars_is_owned = false }; - _res_constr.data[i] = dummy; - } - FREE(_res); - CVec_StrZ_free(_res_constr); -} - int64_t CS_LDK_CResult_CVec_StrZIOErrorZ_ok(ptrArray o) { LDKCVec_StrZ o_constr; o_constr.datalen = o->arr_len; @@ -27413,52 +28943,6 @@ int64_t CS_LDK_CResult_InvoiceRequestBolt12SemanticErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -int64_t CS_LDK_COption_SecretKeyZ_some(int8_tArray o) { - LDKSecretKey o_ref; - CHECK(o->arr_len == 32); - memcpy(o_ref.bytes, o->elems, 32); FREE(o); - LDKCOption_SecretKeyZ *ret_copy = MALLOC(sizeof(LDKCOption_SecretKeyZ), "LDKCOption_SecretKeyZ"); - *ret_copy = COption_SecretKeyZ_some(o_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_COption_SecretKeyZ_none() { - LDKCOption_SecretKeyZ *ret_copy = MALLOC(sizeof(LDKCOption_SecretKeyZ), "LDKCOption_SecretKeyZ"); - *ret_copy = COption_SecretKeyZ_none(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -void CS_LDK_COption_SecretKeyZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCOption_SecretKeyZ _res_conv = *(LDKCOption_SecretKeyZ*)(_res_ptr); - FREE(untag_ptr(_res)); - COption_SecretKeyZ_free(_res_conv); -} - -static inline uint64_t COption_SecretKeyZ_clone_ptr(LDKCOption_SecretKeyZ *NONNULL_PTR arg) { - LDKCOption_SecretKeyZ *ret_copy = MALLOC(sizeof(LDKCOption_SecretKeyZ), "LDKCOption_SecretKeyZ"); - *ret_copy = COption_SecretKeyZ_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -int64_t CS_LDK_COption_SecretKeyZ_clone_ptr(int64_t arg) { - LDKCOption_SecretKeyZ* arg_conv = (LDKCOption_SecretKeyZ*)untag_ptr(arg); - int64_t ret_conv = COption_SecretKeyZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_COption_SecretKeyZ_clone(int64_t orig) { - LDKCOption_SecretKeyZ* orig_conv = (LDKCOption_SecretKeyZ*)untag_ptr(orig); - LDKCOption_SecretKeyZ *ret_copy = MALLOC(sizeof(LDKCOption_SecretKeyZ), "LDKCOption_SecretKeyZ"); - *ret_copy = COption_SecretKeyZ_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - int64_t CS_LDK_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_ok(int64_t o) { LDKInvoiceWithExplicitSigningPubkeyBuilder o_conv; o_conv.inner = untag_ptr(o); @@ -28101,57 +29585,57 @@ int64_t CS_LDK_CResult_StfuDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_SpliceDecodeErrorZ_ok(int64_t o) { - LDKSplice o_conv; +int64_t CS_LDK_CResult_SpliceInitDecodeErrorZ_ok(int64_t o) { + LDKSpliceInit o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = Splice_clone(&o_conv); - LDKCResult_SpliceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceDecodeErrorZ), "LDKCResult_SpliceDecodeErrorZ"); - *ret_conv = CResult_SpliceDecodeErrorZ_ok(o_conv); + o_conv = SpliceInit_clone(&o_conv); + LDKCResult_SpliceInitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceInitDecodeErrorZ), "LDKCResult_SpliceInitDecodeErrorZ"); + *ret_conv = CResult_SpliceInitDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_SpliceDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_SpliceInitDecodeErrorZ_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_SpliceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceDecodeErrorZ), "LDKCResult_SpliceDecodeErrorZ"); - *ret_conv = CResult_SpliceDecodeErrorZ_err(e_conv); + LDKCResult_SpliceInitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceInitDecodeErrorZ), "LDKCResult_SpliceInitDecodeErrorZ"); + *ret_conv = CResult_SpliceInitDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_SpliceDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_SpliceDecodeErrorZ* o_conv = (LDKCResult_SpliceDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_SpliceDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_SpliceInitDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_SpliceInitDecodeErrorZ* o_conv = (LDKCResult_SpliceInitDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_SpliceInitDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_SpliceDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_SpliceInitDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_SpliceDecodeErrorZ _res_conv = *(LDKCResult_SpliceDecodeErrorZ*)(_res_ptr); + LDKCResult_SpliceInitDecodeErrorZ _res_conv = *(LDKCResult_SpliceInitDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_SpliceDecodeErrorZ_free(_res_conv); + CResult_SpliceInitDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_SpliceDecodeErrorZ_clone_ptr(LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_SpliceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceDecodeErrorZ), "LDKCResult_SpliceDecodeErrorZ"); - *ret_conv = CResult_SpliceDecodeErrorZ_clone(arg); +static inline uint64_t CResult_SpliceInitDecodeErrorZ_clone_ptr(LDKCResult_SpliceInitDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_SpliceInitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceInitDecodeErrorZ), "LDKCResult_SpliceInitDecodeErrorZ"); + *ret_conv = CResult_SpliceInitDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_SpliceDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_SpliceDecodeErrorZ* arg_conv = (LDKCResult_SpliceDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_SpliceDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_SpliceInitDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_SpliceInitDecodeErrorZ* arg_conv = (LDKCResult_SpliceInitDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_SpliceInitDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_SpliceDecodeErrorZ_clone(int64_t orig) { - LDKCResult_SpliceDecodeErrorZ* orig_conv = (LDKCResult_SpliceDecodeErrorZ*)untag_ptr(orig); - LDKCResult_SpliceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceDecodeErrorZ), "LDKCResult_SpliceDecodeErrorZ"); - *ret_conv = CResult_SpliceDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_SpliceInitDecodeErrorZ_clone(int64_t orig) { + LDKCResult_SpliceInitDecodeErrorZ* orig_conv = (LDKCResult_SpliceInitDecodeErrorZ*)untag_ptr(orig); + LDKCResult_SpliceInitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceInitDecodeErrorZ), "LDKCResult_SpliceInitDecodeErrorZ"); + *ret_conv = CResult_SpliceInitDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -28965,6 +30449,60 @@ int64_t CS_LDK_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_CResult_CommitmentSignedBatchDecodeErrorZ_ok(int64_t o) { + LDKCommitmentSignedBatch o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = CommitmentSignedBatch_clone(&o_conv); + LDKCResult_CommitmentSignedBatchDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedBatchDecodeErrorZ), "LDKCResult_CommitmentSignedBatchDecodeErrorZ"); + *ret_conv = CResult_CommitmentSignedBatchDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_CommitmentSignedBatchDecodeErrorZ_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_CommitmentSignedBatchDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedBatchDecodeErrorZ), "LDKCResult_CommitmentSignedBatchDecodeErrorZ"); + *ret_conv = CResult_CommitmentSignedBatchDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_CommitmentSignedBatchDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_CommitmentSignedBatchDecodeErrorZ* o_conv = (LDKCResult_CommitmentSignedBatchDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_CommitmentSignedBatchDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_CommitmentSignedBatchDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_CommitmentSignedBatchDecodeErrorZ _res_conv = *(LDKCResult_CommitmentSignedBatchDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_CommitmentSignedBatchDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_CommitmentSignedBatchDecodeErrorZ_clone_ptr(LDKCResult_CommitmentSignedBatchDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_CommitmentSignedBatchDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedBatchDecodeErrorZ), "LDKCResult_CommitmentSignedBatchDecodeErrorZ"); + *ret_conv = CResult_CommitmentSignedBatchDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_CommitmentSignedBatchDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_CommitmentSignedBatchDecodeErrorZ* arg_conv = (LDKCResult_CommitmentSignedBatchDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_CommitmentSignedBatchDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_CommitmentSignedBatchDecodeErrorZ_clone(int64_t orig) { + LDKCResult_CommitmentSignedBatchDecodeErrorZ* orig_conv = (LDKCResult_CommitmentSignedBatchDecodeErrorZ*)untag_ptr(orig); + LDKCResult_CommitmentSignedBatchDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedBatchDecodeErrorZ), "LDKCResult_CommitmentSignedBatchDecodeErrorZ"); + *ret_conv = CResult_CommitmentSignedBatchDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + int64_t CS_LDK_CResult_CommitmentSignedDecodeErrorZ_ok(int64_t o) { LDKCommitmentSigned o_conv; o_conv.inner = untag_ptr(o); @@ -30693,80 +32231,6 @@ int64_t CS_LDK_CResult_GossipTimestampFilterDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -void CS_LDK_CVec_PhantomRouteHintsZ_free(int64_tArray _res) { - LDKCVec_PhantomRouteHintsZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = _res->elems; - for (size_t t = 0; t < _res_constr.datalen; t++) { - int64_t _res_conv_19 = _res_vals[t]; - LDKPhantomRouteHints _res_conv_19_conv; - _res_conv_19_conv.inner = untag_ptr(_res_conv_19); - _res_conv_19_conv.is_owned = ptr_is_owned(_res_conv_19); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_19_conv); - _res_constr.data[t] = _res_conv_19_conv; - } - FREE(_res); - CVec_PhantomRouteHintsZ_free(_res_constr); -} - -int64_t CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(int64_t o) { - LDKBolt11Invoice o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = Bolt11Invoice_clone(&o_conv); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_err(int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKSignOrCreationError e_conv = *(LDKSignOrCreationError*)(e_ptr); - e_conv = SignOrCreationError_clone((LDKSignOrCreationError*)untag_ptr(e)); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -jboolean CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(int64_t o) { - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* o_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(o_conv); - return ret_conv; -} - -void CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ _res_conv = *(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_Bolt11InvoiceSignOrCreationErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_Bolt11InvoiceSignOrCreationErrorZ_clone_ptr(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR arg) { - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_clone_ptr(int64_t arg) { - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* arg_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(int64_t orig) { - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* orig_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(orig); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - int64_t CS_LDK_COption_InboundHTLCStateDetailsZ_some(int32_t o) { LDKInboundHTLCStateDetails o_conv = LDKInboundHTLCStateDetails_from_cs(o); LDKCOption_InboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_InboundHTLCStateDetailsZ), "LDKCOption_InboundHTLCStateDetailsZ"); @@ -31385,6 +32849,167 @@ void CS_LDK_CVec_FutureZ_free(int64_tArray _res) { CVec_FutureZ_free(_res_constr); } +int64_t CS_LDK_CResult_HeldHtlcAvailableDecodeErrorZ_ok(int64_t o) { + LDKHeldHtlcAvailable o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = HeldHtlcAvailable_clone(&o_conv); + LDKCResult_HeldHtlcAvailableDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HeldHtlcAvailableDecodeErrorZ), "LDKCResult_HeldHtlcAvailableDecodeErrorZ"); + *ret_conv = CResult_HeldHtlcAvailableDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_HeldHtlcAvailableDecodeErrorZ_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_HeldHtlcAvailableDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HeldHtlcAvailableDecodeErrorZ), "LDKCResult_HeldHtlcAvailableDecodeErrorZ"); + *ret_conv = CResult_HeldHtlcAvailableDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_HeldHtlcAvailableDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_HeldHtlcAvailableDecodeErrorZ* o_conv = (LDKCResult_HeldHtlcAvailableDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_HeldHtlcAvailableDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_HeldHtlcAvailableDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_HeldHtlcAvailableDecodeErrorZ _res_conv = *(LDKCResult_HeldHtlcAvailableDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_HeldHtlcAvailableDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_HeldHtlcAvailableDecodeErrorZ_clone_ptr(LDKCResult_HeldHtlcAvailableDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HeldHtlcAvailableDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HeldHtlcAvailableDecodeErrorZ), "LDKCResult_HeldHtlcAvailableDecodeErrorZ"); + *ret_conv = CResult_HeldHtlcAvailableDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_HeldHtlcAvailableDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_HeldHtlcAvailableDecodeErrorZ* arg_conv = (LDKCResult_HeldHtlcAvailableDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_HeldHtlcAvailableDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_HeldHtlcAvailableDecodeErrorZ_clone(int64_t orig) { + LDKCResult_HeldHtlcAvailableDecodeErrorZ* orig_conv = (LDKCResult_HeldHtlcAvailableDecodeErrorZ*)untag_ptr(orig); + LDKCResult_HeldHtlcAvailableDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HeldHtlcAvailableDecodeErrorZ), "LDKCResult_HeldHtlcAvailableDecodeErrorZ"); + *ret_conv = CResult_HeldHtlcAvailableDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_ReleaseHeldHtlcDecodeErrorZ_ok(int64_t o) { + LDKReleaseHeldHtlc o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = ReleaseHeldHtlc_clone(&o_conv); + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReleaseHeldHtlcDecodeErrorZ), "LDKCResult_ReleaseHeldHtlcDecodeErrorZ"); + *ret_conv = CResult_ReleaseHeldHtlcDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_ReleaseHeldHtlcDecodeErrorZ_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_ReleaseHeldHtlcDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReleaseHeldHtlcDecodeErrorZ), "LDKCResult_ReleaseHeldHtlcDecodeErrorZ"); + *ret_conv = CResult_ReleaseHeldHtlcDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_ReleaseHeldHtlcDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* o_conv = (LDKCResult_ReleaseHeldHtlcDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ReleaseHeldHtlcDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_ReleaseHeldHtlcDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_ReleaseHeldHtlcDecodeErrorZ _res_conv = *(LDKCResult_ReleaseHeldHtlcDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_ReleaseHeldHtlcDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_ReleaseHeldHtlcDecodeErrorZ_clone_ptr(LDKCResult_ReleaseHeldHtlcDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReleaseHeldHtlcDecodeErrorZ), "LDKCResult_ReleaseHeldHtlcDecodeErrorZ"); + *ret_conv = CResult_ReleaseHeldHtlcDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_ReleaseHeldHtlcDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* arg_conv = (LDKCResult_ReleaseHeldHtlcDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ReleaseHeldHtlcDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_ReleaseHeldHtlcDecodeErrorZ_clone(int64_t orig) { + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* orig_conv = (LDKCResult_ReleaseHeldHtlcDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReleaseHeldHtlcDecodeErrorZ), "LDKCResult_ReleaseHeldHtlcDecodeErrorZ"); + *ret_conv = CResult_ReleaseHeldHtlcDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_AsyncPaymentsMessageDecodeErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKAsyncPaymentsMessage o_conv = *(LDKAsyncPaymentsMessage*)(o_ptr); + o_conv = AsyncPaymentsMessage_clone((LDKAsyncPaymentsMessage*)untag_ptr(o)); + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AsyncPaymentsMessageDecodeErrorZ), "LDKCResult_AsyncPaymentsMessageDecodeErrorZ"); + *ret_conv = CResult_AsyncPaymentsMessageDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_AsyncPaymentsMessageDecodeErrorZ_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_AsyncPaymentsMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AsyncPaymentsMessageDecodeErrorZ), "LDKCResult_AsyncPaymentsMessageDecodeErrorZ"); + *ret_conv = CResult_AsyncPaymentsMessageDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_AsyncPaymentsMessageDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* o_conv = (LDKCResult_AsyncPaymentsMessageDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_AsyncPaymentsMessageDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_AsyncPaymentsMessageDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_AsyncPaymentsMessageDecodeErrorZ _res_conv = *(LDKCResult_AsyncPaymentsMessageDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_AsyncPaymentsMessageDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_AsyncPaymentsMessageDecodeErrorZ_clone_ptr(LDKCResult_AsyncPaymentsMessageDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AsyncPaymentsMessageDecodeErrorZ), "LDKCResult_AsyncPaymentsMessageDecodeErrorZ"); + *ret_conv = CResult_AsyncPaymentsMessageDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_AsyncPaymentsMessageDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* arg_conv = (LDKCResult_AsyncPaymentsMessageDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_AsyncPaymentsMessageDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_AsyncPaymentsMessageDecodeErrorZ_clone(int64_t orig) { + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* orig_conv = (LDKCResult_AsyncPaymentsMessageDecodeErrorZ*)untag_ptr(orig); + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AsyncPaymentsMessageDecodeErrorZ), "LDKCResult_AsyncPaymentsMessageDecodeErrorZ"); + *ret_conv = CResult_AsyncPaymentsMessageDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + int64_t CS_LDK_CResult_OffersMessageDecodeErrorZ_ok(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -32247,6 +33872,59 @@ void CS_LDK_CVec_TransactionZ_free(ptrArray _res) { CVec_TransactionZ_free(_res_constr); } +int64_t CS_LDK_CResult_FundingInfoDecodeErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKFundingInfo o_conv = *(LDKFundingInfo*)(o_ptr); + o_conv = FundingInfo_clone((LDKFundingInfo*)untag_ptr(o)); + LDKCResult_FundingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingInfoDecodeErrorZ), "LDKCResult_FundingInfoDecodeErrorZ"); + *ret_conv = CResult_FundingInfoDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_FundingInfoDecodeErrorZ_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_FundingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingInfoDecodeErrorZ), "LDKCResult_FundingInfoDecodeErrorZ"); + *ret_conv = CResult_FundingInfoDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_FundingInfoDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_FundingInfoDecodeErrorZ* o_conv = (LDKCResult_FundingInfoDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_FundingInfoDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_FundingInfoDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_FundingInfoDecodeErrorZ _res_conv = *(LDKCResult_FundingInfoDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_FundingInfoDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_FundingInfoDecodeErrorZ_clone_ptr(LDKCResult_FundingInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_FundingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingInfoDecodeErrorZ), "LDKCResult_FundingInfoDecodeErrorZ"); + *ret_conv = CResult_FundingInfoDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_FundingInfoDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_FundingInfoDecodeErrorZ* arg_conv = (LDKCResult_FundingInfoDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_FundingInfoDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_FundingInfoDecodeErrorZ_clone(int64_t orig) { + LDKCResult_FundingInfoDecodeErrorZ* orig_conv = (LDKCResult_FundingInfoDecodeErrorZ*)untag_ptr(orig); + LDKCResult_FundingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingInfoDecodeErrorZ), "LDKCResult_FundingInfoDecodeErrorZ"); + *ret_conv = CResult_FundingInfoDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + int64_t CS_LDK_CResult_PaymentPurposeDecodeErrorZ_ok(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -32654,53 +34332,100 @@ int64_t CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_clone(int64_t orig) return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_ok(int32_t o) { +int64_t CS_LDK_COption_PaymentFailureReasonZ_some(int32_t o) { LDKPaymentFailureReason o_conv = LDKPaymentFailureReason_from_cs(o); - LDKCResult_PaymentFailureReasonDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentFailureReasonDecodeErrorZ), "LDKCResult_PaymentFailureReasonDecodeErrorZ"); - *ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_ok(o_conv); + LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); + *ret_copy = COption_PaymentFailureReasonZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_COption_PaymentFailureReasonZ_none() { + LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); + *ret_copy = COption_PaymentFailureReasonZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_COption_PaymentFailureReasonZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_PaymentFailureReasonZ _res_conv = *(LDKCOption_PaymentFailureReasonZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_PaymentFailureReasonZ_free(_res_conv); +} + +static inline uint64_t COption_PaymentFailureReasonZ_clone_ptr(LDKCOption_PaymentFailureReasonZ *NONNULL_PTR arg) { + LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); + *ret_copy = COption_PaymentFailureReasonZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_COption_PaymentFailureReasonZ_clone_ptr(int64_t arg) { + LDKCOption_PaymentFailureReasonZ* arg_conv = (LDKCOption_PaymentFailureReasonZ*)untag_ptr(arg); + int64_t ret_conv = COption_PaymentFailureReasonZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_COption_PaymentFailureReasonZ_clone(int64_t orig) { + LDKCOption_PaymentFailureReasonZ* orig_conv = (LDKCOption_PaymentFailureReasonZ*)untag_ptr(orig); + LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); + *ret_copy = COption_PaymentFailureReasonZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_CResult_COption_PaymentFailureReasonZDecodeErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKCOption_PaymentFailureReasonZ o_conv = *(LDKCOption_PaymentFailureReasonZ*)(o_ptr); + o_conv = COption_PaymentFailureReasonZ_clone((LDKCOption_PaymentFailureReasonZ*)untag_ptr(o)); + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ), "LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_PaymentFailureReasonZDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_COption_PaymentFailureReasonZDecodeErrorZ_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_PaymentFailureReasonDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentFailureReasonDecodeErrorZ), "LDKCResult_PaymentFailureReasonDecodeErrorZ"); - *ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_err(e_conv); + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ), "LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_PaymentFailureReasonZDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_PaymentFailureReasonDecodeErrorZ* o_conv = (LDKCResult_PaymentFailureReasonDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_COption_PaymentFailureReasonZDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* o_conv = (LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_COption_PaymentFailureReasonZDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_COption_PaymentFailureReasonZDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_PaymentFailureReasonDecodeErrorZ _res_conv = *(LDKCResult_PaymentFailureReasonDecodeErrorZ*)(_res_ptr); + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ _res_conv = *(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_PaymentFailureReasonDecodeErrorZ_free(_res_conv); + CResult_COption_PaymentFailureReasonZDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_PaymentFailureReasonDecodeErrorZ_clone_ptr(LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_PaymentFailureReasonDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentFailureReasonDecodeErrorZ), "LDKCResult_PaymentFailureReasonDecodeErrorZ"); - *ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_clone(arg); +static inline uint64_t CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone_ptr(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ), "LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_PaymentFailureReasonDecodeErrorZ* arg_conv = (LDKCResult_PaymentFailureReasonDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* arg_conv = (LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_clone(int64_t orig) { - LDKCResult_PaymentFailureReasonDecodeErrorZ* orig_conv = (LDKCResult_PaymentFailureReasonDecodeErrorZ*)untag_ptr(orig); - LDKCResult_PaymentFailureReasonDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentFailureReasonDecodeErrorZ), "LDKCResult_PaymentFailureReasonDecodeErrorZ"); - *ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone(int64_t orig) { + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* orig_conv = (LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ*)untag_ptr(orig); + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ), "LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -32770,50 +34495,6 @@ void CS_LDK_CVec_ClaimedHTLCZ_free(int64_tArray _res) { CVec_ClaimedHTLCZ_free(_res_constr); } -int64_t CS_LDK_COption_PaymentFailureReasonZ_some(int32_t o) { - LDKPaymentFailureReason o_conv = LDKPaymentFailureReason_from_cs(o); - LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); - *ret_copy = COption_PaymentFailureReasonZ_some(o_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_COption_PaymentFailureReasonZ_none() { - LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); - *ret_copy = COption_PaymentFailureReasonZ_none(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -void CS_LDK_COption_PaymentFailureReasonZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCOption_PaymentFailureReasonZ _res_conv = *(LDKCOption_PaymentFailureReasonZ*)(_res_ptr); - FREE(untag_ptr(_res)); - COption_PaymentFailureReasonZ_free(_res_conv); -} - -static inline uint64_t COption_PaymentFailureReasonZ_clone_ptr(LDKCOption_PaymentFailureReasonZ *NONNULL_PTR arg) { - LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); - *ret_copy = COption_PaymentFailureReasonZ_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -int64_t CS_LDK_COption_PaymentFailureReasonZ_clone_ptr(int64_t arg) { - LDKCOption_PaymentFailureReasonZ* arg_conv = (LDKCOption_PaymentFailureReasonZ*)untag_ptr(arg); - int64_t ret_conv = COption_PaymentFailureReasonZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_COption_PaymentFailureReasonZ_clone(int64_t orig) { - LDKCOption_PaymentFailureReasonZ* orig_conv = (LDKCOption_PaymentFailureReasonZ*)untag_ptr(orig); - LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); - *ret_copy = COption_PaymentFailureReasonZ_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - int64_t CS_LDK_COption_EventZ_some(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -32914,6 +34595,80 @@ int64_t CS_LDK_CResult_COption_EventZDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_CResult_NonceDecodeErrorZ_ok(int64_t o) { + LDKNonce o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = Nonce_clone(&o_conv); + LDKCResult_NonceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonceDecodeErrorZ), "LDKCResult_NonceDecodeErrorZ"); + *ret_conv = CResult_NonceDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_NonceDecodeErrorZ_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_NonceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonceDecodeErrorZ), "LDKCResult_NonceDecodeErrorZ"); + *ret_conv = CResult_NonceDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_NonceDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_NonceDecodeErrorZ* o_conv = (LDKCResult_NonceDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_NonceDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_NonceDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_NonceDecodeErrorZ _res_conv = *(LDKCResult_NonceDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_NonceDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_NonceDecodeErrorZ_clone_ptr(LDKCResult_NonceDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NonceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonceDecodeErrorZ), "LDKCResult_NonceDecodeErrorZ"); + *ret_conv = CResult_NonceDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_NonceDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_NonceDecodeErrorZ* arg_conv = (LDKCResult_NonceDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_NonceDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_NonceDecodeErrorZ_clone(int64_t orig) { + LDKCResult_NonceDecodeErrorZ* orig_conv = (LDKCResult_NonceDecodeErrorZ*)untag_ptr(orig); + LDKCResult_NonceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonceDecodeErrorZ), "LDKCResult_NonceDecodeErrorZ"); + *ret_conv = CResult_NonceDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_CVec_RouteHintHopZ_free(int64_tArray _res) { + LDKCVec_RouteHintHopZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = _res->elems; + for (size_t o = 0; o < _res_constr.datalen; o++) { + int64_t _res_conv_14 = _res_vals[o]; + LDKRouteHintHop _res_conv_14_conv; + _res_conv_14_conv.inner = untag_ptr(_res_conv_14); + _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv); + _res_constr.data[o] = _res_conv_14_conv; + } + FREE(_res); + CVec_RouteHintHopZ_free(_res_constr); +} + int64_t CS_LDK_CResult_SiPrefixBolt11ParseErrorZ_ok(int32_t o) { LDKSiPrefix o_conv = LDKSiPrefix_from_cs(o); LDKCResult_SiPrefixBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixBolt11ParseErrorZ), "LDKCResult_SiPrefixBolt11ParseErrorZ"); @@ -33547,6 +35302,60 @@ int64_t CS_LDK_CResult_BigSizeDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_CResult_UntrustedStringDecodeErrorZ_ok(int64_t o) { + LDKUntrustedString o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = UntrustedString_clone(&o_conv); + LDKCResult_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ"); + *ret_conv = CResult_UntrustedStringDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_UntrustedStringDecodeErrorZ_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_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ"); + *ret_conv = CResult_UntrustedStringDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_UntrustedStringDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_UntrustedStringDecodeErrorZ* o_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_UntrustedStringDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_UntrustedStringDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_UntrustedStringDecodeErrorZ _res_conv = *(LDKCResult_UntrustedStringDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_UntrustedStringDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_UntrustedStringDecodeErrorZ_clone_ptr(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ"); + *ret_conv = CResult_UntrustedStringDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_UntrustedStringDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_UntrustedStringDecodeErrorZ* arg_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_UntrustedStringDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_UntrustedStringDecodeErrorZ_clone(int64_t orig) { + LDKCResult_UntrustedStringDecodeErrorZ* orig_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(orig); + LDKCResult_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ"); + *ret_conv = CResult_UntrustedStringDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + int64_t CS_LDK_CResult_HostnameDecodeErrorZ_ok(int64_t o) { LDKHostname o_conv; o_conv.inner = untag_ptr(o); @@ -33705,60 +35514,6 @@ int64_t CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_clone(int64_t orig) return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_UntrustedStringDecodeErrorZ_ok(int64_t o) { - LDKUntrustedString o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = UntrustedString_clone(&o_conv); - LDKCResult_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ"); - *ret_conv = CResult_UntrustedStringDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_UntrustedStringDecodeErrorZ_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_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ"); - *ret_conv = CResult_UntrustedStringDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -jboolean CS_LDK_CResult_UntrustedStringDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_UntrustedStringDecodeErrorZ* o_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_UntrustedStringDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -void CS_LDK_CResult_UntrustedStringDecodeErrorZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_UntrustedStringDecodeErrorZ _res_conv = *(LDKCResult_UntrustedStringDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_UntrustedStringDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_UntrustedStringDecodeErrorZ_clone_ptr(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ"); - *ret_conv = CResult_UntrustedStringDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t CS_LDK_CResult_UntrustedStringDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_UntrustedStringDecodeErrorZ* arg_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_UntrustedStringDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_CResult_UntrustedStringDecodeErrorZ_clone(int64_t orig) { - LDKCResult_UntrustedStringDecodeErrorZ* orig_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(orig); - LDKCResult_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ"); - *ret_conv = CResult_UntrustedStringDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - int64_t CS_LDK_CResult_ChannelIdDecodeErrorZ_ok(int64_t o) { LDKChannelId o_conv; o_conv.inner = untag_ptr(o); @@ -33849,6 +35604,130 @@ void CS_LDK_C2Tuple__u832u16Z_free(int64_t _res) { C2Tuple__u832u16Z_free(_res_conv); } +int64_t CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_ok(int64_t o) { + LDKBlindedPayInfo o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = BlindedPayInfo_clone(&o_conv); + LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); + *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_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_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); + *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_BlindedPayInfoDecodeErrorZ* o_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_BlindedPayInfoDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_BlindedPayInfoDecodeErrorZ _res_conv = *(LDKCResult_BlindedPayInfoDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_BlindedPayInfoDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_BlindedPayInfoDecodeErrorZ_clone_ptr(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); + *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_BlindedPayInfoDecodeErrorZ* arg_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BlindedPayInfoDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_clone(int64_t orig) { + LDKCResult_BlindedPayInfoDecodeErrorZ* orig_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(orig); + LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); + *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_BlindedPaymentPathNoneZ_ok(int64_t o) { + LDKBlindedPaymentPath o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = BlindedPaymentPath_clone(&o_conv); + LDKCResult_BlindedPaymentPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPaymentPathNoneZ), "LDKCResult_BlindedPaymentPathNoneZ"); + *ret_conv = CResult_BlindedPaymentPathNoneZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_BlindedPaymentPathNoneZ_err() { + LDKCResult_BlindedPaymentPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPaymentPathNoneZ), "LDKCResult_BlindedPaymentPathNoneZ"); + *ret_conv = CResult_BlindedPaymentPathNoneZ_err(); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_BlindedPaymentPathNoneZ_is_ok(int64_t o) { + LDKCResult_BlindedPaymentPathNoneZ* o_conv = (LDKCResult_BlindedPaymentPathNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_BlindedPaymentPathNoneZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_BlindedPaymentPathNoneZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_BlindedPaymentPathNoneZ _res_conv = *(LDKCResult_BlindedPaymentPathNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_BlindedPaymentPathNoneZ_free(_res_conv); +} + +static inline uint64_t CResult_BlindedPaymentPathNoneZ_clone_ptr(LDKCResult_BlindedPaymentPathNoneZ *NONNULL_PTR arg) { + LDKCResult_BlindedPaymentPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPaymentPathNoneZ), "LDKCResult_BlindedPaymentPathNoneZ"); + *ret_conv = CResult_BlindedPaymentPathNoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_BlindedPaymentPathNoneZ_clone_ptr(int64_t arg) { + LDKCResult_BlindedPaymentPathNoneZ* arg_conv = (LDKCResult_BlindedPaymentPathNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BlindedPaymentPathNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_BlindedPaymentPathNoneZ_clone(int64_t orig) { + LDKCResult_BlindedPaymentPathNoneZ* orig_conv = (LDKCResult_BlindedPaymentPathNoneZ*)untag_ptr(orig); + LDKCResult_BlindedPaymentPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPaymentPathNoneZ), "LDKCResult_BlindedPaymentPathNoneZ"); + *ret_conv = CResult_BlindedPaymentPathNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_CVec_PaymentForwardNodeZ_free(int64_tArray _res) { + LDKCVec_PaymentForwardNodeZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPaymentForwardNode), "LDKCVec_PaymentForwardNodeZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = _res->elems; + for (size_t u = 0; u < _res_constr.datalen; u++) { + int64_t _res_conv_20 = _res_vals[u]; + LDKPaymentForwardNode _res_conv_20_conv; + _res_conv_20_conv.inner = untag_ptr(_res_conv_20); + _res_conv_20_conv.is_owned = ptr_is_owned(_res_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_20_conv); + _res_constr.data[u] = _res_conv_20_conv; + } + FREE(_res); + CVec_PaymentForwardNodeZ_free(_res_constr); +} + int64_t CS_LDK_CResult_PaymentRelayDecodeErrorZ_ok(int64_t o) { LDKPaymentRelay o_conv; o_conv.inner = untag_ptr(o); @@ -34172,196 +36051,155 @@ int64_t CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_StrSecp256k1ErrorZ_ok(jstring o) { - LDKStr o_conv = str_ref_to_owned_c(o); - LDKCResult_StrSecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StrSecp256k1ErrorZ), "LDKCResult_StrSecp256k1ErrorZ"); - *ret_conv = CResult_StrSecp256k1ErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_TxOutUtxoLookupErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKTxOut o_conv = *(LDKTxOut*)(o_ptr); + o_conv = TxOut_clone((LDKTxOut*)untag_ptr(o)); + LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); + *ret_conv = CResult_TxOutUtxoLookupErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_StrSecp256k1ErrorZ_err(int32_t e) { - LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_cs(e); - LDKCResult_StrSecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StrSecp256k1ErrorZ), "LDKCResult_StrSecp256k1ErrorZ"); - *ret_conv = CResult_StrSecp256k1ErrorZ_err(e_conv); +int64_t CS_LDK_CResult_TxOutUtxoLookupErrorZ_err(int32_t e) { + LDKUtxoLookupError e_conv = LDKUtxoLookupError_from_cs(e); + LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); + *ret_conv = CResult_TxOutUtxoLookupErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_StrSecp256k1ErrorZ_is_ok(int64_t o) { - LDKCResult_StrSecp256k1ErrorZ* o_conv = (LDKCResult_StrSecp256k1ErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_StrSecp256k1ErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_TxOutUtxoLookupErrorZ_is_ok(int64_t o) { + LDKCResult_TxOutUtxoLookupErrorZ* o_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_TxOutUtxoLookupErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_StrSecp256k1ErrorZ_free(int64_t _res) { +void CS_LDK_CResult_TxOutUtxoLookupErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_StrSecp256k1ErrorZ _res_conv = *(LDKCResult_StrSecp256k1ErrorZ*)(_res_ptr); + LDKCResult_TxOutUtxoLookupErrorZ _res_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_StrSecp256k1ErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_StrSecp256k1ErrorZ_clone_ptr(LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR arg) { - LDKCResult_StrSecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StrSecp256k1ErrorZ), "LDKCResult_StrSecp256k1ErrorZ"); - *ret_conv = CResult_StrSecp256k1ErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t CS_LDK_CResult_StrSecp256k1ErrorZ_clone_ptr(int64_t arg) { - LDKCResult_StrSecp256k1ErrorZ* arg_conv = (LDKCResult_StrSecp256k1ErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_StrSecp256k1ErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_CResult_StrSecp256k1ErrorZ_clone(int64_t orig) { - LDKCResult_StrSecp256k1ErrorZ* orig_conv = (LDKCResult_StrSecp256k1ErrorZ*)untag_ptr(orig); - LDKCResult_StrSecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StrSecp256k1ErrorZ), "LDKCResult_StrSecp256k1ErrorZ"); - *ret_conv = CResult_StrSecp256k1ErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); + CResult_TxOutUtxoLookupErrorZ_free(_res_conv); } -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); +static inline uint64_t CResult_TxOutUtxoLookupErrorZ_clone_ptr(LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR arg) { + LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); + *ret_conv = CResult_TxOutUtxoLookupErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t 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_TxOutUtxoLookupErrorZ_clone_ptr(int64_t arg) { + LDKCResult_TxOutUtxoLookupErrorZ* arg_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_TxOutUtxoLookupErrorZ_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); +int64_t CS_LDK_CResult_TxOutUtxoLookupErrorZ_clone(int64_t orig) { + LDKCResult_TxOutUtxoLookupErrorZ* orig_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(orig); + LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); + *ret_conv = CResult_TxOutUtxoLookupErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -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); +int64_t CS_LDK_CResult_ResponderDecodeErrorZ_ok(int64_t o) { + LDKResponder o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = Responder_clone(&o_conv); + LDKCResult_ResponderDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ResponderDecodeErrorZ), "LDKCResult_ResponderDecodeErrorZ"); + *ret_conv = CResult_ResponderDecodeErrorZ_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(); +int64_t CS_LDK_CResult_ResponderDecodeErrorZ_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_ResponderDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ResponderDecodeErrorZ), "LDKCResult_ResponderDecodeErrorZ"); + *ret_conv = CResult_ResponderDecodeErrorZ_err(e_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); +jboolean CS_LDK_CResult_ResponderDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_ResponderDecodeErrorZ* o_conv = (LDKCResult_ResponderDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ResponderDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(int64_t _res) { +void CS_LDK_CResult_ResponderDecodeErrorZ_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_ResponderDecodeErrorZ _res_conv = *(LDKCResult_ResponderDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(_res_conv); + CResult_ResponderDecodeErrorZ_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_ResponderDecodeErrorZ_clone_ptr(LDKCResult_ResponderDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ResponderDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ResponderDecodeErrorZ), "LDKCResult_ResponderDecodeErrorZ"); + *ret_conv = CResult_ResponderDecodeErrorZ_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_ResponderDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_ResponderDecodeErrorZ* arg_conv = (LDKCResult_ResponderDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ResponderDecodeErrorZ_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_ResponderDecodeErrorZ_clone(int64_t orig) { + LDKCResult_ResponderDecodeErrorZ* orig_conv = (LDKCResult_ResponderDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ResponderDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ResponderDecodeErrorZ), "LDKCResult_ResponderDecodeErrorZ"); + *ret_conv = CResult_ResponderDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_TxOutUtxoLookupErrorZ_ok(int64_t o) { +int64_t CS_LDK_COption_MessageContextZ_some(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); - LDKTxOut o_conv = *(LDKTxOut*)(o_ptr); - o_conv = TxOut_clone((LDKTxOut*)untag_ptr(o)); - LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); - *ret_conv = CResult_TxOutUtxoLookupErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_TxOutUtxoLookupErrorZ_err(int32_t e) { - LDKUtxoLookupError e_conv = LDKUtxoLookupError_from_cs(e); - LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); - *ret_conv = CResult_TxOutUtxoLookupErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); + LDKMessageContext o_conv = *(LDKMessageContext*)(o_ptr); + o_conv = MessageContext_clone((LDKMessageContext*)untag_ptr(o)); + LDKCOption_MessageContextZ *ret_copy = MALLOC(sizeof(LDKCOption_MessageContextZ), "LDKCOption_MessageContextZ"); + *ret_copy = COption_MessageContextZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_CResult_TxOutUtxoLookupErrorZ_is_ok(int64_t o) { - LDKCResult_TxOutUtxoLookupErrorZ* o_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_TxOutUtxoLookupErrorZ_is_ok(o_conv); - return ret_conv; +int64_t CS_LDK_COption_MessageContextZ_none() { + LDKCOption_MessageContextZ *ret_copy = MALLOC(sizeof(LDKCOption_MessageContextZ), "LDKCOption_MessageContextZ"); + *ret_copy = COption_MessageContextZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_CResult_TxOutUtxoLookupErrorZ_free(int64_t _res) { +void CS_LDK_COption_MessageContextZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_TxOutUtxoLookupErrorZ _res_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(_res_ptr); + LDKCOption_MessageContextZ _res_conv = *(LDKCOption_MessageContextZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_TxOutUtxoLookupErrorZ_free(_res_conv); + COption_MessageContextZ_free(_res_conv); } -static inline uint64_t CResult_TxOutUtxoLookupErrorZ_clone_ptr(LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR arg) { - LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); - *ret_conv = CResult_TxOutUtxoLookupErrorZ_clone(arg); - return tag_ptr(ret_conv, true); +static inline uint64_t COption_MessageContextZ_clone_ptr(LDKCOption_MessageContextZ *NONNULL_PTR arg) { + LDKCOption_MessageContextZ *ret_copy = MALLOC(sizeof(LDKCOption_MessageContextZ), "LDKCOption_MessageContextZ"); + *ret_copy = COption_MessageContextZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_CResult_TxOutUtxoLookupErrorZ_clone_ptr(int64_t arg) { - LDKCResult_TxOutUtxoLookupErrorZ* arg_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_TxOutUtxoLookupErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_COption_MessageContextZ_clone_ptr(int64_t arg) { + LDKCOption_MessageContextZ* arg_conv = (LDKCOption_MessageContextZ*)untag_ptr(arg); + int64_t ret_conv = COption_MessageContextZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_TxOutUtxoLookupErrorZ_clone(int64_t orig) { - LDKCResult_TxOutUtxoLookupErrorZ* orig_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(orig); - LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); - *ret_conv = CResult_TxOutUtxoLookupErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_COption_MessageContextZ_clone(int64_t orig) { + LDKCOption_MessageContextZ* orig_conv = (LDKCOption_MessageContextZ*)untag_ptr(orig); + LDKCOption_MessageContextZ *ret_copy = MALLOC(sizeof(LDKCOption_MessageContextZ), "LDKCOption_MessageContextZ"); + *ret_copy = COption_MessageContextZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } static inline uint64_t C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone_ptr(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *NONNULL_PTR arg) { @@ -34564,176 +36402,52 @@ int64_t CS_LDK_CResult_SendSuccessSendErrorZ_clone(int64_t orig) { 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); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = BlindedPath_clone(&o_conv); - LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); - *ret_conv = CResult_BlindedPathNoneZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_BlindedPathNoneZ_err() { - LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); - *ret_conv = CResult_BlindedPathNoneZ_err(); - return tag_ptr(ret_conv, true); -} - -jboolean CS_LDK_CResult_BlindedPathNoneZ_is_ok(int64_t o) { - LDKCResult_BlindedPathNoneZ* o_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_BlindedPathNoneZ_is_ok(o_conv); - return ret_conv; -} - -void CS_LDK_CResult_BlindedPathNoneZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_BlindedPathNoneZ _res_conv = *(LDKCResult_BlindedPathNoneZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_BlindedPathNoneZ_free(_res_conv); -} - -static inline uint64_t CResult_BlindedPathNoneZ_clone_ptr(LDKCResult_BlindedPathNoneZ *NONNULL_PTR arg) { - LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); - *ret_conv = CResult_BlindedPathNoneZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t CS_LDK_CResult_BlindedPathNoneZ_clone_ptr(int64_t arg) { - LDKCResult_BlindedPathNoneZ* arg_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_BlindedPathNoneZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_CResult_BlindedPathNoneZ_clone(int64_t orig) { - LDKCResult_BlindedPathNoneZ* orig_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(orig); - LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); - *ret_conv = CResult_BlindedPathNoneZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_ok(int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ o_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(o_ptr); - o_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(o)); - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ), "LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ"); - *ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_err() { - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ), "LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ"); - *ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_err(); +int64_t CS_LDK_CResult_NoneSendErrorZ_ok() { + LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ"); + *ret_conv = CResult_NoneSendErrorZ_ok(); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_is_ok(int64_t o) { - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* o_conv = (LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_is_ok(o_conv); - return ret_conv; -} - -void CS_LDK_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ _res_conv = *(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free(_res_conv); -} - -static inline uint64_t CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone_ptr(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR arg) { - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ), "LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ"); - *ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t CS_LDK_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone_ptr(int64_t arg) { - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* arg_conv = (LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(int64_t orig) { - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* orig_conv = (LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ*)untag_ptr(orig); - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ), "LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ"); - *ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -void CS_LDK_CVec_ForwardNodeZ_free(int64_tArray _res) { - LDKCVec_ForwardNodeZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKForwardNode), "LDKCVec_ForwardNodeZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = _res->elems; - for (size_t n = 0; n < _res_constr.datalen; n++) { - int64_t _res_conv_13 = _res_vals[n]; - LDKForwardNode _res_conv_13_conv; - _res_conv_13_conv.inner = untag_ptr(_res_conv_13); - _res_conv_13_conv.is_owned = ptr_is_owned(_res_conv_13); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_13_conv); - _res_constr.data[n] = _res_conv_13_conv; - } - FREE(_res); - CVec_ForwardNodeZ_free(_res_constr); -} - -int64_t CS_LDK_CResult_BlindedPathDecodeErrorZ_ok(int64_t o) { - LDKBlindedPath o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = BlindedPath_clone(&o_conv); - LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ"); - *ret_conv = CResult_BlindedPathDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_BlindedPathDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_NoneSendErrorZ_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_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ"); - *ret_conv = CResult_BlindedPathDecodeErrorZ_err(e_conv); + LDKSendError e_conv = *(LDKSendError*)(e_ptr); + e_conv = SendError_clone((LDKSendError*)untag_ptr(e)); + LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ"); + *ret_conv = CResult_NoneSendErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_BlindedPathDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_BlindedPathDecodeErrorZ* o_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_BlindedPathDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_NoneSendErrorZ_is_ok(int64_t o) { + LDKCResult_NoneSendErrorZ* o_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_NoneSendErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_BlindedPathDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_NoneSendErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_BlindedPathDecodeErrorZ _res_conv = *(LDKCResult_BlindedPathDecodeErrorZ*)(_res_ptr); + LDKCResult_NoneSendErrorZ _res_conv = *(LDKCResult_NoneSendErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_BlindedPathDecodeErrorZ_free(_res_conv); + CResult_NoneSendErrorZ_free(_res_conv); } -static inline uint64_t CResult_BlindedPathDecodeErrorZ_clone_ptr(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ"); - *ret_conv = CResult_BlindedPathDecodeErrorZ_clone(arg); +static inline uint64_t CResult_NoneSendErrorZ_clone_ptr(LDKCResult_NoneSendErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ"); + *ret_conv = CResult_NoneSendErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_BlindedPathDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_BlindedPathDecodeErrorZ* arg_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_BlindedPathDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_NoneSendErrorZ_clone_ptr(int64_t arg) { + LDKCResult_NoneSendErrorZ* arg_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_NoneSendErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_BlindedPathDecodeErrorZ_clone(int64_t orig) { - LDKCResult_BlindedPathDecodeErrorZ* orig_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(orig); - LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ"); - *ret_conv = CResult_BlindedPathDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_NoneSendErrorZ_clone(int64_t orig) { + LDKCResult_NoneSendErrorZ* orig_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(orig); + LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ"); + *ret_conv = CResult_NoneSendErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -34791,6 +36505,80 @@ int64_t CS_LDK_CResult_BlindedHopDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +void CS_LDK_CVec_PhantomRouteHintsZ_free(int64_tArray _res) { + LDKCVec_PhantomRouteHintsZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = _res->elems; + for (size_t t = 0; t < _res_constr.datalen; t++) { + int64_t _res_conv_19 = _res_vals[t]; + LDKPhantomRouteHints _res_conv_19_conv; + _res_conv_19_conv.inner = untag_ptr(_res_conv_19); + _res_conv_19_conv.is_owned = ptr_is_owned(_res_conv_19); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_19_conv); + _res_constr.data[t] = _res_conv_19_conv; + } + FREE(_res); + CVec_PhantomRouteHintsZ_free(_res_constr); +} + +int64_t CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(int64_t o) { + LDKBolt11Invoice o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = Bolt11Invoice_clone(&o_conv); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_err(int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKSignOrCreationError e_conv = *(LDKSignOrCreationError*)(e_ptr); + e_conv = SignOrCreationError_clone((LDKSignOrCreationError*)untag_ptr(e)); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(int64_t o) { + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* o_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ _res_conv = *(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_Bolt11InvoiceSignOrCreationErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_Bolt11InvoiceSignOrCreationErrorZ_clone_ptr(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_clone_ptr(int64_t arg) { + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* arg_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(int64_t orig) { + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* orig_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(orig); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + int64_t CS_LDK_CResult_InvoiceErrorDecodeErrorZ_ok(int64_t o) { LDKInvoiceError o_conv; o_conv.inner = untag_ptr(o); @@ -35520,99 +37308,284 @@ void CS_LDK_CVec_C2Tuple_OutPointChannelIdZZ_free(int64_tArray _res) { CVec_C2Tuple_OutPointChannelIdZZ_free(_res_constr); } -void CS_LDK_CVec_MonitorUpdateIdZ_free(int64_tArray _res) { - LDKCVec_MonitorUpdateIdZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMonitorUpdateId), "LDKCVec_MonitorUpdateIdZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = _res->elems; - for (size_t r = 0; r < _res_constr.datalen; r++) { - int64_t _res_conv_17 = _res_vals[r]; - LDKMonitorUpdateId _res_conv_17_conv; - _res_conv_17_conv.inner = untag_ptr(_res_conv_17); - _res_conv_17_conv.is_owned = ptr_is_owned(_res_conv_17); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_17_conv); - _res_constr.data[r] = _res_conv_17_conv; - } - FREE(_res); - CVec_MonitorUpdateIdZ_free(_res_constr); -} - -static inline uint64_t C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR arg) { - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ"); - *ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(arg); +static inline uint64_t C2Tuple_OutPointCVec_u64ZZ_clone_ptr(LDKC2Tuple_OutPointCVec_u64ZZ *NONNULL_PTR arg) { + LDKC2Tuple_OutPointCVec_u64ZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_u64ZZ), "LDKC2Tuple_OutPointCVec_u64ZZ"); + *ret_conv = C2Tuple_OutPointCVec_u64ZZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(int64_t arg) { - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* arg_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(arg); - int64_t ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(arg_conv); +int64_t CS_LDK_C2Tuple_OutPointCVec_u64ZZ_clone_ptr(int64_t arg) { + LDKC2Tuple_OutPointCVec_u64ZZ* arg_conv = (LDKC2Tuple_OutPointCVec_u64ZZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_OutPointCVec_u64ZZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(int64_t orig) { - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* orig_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(orig); - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ"); - *ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(orig_conv); +int64_t CS_LDK_C2Tuple_OutPointCVec_u64ZZ_clone(int64_t orig) { + LDKC2Tuple_OutPointCVec_u64ZZ* orig_conv = (LDKC2Tuple_OutPointCVec_u64ZZ*)untag_ptr(orig); + LDKC2Tuple_OutPointCVec_u64ZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_u64ZZ), "LDKC2Tuple_OutPointCVec_u64ZZ"); + *ret_conv = C2Tuple_OutPointCVec_u64ZZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(int64_t a, int64_tArray b) { +int64_t CS_LDK_C2Tuple_OutPointCVec_u64ZZ_new(int64_t a, int64_tArray b) { LDKOutPoint a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = OutPoint_clone(&a_conv); - LDKCVec_MonitorUpdateIdZ b_constr; + LDKCVec_u64Z b_constr; b_constr.datalen = b->arr_len; if (b_constr.datalen > 0) - b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKMonitorUpdateId), "LDKCVec_MonitorUpdateIdZ Elements"); + b_constr.data = MALLOC(b_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); else b_constr.data = NULL; int64_t* b_vals = b->elems; - for (size_t r = 0; r < b_constr.datalen; r++) { - int64_t b_conv_17 = b_vals[r]; - LDKMonitorUpdateId b_conv_17_conv; - b_conv_17_conv.inner = untag_ptr(b_conv_17); - b_conv_17_conv.is_owned = ptr_is_owned(b_conv_17); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv_17_conv); - b_conv_17_conv = MonitorUpdateId_clone(&b_conv_17_conv); - b_constr.data[r] = b_conv_17_conv; + for (size_t g = 0; g < b_constr.datalen; g++) { + int64_t b_conv_6 = b_vals[g]; + b_constr.data[g] = b_conv_6; } FREE(b); - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ"); - *ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(a_conv, b_constr); + LDKC2Tuple_OutPointCVec_u64ZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_u64ZZ), "LDKC2Tuple_OutPointCVec_u64ZZ"); + *ret_conv = C2Tuple_OutPointCVec_u64ZZ_new(a_conv, b_constr); return tag_ptr(ret_conv, true); } -void CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(int64_t _res) { +void CS_LDK_C2Tuple_OutPointCVec_u64ZZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res_conv = *(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)(_res_ptr); + LDKC2Tuple_OutPointCVec_u64ZZ _res_conv = *(LDKC2Tuple_OutPointCVec_u64ZZ*)(_res_ptr); FREE(untag_ptr(_res)); - C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(_res_conv); + C2Tuple_OutPointCVec_u64ZZ_free(_res_conv); } -void CS_LDK_CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(int64_tArray _res) { - LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ _res_constr; +void CS_LDK_CVec_C2Tuple_OutPointCVec_u64ZZZ_free(int64_tArray _res) { + LDKCVec_C2Tuple_OutPointCVec_u64ZZZ _res_constr; _res_constr.datalen = _res->arr_len; if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OutPointCVec_u64ZZ), "LDKCVec_C2Tuple_OutPointCVec_u64ZZZ Elements"); else _res_constr.data = NULL; int64_t* _res_vals = _res->elems; - for (size_t p = 0; p < _res_constr.datalen; p++) { - int64_t _res_conv_41 = _res_vals[p]; - void* _res_conv_41_ptr = untag_ptr(_res_conv_41); - CHECK_ACCESS(_res_conv_41_ptr); - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res_conv_41_conv = *(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)(_res_conv_41_ptr); - FREE(untag_ptr(_res_conv_41)); - _res_constr.data[p] = _res_conv_41_conv; + 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_OutPointCVec_u64ZZ _res_conv_29_conv = *(LDKC2Tuple_OutPointCVec_u64ZZ*)(_res_conv_29_ptr); + FREE(untag_ptr(_res_conv_29)); + _res_constr.data[d] = _res_conv_29_conv; } FREE(_res); - CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(_res_constr); + CVec_C2Tuple_OutPointCVec_u64ZZZ_free(_res_constr); +} + +int64_t CS_LDK_CResult_BlindedMessagePathDecodeErrorZ_ok(int64_t o) { + LDKBlindedMessagePath o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = BlindedMessagePath_clone(&o_conv); + LDKCResult_BlindedMessagePathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathDecodeErrorZ), "LDKCResult_BlindedMessagePathDecodeErrorZ"); + *ret_conv = CResult_BlindedMessagePathDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_BlindedMessagePathDecodeErrorZ_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_BlindedMessagePathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathDecodeErrorZ), "LDKCResult_BlindedMessagePathDecodeErrorZ"); + *ret_conv = CResult_BlindedMessagePathDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_BlindedMessagePathDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_BlindedMessagePathDecodeErrorZ* o_conv = (LDKCResult_BlindedMessagePathDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_BlindedMessagePathDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_BlindedMessagePathDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_BlindedMessagePathDecodeErrorZ _res_conv = *(LDKCResult_BlindedMessagePathDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_BlindedMessagePathDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_BlindedMessagePathDecodeErrorZ_clone_ptr(LDKCResult_BlindedMessagePathDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_BlindedMessagePathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathDecodeErrorZ), "LDKCResult_BlindedMessagePathDecodeErrorZ"); + *ret_conv = CResult_BlindedMessagePathDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_BlindedMessagePathDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_BlindedMessagePathDecodeErrorZ* arg_conv = (LDKCResult_BlindedMessagePathDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BlindedMessagePathDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_BlindedMessagePathDecodeErrorZ_clone(int64_t orig) { + LDKCResult_BlindedMessagePathDecodeErrorZ* orig_conv = (LDKCResult_BlindedMessagePathDecodeErrorZ*)untag_ptr(orig); + LDKCResult_BlindedMessagePathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathDecodeErrorZ), "LDKCResult_BlindedMessagePathDecodeErrorZ"); + *ret_conv = CResult_BlindedMessagePathDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_BlindedMessagePathNoneZ_ok(int64_t o) { + LDKBlindedMessagePath o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = BlindedMessagePath_clone(&o_conv); + LDKCResult_BlindedMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathNoneZ), "LDKCResult_BlindedMessagePathNoneZ"); + *ret_conv = CResult_BlindedMessagePathNoneZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_BlindedMessagePathNoneZ_err() { + LDKCResult_BlindedMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathNoneZ), "LDKCResult_BlindedMessagePathNoneZ"); + *ret_conv = CResult_BlindedMessagePathNoneZ_err(); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_BlindedMessagePathNoneZ_is_ok(int64_t o) { + LDKCResult_BlindedMessagePathNoneZ* o_conv = (LDKCResult_BlindedMessagePathNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_BlindedMessagePathNoneZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_BlindedMessagePathNoneZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_BlindedMessagePathNoneZ _res_conv = *(LDKCResult_BlindedMessagePathNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_BlindedMessagePathNoneZ_free(_res_conv); +} + +static inline uint64_t CResult_BlindedMessagePathNoneZ_clone_ptr(LDKCResult_BlindedMessagePathNoneZ *NONNULL_PTR arg) { + LDKCResult_BlindedMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathNoneZ), "LDKCResult_BlindedMessagePathNoneZ"); + *ret_conv = CResult_BlindedMessagePathNoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_BlindedMessagePathNoneZ_clone_ptr(int64_t arg) { + LDKCResult_BlindedMessagePathNoneZ* arg_conv = (LDKCResult_BlindedMessagePathNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BlindedMessagePathNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_BlindedMessagePathNoneZ_clone(int64_t orig) { + LDKCResult_BlindedMessagePathNoneZ* orig_conv = (LDKCResult_BlindedMessagePathNoneZ*)untag_ptr(orig); + LDKCResult_BlindedMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathNoneZ), "LDKCResult_BlindedMessagePathNoneZ"); + *ret_conv = CResult_BlindedMessagePathNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_MessageContextDecodeErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKMessageContext o_conv = *(LDKMessageContext*)(o_ptr); + o_conv = MessageContext_clone((LDKMessageContext*)untag_ptr(o)); + LDKCResult_MessageContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_MessageContextDecodeErrorZ), "LDKCResult_MessageContextDecodeErrorZ"); + *ret_conv = CResult_MessageContextDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_MessageContextDecodeErrorZ_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_MessageContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_MessageContextDecodeErrorZ), "LDKCResult_MessageContextDecodeErrorZ"); + *ret_conv = CResult_MessageContextDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_MessageContextDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_MessageContextDecodeErrorZ* o_conv = (LDKCResult_MessageContextDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_MessageContextDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_MessageContextDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_MessageContextDecodeErrorZ _res_conv = *(LDKCResult_MessageContextDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_MessageContextDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_MessageContextDecodeErrorZ_clone_ptr(LDKCResult_MessageContextDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_MessageContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_MessageContextDecodeErrorZ), "LDKCResult_MessageContextDecodeErrorZ"); + *ret_conv = CResult_MessageContextDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_MessageContextDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_MessageContextDecodeErrorZ* arg_conv = (LDKCResult_MessageContextDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_MessageContextDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_MessageContextDecodeErrorZ_clone(int64_t orig) { + LDKCResult_MessageContextDecodeErrorZ* orig_conv = (LDKCResult_MessageContextDecodeErrorZ*)untag_ptr(orig); + LDKCResult_MessageContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_MessageContextDecodeErrorZ), "LDKCResult_MessageContextDecodeErrorZ"); + *ret_conv = CResult_MessageContextDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_OffersContextDecodeErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKOffersContext o_conv = *(LDKOffersContext*)(o_ptr); + o_conv = OffersContext_clone((LDKOffersContext*)untag_ptr(o)); + LDKCResult_OffersContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersContextDecodeErrorZ), "LDKCResult_OffersContextDecodeErrorZ"); + *ret_conv = CResult_OffersContextDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_OffersContextDecodeErrorZ_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_OffersContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersContextDecodeErrorZ), "LDKCResult_OffersContextDecodeErrorZ"); + *ret_conv = CResult_OffersContextDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_OffersContextDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_OffersContextDecodeErrorZ* o_conv = (LDKCResult_OffersContextDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OffersContextDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_OffersContextDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_OffersContextDecodeErrorZ _res_conv = *(LDKCResult_OffersContextDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_OffersContextDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_OffersContextDecodeErrorZ_clone_ptr(LDKCResult_OffersContextDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OffersContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersContextDecodeErrorZ), "LDKCResult_OffersContextDecodeErrorZ"); + *ret_conv = CResult_OffersContextDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_OffersContextDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_OffersContextDecodeErrorZ* arg_conv = (LDKCResult_OffersContextDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OffersContextDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_OffersContextDecodeErrorZ_clone(int64_t orig) { + LDKCResult_OffersContextDecodeErrorZ* orig_conv = (LDKCResult_OffersContextDecodeErrorZ*)untag_ptr(orig); + LDKCResult_OffersContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersContextDecodeErrorZ), "LDKCResult_OffersContextDecodeErrorZ"); + *ret_conv = CResult_OffersContextDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } void CS_LDK_APIError_free(int64_t this_ptr) { @@ -35834,6 +37807,29 @@ int64_t CS_LDK_BigSize_read(int8_tArray ser) { return tag_ptr(ret_conv, true); } +int8_tArray CS_LDK_UntrustedString_write(int64_t obj) { + LDKUntrustedString obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = UntrustedString_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_UntrustedString_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ"); + *ret_conv = UntrustedString_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + void CS_LDK_Hostname_free(int64_t this_obj) { LDKHostname this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -36065,7 +38061,7 @@ int64_t CS_LDK_TransactionU16LenLimited_read(int8_tArray ser) { return tag_ptr(ret_conv, true); } -int64_t CS_LDK_sign(int8_tArray msg, int8_tArray sk) { +jstring CS_LDK_sign(int8_tArray msg, int8_tArray sk) { LDKu8slice msg_ref; msg_ref.datalen = msg->arr_len; msg_ref.data = msg->elems; @@ -36073,10 +38069,11 @@ int64_t CS_LDK_sign(int8_tArray msg, int8_tArray sk) { CHECK(sk->arr_len == 32); memcpy(sk_arr, sk->elems, 32); FREE(sk); uint8_t (*sk_ref)[32] = &sk_arr; - LDKCResult_StrSecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StrSecp256k1ErrorZ), "LDKCResult_StrSecp256k1ErrorZ"); - *ret_conv = sign(msg_ref, sk_ref); + LDKStr ret_str = sign(msg_ref, sk_ref); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); FREE(msg); - return tag_ptr(ret_conv, true); + return ret_conv; } int64_t CS_LDK_recover_pk(int8_tArray msg, jstring sig) { @@ -36103,31 +38100,6 @@ jboolean CS_LDK_verify(int8_tArray msg, jstring sig, int8_tArray pk) { return ret_conv; } -int8_tArray CS_LDK_construct_invoice_preimage(int8_tArray hrp_bytes, ptrArray data_without_signature) { - LDKu8slice hrp_bytes_ref; - hrp_bytes_ref.datalen = hrp_bytes->arr_len; - hrp_bytes_ref.data = hrp_bytes->elems; - LDKCVec_U5Z data_without_signature_constr; - data_without_signature_constr.datalen = data_without_signature->arr_len; - if (data_without_signature_constr.datalen > 0) - data_without_signature_constr.data = MALLOC(data_without_signature_constr.datalen * sizeof(LDKU5), "LDKCVec_U5Z Elements"); - else - data_without_signature_constr.data = NULL; - int8_t* data_without_signature_vals = (void*) data_without_signature->elems; - for (size_t h = 0; h < data_without_signature_constr.datalen; h++) { - int8_t data_without_signature_conv_7 = data_without_signature_vals[h]; - - data_without_signature_constr.data[h] = (LDKU5){ ._0 = data_without_signature_conv_7 }; - } - FREE(data_without_signature); - LDKCVec_u8Z ret_var = construct_invoice_preimage(hrp_bytes_ref, data_without_signature_constr); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - FREE(hrp_bytes); - return ret_arr; -} - void CS_LDK_KVStore_free(int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -36181,7 +38153,7 @@ void CS_LDK_MonitorUpdatingPersister_free(int64_t this_obj) { MonitorUpdatingPersister_free(this_obj_conv); } -int64_t CS_LDK_MonitorUpdatingPersister_new(int64_t kv_store, int64_t logger, int64_t maximum_pending_updates, int64_t entropy_source, int64_t signer_provider) { +int64_t CS_LDK_MonitorUpdatingPersister_new(int64_t kv_store, int64_t logger, int64_t maximum_pending_updates, int64_t entropy_source, int64_t signer_provider, int64_t broadcaster, int64_t fee_estimator) { void* kv_store_ptr = untag_ptr(kv_store); CHECK_ACCESS(kv_store_ptr); LDKKVStore kv_store_conv = *(LDKKVStore*)(kv_store_ptr); @@ -36210,45 +38182,47 @@ int64_t CS_LDK_MonitorUpdatingPersister_new(int64_t kv_store, int64_t logger, i // If this_arg is a JCalls struct, then we need to increment the refcnt in it. LDKSignerProvider_JCalls_cloned(&signer_provider_conv); } - LDKMonitorUpdatingPersister ret_var = MonitorUpdatingPersister_new(kv_store_conv, logger_conv, maximum_pending_updates, entropy_source_conv, signer_provider_conv); + 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); + } + LDKMonitorUpdatingPersister ret_var = MonitorUpdatingPersister_new(kv_store_conv, logger_conv, maximum_pending_updates, entropy_source_conv, signer_provider_conv, broadcaster_conv, fee_estimator_conv); int64_t ret_ref = 0; 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_MonitorUpdatingPersister_read_all_channel_monitors_with_updates(int64_t this_arg, int64_t broadcaster, int64_t fee_estimator) { +int64_t CS_LDK_MonitorUpdatingPersister_read_all_channel_monitors_with_updates(int64_t this_arg) { LDKMonitorUpdatingPersister this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - void* broadcaster_ptr = untag_ptr(broadcaster); - if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); } - LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; - void* fee_estimator_ptr = untag_ptr(fee_estimator); - if (ptr_is_owned(fee_estimator)) { CHECK_ACCESS(fee_estimator_ptr); } - LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ), "LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ"); - *ret_conv = MonitorUpdatingPersister_read_all_channel_monitors_with_updates(&this_arg_conv, broadcaster_conv, fee_estimator_conv); + *ret_conv = MonitorUpdatingPersister_read_all_channel_monitors_with_updates(&this_arg_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_MonitorUpdatingPersister_read_channel_monitor_with_updates(int64_t this_arg, int64_t broadcaster, int64_t fee_estimator, jstring monitor_key) { +int64_t CS_LDK_MonitorUpdatingPersister_read_channel_monitor_with_updates(int64_t this_arg, jstring monitor_key) { LDKMonitorUpdatingPersister this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - void* broadcaster_ptr = untag_ptr(broadcaster); - if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); } - LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; - void* fee_estimator_ptr = untag_ptr(fee_estimator); - if (ptr_is_owned(fee_estimator)) { CHECK_ACCESS(fee_estimator_ptr); } - LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; LDKStr monitor_key_conv = str_ref_to_owned_c(monitor_key); LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ), "LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ"); - *ret_conv = MonitorUpdatingPersister_read_channel_monitor_with_updates(&this_arg_conv, broadcaster_conv, fee_estimator_conv, monitor_key_conv); + *ret_conv = MonitorUpdatingPersister_read_channel_monitor_with_updates(&this_arg_conv, monitor_key_conv); return tag_ptr(ret_conv, true); } @@ -36323,186 +38297,6 @@ int64_t CS_LDK_scid_from_parts(int64_t block, int64_t tx_index, int64_t vout_in 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); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - UntrustedString_free(this_obj_conv); -} - -jstring CS_LDK_UntrustedString_get_a(int64_t this_ptr) { - LDKUntrustedString this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKStr ret_str = UntrustedString_get_a(&this_ptr_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; -} - -void CS_LDK_UntrustedString_set_a(int64_t this_ptr, jstring val) { - LDKUntrustedString this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKStr val_conv = str_ref_to_owned_c(val); - UntrustedString_set_a(&this_ptr_conv, val_conv); -} - -int64_t CS_LDK_UntrustedString_new(jstring a_arg) { - LDKStr a_arg_conv = str_ref_to_owned_c(a_arg); - LDKUntrustedString ret_var = UntrustedString_new(a_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 UntrustedString_clone_ptr(LDKUntrustedString *NONNULL_PTR arg) { - LDKUntrustedString ret_var = UntrustedString_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_UntrustedString_clone_ptr(int64_t arg) { - LDKUntrustedString arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = UntrustedString_clone_ptr(&arg_conv); - return ret_conv; -} - -int64_t CS_LDK_UntrustedString_clone(int64_t orig) { - LDKUntrustedString orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKUntrustedString ret_var = UntrustedString_clone(&orig_conv); - int64_t ret_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_UntrustedString_eq(int64_t a, int64_t b) { - LDKUntrustedString a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKUntrustedString b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = UntrustedString_eq(&a_conv, &b_conv); - return ret_conv; -} - -int64_t CS_LDK_UntrustedString_hash(int64_t o) { - LDKUntrustedString o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = UntrustedString_hash(&o_conv); - return ret_conv; -} - -int8_tArray CS_LDK_UntrustedString_write(int64_t obj) { - LDKUntrustedString obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = UntrustedString_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -int64_t CS_LDK_UntrustedString_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ"); - *ret_conv = UntrustedString_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -jstring CS_LDK_UntrustedString_to_str(int64_t o) { - LDKUntrustedString o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = UntrustedString_to_str(&o_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; -} - -void CS_LDK_PrintableString_free(int64_t this_obj) { - LDKPrintableString this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PrintableString_free(this_obj_conv); -} - -jstring CS_LDK_PrintableString_get_a(int64_t this_ptr) { - LDKPrintableString this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKStr ret_str = PrintableString_get_a(&this_ptr_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; -} - -void CS_LDK_PrintableString_set_a(int64_t this_ptr, jstring val) { - LDKPrintableString this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKStr val_conv = str_ref_to_owned_c(val); - PrintableString_set_a(&this_ptr_conv, val_conv); -} - -int64_t CS_LDK_PrintableString_new(jstring a_arg) { - LDKStr a_arg_conv = str_ref_to_owned_c(a_arg); - LDKPrintableString ret_var = PrintableString_new(a_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; -} - -jstring CS_LDK_PrintableString_to_str(int64_t o) { - LDKPrintableString o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = PrintableString_to_str(&o_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; -} - void CS_LDK_TrackedSpendableOutput_free(int64_t this_obj) { LDKTrackedSpendableOutput this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -37218,6 +39012,29 @@ int64_t CS_LDK_Sleeper_from_two_futures(int64_t fut_a, int64_t fut_b) { return ret_ref; } +int64_t CS_LDK_Sleeper_from_three_futures(int64_t fut_a, int64_t fut_b, int64_t fut_c) { + LDKFuture fut_a_conv; + 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.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.is_owned = false; + LDKFuture fut_c_conv; + fut_c_conv.inner = untag_ptr(fut_c); + fut_c_conv.is_owned = ptr_is_owned(fut_c); + CHECK_INNER_FIELD_ACCESS_OR_NULL(fut_c_conv); + fut_c_conv.is_owned = false; + LDKSleeper ret_var = Sleeper_from_three_futures(&fut_a_conv, &fut_b_conv, &fut_c_conv); + int64_t ret_ref = 0; + 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_Sleeper_new(int64_tArray futures) { LDKCVec_FutureZ futures_constr; futures_constr.datalen = futures->arr_len; @@ -37488,7 +39305,32 @@ void CS_LDK_Record_set_line(int64_t this_ptr, int32_t val) { Record_set_line(&this_ptr_conv, val); } -int64_t CS_LDK_Record_new(int32_t level_arg, int8_tArray peer_id_arg, int64_t channel_id_arg, jstring args_arg, jstring module_path_arg, jstring file_arg, int32_t line_arg) { +int64_t CS_LDK_Record_get_payment_hash(int64_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); + *ret_copy = Record_get_payment_hash(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_Record_set_payment_hash(int64_t this_ptr, int64_t val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_ThirtyTwoBytesZ val_conv = *(LDKCOption_ThirtyTwoBytesZ*)(val_ptr); + val_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(val)); + Record_set_payment_hash(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_Record_new(int32_t level_arg, int8_tArray peer_id_arg, int64_t channel_id_arg, jstring args_arg, jstring module_path_arg, jstring file_arg, int32_t line_arg, int64_t payment_hash_arg) { LDKLevel level_arg_conv = LDKLevel_from_cs(level_arg); LDKPublicKey peer_id_arg_ref; CHECK(peer_id_arg->arr_len == 33); @@ -37501,7 +39343,11 @@ int64_t CS_LDK_Record_new(int32_t level_arg, int8_tArray peer_id_arg, int64_t c LDKStr args_arg_conv = str_ref_to_owned_c(args_arg); LDKStr module_path_arg_conv = str_ref_to_owned_c(module_path_arg); LDKStr file_arg_conv = str_ref_to_owned_c(file_arg); - LDKRecord ret_var = Record_new(level_arg_conv, peer_id_arg_ref, channel_id_arg_conv, args_arg_conv, module_path_arg_conv, file_arg_conv, line_arg); + void* payment_hash_arg_ptr = untag_ptr(payment_hash_arg); + CHECK_ACCESS(payment_hash_arg_ptr); + LDKCOption_ThirtyTwoBytesZ payment_hash_arg_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_arg_ptr); + payment_hash_arg_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash_arg)); + LDKRecord ret_var = Record_new(level_arg_conv, peer_id_arg_ref, channel_id_arg_conv, args_arg_conv, module_path_arg_conv, file_arg_conv, line_arg, payment_hash_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); @@ -37650,23 +39496,23 @@ void CS_LDK_ChannelHandshakeConfig_set_negotiate_scid_privacy(int64_t this_ptr, ChannelHandshakeConfig_set_negotiate_scid_privacy(&this_ptr_conv, val); } -jboolean CS_LDK_ChannelHandshakeConfig_get_announced_channel(int64_t this_ptr) { +jboolean CS_LDK_ChannelHandshakeConfig_get_announce_for_forwarding(int64_t this_ptr) { LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - jboolean ret_conv = ChannelHandshakeConfig_get_announced_channel(&this_ptr_conv); + jboolean ret_conv = ChannelHandshakeConfig_get_announce_for_forwarding(&this_ptr_conv); return ret_conv; } -void CS_LDK_ChannelHandshakeConfig_set_announced_channel(int64_t this_ptr, jboolean val) { +void CS_LDK_ChannelHandshakeConfig_set_announce_for_forwarding(int64_t this_ptr, jboolean val) { LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelHandshakeConfig_set_announced_channel(&this_ptr_conv, val); + ChannelHandshakeConfig_set_announce_for_forwarding(&this_ptr_conv, val); } jboolean CS_LDK_ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(int64_t this_ptr) { @@ -37745,8 +39591,8 @@ void CS_LDK_ChannelHandshakeConfig_set_our_max_accepted_htlcs(int64_t this_ptr, ChannelHandshakeConfig_set_our_max_accepted_htlcs(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelHandshakeConfig_new(int32_t minimum_depth_arg, int16_t our_to_self_delay_arg, int64_t our_htlc_minimum_msat_arg, int8_t max_inbound_htlc_value_in_flight_percent_of_channel_arg, jboolean negotiate_scid_privacy_arg, jboolean announced_channel_arg, jboolean commit_upfront_shutdown_pubkey_arg, int32_t their_channel_reserve_proportional_millionths_arg, jboolean negotiate_anchors_zero_fee_htlc_tx_arg, int16_t our_max_accepted_htlcs_arg) { - LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg, max_inbound_htlc_value_in_flight_percent_of_channel_arg, negotiate_scid_privacy_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg, their_channel_reserve_proportional_millionths_arg, negotiate_anchors_zero_fee_htlc_tx_arg, our_max_accepted_htlcs_arg); +int64_t CS_LDK_ChannelHandshakeConfig_new(int32_t minimum_depth_arg, int16_t our_to_self_delay_arg, int64_t our_htlc_minimum_msat_arg, int8_t max_inbound_htlc_value_in_flight_percent_of_channel_arg, jboolean negotiate_scid_privacy_arg, jboolean announce_for_forwarding_arg, jboolean commit_upfront_shutdown_pubkey_arg, int32_t their_channel_reserve_proportional_millionths_arg, jboolean negotiate_anchors_zero_fee_htlc_tx_arg, int16_t our_max_accepted_htlcs_arg) { + LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg, max_inbound_htlc_value_in_flight_percent_of_channel_arg, negotiate_scid_privacy_arg, announce_for_forwarding_arg, commit_upfront_shutdown_pubkey_arg, their_channel_reserve_proportional_millionths_arg, negotiate_anchors_zero_fee_htlc_tx_arg, our_max_accepted_htlcs_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); @@ -38495,14 +40341,6 @@ int64_t CS_LDK_ChannelConfigUpdate_new(int64_t forwarding_fee_proportional_mill return ret_ref; } -int64_t CS_LDK_ChannelConfigUpdate_default() { - LDKChannelConfigUpdate ret_var = ChannelConfigUpdate_default(); - int64_t ret_ref = 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_UserConfig_free(int64_t this_obj) { LDKUserConfig this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -38687,7 +40525,26 @@ void CS_LDK_UserConfig_set_accept_mpp_keysend(int64_t this_ptr, jboolean val) { UserConfig_set_accept_mpp_keysend(&this_ptr_conv, val); } -int64_t CS_LDK_UserConfig_new(int64_t channel_handshake_config_arg, int64_t channel_handshake_limits_arg, int64_t channel_config_arg, jboolean accept_forwards_to_priv_channels_arg, jboolean accept_inbound_channels_arg, jboolean manually_accept_inbound_channels_arg, jboolean accept_intercept_htlcs_arg, jboolean accept_mpp_keysend_arg) { +jboolean CS_LDK_UserConfig_get_manually_handle_bolt12_invoices(int64_t this_ptr) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + jboolean ret_conv = UserConfig_get_manually_handle_bolt12_invoices(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_UserConfig_set_manually_handle_bolt12_invoices(int64_t this_ptr, jboolean val) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + UserConfig_set_manually_handle_bolt12_invoices(&this_ptr_conv, val); +} + +int64_t CS_LDK_UserConfig_new(int64_t channel_handshake_config_arg, int64_t channel_handshake_limits_arg, int64_t channel_config_arg, jboolean accept_forwards_to_priv_channels_arg, jboolean accept_inbound_channels_arg, jboolean manually_accept_inbound_channels_arg, jboolean accept_intercept_htlcs_arg, jboolean accept_mpp_keysend_arg, jboolean manually_handle_bolt12_invoices_arg) { LDKChannelHandshakeConfig channel_handshake_config_arg_conv; channel_handshake_config_arg_conv.inner = untag_ptr(channel_handshake_config_arg); channel_handshake_config_arg_conv.is_owned = ptr_is_owned(channel_handshake_config_arg); @@ -38703,7 +40560,7 @@ int64_t CS_LDK_UserConfig_new(int64_t channel_handshake_config_arg, int64_t cha channel_config_arg_conv.is_owned = ptr_is_owned(channel_config_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_config_arg_conv); channel_config_arg_conv = ChannelConfig_clone(&channel_config_arg_conv); - LDKUserConfig ret_var = UserConfig_new(channel_handshake_config_arg_conv, channel_handshake_limits_arg_conv, channel_config_arg_conv, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg, manually_accept_inbound_channels_arg, accept_intercept_htlcs_arg, accept_mpp_keysend_arg); + LDKUserConfig ret_var = UserConfig_new(channel_handshake_config_arg_conv, channel_handshake_limits_arg_conv, channel_config_arg_conv, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg, manually_accept_inbound_channels_arg, accept_intercept_htlcs_arg, accept_mpp_keysend_arg, manually_handle_bolt12_invoices_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); @@ -39137,8 +40994,13 @@ int32_t CS_LDK_ConfirmationTarget_clone(int64_t orig) { return ret_conv; } -int32_t CS_LDK_ConfirmationTarget_on_chain_sweep() { - int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_on_chain_sweep()); +int32_t CS_LDK_ConfirmationTarget_maximum_fee_estimate() { + int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_maximum_fee_estimate()); + return ret_conv; +} + +int32_t CS_LDK_ConfirmationTarget_urgent_on_chain_sweep() { + int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_urgent_on_chain_sweep()); return ret_conv; } @@ -39194,69 +41056,6 @@ void CS_LDK_FeeEstimator_free(int64_t this_ptr) { FeeEstimator_free(this_ptr_conv); } -void CS_LDK_MonitorUpdateId_free(int64_t this_obj) { - LDKMonitorUpdateId this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - MonitorUpdateId_free(this_obj_conv); -} - -static inline uint64_t MonitorUpdateId_clone_ptr(LDKMonitorUpdateId *NONNULL_PTR arg) { - LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(arg); - int64_t ret_ref = 0; - 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_MonitorUpdateId_clone_ptr(int64_t arg) { - LDKMonitorUpdateId arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = MonitorUpdateId_clone_ptr(&arg_conv); - return ret_conv; -} - -int64_t CS_LDK_MonitorUpdateId_clone(int64_t orig) { - LDKMonitorUpdateId orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(&orig_conv); - int64_t ret_ref = 0; - 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_MonitorUpdateId_hash(int64_t o) { - LDKMonitorUpdateId o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = MonitorUpdateId_hash(&o_conv); - return ret_conv; -} - -jboolean CS_LDK_MonitorUpdateId_eq(int64_t a, int64_t b) { - LDKMonitorUpdateId a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKMonitorUpdateId b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = MonitorUpdateId_eq(&a_conv, &b_conv); - return ret_conv; -} - void CS_LDK_Persist_free(int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -39409,14 +41208,14 @@ int64_tArray CS_LDK_ChainMonitor_list_pending_monitor_updates(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_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ret_var = ChainMonitor_list_pending_monitor_updates(&this_arg_conv); + LDKCVec_C2Tuple_OutPointCVec_u64ZZZ ret_var = ChainMonitor_list_pending_monitor_updates(&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 p = 0; p < ret_var.datalen; p++) { - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv_41_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ"); - *ret_conv_41_conv = ret_var.data[p]; - ret_arr_ptr[p] = tag_ptr(ret_conv_41_conv, true); + for (size_t d = 0; d < ret_var.datalen; d++) { + LDKC2Tuple_OutPointCVec_u64ZZ* ret_conv_29_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_u64ZZ), "LDKC2Tuple_OutPointCVec_u64ZZ"); + *ret_conv_29_conv = ret_var.data[d]; + ret_arr_ptr[d] = tag_ptr(ret_conv_29_conv, true); } FREE(ret_var.data); @@ -39434,13 +41233,8 @@ int64_t CS_LDK_ChainMonitor_channel_monitor_updated(int64_t this_arg, int64_t f funding_txo_conv.is_owned = ptr_is_owned(funding_txo); CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); funding_txo_conv = OutPoint_clone(&funding_txo_conv); - LDKMonitorUpdateId completed_update_id_conv; - completed_update_id_conv.inner = untag_ptr(completed_update_id); - completed_update_id_conv.is_owned = ptr_is_owned(completed_update_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(completed_update_id_conv); - completed_update_id_conv = MonitorUpdateId_clone(&completed_update_id_conv); LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id_conv); + *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id); return tag_ptr(ret_conv, true); } @@ -39848,6 +41642,39 @@ int64_t CS_LDK_HTLCUpdate_read(int8_tArray ser) { return tag_ptr(ret_conv, true); } +int32_t CS_LDK_BalanceSource_clone(int64_t orig) { + LDKBalanceSource* orig_conv = (LDKBalanceSource*)untag_ptr(orig); + int32_t ret_conv = LDKBalanceSource_to_cs(BalanceSource_clone(orig_conv)); + return ret_conv; +} + +int32_t CS_LDK_BalanceSource_holder_force_closed() { + int32_t ret_conv = LDKBalanceSource_to_cs(BalanceSource_holder_force_closed()); + return ret_conv; +} + +int32_t CS_LDK_BalanceSource_counterparty_force_closed() { + int32_t ret_conv = LDKBalanceSource_to_cs(BalanceSource_counterparty_force_closed()); + return ret_conv; +} + +int32_t CS_LDK_BalanceSource_coop_close() { + int32_t ret_conv = LDKBalanceSource_to_cs(BalanceSource_coop_close()); + return ret_conv; +} + +int32_t CS_LDK_BalanceSource_htlc() { + int32_t ret_conv = LDKBalanceSource_to_cs(BalanceSource_htlc()); + return ret_conv; +} + +jboolean CS_LDK_BalanceSource_eq(int64_t a, int64_t b) { + LDKBalanceSource* a_conv = (LDKBalanceSource*)untag_ptr(a); + LDKBalanceSource* b_conv = (LDKBalanceSource*)untag_ptr(b); + jboolean ret_conv = BalanceSource_eq(a_conv, b_conv); + return ret_conv; +} + void CS_LDK_Balance_free(int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -39877,16 +41704,17 @@ int64_t CS_LDK_Balance_clone(int64_t orig) { return ret_ref; } -int64_t CS_LDK_Balance_claimable_on_channel_close(int64_t amount_satoshis) { +int64_t CS_LDK_Balance_claimable_on_channel_close(int64_t amount_satoshis, int64_t transaction_fee_satoshis, int64_t outbound_payment_htlc_rounded_msat, int64_t outbound_forwarded_htlc_rounded_msat, int64_t inbound_claiming_htlc_rounded_msat, int64_t inbound_htlc_rounded_msat) { LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_claimable_on_channel_close(amount_satoshis); + *ret_copy = Balance_claimable_on_channel_close(amount_satoshis, transaction_fee_satoshis, outbound_payment_htlc_rounded_msat, outbound_forwarded_htlc_rounded_msat, inbound_claiming_htlc_rounded_msat, inbound_htlc_rounded_msat); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Balance_claimable_awaiting_confirmations(int64_t amount_satoshis, int32_t confirmation_height) { +int64_t CS_LDK_Balance_claimable_awaiting_confirmations(int64_t amount_satoshis, int32_t confirmation_height, int32_t source) { + LDKBalanceSource source_conv = LDKBalanceSource_from_cs(source); LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_claimable_awaiting_confirmations(amount_satoshis, confirmation_height); + *ret_copy = Balance_claimable_awaiting_confirmations(amount_satoshis, confirmation_height, source_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -39904,12 +41732,12 @@ int64_t CS_LDK_Balance_contentious_claimable(int64_t amount_satoshis, int32_t t return ret_ref; } -int64_t CS_LDK_Balance_maybe_timeout_claimable_htlc(int64_t amount_satoshis, int32_t claimable_height, int8_tArray payment_hash) { +int64_t CS_LDK_Balance_maybe_timeout_claimable_htlc(int64_t amount_satoshis, int32_t claimable_height, int8_tArray payment_hash, jboolean outbound_payment) { LDKThirtyTwoBytes payment_hash_ref; CHECK(payment_hash->arr_len == 32); memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_maybe_timeout_claimable_htlc(amount_satoshis, claimable_height, payment_hash_ref); + *ret_copy = Balance_maybe_timeout_claimable_htlc(amount_satoshis, claimable_height, payment_hash_ref, outbound_payment); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -40110,7 +41938,7 @@ int64_tArray CS_LDK_ChannelMonitor_get_and_clear_pending_monitor_events(int64_t return ret_arr; } -void CS_LDK_ChannelMonitor_process_pending_events(int64_t this_arg, int64_t handler) { +int64_t CS_LDK_ChannelMonitor_process_pending_events(int64_t this_arg, int64_t handler) { LDKChannelMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -40119,7 +41947,9 @@ void CS_LDK_ChannelMonitor_process_pending_events(int64_t this_arg, int64_t han void* handler_ptr = untag_ptr(handler); if (ptr_is_owned(handler)) { CHECK_ACCESS(handler_ptr); } LDKEventHandler* handler_conv = (LDKEventHandler*)handler_ptr; - ChannelMonitor_process_pending_events(&this_arg_conv, handler_conv); + LDKCResult_NoneReplayEventZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneReplayEventZ), "LDKCResult_NoneReplayEventZ"); + *ret_conv = ChannelMonitor_process_pending_events(&this_arg_conv, handler_conv); + return tag_ptr(ret_conv, true); } int64_t CS_LDK_ChannelMonitor_initial_counterparty_commitment_tx(int64_t this_arg) { @@ -40481,6 +42311,16 @@ 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); } +jboolean CS_LDK_ChannelMonitor_has_pending_claims(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; + jboolean ret_conv = ChannelMonitor_has_pending_claims(&this_arg_conv); + return ret_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); @@ -40884,11 +42724,19 @@ int64_t CS_LDK_peel_payment_onion(int64_t msg, int64_t node_signer, int64_t log CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv.is_owned = false; void* node_signer_ptr = untag_ptr(node_signer); - if (ptr_is_owned(node_signer)) { CHECK_ACCESS(node_signer_ptr); } - LDKNodeSigner* node_signer_conv = (LDKNodeSigner*)node_signer_ptr; + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } void* logger_ptr = untag_ptr(logger); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + 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); + } LDKCResult_PendingHTLCInfoInboundHTLCErrZ* ret_conv = MALLOC(sizeof(LDKCResult_PendingHTLCInfoInboundHTLCErrZ), "LDKCResult_PendingHTLCInfoInboundHTLCErrZ"); *ret_conv = peel_payment_onion(&msg_conv, node_signer_conv, logger_conv, cur_height, accept_mpp_keysend, allow_skimmed_fees); return tag_ptr(ret_conv, true); @@ -41065,12 +42913,38 @@ void CS_LDK_BlindedForward_set_failure(int64_t this_ptr, int32_t val) { BlindedForward_set_failure(&this_ptr_conv, val_conv); } -int64_t CS_LDK_BlindedForward_new(int8_tArray inbound_blinding_point_arg, int32_t failure_arg) { +int8_tArray CS_LDK_BlindedForward_get_next_blinding_override(int64_t this_ptr) { + LDKBlindedForward this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, BlindedForward_get_next_blinding_override(&this_ptr_conv).compressed_form, 33); + return ret_arr; +} + +void CS_LDK_BlindedForward_set_next_blinding_override(int64_t this_ptr, int8_tArray val) { + LDKBlindedForward this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + BlindedForward_set_next_blinding_override(&this_ptr_conv, val_ref); +} + +int64_t CS_LDK_BlindedForward_new(int8_tArray inbound_blinding_point_arg, int32_t failure_arg, int8_tArray next_blinding_override_arg) { LDKPublicKey inbound_blinding_point_arg_ref; CHECK(inbound_blinding_point_arg->arr_len == 33); memcpy(inbound_blinding_point_arg_ref.compressed_form, inbound_blinding_point_arg->elems, 33); FREE(inbound_blinding_point_arg); LDKBlindedFailure failure_arg_conv = LDKBlindedFailure_from_cs(failure_arg); - LDKBlindedForward ret_var = BlindedForward_new(inbound_blinding_point_arg_ref, failure_arg_conv); + LDKPublicKey next_blinding_override_arg_ref; + CHECK(next_blinding_override_arg->arr_len == 33); + memcpy(next_blinding_override_arg_ref.compressed_form, next_blinding_override_arg->elems, 33); FREE(next_blinding_override_arg); + LDKBlindedForward ret_var = BlindedForward_new(inbound_blinding_point_arg_ref, failure_arg_conv, next_blinding_override_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); @@ -42038,7 +43912,7 @@ int64_t CS_LDK_ChannelManager_close_channel_with_feerate_and_script(int64_t thi return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelManager_force_close_broadcasting_latest_txn(int64_t this_arg, int64_t 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, jstring error_message) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -42052,12 +43926,13 @@ int64_t CS_LDK_ChannelManager_force_close_broadcasting_latest_txn(int64_t this_ 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); + LDKStr error_message_conv = str_ref_to_owned_c(error_message); LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_force_close_broadcasting_latest_txn(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref); + *ret_conv = ChannelManager_force_close_broadcasting_latest_txn(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref, error_message_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelManager_force_close_without_broadcasting_txn(int64_t this_arg, int64_t 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, jstring error_message) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -42071,27 +43946,30 @@ int64_t CS_LDK_ChannelManager_force_close_without_broadcasting_txn(int64_t this 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); + LDKStr error_message_conv = str_ref_to_owned_c(error_message); LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_force_close_without_broadcasting_txn(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref); + *ret_conv = ChannelManager_force_close_without_broadcasting_txn(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref, error_message_conv); return tag_ptr(ret_conv, true); } -void CS_LDK_ChannelManager_force_close_all_channels_broadcasting_latest_txn(int64_t this_arg) { +void CS_LDK_ChannelManager_force_close_all_channels_broadcasting_latest_txn(int64_t this_arg, jstring error_message) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelManager_force_close_all_channels_broadcasting_latest_txn(&this_arg_conv); + LDKStr error_message_conv = str_ref_to_owned_c(error_message); + ChannelManager_force_close_all_channels_broadcasting_latest_txn(&this_arg_conv, error_message_conv); } -void CS_LDK_ChannelManager_force_close_all_channels_without_broadcasting_txn(int64_t this_arg) { +void CS_LDK_ChannelManager_force_close_all_channels_without_broadcasting_txn(int64_t this_arg, jstring error_message) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelManager_force_close_all_channels_without_broadcasting_txn(&this_arg_conv); + LDKStr error_message_conv = str_ref_to_owned_c(error_message); + ChannelManager_force_close_all_channels_without_broadcasting_txn(&this_arg_conv, error_message_conv); } int64_t CS_LDK_ChannelManager_send_payment_with_route(int64_t this_arg, int64_t route, int8_tArray payment_hash, int64_t recipient_onion, int8_tArray payment_id) { @@ -42104,7 +43982,7 @@ int64_t CS_LDK_ChannelManager_send_payment_with_route(int64_t this_arg, int64_t route_conv.inner = untag_ptr(route); route_conv.is_owned = ptr_is_owned(route); CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); - route_conv.is_owned = false; + route_conv = Route_clone(&route_conv); LDKThirtyTwoBytes payment_hash_ref; CHECK(payment_hash->arr_len == 32); memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); @@ -42117,7 +43995,7 @@ int64_t CS_LDK_ChannelManager_send_payment_with_route(int64_t this_arg, int64_t CHECK(payment_id->arr_len == 32); memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); - *ret_conv = ChannelManager_send_payment_with_route(&this_arg_conv, &route_conv, payment_hash_ref, recipient_onion_conv, payment_id_ref); + *ret_conv = ChannelManager_send_payment_with_route(&this_arg_conv, route_conv, payment_hash_ref, recipient_onion_conv, payment_id_ref); return tag_ptr(ret_conv, true); } @@ -42288,7 +44166,7 @@ int64_t CS_LDK_ChannelManager_funding_transaction_generated(int64_t this_arg, i 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; + 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); @@ -42298,7 +44176,31 @@ 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_conv, 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); +} + +int64_t CS_LDK_ChannelManager_unsafe_manual_funding_transaction_generated(int64_t this_arg, int64_t temporary_channel_id, int8_tArray counterparty_node_id, int64_t funding) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelId temporary_channel_id_conv; + temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); + temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); + temporary_channel_id_conv = 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); + LDKOutPoint funding_conv; + funding_conv.inner = untag_ptr(funding); + funding_conv.is_owned = ptr_is_owned(funding); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_conv); + funding_conv = OutPoint_clone(&funding_conv); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_unsafe_manual_funding_transaction_generated(&this_arg_conv, temporary_channel_id_conv, counterparty_node_id_ref, funding_conv); return tag_ptr(ret_conv, true); } @@ -42569,14 +44471,18 @@ int64_t CS_LDK_ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(in return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelManager_create_offer_builder(int64_t this_arg) { +int64_t CS_LDK_ChannelManager_create_offer_builder(int64_t this_arg, int64_t absolute_expiry) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; + void* absolute_expiry_ptr = untag_ptr(absolute_expiry); + CHECK_ACCESS(absolute_expiry_ptr); + LDKCOption_u64Z absolute_expiry_conv = *(LDKCOption_u64Z*)(absolute_expiry_ptr); + absolute_expiry_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(absolute_expiry)); LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ"); - *ret_conv = ChannelManager_create_offer_builder(&this_arg_conv); + *ret_conv = ChannelManager_create_offer_builder(&this_arg_conv, absolute_expiry_conv); return tag_ptr(ret_conv, true); } @@ -42915,6 +44821,17 @@ int64_t CS_LDK_ChannelManager_as_OffersMessageHandler(int64_t this_arg) { return tag_ptr(ret_ret, true); } +int64_t CS_LDK_ChannelManager_as_AsyncPaymentsMessageHandler(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; + LDKAsyncPaymentsMessageHandler* ret_ret = MALLOC(sizeof(LDKAsyncPaymentsMessageHandler), "LDKAsyncPaymentsMessageHandler"); + *ret_ret = ChannelManager_as_AsyncPaymentsMessageHandler(&this_arg_conv); + 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); @@ -45717,23 +47634,23 @@ void CS_LDK_ChannelDetails_set_is_usable(int64_t this_ptr, jboolean val) { ChannelDetails_set_is_usable(&this_ptr_conv, val); } -jboolean CS_LDK_ChannelDetails_get_is_public(int64_t this_ptr) { +jboolean CS_LDK_ChannelDetails_get_is_announced(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; - jboolean ret_conv = ChannelDetails_get_is_public(&this_ptr_conv); + jboolean ret_conv = ChannelDetails_get_is_announced(&this_ptr_conv); return ret_conv; } -void CS_LDK_ChannelDetails_set_is_public(int64_t this_ptr, jboolean val) { +void CS_LDK_ChannelDetails_set_is_announced(int64_t this_ptr, jboolean val) { LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelDetails_set_is_public(&this_ptr_conv, val); + ChannelDetails_set_is_announced(&this_ptr_conv, val); } int64_t CS_LDK_ChannelDetails_get_inbound_htlc_minimum_msat(int64_t this_ptr) { @@ -45909,7 +47826,7 @@ void CS_LDK_ChannelDetails_set_pending_outbound_htlcs(int64_t this_ptr, int64_t ChannelDetails_set_pending_outbound_htlcs(&this_ptr_conv, val_constr); } -int64_t CS_LDK_ChannelDetails_new(int64_t 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, int64_tArray pending_inbound_htlcs_arg, int64_tArray pending_outbound_htlcs_arg) { +int64_t CS_LDK_ChannelDetails_new(int64_t 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_announced_arg, int64_t inbound_htlc_minimum_msat_arg, int64_t inbound_htlc_maximum_msat_arg, int64_t config_arg, int64_tArray pending_inbound_htlcs_arg, int64_tArray pending_outbound_htlcs_arg) { LDKChannelId channel_id_arg_conv; channel_id_arg_conv.inner = untag_ptr(channel_id_arg); channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); @@ -45945,6 +47862,7 @@ int64_t CS_LDK_ChannelDetails_new(int64_t channel_id_arg, int64_t counterparty_ 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); + unspendable_punishment_reserve_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(unspendable_punishment_reserve_arg)); 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); @@ -46015,7 +47933,7 @@ int64_t CS_LDK_ChannelDetails_new(int64_t channel_id_arg, int64_t counterparty_ pending_outbound_htlcs_arg_constr.data[v] = pending_outbound_htlcs_arg_conv_21_conv; } FREE(pending_outbound_htlcs_arg); - LDKChannelDetails ret_var = ChannelDetails_new(channel_id_arg_conv, counterparty_arg_conv, funding_txo_arg_conv, channel_type_arg_conv, short_channel_id_arg_conv, outbound_scid_alias_arg_conv, inbound_scid_alias_arg_conv, channel_value_satoshis_arg, unspendable_punishment_reserve_arg_conv, user_channel_id_arg_ref, feerate_sat_per_1000_weight_arg_conv, balance_msat_arg, outbound_capacity_msat_arg, next_outbound_htlc_limit_msat_arg, next_outbound_htlc_minimum_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg_conv, confirmations_arg_conv, force_close_spend_delay_arg_conv, is_outbound_arg, is_channel_ready_arg, channel_shutdown_state_arg_conv, is_usable_arg, is_public_arg, inbound_htlc_minimum_msat_arg_conv, inbound_htlc_maximum_msat_arg_conv, config_arg_conv, pending_inbound_htlcs_arg_constr, pending_outbound_htlcs_arg_constr); + LDKChannelDetails ret_var = ChannelDetails_new(channel_id_arg_conv, counterparty_arg_conv, funding_txo_arg_conv, channel_type_arg_conv, short_channel_id_arg_conv, outbound_scid_alias_arg_conv, inbound_scid_alias_arg_conv, channel_value_satoshis_arg, unspendable_punishment_reserve_arg_conv, user_channel_id_arg_ref, feerate_sat_per_1000_weight_arg_conv, balance_msat_arg, outbound_capacity_msat_arg, next_outbound_htlc_limit_msat_arg, next_outbound_htlc_minimum_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg_conv, confirmations_arg_conv, force_close_spend_delay_arg_conv, is_outbound_arg, is_channel_ready_arg, channel_shutdown_state_arg_conv, is_usable_arg, is_announced_arg, inbound_htlc_minimum_msat_arg_conv, inbound_htlc_maximum_msat_arg_conv, config_arg_conv, pending_inbound_htlcs_arg_constr, pending_outbound_htlcs_arg_constr); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -46417,6 +48335,7 @@ int64_t CS_LDK_Init_new(int64_t features_arg, int64_t networks_arg, int64_t rem void* remote_network_address_arg_ptr = untag_ptr(remote_network_address_arg); CHECK_ACCESS(remote_network_address_arg_ptr); LDKCOption_SocketAddressZ remote_network_address_arg_conv = *(LDKCOption_SocketAddressZ*)(remote_network_address_arg_ptr); + remote_network_address_arg_conv = COption_SocketAddressZ_clone((LDKCOption_SocketAddressZ*)untag_ptr(remote_network_address_arg)); LDKInit ret_var = Init_new(features_arg_conv, networks_arg_conv, remote_network_address_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); @@ -47428,6 +49347,204 @@ jboolean CS_LDK_CommonOpenChannelFields_eq(int64_t a, int64_t b) { return ret_conv; } +int64_t CS_LDK_CommonOpenChannelFields_channel_parameters(int64_t this_arg) { + LDKCommonOpenChannelFields this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelParameters ret_var = CommonOpenChannelFields_channel_parameters(&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_ChannelParameters_free(int64_t this_obj) { + LDKChannelParameters this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelParameters_free(this_obj_conv); +} + +int64_t CS_LDK_ChannelParameters_get_dust_limit_satoshis(int64_t this_ptr) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = ChannelParameters_get_dust_limit_satoshis(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_ChannelParameters_set_dust_limit_satoshis(int64_t this_ptr, int64_t val) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelParameters_set_dust_limit_satoshis(&this_ptr_conv, val); +} + +int64_t CS_LDK_ChannelParameters_get_max_htlc_value_in_flight_msat(int64_t this_ptr) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = ChannelParameters_get_max_htlc_value_in_flight_msat(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_ChannelParameters_set_max_htlc_value_in_flight_msat(int64_t this_ptr, int64_t val) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelParameters_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val); +} + +int64_t CS_LDK_ChannelParameters_get_htlc_minimum_msat(int64_t this_ptr) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = ChannelParameters_get_htlc_minimum_msat(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_ChannelParameters_set_htlc_minimum_msat(int64_t this_ptr, int64_t val) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelParameters_set_htlc_minimum_msat(&this_ptr_conv, val); +} + +int32_t CS_LDK_ChannelParameters_get_commitment_feerate_sat_per_1000_weight(int64_t this_ptr) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = ChannelParameters_get_commitment_feerate_sat_per_1000_weight(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_ChannelParameters_set_commitment_feerate_sat_per_1000_weight(int64_t this_ptr, int32_t val) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelParameters_set_commitment_feerate_sat_per_1000_weight(&this_ptr_conv, val); +} + +int16_t CS_LDK_ChannelParameters_get_to_self_delay(int64_t this_ptr) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = ChannelParameters_get_to_self_delay(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_ChannelParameters_set_to_self_delay(int64_t this_ptr, int16_t val) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelParameters_set_to_self_delay(&this_ptr_conv, val); +} + +int16_t CS_LDK_ChannelParameters_get_max_accepted_htlcs(int64_t this_ptr) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = ChannelParameters_get_max_accepted_htlcs(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_ChannelParameters_set_max_accepted_htlcs(int64_t this_ptr, int16_t val) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelParameters_set_max_accepted_htlcs(&this_ptr_conv, val); +} + +int64_t CS_LDK_ChannelParameters_new(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) { + LDKChannelParameters ret_var = ChannelParameters_new(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); + int64_t ret_ref = 0; + 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 ChannelParameters_clone_ptr(LDKChannelParameters *NONNULL_PTR arg) { + LDKChannelParameters ret_var = ChannelParameters_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_ChannelParameters_clone_ptr(int64_t arg) { + LDKChannelParameters 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 = ChannelParameters_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_ChannelParameters_clone(int64_t orig) { + LDKChannelParameters 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; + LDKChannelParameters ret_var = ChannelParameters_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_ChannelParameters_hash(int64_t o) { + LDKChannelParameters o_conv; + 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 = ChannelParameters_hash(&o_conv); + return ret_conv; +} + +jboolean CS_LDK_ChannelParameters_eq(int64_t a, int64_t b) { + LDKChannelParameters a_conv; + 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; + LDKChannelParameters 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 = ChannelParameters_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); @@ -49055,29 +51172,29 @@ jboolean CS_LDK_Stfu_eq(int64_t a, int64_t b) { return ret_conv; } -void CS_LDK_Splice_free(int64_t this_obj) { - LDKSplice this_obj_conv; +void CS_LDK_SpliceInit_free(int64_t this_obj) { + LDKSpliceInit this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Splice_free(this_obj_conv); + SpliceInit_free(this_obj_conv); } -int64_t CS_LDK_Splice_get_channel_id(int64_t this_ptr) { - LDKSplice this_ptr_conv; +int64_t CS_LDK_SpliceInit_get_channel_id(int64_t this_ptr) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = Splice_get_channel_id(&this_ptr_conv); + LDKChannelId ret_var = SpliceInit_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, int64_t val) { - LDKSplice this_ptr_conv; +void CS_LDK_SpliceInit_set_channel_id(int64_t this_ptr, int64_t val) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -49087,173 +51204,168 @@ void CS_LDK_Splice_set_channel_id(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 = ChannelId_clone(&val_conv); - Splice_set_channel_id(&this_ptr_conv, val_conv); + SpliceInit_set_channel_id(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_Splice_get_chain_hash(int64_t this_ptr) { - LDKSplice this_ptr_conv; +int64_t CS_LDK_SpliceInit_get_funding_contribution_satoshis(int64_t this_ptr) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(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_chain_hash(&this_ptr_conv), 32); - return ret_arr; + int64_t ret_conv = SpliceInit_get_funding_contribution_satoshis(&this_ptr_conv); + return ret_conv; } -void CS_LDK_Splice_set_chain_hash(int64_t this_ptr, int8_tArray val) { - LDKSplice this_ptr_conv; +void CS_LDK_SpliceInit_set_funding_contribution_satoshis(int64_t this_ptr, int64_t val) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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_chain_hash(&this_ptr_conv, val_ref); + SpliceInit_set_funding_contribution_satoshis(&this_ptr_conv, val); } -int64_t CS_LDK_Splice_get_relative_satoshis(int64_t this_ptr) { - LDKSplice this_ptr_conv; +int32_t CS_LDK_SpliceInit_get_funding_feerate_perkw(int64_t this_ptr) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = Splice_get_relative_satoshis(&this_ptr_conv); + int32_t ret_conv = SpliceInit_get_funding_feerate_perkw(&this_ptr_conv); return ret_conv; } -void CS_LDK_Splice_set_relative_satoshis(int64_t this_ptr, int64_t val) { - LDKSplice this_ptr_conv; +void CS_LDK_SpliceInit_set_funding_feerate_perkw(int64_t this_ptr, int32_t val) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - Splice_set_relative_satoshis(&this_ptr_conv, val); + SpliceInit_set_funding_feerate_perkw(&this_ptr_conv, val); } -int32_t CS_LDK_Splice_get_funding_feerate_perkw(int64_t this_ptr) { - LDKSplice this_ptr_conv; +int32_t CS_LDK_SpliceInit_get_locktime(int64_t this_ptr) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = Splice_get_funding_feerate_perkw(&this_ptr_conv); + int32_t ret_conv = SpliceInit_get_locktime(&this_ptr_conv); return ret_conv; } -void CS_LDK_Splice_set_funding_feerate_perkw(int64_t this_ptr, int32_t val) { - LDKSplice this_ptr_conv; +void CS_LDK_SpliceInit_set_locktime(int64_t this_ptr, int32_t val) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - Splice_set_funding_feerate_perkw(&this_ptr_conv, val); + SpliceInit_set_locktime(&this_ptr_conv, val); } -int32_t CS_LDK_Splice_get_locktime(int64_t this_ptr) { - LDKSplice this_ptr_conv; +int8_tArray CS_LDK_SpliceInit_get_funding_pubkey(int64_t this_ptr) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = Splice_get_locktime(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, SpliceInit_get_funding_pubkey(&this_ptr_conv).compressed_form, 33); + return ret_arr; } -void CS_LDK_Splice_set_locktime(int64_t this_ptr, int32_t val) { - LDKSplice this_ptr_conv; +void CS_LDK_SpliceInit_set_funding_pubkey(int64_t this_ptr, int8_tArray val) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - Splice_set_locktime(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + SpliceInit_set_funding_pubkey(&this_ptr_conv, val_ref); } -int8_tArray CS_LDK_Splice_get_funding_pubkey(int64_t this_ptr) { - LDKSplice this_ptr_conv; +int32_t CS_LDK_SpliceInit_get_require_confirmed_inputs(int64_t this_ptr) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(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, Splice_get_funding_pubkey(&this_ptr_conv).compressed_form, 33); - return ret_arr; + int32_t ret_conv = LDKCOption_NoneZ_to_cs(SpliceInit_get_require_confirmed_inputs(&this_ptr_conv)); + return ret_conv; } -void CS_LDK_Splice_set_funding_pubkey(int64_t this_ptr, int8_tArray val) { - LDKSplice this_ptr_conv; +void CS_LDK_SpliceInit_set_require_confirmed_inputs(int64_t this_ptr, int32_t val) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - Splice_set_funding_pubkey(&this_ptr_conv, val_ref); + LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_cs(val); + SpliceInit_set_require_confirmed_inputs(&this_ptr_conv, val_conv); } -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) { +int64_t CS_LDK_SpliceInit_new(int64_t channel_id_arg, int64_t funding_contribution_satoshis_arg, int32_t funding_feerate_perkw_arg, int32_t locktime_arg, int8_tArray funding_pubkey_arg, int32_t require_confirmed_inputs_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_conv, chain_hash_arg_ref, relative_satoshis_arg, funding_feerate_perkw_arg, locktime_arg, funding_pubkey_arg_ref); + LDKCOption_NoneZ require_confirmed_inputs_arg_conv = LDKCOption_NoneZ_from_cs(require_confirmed_inputs_arg); + LDKSpliceInit ret_var = SpliceInit_new(channel_id_arg_conv, funding_contribution_satoshis_arg, funding_feerate_perkw_arg, locktime_arg, funding_pubkey_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); return ret_ref; } -static inline uint64_t Splice_clone_ptr(LDKSplice *NONNULL_PTR arg) { - LDKSplice ret_var = Splice_clone(arg); +static inline uint64_t SpliceInit_clone_ptr(LDKSpliceInit *NONNULL_PTR arg) { + LDKSpliceInit ret_var = SpliceInit_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_Splice_clone_ptr(int64_t arg) { - LDKSplice arg_conv; +int64_t CS_LDK_SpliceInit_clone_ptr(int64_t arg) { + LDKSpliceInit 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 = Splice_clone_ptr(&arg_conv); + int64_t ret_conv = SpliceInit_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_Splice_clone(int64_t orig) { - LDKSplice orig_conv; +int64_t CS_LDK_SpliceInit_clone(int64_t orig) { + LDKSpliceInit 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; - LDKSplice ret_var = Splice_clone(&orig_conv); + LDKSpliceInit ret_var = SpliceInit_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_Splice_eq(int64_t a, int64_t b) { - LDKSplice a_conv; +jboolean CS_LDK_SpliceInit_eq(int64_t a, int64_t b) { + LDKSpliceInit a_conv; 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; - LDKSplice b_conv; + LDKSpliceInit 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 = Splice_eq(&a_conv, &b_conv); + jboolean ret_conv = SpliceInit_eq(&a_conv, &b_conv); return ret_conv; } @@ -49292,46 +51404,23 @@ void CS_LDK_SpliceAck_set_channel_id(int64_t this_ptr, int64_t val) { SpliceAck_set_channel_id(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_SpliceAck_get_chain_hash(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_chain_hash(&this_ptr_conv), 32); - return ret_arr; -} - -void CS_LDK_SpliceAck_set_chain_hash(int64_t this_ptr, int8_tArray 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_chain_hash(&this_ptr_conv, val_ref); -} - -int64_t CS_LDK_SpliceAck_get_relative_satoshis(int64_t this_ptr) { +int64_t CS_LDK_SpliceAck_get_funding_contribution_satoshis(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; - int64_t ret_conv = SpliceAck_get_relative_satoshis(&this_ptr_conv); + int64_t ret_conv = SpliceAck_get_funding_contribution_satoshis(&this_ptr_conv); return ret_conv; } -void CS_LDK_SpliceAck_set_relative_satoshis(int64_t this_ptr, int64_t val) { +void CS_LDK_SpliceAck_set_funding_contribution_satoshis(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; - SpliceAck_set_relative_satoshis(&this_ptr_conv, val); + SpliceAck_set_funding_contribution_satoshis(&this_ptr_conv, val); } int8_tArray CS_LDK_SpliceAck_get_funding_pubkey(int64_t this_ptr) { @@ -49357,19 +51446,37 @@ 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(int64_t channel_id_arg, int8_tArray chain_hash_arg, int64_t relative_satoshis_arg, int8_tArray funding_pubkey_arg) { +int32_t CS_LDK_SpliceAck_get_require_confirmed_inputs(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; + int32_t ret_conv = LDKCOption_NoneZ_to_cs(SpliceAck_get_require_confirmed_inputs(&this_ptr_conv)); + return ret_conv; +} + +void CS_LDK_SpliceAck_set_require_confirmed_inputs(int64_t this_ptr, int32_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; + LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_cs(val); + SpliceAck_set_require_confirmed_inputs(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_SpliceAck_new(int64_t channel_id_arg, int64_t funding_contribution_satoshis_arg, int8_tArray funding_pubkey_arg, int32_t require_confirmed_inputs_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_conv, chain_hash_arg_ref, relative_satoshis_arg, funding_pubkey_arg_ref); + LDKCOption_NoneZ require_confirmed_inputs_arg_conv = LDKCOption_NoneZ_from_cs(require_confirmed_inputs_arg); + LDKSpliceAck ret_var = SpliceAck_new(channel_id_arg_conv, funding_contribution_satoshis_arg, funding_pubkey_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); @@ -49456,13 +51563,39 @@ void CS_LDK_SpliceLocked_set_channel_id(int64_t this_ptr, int64_t val) { SpliceLocked_set_channel_id(&this_ptr_conv, val_conv); } -int64_t CS_LDK_SpliceLocked_new(int64_t channel_id_arg) { +int8_tArray CS_LDK_SpliceLocked_get_splice_txid(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_splice_txid(&this_ptr_conv), 32); + return ret_arr; +} + +void CS_LDK_SpliceLocked_set_splice_txid(int64_t this_ptr, int8_tArray 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_splice_txid(&this_ptr_conv, val_ref); +} + +int64_t CS_LDK_SpliceLocked_new(int64_t channel_id_arg, int8_tArray splice_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); - LDKSpliceLocked ret_var = SpliceLocked_new(channel_id_arg_conv); + LDKThirtyTwoBytes splice_txid_arg_ref; + CHECK(splice_txid_arg->arr_len == 32); + memcpy(splice_txid_arg_ref.data, splice_txid_arg->elems, 32); FREE(splice_txid_arg); + LDKSpliceLocked ret_var = SpliceLocked_new(channel_id_arg_conv, splice_txid_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); @@ -49633,7 +51766,32 @@ 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(int64_t channel_id_arg, int64_t serial_id_arg, int64_t prevtx_arg, int32_t prevtx_out_arg, int32_t sequence_arg) { +int64_t CS_LDK_TxAddInput_get_shared_input_txid(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; + LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); + *ret_copy = TxAddInput_get_shared_input_txid(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_TxAddInput_set_shared_input_txid(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; + 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)); + TxAddInput_set_shared_input_txid(&this_ptr_conv, val_conv); +} + +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, int64_t shared_input_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); @@ -49644,7 +51802,11 @@ int64_t CS_LDK_TxAddInput_new(int64_t channel_id_arg, int64_t serial_id_arg, in 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_conv, serial_id_arg, prevtx_arg_conv, prevtx_out_arg, sequence_arg); + void* shared_input_txid_arg_ptr = untag_ptr(shared_input_txid_arg); + CHECK_ACCESS(shared_input_txid_arg_ptr); + LDKCOption_ThirtyTwoBytesZ shared_input_txid_arg_conv = *(LDKCOption_ThirtyTwoBytesZ*)(shared_input_txid_arg_ptr); + shared_input_txid_arg_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(shared_input_txid_arg)); + LDKTxAddInput ret_var = TxAddInput_new(channel_id_arg_conv, serial_id_arg, prevtx_arg_conv, prevtx_out_arg, sequence_arg, shared_input_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); @@ -50330,19 +52492,19 @@ 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_get_funding_outpoint_sig(int64_t this_ptr) { +int64_t CS_LDK_TxSignatures_get_shared_input_signature(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); + *ret_copy = TxSignatures_get_shared_input_signature(&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) { +void CS_LDK_TxSignatures_set_shared_input_signature(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); @@ -50352,10 +52514,10 @@ void CS_LDK_TxSignatures_set_funding_outpoint_sig(int64_t this_ptr, int64_t 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); + TxSignatures_set_shared_input_signature(&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) { +int64_t CS_LDK_TxSignatures_new(int64_t channel_id_arg, int8_tArray tx_hash_arg, ptrArray witnesses_arg, int64_t shared_input_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); @@ -50381,11 +52543,11 @@ int64_t CS_LDK_TxSignatures_new(int64_t channel_id_arg, int8_tArray tx_hash_arg witnesses_arg_constr.data[i] = witnesses_arg_conv_8_ref; } FREE(witnesses_arg); - 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); + void* shared_input_signature_arg_ptr = untag_ptr(shared_input_signature_arg); + CHECK_ACCESS(shared_input_signature_arg_ptr); + LDKCOption_ECDSASignatureZ shared_input_signature_arg_conv = *(LDKCOption_ECDSASignatureZ*)(shared_input_signature_arg_ptr); + shared_input_signature_arg_conv = COption_ECDSASignatureZ_clone((LDKCOption_ECDSASignatureZ*)untag_ptr(shared_input_signature_arg)); + LDKTxSignatures ret_var = TxSignatures_new(channel_id_arg_conv, tx_hash_arg_ref, witnesses_arg_constr, shared_input_signature_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); @@ -52091,6 +54253,122 @@ jboolean CS_LDK_UpdateFailMalformedHTLC_eq(int64_t a, int64_t b) { return ret_conv; } +void CS_LDK_CommitmentSignedBatch_free(int64_t this_obj) { + LDKCommitmentSignedBatch this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + CommitmentSignedBatch_free(this_obj_conv); +} + +int16_t CS_LDK_CommitmentSignedBatch_get_batch_size(int64_t this_ptr) { + LDKCommitmentSignedBatch this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = CommitmentSignedBatch_get_batch_size(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_CommitmentSignedBatch_set_batch_size(int64_t this_ptr, int16_t val) { + LDKCommitmentSignedBatch this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + CommitmentSignedBatch_set_batch_size(&this_ptr_conv, val); +} + +int8_tArray CS_LDK_CommitmentSignedBatch_get_funding_txid(int64_t this_ptr) { + LDKCommitmentSignedBatch this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(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, *CommitmentSignedBatch_get_funding_txid(&this_ptr_conv), 32); + return ret_arr; +} + +void CS_LDK_CommitmentSignedBatch_set_funding_txid(int64_t this_ptr, int8_tArray val) { + LDKCommitmentSignedBatch this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + CommitmentSignedBatch_set_funding_txid(&this_ptr_conv, val_ref); +} + +int64_t CS_LDK_CommitmentSignedBatch_new(int16_t batch_size_arg, int8_tArray funding_txid_arg) { + 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); + LDKCommitmentSignedBatch ret_var = CommitmentSignedBatch_new(batch_size_arg, funding_txid_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 CommitmentSignedBatch_clone_ptr(LDKCommitmentSignedBatch *NONNULL_PTR arg) { + LDKCommitmentSignedBatch ret_var = CommitmentSignedBatch_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_CommitmentSignedBatch_clone_ptr(int64_t arg) { + LDKCommitmentSignedBatch 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 = CommitmentSignedBatch_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CommitmentSignedBatch_clone(int64_t orig) { + LDKCommitmentSignedBatch 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; + LDKCommitmentSignedBatch ret_var = CommitmentSignedBatch_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_CommitmentSignedBatch_hash(int64_t o) { + LDKCommitmentSignedBatch o_conv; + 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 = CommitmentSignedBatch_hash(&o_conv); + return ret_conv; +} + +jboolean CS_LDK_CommitmentSignedBatch_eq(int64_t a, int64_t b) { + LDKCommitmentSignedBatch a_conv; + 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; + LDKCommitmentSignedBatch 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 = CommitmentSignedBatch_eq(&a_conv, &b_conv); + return ret_conv; +} + void CS_LDK_CommitmentSigned_free(int64_t this_obj) { LDKCommitmentSigned this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -52193,7 +54471,34 @@ 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(int64_t channel_id_arg, int8_tArray signature_arg, ptrArray htlc_signatures_arg) { +int64_t CS_LDK_CommitmentSigned_get_batch(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; + LDKCommitmentSignedBatch ret_var = CommitmentSigned_get_batch(&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_batch(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; + LDKCommitmentSignedBatch 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 = CommitmentSignedBatch_clone(&val_conv); + CommitmentSigned_set_batch(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_CommitmentSigned_new(int64_t channel_id_arg, int8_tArray signature_arg, ptrArray htlc_signatures_arg, int64_t batch_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); @@ -52217,7 +54522,12 @@ int64_t CS_LDK_CommitmentSigned_new(int64_t channel_id_arg, int8_tArray signatu htlc_signatures_arg_constr.data[i] = htlc_signatures_arg_conv_8_ref; } FREE(htlc_signatures_arg); - LDKCommitmentSigned ret_var = CommitmentSigned_new(channel_id_arg_conv, signature_arg_ref, htlc_signatures_arg_constr); + LDKCommitmentSignedBatch batch_arg_conv; + batch_arg_conv.inner = untag_ptr(batch_arg); + batch_arg_conv.is_owned = ptr_is_owned(batch_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(batch_arg_conv); + batch_arg_conv = CommitmentSignedBatch_clone(&batch_arg_conv); + LDKCommitmentSigned ret_var = CommitmentSigned_new(channel_id_arg_conv, signature_arg_ref, htlc_signatures_arg_constr, batch_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); @@ -53468,6 +55778,7 @@ int64_t CS_LDK_UnsignedNodeAnnouncement_new(int64_t features_arg, int32_t times 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_conv_15_conv = SocketAddress_clone((LDKSocketAddress*)untag_ptr(addresses_arg_conv_15)); addresses_arg_constr.data[p] = addresses_arg_conv_15_conv; } FREE(addresses_arg); @@ -54252,23 +56563,42 @@ void CS_LDK_UnsignedChannelUpdate_set_timestamp(int64_t this_ptr, int32_t val) UnsignedChannelUpdate_set_timestamp(&this_ptr_conv, val); } -int8_t CS_LDK_UnsignedChannelUpdate_get_flags(int64_t this_ptr) { +int8_t CS_LDK_UnsignedChannelUpdate_get_message_flags(int64_t this_ptr) { + LDKUnsignedChannelUpdate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_t ret_conv = UnsignedChannelUpdate_get_message_flags(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_UnsignedChannelUpdate_set_message_flags(int64_t this_ptr, int8_t val) { + LDKUnsignedChannelUpdate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + UnsignedChannelUpdate_set_message_flags(&this_ptr_conv, val); +} + +int8_t CS_LDK_UnsignedChannelUpdate_get_channel_flags(int64_t this_ptr) { LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_t ret_conv = UnsignedChannelUpdate_get_flags(&this_ptr_conv); + int8_t ret_conv = UnsignedChannelUpdate_get_channel_flags(&this_ptr_conv); return ret_conv; } -void CS_LDK_UnsignedChannelUpdate_set_flags(int64_t this_ptr, int8_t val) { +void CS_LDK_UnsignedChannelUpdate_set_channel_flags(int64_t this_ptr, int8_t val) { LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - UnsignedChannelUpdate_set_flags(&this_ptr_conv, val); + UnsignedChannelUpdate_set_channel_flags(&this_ptr_conv, val); } int16_t CS_LDK_UnsignedChannelUpdate_get_cltv_expiry_delta(int64_t this_ptr) { @@ -54392,7 +56722,7 @@ void CS_LDK_UnsignedChannelUpdate_set_excess_data(int64_t this_ptr, int8_tArray UnsignedChannelUpdate_set_excess_data(&this_ptr_conv, val_ref); } -int64_t CS_LDK_UnsignedChannelUpdate_new(int8_tArray chain_hash_arg, int64_t short_channel_id_arg, int32_t timestamp_arg, int8_t flags_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg, int32_t fee_base_msat_arg, int32_t fee_proportional_millionths_arg, int8_tArray excess_data_arg) { +int64_t CS_LDK_UnsignedChannelUpdate_new(int8_tArray chain_hash_arg, int64_t short_channel_id_arg, int32_t timestamp_arg, int8_t message_flags_arg, int8_t channel_flags_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg, int32_t fee_base_msat_arg, int32_t fee_proportional_millionths_arg, int8_tArray excess_data_arg) { LDKThirtyTwoBytes chain_hash_arg_ref; CHECK(chain_hash_arg->arr_len == 32); memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg); @@ -54400,7 +56730,7 @@ int64_t CS_LDK_UnsignedChannelUpdate_new(int8_tArray chain_hash_arg, int64_t sh excess_data_arg_ref.datalen = excess_data_arg->arr_len; excess_data_arg_ref.data = MALLOC(excess_data_arg_ref.datalen, "LDKCVec_u8Z Bytes"); memcpy(excess_data_arg_ref.data, excess_data_arg->elems, excess_data_arg_ref.datalen); FREE(excess_data_arg); - LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_new(chain_hash_arg_ref, short_channel_id_arg, timestamp_arg, flags_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, fee_base_msat_arg, fee_proportional_millionths_arg, excess_data_arg_ref); + LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_new(chain_hash_arg_ref, short_channel_id_arg, timestamp_arg, message_flags_arg, channel_flags_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, fee_base_msat_arg, fee_proportional_millionths_arg, excess_data_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -56440,25 +58770,25 @@ int64_t CS_LDK_Stfu_read(int8_tArray ser) { return tag_ptr(ret_conv, true); } -int8_tArray CS_LDK_Splice_write(int64_t obj) { - LDKSplice obj_conv; +int8_tArray CS_LDK_SpliceInit_write(int64_t obj) { + LDKSpliceInit 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 = Splice_write(&obj_conv); + LDKCVec_u8Z ret_var = SpliceInit_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_Splice_read(int8_tArray ser) { +int64_t CS_LDK_SpliceInit_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_SpliceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceDecodeErrorZ), "LDKCResult_SpliceDecodeErrorZ"); - *ret_conv = Splice_read(ser_ref); + LDKCResult_SpliceInitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceInitDecodeErrorZ), "LDKCResult_SpliceInitDecodeErrorZ"); + *ret_conv = SpliceInit_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } @@ -56808,6 +59138,29 @@ int64_t CS_LDK_ClosingSignedFeeRange_read(int8_tArray ser) { return tag_ptr(ret_conv, true); } +int8_tArray CS_LDK_CommitmentSignedBatch_write(int64_t obj) { + LDKCommitmentSignedBatch 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 = CommitmentSignedBatch_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_CommitmentSignedBatch_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_CommitmentSignedBatchDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedBatchDecodeErrorZ), "LDKCResult_CommitmentSignedBatchDecodeErrorZ"); + *ret_conv = CommitmentSignedBatch_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + int8_tArray CS_LDK_CommitmentSigned_write(int64_t obj) { LDKCommitmentSigned obj_conv; obj_conv.inner = untag_ptr(obj); @@ -57579,17 +59932,6 @@ int64_t CS_LDK_IgnoringMessageHandler_new() { return ret_ref; } -int64_t CS_LDK_IgnoringMessageHandler_as_EventsProvider(int64_t this_arg) { - LDKIgnoringMessageHandler this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); - *ret_ret = IgnoringMessageHandler_as_EventsProvider(&this_arg_conv); - return tag_ptr(ret_ret, true); -} - int64_t CS_LDK_IgnoringMessageHandler_as_MessageSendEventsProvider(int64_t this_arg) { LDKIgnoringMessageHandler this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -57634,6 +59976,17 @@ int64_t CS_LDK_IgnoringMessageHandler_as_OffersMessageHandler(int64_t this_arg) return tag_ptr(ret_ret, true); } +int64_t CS_LDK_IgnoringMessageHandler_as_AsyncPaymentsMessageHandler(int64_t this_arg) { + LDKIgnoringMessageHandler this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKAsyncPaymentsMessageHandler* ret_ret = MALLOC(sizeof(LDKAsyncPaymentsMessageHandler), "LDKAsyncPaymentsMessageHandler"); + *ret_ret = IgnoringMessageHandler_as_AsyncPaymentsMessageHandler(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + int64_t CS_LDK_IgnoringMessageHandler_as_CustomOnionMessageHandler(int64_t this_arg) { LDKIgnoringMessageHandler this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -57997,6 +60350,7 @@ int64_t CS_LDK_PeerDetails_new(int8_tArray counterparty_node_id_arg, int64_t so 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); + socket_address_arg_conv = COption_SocketAddressZ_clone((LDKCOption_SocketAddressZ*)untag_ptr(socket_address_arg)); 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); @@ -58164,6 +60518,7 @@ int64_t CS_LDK_PeerManager_new_outbound_connection(int64_t this_arg, int8_tArra void* remote_network_address_ptr = untag_ptr(remote_network_address); CHECK_ACCESS(remote_network_address_ptr); LDKCOption_SocketAddressZ remote_network_address_conv = *(LDKCOption_SocketAddressZ*)(remote_network_address_ptr); + remote_network_address_conv = COption_SocketAddressZ_clone((LDKCOption_SocketAddressZ*)untag_ptr(remote_network_address)); LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); *ret_conv = PeerManager_new_outbound_connection(&this_arg_conv, their_node_id_ref, descriptor_conv, remote_network_address_conv); return tag_ptr(ret_conv, true); @@ -58185,6 +60540,7 @@ int64_t CS_LDK_PeerManager_new_inbound_connection(int64_t this_arg, int64_t des void* remote_network_address_ptr = untag_ptr(remote_network_address); CHECK_ACCESS(remote_network_address_ptr); LDKCOption_SocketAddressZ remote_network_address_conv = *(LDKCOption_SocketAddressZ*)(remote_network_address_ptr); + remote_network_address_conv = COption_SocketAddressZ_clone((LDKCOption_SocketAddressZ*)untag_ptr(remote_network_address)); LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); *ret_conv = PeerManager_new_inbound_connection(&this_arg_conv, descriptor_conv, remote_network_address_conv); return tag_ptr(ret_conv, true); @@ -58297,6 +60653,7 @@ void CS_LDK_PeerManager_broadcast_node_announcement(int64_t this_arg, int8_tArr void* addresses_conv_15_ptr = untag_ptr(addresses_conv_15); CHECK_ACCESS(addresses_conv_15_ptr); LDKSocketAddress addresses_conv_15_conv = *(LDKSocketAddress*)(addresses_conv_15_ptr); + addresses_conv_15_conv = SocketAddress_clone((LDKSocketAddress*)untag_ptr(addresses_conv_15)); addresses_constr.data[p] = addresses_conv_15_conv; } FREE(addresses); @@ -59274,6 +61631,16 @@ jboolean CS_LDK_HTLCOutputInCommitment_eq(int64_t a, int64_t b) { return ret_conv; } +int64_t CS_LDK_HTLCOutputInCommitment_to_bitcoin_amount(int64_t this_arg) { + LDKHTLCOutputInCommitment this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int64_t ret_conv = HTLCOutputInCommitment_to_bitcoin_amount(&this_arg_conv); + return ret_conv; +} + int8_tArray CS_LDK_HTLCOutputInCommitment_write(int64_t obj) { LDKHTLCOutputInCommitment obj_conv; obj_conv.inner = untag_ptr(obj); @@ -60780,7752 +63147,8407 @@ int64_t CS_LDK_get_commitment_transaction_number_obscure_factor(int8_tArray bro return ret_conv; } -jboolean CS_LDK_InitFeatures_eq(int64_t a, int64_t b) { - LDKInitFeatures a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKInitFeatures b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = InitFeatures_eq(&a_conv, &b_conv); - return ret_conv; +int8_tArray CS_LDK_InitFeatures_write(int64_t obj) { + LDKInitFeatures obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = InitFeatures_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -jboolean CS_LDK_NodeFeatures_eq(int64_t a, int64_t b) { - LDKNodeFeatures a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKNodeFeatures b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_eq(&a_conv, &b_conv); - return ret_conv; +int64_t CS_LDK_InitFeatures_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); + *ret_conv = InitFeatures_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_ChannelFeatures_eq(int64_t a, int64_t b) { - LDKChannelFeatures a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKChannelFeatures b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = ChannelFeatures_eq(&a_conv, &b_conv); - return ret_conv; +int8_tArray CS_LDK_ChannelFeatures_write(int64_t obj) { + LDKChannelFeatures obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ChannelFeatures_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -jboolean CS_LDK_Bolt11InvoiceFeatures_eq(int64_t a, int64_t b) { - LDKBolt11InvoiceFeatures a_conv; - 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; - LDKBolt11InvoiceFeatures 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 = Bolt11InvoiceFeatures_eq(&a_conv, &b_conv); - return ret_conv; +int64_t CS_LDK_ChannelFeatures_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); + *ret_conv = ChannelFeatures_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_OfferFeatures_eq(int64_t a, int64_t b) { - LDKOfferFeatures a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKOfferFeatures b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = OfferFeatures_eq(&a_conv, &b_conv); - return ret_conv; +int8_tArray CS_LDK_NodeFeatures_write(int64_t obj) { + LDKNodeFeatures obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = NodeFeatures_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -jboolean CS_LDK_InvoiceRequestFeatures_eq(int64_t a, int64_t b) { - LDKInvoiceRequestFeatures a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKInvoiceRequestFeatures b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = InvoiceRequestFeatures_eq(&a_conv, &b_conv); - return ret_conv; +int64_t CS_LDK_NodeFeatures_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); + *ret_conv = NodeFeatures_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_Bolt12InvoiceFeatures_eq(int64_t a, int64_t b) { - LDKBolt12InvoiceFeatures a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKBolt12InvoiceFeatures b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = Bolt12InvoiceFeatures_eq(&a_conv, &b_conv); - return ret_conv; +int8_tArray CS_LDK_Bolt11InvoiceFeatures_write(int64_t obj) { + LDKBolt11InvoiceFeatures 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 = Bolt11InvoiceFeatures_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -jboolean CS_LDK_BlindedHopFeatures_eq(int64_t a, int64_t b) { - LDKBlindedHopFeatures a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKBlindedHopFeatures b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = BlindedHopFeatures_eq(&a_conv, &b_conv); - return ret_conv; +int64_t CS_LDK_Bolt11InvoiceFeatures_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ"); + *ret_conv = Bolt11InvoiceFeatures_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_ChannelTypeFeatures_eq(int64_t a, int64_t b) { - LDKChannelTypeFeatures a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKChannelTypeFeatures b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_eq(&a_conv, &b_conv); - return ret_conv; +int8_tArray CS_LDK_Bolt12InvoiceFeatures_write(int64_t obj) { + LDKBolt12InvoiceFeatures 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 = Bolt12InvoiceFeatures_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -static inline uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg) { - LDKInitFeatures ret_var = InitFeatures_clone(arg); +int64_t CS_LDK_Bolt12InvoiceFeatures_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ"); + *ret_conv = Bolt12InvoiceFeatures_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray CS_LDK_BlindedHopFeatures_write(int64_t obj) { + LDKBlindedHopFeatures obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = BlindedHopFeatures_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_BlindedHopFeatures_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ"); + *ret_conv = BlindedHopFeatures_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray CS_LDK_ChannelTypeFeatures_write(int64_t obj) { + LDKChannelTypeFeatures obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ChannelTypeFeatures_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_ChannelTypeFeatures_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); + *ret_conv = ChannelTypeFeatures_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_ShutdownScript_free(int64_t this_obj) { + LDKShutdownScript this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ShutdownScript_free(this_obj_conv); +} + +static inline uint64_t ShutdownScript_clone_ptr(LDKShutdownScript *NONNULL_PTR arg) { + LDKShutdownScript ret_var = ShutdownScript_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_InitFeatures_clone_ptr(int64_t arg) { - LDKInitFeatures arg_conv; +int64_t CS_LDK_ShutdownScript_clone_ptr(int64_t arg) { + LDKShutdownScript arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = InitFeatures_clone_ptr(&arg_conv); + int64_t ret_conv = ShutdownScript_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_InitFeatures_clone(int64_t orig) { - LDKInitFeatures orig_conv; +int64_t CS_LDK_ShutdownScript_clone(int64_t orig) { + LDKShutdownScript orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKInitFeatures ret_var = InitFeatures_clone(&orig_conv); + LDKShutdownScript ret_var = ShutdownScript_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; } -static inline uint64_t NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg) { - LDKNodeFeatures ret_var = NodeFeatures_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_NodeFeatures_clone_ptr(int64_t arg) { - LDKNodeFeatures arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = NodeFeatures_clone_ptr(&arg_conv); +jboolean CS_LDK_ShutdownScript_eq(int64_t a, int64_t b) { + LDKShutdownScript a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKShutdownScript b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ShutdownScript_eq(&a_conv, &b_conv); return ret_conv; } -int64_t CS_LDK_NodeFeatures_clone(int64_t orig) { - LDKNodeFeatures orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKNodeFeatures ret_var = NodeFeatures_clone(&orig_conv); +void CS_LDK_InvalidShutdownScript_free(int64_t this_obj) { + LDKInvalidShutdownScript this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InvalidShutdownScript_free(this_obj_conv); +} + +int8_tArray CS_LDK_InvalidShutdownScript_get_script(int64_t this_ptr) { + LDKInvalidShutdownScript this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u8Z ret_var = InvalidShutdownScript_get_script(&this_ptr_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +void CS_LDK_InvalidShutdownScript_set_script(int64_t this_ptr, int8_tArray val) { + LDKInvalidShutdownScript this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u8Z val_ref; + val_ref.datalen = val->arr_len; + val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val); + InvalidShutdownScript_set_script(&this_ptr_conv, val_ref); +} + +int64_t CS_LDK_InvalidShutdownScript_new(int8_tArray script_arg) { + LDKCVec_u8Z script_arg_ref; + script_arg_ref.datalen = script_arg->arr_len; + script_arg_ref.data = MALLOC(script_arg_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(script_arg_ref.data, script_arg->elems, script_arg_ref.datalen); FREE(script_arg); + LDKInvalidShutdownScript ret_var = InvalidShutdownScript_new(script_arg_ref); int64_t ret_ref = 0; 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 ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg) { - LDKChannelFeatures ret_var = ChannelFeatures_clone(arg); +static inline uint64_t InvalidShutdownScript_clone_ptr(LDKInvalidShutdownScript *NONNULL_PTR arg) { + LDKInvalidShutdownScript ret_var = InvalidShutdownScript_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_ChannelFeatures_clone_ptr(int64_t arg) { - LDKChannelFeatures arg_conv; +int64_t CS_LDK_InvalidShutdownScript_clone_ptr(int64_t arg) { + LDKInvalidShutdownScript arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = ChannelFeatures_clone_ptr(&arg_conv); + int64_t ret_conv = InvalidShutdownScript_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_ChannelFeatures_clone(int64_t orig) { - LDKChannelFeatures orig_conv; +int64_t CS_LDK_InvalidShutdownScript_clone(int64_t orig) { + LDKInvalidShutdownScript orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKChannelFeatures ret_var = ChannelFeatures_clone(&orig_conv); + LDKInvalidShutdownScript ret_var = InvalidShutdownScript_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; } -static inline uint64_t Bolt11InvoiceFeatures_clone_ptr(LDKBolt11InvoiceFeatures *NONNULL_PTR arg) { - LDKBolt11InvoiceFeatures ret_var = Bolt11InvoiceFeatures_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; +int8_tArray CS_LDK_ShutdownScript_write(int64_t obj) { + LDKShutdownScript obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ShutdownScript_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -int64_t CS_LDK_Bolt11InvoiceFeatures_clone_ptr(int64_t arg) { - LDKBolt11InvoiceFeatures 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 = Bolt11InvoiceFeatures_clone_ptr(&arg_conv); - return ret_conv; + +int64_t CS_LDK_ShutdownScript_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); + *ret_conv = ShutdownScript_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_Bolt11InvoiceFeatures_clone(int64_t orig) { - LDKBolt11InvoiceFeatures 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; - LDKBolt11InvoiceFeatures ret_var = Bolt11InvoiceFeatures_clone(&orig_conv); +int64_t CS_LDK_ShutdownScript_new_p2wpkh(int8_tArray pubkey_hash) { + uint8_t pubkey_hash_arr[20]; + CHECK(pubkey_hash->arr_len == 20); + memcpy(pubkey_hash_arr, pubkey_hash->elems, 20); FREE(pubkey_hash); + uint8_t (*pubkey_hash_ref)[20] = &pubkey_hash_arr; + LDKShutdownScript ret_var = ShutdownScript_new_p2wpkh(pubkey_hash_ref); int64_t ret_ref = 0; 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 OfferFeatures_clone_ptr(LDKOfferFeatures *NONNULL_PTR arg) { - LDKOfferFeatures ret_var = OfferFeatures_clone(arg); +int64_t CS_LDK_ShutdownScript_new_p2wsh(int8_tArray script_hash) { + uint8_t script_hash_arr[32]; + CHECK(script_hash->arr_len == 32); + memcpy(script_hash_arr, script_hash->elems, 32); FREE(script_hash); + uint8_t (*script_hash_ref)[32] = &script_hash_arr; + LDKShutdownScript ret_var = ShutdownScript_new_p2wsh(script_hash_ref); int64_t ret_ref = 0; 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_OfferFeatures_clone_ptr(int64_t arg) { - LDKOfferFeatures arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = OfferFeatures_clone_ptr(&arg_conv); + +int64_t CS_LDK_ShutdownScript_new_witness_program(int64_t witness_program) { + void* witness_program_ptr = untag_ptr(witness_program); + CHECK_ACCESS(witness_program_ptr); + LDKWitnessProgram witness_program_conv = *(LDKWitnessProgram*)(witness_program_ptr); + witness_program_conv = WitnessProgram_clone((LDKWitnessProgram*)untag_ptr(witness_program)); + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); + *ret_conv = ShutdownScript_new_witness_program(witness_program_conv); + return tag_ptr(ret_conv, true); +} + +int8_tArray CS_LDK_ShutdownScript_into_inner(int64_t this_arg) { + LDKShutdownScript this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = ShutdownScript_clone(&this_arg_conv); + LDKCVec_u8Z ret_var = ShutdownScript_into_inner(this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int8_tArray CS_LDK_ShutdownScript_as_legacy_pubkey(int64_t this_arg) { + LDKShutdownScript this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, ShutdownScript_as_legacy_pubkey(&this_arg_conv).compressed_form, 33); + return ret_arr; +} + +jboolean CS_LDK_ShutdownScript_is_compatible(int64_t this_arg, int64_t features) { + LDKShutdownScript this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKInitFeatures features_conv; + features_conv.inner = untag_ptr(features); + features_conv.is_owned = ptr_is_owned(features); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); + features_conv.is_owned = false; + jboolean ret_conv = ShutdownScript_is_compatible(&this_arg_conv, &features_conv); return ret_conv; } -int64_t CS_LDK_OfferFeatures_clone(int64_t orig) { - LDKOfferFeatures orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKOfferFeatures ret_var = OfferFeatures_clone(&orig_conv); +jstring CS_LDK_ShutdownScript_to_str(int64_t o) { + LDKShutdownScript o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = ShutdownScript_to_str(&o_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + 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 InvoiceRequestFeatures_clone_ptr(LDKInvoiceRequestFeatures *NONNULL_PTR arg) { - LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_clone(arg); +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_InvoiceRequestFeatures_clone_ptr(int64_t arg) { - LDKInvoiceRequestFeatures arg_conv; +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 = InvoiceRequestFeatures_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelId_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_InvoiceRequestFeatures_clone(int64_t orig) { - LDKInvoiceRequestFeatures orig_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; - LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_clone(&orig_conv); + 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; } -static inline uint64_t Bolt12InvoiceFeatures_clone_ptr(LDKBolt12InvoiceFeatures *NONNULL_PTR arg) { - LDKBolt12InvoiceFeatures ret_var = Bolt12InvoiceFeatures_clone(arg); +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_Bolt12InvoiceFeatures_clone_ptr(int64_t arg) { - LDKBolt12InvoiceFeatures arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = Bolt12InvoiceFeatures_clone_ptr(&arg_conv); - return ret_conv; -} -int64_t CS_LDK_Bolt12InvoiceFeatures_clone(int64_t orig) { - LDKBolt12InvoiceFeatures orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKBolt12InvoiceFeatures ret_var = Bolt12InvoiceFeatures_clone(&orig_conv); +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; } -static inline uint64_t BlindedHopFeatures_clone_ptr(LDKBlindedHopFeatures *NONNULL_PTR arg) { - LDKBlindedHopFeatures ret_var = BlindedHopFeatures_clone(arg); +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_BlindedHopFeatures_clone_ptr(int64_t arg) { - LDKBlindedHopFeatures arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = BlindedHopFeatures_clone_ptr(&arg_conv); - return ret_conv; -} -int64_t CS_LDK_BlindedHopFeatures_clone(int64_t orig) { - LDKBlindedHopFeatures orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKBlindedHopFeatures ret_var = BlindedHopFeatures_clone(&orig_conv); +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; } -static inline uint64_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg) { - LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(arg); +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; } -int64_t CS_LDK_ChannelTypeFeatures_clone_ptr(int64_t arg) { - LDKChannelTypeFeatures arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = ChannelTypeFeatures_clone_ptr(&arg_conv); + +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_ChannelTypeFeatures_clone(int64_t orig) { - LDKChannelTypeFeatures orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(&orig_conv); +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_InitFeatures_hash(int64_t o) { - LDKInitFeatures o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = InitFeatures_hash(&o_conv); - return ret_conv; +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; } -int64_t CS_LDK_NodeFeatures_hash(int64_t o) { - LDKNodeFeatures o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = NodeFeatures_hash(&o_conv); - return ret_conv; +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_ChannelFeatures_hash(int64_t o) { - LDKChannelFeatures o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = ChannelFeatures_hash(&o_conv); - return ret_conv; +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); } -int64_t CS_LDK_Bolt11InvoiceFeatures_hash(int64_t o) { - LDKBolt11InvoiceFeatures o_conv; +jstring CS_LDK_ChannelId_to_str(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 = Bolt11InvoiceFeatures_hash(&o_conv); + LDKStr ret_str = ChannelId_to_str(&o_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); return ret_conv; } -int64_t CS_LDK_OfferFeatures_hash(int64_t o) { - LDKOfferFeatures o_conv; - 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 = OfferFeatures_hash(&o_conv); - return ret_conv; +int64_t CS_LDK_create_phantom_invoice(int64_t amt_msat, int64_t payment_hash, jstring description, int32_t invoice_expiry_delta_secs, int64_tArray phantom_route_hints, int64_t entropy_source, int64_t node_signer, int64_t logger, int32_t network, int64_t min_final_cltv_expiry_delta, int64_t duration_since_epoch) { + void* amt_msat_ptr = untag_ptr(amt_msat); + CHECK_ACCESS(amt_msat_ptr); + LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); + amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); + void* payment_hash_ptr = untag_ptr(payment_hash); + CHECK_ACCESS(payment_hash_ptr); + LDKCOption_ThirtyTwoBytesZ payment_hash_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_ptr); + payment_hash_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash)); + LDKStr description_conv = str_ref_to_owned_c(description); + LDKCVec_PhantomRouteHintsZ phantom_route_hints_constr; + phantom_route_hints_constr.datalen = phantom_route_hints->arr_len; + if (phantom_route_hints_constr.datalen > 0) + phantom_route_hints_constr.data = MALLOC(phantom_route_hints_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements"); + else + phantom_route_hints_constr.data = NULL; + int64_t* phantom_route_hints_vals = phantom_route_hints->elems; + for (size_t t = 0; t < phantom_route_hints_constr.datalen; t++) { + int64_t phantom_route_hints_conv_19 = phantom_route_hints_vals[t]; + LDKPhantomRouteHints phantom_route_hints_conv_19_conv; + phantom_route_hints_conv_19_conv.inner = untag_ptr(phantom_route_hints_conv_19); + phantom_route_hints_conv_19_conv.is_owned = ptr_is_owned(phantom_route_hints_conv_19); + CHECK_INNER_FIELD_ACCESS_OR_NULL(phantom_route_hints_conv_19_conv); + phantom_route_hints_conv_19_conv = PhantomRouteHints_clone(&phantom_route_hints_conv_19_conv); + phantom_route_hints_constr.data[t] = phantom_route_hints_conv_19_conv; + } + FREE(phantom_route_hints); + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKCurrency network_conv = LDKCurrency_from_cs(network); + void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); + CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); + LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); + min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = create_phantom_invoice(amt_msat_conv, payment_hash_conv, description_conv, invoice_expiry_delta_secs, phantom_route_hints_constr, entropy_source_conv, node_signer_conv, logger_conv, network_conv, min_final_cltv_expiry_delta_conv, duration_since_epoch); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_InvoiceRequestFeatures_hash(int64_t o) { - LDKInvoiceRequestFeatures o_conv; - 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 = InvoiceRequestFeatures_hash(&o_conv); - return ret_conv; +int64_t CS_LDK_create_phantom_invoice_with_description_hash(int64_t amt_msat, int64_t payment_hash, int32_t invoice_expiry_delta_secs, int64_t description_hash, int64_tArray phantom_route_hints, int64_t entropy_source, int64_t node_signer, int64_t logger, int32_t network, int64_t min_final_cltv_expiry_delta, int64_t duration_since_epoch) { + void* amt_msat_ptr = untag_ptr(amt_msat); + CHECK_ACCESS(amt_msat_ptr); + LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); + amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); + void* payment_hash_ptr = untag_ptr(payment_hash); + CHECK_ACCESS(payment_hash_ptr); + LDKCOption_ThirtyTwoBytesZ payment_hash_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_ptr); + payment_hash_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash)); + LDKSha256 description_hash_conv; + description_hash_conv.inner = untag_ptr(description_hash); + description_hash_conv.is_owned = ptr_is_owned(description_hash); + CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv); + description_hash_conv = Sha256_clone(&description_hash_conv); + LDKCVec_PhantomRouteHintsZ phantom_route_hints_constr; + phantom_route_hints_constr.datalen = phantom_route_hints->arr_len; + if (phantom_route_hints_constr.datalen > 0) + phantom_route_hints_constr.data = MALLOC(phantom_route_hints_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements"); + else + phantom_route_hints_constr.data = NULL; + int64_t* phantom_route_hints_vals = phantom_route_hints->elems; + for (size_t t = 0; t < phantom_route_hints_constr.datalen; t++) { + int64_t phantom_route_hints_conv_19 = phantom_route_hints_vals[t]; + LDKPhantomRouteHints phantom_route_hints_conv_19_conv; + phantom_route_hints_conv_19_conv.inner = untag_ptr(phantom_route_hints_conv_19); + phantom_route_hints_conv_19_conv.is_owned = ptr_is_owned(phantom_route_hints_conv_19); + CHECK_INNER_FIELD_ACCESS_OR_NULL(phantom_route_hints_conv_19_conv); + phantom_route_hints_conv_19_conv = PhantomRouteHints_clone(&phantom_route_hints_conv_19_conv); + phantom_route_hints_constr.data[t] = phantom_route_hints_conv_19_conv; + } + FREE(phantom_route_hints); + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKCurrency network_conv = LDKCurrency_from_cs(network); + void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); + CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); + LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); + min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = create_phantom_invoice_with_description_hash(amt_msat_conv, payment_hash_conv, invoice_expiry_delta_secs, description_hash_conv, phantom_route_hints_constr, entropy_source_conv, node_signer_conv, logger_conv, network_conv, min_final_cltv_expiry_delta_conv, duration_since_epoch); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_Bolt12InvoiceFeatures_hash(int64_t o) { - LDKBolt12InvoiceFeatures o_conv; - 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 = Bolt12InvoiceFeatures_hash(&o_conv); - return ret_conv; +int64_t CS_LDK_create_invoice_from_channelmanager(int64_t channelmanager, int64_t node_signer, int64_t logger, int32_t network, int64_t amt_msat, jstring description, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { + LDKChannelManager channelmanager_conv; + channelmanager_conv.inner = untag_ptr(channelmanager); + channelmanager_conv.is_owned = ptr_is_owned(channelmanager); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); + channelmanager_conv.is_owned = false; + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKCurrency network_conv = LDKCurrency_from_cs(network); + void* amt_msat_ptr = untag_ptr(amt_msat); + CHECK_ACCESS(amt_msat_ptr); + LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); + amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); + LDKStr description_conv = str_ref_to_owned_c(description); + void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); + CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); + LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); + min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = create_invoice_from_channelmanager(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_conv, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_BlindedHopFeatures_hash(int64_t o) { - LDKBlindedHopFeatures o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = BlindedHopFeatures_hash(&o_conv); - return ret_conv; +int64_t CS_LDK_create_invoice_from_channelmanager_with_description_hash(int64_t channelmanager, int64_t node_signer, int64_t logger, int32_t network, int64_t amt_msat, int64_t description_hash, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { + LDKChannelManager channelmanager_conv; + channelmanager_conv.inner = untag_ptr(channelmanager); + channelmanager_conv.is_owned = ptr_is_owned(channelmanager); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); + channelmanager_conv.is_owned = false; + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKCurrency network_conv = LDKCurrency_from_cs(network); + void* amt_msat_ptr = untag_ptr(amt_msat); + CHECK_ACCESS(amt_msat_ptr); + LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); + amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); + LDKSha256 description_hash_conv; + description_hash_conv.inner = untag_ptr(description_hash); + description_hash_conv.is_owned = ptr_is_owned(description_hash); + CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv); + description_hash_conv = Sha256_clone(&description_hash_conv); + void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); + CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); + LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); + min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = create_invoice_from_channelmanager_with_description_hash(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_hash_conv, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelTypeFeatures_hash(int64_t o) { - LDKChannelTypeFeatures o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = ChannelTypeFeatures_hash(&o_conv); - return ret_conv; +int64_t CS_LDK_create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(int64_t channelmanager, int64_t node_signer, int64_t logger, int32_t network, int64_t amt_msat, int64_t description_hash, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { + LDKChannelManager channelmanager_conv; + channelmanager_conv.inner = untag_ptr(channelmanager); + channelmanager_conv.is_owned = ptr_is_owned(channelmanager); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); + channelmanager_conv.is_owned = false; + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKCurrency network_conv = LDKCurrency_from_cs(network); + void* amt_msat_ptr = untag_ptr(amt_msat); + CHECK_ACCESS(amt_msat_ptr); + LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); + amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); + LDKSha256 description_hash_conv; + description_hash_conv.inner = untag_ptr(description_hash); + description_hash_conv.is_owned = ptr_is_owned(description_hash); + CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv); + description_hash_conv = Sha256_clone(&description_hash_conv); + void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); + CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); + LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); + min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_hash_conv, duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); + return tag_ptr(ret_conv, true); } -void CS_LDK_InitFeatures_free(int64_t this_obj) { - LDKInitFeatures this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InitFeatures_free(this_obj_conv); +int64_t CS_LDK_create_invoice_from_channelmanager_and_duration_since_epoch(int64_t channelmanager, int64_t node_signer, int64_t logger, int32_t network, int64_t amt_msat, jstring description, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { + LDKChannelManager channelmanager_conv; + channelmanager_conv.inner = untag_ptr(channelmanager); + channelmanager_conv.is_owned = ptr_is_owned(channelmanager); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); + channelmanager_conv.is_owned = false; + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKCurrency network_conv = LDKCurrency_from_cs(network); + void* amt_msat_ptr = untag_ptr(amt_msat); + CHECK_ACCESS(amt_msat_ptr); + LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); + amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); + LDKStr description_conv = str_ref_to_owned_c(description); + void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); + CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); + LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); + min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = create_invoice_from_channelmanager_and_duration_since_epoch(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_conv, duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); + return tag_ptr(ret_conv, true); } -void CS_LDK_NodeFeatures_free(int64_t this_obj) { - LDKNodeFeatures this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - NodeFeatures_free(this_obj_conv); +int64_t CS_LDK_create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(int64_t channelmanager, int64_t node_signer, int64_t logger, int32_t network, int64_t amt_msat, jstring description, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs, int8_tArray payment_hash, int64_t min_final_cltv_expiry_delta) { + LDKChannelManager channelmanager_conv; + channelmanager_conv.inner = untag_ptr(channelmanager); + channelmanager_conv.is_owned = ptr_is_owned(channelmanager); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); + channelmanager_conv.is_owned = false; + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKCurrency network_conv = LDKCurrency_from_cs(network); + void* amt_msat_ptr = untag_ptr(amt_msat); + CHECK_ACCESS(amt_msat_ptr); + LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); + amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); + LDKStr description_conv = str_ref_to_owned_c(description); + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); + CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); + LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); + min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_conv, duration_since_epoch, invoice_expiry_delta_secs, payment_hash_ref, min_final_cltv_expiry_delta_conv); + return tag_ptr(ret_conv, true); } -void CS_LDK_ChannelFeatures_free(int64_t this_obj) { - LDKChannelFeatures this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelFeatures_free(this_obj_conv); +int64_t CS_LDK_payment_parameters_from_zero_amount_invoice(int64_t invoice, int64_t amount_msat) { + LDKBolt11Invoice invoice_conv; + invoice_conv.inner = untag_ptr(invoice); + invoice_conv.is_owned = ptr_is_owned(invoice); + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); + invoice_conv.is_owned = false; + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); + *ret_conv = payment_parameters_from_zero_amount_invoice(&invoice_conv, amount_msat); + return tag_ptr(ret_conv, true); } -void CS_LDK_Bolt11InvoiceFeatures_free(int64_t this_obj) { - LDKBolt11InvoiceFeatures this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Bolt11InvoiceFeatures_free(this_obj_conv); +int64_t CS_LDK_payment_parameters_from_invoice(int64_t invoice) { + LDKBolt11Invoice invoice_conv; + invoice_conv.inner = untag_ptr(invoice); + invoice_conv.is_owned = ptr_is_owned(invoice); + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); + invoice_conv.is_owned = false; + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); + *ret_conv = payment_parameters_from_invoice(&invoice_conv); + return tag_ptr(ret_conv, true); } -void CS_LDK_OfferFeatures_free(int64_t this_obj) { - LDKOfferFeatures this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - OfferFeatures_free(this_obj_conv); +void CS_LDK_Retry_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); + LDKRetry this_ptr_conv = *(LDKRetry*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Retry_free(this_ptr_conv); } -void CS_LDK_InvoiceRequestFeatures_free(int64_t this_obj) { - LDKInvoiceRequestFeatures this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InvoiceRequestFeatures_free(this_obj_conv); +static inline uint64_t Retry_clone_ptr(LDKRetry *NONNULL_PTR arg) { + LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); + *ret_copy = Retry_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } - -void CS_LDK_Bolt12InvoiceFeatures_free(int64_t this_obj) { - LDKBolt12InvoiceFeatures this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Bolt12InvoiceFeatures_free(this_obj_conv); +int64_t CS_LDK_Retry_clone_ptr(int64_t arg) { + LDKRetry* arg_conv = (LDKRetry*)untag_ptr(arg); + int64_t ret_conv = Retry_clone_ptr(arg_conv); + return ret_conv; } -void CS_LDK_BlindedHopFeatures_free(int64_t this_obj) { - LDKBlindedHopFeatures this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BlindedHopFeatures_free(this_obj_conv); +int64_t CS_LDK_Retry_clone(int64_t orig) { + LDKRetry* orig_conv = (LDKRetry*)untag_ptr(orig); + LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); + *ret_copy = Retry_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_ChannelTypeFeatures_free(int64_t this_obj) { - LDKChannelTypeFeatures this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelTypeFeatures_free(this_obj_conv); +int64_t CS_LDK_Retry_attempts(int32_t a) { + LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); + *ret_copy = Retry_attempts(a); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_InitFeatures_empty() { - LDKInitFeatures ret_var = InitFeatures_empty(); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +int64_t CS_LDK_Retry_timeout(int64_t a) { + LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); + *ret_copy = Retry_timeout(a); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -jboolean CS_LDK_InitFeatures_requires_unknown_bits_from(int64_t this_arg, int64_t other) { - 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; - LDKInitFeatures other_conv; - other_conv.inner = untag_ptr(other); - other_conv.is_owned = ptr_is_owned(other); - CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); - other_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); +jboolean CS_LDK_Retry_eq(int64_t a, int64_t b) { + LDKRetry* a_conv = (LDKRetry*)untag_ptr(a); + LDKRetry* b_conv = (LDKRetry*)untag_ptr(b); + jboolean ret_conv = Retry_eq(a_conv, b_conv); return ret_conv; } -jboolean CS_LDK_InitFeatures_requires_unknown_bits(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_unknown_bits(&this_arg_conv); +int64_t CS_LDK_Retry_hash(int64_t o) { + LDKRetry* o_conv = (LDKRetry*)untag_ptr(o); + int64_t ret_conv = Retry_hash(o_conv); return ret_conv; } -int64_t CS_LDK_InitFeatures_set_required_feature_bit(int64_t this_arg, int64_t bit) { - 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; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = InitFeatures_set_required_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_InitFeatures_set_optional_feature_bit(int64_t this_arg, int64_t bit) { - 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; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = InitFeatures_set_optional_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +int8_tArray CS_LDK_Retry_write(int64_t obj) { + LDKRetry* obj_conv = (LDKRetry*)untag_ptr(obj); + LDKCVec_u8Z ret_var = Retry_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_InitFeatures_set_required_custom_bit(int64_t this_arg, int64_t bit) { - 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; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = InitFeatures_set_required_custom_bit(&this_arg_conv, bit); +int64_t CS_LDK_Retry_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_RetryDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RetryDecodeErrorZ), "LDKCResult_RetryDecodeErrorZ"); + *ret_conv = Retry_read(ser_ref); + FREE(ser); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_InitFeatures_set_optional_custom_bit(int64_t this_arg, int64_t bit) { - 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; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = InitFeatures_set_optional_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +int32_t CS_LDK_RetryableSendFailure_clone(int64_t orig) { + LDKRetryableSendFailure* orig_conv = (LDKRetryableSendFailure*)untag_ptr(orig); + int32_t ret_conv = LDKRetryableSendFailure_to_cs(RetryableSendFailure_clone(orig_conv)); + return ret_conv; } -int64_t CS_LDK_NodeFeatures_empty() { - LDKNodeFeatures ret_var = NodeFeatures_empty(); - int64_t ret_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_RetryableSendFailure_payment_expired() { + int32_t ret_conv = LDKRetryableSendFailure_to_cs(RetryableSendFailure_payment_expired()); + return ret_conv; } -jboolean CS_LDK_NodeFeatures_requires_unknown_bits_from(int64_t this_arg, int64_t other) { - 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; - LDKNodeFeatures other_conv; - other_conv.inner = untag_ptr(other); - other_conv.is_owned = ptr_is_owned(other); - CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); - other_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); +int32_t CS_LDK_RetryableSendFailure_route_not_found() { + int32_t ret_conv = LDKRetryableSendFailure_to_cs(RetryableSendFailure_route_not_found()); return ret_conv; } -jboolean CS_LDK_NodeFeatures_requires_unknown_bits(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_unknown_bits(&this_arg_conv); +int32_t CS_LDK_RetryableSendFailure_duplicate_payment() { + int32_t ret_conv = LDKRetryableSendFailure_to_cs(RetryableSendFailure_duplicate_payment()); return ret_conv; } -int64_t CS_LDK_NodeFeatures_set_required_feature_bit(int64_t this_arg, int64_t bit) { - 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; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = NodeFeatures_set_required_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +int32_t CS_LDK_RetryableSendFailure_onion_packet_size_exceeded() { + int32_t ret_conv = LDKRetryableSendFailure_to_cs(RetryableSendFailure_onion_packet_size_exceeded()); + return ret_conv; } -int64_t CS_LDK_NodeFeatures_set_optional_feature_bit(int64_t this_arg, int64_t bit) { - 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; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = NodeFeatures_set_optional_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +jboolean CS_LDK_RetryableSendFailure_eq(int64_t a, int64_t b) { + LDKRetryableSendFailure* a_conv = (LDKRetryableSendFailure*)untag_ptr(a); + LDKRetryableSendFailure* b_conv = (LDKRetryableSendFailure*)untag_ptr(b); + jboolean ret_conv = RetryableSendFailure_eq(a_conv, b_conv); + return ret_conv; } -int64_t CS_LDK_NodeFeatures_set_required_custom_bit(int64_t this_arg, int64_t bit) { - 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; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = NodeFeatures_set_required_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_NodeFeatures_set_optional_custom_bit(int64_t this_arg, int64_t bit) { - 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; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = NodeFeatures_set_optional_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +void CS_LDK_PaymentSendFailure_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); + LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + PaymentSendFailure_free(this_ptr_conv); } -int64_t CS_LDK_ChannelFeatures_empty() { - LDKChannelFeatures ret_var = ChannelFeatures_empty(); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +static inline uint64_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg) { + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } - -jboolean CS_LDK_ChannelFeatures_requires_unknown_bits_from(int64_t this_arg, int64_t other) { - LDKChannelFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelFeatures other_conv; - other_conv.inner = untag_ptr(other); - other_conv.is_owned = ptr_is_owned(other); - CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); - other_conv.is_owned = false; - jboolean ret_conv = ChannelFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); +int64_t CS_LDK_PaymentSendFailure_clone_ptr(int64_t arg) { + LDKPaymentSendFailure* arg_conv = (LDKPaymentSendFailure*)untag_ptr(arg); + int64_t ret_conv = PaymentSendFailure_clone_ptr(arg_conv); return ret_conv; } -jboolean CS_LDK_ChannelFeatures_requires_unknown_bits(int64_t this_arg) { - LDKChannelFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelFeatures_requires_unknown_bits(&this_arg_conv); - return ret_conv; +int64_t CS_LDK_PaymentSendFailure_clone(int64_t orig) { + LDKPaymentSendFailure* orig_conv = (LDKPaymentSendFailure*)untag_ptr(orig); + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_ChannelFeatures_set_required_feature_bit(int64_t this_arg, int64_t bit) { - LDKChannelFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = ChannelFeatures_set_required_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_PaymentSendFailure_parameter_error(int64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKAPIError a_conv = *(LDKAPIError*)(a_ptr); + a_conv = APIError_clone((LDKAPIError*)untag_ptr(a)); + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_parameter_error(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_ChannelFeatures_set_optional_feature_bit(int64_t this_arg, int64_t bit) { - LDKChannelFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = ChannelFeatures_set_optional_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_PaymentSendFailure_path_parameter_error(int64_tArray a) { + LDKCVec_CResult_NoneAPIErrorZZ a_constr; + a_constr.datalen = a->arr_len; + if (a_constr.datalen > 0) + a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements"); + else + a_constr.data = NULL; + int64_t* a_vals = a->elems; + for (size_t w = 0; w < a_constr.datalen; w++) { + int64_t a_conv_22 = a_vals[w]; + void* a_conv_22_ptr = untag_ptr(a_conv_22); + CHECK_ACCESS(a_conv_22_ptr); + LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(a_conv_22_ptr); + a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)untag_ptr(a_conv_22)); + a_constr.data[w] = a_conv_22_conv; + } + FREE(a); + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_path_parameter_error(a_constr); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_ChannelFeatures_set_required_custom_bit(int64_t this_arg, int64_t bit) { - LDKChannelFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = ChannelFeatures_set_required_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_PaymentSendFailure_all_failed_resend_safe(int64_tArray a) { + LDKCVec_APIErrorZ a_constr; + a_constr.datalen = a->arr_len; + if (a_constr.datalen > 0) + a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements"); + else + a_constr.data = NULL; + int64_t* a_vals = a->elems; + for (size_t k = 0; k < a_constr.datalen; k++) { + int64_t a_conv_10 = a_vals[k]; + void* a_conv_10_ptr = untag_ptr(a_conv_10); + CHECK_ACCESS(a_conv_10_ptr); + LDKAPIError a_conv_10_conv = *(LDKAPIError*)(a_conv_10_ptr); + a_conv_10_conv = APIError_clone((LDKAPIError*)untag_ptr(a_conv_10)); + a_constr.data[k] = a_conv_10_conv; + } + FREE(a); + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_all_failed_resend_safe(a_constr); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_ChannelFeatures_set_optional_custom_bit(int64_t this_arg, int64_t bit) { - LDKChannelFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = ChannelFeatures_set_optional_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_PaymentSendFailure_duplicate_payment() { + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_duplicate_payment(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_Bolt11InvoiceFeatures_empty() { - LDKBolt11InvoiceFeatures ret_var = Bolt11InvoiceFeatures_empty(); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +int64_t CS_LDK_PaymentSendFailure_partial_failure(int64_tArray results, int64_t failed_paths_retry, int8_tArray payment_id) { + LDKCVec_CResult_NoneAPIErrorZZ results_constr; + results_constr.datalen = results->arr_len; + if (results_constr.datalen > 0) + results_constr.data = MALLOC(results_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements"); + else + results_constr.data = NULL; + int64_t* results_vals = results->elems; + for (size_t w = 0; w < results_constr.datalen; w++) { + int64_t results_conv_22 = results_vals[w]; + void* results_conv_22_ptr = untag_ptr(results_conv_22); + CHECK_ACCESS(results_conv_22_ptr); + LDKCResult_NoneAPIErrorZ results_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(results_conv_22_ptr); + results_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)untag_ptr(results_conv_22)); + results_constr.data[w] = results_conv_22_conv; + } + FREE(results); + LDKRouteParameters failed_paths_retry_conv; + failed_paths_retry_conv.inner = untag_ptr(failed_paths_retry); + failed_paths_retry_conv.is_owned = ptr_is_owned(failed_paths_retry); + CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_conv); + failed_paths_retry_conv = RouteParameters_clone(&failed_paths_retry_conv); + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_partial_failure(results_constr, failed_paths_retry_conv, payment_id_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -jboolean CS_LDK_Bolt11InvoiceFeatures_requires_unknown_bits_from(int64_t this_arg, int64_t other) { - 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; - LDKBolt11InvoiceFeatures other_conv; - other_conv.inner = untag_ptr(other); - other_conv.is_owned = ptr_is_owned(other); - CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); - other_conv.is_owned = false; - jboolean ret_conv = Bolt11InvoiceFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); +jboolean CS_LDK_PaymentSendFailure_eq(int64_t a, int64_t b) { + LDKPaymentSendFailure* a_conv = (LDKPaymentSendFailure*)untag_ptr(a); + LDKPaymentSendFailure* b_conv = (LDKPaymentSendFailure*)untag_ptr(b); + jboolean ret_conv = PaymentSendFailure_eq(a_conv, b_conv); return ret_conv; } -jboolean CS_LDK_Bolt11InvoiceFeatures_requires_unknown_bits(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_unknown_bits(&this_arg_conv); - return ret_conv; +void CS_LDK_Bolt12PaymentError_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); + LDKBolt12PaymentError this_ptr_conv = *(LDKBolt12PaymentError*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Bolt12PaymentError_free(this_ptr_conv); } -int64_t CS_LDK_Bolt11InvoiceFeatures_set_required_feature_bit(int64_t this_arg, int64_t bit) { - 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; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = Bolt11InvoiceFeatures_set_required_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +static inline uint64_t Bolt12PaymentError_clone_ptr(LDKBolt12PaymentError *NONNULL_PTR arg) { + LDKBolt12PaymentError *ret_copy = MALLOC(sizeof(LDKBolt12PaymentError), "LDKBolt12PaymentError"); + *ret_copy = Bolt12PaymentError_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_Bolt12PaymentError_clone_ptr(int64_t arg) { + LDKBolt12PaymentError* arg_conv = (LDKBolt12PaymentError*)untag_ptr(arg); + int64_t ret_conv = Bolt12PaymentError_clone_ptr(arg_conv); + return ret_conv; } -int64_t CS_LDK_Bolt11InvoiceFeatures_set_optional_feature_bit(int64_t this_arg, int64_t bit) { - 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; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = Bolt11InvoiceFeatures_set_optional_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_Bolt12PaymentError_clone(int64_t orig) { + LDKBolt12PaymentError* orig_conv = (LDKBolt12PaymentError*)untag_ptr(orig); + LDKBolt12PaymentError *ret_copy = MALLOC(sizeof(LDKBolt12PaymentError), "LDKBolt12PaymentError"); + *ret_copy = Bolt12PaymentError_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_Bolt11InvoiceFeatures_set_required_custom_bit(int64_t this_arg, int64_t bit) { - 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; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = Bolt11InvoiceFeatures_set_required_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_Bolt12PaymentError_unexpected_invoice() { + LDKBolt12PaymentError *ret_copy = MALLOC(sizeof(LDKBolt12PaymentError), "LDKBolt12PaymentError"); + *ret_copy = Bolt12PaymentError_unexpected_invoice(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_Bolt11InvoiceFeatures_set_optional_custom_bit(int64_t this_arg, int64_t bit) { - 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; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = Bolt11InvoiceFeatures_set_optional_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_Bolt12PaymentError_duplicate_invoice() { + LDKBolt12PaymentError *ret_copy = MALLOC(sizeof(LDKBolt12PaymentError), "LDKBolt12PaymentError"); + *ret_copy = Bolt12PaymentError_duplicate_invoice(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_OfferFeatures_empty() { - LDKOfferFeatures ret_var = OfferFeatures_empty(); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +int64_t CS_LDK_Bolt12PaymentError_unknown_required_features() { + LDKBolt12PaymentError *ret_copy = MALLOC(sizeof(LDKBolt12PaymentError), "LDKBolt12PaymentError"); + *ret_copy = Bolt12PaymentError_unknown_required_features(); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -jboolean CS_LDK_OfferFeatures_requires_unknown_bits_from(int64_t this_arg, int64_t other) { - LDKOfferFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOfferFeatures other_conv; - other_conv.inner = untag_ptr(other); - other_conv.is_owned = ptr_is_owned(other); - CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); - other_conv.is_owned = false; - jboolean ret_conv = OfferFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); - return ret_conv; +int64_t CS_LDK_Bolt12PaymentError_sending_failed(int32_t a) { + LDKRetryableSendFailure a_conv = LDKRetryableSendFailure_from_cs(a); + LDKBolt12PaymentError *ret_copy = MALLOC(sizeof(LDKBolt12PaymentError), "LDKBolt12PaymentError"); + *ret_copy = Bolt12PaymentError_sending_failed(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_OfferFeatures_requires_unknown_bits(int64_t this_arg) { - LDKOfferFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = OfferFeatures_requires_unknown_bits(&this_arg_conv); +jboolean CS_LDK_Bolt12PaymentError_eq(int64_t a, int64_t b) { + LDKBolt12PaymentError* a_conv = (LDKBolt12PaymentError*)untag_ptr(a); + LDKBolt12PaymentError* b_conv = (LDKBolt12PaymentError*)untag_ptr(b); + jboolean ret_conv = Bolt12PaymentError_eq(a_conv, b_conv); return ret_conv; } -int64_t CS_LDK_OfferFeatures_set_required_feature_bit(int64_t this_arg, int64_t bit) { - LDKOfferFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = OfferFeatures_set_required_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +void CS_LDK_ProbeSendFailure_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); + LDKProbeSendFailure this_ptr_conv = *(LDKProbeSendFailure*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + ProbeSendFailure_free(this_ptr_conv); } -int64_t CS_LDK_OfferFeatures_set_optional_feature_bit(int64_t this_arg, int64_t bit) { - LDKOfferFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = OfferFeatures_set_optional_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +static inline uint64_t ProbeSendFailure_clone_ptr(LDKProbeSendFailure *NONNULL_PTR arg) { + LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); + *ret_copy = ProbeSendFailure_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_ProbeSendFailure_clone_ptr(int64_t arg) { + LDKProbeSendFailure* arg_conv = (LDKProbeSendFailure*)untag_ptr(arg); + int64_t ret_conv = ProbeSendFailure_clone_ptr(arg_conv); + return ret_conv; } -int64_t CS_LDK_OfferFeatures_set_required_custom_bit(int64_t this_arg, int64_t bit) { - LDKOfferFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = OfferFeatures_set_required_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_ProbeSendFailure_clone(int64_t orig) { + LDKProbeSendFailure* orig_conv = (LDKProbeSendFailure*)untag_ptr(orig); + LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); + *ret_copy = ProbeSendFailure_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_OfferFeatures_set_optional_custom_bit(int64_t this_arg, int64_t bit) { - LDKOfferFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = OfferFeatures_set_optional_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_ProbeSendFailure_route_not_found() { + LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); + *ret_copy = ProbeSendFailure_route_not_found(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_InvoiceRequestFeatures_empty() { - LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_empty(); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +int64_t CS_LDK_ProbeSendFailure_sending_failed(int64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKPaymentSendFailure a_conv = *(LDKPaymentSendFailure*)(a_ptr); + a_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(a)); + LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); + *ret_copy = ProbeSendFailure_sending_failed(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -jboolean CS_LDK_InvoiceRequestFeatures_requires_unknown_bits_from(int64_t this_arg, int64_t other) { - LDKInvoiceRequestFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKInvoiceRequestFeatures other_conv; - other_conv.inner = untag_ptr(other); - other_conv.is_owned = ptr_is_owned(other); - CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); - other_conv.is_owned = false; - jboolean ret_conv = InvoiceRequestFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); +jboolean CS_LDK_ProbeSendFailure_eq(int64_t a, int64_t b) { + LDKProbeSendFailure* a_conv = (LDKProbeSendFailure*)untag_ptr(a); + LDKProbeSendFailure* b_conv = (LDKProbeSendFailure*)untag_ptr(b); + jboolean ret_conv = ProbeSendFailure_eq(a_conv, b_conv); return ret_conv; } -jboolean CS_LDK_InvoiceRequestFeatures_requires_unknown_bits(int64_t this_arg) { - LDKInvoiceRequestFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InvoiceRequestFeatures_requires_unknown_bits(&this_arg_conv); - return ret_conv; +void CS_LDK_RecipientOnionFields_free(int64_t this_obj) { + LDKRecipientOnionFields this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + RecipientOnionFields_free(this_obj_conv); } -int64_t CS_LDK_InvoiceRequestFeatures_set_required_feature_bit(int64_t this_arg, int64_t bit) { - LDKInvoiceRequestFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = InvoiceRequestFeatures_set_required_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_RecipientOnionFields_get_payment_secret(int64_t this_ptr) { + LDKRecipientOnionFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); + *ret_copy = RecipientOnionFields_get_payment_secret(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_InvoiceRequestFeatures_set_optional_feature_bit(int64_t this_arg, int64_t bit) { - LDKInvoiceRequestFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = InvoiceRequestFeatures_set_optional_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +void CS_LDK_RecipientOnionFields_set_payment_secret(int64_t this_ptr, int64_t val) { + LDKRecipientOnionFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_ThirtyTwoBytesZ val_conv = *(LDKCOption_ThirtyTwoBytesZ*)(val_ptr); + val_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(val)); + RecipientOnionFields_set_payment_secret(&this_ptr_conv, val_conv); } -int64_t CS_LDK_InvoiceRequestFeatures_set_required_custom_bit(int64_t this_arg, int64_t bit) { - LDKInvoiceRequestFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = InvoiceRequestFeatures_set_required_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_RecipientOnionFields_get_payment_metadata(int64_t this_ptr) { + LDKRecipientOnionFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = RecipientOnionFields_get_payment_metadata(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_InvoiceRequestFeatures_set_optional_custom_bit(int64_t this_arg, int64_t bit) { - LDKInvoiceRequestFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = InvoiceRequestFeatures_set_optional_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +void CS_LDK_RecipientOnionFields_set_payment_metadata(int64_t this_ptr, int64_t val) { + LDKRecipientOnionFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_CVec_u8ZZ val_conv = *(LDKCOption_CVec_u8ZZ*)(val_ptr); + val_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(val)); + RecipientOnionFields_set_payment_metadata(&this_ptr_conv, val_conv); } -int64_t CS_LDK_Bolt12InvoiceFeatures_empty() { - LDKBolt12InvoiceFeatures ret_var = Bolt12InvoiceFeatures_empty(); +static inline uint64_t RecipientOnionFields_clone_ptr(LDKRecipientOnionFields *NONNULL_PTR arg) { + LDKRecipientOnionFields ret_var = RecipientOnionFields_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; } - -jboolean CS_LDK_Bolt12InvoiceFeatures_requires_unknown_bits_from(int64_t this_arg, int64_t other) { - LDKBolt12InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKBolt12InvoiceFeatures other_conv; - other_conv.inner = untag_ptr(other); - other_conv.is_owned = ptr_is_owned(other); - CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); - other_conv.is_owned = false; - jboolean ret_conv = Bolt12InvoiceFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); - return ret_conv; -} - -jboolean CS_LDK_Bolt12InvoiceFeatures_requires_unknown_bits(int64_t this_arg) { - LDKBolt12InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = Bolt12InvoiceFeatures_requires_unknown_bits(&this_arg_conv); +int64_t CS_LDK_RecipientOnionFields_clone_ptr(int64_t arg) { + LDKRecipientOnionFields arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = RecipientOnionFields_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_Bolt12InvoiceFeatures_set_required_feature_bit(int64_t this_arg, int64_t bit) { - LDKBolt12InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = Bolt12InvoiceFeatures_set_required_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_Bolt12InvoiceFeatures_set_optional_feature_bit(int64_t this_arg, int64_t bit) { - LDKBolt12InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = Bolt12InvoiceFeatures_set_optional_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_Bolt12InvoiceFeatures_set_required_custom_bit(int64_t this_arg, int64_t bit) { - LDKBolt12InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = Bolt12InvoiceFeatures_set_required_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_Bolt12InvoiceFeatures_set_optional_custom_bit(int64_t this_arg, int64_t bit) { - LDKBolt12InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = Bolt12InvoiceFeatures_set_optional_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_BlindedHopFeatures_empty() { - LDKBlindedHopFeatures ret_var = BlindedHopFeatures_empty(); +int64_t CS_LDK_RecipientOnionFields_clone(int64_t orig) { + LDKRecipientOnionFields orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKRecipientOnionFields ret_var = RecipientOnionFields_clone(&orig_conv); int64_t ret_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_BlindedHopFeatures_requires_unknown_bits_from(int64_t this_arg, int64_t other) { - LDKBlindedHopFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKBlindedHopFeatures other_conv; - other_conv.inner = untag_ptr(other); - other_conv.is_owned = ptr_is_owned(other); - CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); - other_conv.is_owned = false; - jboolean ret_conv = BlindedHopFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); - return ret_conv; -} - -jboolean CS_LDK_BlindedHopFeatures_requires_unknown_bits(int64_t this_arg) { - LDKBlindedHopFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = BlindedHopFeatures_requires_unknown_bits(&this_arg_conv); +jboolean CS_LDK_RecipientOnionFields_eq(int64_t a, int64_t b) { + LDKRecipientOnionFields a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKRecipientOnionFields b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = RecipientOnionFields_eq(&a_conv, &b_conv); return ret_conv; } -int64_t CS_LDK_BlindedHopFeatures_set_required_feature_bit(int64_t this_arg, int64_t bit) { - LDKBlindedHopFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = BlindedHopFeatures_set_required_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_BlindedHopFeatures_set_optional_feature_bit(int64_t this_arg, int64_t bit) { - LDKBlindedHopFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = BlindedHopFeatures_set_optional_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +int8_tArray CS_LDK_RecipientOnionFields_write(int64_t obj) { + LDKRecipientOnionFields obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = RecipientOnionFields_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -int64_t CS_LDK_BlindedHopFeatures_set_required_custom_bit(int64_t this_arg, int64_t bit) { - LDKBlindedHopFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = BlindedHopFeatures_set_required_custom_bit(&this_arg_conv, bit); +int64_t CS_LDK_RecipientOnionFields_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_RecipientOnionFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsDecodeErrorZ), "LDKCResult_RecipientOnionFieldsDecodeErrorZ"); + *ret_conv = RecipientOnionFields_read(ser_ref); + FREE(ser); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_BlindedHopFeatures_set_optional_custom_bit(int64_t this_arg, int64_t bit) { - LDKBlindedHopFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = BlindedHopFeatures_set_optional_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_RecipientOnionFields_secret_only(int8_tArray payment_secret) { + LDKThirtyTwoBytes payment_secret_ref; + CHECK(payment_secret->arr_len == 32); + memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret); + LDKRecipientOnionFields ret_var = RecipientOnionFields_secret_only(payment_secret_ref); + int64_t ret_ref = 0; + 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_ChannelTypeFeatures_empty() { - LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_empty(); +int64_t CS_LDK_RecipientOnionFields_spontaneous_empty() { + LDKRecipientOnionFields ret_var = RecipientOnionFields_spontaneous_empty(); int64_t ret_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_ChannelTypeFeatures_requires_unknown_bits_from(int64_t this_arg, int64_t other) { - LDKChannelTypeFeatures this_arg_conv; +int64_t CS_LDK_RecipientOnionFields_with_custom_tlvs(int64_t this_arg, int64_tArray custom_tlvs) { + LDKRecipientOnionFields this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelTypeFeatures other_conv; - other_conv.inner = untag_ptr(other); - other_conv.is_owned = ptr_is_owned(other); - CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); - other_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); - return ret_conv; + this_arg_conv = RecipientOnionFields_clone(&this_arg_conv); + LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs_constr; + custom_tlvs_constr.datalen = custom_tlvs->arr_len; + if (custom_tlvs_constr.datalen > 0) + custom_tlvs_constr.data = MALLOC(custom_tlvs_constr.datalen * sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKCVec_C2Tuple_u64CVec_u8ZZZ Elements"); + else + custom_tlvs_constr.data = NULL; + int64_t* custom_tlvs_vals = custom_tlvs->elems; + for (size_t x = 0; x < custom_tlvs_constr.datalen; x++) { + int64_t custom_tlvs_conv_23 = custom_tlvs_vals[x]; + void* custom_tlvs_conv_23_ptr = untag_ptr(custom_tlvs_conv_23); + CHECK_ACCESS(custom_tlvs_conv_23_ptr); + LDKC2Tuple_u64CVec_u8ZZ custom_tlvs_conv_23_conv = *(LDKC2Tuple_u64CVec_u8ZZ*)(custom_tlvs_conv_23_ptr); + custom_tlvs_conv_23_conv = C2Tuple_u64CVec_u8ZZ_clone((LDKC2Tuple_u64CVec_u8ZZ*)untag_ptr(custom_tlvs_conv_23)); + custom_tlvs_constr.data[x] = custom_tlvs_conv_23_conv; + } + FREE(custom_tlvs); + LDKCResult_RecipientOnionFieldsNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsNoneZ), "LDKCResult_RecipientOnionFieldsNoneZ"); + *ret_conv = RecipientOnionFields_with_custom_tlvs(this_arg_conv, custom_tlvs_constr); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_ChannelTypeFeatures_requires_unknown_bits(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +int64_tArray CS_LDK_RecipientOnionFields_custom_tlvs(int64_t this_arg) { + LDKRecipientOnionFields this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_requires_unknown_bits(&this_arg_conv); - return ret_conv; + LDKCVec_C2Tuple_u64CVec_u8ZZZ ret_var = RecipientOnionFields_custom_tlvs(&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 x = 0; x < ret_var.datalen; x++) { + LDKC2Tuple_u64CVec_u8ZZ* ret_conv_23_conv = MALLOC(sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKC2Tuple_u64CVec_u8ZZ"); + *ret_conv_23_conv = ret_var.data[x]; + ret_arr_ptr[x] = tag_ptr(ret_conv_23_conv, true); + } + + FREE(ret_var.data); + return ret_arr; } -int64_t CS_LDK_ChannelTypeFeatures_set_required_feature_bit(int64_t this_arg, int64_t bit) { - LDKChannelTypeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = ChannelTypeFeatures_set_required_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +void CS_LDK_CustomMessageReader_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); + LDKCustomMessageReader this_ptr_conv = *(LDKCustomMessageReader*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + CustomMessageReader_free(this_ptr_conv); } -int64_t CS_LDK_ChannelTypeFeatures_set_optional_feature_bit(int64_t this_arg, int64_t bit) { - LDKChannelTypeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = ChannelTypeFeatures_set_optional_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +static inline uint64_t Type_clone_ptr(LDKType *NONNULL_PTR arg) { + LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType"); + *ret_ret = Type_clone(arg); + return tag_ptr(ret_ret, true); } - -int64_t CS_LDK_ChannelTypeFeatures_set_required_custom_bit(int64_t this_arg, int64_t bit) { - LDKChannelTypeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = ChannelTypeFeatures_set_required_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_Type_clone_ptr(int64_t arg) { + void* arg_ptr = untag_ptr(arg); + if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); } + LDKType* arg_conv = (LDKType*)arg_ptr; + int64_t ret_conv = Type_clone_ptr(arg_conv); + return ret_conv; } -int64_t CS_LDK_ChannelTypeFeatures_set_optional_custom_bit(int64_t this_arg, int64_t bit) { - LDKChannelTypeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = ChannelTypeFeatures_set_optional_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_Type_clone(int64_t orig) { + void* orig_ptr = untag_ptr(orig); + if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); } + LDKType* orig_conv = (LDKType*)orig_ptr; + LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType"); + *ret_ret = Type_clone(orig_conv); + return tag_ptr(ret_ret, true); } -int8_tArray CS_LDK_InitFeatures_write(int64_t obj) { - LDKInitFeatures obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = InitFeatures_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +void CS_LDK_Type_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); + LDKType this_ptr_conv = *(LDKType*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Type_free(this_ptr_conv); } -int64_t CS_LDK_InitFeatures_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); - *ret_conv = InitFeatures_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +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_ChannelFeatures_write(int64_t obj) { - LDKChannelFeatures obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ChannelFeatures_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); +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; } -int64_t CS_LDK_ChannelFeatures_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); - *ret_conv = ChannelFeatures_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +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); } -int8_tArray CS_LDK_NodeFeatures_write(int64_t obj) { - LDKNodeFeatures obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = NodeFeatures_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +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; } -int64_t CS_LDK_NodeFeatures_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); - *ret_conv = NodeFeatures_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +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; } -int8_tArray CS_LDK_Bolt11InvoiceFeatures_write(int64_t obj) { - LDKBolt11InvoiceFeatures 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 = Bolt11InvoiceFeatures_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_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; } -int64_t CS_LDK_Bolt11InvoiceFeatures_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ"); - *ret_conv = Bolt11InvoiceFeatures_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +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_Bolt12InvoiceFeatures_write(int64_t obj) { - LDKBolt12InvoiceFeatures obj_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 = Bolt12InvoiceFeatures_write(&obj_conv); + 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_Bolt12InvoiceFeatures_read(int8_tArray ser) { +int64_t CS_LDK_OfferId_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ"); - *ret_conv = Bolt12InvoiceFeatures_read(ser_ref); + LDKCResult_OfferIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferIdDecodeErrorZ), "LDKCResult_OfferIdDecodeErrorZ"); + *ret_conv = OfferId_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -int8_tArray CS_LDK_BlindedHopFeatures_write(int64_t obj) { - LDKBlindedHopFeatures obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = BlindedHopFeatures_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +void 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); } -int64_t CS_LDK_BlindedHopFeatures_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ"); - *ret_conv = BlindedHopFeatures_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +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; } -int8_tArray CS_LDK_ChannelTypeFeatures_write(int64_t obj) { - LDKChannelTypeFeatures obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ChannelTypeFeatures_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +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; } -int64_t CS_LDK_ChannelTypeFeatures_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); - *ret_conv = ChannelTypeFeatures_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void 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); } -void CS_LDK_InitFeatures_set_data_loss_protect_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_data_loss_protect_optional(&this_arg_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; } -void CS_LDK_InitFeatures_set_data_loss_protect_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_data_loss_protect_required(&this_arg_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; } -jboolean CS_LDK_InitFeatures_supports_data_loss_protect(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_data_loss_protect(&this_arg_conv); - return ret_conv; +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; } -void CS_LDK_NodeFeatures_set_data_loss_protect_optional(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +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.is_owned = false; - NodeFeatures_set_data_loss_protect_optional(&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_NodeFeatures_set_data_loss_protect_required(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +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.is_owned = false; - NodeFeatures_set_data_loss_protect_required(&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); } -jboolean CS_LDK_NodeFeatures_supports_data_loss_protect(int64_t this_arg) { - LDKNodeFeatures this_arg_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.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_data_loss_protect(&this_arg_conv); - return ret_conv; + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + OfferWithExplicitMetadataBuilder_amount_msats(this_arg_conv, amount_msats); } -jboolean CS_LDK_InitFeatures_requires_data_loss_protect(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +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.is_owned = false; - jboolean ret_conv = InitFeatures_requires_data_loss_protect(&this_arg_conv); - return ret_conv; + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + OfferWithExplicitMetadataBuilder_absolute_expiry(this_arg_conv, absolute_expiry); } -jboolean CS_LDK_NodeFeatures_requires_data_loss_protect(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +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.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_data_loss_protect(&this_arg_conv); - return ret_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_InitFeatures_set_initial_routing_sync_optional(int64_t this_arg) { - LDKInitFeatures this_arg_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.is_owned = false; - InitFeatures_set_initial_routing_sync_optional(&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_InitFeatures_set_initial_routing_sync_required(int64_t this_arg) { - LDKInitFeatures this_arg_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.is_owned = false; - InitFeatures_set_initial_routing_sync_required(&this_arg_conv); + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + LDKBlindedMessagePath 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 = BlindedMessagePath_clone(&path_conv); + OfferWithExplicitMetadataBuilder_path(this_arg_conv, path_conv); } -jboolean CS_LDK_InitFeatures_initial_routing_sync(int64_t this_arg) { - LDKInitFeatures this_arg_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.is_owned = false; - jboolean ret_conv = InitFeatures_initial_routing_sync(&this_arg_conv); - return ret_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); } -void CS_LDK_InitFeatures_set_upfront_shutdown_script_optional(int64_t this_arg) { - LDKInitFeatures this_arg_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.is_owned = false; - InitFeatures_set_upfront_shutdown_script_optional(&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); } -void CS_LDK_InitFeatures_set_upfront_shutdown_script_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_upfront_shutdown_script_required(&this_arg_conv); +int64_t CS_LDK_OfferWithDerivedMetadataBuilder_deriving_signing_pubkey(int8_tArray node_id, int64_t expanded_key, int64_t nonce) { + 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; + LDKNonce nonce_conv; + nonce_conv.inner = untag_ptr(nonce); + nonce_conv.is_owned = ptr_is_owned(nonce); + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_conv); + nonce_conv = Nonce_clone(&nonce_conv); + LDKOfferWithDerivedMetadataBuilder ret_var = OfferWithDerivedMetadataBuilder_deriving_signing_pubkey(node_id_ref, &expanded_key_conv, nonce_conv); + int64_t ret_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_InitFeatures_supports_upfront_shutdown_script(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +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.is_owned = false; - jboolean ret_conv = InitFeatures_supports_upfront_shutdown_script(&this_arg_conv); - return ret_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_NodeFeatures_set_upfront_shutdown_script_optional(int64_t this_arg) { - LDKNodeFeatures this_arg_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.is_owned = false; - NodeFeatures_set_upfront_shutdown_script_optional(&this_arg_conv); + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + OfferWithDerivedMetadataBuilder_amount_msats(this_arg_conv, amount_msats); } -void CS_LDK_NodeFeatures_set_upfront_shutdown_script_required(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +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.is_owned = false; - NodeFeatures_set_upfront_shutdown_script_required(&this_arg_conv); + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + OfferWithDerivedMetadataBuilder_absolute_expiry(this_arg_conv, absolute_expiry); } -jboolean CS_LDK_NodeFeatures_supports_upfront_shutdown_script(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +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.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_upfront_shutdown_script(&this_arg_conv); - return ret_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); } -jboolean CS_LDK_InitFeatures_requires_upfront_shutdown_script(int64_t this_arg) { - LDKInitFeatures this_arg_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.is_owned = false; - jboolean ret_conv = InitFeatures_requires_upfront_shutdown_script(&this_arg_conv); - return ret_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); } -jboolean CS_LDK_NodeFeatures_requires_upfront_shutdown_script(int64_t this_arg) { - LDKNodeFeatures this_arg_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.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_upfront_shutdown_script(&this_arg_conv); - return ret_conv; + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKBlindedMessagePath 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 = BlindedMessagePath_clone(&path_conv); + OfferWithDerivedMetadataBuilder_path(this_arg_conv, path_conv); } -void CS_LDK_InitFeatures_set_gossip_queries_optional(int64_t this_arg) { - LDKInitFeatures this_arg_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.is_owned = false; - InitFeatures_set_gossip_queries_optional(&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); } -void CS_LDK_InitFeatures_set_gossip_queries_required(int64_t this_arg) { - LDKInitFeatures this_arg_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.is_owned = false; - InitFeatures_set_gossip_queries_required(&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); } -jboolean CS_LDK_InitFeatures_supports_gossip_queries(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_gossip_queries(&this_arg_conv); +void CS_LDK_Offer_free(int64_t this_obj) { + LDKOffer this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Offer_free(this_obj_conv); +} + +static inline uint64_t Offer_clone_ptr(LDKOffer *NONNULL_PTR arg) { + LDKOffer ret_var = Offer_clone(arg); + int64_t ret_ref = 0; + 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_clone_ptr(int64_t arg) { + LDKOffer arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = Offer_clone_ptr(&arg_conv); return ret_conv; } -void CS_LDK_NodeFeatures_set_gossip_queries_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_gossip_queries_optional(&this_arg_conv); +int64_t CS_LDK_Offer_clone(int64_t orig) { + LDKOffer orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKOffer ret_var = Offer_clone(&orig_conv); + int64_t ret_ref = 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_NodeFeatures_set_gossip_queries_required(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +ptrArray CS_LDK_Offer_chains(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; - NodeFeatures_set_gossip_queries_required(&this_arg_conv); + LDKCVec_ThirtyTwoBytesZ ret_var = Offer_chains(&this_arg_conv); + ptrArray ret_arr = NULL; + ret_arr = init_ptrArray(ret_var.datalen, __LINE__); + int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8); + for (size_t i = 0; i < ret_var.datalen; i++) { + int8_tArray ret_conv_8_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_conv_8_arr->elems, ret_var.data[i].data, 32); + ret_arr_ptr[i] = ret_conv_8_arr; + } + + FREE(ret_var.data); + return ret_arr; } -jboolean CS_LDK_NodeFeatures_supports_gossip_queries(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_Offer_metadata(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; - jboolean ret_conv = NodeFeatures_supports_gossip_queries(&this_arg_conv); - return ret_conv; + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = Offer_metadata(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_InitFeatures_requires_gossip_queries(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_Offer_amount(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; - jboolean ret_conv = InitFeatures_requires_gossip_queries(&this_arg_conv); - return ret_conv; + 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; } -jboolean CS_LDK_NodeFeatures_requires_gossip_queries(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_Offer_description(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; - jboolean ret_conv = NodeFeatures_requires_gossip_queries(&this_arg_conv); - return ret_conv; + LDKPrintableString ret_var = Offer_description(&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_InitFeatures_set_variable_length_onion_optional(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_Offer_offer_features(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; - InitFeatures_set_variable_length_onion_optional(&this_arg_conv); + LDKOfferFeatures ret_var = Offer_offer_features(&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_InitFeatures_set_variable_length_onion_required(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_Offer_absolute_expiry(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; - InitFeatures_set_variable_length_onion_required(&this_arg_conv); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = Offer_absolute_expiry(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_InitFeatures_supports_variable_length_onion(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_Offer_issuer(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; - jboolean ret_conv = InitFeatures_supports_variable_length_onion(&this_arg_conv); - return ret_conv; + LDKPrintableString ret_var = Offer_issuer(&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_NodeFeatures_set_variable_length_onion_optional(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_tArray CS_LDK_Offer_paths(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; - NodeFeatures_set_variable_length_onion_optional(&this_arg_conv); + LDKCVec_BlindedMessagePathZ ret_var = Offer_paths(&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 u = 0; u < ret_var.datalen; u++) { + LDKBlindedMessagePath ret_conv_20_var = ret_var.data[u]; + int64_t ret_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_20_var); + ret_conv_20_ref = tag_ptr(ret_conv_20_var.inner, ret_conv_20_var.is_owned); + ret_arr_ptr[u] = ret_conv_20_ref; + } + + FREE(ret_var.data); + return ret_arr; } -void CS_LDK_NodeFeatures_set_variable_length_onion_required(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_Offer_supported_quantity(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; - NodeFeatures_set_variable_length_onion_required(&this_arg_conv); + 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; } -jboolean CS_LDK_NodeFeatures_supports_variable_length_onion(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int8_tArray CS_LDK_Offer_signing_pubkey(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; - jboolean ret_conv = NodeFeatures_supports_variable_length_onion(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, Offer_signing_pubkey(&this_arg_conv).compressed_form, 33); + return ret_arr; } -void CS_LDK_Bolt11InvoiceFeatures_set_variable_length_onion_optional(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +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; - Bolt11InvoiceFeatures_set_variable_length_onion_optional(&this_arg_conv); + 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; } -void CS_LDK_Bolt11InvoiceFeatures_set_variable_length_onion_required(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +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); this_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_variable_length_onion_required(&this_arg_conv); + LDKThirtyTwoBytes chain_ref; + CHECK(chain->arr_len == 32); + memcpy(chain_ref.data, chain->elems, 32); FREE(chain); + jboolean ret_conv = Offer_supports_chain(&this_arg_conv, chain_ref); + return ret_conv; } -jboolean CS_LDK_Bolt11InvoiceFeatures_supports_variable_length_onion(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +jboolean CS_LDK_Offer_is_expired(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; - jboolean ret_conv = Bolt11InvoiceFeatures_supports_variable_length_onion(&this_arg_conv); + jboolean ret_conv = Offer_is_expired(&this_arg_conv); return ret_conv; } -jboolean CS_LDK_InitFeatures_requires_variable_length_onion(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +jboolean CS_LDK_Offer_is_expired_no_std(int64_t this_arg, int64_t duration_since_epoch) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_variable_length_onion(&this_arg_conv); + jboolean ret_conv = Offer_is_expired_no_std(&this_arg_conv, duration_since_epoch); return ret_conv; } -jboolean CS_LDK_NodeFeatures_requires_variable_length_onion(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +jboolean CS_LDK_Offer_is_valid_quantity(int64_t this_arg, int64_t quantity) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_variable_length_onion(&this_arg_conv); + jboolean ret_conv = Offer_is_valid_quantity(&this_arg_conv, quantity); return ret_conv; } -jboolean CS_LDK_Bolt11InvoiceFeatures_requires_variable_length_onion(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +jboolean CS_LDK_Offer_expects_quantity(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; - jboolean ret_conv = Bolt11InvoiceFeatures_requires_variable_length_onion(&this_arg_conv); + jboolean ret_conv = Offer_expects_quantity(&this_arg_conv); return ret_conv; } -void CS_LDK_InitFeatures_set_static_remote_key_optional(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_Offer_request_invoice_deriving_payer_id(int64_t this_arg, int64_t expanded_key, int64_t nonce, 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; - InitFeatures_set_static_remote_key_optional(&this_arg_conv); + 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; + LDKNonce nonce_conv; + nonce_conv.inner = untag_ptr(nonce); + nonce_conv.is_owned = ptr_is_owned(nonce); + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_conv); + nonce_conv = Nonce_clone(&nonce_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, nonce_conv, payment_id_ref); + return tag_ptr(ret_conv, true); } -void CS_LDK_InitFeatures_set_static_remote_key_required(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_Offer_request_invoice_deriving_metadata(int64_t this_arg, int8_tArray payer_id, int64_t expanded_key, int64_t nonce, 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; - InitFeatures_set_static_remote_key_required(&this_arg_conv); + 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; + LDKNonce nonce_conv; + nonce_conv.inner = untag_ptr(nonce); + nonce_conv.is_owned = ptr_is_owned(nonce); + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_conv); + nonce_conv = Nonce_clone(&nonce_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, nonce_conv, payment_id_ref); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_InitFeatures_supports_static_remote_key(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +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; - jboolean ret_conv = InitFeatures_supports_static_remote_key(&this_arg_conv); - return ret_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); + 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); } -void CS_LDK_NodeFeatures_set_static_remote_key_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_static_remote_key_optional(&this_arg_conv); +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; } -void CS_LDK_NodeFeatures_set_static_remote_key_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_static_remote_key_required(&this_arg_conv); +int64_t CS_LDK_Offer_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_OfferDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferDecodeErrorZ), "LDKCResult_OfferDecodeErrorZ"); + *ret_conv = Offer_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_NodeFeatures_supports_static_remote_key(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_static_remote_key(&this_arg_conv); +int8_tArray CS_LDK_Offer_write(int64_t obj) { + LDKOffer obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = Offer_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +void 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_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 = (LDKAmount*)untag_ptr(arg); + int64_t ret_conv = Amount_clone_ptr(arg_conv); return ret_conv; } -void CS_LDK_ChannelTypeFeatures_set_static_remote_key_optional(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +int64_t CS_LDK_Amount_clone(int64_t orig) { + 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_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); +} + +jstring CS_LDK_Offer_to_str(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; + LDKStr ret_str = Offer_to_str(&o_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +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); + InvoiceWithExplicitSigningPubkeyBuilder_free(this_obj_conv); +} + +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); - this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_static_remote_key_optional(&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_ChannelTypeFeatures_set_static_remote_key_required(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +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); - this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_static_remote_key_required(&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); } -jboolean CS_LDK_ChannelTypeFeatures_supports_static_remote_key(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +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); - this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_supports_static_remote_key(&this_arg_conv); - return ret_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); } -jboolean CS_LDK_InitFeatures_requires_static_remote_key(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +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); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_static_remote_key(&this_arg_conv); - return ret_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); } -jboolean CS_LDK_NodeFeatures_requires_static_remote_key(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +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); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_static_remote_key(&this_arg_conv); - return ret_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); } -jboolean CS_LDK_ChannelTypeFeatures_requires_static_remote_key(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +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); - this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_requires_static_remote_key(&this_arg_conv); - return ret_conv; + // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder + + InvoiceWithExplicitSigningPubkeyBuilder_allow_mpp(this_arg_conv); } -void CS_LDK_InitFeatures_set_payment_secret_optional(int64_t this_arg) { - LDKInitFeatures 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); - this_arg_conv.is_owned = false; - InitFeatures_set_payment_secret_optional(&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_InitFeatures_set_payment_secret_required(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +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); - this_arg_conv.is_owned = false; - InitFeatures_set_payment_secret_required(&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); } -jboolean CS_LDK_InitFeatures_supports_payment_secret(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +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); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_payment_secret(&this_arg_conv); - return ret_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_NodeFeatures_set_payment_secret_optional(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +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); - this_arg_conv.is_owned = false; - NodeFeatures_set_payment_secret_optional(&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_NodeFeatures_set_payment_secret_required(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +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); - this_arg_conv.is_owned = false; - NodeFeatures_set_payment_secret_required(&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); } -jboolean CS_LDK_NodeFeatures_supports_payment_secret(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +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); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_payment_secret(&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_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 = UnsignedBolt12Invoice_clone_ptr(&arg_conv); return ret_conv; } -void CS_LDK_Bolt11InvoiceFeatures_set_payment_secret_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_payment_secret_optional(&this_arg_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; + 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; } -void CS_LDK_Bolt11InvoiceFeatures_set_payment_secret_required(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_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) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_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_payment_secret_required(&this_arg_conv); + LDKTaggedHash ret_var = UnsignedBolt12Invoice_tagged_hash(&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_Bolt11InvoiceFeatures_supports_payment_secret(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +void CS_LDK_Bolt12Invoice_free(int64_t this_obj) { + LDKBolt12Invoice this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Bolt12Invoice_free(this_obj_conv); +} + +static inline uint64_t Bolt12Invoice_clone_ptr(LDKBolt12Invoice *NONNULL_PTR arg) { + LDKBolt12Invoice ret_var = Bolt12Invoice_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_Bolt12Invoice_clone_ptr(int64_t arg) { + LDKBolt12Invoice 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 = Bolt12Invoice_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_Bolt12Invoice_clone(int64_t orig) { + LDKBolt12Invoice 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; + LDKBolt12Invoice ret_var = Bolt12Invoice_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_UnsignedBolt12Invoice_created_at(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_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_payment_secret(&this_arg_conv); + int64_t ret_conv = UnsignedBolt12Invoice_created_at(&this_arg_conv); return ret_conv; } -jboolean CS_LDK_InitFeatures_requires_payment_secret(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_UnsignedBolt12Invoice_relative_expiry(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_payment_secret(&this_arg_conv); + int64_t ret_conv = UnsignedBolt12Invoice_relative_expiry(&this_arg_conv); return ret_conv; } -jboolean CS_LDK_NodeFeatures_requires_payment_secret(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +jboolean CS_LDK_UnsignedBolt12Invoice_is_expired(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_payment_secret(&this_arg_conv); + jboolean ret_conv = UnsignedBolt12Invoice_is_expired(&this_arg_conv); return ret_conv; } -jboolean CS_LDK_Bolt11InvoiceFeatures_requires_payment_secret(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +ptrArray CS_LDK_UnsignedBolt12Invoice_fallbacks(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_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_payment_secret(&this_arg_conv); - return ret_conv; + LDKCVec_StrZ ret_var = UnsignedBolt12Invoice_fallbacks(&this_arg_conv); + ptrArray ret_arr = NULL; + ret_arr = init_ptrArray(ret_var.datalen, __LINE__); + jstring *ret_arr_ptr = (jstring*)(((uint8_t*)ret_arr) + 8); + for (size_t i = 0; i < ret_var.datalen; i++) { + LDKStr ret_conv_8_str = ret_var.data[i]; + jstring ret_conv_8_conv = str_ref_to_cs(ret_conv_8_str.chars, ret_conv_8_str.len); + Str_free(ret_conv_8_str); + ret_arr_ptr[i] = ret_conv_8_conv; + } + + FREE(ret_var.data); + return ret_arr; } -void CS_LDK_InitFeatures_set_basic_mpp_optional(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_UnsignedBolt12Invoice_invoice_features(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_basic_mpp_optional(&this_arg_conv); + LDKBolt12InvoiceFeatures ret_var = UnsignedBolt12Invoice_invoice_features(&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_InitFeatures_set_basic_mpp_required(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int8_tArray CS_LDK_UnsignedBolt12Invoice_signing_pubkey(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_basic_mpp_required(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, UnsignedBolt12Invoice_signing_pubkey(&this_arg_conv).compressed_form, 33); + return ret_arr; } -jboolean CS_LDK_InitFeatures_supports_basic_mpp(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_UnsignedBolt12Invoice_offer_chains(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_basic_mpp(&this_arg_conv); - return ret_conv; + LDKCOption_CVec_ThirtyTwoBytesZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_ThirtyTwoBytesZZ), "LDKCOption_CVec_ThirtyTwoBytesZZ"); + *ret_copy = UnsignedBolt12Invoice_offer_chains(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_NodeFeatures_set_basic_mpp_optional(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int8_tArray CS_LDK_UnsignedBolt12Invoice_chain(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_basic_mpp_optional(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, UnsignedBolt12Invoice_chain(&this_arg_conv).data, 32); + return ret_arr; } -void CS_LDK_NodeFeatures_set_basic_mpp_required(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_UnsignedBolt12Invoice_metadata(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_basic_mpp_required(&this_arg_conv); + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = UnsignedBolt12Invoice_metadata(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_NodeFeatures_supports_basic_mpp(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_UnsignedBolt12Invoice_amount(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_basic_mpp(&this_arg_conv); - return ret_conv; + 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; } -void CS_LDK_Bolt11InvoiceFeatures_set_basic_mpp_optional(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +int64_t CS_LDK_UnsignedBolt12Invoice_offer_features(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_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_basic_mpp_optional(&this_arg_conv); + LDKOfferFeatures ret_var = UnsignedBolt12Invoice_offer_features(&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_Bolt11InvoiceFeatures_set_basic_mpp_required(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +int64_t CS_LDK_UnsignedBolt12Invoice_description(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_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_basic_mpp_required(&this_arg_conv); + LDKPrintableString ret_var = UnsignedBolt12Invoice_description(&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_Bolt11InvoiceFeatures_supports_basic_mpp(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +int64_t CS_LDK_UnsignedBolt12Invoice_absolute_expiry(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_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_basic_mpp(&this_arg_conv); - return ret_conv; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = UnsignedBolt12Invoice_absolute_expiry(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_Bolt12InvoiceFeatures_set_basic_mpp_optional(int64_t this_arg) { - LDKBolt12InvoiceFeatures this_arg_conv; +int64_t CS_LDK_UnsignedBolt12Invoice_issuer(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - Bolt12InvoiceFeatures_set_basic_mpp_optional(&this_arg_conv); + LDKPrintableString ret_var = UnsignedBolt12Invoice_issuer(&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_Bolt12InvoiceFeatures_set_basic_mpp_required(int64_t this_arg) { - LDKBolt12InvoiceFeatures this_arg_conv; +int64_tArray CS_LDK_UnsignedBolt12Invoice_message_paths(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - Bolt12InvoiceFeatures_set_basic_mpp_required(&this_arg_conv); + LDKCVec_BlindedMessagePathZ ret_var = UnsignedBolt12Invoice_message_paths(&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 u = 0; u < ret_var.datalen; u++) { + LDKBlindedMessagePath ret_conv_20_var = ret_var.data[u]; + int64_t ret_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_20_var); + ret_conv_20_ref = tag_ptr(ret_conv_20_var.inner, ret_conv_20_var.is_owned); + ret_arr_ptr[u] = ret_conv_20_ref; + } + + FREE(ret_var.data); + return ret_arr; } -jboolean CS_LDK_Bolt12InvoiceFeatures_supports_basic_mpp(int64_t this_arg) { - LDKBolt12InvoiceFeatures this_arg_conv; +int64_t CS_LDK_UnsignedBolt12Invoice_supported_quantity(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = Bolt12InvoiceFeatures_supports_basic_mpp(&this_arg_conv); - return ret_conv; + 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; } -jboolean CS_LDK_InitFeatures_requires_basic_mpp(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int8_tArray CS_LDK_UnsignedBolt12Invoice_payer_metadata(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_basic_mpp(&this_arg_conv); - return ret_conv; + LDKu8slice ret_var = UnsignedBolt12Invoice_payer_metadata(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + return ret_arr; } -jboolean CS_LDK_NodeFeatures_requires_basic_mpp(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_UnsignedBolt12Invoice_invoice_request_features(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_basic_mpp(&this_arg_conv); - return ret_conv; + LDKInvoiceRequestFeatures ret_var = UnsignedBolt12Invoice_invoice_request_features(&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_Bolt11InvoiceFeatures_requires_basic_mpp(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +int64_t CS_LDK_UnsignedBolt12Invoice_quantity(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_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_basic_mpp(&this_arg_conv); - return ret_conv; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = UnsignedBolt12Invoice_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_Bolt12InvoiceFeatures_requires_basic_mpp(int64_t this_arg) { - LDKBolt12InvoiceFeatures this_arg_conv; +int8_tArray CS_LDK_UnsignedBolt12Invoice_payer_id(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = Bolt12InvoiceFeatures_requires_basic_mpp(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, UnsignedBolt12Invoice_payer_id(&this_arg_conv).compressed_form, 33); + return ret_arr; } -void CS_LDK_InitFeatures_set_wumbo_optional(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_UnsignedBolt12Invoice_payer_note(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_wumbo_optional(&this_arg_conv); + LDKPrintableString ret_var = UnsignedBolt12Invoice_payer_note(&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_InitFeatures_set_wumbo_required(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int8_tArray CS_LDK_UnsignedBolt12Invoice_payment_hash(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_wumbo_required(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, UnsignedBolt12Invoice_payment_hash(&this_arg_conv).data, 32); + return ret_arr; } -jboolean CS_LDK_InitFeatures_supports_wumbo(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_UnsignedBolt12Invoice_amount_msats(int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_wumbo(&this_arg_conv); + int64_t ret_conv = UnsignedBolt12Invoice_amount_msats(&this_arg_conv); return ret_conv; } -void CS_LDK_NodeFeatures_set_wumbo_optional(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_Bolt12Invoice_created_at(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_wumbo_optional(&this_arg_conv); + int64_t ret_conv = Bolt12Invoice_created_at(&this_arg_conv); + return ret_conv; } -void CS_LDK_NodeFeatures_set_wumbo_required(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_Bolt12Invoice_relative_expiry(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_wumbo_required(&this_arg_conv); + int64_t ret_conv = Bolt12Invoice_relative_expiry(&this_arg_conv); + return ret_conv; } -jboolean CS_LDK_NodeFeatures_supports_wumbo(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +jboolean CS_LDK_Bolt12Invoice_is_expired(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_wumbo(&this_arg_conv); + jboolean ret_conv = Bolt12Invoice_is_expired(&this_arg_conv); return ret_conv; } -jboolean CS_LDK_InitFeatures_requires_wumbo(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +ptrArray CS_LDK_Bolt12Invoice_fallbacks(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_wumbo(&this_arg_conv); - return ret_conv; + LDKCVec_StrZ ret_var = Bolt12Invoice_fallbacks(&this_arg_conv); + ptrArray ret_arr = NULL; + ret_arr = init_ptrArray(ret_var.datalen, __LINE__); + jstring *ret_arr_ptr = (jstring*)(((uint8_t*)ret_arr) + 8); + for (size_t i = 0; i < ret_var.datalen; i++) { + LDKStr ret_conv_8_str = ret_var.data[i]; + jstring ret_conv_8_conv = str_ref_to_cs(ret_conv_8_str.chars, ret_conv_8_str.len); + Str_free(ret_conv_8_str); + ret_arr_ptr[i] = ret_conv_8_conv; + } + + FREE(ret_var.data); + return ret_arr; } -jboolean CS_LDK_NodeFeatures_requires_wumbo(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_Bolt12Invoice_invoice_features(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_wumbo(&this_arg_conv); - return ret_conv; + LDKBolt12InvoiceFeatures ret_var = Bolt12Invoice_invoice_features(&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_InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int8_tArray CS_LDK_Bolt12Invoice_signing_pubkey(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, Bolt12Invoice_signing_pubkey(&this_arg_conv).compressed_form, 33); + return ret_arr; } -void CS_LDK_InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_Bolt12Invoice_offer_chains(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(&this_arg_conv); + LDKCOption_CVec_ThirtyTwoBytesZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_ThirtyTwoBytesZZ), "LDKCOption_CVec_ThirtyTwoBytesZZ"); + *ret_copy = Bolt12Invoice_offer_chains(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_InitFeatures_supports_anchors_nonzero_fee_htlc_tx(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int8_tArray CS_LDK_Bolt12Invoice_chain(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_anchors_nonzero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, Bolt12Invoice_chain(&this_arg_conv).data, 32); + return ret_arr; } -void CS_LDK_NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_Bolt12Invoice_metadata(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(&this_arg_conv); + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = Bolt12Invoice_metadata(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_Bolt12Invoice_amount(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(&this_arg_conv); + 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; } -jboolean CS_LDK_NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_Bolt12Invoice_offer_features(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + LDKOfferFeatures ret_var = Bolt12Invoice_offer_features(&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_ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +int64_t CS_LDK_Bolt12Invoice_description(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(&this_arg_conv); + LDKPrintableString ret_var = Bolt12Invoice_description(&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_ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +int64_t CS_LDK_Bolt12Invoice_absolute_expiry(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(&this_arg_conv); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = Bolt12Invoice_absolute_expiry(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +int64_t CS_LDK_Bolt12Invoice_issuer(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + LDKPrintableString ret_var = Bolt12Invoice_issuer(&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_InitFeatures_requires_anchors_nonzero_fee_htlc_tx(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_tArray CS_LDK_Bolt12Invoice_message_paths(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_anchors_nonzero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + LDKCVec_BlindedMessagePathZ ret_var = Bolt12Invoice_message_paths(&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 u = 0; u < ret_var.datalen; u++) { + LDKBlindedMessagePath ret_conv_20_var = ret_var.data[u]; + int64_t ret_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_20_var); + ret_conv_20_ref = tag_ptr(ret_conv_20_var.inner, ret_conv_20_var.is_owned); + ret_arr_ptr[u] = ret_conv_20_ref; + } + + FREE(ret_var.data); + return ret_arr; } -jboolean CS_LDK_NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_Bolt12Invoice_supported_quantity(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + 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; } -jboolean CS_LDK_ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +int8_tArray CS_LDK_Bolt12Invoice_payer_metadata(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + LDKu8slice ret_var = Bolt12Invoice_payer_metadata(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + return ret_arr; } -void CS_LDK_InitFeatures_set_anchors_zero_fee_htlc_tx_optional(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_Bolt12Invoice_invoice_request_features(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_anchors_zero_fee_htlc_tx_optional(&this_arg_conv); + LDKInvoiceRequestFeatures ret_var = Bolt12Invoice_invoice_request_features(&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_InitFeatures_set_anchors_zero_fee_htlc_tx_required(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_Bolt12Invoice_quantity(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_anchors_zero_fee_htlc_tx_required(&this_arg_conv); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = Bolt12Invoice_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_InitFeatures_supports_anchors_zero_fee_htlc_tx(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int8_tArray CS_LDK_Bolt12Invoice_payer_id(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_anchors_zero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, Bolt12Invoice_payer_id(&this_arg_conv).compressed_form, 33); + return ret_arr; } -void CS_LDK_NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_Bolt12Invoice_payer_note(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(&this_arg_conv); + LDKPrintableString ret_var = Bolt12Invoice_payer_note(&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_NodeFeatures_set_anchors_zero_fee_htlc_tx_required(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int8_tArray CS_LDK_Bolt12Invoice_payment_hash(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_anchors_zero_fee_htlc_tx_required(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, Bolt12Invoice_payment_hash(&this_arg_conv).data, 32); + return ret_arr; } -jboolean CS_LDK_NodeFeatures_supports_anchors_zero_fee_htlc_tx(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_Bolt12Invoice_amount_msats(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_anchors_zero_fee_htlc_tx(&this_arg_conv); + int64_t ret_conv = Bolt12Invoice_amount_msats(&this_arg_conv); return ret_conv; } -void CS_LDK_ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +int8_tArray CS_LDK_Bolt12Invoice_signature(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); + memcpy(ret_arr->elems, Bolt12Invoice_signature(&this_arg_conv).compact_form, 64); + return ret_arr; } -void CS_LDK_ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +int8_tArray CS_LDK_Bolt12Invoice_signable_hash(int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, Bolt12Invoice_signable_hash(&this_arg_conv).data, 32); + return ret_arr; } -jboolean CS_LDK_ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +int64_t CS_LDK_Bolt12Invoice_verify_using_metadata(int64_t this_arg, int64_t key) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + LDKExpandedKey key_conv; + key_conv.inner = untag_ptr(key); + key_conv.is_owned = ptr_is_owned(key); + CHECK_INNER_FIELD_ACCESS_OR_NULL(key_conv); + key_conv.is_owned = false; + LDKCResult_ThirtyTwoBytesNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesNoneZ), "LDKCResult_ThirtyTwoBytesNoneZ"); + *ret_conv = Bolt12Invoice_verify_using_metadata(&this_arg_conv, &key_conv); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_InitFeatures_requires_anchors_zero_fee_htlc_tx(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_Bolt12Invoice_verify_using_payer_data(int64_t this_arg, int8_tArray payment_id, int64_t nonce, int64_t key) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_anchors_zero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + LDKNonce nonce_conv; + nonce_conv.inner = untag_ptr(nonce); + nonce_conv.is_owned = ptr_is_owned(nonce); + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_conv); + nonce_conv = Nonce_clone(&nonce_conv); + LDKExpandedKey key_conv; + key_conv.inner = untag_ptr(key); + key_conv.is_owned = ptr_is_owned(key); + CHECK_INNER_FIELD_ACCESS_OR_NULL(key_conv); + key_conv.is_owned = false; + LDKCResult_ThirtyTwoBytesNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesNoneZ), "LDKCResult_ThirtyTwoBytesNoneZ"); + *ret_conv = Bolt12Invoice_verify_using_payer_data(&this_arg_conv, payment_id_ref, nonce_conv, &key_conv); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_NodeFeatures_requires_anchors_zero_fee_htlc_tx(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_anchors_zero_fee_htlc_tx(&this_arg_conv); +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; } -jboolean CS_LDK_ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(&this_arg_conv); - return ret_conv; +int8_tArray CS_LDK_UnsignedBolt12Invoice_write(int64_t obj) { + LDKUnsignedBolt12Invoice 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 = UnsignedBolt12Invoice_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -void CS_LDK_InitFeatures_set_route_blinding_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_route_blinding_optional(&this_arg_conv); +int8_tArray CS_LDK_Bolt12Invoice_write(int64_t obj) { + LDKBolt12Invoice 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 = Bolt12Invoice_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -void CS_LDK_InitFeatures_set_route_blinding_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_route_blinding_required(&this_arg_conv); +int64_t CS_LDK_Bolt12Invoice_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_Bolt12InvoiceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceDecodeErrorZ), "LDKCResult_Bolt12InvoiceDecodeErrorZ"); + *ret_conv = Bolt12Invoice_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_InitFeatures_supports_route_blinding(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_route_blinding(&this_arg_conv); - return ret_conv; +void CS_LDK_InvoiceError_free(int64_t this_obj) { + LDKInvoiceError this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InvoiceError_free(this_obj_conv); } -void CS_LDK_NodeFeatures_set_route_blinding_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_route_blinding_optional(&this_arg_conv); +int64_t CS_LDK_InvoiceError_get_erroneous_field(int64_t this_ptr) { + LDKInvoiceError this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKErroneousField ret_var = InvoiceError_get_erroneous_field(&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_NodeFeatures_set_route_blinding_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_route_blinding_required(&this_arg_conv); +void CS_LDK_InvoiceError_set_erroneous_field(int64_t this_ptr, int64_t val) { + LDKInvoiceError this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKErroneousField 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 = ErroneousField_clone(&val_conv); + InvoiceError_set_erroneous_field(&this_ptr_conv, val_conv); } -jboolean CS_LDK_NodeFeatures_supports_route_blinding(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_route_blinding(&this_arg_conv); - return ret_conv; +int64_t CS_LDK_InvoiceError_get_message(int64_t this_ptr) { + LDKInvoiceError this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = InvoiceError_get_message(&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; } -jboolean CS_LDK_InitFeatures_requires_route_blinding(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_route_blinding(&this_arg_conv); - return ret_conv; +void CS_LDK_InvoiceError_set_message(int64_t this_ptr, int64_t val) { + LDKInvoiceError this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + InvoiceError_set_message(&this_ptr_conv, val_conv); } -jboolean CS_LDK_NodeFeatures_requires_route_blinding(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_route_blinding(&this_arg_conv); +int64_t CS_LDK_InvoiceError_new(int64_t erroneous_field_arg, int64_t message_arg) { + LDKErroneousField erroneous_field_arg_conv; + erroneous_field_arg_conv.inner = untag_ptr(erroneous_field_arg); + erroneous_field_arg_conv.is_owned = ptr_is_owned(erroneous_field_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(erroneous_field_arg_conv); + erroneous_field_arg_conv = ErroneousField_clone(&erroneous_field_arg_conv); + LDKUntrustedString message_arg_conv; + message_arg_conv.inner = untag_ptr(message_arg); + message_arg_conv.is_owned = ptr_is_owned(message_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_arg_conv); + message_arg_conv = UntrustedString_clone(&message_arg_conv); + LDKInvoiceError ret_var = InvoiceError_new(erroneous_field_arg_conv, message_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 InvoiceError_clone_ptr(LDKInvoiceError *NONNULL_PTR arg) { + LDKInvoiceError ret_var = InvoiceError_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_InvoiceError_clone_ptr(int64_t arg) { + LDKInvoiceError 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 = InvoiceError_clone_ptr(&arg_conv); return ret_conv; } -void CS_LDK_InitFeatures_set_shutdown_any_segwit_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_shutdown_any_segwit_optional(&this_arg_conv); +int64_t CS_LDK_InvoiceError_clone(int64_t orig) { + LDKInvoiceError 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; + LDKInvoiceError ret_var = InvoiceError_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_InitFeatures_set_shutdown_any_segwit_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_shutdown_any_segwit_required(&this_arg_conv); +void CS_LDK_ErroneousField_free(int64_t this_obj) { + LDKErroneousField this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ErroneousField_free(this_obj_conv); } -jboolean CS_LDK_InitFeatures_supports_shutdown_anysegwit(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_shutdown_anysegwit(&this_arg_conv); +int64_t CS_LDK_ErroneousField_get_tlv_fieldnum(int64_t this_ptr) { + LDKErroneousField this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = ErroneousField_get_tlv_fieldnum(&this_ptr_conv); return ret_conv; } -void CS_LDK_NodeFeatures_set_shutdown_any_segwit_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_shutdown_any_segwit_optional(&this_arg_conv); +void CS_LDK_ErroneousField_set_tlv_fieldnum(int64_t this_ptr, int64_t val) { + LDKErroneousField this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ErroneousField_set_tlv_fieldnum(&this_ptr_conv, val); } -void CS_LDK_NodeFeatures_set_shutdown_any_segwit_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_shutdown_any_segwit_required(&this_arg_conv); +int64_t CS_LDK_ErroneousField_get_suggested_value(int64_t this_ptr) { + LDKErroneousField this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = ErroneousField_get_suggested_value(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_NodeFeatures_supports_shutdown_anysegwit(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_shutdown_anysegwit(&this_arg_conv); - return ret_conv; +void CS_LDK_ErroneousField_set_suggested_value(int64_t this_ptr, int64_t val) { + LDKErroneousField this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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)); + ErroneousField_set_suggested_value(&this_ptr_conv, val_conv); } -jboolean CS_LDK_InitFeatures_requires_shutdown_anysegwit(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_shutdown_anysegwit(&this_arg_conv); - return ret_conv; +int64_t CS_LDK_ErroneousField_new(int64_t tlv_fieldnum_arg, int64_t suggested_value_arg) { + void* suggested_value_arg_ptr = untag_ptr(suggested_value_arg); + CHECK_ACCESS(suggested_value_arg_ptr); + LDKCOption_CVec_u8ZZ suggested_value_arg_conv = *(LDKCOption_CVec_u8ZZ*)(suggested_value_arg_ptr); + suggested_value_arg_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(suggested_value_arg)); + LDKErroneousField ret_var = ErroneousField_new(tlv_fieldnum_arg, suggested_value_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_NodeFeatures_requires_shutdown_anysegwit(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_shutdown_anysegwit(&this_arg_conv); +static inline uint64_t ErroneousField_clone_ptr(LDKErroneousField *NONNULL_PTR arg) { + LDKErroneousField ret_var = ErroneousField_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_ErroneousField_clone_ptr(int64_t arg) { + LDKErroneousField 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 = ErroneousField_clone_ptr(&arg_conv); return ret_conv; } -void CS_LDK_InitFeatures_set_taproot_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_taproot_optional(&this_arg_conv); +int64_t CS_LDK_ErroneousField_clone(int64_t orig) { + LDKErroneousField 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; + LDKErroneousField ret_var = ErroneousField_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_InitFeatures_set_taproot_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_taproot_required(&this_arg_conv); +int64_t CS_LDK_InvoiceError_from_string(jstring s) { + LDKStr s_conv = str_ref_to_owned_c(s); + LDKInvoiceError ret_var = InvoiceError_from_string(s_conv); + int64_t ret_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_InitFeatures_supports_taproot(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_taproot(&this_arg_conv); +jstring CS_LDK_InvoiceError_to_str(int64_t o) { + LDKInvoiceError o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = InvoiceError_to_str(&o_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); return ret_conv; } -void CS_LDK_NodeFeatures_set_taproot_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_taproot_optional(&this_arg_conv); +int8_tArray CS_LDK_InvoiceError_write(int64_t obj) { + LDKInvoiceError 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 = InvoiceError_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -void CS_LDK_NodeFeatures_set_taproot_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_taproot_required(&this_arg_conv); +int64_t CS_LDK_InvoiceError_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); + *ret_conv = InvoiceError_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_NodeFeatures_supports_taproot(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_taproot(&this_arg_conv); - return ret_conv; +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_ChannelTypeFeatures_set_taproot_optional(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_taproot_optional(&this_arg_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); } -void CS_LDK_ChannelTypeFeatures_set_taproot_required(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_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); - this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_taproot_required(&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); } -jboolean CS_LDK_ChannelTypeFeatures_supports_taproot(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +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); - this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_supports_taproot(&this_arg_conv); - return ret_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); } -jboolean CS_LDK_InitFeatures_requires_taproot(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +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); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_taproot(&this_arg_conv); - return ret_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); } -jboolean CS_LDK_NodeFeatures_requires_taproot(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +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); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_taproot(&this_arg_conv); - return ret_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); } -jboolean CS_LDK_ChannelTypeFeatures_requires_taproot(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +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); - this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_requires_taproot(&this_arg_conv); - return ret_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); } -void CS_LDK_InitFeatures_set_onion_messages_optional(int64_t this_arg) { - LDKInitFeatures this_arg_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); - this_arg_conv.is_owned = false; - InitFeatures_set_onion_messages_optional(&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); } -void CS_LDK_InitFeatures_set_onion_messages_required(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +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); - this_arg_conv.is_owned = false; - InitFeatures_set_onion_messages_required(&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); } -jboolean CS_LDK_InitFeatures_supports_onion_messages(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +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); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_onion_messages(&this_arg_conv); - return ret_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); } -void CS_LDK_NodeFeatures_set_onion_messages_optional(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +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); - this_arg_conv.is_owned = false; - NodeFeatures_set_onion_messages_optional(&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_NodeFeatures_set_onion_messages_required(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +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); - this_arg_conv.is_owned = false; - NodeFeatures_set_onion_messages_required(&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); } -jboolean CS_LDK_NodeFeatures_supports_onion_messages(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_onion_messages(&this_arg_conv); - return ret_conv; +void CS_LDK_UnsignedInvoiceRequest_free(int64_t this_obj) { + LDKUnsignedInvoiceRequest this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + UnsignedInvoiceRequest_free(this_obj_conv); } -jboolean CS_LDK_InitFeatures_requires_onion_messages(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_onion_messages(&this_arg_conv); - return ret_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; } - -jboolean CS_LDK_NodeFeatures_requires_onion_messages(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_onion_messages(&this_arg_conv); +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; } -void CS_LDK_InitFeatures_set_channel_type_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_channel_type_optional(&this_arg_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_InitFeatures_set_channel_type_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_channel_type_required(&this_arg_conv); +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); } -jboolean CS_LDK_InitFeatures_supports_channel_type(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_UnsignedInvoiceRequest_tagged_hash(int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_channel_type(&this_arg_conv); - return ret_conv; + LDKTaggedHash ret_var = UnsignedInvoiceRequest_tagged_hash(&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_NodeFeatures_set_channel_type_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_channel_type_optional(&this_arg_conv); +void CS_LDK_InvoiceRequest_free(int64_t this_obj) { + LDKInvoiceRequest this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InvoiceRequest_free(this_obj_conv); } -void CS_LDK_NodeFeatures_set_channel_type_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_channel_type_required(&this_arg_conv); +static inline uint64_t InvoiceRequest_clone_ptr(LDKInvoiceRequest *NONNULL_PTR arg) { + LDKInvoiceRequest ret_var = InvoiceRequest_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; } - -jboolean CS_LDK_NodeFeatures_supports_channel_type(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_channel_type(&this_arg_conv); +int64_t CS_LDK_InvoiceRequest_clone_ptr(int64_t arg) { + LDKInvoiceRequest arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = InvoiceRequest_clone_ptr(&arg_conv); return ret_conv; } -jboolean CS_LDK_InitFeatures_requires_channel_type(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_channel_type(&this_arg_conv); - return ret_conv; +int64_t CS_LDK_InvoiceRequest_clone(int64_t orig) { + LDKInvoiceRequest orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKInvoiceRequest ret_var = InvoiceRequest_clone(&orig_conv); + int64_t ret_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_NodeFeatures_requires_channel_type(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_channel_type(&this_arg_conv); - return ret_conv; +void CS_LDK_VerifiedInvoiceRequest_free(int64_t this_obj) { + LDKVerifiedInvoiceRequest this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + VerifiedInvoiceRequest_free(this_obj_conv); } -void CS_LDK_InitFeatures_set_scid_privacy_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_scid_privacy_optional(&this_arg_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_InitFeatures_set_scid_privacy_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_scid_privacy_required(&this_arg_conv); +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); } -jboolean CS_LDK_InitFeatures_supports_scid_privacy(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_scid_privacy(&this_arg_conv); +static inline uint64_t VerifiedInvoiceRequest_clone_ptr(LDKVerifiedInvoiceRequest *NONNULL_PTR arg) { + LDKVerifiedInvoiceRequest ret_var = VerifiedInvoiceRequest_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_VerifiedInvoiceRequest_clone_ptr(int64_t arg) { + LDKVerifiedInvoiceRequest 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 = VerifiedInvoiceRequest_clone_ptr(&arg_conv); return ret_conv; } -void CS_LDK_NodeFeatures_set_scid_privacy_optional(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_VerifiedInvoiceRequest_clone(int64_t orig) { + LDKVerifiedInvoiceRequest 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; + LDKVerifiedInvoiceRequest ret_var = VerifiedInvoiceRequest_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; +} + +ptrArray CS_LDK_UnsignedInvoiceRequest_chains(int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_scid_privacy_optional(&this_arg_conv); + LDKCVec_ThirtyTwoBytesZ ret_var = UnsignedInvoiceRequest_chains(&this_arg_conv); + ptrArray ret_arr = NULL; + ret_arr = init_ptrArray(ret_var.datalen, __LINE__); + int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8); + for (size_t i = 0; i < ret_var.datalen; i++) { + int8_tArray ret_conv_8_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_conv_8_arr->elems, ret_var.data[i].data, 32); + ret_arr_ptr[i] = ret_conv_8_arr; + } + + FREE(ret_var.data); + return ret_arr; } -void CS_LDK_NodeFeatures_set_scid_privacy_required(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_UnsignedInvoiceRequest_metadata(int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_scid_privacy_required(&this_arg_conv); + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = UnsignedInvoiceRequest_metadata(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_NodeFeatures_supports_scid_privacy(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_UnsignedInvoiceRequest_amount(int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_scid_privacy(&this_arg_conv); - return ret_conv; + 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; } -void CS_LDK_ChannelTypeFeatures_set_scid_privacy_optional(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +int64_t CS_LDK_UnsignedInvoiceRequest_description(int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_scid_privacy_optional(&this_arg_conv); + LDKPrintableString ret_var = UnsignedInvoiceRequest_description(&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_ChannelTypeFeatures_set_scid_privacy_required(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +int64_t CS_LDK_UnsignedInvoiceRequest_offer_features(int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_scid_privacy_required(&this_arg_conv); + LDKOfferFeatures ret_var = UnsignedInvoiceRequest_offer_features(&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_ChannelTypeFeatures_supports_scid_privacy(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +int64_t CS_LDK_UnsignedInvoiceRequest_absolute_expiry(int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_supports_scid_privacy(&this_arg_conv); - return ret_conv; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = UnsignedInvoiceRequest_absolute_expiry(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_InitFeatures_requires_scid_privacy(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_UnsignedInvoiceRequest_issuer(int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_scid_privacy(&this_arg_conv); - return ret_conv; + LDKPrintableString ret_var = UnsignedInvoiceRequest_issuer(&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_NodeFeatures_requires_scid_privacy(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_tArray CS_LDK_UnsignedInvoiceRequest_paths(int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_scid_privacy(&this_arg_conv); - return ret_conv; + LDKCVec_BlindedMessagePathZ ret_var = UnsignedInvoiceRequest_paths(&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 u = 0; u < ret_var.datalen; u++) { + LDKBlindedMessagePath ret_conv_20_var = ret_var.data[u]; + int64_t ret_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_20_var); + ret_conv_20_ref = tag_ptr(ret_conv_20_var.inner, ret_conv_20_var.is_owned); + ret_arr_ptr[u] = ret_conv_20_ref; + } + + FREE(ret_var.data); + return ret_arr; } -jboolean CS_LDK_ChannelTypeFeatures_requires_scid_privacy(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +int64_t CS_LDK_UnsignedInvoiceRequest_supported_quantity(int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_requires_scid_privacy(&this_arg_conv); - return ret_conv; + 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; } -void CS_LDK_Bolt11InvoiceFeatures_set_payment_metadata_optional(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +int8_tArray CS_LDK_UnsignedInvoiceRequest_signing_pubkey(int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_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_payment_metadata_optional(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, UnsignedInvoiceRequest_signing_pubkey(&this_arg_conv).compressed_form, 33); + return ret_arr; } -void CS_LDK_Bolt11InvoiceFeatures_set_payment_metadata_required(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +int8_tArray CS_LDK_UnsignedInvoiceRequest_payer_metadata(int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_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_payment_metadata_required(&this_arg_conv); + LDKu8slice ret_var = UnsignedInvoiceRequest_payer_metadata(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + return ret_arr; } -jboolean CS_LDK_Bolt11InvoiceFeatures_supports_payment_metadata(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +int8_tArray CS_LDK_UnsignedInvoiceRequest_chain(int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_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_payment_metadata(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, UnsignedInvoiceRequest_chain(&this_arg_conv).data, 32); + return ret_arr; } -jboolean CS_LDK_Bolt11InvoiceFeatures_requires_payment_metadata(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +int64_t CS_LDK_UnsignedInvoiceRequest_amount_msats(int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_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_payment_metadata(&this_arg_conv); - return ret_conv; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = UnsignedInvoiceRequest_amount_msats(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_InitFeatures_set_zero_conf_optional(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_UnsignedInvoiceRequest_invoice_request_features(int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_zero_conf_optional(&this_arg_conv); + LDKInvoiceRequestFeatures ret_var = UnsignedInvoiceRequest_invoice_request_features(&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_InitFeatures_set_zero_conf_required(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_UnsignedInvoiceRequest_quantity(int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_zero_conf_required(&this_arg_conv); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = UnsignedInvoiceRequest_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_InitFeatures_supports_zero_conf(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int8_tArray CS_LDK_UnsignedInvoiceRequest_payer_id(int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_zero_conf(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, UnsignedInvoiceRequest_payer_id(&this_arg_conv).compressed_form, 33); + return ret_arr; } -void CS_LDK_NodeFeatures_set_zero_conf_optional(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_UnsignedInvoiceRequest_payer_note(int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_zero_conf_optional(&this_arg_conv); + LDKPrintableString ret_var = UnsignedInvoiceRequest_payer_note(&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_NodeFeatures_set_zero_conf_required(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +ptrArray CS_LDK_InvoiceRequest_chains(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; - NodeFeatures_set_zero_conf_required(&this_arg_conv); + LDKCVec_ThirtyTwoBytesZ ret_var = InvoiceRequest_chains(&this_arg_conv); + ptrArray ret_arr = NULL; + ret_arr = init_ptrArray(ret_var.datalen, __LINE__); + int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8); + for (size_t i = 0; i < ret_var.datalen; i++) { + int8_tArray ret_conv_8_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_conv_8_arr->elems, ret_var.data[i].data, 32); + ret_arr_ptr[i] = ret_conv_8_arr; + } + + FREE(ret_var.data); + return ret_arr; } -jboolean CS_LDK_NodeFeatures_supports_zero_conf(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_InvoiceRequest_metadata(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; - jboolean ret_conv = NodeFeatures_supports_zero_conf(&this_arg_conv); - return ret_conv; + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = InvoiceRequest_metadata(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_ChannelTypeFeatures_set_zero_conf_optional(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +int64_t CS_LDK_InvoiceRequest_amount(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; - ChannelTypeFeatures_set_zero_conf_optional(&this_arg_conv); + 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; } -void CS_LDK_ChannelTypeFeatures_set_zero_conf_required(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +int64_t CS_LDK_InvoiceRequest_description(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; - ChannelTypeFeatures_set_zero_conf_required(&this_arg_conv); + LDKPrintableString ret_var = InvoiceRequest_description(&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_ChannelTypeFeatures_supports_zero_conf(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +int64_t CS_LDK_InvoiceRequest_offer_features(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; - jboolean ret_conv = ChannelTypeFeatures_supports_zero_conf(&this_arg_conv); - return ret_conv; + LDKOfferFeatures ret_var = InvoiceRequest_offer_features(&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_InitFeatures_requires_zero_conf(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_InvoiceRequest_absolute_expiry(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; - jboolean ret_conv = InitFeatures_requires_zero_conf(&this_arg_conv); - return ret_conv; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = InvoiceRequest_absolute_expiry(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_NodeFeatures_requires_zero_conf(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_InvoiceRequest_issuer(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; - jboolean ret_conv = NodeFeatures_requires_zero_conf(&this_arg_conv); - return ret_conv; + LDKPrintableString ret_var = InvoiceRequest_issuer(&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_ChannelTypeFeatures_requires_zero_conf(int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +int64_tArray CS_LDK_InvoiceRequest_paths(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; - jboolean ret_conv = ChannelTypeFeatures_requires_zero_conf(&this_arg_conv); - return ret_conv; + LDKCVec_BlindedMessagePathZ ret_var = InvoiceRequest_paths(&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 u = 0; u < ret_var.datalen; u++) { + LDKBlindedMessagePath ret_conv_20_var = ret_var.data[u]; + int64_t ret_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_20_var); + ret_conv_20_ref = tag_ptr(ret_conv_20_var.inner, ret_conv_20_var.is_owned); + ret_arr_ptr[u] = ret_conv_20_ref; + } + + FREE(ret_var.data); + return ret_arr; } -void CS_LDK_NodeFeatures_set_keysend_optional(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_InvoiceRequest_supported_quantity(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; - NodeFeatures_set_keysend_optional(&this_arg_conv); + 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; } -void CS_LDK_NodeFeatures_set_keysend_required(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int8_tArray CS_LDK_InvoiceRequest_signing_pubkey(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; - NodeFeatures_set_keysend_required(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, InvoiceRequest_signing_pubkey(&this_arg_conv).compressed_form, 33); + return ret_arr; } -jboolean CS_LDK_NodeFeatures_supports_keysend(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int8_tArray CS_LDK_InvoiceRequest_payer_metadata(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; - jboolean ret_conv = NodeFeatures_supports_keysend(&this_arg_conv); - return ret_conv; + LDKu8slice ret_var = InvoiceRequest_payer_metadata(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + return ret_arr; } -jboolean CS_LDK_NodeFeatures_requires_keysend(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int8_tArray CS_LDK_InvoiceRequest_chain(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; - jboolean ret_conv = NodeFeatures_requires_keysend(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, InvoiceRequest_chain(&this_arg_conv).data, 32); + return ret_arr; } -void CS_LDK_InitFeatures_set_trampoline_routing_optional(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_InvoiceRequest_amount_msats(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; - InitFeatures_set_trampoline_routing_optional(&this_arg_conv); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = InvoiceRequest_amount_msats(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_InitFeatures_set_trampoline_routing_required(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_InvoiceRequest_invoice_request_features(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; - InitFeatures_set_trampoline_routing_required(&this_arg_conv); + LDKInvoiceRequestFeatures ret_var = InvoiceRequest_invoice_request_features(&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_InitFeatures_supports_trampoline_routing(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +int64_t CS_LDK_InvoiceRequest_quantity(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; - jboolean ret_conv = InitFeatures_supports_trampoline_routing(&this_arg_conv); - return ret_conv; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = InvoiceRequest_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_NodeFeatures_set_trampoline_routing_optional(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int8_tArray CS_LDK_InvoiceRequest_payer_id(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; - NodeFeatures_set_trampoline_routing_optional(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, InvoiceRequest_payer_id(&this_arg_conv).compressed_form, 33); + return ret_arr; } -void CS_LDK_NodeFeatures_set_trampoline_routing_required(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_InvoiceRequest_payer_note(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; - NodeFeatures_set_trampoline_routing_required(&this_arg_conv); + LDKPrintableString ret_var = InvoiceRequest_payer_note(&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_NodeFeatures_supports_trampoline_routing(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +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; - jboolean ret_conv = NodeFeatures_supports_trampoline_routing(&this_arg_conv); - return ret_conv; + LDKCVec_BlindedPaymentPathZ 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(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); + else + payment_paths_constr.data = NULL; + int64_t* payment_paths_vals = payment_paths->elems; + for (size_t u = 0; u < payment_paths_constr.datalen; u++) { + int64_t payment_paths_conv_20 = payment_paths_vals[u]; + LDKBlindedPaymentPath payment_paths_conv_20_conv; + payment_paths_conv_20_conv.inner = untag_ptr(payment_paths_conv_20); + payment_paths_conv_20_conv.is_owned = ptr_is_owned(payment_paths_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_paths_conv_20_conv); + payment_paths_conv_20_conv = BlindedPaymentPath_clone(&payment_paths_conv_20_conv); + payment_paths_constr.data[u] = payment_paths_conv_20_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); } -void CS_LDK_Bolt11InvoiceFeatures_set_trampoline_routing_optional(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +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; - Bolt11InvoiceFeatures_set_trampoline_routing_optional(&this_arg_conv); -} - -void CS_LDK_Bolt11InvoiceFeatures_set_trampoline_routing_required(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; + LDKCVec_BlindedPaymentPathZ 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(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); + else + payment_paths_constr.data = NULL; + int64_t* payment_paths_vals = payment_paths->elems; + for (size_t u = 0; u < payment_paths_constr.datalen; u++) { + int64_t payment_paths_conv_20 = payment_paths_vals[u]; + LDKBlindedPaymentPath payment_paths_conv_20_conv; + payment_paths_conv_20_conv.inner = untag_ptr(payment_paths_conv_20); + payment_paths_conv_20_conv.is_owned = ptr_is_owned(payment_paths_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_paths_conv_20_conv); + payment_paths_conv_20_conv = BlindedPaymentPath_clone(&payment_paths_conv_20_conv); + payment_paths_constr.data[u] = payment_paths_conv_20_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_using_metadata(int64_t this_arg, int64_t key) { + 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; - Bolt11InvoiceFeatures_set_trampoline_routing_required(&this_arg_conv); + this_arg_conv = InvoiceRequest_clone(&this_arg_conv); + LDKExpandedKey key_conv; + key_conv.inner = untag_ptr(key); + key_conv.is_owned = ptr_is_owned(key); + CHECK_INNER_FIELD_ACCESS_OR_NULL(key_conv); + key_conv.is_owned = false; + LDKCResult_VerifiedInvoiceRequestNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_VerifiedInvoiceRequestNoneZ), "LDKCResult_VerifiedInvoiceRequestNoneZ"); + *ret_conv = InvoiceRequest_verify_using_metadata(this_arg_conv, &key_conv); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_Bolt11InvoiceFeatures_supports_trampoline_routing(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +int64_t CS_LDK_InvoiceRequest_verify_using_recipient_data(int64_t this_arg, int64_t nonce, int64_t key) { + 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 = InvoiceRequest_clone(&this_arg_conv); + LDKNonce nonce_conv; + nonce_conv.inner = untag_ptr(nonce); + nonce_conv.is_owned = ptr_is_owned(nonce); + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_conv); + nonce_conv = Nonce_clone(&nonce_conv); + LDKExpandedKey key_conv; + key_conv.inner = untag_ptr(key); + key_conv.is_owned = ptr_is_owned(key); + CHECK_INNER_FIELD_ACCESS_OR_NULL(key_conv); + key_conv.is_owned = false; + LDKCResult_VerifiedInvoiceRequestNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_VerifiedInvoiceRequestNoneZ), "LDKCResult_VerifiedInvoiceRequestNoneZ"); + *ret_conv = InvoiceRequest_verify_using_recipient_data(this_arg_conv, nonce_conv, &key_conv); + 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; - jboolean ret_conv = Bolt11InvoiceFeatures_supports_trampoline_routing(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); + memcpy(ret_arr->elems, InvoiceRequest_signature(&this_arg_conv).compact_form, 64); + return ret_arr; } -jboolean CS_LDK_InitFeatures_requires_trampoline_routing(int64_t this_arg) { - LDKInitFeatures this_arg_conv; +ptrArray CS_LDK_VerifiedInvoiceRequest_chains(int64_t this_arg) { + 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; - jboolean ret_conv = InitFeatures_requires_trampoline_routing(&this_arg_conv); - return ret_conv; + LDKCVec_ThirtyTwoBytesZ ret_var = VerifiedInvoiceRequest_chains(&this_arg_conv); + ptrArray ret_arr = NULL; + ret_arr = init_ptrArray(ret_var.datalen, __LINE__); + int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8); + for (size_t i = 0; i < ret_var.datalen; i++) { + int8_tArray ret_conv_8_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_conv_8_arr->elems, ret_var.data[i].data, 32); + ret_arr_ptr[i] = ret_conv_8_arr; + } + + FREE(ret_var.data); + return ret_arr; } -jboolean CS_LDK_NodeFeatures_requires_trampoline_routing(int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t CS_LDK_VerifiedInvoiceRequest_metadata(int64_t this_arg) { + 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; - jboolean ret_conv = NodeFeatures_requires_trampoline_routing(&this_arg_conv); - return ret_conv; + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = VerifiedInvoiceRequest_metadata(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_Bolt11InvoiceFeatures_requires_trampoline_routing(int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +int64_t CS_LDK_VerifiedInvoiceRequest_amount(int64_t this_arg) { + 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; - jboolean ret_conv = Bolt11InvoiceFeatures_requires_trampoline_routing(&this_arg_conv); - return ret_conv; + 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; } -void CS_LDK_ShutdownScript_free(int64_t this_obj) { - LDKShutdownScript this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ShutdownScript_free(this_obj_conv); +int64_t CS_LDK_VerifiedInvoiceRequest_description(int64_t this_arg) { + 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; + LDKPrintableString ret_var = VerifiedInvoiceRequest_description(&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; } -static inline uint64_t ShutdownScript_clone_ptr(LDKShutdownScript *NONNULL_PTR arg) { - LDKShutdownScript ret_var = ShutdownScript_clone(arg); +int64_t CS_LDK_VerifiedInvoiceRequest_offer_features(int64_t this_arg) { + 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; + LDKOfferFeatures ret_var = VerifiedInvoiceRequest_offer_features(&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_ShutdownScript_clone_ptr(int64_t arg) { - LDKShutdownScript arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = ShutdownScript_clone_ptr(&arg_conv); - return ret_conv; + +int64_t CS_LDK_VerifiedInvoiceRequest_absolute_expiry(int64_t this_arg) { + 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; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = VerifiedInvoiceRequest_absolute_expiry(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_ShutdownScript_clone(int64_t orig) { - LDKShutdownScript orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKShutdownScript ret_var = ShutdownScript_clone(&orig_conv); +int64_t CS_LDK_VerifiedInvoiceRequest_issuer(int64_t this_arg) { + 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; + LDKPrintableString ret_var = VerifiedInvoiceRequest_issuer(&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_ShutdownScript_eq(int64_t a, int64_t b) { - LDKShutdownScript a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKShutdownScript b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = ShutdownScript_eq(&a_conv, &b_conv); - return ret_conv; +int64_tArray CS_LDK_VerifiedInvoiceRequest_paths(int64_t this_arg) { + 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_BlindedMessagePathZ ret_var = VerifiedInvoiceRequest_paths(&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 u = 0; u < ret_var.datalen; u++) { + LDKBlindedMessagePath ret_conv_20_var = ret_var.data[u]; + int64_t ret_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_20_var); + ret_conv_20_ref = tag_ptr(ret_conv_20_var.inner, ret_conv_20_var.is_owned); + ret_arr_ptr[u] = ret_conv_20_ref; + } + + FREE(ret_var.data); + return ret_arr; } -void CS_LDK_InvalidShutdownScript_free(int64_t this_obj) { - LDKInvalidShutdownScript this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InvalidShutdownScript_free(this_obj_conv); +int64_t CS_LDK_VerifiedInvoiceRequest_supported_quantity(int64_t this_arg) { + 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; + 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; } -int8_tArray CS_LDK_InvalidShutdownScript_get_script(int64_t this_ptr) { - LDKInvalidShutdownScript this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_u8Z ret_var = InvalidShutdownScript_get_script(&this_ptr_conv); +int8_tArray CS_LDK_VerifiedInvoiceRequest_signing_pubkey(int64_t this_arg) { + 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; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, VerifiedInvoiceRequest_signing_pubkey(&this_arg_conv).compressed_form, 33); + return ret_arr; +} + +int8_tArray CS_LDK_VerifiedInvoiceRequest_payer_metadata(int64_t this_arg) { + 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; + LDKu8slice ret_var = VerifiedInvoiceRequest_payer_metadata(&this_arg_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); return ret_arr; } -void CS_LDK_InvalidShutdownScript_set_script(int64_t this_ptr, int8_tArray val) { - LDKInvalidShutdownScript this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_u8Z val_ref; - val_ref.datalen = val->arr_len; - val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val); - InvalidShutdownScript_set_script(&this_ptr_conv, val_ref); +int8_tArray CS_LDK_VerifiedInvoiceRequest_chain(int64_t this_arg) { + 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; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, VerifiedInvoiceRequest_chain(&this_arg_conv).data, 32); + return ret_arr; } -int64_t CS_LDK_InvalidShutdownScript_new(int8_tArray script_arg) { - LDKCVec_u8Z script_arg_ref; - script_arg_ref.datalen = script_arg->arr_len; - script_arg_ref.data = MALLOC(script_arg_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(script_arg_ref.data, script_arg->elems, script_arg_ref.datalen); FREE(script_arg); - LDKInvalidShutdownScript ret_var = InvalidShutdownScript_new(script_arg_ref); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +int64_t CS_LDK_VerifiedInvoiceRequest_amount_msats(int64_t this_arg) { + 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; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = VerifiedInvoiceRequest_amount_msats(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline uint64_t InvalidShutdownScript_clone_ptr(LDKInvalidShutdownScript *NONNULL_PTR arg) { - LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(arg); +int64_t CS_LDK_VerifiedInvoiceRequest_invoice_request_features(int64_t this_arg) { + 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; + LDKInvoiceRequestFeatures ret_var = VerifiedInvoiceRequest_invoice_request_features(&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_InvalidShutdownScript_clone_ptr(int64_t arg) { - LDKInvalidShutdownScript arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = InvalidShutdownScript_clone_ptr(&arg_conv); - return ret_conv; -} -int64_t CS_LDK_InvalidShutdownScript_clone(int64_t orig) { - LDKInvalidShutdownScript orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKInvalidShutdownScript ret_var = InvalidShutdownScript_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); +int64_t CS_LDK_VerifiedInvoiceRequest_quantity(int64_t this_arg) { + 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; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = VerifiedInvoiceRequest_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int8_tArray CS_LDK_ShutdownScript_write(int64_t obj) { - LDKShutdownScript obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ShutdownScript_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); +int8_tArray CS_LDK_VerifiedInvoiceRequest_payer_id(int64_t this_arg) { + 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; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, VerifiedInvoiceRequest_payer_id(&this_arg_conv).compressed_form, 33); return ret_arr; } -int64_t CS_LDK_ShutdownScript_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); - *ret_conv = ShutdownScript_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_ShutdownScript_new_p2wpkh(int8_tArray pubkey_hash) { - uint8_t pubkey_hash_arr[20]; - CHECK(pubkey_hash->arr_len == 20); - memcpy(pubkey_hash_arr, pubkey_hash->elems, 20); FREE(pubkey_hash); - uint8_t (*pubkey_hash_ref)[20] = &pubkey_hash_arr; - LDKShutdownScript ret_var = ShutdownScript_new_p2wpkh(pubkey_hash_ref); - int64_t ret_ref = 0; - 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_ShutdownScript_new_p2wsh(int8_tArray script_hash) { - uint8_t script_hash_arr[32]; - CHECK(script_hash->arr_len == 32); - memcpy(script_hash_arr, script_hash->elems, 32); FREE(script_hash); - uint8_t (*script_hash_ref)[32] = &script_hash_arr; - LDKShutdownScript ret_var = ShutdownScript_new_p2wsh(script_hash_ref); +int64_t CS_LDK_VerifiedInvoiceRequest_payer_note(int64_t this_arg) { + 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; + LDKPrintableString ret_var = VerifiedInvoiceRequest_payer_note(&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_ShutdownScript_new_witness_program(int64_t witness_program) { - void* witness_program_ptr = untag_ptr(witness_program); - CHECK_ACCESS(witness_program_ptr); - LDKWitnessProgram witness_program_conv = *(LDKWitnessProgram*)(witness_program_ptr); - witness_program_conv = WitnessProgram_clone((LDKWitnessProgram*)untag_ptr(witness_program)); - LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); - *ret_conv = ShutdownScript_new_witness_program(witness_program_conv); +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_BlindedPaymentPathZ 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(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); + else + payment_paths_constr.data = NULL; + int64_t* payment_paths_vals = payment_paths->elems; + for (size_t u = 0; u < payment_paths_constr.datalen; u++) { + int64_t payment_paths_conv_20 = payment_paths_vals[u]; + LDKBlindedPaymentPath payment_paths_conv_20_conv; + payment_paths_conv_20_conv.inner = untag_ptr(payment_paths_conv_20); + payment_paths_conv_20_conv.is_owned = ptr_is_owned(payment_paths_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_paths_conv_20_conv); + payment_paths_conv_20_conv = BlindedPaymentPath_clone(&payment_paths_conv_20_conv); + payment_paths_constr.data[u] = payment_paths_conv_20_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); } -int8_tArray CS_LDK_ShutdownScript_into_inner(int64_t this_arg) { - LDKShutdownScript this_arg_conv; +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 = ShutdownScript_clone(&this_arg_conv); - LDKCVec_u8Z ret_var = ShutdownScript_into_inner(this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; + this_arg_conv.is_owned = false; + LDKCVec_BlindedPaymentPathZ 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(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); + else + payment_paths_constr.data = NULL; + int64_t* payment_paths_vals = payment_paths->elems; + for (size_t u = 0; u < payment_paths_constr.datalen; u++) { + int64_t payment_paths_conv_20 = payment_paths_vals[u]; + LDKBlindedPaymentPath payment_paths_conv_20_conv; + payment_paths_conv_20_conv.inner = untag_ptr(payment_paths_conv_20); + payment_paths_conv_20_conv.is_owned = ptr_is_owned(payment_paths_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_paths_conv_20_conv); + payment_paths_conv_20_conv = BlindedPaymentPath_clone(&payment_paths_conv_20_conv); + payment_paths_constr.data[u] = payment_paths_conv_20_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); } -int8_tArray CS_LDK_ShutdownScript_as_legacy_pubkey(int64_t this_arg) { - LDKShutdownScript this_arg_conv; +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; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, ShutdownScript_as_legacy_pubkey(&this_arg_conv).compressed_form, 33); - return ret_arr; + LDKCVec_BlindedPaymentPathZ 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(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); + else + payment_paths_constr.data = NULL; + int64_t* payment_paths_vals = payment_paths->elems; + for (size_t u = 0; u < payment_paths_constr.datalen; u++) { + int64_t payment_paths_conv_20 = payment_paths_vals[u]; + LDKBlindedPaymentPath payment_paths_conv_20_conv; + payment_paths_conv_20_conv.inner = untag_ptr(payment_paths_conv_20); + payment_paths_conv_20_conv.is_owned = ptr_is_owned(payment_paths_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_paths_conv_20_conv); + payment_paths_conv_20_conv = BlindedPaymentPath_clone(&payment_paths_conv_20_conv); + payment_paths_constr.data[u] = payment_paths_conv_20_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); } -jboolean CS_LDK_ShutdownScript_is_compatible(int64_t this_arg, int64_t features) { - LDKShutdownScript this_arg_conv; +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; - LDKInitFeatures features_conv; - features_conv.inner = untag_ptr(features); - features_conv.is_owned = ptr_is_owned(features); - CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); - features_conv.is_owned = false; - jboolean ret_conv = ShutdownScript_is_compatible(&this_arg_conv, &features_conv); - return ret_conv; + LDKCVec_BlindedPaymentPathZ 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(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); + else + payment_paths_constr.data = NULL; + int64_t* payment_paths_vals = payment_paths->elems; + for (size_t u = 0; u < payment_paths_constr.datalen; u++) { + int64_t payment_paths_conv_20 = payment_paths_vals[u]; + LDKBlindedPaymentPath payment_paths_conv_20_conv; + payment_paths_conv_20_conv.inner = untag_ptr(payment_paths_conv_20); + payment_paths_conv_20_conv.is_owned = ptr_is_owned(payment_paths_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_paths_conv_20_conv); + payment_paths_conv_20_conv = BlindedPaymentPath_clone(&payment_paths_conv_20_conv); + payment_paths_constr.data[u] = payment_paths_conv_20_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); } -jstring CS_LDK_ShutdownScript_to_str(int64_t o) { - LDKShutdownScript o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = ShutdownScript_to_str(&o_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; +int8_tArray CS_LDK_UnsignedInvoiceRequest_write(int64_t obj) { + LDKUnsignedInvoiceRequest 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 = UnsignedInvoiceRequest_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -void CS_LDK_ChannelId_free(int64_t this_obj) { - LDKChannelId this_obj_conv; +int8_tArray CS_LDK_InvoiceRequest_write(int64_t obj) { + LDKInvoiceRequest obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = InvoiceRequest_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +void 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); - ChannelId_free(this_obj_conv); + InvoiceRequestFields_free(this_obj_conv); } -int8_tArray CS_LDK_ChannelId_get_a(int64_t this_ptr) { - LDKChannelId this_ptr_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(32, __LINE__); - memcpy(ret_arr->elems, *ChannelId_get_a(&this_ptr_conv), 32); + 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_ChannelId_set_a(int64_t this_ptr, int8_tArray val) { - LDKChannelId this_ptr_conv; +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; - 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); + 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_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; -} +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; +} -static inline uint64_t ChannelId_clone_ptr(LDKChannelId *NONNULL_PTR arg) { - LDKChannelId ret_var = ChannelId_clone(arg); +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; } -int64_t CS_LDK_ChannelId_clone_ptr(int64_t arg) { - LDKChannelId arg_conv; + +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 = ChannelId_clone_ptr(&arg_conv); + int64_t ret_conv = InvoiceRequestFields_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_ChannelId_clone(int64_t orig) { - LDKChannelId orig_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; - LDKChannelId ret_var = ChannelId_clone(&orig_conv); + 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_ChannelId_eq(int64_t a, int64_t b) { - LDKChannelId a_conv; +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; - LDKChannelId b_conv; + 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 = ChannelId_eq(&a_conv, &b_conv); + jboolean ret_conv = InvoiceRequestFields_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; +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_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 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); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + TaggedHash_free(this_obj_conv); +} + +static inline uint64_t TaggedHash_clone_ptr(LDKTaggedHash *NONNULL_PTR arg) { + LDKTaggedHash ret_var = TaggedHash_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_TaggedHash_clone_ptr(int64_t arg) { + LDKTaggedHash 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 = TaggedHash_clone_ptr(&arg_conv); + return ret_conv; +} -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 CS_LDK_TaggedHash_clone(int64_t orig) { + LDKTaggedHash 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; + LDKTaggedHash ret_var = TaggedHash_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_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); +int8_tArray CS_LDK_TaggedHash_as_digest(int64_t this_arg) { + LDKTaggedHash this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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, *TaggedHash_as_digest(&this_arg_conv), 32); + return ret_arr; +} + +jstring CS_LDK_TaggedHash_tag(int64_t this_arg) { + LDKTaggedHash this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKStr ret_str = TaggedHash_tag(&this_arg_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +int8_tArray CS_LDK_TaggedHash_merkle_root(int64_t this_arg) { + LDKTaggedHash this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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, TaggedHash_merkle_root(&this_arg_conv).data, 32); + 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_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); +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_ChannelId_new_zero() { - LDKChannelId ret_var = ChannelId_new_zero(); +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_Nonce_free(int64_t this_obj) { + LDKNonce this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Nonce_free(this_obj_conv); +} + +static inline uint64_t Nonce_clone_ptr(LDKNonce *NONNULL_PTR arg) { + LDKNonce ret_var = Nonce_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; } - -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); +int64_t CS_LDK_Nonce_clone_ptr(int64_t arg) { + LDKNonce 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 = Nonce_clone_ptr(&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 CS_LDK_Nonce_clone(int64_t orig) { + LDKNonce 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; + LDKNonce ret_var = Nonce_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_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); +jboolean CS_LDK_Nonce_eq(int64_t a, int64_t b) { + LDKNonce a_conv; + 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; + LDKNonce 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 = Nonce_eq(&a_conv, &b_conv); + return ret_conv; +} + +int64_t CS_LDK_Nonce_from_entropy_source(int64_t entropy_source) { + 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); + } + LDKNonce ret_var = Nonce_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; } -int8_tArray CS_LDK_ChannelId_write(int64_t obj) { - LDKChannelId obj_conv; +int8_tArray CS_LDK_Nonce_as_slice(int64_t this_arg) { + LDKNonce this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKu8slice ret_var = Nonce_as_slice(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + return ret_arr; +} + +int8_tArray CS_LDK_Nonce_write(int64_t obj) { + LDKNonce 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); + LDKCVec_u8Z ret_var = Nonce_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) { +int64_t CS_LDK_Nonce_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); + LDKCResult_NonceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonceDecodeErrorZ), "LDKCResult_NonceDecodeErrorZ"); + *ret_conv = Nonce_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -jstring CS_LDK_ChannelId_to_str(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; - LDKStr ret_str = ChannelId_to_str(&o_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; +void CS_LDK_Bolt12ParseError_free(int64_t this_obj) { + LDKBolt12ParseError this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Bolt12ParseError_free(this_obj_conv); } -void CS_LDK_Retry_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); - LDKRetry this_ptr_conv = *(LDKRetry*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Retry_free(this_ptr_conv); +static inline uint64_t Bolt12ParseError_clone_ptr(LDKBolt12ParseError *NONNULL_PTR arg) { + LDKBolt12ParseError ret_var = Bolt12ParseError_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_Bolt12ParseError_clone_ptr(int64_t arg) { + LDKBolt12ParseError 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 = Bolt12ParseError_clone_ptr(&arg_conv); + return ret_conv; } -static inline uint64_t Retry_clone_ptr(LDKRetry *NONNULL_PTR arg) { - LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); - *ret_copy = Retry_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); +int64_t CS_LDK_Bolt12ParseError_clone(int64_t orig) { + LDKBolt12ParseError 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; + LDKBolt12ParseError ret_var = Bolt12ParseError_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_Retry_clone_ptr(int64_t arg) { - LDKRetry* arg_conv = (LDKRetry*)untag_ptr(arg); - int64_t ret_conv = Retry_clone_ptr(arg_conv); + +int32_t CS_LDK_Bolt12SemanticError_clone(int64_t orig) { + LDKBolt12SemanticError* orig_conv = (LDKBolt12SemanticError*)untag_ptr(orig); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_clone(orig_conv)); return ret_conv; } -int64_t CS_LDK_Retry_clone(int64_t orig) { - LDKRetry* orig_conv = (LDKRetry*)untag_ptr(orig); - LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); - *ret_copy = Retry_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_Bolt12SemanticError_already_expired() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_already_expired()); + return ret_conv; } -int64_t CS_LDK_Retry_attempts(int32_t a) { - LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); - *ret_copy = Retry_attempts(a); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_Bolt12SemanticError_unsupported_chain() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unsupported_chain()); + return ret_conv; } -int64_t CS_LDK_Retry_timeout(int64_t a) { - LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); - *ret_copy = Retry_timeout(a); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_Bolt12SemanticError_unexpected_chain() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unexpected_chain()); + return ret_conv; } -jboolean CS_LDK_Retry_eq(int64_t a, int64_t b) { - LDKRetry* a_conv = (LDKRetry*)untag_ptr(a); - LDKRetry* b_conv = (LDKRetry*)untag_ptr(b); - jboolean ret_conv = Retry_eq(a_conv, b_conv); +int32_t CS_LDK_Bolt12SemanticError_missing_amount() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_amount()); return ret_conv; } -int64_t CS_LDK_Retry_hash(int64_t o) { - LDKRetry* o_conv = (LDKRetry*)untag_ptr(o); - int64_t ret_conv = Retry_hash(o_conv); +int32_t CS_LDK_Bolt12SemanticError_invalid_amount() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_invalid_amount()); return ret_conv; } -int8_tArray CS_LDK_Retry_write(int64_t obj) { - LDKRetry* obj_conv = (LDKRetry*)untag_ptr(obj); - LDKCVec_u8Z ret_var = Retry_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_Bolt12SemanticError_insufficient_amount() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_insufficient_amount()); + return ret_conv; } -int64_t CS_LDK_Retry_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_RetryDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RetryDecodeErrorZ), "LDKCResult_RetryDecodeErrorZ"); - *ret_conv = Retry_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +int32_t CS_LDK_Bolt12SemanticError_unexpected_amount() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unexpected_amount()); + return ret_conv; } -int32_t CS_LDK_RetryableSendFailure_clone(int64_t orig) { - LDKRetryableSendFailure* orig_conv = (LDKRetryableSendFailure*)untag_ptr(orig); - int32_t ret_conv = LDKRetryableSendFailure_to_cs(RetryableSendFailure_clone(orig_conv)); +int32_t CS_LDK_Bolt12SemanticError_unsupported_currency() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unsupported_currency()); return ret_conv; } -int32_t CS_LDK_RetryableSendFailure_payment_expired() { - int32_t ret_conv = LDKRetryableSendFailure_to_cs(RetryableSendFailure_payment_expired()); +int32_t CS_LDK_Bolt12SemanticError_unknown_required_features() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unknown_required_features()); return ret_conv; } -int32_t CS_LDK_RetryableSendFailure_route_not_found() { - int32_t ret_conv = LDKRetryableSendFailure_to_cs(RetryableSendFailure_route_not_found()); +int32_t CS_LDK_Bolt12SemanticError_unexpected_features() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unexpected_features()); return ret_conv; } -int32_t CS_LDK_RetryableSendFailure_duplicate_payment() { - int32_t ret_conv = LDKRetryableSendFailure_to_cs(RetryableSendFailure_duplicate_payment()); +int32_t CS_LDK_Bolt12SemanticError_missing_description() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_description()); return ret_conv; } -jboolean CS_LDK_RetryableSendFailure_eq(int64_t a, int64_t b) { - LDKRetryableSendFailure* a_conv = (LDKRetryableSendFailure*)untag_ptr(a); - LDKRetryableSendFailure* b_conv = (LDKRetryableSendFailure*)untag_ptr(b); - jboolean ret_conv = RetryableSendFailure_eq(a_conv, b_conv); +int32_t CS_LDK_Bolt12SemanticError_missing_signing_pubkey() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_signing_pubkey()); return ret_conv; } -void CS_LDK_PaymentSendFailure_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); - LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - PaymentSendFailure_free(this_ptr_conv); +int32_t CS_LDK_Bolt12SemanticError_invalid_signing_pubkey() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_invalid_signing_pubkey()); + return ret_conv; } -static inline uint64_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg) { - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = PaymentSendFailure_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_Bolt12SemanticError_unexpected_signing_pubkey() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unexpected_signing_pubkey()); + return ret_conv; } -int64_t CS_LDK_PaymentSendFailure_clone_ptr(int64_t arg) { - LDKPaymentSendFailure* arg_conv = (LDKPaymentSendFailure*)untag_ptr(arg); - int64_t ret_conv = PaymentSendFailure_clone_ptr(arg_conv); + +int32_t CS_LDK_Bolt12SemanticError_missing_quantity() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_quantity()); return ret_conv; } -int64_t CS_LDK_PaymentSendFailure_clone(int64_t orig) { - LDKPaymentSendFailure* orig_conv = (LDKPaymentSendFailure*)untag_ptr(orig); - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = PaymentSendFailure_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_Bolt12SemanticError_invalid_quantity() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_invalid_quantity()); + return ret_conv; } -int64_t CS_LDK_PaymentSendFailure_parameter_error(int64_t a) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKAPIError a_conv = *(LDKAPIError*)(a_ptr); - a_conv = APIError_clone((LDKAPIError*)untag_ptr(a)); - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = PaymentSendFailure_parameter_error(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_Bolt12SemanticError_unexpected_quantity() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unexpected_quantity()); + return ret_conv; } -int64_t CS_LDK_PaymentSendFailure_path_parameter_error(int64_tArray a) { - LDKCVec_CResult_NoneAPIErrorZZ a_constr; - a_constr.datalen = a->arr_len; - if (a_constr.datalen > 0) - a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements"); - else - a_constr.data = NULL; - int64_t* a_vals = a->elems; - for (size_t w = 0; w < a_constr.datalen; w++) { - int64_t a_conv_22 = a_vals[w]; - void* a_conv_22_ptr = untag_ptr(a_conv_22); - CHECK_ACCESS(a_conv_22_ptr); - LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(a_conv_22_ptr); - a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)untag_ptr(a_conv_22)); - a_constr.data[w] = a_conv_22_conv; - } - FREE(a); - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = PaymentSendFailure_path_parameter_error(a_constr); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_Bolt12SemanticError_invalid_metadata() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_invalid_metadata()); + return ret_conv; } -int64_t CS_LDK_PaymentSendFailure_all_failed_resend_safe(int64_tArray a) { - LDKCVec_APIErrorZ a_constr; - a_constr.datalen = a->arr_len; - if (a_constr.datalen > 0) - a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements"); - else - a_constr.data = NULL; - int64_t* a_vals = a->elems; - for (size_t k = 0; k < a_constr.datalen; k++) { - int64_t a_conv_10 = a_vals[k]; - void* a_conv_10_ptr = untag_ptr(a_conv_10); - CHECK_ACCESS(a_conv_10_ptr); - LDKAPIError a_conv_10_conv = *(LDKAPIError*)(a_conv_10_ptr); - a_conv_10_conv = APIError_clone((LDKAPIError*)untag_ptr(a_conv_10)); - a_constr.data[k] = a_conv_10_conv; - } - FREE(a); - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = PaymentSendFailure_all_failed_resend_safe(a_constr); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_Bolt12SemanticError_unexpected_metadata() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unexpected_metadata()); + return ret_conv; } -int64_t CS_LDK_PaymentSendFailure_duplicate_payment() { - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = PaymentSendFailure_duplicate_payment(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_Bolt12SemanticError_missing_payer_metadata() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_payer_metadata()); + return ret_conv; } -int64_t CS_LDK_PaymentSendFailure_partial_failure(int64_tArray results, int64_t failed_paths_retry, int8_tArray payment_id) { - LDKCVec_CResult_NoneAPIErrorZZ results_constr; - results_constr.datalen = results->arr_len; - if (results_constr.datalen > 0) - results_constr.data = MALLOC(results_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements"); - else - results_constr.data = NULL; - int64_t* results_vals = results->elems; - for (size_t w = 0; w < results_constr.datalen; w++) { - int64_t results_conv_22 = results_vals[w]; - void* results_conv_22_ptr = untag_ptr(results_conv_22); - CHECK_ACCESS(results_conv_22_ptr); - LDKCResult_NoneAPIErrorZ results_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(results_conv_22_ptr); - results_constr.data[w] = results_conv_22_conv; - } - FREE(results); - LDKRouteParameters failed_paths_retry_conv; - failed_paths_retry_conv.inner = untag_ptr(failed_paths_retry); - failed_paths_retry_conv.is_owned = ptr_is_owned(failed_paths_retry); - CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_conv); - failed_paths_retry_conv = RouteParameters_clone(&failed_paths_retry_conv); - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = PaymentSendFailure_partial_failure(results_constr, failed_paths_retry_conv, payment_id_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_Bolt12SemanticError_missing_payer_id() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_payer_id()); + return ret_conv; } -jboolean CS_LDK_PaymentSendFailure_eq(int64_t a, int64_t b) { - LDKPaymentSendFailure* a_conv = (LDKPaymentSendFailure*)untag_ptr(a); - LDKPaymentSendFailure* b_conv = (LDKPaymentSendFailure*)untag_ptr(b); - jboolean ret_conv = PaymentSendFailure_eq(a_conv, b_conv); +int32_t CS_LDK_Bolt12SemanticError_duplicate_payment_id() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_duplicate_payment_id()); return ret_conv; } -void CS_LDK_ProbeSendFailure_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); - LDKProbeSendFailure this_ptr_conv = *(LDKProbeSendFailure*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - ProbeSendFailure_free(this_ptr_conv); +int32_t CS_LDK_Bolt12SemanticError_missing_paths() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_paths()); + return ret_conv; } -static inline uint64_t ProbeSendFailure_clone_ptr(LDKProbeSendFailure *NONNULL_PTR arg) { - LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); - *ret_copy = ProbeSendFailure_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_Bolt12SemanticError_unexpected_paths() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unexpected_paths()); + return ret_conv; } -int64_t CS_LDK_ProbeSendFailure_clone_ptr(int64_t arg) { - LDKProbeSendFailure* arg_conv = (LDKProbeSendFailure*)untag_ptr(arg); - int64_t ret_conv = ProbeSendFailure_clone_ptr(arg_conv); + +int32_t CS_LDK_Bolt12SemanticError_invalid_pay_info() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_invalid_pay_info()); return ret_conv; } -int64_t CS_LDK_ProbeSendFailure_clone(int64_t orig) { - LDKProbeSendFailure* orig_conv = (LDKProbeSendFailure*)untag_ptr(orig); - LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); - *ret_copy = ProbeSendFailure_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_Bolt12SemanticError_missing_creation_time() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_creation_time()); + return ret_conv; } -int64_t CS_LDK_ProbeSendFailure_route_not_found() { - LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); - *ret_copy = ProbeSendFailure_route_not_found(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_Bolt12SemanticError_missing_payment_hash() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_payment_hash()); + return ret_conv; } -int64_t CS_LDK_ProbeSendFailure_sending_failed(int64_t a) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKPaymentSendFailure a_conv = *(LDKPaymentSendFailure*)(a_ptr); - a_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(a)); - LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); - *ret_copy = ProbeSendFailure_sending_failed(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_Bolt12SemanticError_unexpected_payment_hash() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unexpected_payment_hash()); + return ret_conv; } -jboolean CS_LDK_ProbeSendFailure_eq(int64_t a, int64_t b) { - LDKProbeSendFailure* a_conv = (LDKProbeSendFailure*)untag_ptr(a); - LDKProbeSendFailure* b_conv = (LDKProbeSendFailure*)untag_ptr(b); - jboolean ret_conv = ProbeSendFailure_eq(a_conv, b_conv); +int32_t CS_LDK_Bolt12SemanticError_missing_signature() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_signature()); return ret_conv; } -void CS_LDK_RecipientOnionFields_free(int64_t this_obj) { - LDKRecipientOnionFields this_obj_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); - RecipientOnionFields_free(this_obj_conv); -} - -int64_t CS_LDK_RecipientOnionFields_get_payment_secret(int64_t this_ptr) { - LDKRecipientOnionFields this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); - *ret_copy = RecipientOnionFields_get_payment_secret(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -void CS_LDK_RecipientOnionFields_set_payment_secret(int64_t this_ptr, int64_t val) { - LDKRecipientOnionFields this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_ThirtyTwoBytesZ val_conv = *(LDKCOption_ThirtyTwoBytesZ*)(val_ptr); - val_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(val)); - RecipientOnionFields_set_payment_secret(&this_ptr_conv, val_conv); -} - -int64_t CS_LDK_RecipientOnionFields_get_payment_metadata(int64_t this_ptr) { - LDKRecipientOnionFields this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = RecipientOnionFields_get_payment_metadata(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -void CS_LDK_RecipientOnionFields_set_payment_metadata(int64_t this_ptr, int64_t val) { - LDKRecipientOnionFields this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_CVec_u8ZZ val_conv = *(LDKCOption_CVec_u8ZZ*)(val_ptr); - val_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(val)); - RecipientOnionFields_set_payment_metadata(&this_ptr_conv, val_conv); + RefundMaybeWithDerivedMetadataBuilder_free(this_obj_conv); } -static inline uint64_t RecipientOnionFields_clone_ptr(LDKRecipientOnionFields *NONNULL_PTR arg) { - LDKRecipientOnionFields ret_var = RecipientOnionFields_clone(arg); +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_RecipientOnionFields_clone_ptr(int64_t arg) { - LDKRecipientOnionFields arg_conv; +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 = RecipientOnionFields_clone_ptr(&arg_conv); + int64_t ret_conv = RefundMaybeWithDerivedMetadataBuilder_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_RecipientOnionFields_clone(int64_t orig) { - LDKRecipientOnionFields orig_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; - LDKRecipientOnionFields ret_var = RecipientOnionFields_clone(&orig_conv); + 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; } -jboolean CS_LDK_RecipientOnionFields_eq(int64_t a, int64_t b) { - LDKRecipientOnionFields a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKRecipientOnionFields b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = RecipientOnionFields_eq(&a_conv, &b_conv); - return ret_conv; -} - -int8_tArray CS_LDK_RecipientOnionFields_write(int64_t obj) { - LDKRecipientOnionFields obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = RecipientOnionFields_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +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_RecipientOnionFields_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_RecipientOnionFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsDecodeErrorZ), "LDKCResult_RecipientOnionFieldsDecodeErrorZ"); - *ret_conv = RecipientOnionFields_read(ser_ref); - FREE(ser); +int64_t CS_LDK_RefundMaybeWithDerivedMetadataBuilder_deriving_payer_id(int8_tArray node_id, int64_t expanded_key, int64_t nonce, 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; + LDKNonce nonce_conv; + nonce_conv.inner = untag_ptr(nonce); + nonce_conv.is_owned = ptr_is_owned(nonce); + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_conv); + nonce_conv = Nonce_clone(&nonce_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, nonce_conv, amount_msats, payment_id_ref); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_RecipientOnionFields_secret_only(int8_tArray payment_secret) { - LDKThirtyTwoBytes payment_secret_ref; - CHECK(payment_secret->arr_len == 32); - memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret); - LDKRecipientOnionFields ret_var = RecipientOnionFields_secret_only(payment_secret_ref); - int64_t ret_ref = 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_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); } -int64_t CS_LDK_RecipientOnionFields_spontaneous_empty() { - LDKRecipientOnionFields ret_var = RecipientOnionFields_spontaneous_empty(); - int64_t ret_ref = 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_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); } -int64_t CS_LDK_RecipientOnionFields_with_custom_tlvs(int64_t this_arg, int64_tArray custom_tlvs) { - LDKRecipientOnionFields this_arg_conv; +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 = RecipientOnionFields_clone(&this_arg_conv); - LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs_constr; - custom_tlvs_constr.datalen = custom_tlvs->arr_len; - if (custom_tlvs_constr.datalen > 0) - custom_tlvs_constr.data = MALLOC(custom_tlvs_constr.datalen * sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKCVec_C2Tuple_u64CVec_u8ZZZ Elements"); - else - custom_tlvs_constr.data = NULL; - int64_t* custom_tlvs_vals = custom_tlvs->elems; - for (size_t x = 0; x < custom_tlvs_constr.datalen; x++) { - int64_t custom_tlvs_conv_23 = custom_tlvs_vals[x]; - void* custom_tlvs_conv_23_ptr = untag_ptr(custom_tlvs_conv_23); - CHECK_ACCESS(custom_tlvs_conv_23_ptr); - LDKC2Tuple_u64CVec_u8ZZ custom_tlvs_conv_23_conv = *(LDKC2Tuple_u64CVec_u8ZZ*)(custom_tlvs_conv_23_ptr); - custom_tlvs_conv_23_conv = C2Tuple_u64CVec_u8ZZ_clone((LDKC2Tuple_u64CVec_u8ZZ*)untag_ptr(custom_tlvs_conv_23)); - custom_tlvs_constr.data[x] = custom_tlvs_conv_23_conv; - } - FREE(custom_tlvs); - LDKCResult_RecipientOnionFieldsNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsNoneZ), "LDKCResult_RecipientOnionFieldsNoneZ"); - *ret_conv = RecipientOnionFields_with_custom_tlvs(this_arg_conv, custom_tlvs_constr); - return tag_ptr(ret_conv, true); + this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKStr issuer_conv = str_ref_to_owned_c(issuer); + RefundMaybeWithDerivedMetadataBuilder_issuer(this_arg_conv, issuer_conv); } -int64_tArray CS_LDK_RecipientOnionFields_custom_tlvs(int64_t this_arg) { - LDKRecipientOnionFields this_arg_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.is_owned = false; - LDKCVec_C2Tuple_u64CVec_u8ZZZ ret_var = RecipientOnionFields_custom_tlvs(&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 x = 0; x < ret_var.datalen; x++) { - LDKC2Tuple_u64CVec_u8ZZ* ret_conv_23_conv = MALLOC(sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKC2Tuple_u64CVec_u8ZZ"); - *ret_conv_23_conv = ret_var.data[x]; - ret_arr_ptr[x] = tag_ptr(ret_conv_23_conv, true); - } - - FREE(ret_var.data); - return ret_arr; + this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKBlindedMessagePath 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 = BlindedMessagePath_clone(&path_conv); + RefundMaybeWithDerivedMetadataBuilder_path(this_arg_conv, path_conv); } -void CS_LDK_CustomMessageReader_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); - LDKCustomMessageReader this_ptr_conv = *(LDKCustomMessageReader*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - CustomMessageReader_free(this_ptr_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); } -static inline uint64_t Type_clone_ptr(LDKType *NONNULL_PTR arg) { - LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType"); - *ret_ret = Type_clone(arg); - return tag_ptr(ret_ret, true); -} -int64_t CS_LDK_Type_clone_ptr(int64_t arg) { - void* arg_ptr = untag_ptr(arg); - if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); } - LDKType* arg_conv = (LDKType*)arg_ptr; - int64_t ret_conv = Type_clone_ptr(arg_conv); - return ret_conv; +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); } -int64_t CS_LDK_Type_clone(int64_t orig) { - void* orig_ptr = untag_ptr(orig); - if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); } - LDKType* orig_conv = (LDKType*)orig_ptr; - LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType"); - *ret_ret = Type_clone(orig_conv); - return tag_ptr(ret_ret, true); +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); } -void CS_LDK_Type_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); - LDKType this_ptr_conv = *(LDKType*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Type_free(this_ptr_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_OfferId_free(int64_t this_obj) { - LDKOfferId this_obj_conv; +void CS_LDK_Refund_free(int64_t this_obj) { + LDKRefund this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - 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; + Refund_free(this_obj_conv); } -static inline uint64_t OfferId_clone_ptr(LDKOfferId *NONNULL_PTR arg) { - LDKOfferId ret_var = OfferId_clone(arg); +static inline uint64_t Refund_clone_ptr(LDKRefund *NONNULL_PTR arg) { + LDKRefund ret_var = Refund_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; +int64_t CS_LDK_Refund_clone_ptr(int64_t arg) { + LDKRefund arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = OfferId_clone_ptr(&arg_conv); + int64_t ret_conv = Refund_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_OfferId_clone(int64_t orig) { - LDKOfferId orig_conv; +int64_t CS_LDK_Refund_clone(int64_t orig) { + LDKRefund orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKOfferId ret_var = OfferId_clone(&orig_conv); + LDKRefund ret_var = Refund_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_Refund_description(int64_t this_arg) { + LDKRefund this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKPrintableString ret_var = Refund_description(&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_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); +int64_t CS_LDK_Refund_absolute_expiry(int64_t this_arg) { + LDKRefund this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = Refund_absolute_expiry(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); 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); +jboolean CS_LDK_Refund_is_expired(int64_t this_arg) { + LDKRefund this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Refund_is_expired(&this_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; +jboolean CS_LDK_Refund_is_expired_no_std(int64_t this_arg, int64_t duration_since_epoch) { + LDKRefund this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Refund_is_expired_no_std(&this_arg_conv, duration_since_epoch); + return ret_conv; } -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 CS_LDK_Refund_issuer(int64_t this_arg) { + LDKRefund this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKPrintableString ret_var = Refund_issuer(&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_OfferWithExplicitMetadataBuilder_metadata(int64_t this_arg, int8_tArray metadata) { - LDKOfferWithExplicitMetadataBuilder this_arg_conv; +int64_tArray CS_LDK_Refund_paths(int64_t this_arg) { + LDKRefund this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = 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); + this_arg_conv.is_owned = false; + LDKCVec_BlindedMessagePathZ ret_var = Refund_paths(&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 u = 0; u < ret_var.datalen; u++) { + LDKBlindedMessagePath ret_conv_20_var = ret_var.data[u]; + int64_t ret_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_20_var); + ret_conv_20_ref = tag_ptr(ret_conv_20_var.inner, ret_conv_20_var.is_owned); + ret_arr_ptr[u] = ret_conv_20_ref; + } + + FREE(ret_var.data); + return ret_arr; } -void CS_LDK_OfferWithExplicitMetadataBuilder_chain(int64_t this_arg, int32_t network) { - LDKOfferWithExplicitMetadataBuilder this_arg_conv; +int8_tArray CS_LDK_Refund_payer_metadata(int64_t this_arg) { + LDKRefund this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); - LDKNetwork network_conv = LDKNetwork_from_cs(network); - OfferWithExplicitMetadataBuilder_chain(this_arg_conv, network_conv); + this_arg_conv.is_owned = false; + LDKu8slice ret_var = Refund_payer_metadata(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + return ret_arr; } -void CS_LDK_OfferWithExplicitMetadataBuilder_amount_msats(int64_t this_arg, int64_t amount_msats) { - LDKOfferWithExplicitMetadataBuilder this_arg_conv; +int8_tArray CS_LDK_Refund_chain(int64_t this_arg) { + LDKRefund this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); - OfferWithExplicitMetadataBuilder_amount_msats(this_arg_conv, amount_msats); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, Refund_chain(&this_arg_conv).data, 32); + return ret_arr; } -void CS_LDK_OfferWithExplicitMetadataBuilder_absolute_expiry(int64_t this_arg, int64_t absolute_expiry) { - LDKOfferWithExplicitMetadataBuilder this_arg_conv; +int64_t CS_LDK_Refund_amount_msats(int64_t this_arg) { + LDKRefund this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); - OfferWithExplicitMetadataBuilder_absolute_expiry(this_arg_conv, absolute_expiry); + this_arg_conv.is_owned = false; + int64_t ret_conv = Refund_amount_msats(&this_arg_conv); + return ret_conv; } -void CS_LDK_OfferWithExplicitMetadataBuilder_description(int64_t this_arg, jstring description) { - LDKOfferWithExplicitMetadataBuilder this_arg_conv; +int64_t CS_LDK_Refund_features(int64_t this_arg) { + LDKRefund this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); - LDKStr description_conv = str_ref_to_owned_c(description); - OfferWithExplicitMetadataBuilder_description(this_arg_conv, description_conv); + this_arg_conv.is_owned = false; + LDKInvoiceRequestFeatures ret_var = Refund_features(&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_OfferWithExplicitMetadataBuilder_issuer(int64_t this_arg, jstring issuer) { - LDKOfferWithExplicitMetadataBuilder this_arg_conv; +int64_t CS_LDK_Refund_quantity(int64_t this_arg) { + LDKRefund this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); - LDKStr issuer_conv = str_ref_to_owned_c(issuer); - OfferWithExplicitMetadataBuilder_issuer(this_arg_conv, issuer_conv); + this_arg_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = Refund_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_OfferWithExplicitMetadataBuilder_path(int64_t this_arg, int64_t path) { - LDKOfferWithExplicitMetadataBuilder this_arg_conv; +int8_tArray CS_LDK_Refund_payer_id(int64_t this_arg) { + LDKRefund this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = 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); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, Refund_payer_id(&this_arg_conv).compressed_form, 33); + return ret_arr; } -void CS_LDK_OfferWithExplicitMetadataBuilder_supported_quantity(int64_t this_arg, int64_t quantity) { - LDKOfferWithExplicitMetadataBuilder this_arg_conv; +int64_t CS_LDK_Refund_payer_note(int64_t this_arg) { + LDKRefund this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = 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); + this_arg_conv.is_owned = false; + LDKPrintableString ret_var = Refund_payer_note(&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_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); +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; +} + +int64_t CS_LDK_Refund_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_RefundDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundDecodeErrorZ), "LDKCResult_RefundDecodeErrorZ"); + *ret_conv = Refund_read(ser_ref); + FREE(ser); 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; +int8_tArray CS_LDK_Refund_write(int64_t obj) { + LDKRefund obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = Refund_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -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); +int64_t CS_LDK_Refund_from_str(jstring s) { + LDKStr s_conv = str_ref_to_owned_c(s); + LDKCResult_RefundBolt12ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundBolt12ParseErrorZ), "LDKCResult_RefundBolt12ParseErrorZ"); + *ret_conv = Refund_from_str(s_conv); + return tag_ptr(ret_conv, true); } -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); +jstring CS_LDK_Refund_to_str(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; + LDKStr ret_str = Refund_to_str(&o_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; } -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); +int32_t CS_LDK_UtxoLookupError_clone(int64_t orig) { + LDKUtxoLookupError* orig_conv = (LDKUtxoLookupError*)untag_ptr(orig); + int32_t ret_conv = LDKUtxoLookupError_to_cs(UtxoLookupError_clone(orig_conv)); + return ret_conv; } -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); +int32_t CS_LDK_UtxoLookupError_unknown_chain() { + int32_t ret_conv = LDKUtxoLookupError_to_cs(UtxoLookupError_unknown_chain()); + return ret_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); +int32_t CS_LDK_UtxoLookupError_unknown_tx() { + int32_t ret_conv = LDKUtxoLookupError_to_cs(UtxoLookupError_unknown_tx()); + return ret_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_UtxoResult_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); + LDKUtxoResult this_ptr_conv = *(LDKUtxoResult*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + UtxoResult_free(this_ptr_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); +static inline uint64_t UtxoResult_clone_ptr(LDKUtxoResult *NONNULL_PTR arg) { + LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult"); + *ret_copy = UtxoResult_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_UtxoResult_clone_ptr(int64_t arg) { + LDKUtxoResult* arg_conv = (LDKUtxoResult*)untag_ptr(arg); + int64_t ret_conv = UtxoResult_clone_ptr(arg_conv); + return ret_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); +int64_t CS_LDK_UtxoResult_clone(int64_t orig) { + LDKUtxoResult* orig_conv = (LDKUtxoResult*)untag_ptr(orig); + LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult"); + *ret_copy = UtxoResult_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_Offer_free(int64_t this_obj) { - LDKOffer this_obj_conv; +int64_t CS_LDK_UtxoResult_sync(int64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKCResult_TxOutUtxoLookupErrorZ a_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(a_ptr); + a_conv = CResult_TxOutUtxoLookupErrorZ_clone((LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(a)); + LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult"); + *ret_copy = UtxoResult_sync(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_UtxoResult_async(int64_t a) { + LDKUtxoFuture a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = UtxoFuture_clone(&a_conv); + LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult"); + *ret_copy = UtxoResult_async(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_UtxoLookup_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); + LDKUtxoLookup this_ptr_conv = *(LDKUtxoLookup*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + UtxoLookup_free(this_ptr_conv); +} + +void CS_LDK_UtxoFuture_free(int64_t this_obj) { + LDKUtxoFuture this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Offer_free(this_obj_conv); + UtxoFuture_free(this_obj_conv); } -static inline uint64_t Offer_clone_ptr(LDKOffer *NONNULL_PTR arg) { - LDKOffer ret_var = Offer_clone(arg); +static inline uint64_t UtxoFuture_clone_ptr(LDKUtxoFuture *NONNULL_PTR arg) { + LDKUtxoFuture ret_var = UtxoFuture_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_Offer_clone_ptr(int64_t arg) { - LDKOffer arg_conv; +int64_t CS_LDK_UtxoFuture_clone_ptr(int64_t arg) { + LDKUtxoFuture arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Offer_clone_ptr(&arg_conv); + int64_t ret_conv = UtxoFuture_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_Offer_clone(int64_t orig) { - LDKOffer orig_conv; +int64_t CS_LDK_UtxoFuture_clone(int64_t orig) { + LDKUtxoFuture orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKOffer ret_var = Offer_clone(&orig_conv); + LDKUtxoFuture ret_var = UtxoFuture_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; } -ptrArray CS_LDK_Offer_chains(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; - LDKCVec_ThirtyTwoBytesZ ret_var = Offer_chains(&this_arg_conv); - ptrArray ret_arr = NULL; - ret_arr = init_ptrArray(ret_var.datalen, __LINE__); - int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8); - for (size_t i = 0; i < ret_var.datalen; i++) { - int8_tArray ret_conv_8_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_conv_8_arr->elems, ret_var.data[i].data, 32); - ret_arr_ptr[i] = ret_conv_8_arr; - } - - FREE(ret_var.data); - return ret_arr; +int64_t CS_LDK_UtxoFuture_new() { + LDKUtxoFuture ret_var = UtxoFuture_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_Offer_metadata(int64_t this_arg) { - LDKOffer this_arg_conv; +void CS_LDK_UtxoFuture_resolve_without_forwarding(int64_t this_arg, int64_t graph, int64_t result) { + LDKUtxoFuture this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = Offer_metadata(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKNetworkGraph graph_conv; + graph_conv.inner = untag_ptr(graph); + graph_conv.is_owned = ptr_is_owned(graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(graph_conv); + graph_conv.is_owned = false; + void* result_ptr = untag_ptr(result); + CHECK_ACCESS(result_ptr); + LDKCResult_TxOutUtxoLookupErrorZ result_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(result_ptr); + result_conv = CResult_TxOutUtxoLookupErrorZ_clone((LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(result)); + UtxoFuture_resolve_without_forwarding(&this_arg_conv, &graph_conv, result_conv); } -int64_t CS_LDK_Offer_amount(int64_t this_arg) { - LDKOffer this_arg_conv; +void CS_LDK_UtxoFuture_resolve(int64_t this_arg, int64_t graph, int64_t gossip, int64_t result) { + LDKUtxoFuture this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - 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; + LDKNetworkGraph graph_conv; + graph_conv.inner = untag_ptr(graph); + graph_conv.is_owned = ptr_is_owned(graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(graph_conv); + graph_conv.is_owned = false; + LDKP2PGossipSync gossip_conv; + gossip_conv.inner = untag_ptr(gossip); + gossip_conv.is_owned = ptr_is_owned(gossip); + CHECK_INNER_FIELD_ACCESS_OR_NULL(gossip_conv); + gossip_conv.is_owned = false; + void* result_ptr = untag_ptr(result); + CHECK_ACCESS(result_ptr); + LDKCResult_TxOutUtxoLookupErrorZ result_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(result_ptr); + result_conv = CResult_TxOutUtxoLookupErrorZ_clone((LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(result)); + UtxoFuture_resolve(&this_arg_conv, &graph_conv, &gossip_conv, result_conv); } -int64_t CS_LDK_Offer_description(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; - LDKPrintableString ret_var = Offer_description(&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_NodeId_free(int64_t this_obj) { + LDKNodeId this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + NodeId_free(this_obj_conv); } -int64_t CS_LDK_Offer_offer_features(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; - LDKOfferFeatures ret_var = Offer_offer_features(&this_arg_conv); +static inline uint64_t NodeId_clone_ptr(LDKNodeId *NONNULL_PTR arg) { + LDKNodeId ret_var = NodeId_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_Offer_absolute_expiry(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; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = Offer_absolute_expiry(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_NodeId_clone_ptr(int64_t arg) { + LDKNodeId arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = NodeId_clone_ptr(&arg_conv); + return ret_conv; } -int64_t CS_LDK_Offer_issuer(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; - LDKPrintableString ret_var = Offer_issuer(&this_arg_conv); +int64_t CS_LDK_NodeId_clone(int64_t orig) { + LDKNodeId orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKNodeId ret_var = NodeId_clone(&orig_conv); int64_t ret_ref = 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_Offer_paths(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; - LDKCVec_BlindedPathZ ret_var = Offer_paths(&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 n = 0; n < ret_var.datalen; n++) { - LDKBlindedPath 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_Offer_supported_quantity(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; - 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; -} - -int8_tArray CS_LDK_Offer_signing_pubkey(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; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, Offer_signing_pubkey(&this_arg_conv).compressed_form, 33); - return ret_arr; +jboolean CS_LDK_NodeId_eq(int64_t a, int64_t b) { + LDKNodeId a_conv; + 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; + LDKNodeId 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 = NodeId_eq(&a_conv, &b_conv); + return ret_conv; } -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 CS_LDK_NodeId_from_pubkey(int8_tArray pubkey) { + LDKPublicKey pubkey_ref; + CHECK(pubkey->arr_len == 33); + memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); FREE(pubkey); + LDKNodeId ret_var = NodeId_from_pubkey(pubkey_ref); int64_t ret_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); - this_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 chain_ref; - CHECK(chain->arr_len == 32); - memcpy(chain_ref.data, chain->elems, 32); FREE(chain); - jboolean ret_conv = Offer_supports_chain(&this_arg_conv, chain_ref); - return ret_conv; -} - -jboolean CS_LDK_Offer_is_expired(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; - jboolean ret_conv = Offer_is_expired(&this_arg_conv); - return ret_conv; -} - -jboolean CS_LDK_Offer_is_expired_no_std(int64_t this_arg, int64_t duration_since_epoch) { - LDKOffer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = Offer_is_expired_no_std(&this_arg_conv, duration_since_epoch); - return ret_conv; -} - -jboolean CS_LDK_Offer_is_valid_quantity(int64_t this_arg, int64_t quantity) { - LDKOffer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = Offer_is_valid_quantity(&this_arg_conv, quantity); - return ret_conv; +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); } -jboolean CS_LDK_Offer_expects_quantity(int64_t this_arg) { - LDKOffer this_arg_conv; +int8_tArray CS_LDK_NodeId_as_slice(int64_t this_arg) { + LDKNodeId this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = Offer_expects_quantity(&this_arg_conv); - return ret_conv; + LDKu8slice ret_var = NodeId_as_slice(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + return ret_arr; } -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; +int8_tArray CS_LDK_NodeId_as_array(int64_t this_arg) { + LDKNodeId this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - 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); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, *NodeId_as_array(&this_arg_conv), 33); + return ret_arr; } -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; +int64_t CS_LDK_NodeId_as_pubkey(int64_t this_arg) { + LDKNodeId this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - 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); + LDKCResult_PublicKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecp256k1ErrorZ), "LDKCResult_PublicKeySecp256k1ErrorZ"); + *ret_conv = NodeId_as_pubkey(&this_arg_conv); 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); +jstring CS_LDK_NodeId_to_str(int64_t o) { + LDKNodeId o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = NodeId_to_str(&o_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; } -int64_t CS_LDK_Offer_hash(int64_t o) { - LDKOffer o_conv; +int64_t CS_LDK_NodeId_hash(int64_t o) { + LDKNodeId o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv.is_owned = false; - int64_t ret_conv = Offer_hash(&o_conv); + int64_t ret_conv = NodeId_hash(&o_conv); return ret_conv; } -int8_tArray CS_LDK_Offer_write(int64_t obj) { - LDKOffer obj_conv; +int8_tArray CS_LDK_NodeId_write(int64_t obj) { + LDKNodeId obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = Offer_write(&obj_conv); + LDKCVec_u8Z ret_var = NodeId_write(&obj_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } -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_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 = (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 = (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_NodeId_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); + *ret_conv = NodeId_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -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; +void CS_LDK_NetworkGraph_free(int64_t this_obj) { + LDKNetworkGraph this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + NetworkGraph_free(this_obj_conv); } -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_ReadOnlyNetworkGraph_free(int64_t this_obj) { + LDKReadOnlyNetworkGraph this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ReadOnlyNetworkGraph_free(this_obj_conv); } -void CS_LDK_Quantity_free(int64_t this_ptr) { +void CS_LDK_NetworkUpdate_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); + LDKNetworkUpdate this_ptr_conv = *(LDKNetworkUpdate*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - Quantity_free(this_ptr_conv); + NetworkUpdate_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); +static inline uint64_t NetworkUpdate_clone_ptr(LDKNetworkUpdate *NONNULL_PTR arg) { + LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); + *ret_copy = NetworkUpdate_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); +int64_t CS_LDK_NetworkUpdate_clone_ptr(int64_t arg) { + LDKNetworkUpdate* arg_conv = (LDKNetworkUpdate*)untag_ptr(arg); + int64_t ret_conv = NetworkUpdate_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 CS_LDK_NetworkUpdate_clone(int64_t orig) { + LDKNetworkUpdate* orig_conv = (LDKNetworkUpdate*)untag_ptr(orig); + LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); + *ret_copy = NetworkUpdate_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 CS_LDK_NetworkUpdate_channel_failure(int64_t short_channel_id, jboolean is_permanent) { + LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); + *ret_copy = NetworkUpdate_channel_failure(short_channel_id, is_permanent); 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 CS_LDK_NetworkUpdate_node_failure(int8_tArray node_id, jboolean is_permanent) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); + *ret_copy = NetworkUpdate_node_failure(node_id_ref, is_permanent); 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; +jboolean CS_LDK_NetworkUpdate_eq(int64_t a, int64_t b) { + LDKNetworkUpdate* a_conv = (LDKNetworkUpdate*)untag_ptr(a); + LDKNetworkUpdate* b_conv = (LDKNetworkUpdate*)untag_ptr(b); + jboolean ret_conv = NetworkUpdate_eq(a_conv, b_conv); + return ret_conv; } -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); +int8_tArray CS_LDK_NetworkUpdate_write(int64_t obj) { + LDKNetworkUpdate* obj_conv = (LDKNetworkUpdate*)untag_ptr(obj); + LDKCVec_u8Z ret_var = NetworkUpdate_write(obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -jstring CS_LDK_Offer_to_str(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; - LDKStr ret_str = Offer_to_str(&o_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; +int64_t CS_LDK_NetworkUpdate_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = NetworkUpdate_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -void CS_LDK_InvoiceWithExplicitSigningPubkeyBuilder_free(int64_t this_obj) { - LDKInvoiceWithExplicitSigningPubkeyBuilder this_obj_conv; +void CS_LDK_P2PGossipSync_free(int64_t this_obj) { + LDKP2PGossipSync this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InvoiceWithExplicitSigningPubkeyBuilder_free(this_obj_conv); + P2PGossipSync_free(this_obj_conv); } -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_P2PGossipSync_new(int64_t network_graph, int64_t utxo_lookup, int64_t logger) { + LDKNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; + void* utxo_lookup_ptr = untag_ptr(utxo_lookup); + CHECK_ACCESS(utxo_lookup_ptr); + LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr); + // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ + if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) { + // Manually implement clone for Java trait instances + if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some); + } + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKP2PGossipSync ret_var = P2PGossipSync_new(&network_graph_conv, utxo_lookup_conv, logger_conv); + int64_t ret_ref = 0; + 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_InvoiceWithExplicitSigningPubkeyBuilder_build(int64_t this_arg) { - LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; +void CS_LDK_P2PGossipSync_add_utxo_lookup(int64_t this_arg, int64_t utxo_lookup) { + LDKP2PGossipSync this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // 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); + this_arg_conv.is_owned = false; + void* utxo_lookup_ptr = untag_ptr(utxo_lookup); + CHECK_ACCESS(utxo_lookup_ptr); + LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr); + // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ + if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) { + // Manually implement clone for Java trait instances + if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some); + } + } + P2PGossipSync_add_utxo_lookup(&this_arg_conv, utxo_lookup_conv); } -void CS_LDK_InvoiceWithExplicitSigningPubkeyBuilder_relative_expiry(int64_t this_arg, int32_t relative_expiry_secs) { - LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; +void CS_LDK_NetworkGraph_handle_network_update(int64_t this_arg, int64_t network_update) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder - - InvoiceWithExplicitSigningPubkeyBuilder_relative_expiry(this_arg_conv, relative_expiry_secs); + this_arg_conv.is_owned = false; + LDKNetworkUpdate* network_update_conv = (LDKNetworkUpdate*)untag_ptr(network_update); + NetworkGraph_handle_network_update(&this_arg_conv, network_update_conv); } -void CS_LDK_InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wsh(int64_t this_arg, int8_tArray script_hash) { - LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; +int8_tArray CS_LDK_NetworkGraph_get_chain_hash(int64_t this_arg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // 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); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, NetworkGraph_get_chain_hash(&this_arg_conv).data, 32); + return ret_arr; } -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); +int64_t CS_LDK_verify_node_announcement(int64_t msg) { + LDKNodeAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = verify_node_announcement(&msg_conv); + return tag_ptr(ret_conv, true); } -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_verify_channel_announcement(int64_t msg) { + LDKChannelAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = verify_channel_announcement(&msg_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_InvoiceWithDerivedSigningPubkeyBuilder_build_and_sign(int64_t this_arg) { - LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; +int64_t CS_LDK_P2PGossipSync_as_RoutingMessageHandler(int64_t this_arg) { + LDKP2PGossipSync this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // 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); + this_arg_conv.is_owned = false; + LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler"); + *ret_ret = P2PGossipSync_as_RoutingMessageHandler(&this_arg_conv); + return tag_ptr(ret_ret, true); } -void CS_LDK_InvoiceWithDerivedSigningPubkeyBuilder_relative_expiry(int64_t this_arg, int32_t relative_expiry_secs) { - LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; +int64_t CS_LDK_P2PGossipSync_as_MessageSendEventsProvider(int64_t this_arg) { + LDKP2PGossipSync this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder - - InvoiceWithDerivedSigningPubkeyBuilder_relative_expiry(this_arg_conv, relative_expiry_secs); + this_arg_conv.is_owned = false; + LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); + *ret_ret = P2PGossipSync_as_MessageSendEventsProvider(&this_arg_conv); + return tag_ptr(ret_ret, true); } -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_ChannelUpdateInfo_free(int64_t this_obj) { + LDKChannelUpdateInfo this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelUpdateInfo_free(this_obj_conv); } -void 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); +int64_t CS_LDK_ChannelUpdateInfo_get_htlc_minimum_msat(int64_t this_ptr) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ChannelUpdateInfo_get_htlc_minimum_msat(&this_ptr_conv); + return ret_conv; } -void 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_ChannelUpdateInfo_set_htlc_minimum_msat(int64_t this_ptr, int64_t val) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelUpdateInfo_set_htlc_minimum_msat(&this_ptr_conv, val); } -void 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); +int64_t CS_LDK_ChannelUpdateInfo_get_htlc_maximum_msat(int64_t this_ptr) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ChannelUpdateInfo_get_htlc_maximum_msat(&this_ptr_conv); + return ret_conv; } -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_ChannelUpdateInfo_set_htlc_maximum_msat(int64_t this_ptr, int64_t val) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelUpdateInfo_set_htlc_maximum_msat(&this_ptr_conv, val); } -static inline uint64_t UnsignedBolt12Invoice_clone_ptr(LDKUnsignedBolt12Invoice *NONNULL_PTR arg) { - LDKUnsignedBolt12Invoice ret_var = UnsignedBolt12Invoice_clone(arg); +int64_t CS_LDK_ChannelUpdateInfo_get_fees(int64_t this_ptr) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKRoutingFees ret_var = ChannelUpdateInfo_get_fees(&this_ptr_conv); int64_t ret_ref = 0; 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_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 = UnsignedBolt12Invoice_clone_ptr(&arg_conv); + +void CS_LDK_ChannelUpdateInfo_set_fees(int64_t this_ptr, int64_t val) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKRoutingFees val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = RoutingFees_clone(&val_conv); + ChannelUpdateInfo_set_fees(&this_ptr_conv, val_conv); +} + +int32_t CS_LDK_ChannelUpdateInfo_get_last_update(int64_t this_ptr) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = ChannelUpdateInfo_get_last_update(&this_ptr_conv); return ret_conv; } -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; - LDKUnsignedBolt12Invoice ret_var = UnsignedBolt12Invoice_clone(&orig_conv); +void CS_LDK_ChannelUpdateInfo_set_last_update(int64_t this_ptr, int32_t val) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelUpdateInfo_set_last_update(&this_ptr_conv, val); +} + +int16_t CS_LDK_ChannelUpdateInfo_get_cltv_expiry_delta(int64_t this_ptr) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int16_t ret_conv = ChannelUpdateInfo_get_cltv_expiry_delta(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_ChannelUpdateInfo_set_cltv_expiry_delta(int64_t this_ptr, int16_t val) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelUpdateInfo_set_cltv_expiry_delta(&this_ptr_conv, val); +} + +jboolean CS_LDK_ChannelUpdateInfo_get_enabled(int64_t this_ptr) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + jboolean ret_conv = ChannelUpdateInfo_get_enabled(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_ChannelUpdateInfo_set_enabled(int64_t this_ptr, jboolean val) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelUpdateInfo_set_enabled(&this_ptr_conv, val); +} + +int64_t CS_LDK_ChannelUpdateInfo_get_last_update_message(int64_t this_ptr) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelUpdate ret_var = ChannelUpdateInfo_get_last_update_message(&this_ptr_conv); int64_t ret_ref = 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_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); +void CS_LDK_ChannelUpdateInfo_set_last_update_message(int64_t this_ptr, int64_t val) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelUpdate val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelUpdate_clone(&val_conv); + ChannelUpdateInfo_set_last_update_message(&this_ptr_conv, val_conv); } -int64_t CS_LDK_UnsignedBolt12Invoice_tagged_hash(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKTaggedHash ret_var = UnsignedBolt12Invoice_tagged_hash(&this_arg_conv); +int64_t CS_LDK_ChannelUpdateInfo_new(int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg, int64_t fees_arg, int32_t last_update_arg, int16_t cltv_expiry_delta_arg, jboolean enabled_arg, int64_t last_update_message_arg) { + LDKRoutingFees fees_arg_conv; + fees_arg_conv.inner = untag_ptr(fees_arg); + fees_arg_conv.is_owned = ptr_is_owned(fees_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv); + fees_arg_conv = RoutingFees_clone(&fees_arg_conv); + LDKChannelUpdate last_update_message_arg_conv; + last_update_message_arg_conv.inner = untag_ptr(last_update_message_arg); + last_update_message_arg_conv.is_owned = ptr_is_owned(last_update_message_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(last_update_message_arg_conv); + last_update_message_arg_conv = ChannelUpdate_clone(&last_update_message_arg_conv); + LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_new(htlc_minimum_msat_arg, htlc_maximum_msat_arg, fees_arg_conv, last_update_arg, cltv_expiry_delta_arg, enabled_arg, last_update_message_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_Bolt12Invoice_free(int64_t this_obj) { - LDKBolt12Invoice this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Bolt12Invoice_free(this_obj_conv); -} - -static inline uint64_t Bolt12Invoice_clone_ptr(LDKBolt12Invoice *NONNULL_PTR arg) { - LDKBolt12Invoice ret_var = Bolt12Invoice_clone(arg); +static inline uint64_t ChannelUpdateInfo_clone_ptr(LDKChannelUpdateInfo *NONNULL_PTR arg) { + LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_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_Bolt12Invoice_clone_ptr(int64_t arg) { - LDKBolt12Invoice arg_conv; +int64_t CS_LDK_ChannelUpdateInfo_clone_ptr(int64_t arg) { + LDKChannelUpdateInfo arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Bolt12Invoice_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelUpdateInfo_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_Bolt12Invoice_clone(int64_t orig) { - LDKBolt12Invoice orig_conv; +int64_t CS_LDK_ChannelUpdateInfo_clone(int64_t orig) { + LDKChannelUpdateInfo orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBolt12Invoice ret_var = Bolt12Invoice_clone(&orig_conv); + LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_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_UnsignedBolt12Invoice_offer_chains(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_CVec_ThirtyTwoBytesZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_ThirtyTwoBytesZZ), "LDKCOption_CVec_ThirtyTwoBytesZZ"); - *ret_copy = UnsignedBolt12Invoice_offer_chains(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_ChannelUpdateInfo_eq(int64_t a, int64_t b) { + LDKChannelUpdateInfo a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKChannelUpdateInfo b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ChannelUpdateInfo_eq(&a_conv, &b_conv); + return ret_conv; } -int8_tArray CS_LDK_UnsignedBolt12Invoice_chain(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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, UnsignedBolt12Invoice_chain(&this_arg_conv).data, 32); +jstring CS_LDK_ChannelUpdateInfo_to_str(int64_t o) { + LDKChannelUpdateInfo o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = ChannelUpdateInfo_to_str(&o_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +int8_tArray CS_LDK_ChannelUpdateInfo_write(int64_t obj) { + LDKChannelUpdateInfo obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ChannelUpdateInfo_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_UnsignedBolt12Invoice_metadata(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = UnsignedBolt12Invoice_metadata(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_ChannelUpdateInfo_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ"); + *ret_conv = ChannelUpdateInfo_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_UnsignedBolt12Invoice_amount(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_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; +void CS_LDK_ChannelInfo_free(int64_t this_obj) { + LDKChannelInfo this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelInfo_free(this_obj_conv); } -int64_t CS_LDK_UnsignedBolt12Invoice_offer_features(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOfferFeatures ret_var = UnsignedBolt12Invoice_offer_features(&this_arg_conv); +int64_t CS_LDK_ChannelInfo_get_features(int64_t this_ptr) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelFeatures ret_var = ChannelInfo_get_features(&this_ptr_conv); int64_t ret_ref = 0; 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_UnsignedBolt12Invoice_description(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = UnsignedBolt12Invoice_description(&this_arg_conv); +void CS_LDK_ChannelInfo_set_features(int64_t this_ptr, int64_t val) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelFeatures val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelFeatures_clone(&val_conv); + ChannelInfo_set_features(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_ChannelInfo_get_node_one(int64_t this_ptr) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKNodeId ret_var = ChannelInfo_get_node_one(&this_ptr_conv); int64_t ret_ref = 0; 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_UnsignedBolt12Invoice_absolute_expiry(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = UnsignedBolt12Invoice_absolute_expiry(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_ChannelInfo_set_node_one(int64_t this_ptr, int64_t val) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKNodeId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = NodeId_clone(&val_conv); + ChannelInfo_set_node_one(&this_ptr_conv, val_conv); } -int64_t CS_LDK_UnsignedBolt12Invoice_issuer(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = UnsignedBolt12Invoice_issuer(&this_arg_conv); +int64_t CS_LDK_ChannelInfo_get_node_two(int64_t this_ptr) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKNodeId ret_var = ChannelInfo_get_node_two(&this_ptr_conv); int64_t ret_ref = 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_UnsignedBolt12Invoice_message_paths(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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_BlindedPathZ ret_var = UnsignedBolt12Invoice_message_paths(&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 n = 0; n < ret_var.datalen; n++) { - LDKBlindedPath 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; +void CS_LDK_ChannelInfo_set_node_two(int64_t this_ptr, int64_t val) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKNodeId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = NodeId_clone(&val_conv); + ChannelInfo_set_node_two(&this_ptr_conv, val_conv); } -int64_t CS_LDK_UnsignedBolt12Invoice_supported_quantity(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_QuantityZ *ret_copy = MALLOC(sizeof(LDKCOption_QuantityZ), "LDKCOption_QuantityZ"); - *ret_copy = UnsignedBolt12Invoice_supported_quantity(&this_arg_conv); +int64_t CS_LDK_ChannelInfo_get_capacity_sats(int64_t this_ptr) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelInfo_get_capacity_sats(&this_ptr_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int8_tArray CS_LDK_UnsignedBolt12Invoice_payer_metadata(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKu8slice ret_var = UnsignedBolt12Invoice_payer_metadata(&this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - return ret_arr; +void CS_LDK_ChannelInfo_set_capacity_sats(int64_t this_ptr, int64_t val) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + ChannelInfo_set_capacity_sats(&this_ptr_conv, val_conv); } -int64_t CS_LDK_UnsignedBolt12Invoice_invoice_request_features(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKInvoiceRequestFeatures ret_var = UnsignedBolt12Invoice_invoice_request_features(&this_arg_conv); +int64_t CS_LDK_ChannelInfo_get_one_to_two(int64_t this_ptr) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelUpdateInfo ret_var = ChannelInfo_get_one_to_two(&this_ptr_conv); int64_t ret_ref = 0; 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_UnsignedBolt12Invoice_quantity(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = UnsignedBolt12Invoice_quantity(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +void CS_LDK_ChannelInfo_set_one_to_two(int64_t this_ptr, int64_t val) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelUpdateInfo val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelUpdateInfo_clone(&val_conv); + ChannelInfo_set_one_to_two(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_ChannelInfo_get_two_to_one(int64_t this_ptr) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelUpdateInfo ret_var = ChannelInfo_get_two_to_one(&this_ptr_conv); + int64_t ret_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_UnsignedBolt12Invoice_payer_id(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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, UnsignedBolt12Invoice_payer_id(&this_arg_conv).compressed_form, 33); - return ret_arr; +void CS_LDK_ChannelInfo_set_two_to_one(int64_t this_ptr, int64_t val) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelUpdateInfo val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelUpdateInfo_clone(&val_conv); + ChannelInfo_set_two_to_one(&this_ptr_conv, val_conv); } -int64_t CS_LDK_UnsignedBolt12Invoice_payer_note(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = UnsignedBolt12Invoice_payer_note(&this_arg_conv); +int64_t CS_LDK_ChannelInfo_get_announcement_message(int64_t this_ptr) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelAnnouncement ret_var = ChannelInfo_get_announcement_message(&this_ptr_conv); int64_t ret_ref = 0; 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_UnsignedBolt12Invoice_created_at(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = UnsignedBolt12Invoice_created_at(&this_arg_conv); - return ret_conv; +void CS_LDK_ChannelInfo_set_announcement_message(int64_t this_ptr, int64_t val) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelAnnouncement val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelAnnouncement_clone(&val_conv); + ChannelInfo_set_announcement_message(&this_ptr_conv, val_conv); } -int64_t CS_LDK_UnsignedBolt12Invoice_relative_expiry(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = UnsignedBolt12Invoice_relative_expiry(&this_arg_conv); - return ret_conv; +static inline uint64_t ChannelInfo_clone_ptr(LDKChannelInfo *NONNULL_PTR arg) { + LDKChannelInfo ret_var = ChannelInfo_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; } - -jboolean CS_LDK_UnsignedBolt12Invoice_is_expired(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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 = UnsignedBolt12Invoice_is_expired(&this_arg_conv); +int64_t CS_LDK_ChannelInfo_clone_ptr(int64_t arg) { + LDKChannelInfo arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = ChannelInfo_clone_ptr(&arg_conv); return ret_conv; } -int8_tArray CS_LDK_UnsignedBolt12Invoice_payment_hash(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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, UnsignedBolt12Invoice_payment_hash(&this_arg_conv).data, 32); - return ret_arr; +int64_t CS_LDK_ChannelInfo_clone(int64_t orig) { + LDKChannelInfo orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKChannelInfo ret_var = ChannelInfo_clone(&orig_conv); + int64_t ret_ref = 0; + 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_UnsignedBolt12Invoice_amount_msats(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = UnsignedBolt12Invoice_amount_msats(&this_arg_conv); +jboolean CS_LDK_ChannelInfo_eq(int64_t a, int64_t b) { + LDKChannelInfo a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKChannelInfo b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ChannelInfo_eq(&a_conv, &b_conv); return ret_conv; } -int64_t CS_LDK_UnsignedBolt12Invoice_invoice_features(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; +int64_t CS_LDK_ChannelInfo_get_directional_info(int64_t this_arg, int8_t channel_flags) { + LDKChannelInfo this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKBolt12InvoiceFeatures ret_var = UnsignedBolt12Invoice_invoice_features(&this_arg_conv); + LDKChannelUpdateInfo ret_var = ChannelInfo_get_directional_info(&this_arg_conv, channel_flags); int64_t ret_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_UnsignedBolt12Invoice_signing_pubkey(int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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, UnsignedBolt12Invoice_signing_pubkey(&this_arg_conv).compressed_form, 33); - return ret_arr; +jstring CS_LDK_ChannelInfo_to_str(int64_t o) { + LDKChannelInfo o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = ChannelInfo_to_str(&o_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; } -int64_t CS_LDK_Bolt12Invoice_offer_chains(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_CVec_ThirtyTwoBytesZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_ThirtyTwoBytesZZ), "LDKCOption_CVec_ThirtyTwoBytesZZ"); - *ret_copy = Bolt12Invoice_offer_chains(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int8_tArray CS_LDK_ChannelInfo_write(int64_t obj) { + LDKChannelInfo obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ChannelInfo_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -int8_tArray CS_LDK_Bolt12Invoice_chain(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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, Bolt12Invoice_chain(&this_arg_conv).data, 32); - return ret_arr; +int64_t CS_LDK_ChannelInfo_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); + *ret_conv = ChannelInfo_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_Bolt12Invoice_metadata(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = Bolt12Invoice_metadata(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_DirectedChannelInfo_free(int64_t this_obj) { + LDKDirectedChannelInfo this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + DirectedChannelInfo_free(this_obj_conv); } -int64_t CS_LDK_Bolt12Invoice_amount(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_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); +static inline uint64_t DirectedChannelInfo_clone_ptr(LDKDirectedChannelInfo *NONNULL_PTR arg) { + LDKDirectedChannelInfo ret_var = DirectedChannelInfo_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_DirectedChannelInfo_clone_ptr(int64_t arg) { + LDKDirectedChannelInfo arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = DirectedChannelInfo_clone_ptr(&arg_conv); + return ret_conv; +} -int64_t CS_LDK_Bolt12Invoice_offer_features(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOfferFeatures ret_var = Bolt12Invoice_offer_features(&this_arg_conv); +int64_t CS_LDK_DirectedChannelInfo_clone(int64_t orig) { + LDKDirectedChannelInfo orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKDirectedChannelInfo ret_var = DirectedChannelInfo_clone(&orig_conv); int64_t ret_ref = 0; 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_Bolt12Invoice_description(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; +int64_t CS_LDK_DirectedChannelInfo_channel(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; - LDKPrintableString ret_var = Bolt12Invoice_description(&this_arg_conv); + LDKChannelInfo ret_var = DirectedChannelInfo_channel(&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_Bolt12Invoice_absolute_expiry(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; +int64_t CS_LDK_DirectedChannelInfo_effective_capacity(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; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = Bolt12Invoice_absolute_expiry(&this_arg_conv); + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = DirectedChannelInfo_effective_capacity(&this_arg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Bolt12Invoice_issuer(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; +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; - LDKPrintableString ret_var = Bolt12Invoice_issuer(&this_arg_conv); + 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_tArray CS_LDK_Bolt12Invoice_message_paths(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; +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; - LDKCVec_BlindedPathZ ret_var = Bolt12Invoice_message_paths(&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 n = 0; n < ret_var.datalen; n++) { - LDKBlindedPath 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; + 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; } -int64_t CS_LDK_Bolt12Invoice_supported_quantity(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_QuantityZ *ret_copy = MALLOC(sizeof(LDKCOption_QuantityZ), "LDKCOption_QuantityZ"); - *ret_copy = Bolt12Invoice_supported_quantity(&this_arg_conv); +void CS_LDK_EffectiveCapacity_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); + LDKEffectiveCapacity this_ptr_conv = *(LDKEffectiveCapacity*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + EffectiveCapacity_free(this_ptr_conv); +} + +static inline uint64_t EffectiveCapacity_clone_ptr(LDKEffectiveCapacity *NONNULL_PTR arg) { + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } +int64_t CS_LDK_EffectiveCapacity_clone_ptr(int64_t arg) { + LDKEffectiveCapacity* arg_conv = (LDKEffectiveCapacity*)untag_ptr(arg); + int64_t ret_conv = EffectiveCapacity_clone_ptr(arg_conv); + return ret_conv; +} -int8_tArray CS_LDK_Bolt12Invoice_payer_metadata(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKu8slice ret_var = Bolt12Invoice_payer_metadata(&this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - return ret_arr; +int64_t CS_LDK_EffectiveCapacity_clone(int64_t orig) { + LDKEffectiveCapacity* orig_conv = (LDKEffectiveCapacity*)untag_ptr(orig); + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_Bolt12Invoice_invoice_request_features(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKInvoiceRequestFeatures ret_var = Bolt12Invoice_invoice_request_features(&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); +int64_t CS_LDK_EffectiveCapacity_exact_liquidity(int64_t liquidity_msat) { + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_exact_liquidity(liquidity_msat); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Bolt12Invoice_quantity(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = Bolt12Invoice_quantity(&this_arg_conv); +int64_t CS_LDK_EffectiveCapacity_advertised_max_htlc(int64_t amount_msat) { + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_advertised_max_htlc(amount_msat); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int8_tArray CS_LDK_Bolt12Invoice_payer_id(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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, Bolt12Invoice_payer_id(&this_arg_conv).compressed_form, 33); - return ret_arr; +int64_t CS_LDK_EffectiveCapacity_total(int64_t capacity_msat, int64_t htlc_maximum_msat) { + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_total(capacity_msat, htlc_maximum_msat); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_Bolt12Invoice_payer_note(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = Bolt12Invoice_payer_note(&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); +int64_t CS_LDK_EffectiveCapacity_infinite() { + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_infinite(); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Bolt12Invoice_created_at(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = Bolt12Invoice_created_at(&this_arg_conv); - return ret_conv; +int64_t CS_LDK_EffectiveCapacity_hint_max_htlc(int64_t amount_msat) { + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_hint_max_htlc(amount_msat); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_Bolt12Invoice_relative_expiry(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = Bolt12Invoice_relative_expiry(&this_arg_conv); - return ret_conv; +int64_t CS_LDK_EffectiveCapacity_unknown() { + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_unknown(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_Bolt12Invoice_is_expired(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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 = Bolt12Invoice_is_expired(&this_arg_conv); +int64_t CS_LDK_EffectiveCapacity_as_msat(int64_t this_arg) { + LDKEffectiveCapacity* this_arg_conv = (LDKEffectiveCapacity*)untag_ptr(this_arg); + int64_t ret_conv = EffectiveCapacity_as_msat(this_arg_conv); return ret_conv; } -int8_tArray CS_LDK_Bolt12Invoice_payment_hash(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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, Bolt12Invoice_payment_hash(&this_arg_conv).data, 32); +int8_tArray CS_LDK_RoutingFees_write(int64_t obj) { + LDKRoutingFees obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = RoutingFees_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_Bolt12Invoice_amount_msats(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = Bolt12Invoice_amount_msats(&this_arg_conv); - return ret_conv; +int64_t CS_LDK_RoutingFees_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); + *ret_conv = RoutingFees_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_Bolt12Invoice_invoice_features(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKBolt12InvoiceFeatures ret_var = Bolt12Invoice_invoice_features(&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; -} - -int8_tArray CS_LDK_Bolt12Invoice_signing_pubkey(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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, Bolt12Invoice_signing_pubkey(&this_arg_conv).compressed_form, 33); - return ret_arr; -} - -int8_tArray CS_LDK_Bolt12Invoice_signature(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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, Bolt12Invoice_signature(&this_arg_conv).compact_form, 64); - return ret_arr; -} - -int8_tArray CS_LDK_Bolt12Invoice_signable_hash(int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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, Bolt12Invoice_signable_hash(&this_arg_conv).data, 32); - return ret_arr; -} - -int64_t CS_LDK_Bolt12Invoice_verify(int64_t this_arg, int64_t key) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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 key_conv; - key_conv.inner = untag_ptr(key); - key_conv.is_owned = ptr_is_owned(key); - CHECK_INNER_FIELD_ACCESS_OR_NULL(key_conv); - key_conv.is_owned = false; - LDKCResult_ThirtyTwoBytesNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesNoneZ), "LDKCResult_ThirtyTwoBytesNoneZ"); - *ret_conv = Bolt12Invoice_verify(&this_arg_conv, &key_conv); - 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); - 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 = UnsignedBolt12Invoice_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_Bolt12Invoice_write(int64_t obj) { - LDKBolt12Invoice 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 = Bolt12Invoice_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -void CS_LDK_BlindedPayInfo_free(int64_t this_obj) { - LDKBlindedPayInfo this_obj_conv; +void CS_LDK_NodeAnnouncementDetails_free(int64_t this_obj) { + LDKNodeAnnouncementDetails this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BlindedPayInfo_free(this_obj_conv); + NodeAnnouncementDetails_free(this_obj_conv); } -int32_t CS_LDK_BlindedPayInfo_get_fee_base_msat(int64_t this_ptr) { - LDKBlindedPayInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int32_t ret_conv = BlindedPayInfo_get_fee_base_msat(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_BlindedPayInfo_set_fee_base_msat(int64_t this_ptr, int32_t val) { - LDKBlindedPayInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - BlindedPayInfo_set_fee_base_msat(&this_ptr_conv, val); -} - -int32_t CS_LDK_BlindedPayInfo_get_fee_proportional_millionths(int64_t this_ptr) { - LDKBlindedPayInfo this_ptr_conv; +int64_t CS_LDK_NodeAnnouncementDetails_get_features(int64_t this_ptr) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int32_t ret_conv = BlindedPayInfo_get_fee_proportional_millionths(&this_ptr_conv); - return ret_conv; + LDKNodeFeatures ret_var = NodeAnnouncementDetails_get_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_BlindedPayInfo_set_fee_proportional_millionths(int64_t this_ptr, int32_t val) { - LDKBlindedPayInfo this_ptr_conv; +void CS_LDK_NodeAnnouncementDetails_set_features(int64_t this_ptr, int64_t val) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - BlindedPayInfo_set_fee_proportional_millionths(&this_ptr_conv, val); + LDKNodeFeatures val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = NodeFeatures_clone(&val_conv); + NodeAnnouncementDetails_set_features(&this_ptr_conv, val_conv); } -int16_t CS_LDK_BlindedPayInfo_get_cltv_expiry_delta(int64_t this_ptr) { - LDKBlindedPayInfo this_ptr_conv; +int32_t CS_LDK_NodeAnnouncementDetails_get_last_update(int64_t this_ptr) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int16_t ret_conv = BlindedPayInfo_get_cltv_expiry_delta(&this_ptr_conv); + int32_t ret_conv = NodeAnnouncementDetails_get_last_update(&this_ptr_conv); return ret_conv; } -void CS_LDK_BlindedPayInfo_set_cltv_expiry_delta(int64_t this_ptr, int16_t val) { - LDKBlindedPayInfo this_ptr_conv; +void CS_LDK_NodeAnnouncementDetails_set_last_update(int64_t this_ptr, int32_t val) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - BlindedPayInfo_set_cltv_expiry_delta(&this_ptr_conv, val); + NodeAnnouncementDetails_set_last_update(&this_ptr_conv, val); } -int64_t CS_LDK_BlindedPayInfo_get_htlc_minimum_msat(int64_t this_ptr) { - LDKBlindedPayInfo this_ptr_conv; +int8_tArray CS_LDK_NodeAnnouncementDetails_get_rgb(int64_t this_ptr) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = BlindedPayInfo_get_htlc_minimum_msat(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(3, __LINE__); + memcpy(ret_arr->elems, *NodeAnnouncementDetails_get_rgb(&this_ptr_conv), 3); + return ret_arr; } -void CS_LDK_BlindedPayInfo_set_htlc_minimum_msat(int64_t this_ptr, int64_t val) { - LDKBlindedPayInfo this_ptr_conv; +void CS_LDK_NodeAnnouncementDetails_set_rgb(int64_t this_ptr, int8_tArray val) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - BlindedPayInfo_set_htlc_minimum_msat(&this_ptr_conv, val); + LDKThreeBytes val_ref; + CHECK(val->arr_len == 3); + memcpy(val_ref.data, val->elems, 3); FREE(val); + NodeAnnouncementDetails_set_rgb(&this_ptr_conv, val_ref); } -int64_t CS_LDK_BlindedPayInfo_get_htlc_maximum_msat(int64_t this_ptr) { - LDKBlindedPayInfo this_ptr_conv; +int64_t CS_LDK_NodeAnnouncementDetails_get_alias(int64_t this_ptr) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = BlindedPayInfo_get_htlc_maximum_msat(&this_ptr_conv); - return ret_conv; + LDKNodeAlias ret_var = NodeAnnouncementDetails_get_alias(&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_BlindedPayInfo_set_htlc_maximum_msat(int64_t this_ptr, int64_t val) { - LDKBlindedPayInfo this_ptr_conv; +void CS_LDK_NodeAnnouncementDetails_set_alias(int64_t this_ptr, int64_t val) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - BlindedPayInfo_set_htlc_maximum_msat(&this_ptr_conv, val); + LDKNodeAlias val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = NodeAlias_clone(&val_conv); + NodeAnnouncementDetails_set_alias(&this_ptr_conv, val_conv); } -int64_t CS_LDK_BlindedPayInfo_get_features(int64_t this_ptr) { - LDKBlindedPayInfo this_ptr_conv; +int64_tArray CS_LDK_NodeAnnouncementDetails_get_addresses(int64_t this_ptr) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKBlindedHopFeatures ret_var = BlindedPayInfo_get_features(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + LDKCVec_SocketAddressZ ret_var = NodeAnnouncementDetails_get_addresses(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t p = 0; p < ret_var.datalen; p++) { + LDKSocketAddress *ret_conv_15_copy = MALLOC(sizeof(LDKSocketAddress), "LDKSocketAddress"); + *ret_conv_15_copy = ret_var.data[p]; + int64_t ret_conv_15_ref = tag_ptr(ret_conv_15_copy, true); + ret_arr_ptr[p] = ret_conv_15_ref; + } + + FREE(ret_var.data); + return ret_arr; } -void CS_LDK_BlindedPayInfo_set_features(int64_t this_ptr, int64_t val) { - LDKBlindedPayInfo this_ptr_conv; +void CS_LDK_NodeAnnouncementDetails_set_addresses(int64_t this_ptr, int64_tArray val) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKBlindedHopFeatures val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = BlindedHopFeatures_clone(&val_conv); - BlindedPayInfo_set_features(&this_ptr_conv, val_conv); + LDKCVec_SocketAddressZ val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSocketAddress), "LDKCVec_SocketAddressZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = val->elems; + for (size_t p = 0; p < val_constr.datalen; p++) { + int64_t val_conv_15 = val_vals[p]; + void* val_conv_15_ptr = untag_ptr(val_conv_15); + CHECK_ACCESS(val_conv_15_ptr); + LDKSocketAddress val_conv_15_conv = *(LDKSocketAddress*)(val_conv_15_ptr); + val_conv_15_conv = SocketAddress_clone((LDKSocketAddress*)untag_ptr(val_conv_15)); + val_constr.data[p] = val_conv_15_conv; + } + FREE(val); + NodeAnnouncementDetails_set_addresses(&this_ptr_conv, val_constr); } -int64_t CS_LDK_BlindedPayInfo_new(int32_t fee_base_msat_arg, int32_t fee_proportional_millionths_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg, int64_t features_arg) { - LDKBlindedHopFeatures features_arg_conv; +int64_t CS_LDK_NodeAnnouncementDetails_new(int64_t features_arg, int32_t last_update_arg, int8_tArray rgb_arg, int64_t alias_arg, int64_tArray addresses_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 = BlindedHopFeatures_clone(&features_arg_conv); - LDKBlindedPayInfo ret_var = BlindedPayInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, features_arg_conv); + features_arg_conv = NodeFeatures_clone(&features_arg_conv); + LDKThreeBytes rgb_arg_ref; + CHECK(rgb_arg->arr_len == 3); + memcpy(rgb_arg_ref.data, rgb_arg->elems, 3); FREE(rgb_arg); + LDKNodeAlias alias_arg_conv; + alias_arg_conv.inner = untag_ptr(alias_arg); + alias_arg_conv.is_owned = ptr_is_owned(alias_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(alias_arg_conv); + alias_arg_conv = NodeAlias_clone(&alias_arg_conv); + LDKCVec_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_conv_15_conv = SocketAddress_clone((LDKSocketAddress*)untag_ptr(addresses_arg_conv_15)); + addresses_arg_constr.data[p] = addresses_arg_conv_15_conv; + } + FREE(addresses_arg); + LDKNodeAnnouncementDetails ret_var = NodeAnnouncementDetails_new(features_arg_conv, last_update_arg, rgb_arg_ref, alias_arg_conv, addresses_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); return ret_ref; } -static inline uint64_t BlindedPayInfo_clone_ptr(LDKBlindedPayInfo *NONNULL_PTR arg) { - LDKBlindedPayInfo ret_var = BlindedPayInfo_clone(arg); +static inline uint64_t NodeAnnouncementDetails_clone_ptr(LDKNodeAnnouncementDetails *NONNULL_PTR arg) { + LDKNodeAnnouncementDetails ret_var = NodeAnnouncementDetails_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_BlindedPayInfo_clone_ptr(int64_t arg) { - LDKBlindedPayInfo arg_conv; +int64_t CS_LDK_NodeAnnouncementDetails_clone_ptr(int64_t arg) { + LDKNodeAnnouncementDetails arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = BlindedPayInfo_clone_ptr(&arg_conv); + int64_t ret_conv = NodeAnnouncementDetails_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_BlindedPayInfo_clone(int64_t orig) { - LDKBlindedPayInfo orig_conv; +int64_t CS_LDK_NodeAnnouncementDetails_clone(int64_t orig) { + LDKNodeAnnouncementDetails orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBlindedPayInfo ret_var = BlindedPayInfo_clone(&orig_conv); + LDKNodeAnnouncementDetails ret_var = NodeAnnouncementDetails_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_BlindedPayInfo_hash(int64_t o) { - LDKBlindedPayInfo o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = BlindedPayInfo_hash(&o_conv); - return ret_conv; -} - -jboolean CS_LDK_BlindedPayInfo_eq(int64_t a, int64_t b) { - LDKBlindedPayInfo a_conv; +jboolean CS_LDK_NodeAnnouncementDetails_eq(int64_t a, int64_t b) { + LDKNodeAnnouncementDetails a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKBlindedPayInfo b_conv; + LDKNodeAnnouncementDetails b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = BlindedPayInfo_eq(&a_conv, &b_conv); + jboolean ret_conv = NodeAnnouncementDetails_eq(&a_conv, &b_conv); return ret_conv; } -int8_tArray CS_LDK_BlindedPayInfo_write(int64_t obj) { - LDKBlindedPayInfo obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = BlindedPayInfo_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +void CS_LDK_NodeAnnouncementInfo_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); + LDKNodeAnnouncementInfo this_ptr_conv = *(LDKNodeAnnouncementInfo*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + NodeAnnouncementInfo_free(this_ptr_conv); } -int64_t CS_LDK_BlindedPayInfo_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); - *ret_conv = BlindedPayInfo_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +static inline uint64_t NodeAnnouncementInfo_clone_ptr(LDKNodeAnnouncementInfo *NONNULL_PTR arg) { + LDKNodeAnnouncementInfo *ret_copy = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo"); + *ret_copy = NodeAnnouncementInfo_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } - -void CS_LDK_InvoiceError_free(int64_t this_obj) { - LDKInvoiceError this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InvoiceError_free(this_obj_conv); +int64_t CS_LDK_NodeAnnouncementInfo_clone_ptr(int64_t arg) { + LDKNodeAnnouncementInfo* arg_conv = (LDKNodeAnnouncementInfo*)untag_ptr(arg); + int64_t ret_conv = NodeAnnouncementInfo_clone_ptr(arg_conv); + return ret_conv; } -int64_t CS_LDK_InvoiceError_get_erroneous_field(int64_t this_ptr) { - LDKInvoiceError this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKErroneousField ret_var = InvoiceError_get_erroneous_field(&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); +int64_t CS_LDK_NodeAnnouncementInfo_clone(int64_t orig) { + LDKNodeAnnouncementInfo* orig_conv = (LDKNodeAnnouncementInfo*)untag_ptr(orig); + LDKNodeAnnouncementInfo *ret_copy = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo"); + *ret_copy = NodeAnnouncementInfo_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void CS_LDK_InvoiceError_set_erroneous_field(int64_t this_ptr, int64_t val) { - LDKInvoiceError this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKErroneousField 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 = ErroneousField_clone(&val_conv); - InvoiceError_set_erroneous_field(&this_ptr_conv, val_conv); +int64_t CS_LDK_NodeAnnouncementInfo_relayed(int64_t a) { + LDKNodeAnnouncement a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = NodeAnnouncement_clone(&a_conv); + LDKNodeAnnouncementInfo *ret_copy = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo"); + *ret_copy = NodeAnnouncementInfo_relayed(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_InvoiceError_get_message(int64_t this_ptr) { - LDKInvoiceError this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = InvoiceError_get_message(&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); +int64_t CS_LDK_NodeAnnouncementInfo_local(int64_t a) { + LDKNodeAnnouncementDetails a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = NodeAnnouncementDetails_clone(&a_conv); + LDKNodeAnnouncementInfo *ret_copy = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo"); + *ret_copy = NodeAnnouncementInfo_local(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void CS_LDK_InvoiceError_set_message(int64_t this_ptr, int64_t val) { - LDKInvoiceError this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - InvoiceError_set_message(&this_ptr_conv, val_conv); +jboolean CS_LDK_NodeAnnouncementInfo_eq(int64_t a, int64_t b) { + LDKNodeAnnouncementInfo* a_conv = (LDKNodeAnnouncementInfo*)untag_ptr(a); + LDKNodeAnnouncementInfo* b_conv = (LDKNodeAnnouncementInfo*)untag_ptr(b); + jboolean ret_conv = NodeAnnouncementInfo_eq(a_conv, b_conv); + return ret_conv; } -int64_t CS_LDK_InvoiceError_new(int64_t erroneous_field_arg, int64_t message_arg) { - LDKErroneousField erroneous_field_arg_conv; - erroneous_field_arg_conv.inner = untag_ptr(erroneous_field_arg); - erroneous_field_arg_conv.is_owned = ptr_is_owned(erroneous_field_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(erroneous_field_arg_conv); - erroneous_field_arg_conv = ErroneousField_clone(&erroneous_field_arg_conv); - LDKUntrustedString message_arg_conv; - message_arg_conv.inner = untag_ptr(message_arg); - message_arg_conv.is_owned = ptr_is_owned(message_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(message_arg_conv); - message_arg_conv = UntrustedString_clone(&message_arg_conv); - LDKInvoiceError ret_var = InvoiceError_new(erroneous_field_arg_conv, message_arg_conv); +int64_t CS_LDK_NodeAnnouncementInfo_features(int64_t this_arg) { + LDKNodeAnnouncementInfo* this_arg_conv = (LDKNodeAnnouncementInfo*)untag_ptr(this_arg); + LDKNodeFeatures ret_var = NodeAnnouncementInfo_features(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; } -static inline uint64_t InvoiceError_clone_ptr(LDKInvoiceError *NONNULL_PTR arg) { - LDKInvoiceError ret_var = InvoiceError_clone(arg); +int32_t CS_LDK_NodeAnnouncementInfo_last_update(int64_t this_arg) { + LDKNodeAnnouncementInfo* this_arg_conv = (LDKNodeAnnouncementInfo*)untag_ptr(this_arg); + int32_t ret_conv = NodeAnnouncementInfo_last_update(this_arg_conv); + return ret_conv; +} + +int8_tArray CS_LDK_NodeAnnouncementInfo_rgb(int64_t this_arg) { + LDKNodeAnnouncementInfo* this_arg_conv = (LDKNodeAnnouncementInfo*)untag_ptr(this_arg); + int8_tArray ret_arr = init_int8_tArray(3, __LINE__); + memcpy(ret_arr->elems, NodeAnnouncementInfo_rgb(this_arg_conv).data, 3); + return ret_arr; +} + +int64_t CS_LDK_NodeAnnouncementInfo_alias(int64_t this_arg) { + LDKNodeAnnouncementInfo* this_arg_conv = (LDKNodeAnnouncementInfo*)untag_ptr(this_arg); + LDKNodeAlias ret_var = NodeAnnouncementInfo_alias(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_InvoiceError_clone_ptr(int64_t arg) { - LDKInvoiceError 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 = InvoiceError_clone_ptr(&arg_conv); - return ret_conv; + +int64_tArray CS_LDK_NodeAnnouncementInfo_addresses(int64_t this_arg) { + LDKNodeAnnouncementInfo* this_arg_conv = (LDKNodeAnnouncementInfo*)untag_ptr(this_arg); + LDKCVec_SocketAddressZ ret_var = NodeAnnouncementInfo_addresses(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 p = 0; p < ret_var.datalen; p++) { + LDKSocketAddress *ret_conv_15_copy = MALLOC(sizeof(LDKSocketAddress), "LDKSocketAddress"); + *ret_conv_15_copy = ret_var.data[p]; + int64_t ret_conv_15_ref = tag_ptr(ret_conv_15_copy, true); + ret_arr_ptr[p] = ret_conv_15_ref; + } + + FREE(ret_var.data); + return ret_arr; } -int64_t CS_LDK_InvoiceError_clone(int64_t orig) { - LDKInvoiceError 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; - LDKInvoiceError ret_var = InvoiceError_clone(&orig_conv); +int64_t CS_LDK_NodeAnnouncementInfo_announcement_message(int64_t this_arg) { + LDKNodeAnnouncementInfo* this_arg_conv = (LDKNodeAnnouncementInfo*)untag_ptr(this_arg); + LDKNodeAnnouncement ret_var = NodeAnnouncementInfo_announcement_message(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_ErroneousField_free(int64_t this_obj) { - LDKErroneousField this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ErroneousField_free(this_obj_conv); +int8_tArray CS_LDK_NodeAnnouncementInfo_write(int64_t obj) { + LDKNodeAnnouncementInfo* obj_conv = (LDKNodeAnnouncementInfo*)untag_ptr(obj); + LDKCVec_u8Z ret_var = NodeAnnouncementInfo_write(obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -int64_t CS_LDK_ErroneousField_get_tlv_fieldnum(int64_t this_ptr) { - LDKErroneousField this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = ErroneousField_get_tlv_fieldnum(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_NodeAnnouncementInfo_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); + *ret_conv = NodeAnnouncementInfo_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -void CS_LDK_ErroneousField_set_tlv_fieldnum(int64_t this_ptr, int64_t val) { - LDKErroneousField this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ErroneousField_set_tlv_fieldnum(&this_ptr_conv, val); +void CS_LDK_NodeAlias_free(int64_t this_obj) { + LDKNodeAlias this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + NodeAlias_free(this_obj_conv); } -int64_t CS_LDK_ErroneousField_get_suggested_value(int64_t this_ptr) { - LDKErroneousField this_ptr_conv; +int8_tArray CS_LDK_NodeAlias_get_a(int64_t this_ptr) { + LDKNodeAlias this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = ErroneousField_get_suggested_value(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *NodeAlias_get_a(&this_ptr_conv), 32); + return ret_arr; } -void CS_LDK_ErroneousField_set_suggested_value(int64_t this_ptr, int64_t val) { - LDKErroneousField this_ptr_conv; +void CS_LDK_NodeAlias_set_a(int64_t this_ptr, int8_tArray val) { + LDKNodeAlias this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - 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)); - ErroneousField_set_suggested_value(&this_ptr_conv, val_conv); + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + NodeAlias_set_a(&this_ptr_conv, val_ref); } -int64_t CS_LDK_ErroneousField_new(int64_t tlv_fieldnum_arg, int64_t suggested_value_arg) { - void* suggested_value_arg_ptr = untag_ptr(suggested_value_arg); - CHECK_ACCESS(suggested_value_arg_ptr); - LDKCOption_CVec_u8ZZ suggested_value_arg_conv = *(LDKCOption_CVec_u8ZZ*)(suggested_value_arg_ptr); - suggested_value_arg_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(suggested_value_arg)); - LDKErroneousField ret_var = ErroneousField_new(tlv_fieldnum_arg, suggested_value_arg_conv); +int64_t CS_LDK_NodeAlias_new(int8_tArray a_arg) { + LDKThirtyTwoBytes a_arg_ref; + CHECK(a_arg->arr_len == 32); + memcpy(a_arg_ref.data, a_arg->elems, 32); FREE(a_arg); + LDKNodeAlias ret_var = NodeAlias_new(a_arg_ref); int64_t ret_ref = 0; 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 ErroneousField_clone_ptr(LDKErroneousField *NONNULL_PTR arg) { - LDKErroneousField ret_var = ErroneousField_clone(arg); +static inline uint64_t NodeAlias_clone_ptr(LDKNodeAlias *NONNULL_PTR arg) { + LDKNodeAlias ret_var = NodeAlias_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_ErroneousField_clone_ptr(int64_t arg) { - LDKErroneousField arg_conv; +int64_t CS_LDK_NodeAlias_clone_ptr(int64_t arg) { + LDKNodeAlias arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = ErroneousField_clone_ptr(&arg_conv); + int64_t ret_conv = NodeAlias_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_ErroneousField_clone(int64_t orig) { - LDKErroneousField orig_conv; +int64_t CS_LDK_NodeAlias_clone(int64_t orig) { + LDKNodeAlias orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKErroneousField ret_var = ErroneousField_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_InvoiceError_from_string(jstring s) { - LDKStr s_conv = str_ref_to_owned_c(s); - LDKInvoiceError ret_var = InvoiceError_from_string(s_conv); + LDKNodeAlias ret_var = NodeAlias_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; } -jstring CS_LDK_InvoiceError_to_str(int64_t o) { - LDKInvoiceError o_conv; +int64_t CS_LDK_NodeAlias_hash(int64_t o) { + LDKNodeAlias o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv.is_owned = false; - LDKStr ret_str = InvoiceError_to_str(&o_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); + int64_t ret_conv = NodeAlias_hash(&o_conv); return ret_conv; } -int8_tArray CS_LDK_InvoiceError_write(int64_t obj) { - LDKInvoiceError obj_conv; +jboolean CS_LDK_NodeAlias_eq(int64_t a, int64_t b) { + LDKNodeAlias a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKNodeAlias b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = NodeAlias_eq(&a_conv, &b_conv); + return ret_conv; +} + +jstring CS_LDK_NodeAlias_to_str(int64_t o) { + LDKNodeAlias o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = NodeAlias_to_str(&o_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +int8_tArray CS_LDK_NodeAlias_write(int64_t obj) { + LDKNodeAlias obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = InvoiceError_write(&obj_conv); + LDKCVec_u8Z ret_var = NodeAlias_write(&obj_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_InvoiceError_read(int8_tArray ser) { +int64_t CS_LDK_NodeAlias_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); - *ret_conv = InvoiceError_read(ser_ref); + LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ"); + *ret_conv = NodeAlias_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -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); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - 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); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKTaggedHash ret_var = UnsignedInvoiceRequest_tagged_hash(&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_InvoiceRequest_free(int64_t this_obj) { - LDKInvoiceRequest this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InvoiceRequest_free(this_obj_conv); -} - -static inline uint64_t InvoiceRequest_clone_ptr(LDKInvoiceRequest *NONNULL_PTR arg) { - LDKInvoiceRequest ret_var = InvoiceRequest_clone(arg); - int64_t ret_ref = 0; - 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_InvoiceRequest_clone_ptr(int64_t arg) { - LDKInvoiceRequest arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = InvoiceRequest_clone_ptr(&arg_conv); - return ret_conv; -} - -int64_t CS_LDK_InvoiceRequest_clone(int64_t orig) { - LDKInvoiceRequest orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKInvoiceRequest ret_var = InvoiceRequest_clone(&orig_conv); - int64_t ret_ref = 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_free(int64_t this_obj) { - LDKVerifiedInvoiceRequest this_obj_conv; +void CS_LDK_NodeInfo_free(int64_t this_obj) { + LDKNodeInfo this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - VerifiedInvoiceRequest_free(this_obj_conv); + NodeInfo_free(this_obj_conv); } -int64_t CS_LDK_VerifiedInvoiceRequest_get_offer_id(int64_t this_ptr) { - LDKVerifiedInvoiceRequest this_ptr_conv; +int64_tArray CS_LDK_NodeInfo_get_channels(int64_t this_ptr) { + LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - 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; + LDKCVec_u64Z ret_var = NodeInfo_get_channels(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + + FREE(ret_var.data); + return ret_arr; } -void CS_LDK_VerifiedInvoiceRequest_set_offer_id(int64_t this_ptr, int64_t val) { - LDKVerifiedInvoiceRequest this_ptr_conv; +void CS_LDK_NodeInfo_set_channels(int64_t this_ptr, int64_tArray val) { + LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - 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); + LDKCVec_u64Z val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = val->elems; + for (size_t g = 0; g < val_constr.datalen; g++) { + int64_t val_conv_6 = val_vals[g]; + val_constr.data[g] = val_conv_6; + } + FREE(val); + NodeInfo_set_channels(&this_ptr_conv, val_constr); } -int64_t CS_LDK_VerifiedInvoiceRequest_get_keys(int64_t this_ptr) { - LDKVerifiedInvoiceRequest this_ptr_conv; +int64_t CS_LDK_NodeInfo_get_announcement_info(int64_t this_ptr) { + LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_SecretKeyZ *ret_copy = MALLOC(sizeof(LDKCOption_SecretKeyZ), "LDKCOption_SecretKeyZ"); - *ret_copy = VerifiedInvoiceRequest_get_keys(&this_ptr_conv); + LDKCOption_NodeAnnouncementInfoZ *ret_copy = MALLOC(sizeof(LDKCOption_NodeAnnouncementInfoZ), "LDKCOption_NodeAnnouncementInfoZ"); + *ret_copy = NodeInfo_get_announcement_info(&this_ptr_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void CS_LDK_VerifiedInvoiceRequest_set_keys(int64_t this_ptr, int64_t val) { - LDKVerifiedInvoiceRequest this_ptr_conv; +void CS_LDK_NodeInfo_set_announcement_info(int64_t this_ptr, int64_t val) { + LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; void* val_ptr = untag_ptr(val); CHECK_ACCESS(val_ptr); - LDKCOption_SecretKeyZ val_conv = *(LDKCOption_SecretKeyZ*)(val_ptr); - val_conv = COption_SecretKeyZ_clone((LDKCOption_SecretKeyZ*)untag_ptr(val)); - VerifiedInvoiceRequest_set_keys(&this_ptr_conv, val_conv); + LDKCOption_NodeAnnouncementInfoZ val_conv = *(LDKCOption_NodeAnnouncementInfoZ*)(val_ptr); + val_conv = COption_NodeAnnouncementInfoZ_clone((LDKCOption_NodeAnnouncementInfoZ*)untag_ptr(val)); + NodeInfo_set_announcement_info(&this_ptr_conv, val_conv); } -static inline uint64_t VerifiedInvoiceRequest_clone_ptr(LDKVerifiedInvoiceRequest *NONNULL_PTR arg) { - LDKVerifiedInvoiceRequest ret_var = VerifiedInvoiceRequest_clone(arg); +static inline uint64_t NodeInfo_clone_ptr(LDKNodeInfo *NONNULL_PTR arg) { + LDKNodeInfo ret_var = NodeInfo_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_VerifiedInvoiceRequest_clone_ptr(int64_t arg) { - LDKVerifiedInvoiceRequest arg_conv; +int64_t CS_LDK_NodeInfo_clone_ptr(int64_t arg) { + LDKNodeInfo arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = VerifiedInvoiceRequest_clone_ptr(&arg_conv); + int64_t ret_conv = NodeInfo_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_VerifiedInvoiceRequest_clone(int64_t orig) { - LDKVerifiedInvoiceRequest orig_conv; +int64_t CS_LDK_NodeInfo_clone(int64_t orig) { + LDKNodeInfo orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKVerifiedInvoiceRequest ret_var = VerifiedInvoiceRequest_clone(&orig_conv); + LDKNodeInfo ret_var = NodeInfo_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; } -ptrArray CS_LDK_UnsignedInvoiceRequest_chains(int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +jboolean CS_LDK_NodeInfo_eq(int64_t a, int64_t b) { + LDKNodeInfo a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKNodeInfo b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = NodeInfo_eq(&a_conv, &b_conv); + return ret_conv; +} + +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; - LDKCVec_ThirtyTwoBytesZ ret_var = UnsignedInvoiceRequest_chains(&this_arg_conv); - ptrArray ret_arr = NULL; - ret_arr = init_ptrArray(ret_var.datalen, __LINE__); - int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8); - for (size_t i = 0; i < ret_var.datalen; i++) { - int8_tArray ret_conv_8_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_conv_8_arr->elems, ret_var.data[i].data, 32); - ret_arr_ptr[i] = ret_conv_8_arr; - } - - FREE(ret_var.data); + jboolean ret_conv = NodeInfo_is_tor_only(&this_arg_conv); + return ret_conv; +} + +jstring CS_LDK_NodeInfo_to_str(int64_t o) { + LDKNodeInfo o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = NodeInfo_to_str(&o_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +int8_tArray CS_LDK_NodeInfo_write(int64_t obj) { + LDKNodeInfo obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = NodeInfo_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_UnsignedInvoiceRequest_metadata(int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = UnsignedInvoiceRequest_metadata(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_NodeInfo_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); + *ret_conv = NodeInfo_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_UnsignedInvoiceRequest_amount(int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_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; +int8_tArray CS_LDK_NetworkGraph_write(int64_t obj) { + LDKNetworkGraph obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = NetworkGraph_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -int64_t CS_LDK_UnsignedInvoiceRequest_description(int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = UnsignedInvoiceRequest_description(&this_arg_conv); +int64_t CS_LDK_NetworkGraph_read(int8_tArray ser, int64_t arg) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + void* arg_ptr = untag_ptr(arg); + CHECK_ACCESS(arg_ptr); + LDKLogger arg_conv = *(LDKLogger*)(arg_ptr); + if (arg_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&arg_conv); + } + LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); + *ret_conv = NetworkGraph_read(ser_ref, arg_conv); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +jstring CS_LDK_NetworkGraph_to_str(int64_t o) { + LDKNetworkGraph o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = NetworkGraph_to_str(&o_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +int64_t CS_LDK_NetworkGraph_new(int32_t network, int64_t logger) { + LDKNetwork network_conv = LDKNetwork_from_cs(network); + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKNetworkGraph ret_var = NetworkGraph_new(network_conv, logger_conv); int64_t ret_ref = 0; 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_offer_features(int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +int64_t CS_LDK_NetworkGraph_read_only(int64_t this_arg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKOfferFeatures ret_var = UnsignedInvoiceRequest_offer_features(&this_arg_conv); + LDKReadOnlyNetworkGraph ret_var = NetworkGraph_read_only(&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_UnsignedInvoiceRequest_absolute_expiry(int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +int64_t CS_LDK_NetworkGraph_get_last_rapid_gossip_sync_timestamp(int64_t this_arg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = UnsignedInvoiceRequest_absolute_expiry(&this_arg_conv); + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = NetworkGraph_get_last_rapid_gossip_sync_timestamp(&this_arg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_UnsignedInvoiceRequest_issuer(int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +void CS_LDK_NetworkGraph_set_last_rapid_gossip_sync_timestamp(int64_t this_arg, int32_t last_rapid_gossip_sync_timestamp) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKPrintableString ret_var = UnsignedInvoiceRequest_issuer(&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; + NetworkGraph_set_last_rapid_gossip_sync_timestamp(&this_arg_conv, last_rapid_gossip_sync_timestamp); } -int64_tArray CS_LDK_UnsignedInvoiceRequest_paths(int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +int64_t CS_LDK_NetworkGraph_update_node_from_announcement(int64_t this_arg, int64_t msg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_BlindedPathZ ret_var = UnsignedInvoiceRequest_paths(&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 n = 0; n < ret_var.datalen; n++) { - LDKBlindedPath 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_UnsignedInvoiceRequest_supported_quantity(int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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_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; + LDKNodeAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_node_from_announcement(&this_arg_conv, &msg_conv); + return tag_ptr(ret_conv, true); } -int8_tArray CS_LDK_UnsignedInvoiceRequest_signing_pubkey(int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +int64_t CS_LDK_NetworkGraph_update_node_from_unsigned_announcement(int64_t this_arg, int64_t msg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, UnsignedInvoiceRequest_signing_pubkey(&this_arg_conv).compressed_form, 33); - return ret_arr; + LDKUnsignedNodeAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_node_from_unsigned_announcement(&this_arg_conv, &msg_conv); + return tag_ptr(ret_conv, true); } -int8_tArray CS_LDK_UnsignedInvoiceRequest_payer_metadata(int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +int64_t CS_LDK_NetworkGraph_update_channel_from_announcement(int64_t this_arg, int64_t msg, int64_t utxo_lookup) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKu8slice ret_var = UnsignedInvoiceRequest_payer_metadata(&this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - return ret_arr; + LDKChannelAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + void* utxo_lookup_ptr = untag_ptr(utxo_lookup); + CHECK_ACCESS(utxo_lookup_ptr); + LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr); + // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ + if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) { + // Manually implement clone for Java trait instances + if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some); + } + } + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_channel_from_announcement(&this_arg_conv, &msg_conv, utxo_lookup_conv); + return tag_ptr(ret_conv, true); } -int8_tArray CS_LDK_UnsignedInvoiceRequest_chain(int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +int64_t CS_LDK_NetworkGraph_update_channel_from_announcement_no_lookup(int64_t this_arg, int64_t msg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, UnsignedInvoiceRequest_chain(&this_arg_conv).data, 32); - return ret_arr; + LDKChannelAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_channel_from_announcement_no_lookup(&this_arg_conv, &msg_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_UnsignedInvoiceRequest_amount_msats(int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +int64_t CS_LDK_NetworkGraph_update_channel_from_unsigned_announcement(int64_t this_arg, int64_t msg, int64_t utxo_lookup) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = UnsignedInvoiceRequest_amount_msats(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKUnsignedChannelAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + void* utxo_lookup_ptr = untag_ptr(utxo_lookup); + CHECK_ACCESS(utxo_lookup_ptr); + LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr); + // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ + if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) { + // Manually implement clone for Java trait instances + if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some); + } + } + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_channel_from_unsigned_announcement(&this_arg_conv, &msg_conv, utxo_lookup_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_UnsignedInvoiceRequest_invoice_request_features(int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +int64_t CS_LDK_NetworkGraph_add_channel_from_partial_announcement(int64_t this_arg, int64_t short_channel_id, int64_t timestamp, int64_t features, int8_tArray node_id_1, int8_tArray node_id_2) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKInvoiceRequestFeatures ret_var = UnsignedInvoiceRequest_invoice_request_features(&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; + LDKChannelFeatures features_conv; + features_conv.inner = untag_ptr(features); + features_conv.is_owned = ptr_is_owned(features); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); + features_conv = ChannelFeatures_clone(&features_conv); + LDKPublicKey node_id_1_ref; + CHECK(node_id_1->arr_len == 33); + memcpy(node_id_1_ref.compressed_form, node_id_1->elems, 33); FREE(node_id_1); + LDKPublicKey node_id_2_ref; + CHECK(node_id_2->arr_len == 33); + memcpy(node_id_2_ref.compressed_form, node_id_2->elems, 33); FREE(node_id_2); + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_add_channel_from_partial_announcement(&this_arg_conv, short_channel_id, timestamp, features_conv, node_id_1_ref, node_id_2_ref); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_UnsignedInvoiceRequest_quantity(int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +void CS_LDK_NetworkGraph_channel_failed_permanent(int64_t this_arg, int64_t short_channel_id) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = UnsignedInvoiceRequest_quantity(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + NetworkGraph_channel_failed_permanent(&this_arg_conv, short_channel_id); } -int8_tArray CS_LDK_UnsignedInvoiceRequest_payer_id(int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +void CS_LDK_NetworkGraph_node_failed_permanent(int64_t this_arg, int8_tArray node_id) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, UnsignedInvoiceRequest_payer_id(&this_arg_conv).compressed_form, 33); - return ret_arr; + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + NetworkGraph_node_failed_permanent(&this_arg_conv, node_id_ref); } -int64_t CS_LDK_UnsignedInvoiceRequest_payer_note(int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +void CS_LDK_NetworkGraph_remove_stale_channels_and_tracking(int64_t this_arg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKPrintableString ret_var = UnsignedInvoiceRequest_payer_note(&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; + NetworkGraph_remove_stale_channels_and_tracking(&this_arg_conv); } -ptrArray CS_LDK_InvoiceRequest_chains(int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +void CS_LDK_NetworkGraph_remove_stale_channels_and_tracking_with_time(int64_t this_arg, int64_t current_time_unix) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_ThirtyTwoBytesZ ret_var = InvoiceRequest_chains(&this_arg_conv); - ptrArray ret_arr = NULL; - ret_arr = init_ptrArray(ret_var.datalen, __LINE__); - int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8); - for (size_t i = 0; i < ret_var.datalen; i++) { - int8_tArray ret_conv_8_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_conv_8_arr->elems, ret_var.data[i].data, 32); - ret_arr_ptr[i] = ret_conv_8_arr; - } - - FREE(ret_var.data); - return ret_arr; + NetworkGraph_remove_stale_channels_and_tracking_with_time(&this_arg_conv, current_time_unix); } -int64_t CS_LDK_InvoiceRequest_metadata(int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +int64_t CS_LDK_NetworkGraph_update_channel(int64_t this_arg, int64_t msg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = InvoiceRequest_metadata(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKChannelUpdate msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_channel(&this_arg_conv, &msg_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_InvoiceRequest_amount(int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +int64_t CS_LDK_NetworkGraph_update_channel_unsigned(int64_t this_arg, int64_t msg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - 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; + LDKUnsignedChannelUpdate msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_channel_unsigned(&this_arg_conv, &msg_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_InvoiceRequest_description(int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +int64_t CS_LDK_NetworkGraph_verify_channel_update(int64_t this_arg, int64_t msg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKPrintableString ret_var = InvoiceRequest_description(&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; + LDKChannelUpdate msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_verify_channel_update(&this_arg_conv, &msg_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_InvoiceRequest_offer_features(int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +int64_t CS_LDK_ReadOnlyNetworkGraph_channel(int64_t this_arg, int64_t short_channel_id) { + LDKReadOnlyNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKOfferFeatures ret_var = InvoiceRequest_offer_features(&this_arg_conv); + LDKChannelInfo ret_var = ReadOnlyNetworkGraph_channel(&this_arg_conv, short_channel_id); int64_t ret_ref = 0; 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_InvoiceRequest_absolute_expiry(int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +int64_tArray CS_LDK_ReadOnlyNetworkGraph_list_channels(int64_t this_arg) { + LDKReadOnlyNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = InvoiceRequest_absolute_expiry(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKCVec_u64Z ret_var = ReadOnlyNetworkGraph_list_channels(&this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + + FREE(ret_var.data); + return ret_arr; } -int64_t CS_LDK_InvoiceRequest_issuer(int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +int64_t CS_LDK_ReadOnlyNetworkGraph_node(int64_t this_arg, int64_t node_id) { + LDKReadOnlyNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKPrintableString ret_var = InvoiceRequest_issuer(&this_arg_conv); + LDKNodeId node_id_conv; + node_id_conv.inner = untag_ptr(node_id); + node_id_conv.is_owned = ptr_is_owned(node_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); + node_id_conv.is_owned = false; + LDKNodeInfo ret_var = ReadOnlyNetworkGraph_node(&this_arg_conv, &node_id_conv); int64_t ret_ref = 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_InvoiceRequest_paths(int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +int64_tArray CS_LDK_ReadOnlyNetworkGraph_list_nodes(int64_t this_arg) { + LDKReadOnlyNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_BlindedPathZ ret_var = InvoiceRequest_paths(&this_arg_conv); + LDKCVec_NodeIdZ ret_var = ReadOnlyNetworkGraph_list_nodes(&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 n = 0; n < ret_var.datalen; n++) { - LDKBlindedPath 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; + for (size_t i = 0; i < ret_var.datalen; i++) { + LDKNodeId ret_conv_8_var = ret_var.data[i]; + int64_t ret_conv_8_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_8_var); + ret_conv_8_ref = tag_ptr(ret_conv_8_var.inner, ret_conv_8_var.is_owned); + ret_arr_ptr[i] = ret_conv_8_ref; } FREE(ret_var.data); return ret_arr; } -int64_t CS_LDK_InvoiceRequest_supported_quantity(int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +int64_t CS_LDK_ReadOnlyNetworkGraph_get_addresses(int64_t this_arg, int8_tArray pubkey) { + LDKReadOnlyNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); - *ret_copy = InvoiceRequest_supported_quantity(&this_arg_conv); + LDKPublicKey pubkey_ref; + CHECK(pubkey->arr_len == 33); + memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); FREE(pubkey); + LDKCOption_CVec_SocketAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_SocketAddressZZ), "LDKCOption_CVec_SocketAddressZZ"); + *ret_copy = ReadOnlyNetworkGraph_get_addresses(&this_arg_conv, pubkey_ref); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int8_tArray CS_LDK_InvoiceRequest_signing_pubkey(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(33, __LINE__); - memcpy(ret_arr->elems, InvoiceRequest_signing_pubkey(&this_arg_conv).compressed_form, 33); - return ret_arr; +void CS_LDK_DefaultRouter_free(int64_t this_obj) { + LDKDefaultRouter this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + DefaultRouter_free(this_obj_conv); } -int8_tArray CS_LDK_InvoiceRequest_payer_metadata(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; - LDKu8slice ret_var = InvoiceRequest_payer_metadata(&this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - return ret_arr; +int64_t CS_LDK_DefaultRouter_new(int64_t network_graph, int64_t logger, int64_t entropy_source, int64_t scorer, int64_t score_params) { + LDKNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + void* scorer_ptr = untag_ptr(scorer); + CHECK_ACCESS(scorer_ptr); + LDKLockableScore scorer_conv = *(LDKLockableScore*)(scorer_ptr); + if (scorer_conv.free == LDKLockableScore_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLockableScore_JCalls_cloned(&scorer_conv); + } + LDKProbabilisticScoringFeeParameters score_params_conv; + score_params_conv.inner = untag_ptr(score_params); + score_params_conv.is_owned = ptr_is_owned(score_params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(score_params_conv); + score_params_conv = ProbabilisticScoringFeeParameters_clone(&score_params_conv); + LDKDefaultRouter ret_var = DefaultRouter_new(&network_graph_conv, logger_conv, entropy_source_conv, scorer_conv, score_params_conv); + int64_t ret_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_InvoiceRequest_chain(int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +int64_t CS_LDK_DefaultRouter_as_Router(int64_t this_arg) { + LDKDefaultRouter this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, InvoiceRequest_chain(&this_arg_conv).data, 32); - return ret_arr; + LDKRouter* ret_ret = MALLOC(sizeof(LDKRouter), "LDKRouter"); + *ret_ret = DefaultRouter_as_Router(&this_arg_conv); + return tag_ptr(ret_ret, true); } -int64_t CS_LDK_InvoiceRequest_amount_msats(int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +int64_t CS_LDK_DefaultRouter_as_MessageRouter(int64_t this_arg) { + LDKDefaultRouter this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = InvoiceRequest_amount_msats(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKMessageRouter* ret_ret = MALLOC(sizeof(LDKMessageRouter), "LDKMessageRouter"); + *ret_ret = DefaultRouter_as_MessageRouter(&this_arg_conv); + return tag_ptr(ret_ret, true); } -int64_t CS_LDK_InvoiceRequest_invoice_request_features(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; - LDKInvoiceRequestFeatures ret_var = InvoiceRequest_invoice_request_features(&this_arg_conv); +void CS_LDK_Router_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); + LDKRouter this_ptr_conv = *(LDKRouter*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Router_free(this_ptr_conv); +} + +void CS_LDK_ScorerAccountingForInFlightHtlcs_free(int64_t this_obj) { + LDKScorerAccountingForInFlightHtlcs this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ScorerAccountingForInFlightHtlcs_free(this_obj_conv); +} + +int64_t CS_LDK_ScorerAccountingForInFlightHtlcs_new(int64_t scorer, int64_t inflight_htlcs) { + void* scorer_ptr = untag_ptr(scorer); + CHECK_ACCESS(scorer_ptr); + LDKScoreLookUp scorer_conv = *(LDKScoreLookUp*)(scorer_ptr); + if (scorer_conv.free == LDKScoreLookUp_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKScoreLookUp_JCalls_cloned(&scorer_conv); + } + LDKInFlightHtlcs inflight_htlcs_conv; + inflight_htlcs_conv.inner = untag_ptr(inflight_htlcs); + inflight_htlcs_conv.is_owned = ptr_is_owned(inflight_htlcs); + CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_conv); + inflight_htlcs_conv.is_owned = false; + LDKScorerAccountingForInFlightHtlcs ret_var = ScorerAccountingForInFlightHtlcs_new(scorer_conv, &inflight_htlcs_conv); int64_t ret_ref = 0; 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_InvoiceRequest_quantity(int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +int64_t CS_LDK_ScorerAccountingForInFlightHtlcs_as_ScoreLookUp(int64_t this_arg) { + LDKScorerAccountingForInFlightHtlcs this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = InvoiceRequest_quantity(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); + LDKScoreLookUp* ret_ret = MALLOC(sizeof(LDKScoreLookUp), "LDKScoreLookUp"); + *ret_ret = ScorerAccountingForInFlightHtlcs_as_ScoreLookUp(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +void CS_LDK_InFlightHtlcs_free(int64_t this_obj) { + LDKInFlightHtlcs this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InFlightHtlcs_free(this_obj_conv); +} + +static inline uint64_t InFlightHtlcs_clone_ptr(LDKInFlightHtlcs *NONNULL_PTR arg) { + LDKInFlightHtlcs ret_var = InFlightHtlcs_clone(arg); + int64_t ret_ref = 0; + 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_InFlightHtlcs_clone_ptr(int64_t arg) { + LDKInFlightHtlcs arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = InFlightHtlcs_clone_ptr(&arg_conv); + return ret_conv; +} -int8_tArray CS_LDK_InvoiceRequest_payer_id(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(33, __LINE__); - memcpy(ret_arr->elems, InvoiceRequest_payer_id(&this_arg_conv).compressed_form, 33); - return ret_arr; +int64_t CS_LDK_InFlightHtlcs_clone(int64_t orig) { + LDKInFlightHtlcs orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKInFlightHtlcs ret_var = InFlightHtlcs_clone(&orig_conv); + int64_t ret_ref = 0; + 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_InvoiceRequest_payer_note(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; - LDKPrintableString ret_var = InvoiceRequest_payer_note(&this_arg_conv); +int64_t CS_LDK_InFlightHtlcs_new() { + LDKInFlightHtlcs ret_var = InFlightHtlcs_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_InvoiceRequest_respond_with(int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash) { - LDKInvoiceRequest this_arg_conv; +void CS_LDK_InFlightHtlcs_process_path(int64_t this_arg, int64_t path, int8_tArray payer_node_id) { + LDKInFlightHtlcs this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - 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); + LDKPath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv.is_owned = false; + LDKPublicKey payer_node_id_ref; + CHECK(payer_node_id->arr_len == 33); + memcpy(payer_node_id_ref.compressed_form, payer_node_id->elems, 33); FREE(payer_node_id); + InFlightHtlcs_process_path(&this_arg_conv, &path_conv, payer_node_id_ref); } -int64_t 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; +void CS_LDK_InFlightHtlcs_add_inflight_htlc(int64_t this_arg, int64_t source, int64_t target, int64_t channel_scid, int64_t used_msat) { + LDKInFlightHtlcs this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - 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) { - 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 = InvoiceRequest_clone(&this_arg_conv); - LDKExpandedKey key_conv; - key_conv.inner = untag_ptr(key); - key_conv.is_owned = ptr_is_owned(key); - CHECK_INNER_FIELD_ACCESS_OR_NULL(key_conv); - key_conv.is_owned = false; - LDKCResult_VerifiedInvoiceRequestNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_VerifiedInvoiceRequestNoneZ), "LDKCResult_VerifiedInvoiceRequestNoneZ"); - *ret_conv = InvoiceRequest_verify(this_arg_conv, &key_conv); - 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); - this_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_ThirtyTwoBytesZ ret_var = VerifiedInvoiceRequest_chains(&this_arg_conv); - ptrArray ret_arr = NULL; - ret_arr = init_ptrArray(ret_var.datalen, __LINE__); - int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8); - for (size_t i = 0; i < ret_var.datalen; i++) { - int8_tArray ret_conv_8_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_conv_8_arr->elems, ret_var.data[i].data, 32); - ret_arr_ptr[i] = ret_conv_8_arr; - } - - FREE(ret_var.data); - return ret_arr; -} - -int64_t CS_LDK_VerifiedInvoiceRequest_metadata(int64_t this_arg) { - 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; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = VerifiedInvoiceRequest_metadata(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_VerifiedInvoiceRequest_amount(int64_t this_arg) { - 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; - 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; -} - -int64_t CS_LDK_VerifiedInvoiceRequest_description(int64_t this_arg) { - 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; - LDKPrintableString ret_var = VerifiedInvoiceRequest_description(&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_VerifiedInvoiceRequest_offer_features(int64_t this_arg) { - 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; - LDKOfferFeatures ret_var = VerifiedInvoiceRequest_offer_features(&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_VerifiedInvoiceRequest_absolute_expiry(int64_t this_arg) { - 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; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = VerifiedInvoiceRequest_absolute_expiry(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_VerifiedInvoiceRequest_issuer(int64_t this_arg) { - 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; - LDKPrintableString ret_var = VerifiedInvoiceRequest_issuer(&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_VerifiedInvoiceRequest_paths(int64_t this_arg) { - 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_BlindedPathZ ret_var = VerifiedInvoiceRequest_paths(&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 n = 0; n < ret_var.datalen; n++) { - LDKBlindedPath 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_VerifiedInvoiceRequest_supported_quantity(int64_t this_arg) { - 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; - 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; -} - -int8_tArray CS_LDK_VerifiedInvoiceRequest_signing_pubkey(int64_t this_arg) { - 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; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, VerifiedInvoiceRequest_signing_pubkey(&this_arg_conv).compressed_form, 33); - return ret_arr; -} - -int8_tArray CS_LDK_VerifiedInvoiceRequest_payer_metadata(int64_t this_arg) { - 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; - LDKu8slice ret_var = VerifiedInvoiceRequest_payer_metadata(&this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - return ret_arr; -} - -int8_tArray CS_LDK_VerifiedInvoiceRequest_chain(int64_t this_arg) { - 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; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, VerifiedInvoiceRequest_chain(&this_arg_conv).data, 32); - return ret_arr; -} - -int64_t CS_LDK_VerifiedInvoiceRequest_amount_msats(int64_t this_arg) { - 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; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = VerifiedInvoiceRequest_amount_msats(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_VerifiedInvoiceRequest_invoice_request_features(int64_t this_arg) { - 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; - LDKInvoiceRequestFeatures ret_var = VerifiedInvoiceRequest_invoice_request_features(&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; + LDKNodeId source_conv; + source_conv.inner = untag_ptr(source); + source_conv.is_owned = ptr_is_owned(source); + CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv); + source_conv.is_owned = false; + LDKNodeId target_conv; + target_conv.inner = untag_ptr(target); + target_conv.is_owned = ptr_is_owned(target); + CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); + target_conv.is_owned = false; + InFlightHtlcs_add_inflight_htlc(&this_arg_conv, &source_conv, &target_conv, channel_scid, used_msat); } -int64_t CS_LDK_VerifiedInvoiceRequest_quantity(int64_t this_arg) { - LDKVerifiedInvoiceRequest this_arg_conv; +int64_t CS_LDK_InFlightHtlcs_used_liquidity_msat(int64_t this_arg, int64_t source, int64_t target, int64_t channel_scid) { + LDKInFlightHtlcs this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; + LDKNodeId source_conv; + source_conv.inner = untag_ptr(source); + source_conv.is_owned = ptr_is_owned(source); + CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv); + source_conv.is_owned = false; + LDKNodeId target_conv; + target_conv.inner = untag_ptr(target); + target_conv.is_owned = ptr_is_owned(target); + CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); + target_conv.is_owned = false; LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = VerifiedInvoiceRequest_quantity(&this_arg_conv); + *ret_copy = InFlightHtlcs_used_liquidity_msat(&this_arg_conv, &source_conv, &target_conv, channel_scid); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int8_tArray CS_LDK_VerifiedInvoiceRequest_payer_id(int64_t this_arg) { - 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; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, VerifiedInvoiceRequest_payer_id(&this_arg_conv).compressed_form, 33); - return ret_arr; -} - -int64_t CS_LDK_VerifiedInvoiceRequest_payer_note(int64_t this_arg) { - 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; - LDKPrintableString ret_var = VerifiedInvoiceRequest_payer_note(&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_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; +int8_tArray CS_LDK_InFlightHtlcs_write(int64_t obj) { + LDKInFlightHtlcs obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = UnsignedInvoiceRequest_write(&obj_conv); + LDKCVec_u8Z ret_var = InFlightHtlcs_write(&obj_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } -int8_tArray CS_LDK_InvoiceRequest_write(int64_t obj) { - LDKInvoiceRequest obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = InvoiceRequest_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +int64_t CS_LDK_InFlightHtlcs_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ"); + *ret_conv = InFlightHtlcs_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -void CS_LDK_InvoiceRequestFields_free(int64_t this_obj) { - LDKInvoiceRequestFields this_obj_conv; +void CS_LDK_RouteHop_free(int64_t this_obj) { + LDKRouteHop this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InvoiceRequestFields_free(this_obj_conv); + RouteHop_free(this_obj_conv); } -int8_tArray CS_LDK_InvoiceRequestFields_get_payer_id(int64_t this_ptr) { - LDKInvoiceRequestFields this_ptr_conv; +int8_tArray CS_LDK_RouteHop_get_pubkey(int64_t this_ptr) { + LDKRouteHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, InvoiceRequestFields_get_payer_id(&this_ptr_conv).compressed_form, 33); + memcpy(ret_arr->elems, RouteHop_get_pubkey(&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; +void CS_LDK_RouteHop_set_pubkey(int64_t this_ptr, int8_tArray val) { + LDKRouteHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -68533,1273 +71555,2007 @@ void CS_LDK_InvoiceRequestFields_set_payer_id(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); - InvoiceRequestFields_set_payer_id(&this_ptr_conv, val_ref); + RouteHop_set_pubkey(&this_ptr_conv, val_ref); } -int64_t CS_LDK_InvoiceRequestFields_get_quantity(int64_t this_ptr) { - LDKInvoiceRequestFields this_ptr_conv; +int64_t CS_LDK_RouteHop_get_node_features(int64_t this_ptr) { + LDKRouteHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - 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); + LDKNodeFeatures ret_var = RouteHop_get_node_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_InvoiceRequestFields_set_quantity(int64_t this_ptr, int64_t val) { - LDKInvoiceRequestFields this_ptr_conv; +void CS_LDK_RouteHop_set_node_features(int64_t this_ptr, int64_t val) { + LDKRouteHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - 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); + LDKNodeFeatures val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = NodeFeatures_clone(&val_conv); + RouteHop_set_node_features(&this_ptr_conv, val_conv); } -int64_t CS_LDK_InvoiceRequestFields_get_payer_note_truncated(int64_t this_ptr) { - LDKInvoiceRequestFields this_ptr_conv; +int64_t CS_LDK_RouteHop_get_short_channel_id(int64_t this_ptr) { + LDKRouteHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKUntrustedString ret_var = InvoiceRequestFields_get_payer_note_truncated(&this_ptr_conv); + int64_t ret_conv = RouteHop_get_short_channel_id(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_RouteHop_set_short_channel_id(int64_t this_ptr, int64_t val) { + LDKRouteHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + RouteHop_set_short_channel_id(&this_ptr_conv, val); +} + +int64_t CS_LDK_RouteHop_get_channel_features(int64_t this_ptr) { + LDKRouteHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelFeatures ret_var = RouteHop_get_channel_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_InvoiceRequestFields_set_payer_note_truncated(int64_t this_ptr, int64_t val) { - LDKInvoiceRequestFields this_ptr_conv; +void CS_LDK_RouteHop_set_channel_features(int64_t this_ptr, int64_t val) { + LDKRouteHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKUntrustedString val_conv; + LDKChannelFeatures val_conv; val_conv.inner = untag_ptr(val); val_conv.is_owned = ptr_is_owned(val); CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = UntrustedString_clone(&val_conv); - InvoiceRequestFields_set_payer_note_truncated(&this_ptr_conv, val_conv); + val_conv = ChannelFeatures_clone(&val_conv); + RouteHop_set_channel_features(&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; +int64_t CS_LDK_RouteHop_get_fee_msat(int64_t this_ptr) { + LDKRouteHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = RouteHop_get_fee_msat(&this_ptr_conv); + return ret_conv; } -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; +void CS_LDK_RouteHop_set_fee_msat(int64_t this_ptr, int64_t val) { + LDKRouteHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + RouteHop_set_fee_msat(&this_ptr_conv, val); } -int64_t CS_LDK_InvoiceRequestFields_clone(int64_t orig) { - LDKInvoiceRequestFields orig_conv; +int32_t CS_LDK_RouteHop_get_cltv_expiry_delta(int64_t this_ptr) { + LDKRouteHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = RouteHop_get_cltv_expiry_delta(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_RouteHop_set_cltv_expiry_delta(int64_t this_ptr, int32_t val) { + LDKRouteHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + RouteHop_set_cltv_expiry_delta(&this_ptr_conv, val); +} + +jboolean CS_LDK_RouteHop_get_maybe_announced_channel(int64_t this_ptr) { + LDKRouteHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + jboolean ret_conv = RouteHop_get_maybe_announced_channel(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_RouteHop_set_maybe_announced_channel(int64_t this_ptr, jboolean val) { + LDKRouteHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + RouteHop_set_maybe_announced_channel(&this_ptr_conv, val); +} + +int64_t CS_LDK_RouteHop_new(int8_tArray pubkey_arg, int64_t node_features_arg, int64_t short_channel_id_arg, int64_t channel_features_arg, int64_t fee_msat_arg, int32_t cltv_expiry_delta_arg, jboolean maybe_announced_channel_arg) { + LDKPublicKey pubkey_arg_ref; + CHECK(pubkey_arg->arr_len == 33); + memcpy(pubkey_arg_ref.compressed_form, pubkey_arg->elems, 33); FREE(pubkey_arg); + LDKNodeFeatures node_features_arg_conv; + node_features_arg_conv.inner = untag_ptr(node_features_arg); + node_features_arg_conv.is_owned = ptr_is_owned(node_features_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_features_arg_conv); + node_features_arg_conv = NodeFeatures_clone(&node_features_arg_conv); + LDKChannelFeatures channel_features_arg_conv; + channel_features_arg_conv.inner = untag_ptr(channel_features_arg); + channel_features_arg_conv.is_owned = ptr_is_owned(channel_features_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_features_arg_conv); + channel_features_arg_conv = ChannelFeatures_clone(&channel_features_arg_conv); + LDKRouteHop ret_var = RouteHop_new(pubkey_arg_ref, node_features_arg_conv, short_channel_id_arg, channel_features_arg_conv, fee_msat_arg, cltv_expiry_delta_arg, maybe_announced_channel_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 RouteHop_clone_ptr(LDKRouteHop *NONNULL_PTR arg) { + LDKRouteHop ret_var = RouteHop_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_RouteHop_clone_ptr(int64_t arg) { + LDKRouteHop arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = RouteHop_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_RouteHop_clone(int64_t orig) { + LDKRouteHop orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKInvoiceRequestFields ret_var = InvoiceRequestFields_clone(&orig_conv); + LDKRouteHop ret_var = RouteHop_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; +int64_t CS_LDK_RouteHop_hash(int64_t o) { + LDKRouteHop o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = RouteHop_hash(&o_conv); + return ret_conv; +} + +jboolean CS_LDK_RouteHop_eq(int64_t a, int64_t b) { + LDKRouteHop a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKInvoiceRequestFields b_conv; + LDKRouteHop b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = InvoiceRequestFields_eq(&a_conv, &b_conv); + jboolean ret_conv = RouteHop_eq(&a_conv, &b_conv); return ret_conv; } -int8_tArray CS_LDK_InvoiceRequestFields_write(int64_t obj) { - LDKInvoiceRequestFields obj_conv; +int8_tArray CS_LDK_RouteHop_write(int64_t obj) { + LDKRouteHop obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = InvoiceRequestFields_write(&obj_conv); + LDKCVec_u8Z ret_var = RouteHop_write(&obj_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_InvoiceRequestFields_read(int8_tArray ser) { +int64_t CS_LDK_RouteHop_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); + LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); + *ret_conv = RouteHop_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_TaggedHash_free(int64_t this_obj) { - LDKTaggedHash this_obj_conv; +void CS_LDK_BlindedTail_free(int64_t this_obj) { + LDKBlindedTail this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - TaggedHash_free(this_obj_conv); + BlindedTail_free(this_obj_conv); } -static inline uint64_t TaggedHash_clone_ptr(LDKTaggedHash *NONNULL_PTR arg) { - LDKTaggedHash ret_var = TaggedHash_clone(arg); +int64_tArray CS_LDK_BlindedTail_get_hops(int64_t this_ptr) { + LDKBlindedTail this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_BlindedHopZ ret_var = BlindedTail_get_hops(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t m = 0; m < ret_var.datalen; m++) { + LDKBlindedHop ret_conv_12_var = ret_var.data[m]; + int64_t ret_conv_12_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_var); + ret_conv_12_ref = tag_ptr(ret_conv_12_var.inner, ret_conv_12_var.is_owned); + ret_arr_ptr[m] = ret_conv_12_ref; + } + + FREE(ret_var.data); + return ret_arr; +} + +void CS_LDK_BlindedTail_set_hops(int64_t this_ptr, int64_tArray val) { + LDKBlindedTail this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_BlindedHopZ val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKBlindedHop), "LDKCVec_BlindedHopZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = val->elems; + for (size_t m = 0; m < val_constr.datalen; m++) { + int64_t val_conv_12 = val_vals[m]; + LDKBlindedHop val_conv_12_conv; + val_conv_12_conv.inner = untag_ptr(val_conv_12); + val_conv_12_conv.is_owned = ptr_is_owned(val_conv_12); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_12_conv); + val_conv_12_conv = BlindedHop_clone(&val_conv_12_conv); + val_constr.data[m] = val_conv_12_conv; + } + FREE(val); + BlindedTail_set_hops(&this_ptr_conv, val_constr); +} + +int8_tArray CS_LDK_BlindedTail_get_blinding_point(int64_t this_ptr) { + LDKBlindedTail this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, BlindedTail_get_blinding_point(&this_ptr_conv).compressed_form, 33); + return ret_arr; +} + +void CS_LDK_BlindedTail_set_blinding_point(int64_t this_ptr, int8_tArray val) { + LDKBlindedTail this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + BlindedTail_set_blinding_point(&this_ptr_conv, val_ref); +} + +int32_t CS_LDK_BlindedTail_get_excess_final_cltv_expiry_delta(int64_t this_ptr) { + LDKBlindedTail this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = BlindedTail_get_excess_final_cltv_expiry_delta(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_BlindedTail_set_excess_final_cltv_expiry_delta(int64_t this_ptr, int32_t val) { + LDKBlindedTail this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + BlindedTail_set_excess_final_cltv_expiry_delta(&this_ptr_conv, val); +} + +int64_t CS_LDK_BlindedTail_get_final_value_msat(int64_t this_ptr) { + LDKBlindedTail this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = BlindedTail_get_final_value_msat(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_BlindedTail_set_final_value_msat(int64_t this_ptr, int64_t val) { + LDKBlindedTail this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + BlindedTail_set_final_value_msat(&this_ptr_conv, val); +} + +int64_t CS_LDK_BlindedTail_new(int64_tArray hops_arg, int8_tArray blinding_point_arg, int32_t excess_final_cltv_expiry_delta_arg, int64_t final_value_msat_arg) { + LDKCVec_BlindedHopZ hops_arg_constr; + hops_arg_constr.datalen = hops_arg->arr_len; + if (hops_arg_constr.datalen > 0) + hops_arg_constr.data = MALLOC(hops_arg_constr.datalen * sizeof(LDKBlindedHop), "LDKCVec_BlindedHopZ Elements"); + else + hops_arg_constr.data = NULL; + int64_t* hops_arg_vals = hops_arg->elems; + for (size_t m = 0; m < hops_arg_constr.datalen; m++) { + int64_t hops_arg_conv_12 = hops_arg_vals[m]; + LDKBlindedHop hops_arg_conv_12_conv; + hops_arg_conv_12_conv.inner = untag_ptr(hops_arg_conv_12); + hops_arg_conv_12_conv.is_owned = ptr_is_owned(hops_arg_conv_12); + CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_arg_conv_12_conv); + hops_arg_conv_12_conv = BlindedHop_clone(&hops_arg_conv_12_conv); + hops_arg_constr.data[m] = hops_arg_conv_12_conv; + } + FREE(hops_arg); + LDKPublicKey blinding_point_arg_ref; + CHECK(blinding_point_arg->arr_len == 33); + memcpy(blinding_point_arg_ref.compressed_form, blinding_point_arg->elems, 33); FREE(blinding_point_arg); + LDKBlindedTail ret_var = BlindedTail_new(hops_arg_constr, blinding_point_arg_ref, excess_final_cltv_expiry_delta_arg, final_value_msat_arg); int64_t ret_ref = 0; 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_TaggedHash_clone_ptr(int64_t arg) { - LDKTaggedHash arg_conv; + +static inline uint64_t BlindedTail_clone_ptr(LDKBlindedTail *NONNULL_PTR arg) { + LDKBlindedTail ret_var = BlindedTail_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_BlindedTail_clone_ptr(int64_t arg) { + LDKBlindedTail arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = TaggedHash_clone_ptr(&arg_conv); + int64_t ret_conv = BlindedTail_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_TaggedHash_clone(int64_t orig) { - LDKTaggedHash orig_conv; +int64_t CS_LDK_BlindedTail_clone(int64_t orig) { + LDKBlindedTail orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKTaggedHash ret_var = TaggedHash_clone(&orig_conv); + LDKBlindedTail ret_var = BlindedTail_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; } -int8_tArray CS_LDK_TaggedHash_as_digest(int64_t this_arg) { - LDKTaggedHash this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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, *TaggedHash_as_digest(&this_arg_conv), 32); - return ret_arr; +int64_t CS_LDK_BlindedTail_hash(int64_t o) { + LDKBlindedTail o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = BlindedTail_hash(&o_conv); + return ret_conv; } -jstring CS_LDK_TaggedHash_tag(int64_t this_arg) { - LDKTaggedHash this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKStr ret_str = TaggedHash_tag(&this_arg_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); +jboolean CS_LDK_BlindedTail_eq(int64_t a, int64_t b) { + LDKBlindedTail a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKBlindedTail b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = BlindedTail_eq(&a_conv, &b_conv); return ret_conv; } -int8_tArray CS_LDK_TaggedHash_merkle_root(int64_t this_arg) { - LDKTaggedHash this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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, TaggedHash_merkle_root(&this_arg_conv).data, 32); +int8_tArray CS_LDK_BlindedTail_write(int64_t obj) { + LDKBlindedTail obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = BlindedTail_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); return ret_arr; } -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); +int64_t CS_LDK_BlindedTail_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_BlindedTailDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedTailDecodeErrorZ), "LDKCResult_BlindedTailDecodeErrorZ"); + *ret_conv = BlindedTail_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -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; +void CS_LDK_Path_free(int64_t this_obj) { + LDKPath this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Path_free(this_obj_conv); } -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_tArray CS_LDK_Path_get_hops(int64_t this_ptr) { + LDKPath this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_RouteHopZ ret_var = Path_get_hops(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t k = 0; k < ret_var.datalen; k++) { + LDKRouteHop 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; + } + + FREE(ret_var.data); + return ret_arr; } -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; +void CS_LDK_Path_set_hops(int64_t this_ptr, int64_tArray val) { + LDKPath this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_RouteHopZ val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = val->elems; + for (size_t k = 0; k < val_constr.datalen; k++) { + int64_t val_conv_10 = val_vals[k]; + LDKRouteHop val_conv_10_conv; + val_conv_10_conv.inner = untag_ptr(val_conv_10); + val_conv_10_conv.is_owned = ptr_is_owned(val_conv_10); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_10_conv); + val_conv_10_conv = RouteHop_clone(&val_conv_10_conv); + val_constr.data[k] = val_conv_10_conv; + } + FREE(val); + Path_set_hops(&this_ptr_conv, val_constr); } -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); +int64_t CS_LDK_Path_get_blinded_tail(int64_t this_ptr) { + LDKPath this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBlindedTail ret_var = Path_get_blinded_tail(&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; } -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_Path_set_blinded_tail(int64_t this_ptr, int64_t val) { + LDKPath this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBlindedTail val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = BlindedTail_clone(&val_conv); + Path_set_blinded_tail(&this_ptr_conv, val_conv); } -void CS_LDK_Bolt12ParseError_free(int64_t this_obj) { - LDKBolt12ParseError this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Bolt12ParseError_free(this_obj_conv); +int64_t CS_LDK_Path_new(int64_tArray hops_arg, int64_t blinded_tail_arg) { + LDKCVec_RouteHopZ hops_arg_constr; + hops_arg_constr.datalen = hops_arg->arr_len; + if (hops_arg_constr.datalen > 0) + hops_arg_constr.data = MALLOC(hops_arg_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); + else + hops_arg_constr.data = NULL; + int64_t* hops_arg_vals = hops_arg->elems; + for (size_t k = 0; k < hops_arg_constr.datalen; k++) { + int64_t hops_arg_conv_10 = hops_arg_vals[k]; + LDKRouteHop hops_arg_conv_10_conv; + hops_arg_conv_10_conv.inner = untag_ptr(hops_arg_conv_10); + hops_arg_conv_10_conv.is_owned = ptr_is_owned(hops_arg_conv_10); + CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_arg_conv_10_conv); + hops_arg_conv_10_conv = RouteHop_clone(&hops_arg_conv_10_conv); + hops_arg_constr.data[k] = hops_arg_conv_10_conv; + } + FREE(hops_arg); + LDKBlindedTail blinded_tail_arg_conv; + blinded_tail_arg_conv.inner = untag_ptr(blinded_tail_arg); + blinded_tail_arg_conv.is_owned = ptr_is_owned(blinded_tail_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_tail_arg_conv); + blinded_tail_arg_conv = BlindedTail_clone(&blinded_tail_arg_conv); + LDKPath ret_var = Path_new(hops_arg_constr, blinded_tail_arg_conv); + int64_t ret_ref = 0; + 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 Bolt12ParseError_clone_ptr(LDKBolt12ParseError *NONNULL_PTR arg) { - LDKBolt12ParseError ret_var = Bolt12ParseError_clone(arg); +static inline uint64_t Path_clone_ptr(LDKPath *NONNULL_PTR arg) { + LDKPath ret_var = Path_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_Bolt12ParseError_clone_ptr(int64_t arg) { - LDKBolt12ParseError arg_conv; +int64_t CS_LDK_Path_clone_ptr(int64_t arg) { + LDKPath arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Bolt12ParseError_clone_ptr(&arg_conv); + int64_t ret_conv = Path_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_Bolt12ParseError_clone(int64_t orig) { - LDKBolt12ParseError orig_conv; +int64_t CS_LDK_Path_clone(int64_t orig) { + LDKPath orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBolt12ParseError ret_var = Bolt12ParseError_clone(&orig_conv); + LDKPath ret_var = Path_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; } -int32_t CS_LDK_Bolt12SemanticError_clone(int64_t orig) { - LDKBolt12SemanticError* orig_conv = (LDKBolt12SemanticError*)untag_ptr(orig); - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_clone(orig_conv)); - return ret_conv; -} - -int32_t CS_LDK_Bolt12SemanticError_already_expired() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_already_expired()); - return ret_conv; -} - -int32_t CS_LDK_Bolt12SemanticError_unsupported_chain() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unsupported_chain()); +int64_t CS_LDK_Path_hash(int64_t o) { + LDKPath o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = Path_hash(&o_conv); return ret_conv; } -int32_t CS_LDK_Bolt12SemanticError_unexpected_chain() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unexpected_chain()); - return ret_conv; +jboolean CS_LDK_Path_eq(int64_t a, int64_t b) { + LDKPath a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKPath b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = Path_eq(&a_conv, &b_conv); + return ret_conv; } -int32_t CS_LDK_Bolt12SemanticError_missing_amount() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_amount()); +int64_t CS_LDK_Path_fee_msat(int64_t this_arg) { + LDKPath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int64_t ret_conv = Path_fee_msat(&this_arg_conv); return ret_conv; } -int32_t CS_LDK_Bolt12SemanticError_invalid_amount() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_invalid_amount()); +int64_t CS_LDK_Path_final_value_msat(int64_t this_arg) { + LDKPath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int64_t ret_conv = Path_final_value_msat(&this_arg_conv); return ret_conv; } -int32_t CS_LDK_Bolt12SemanticError_insufficient_amount() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_insufficient_amount()); - return ret_conv; +int64_t CS_LDK_Path_final_cltv_expiry_delta(int64_t this_arg) { + LDKPath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = Path_final_cltv_expiry_delta(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int32_t CS_LDK_Bolt12SemanticError_unexpected_amount() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unexpected_amount()); - return ret_conv; +void CS_LDK_Route_free(int64_t this_obj) { + LDKRoute this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Route_free(this_obj_conv); } -int32_t CS_LDK_Bolt12SemanticError_unsupported_currency() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unsupported_currency()); - return ret_conv; +int64_tArray CS_LDK_Route_get_paths(int64_t this_ptr) { + LDKRoute this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_PathZ ret_var = Route_get_paths(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t g = 0; g < ret_var.datalen; g++) { + LDKPath ret_conv_6_var = ret_var.data[g]; + int64_t ret_conv_6_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_6_var); + ret_conv_6_ref = tag_ptr(ret_conv_6_var.inner, ret_conv_6_var.is_owned); + ret_arr_ptr[g] = ret_conv_6_ref; + } + + FREE(ret_var.data); + return ret_arr; } -int32_t CS_LDK_Bolt12SemanticError_unknown_required_features() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unknown_required_features()); - return ret_conv; +void CS_LDK_Route_set_paths(int64_t this_ptr, int64_tArray val) { + LDKRoute this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_PathZ val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKPath), "LDKCVec_PathZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = val->elems; + for (size_t g = 0; g < val_constr.datalen; g++) { + int64_t val_conv_6 = val_vals[g]; + LDKPath val_conv_6_conv; + val_conv_6_conv.inner = untag_ptr(val_conv_6); + val_conv_6_conv.is_owned = ptr_is_owned(val_conv_6); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_6_conv); + val_conv_6_conv = Path_clone(&val_conv_6_conv); + val_constr.data[g] = val_conv_6_conv; + } + FREE(val); + Route_set_paths(&this_ptr_conv, val_constr); } -int32_t CS_LDK_Bolt12SemanticError_unexpected_features() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unexpected_features()); - return ret_conv; +int64_t CS_LDK_Route_get_route_params(int64_t this_ptr) { + LDKRoute this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKRouteParameters ret_var = Route_get_route_params(&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; } -int32_t CS_LDK_Bolt12SemanticError_missing_description() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_description()); - return ret_conv; +void CS_LDK_Route_set_route_params(int64_t this_ptr, int64_t val) { + LDKRoute this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKRouteParameters 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 = RouteParameters_clone(&val_conv); + Route_set_route_params(&this_ptr_conv, val_conv); } -int32_t CS_LDK_Bolt12SemanticError_missing_signing_pubkey() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_signing_pubkey()); - return ret_conv; +int64_t CS_LDK_Route_new(int64_tArray paths_arg, int64_t route_params_arg) { + LDKCVec_PathZ paths_arg_constr; + paths_arg_constr.datalen = paths_arg->arr_len; + if (paths_arg_constr.datalen > 0) + paths_arg_constr.data = MALLOC(paths_arg_constr.datalen * sizeof(LDKPath), "LDKCVec_PathZ Elements"); + else + paths_arg_constr.data = NULL; + int64_t* paths_arg_vals = paths_arg->elems; + for (size_t g = 0; g < paths_arg_constr.datalen; g++) { + int64_t paths_arg_conv_6 = paths_arg_vals[g]; + LDKPath paths_arg_conv_6_conv; + paths_arg_conv_6_conv.inner = untag_ptr(paths_arg_conv_6); + paths_arg_conv_6_conv.is_owned = ptr_is_owned(paths_arg_conv_6); + CHECK_INNER_FIELD_ACCESS_OR_NULL(paths_arg_conv_6_conv); + paths_arg_conv_6_conv = Path_clone(&paths_arg_conv_6_conv); + paths_arg_constr.data[g] = paths_arg_conv_6_conv; + } + FREE(paths_arg); + LDKRouteParameters route_params_arg_conv; + route_params_arg_conv.inner = untag_ptr(route_params_arg); + route_params_arg_conv.is_owned = ptr_is_owned(route_params_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_arg_conv); + route_params_arg_conv = RouteParameters_clone(&route_params_arg_conv); + LDKRoute ret_var = Route_new(paths_arg_constr, route_params_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; } -int32_t CS_LDK_Bolt12SemanticError_invalid_signing_pubkey() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_invalid_signing_pubkey()); +static inline uint64_t Route_clone_ptr(LDKRoute *NONNULL_PTR arg) { + LDKRoute ret_var = Route_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_Route_clone_ptr(int64_t arg) { + LDKRoute arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = Route_clone_ptr(&arg_conv); return ret_conv; } -int32_t CS_LDK_Bolt12SemanticError_unexpected_signing_pubkey() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unexpected_signing_pubkey()); - return ret_conv; +int64_t CS_LDK_Route_clone(int64_t orig) { + LDKRoute orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKRoute ret_var = Route_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; } -int32_t CS_LDK_Bolt12SemanticError_missing_quantity() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_quantity()); +int64_t CS_LDK_Route_hash(int64_t o) { + LDKRoute o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = Route_hash(&o_conv); return ret_conv; } -int32_t CS_LDK_Bolt12SemanticError_invalid_quantity() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_invalid_quantity()); +jboolean CS_LDK_Route_eq(int64_t a, int64_t b) { + LDKRoute a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKRoute b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = Route_eq(&a_conv, &b_conv); return ret_conv; } -int32_t CS_LDK_Bolt12SemanticError_unexpected_quantity() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unexpected_quantity()); +int64_t CS_LDK_Route_get_total_fees(int64_t this_arg) { + LDKRoute this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int64_t ret_conv = Route_get_total_fees(&this_arg_conv); return ret_conv; } -int32_t CS_LDK_Bolt12SemanticError_invalid_metadata() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_invalid_metadata()); +int64_t CS_LDK_Route_get_total_amount(int64_t this_arg) { + LDKRoute this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int64_t ret_conv = Route_get_total_amount(&this_arg_conv); return ret_conv; } -int32_t CS_LDK_Bolt12SemanticError_unexpected_metadata() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unexpected_metadata()); +jstring CS_LDK_Route_to_str(int64_t o) { + LDKRoute o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = Route_to_str(&o_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); return ret_conv; } -int32_t CS_LDK_Bolt12SemanticError_missing_payer_metadata() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_payer_metadata()); - return ret_conv; +int8_tArray CS_LDK_Route_write(int64_t obj) { + LDKRoute obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = Route_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -int32_t CS_LDK_Bolt12SemanticError_missing_payer_id() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_payer_id()); - return ret_conv; +int64_t CS_LDK_Route_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); + *ret_conv = Route_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -int32_t CS_LDK_Bolt12SemanticError_duplicate_payment_id() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_duplicate_payment_id()); - return ret_conv; +void CS_LDK_RouteParameters_free(int64_t this_obj) { + LDKRouteParameters this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + RouteParameters_free(this_obj_conv); } -int32_t CS_LDK_Bolt12SemanticError_missing_paths() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_paths()); - return ret_conv; +int64_t CS_LDK_RouteParameters_get_payment_params(int64_t this_ptr) { + LDKRouteParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPaymentParameters ret_var = RouteParameters_get_payment_params(&this_ptr_conv); + int64_t ret_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_Bolt12SemanticError_unexpected_paths() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unexpected_paths()); - return ret_conv; +void CS_LDK_RouteParameters_set_payment_params(int64_t this_ptr, int64_t val) { + LDKRouteParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPaymentParameters val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = PaymentParameters_clone(&val_conv); + RouteParameters_set_payment_params(&this_ptr_conv, val_conv); } -int32_t CS_LDK_Bolt12SemanticError_invalid_pay_info() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_invalid_pay_info()); +int64_t CS_LDK_RouteParameters_get_final_value_msat(int64_t this_ptr) { + LDKRouteParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = RouteParameters_get_final_value_msat(&this_ptr_conv); return ret_conv; } -int32_t CS_LDK_Bolt12SemanticError_missing_creation_time() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_creation_time()); - return ret_conv; +void CS_LDK_RouteParameters_set_final_value_msat(int64_t this_ptr, int64_t val) { + LDKRouteParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + RouteParameters_set_final_value_msat(&this_ptr_conv, val); } -int32_t CS_LDK_Bolt12SemanticError_missing_payment_hash() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_payment_hash()); - return ret_conv; +int64_t CS_LDK_RouteParameters_get_max_total_routing_fee_msat(int64_t this_ptr) { + LDKRouteParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = RouteParameters_get_max_total_routing_fee_msat(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int32_t CS_LDK_Bolt12SemanticError_missing_signature() { - int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_missing_signature()); - return ret_conv; +void CS_LDK_RouteParameters_set_max_total_routing_fee_msat(int64_t this_ptr, int64_t val) { + LDKRouteParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + 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)); + RouteParameters_set_max_total_routing_fee_msat(&this_ptr_conv, val_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); +int64_t CS_LDK_RouteParameters_new(int64_t payment_params_arg, int64_t final_value_msat_arg, int64_t max_total_routing_fee_msat_arg) { + LDKPaymentParameters payment_params_arg_conv; + payment_params_arg_conv.inner = untag_ptr(payment_params_arg); + payment_params_arg_conv.is_owned = ptr_is_owned(payment_params_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_params_arg_conv); + payment_params_arg_conv = PaymentParameters_clone(&payment_params_arg_conv); + void* max_total_routing_fee_msat_arg_ptr = untag_ptr(max_total_routing_fee_msat_arg); + CHECK_ACCESS(max_total_routing_fee_msat_arg_ptr); + LDKCOption_u64Z max_total_routing_fee_msat_arg_conv = *(LDKCOption_u64Z*)(max_total_routing_fee_msat_arg_ptr); + max_total_routing_fee_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(max_total_routing_fee_msat_arg)); + LDKRouteParameters ret_var = RouteParameters_new(payment_params_arg_conv, final_value_msat_arg, max_total_routing_fee_msat_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 RefundMaybeWithDerivedMetadataBuilder_clone_ptr(LDKRefundMaybeWithDerivedMetadataBuilder *NONNULL_PTR arg) { - LDKRefundMaybeWithDerivedMetadataBuilder ret_var = RefundMaybeWithDerivedMetadataBuilder_clone(arg); +static inline uint64_t RouteParameters_clone_ptr(LDKRouteParameters *NONNULL_PTR arg) { + LDKRouteParameters ret_var = RouteParameters_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; +int64_t CS_LDK_RouteParameters_clone_ptr(int64_t arg) { + LDKRouteParameters arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = RefundMaybeWithDerivedMetadataBuilder_clone_ptr(&arg_conv); + int64_t ret_conv = RouteParameters_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_RefundMaybeWithDerivedMetadataBuilder_clone(int64_t orig) { - LDKRefundMaybeWithDerivedMetadataBuilder orig_conv; +int64_t CS_LDK_RouteParameters_clone(int64_t orig) { + LDKRouteParameters orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKRefundMaybeWithDerivedMetadataBuilder ret_var = RefundMaybeWithDerivedMetadataBuilder_clone(&orig_conv); + LDKRouteParameters ret_var = RouteParameters_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_RouteParameters_hash(int64_t o) { + LDKRouteParameters o_conv; + 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 = RouteParameters_hash(&o_conv); + return ret_conv; } -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); +jboolean CS_LDK_RouteParameters_eq(int64_t a, int64_t b) { + LDKRouteParameters a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKRouteParameters b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = RouteParameters_eq(&a_conv, &b_conv); + return ret_conv; } -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); +int64_t CS_LDK_RouteParameters_from_payment_params_and_value(int64_t payment_params, int64_t final_value_msat) { + LDKPaymentParameters payment_params_conv; + payment_params_conv.inner = untag_ptr(payment_params); + payment_params_conv.is_owned = ptr_is_owned(payment_params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_params_conv); + payment_params_conv = PaymentParameters_clone(&payment_params_conv); + LDKRouteParameters ret_var = RouteParameters_from_payment_params_and_value(payment_params_conv, final_value_msat); + int64_t ret_ref = 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_RefundMaybeWithDerivedMetadataBuilder_absolute_expiry(int64_t this_arg, int64_t absolute_expiry) { - LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; +int64_t CS_LDK_RouteParameters_set_max_path_length(int64_t this_arg, int64_t recipient_onion, jboolean is_keysend, int32_t best_block_height) { + LDKRouteParameters this_arg_conv; this_arg_conv.inner = untag_ptr(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); + this_arg_conv.is_owned = false; + LDKRecipientOnionFields recipient_onion_conv; + recipient_onion_conv.inner = untag_ptr(recipient_onion); + recipient_onion_conv.is_owned = ptr_is_owned(recipient_onion); + CHECK_INNER_FIELD_ACCESS_OR_NULL(recipient_onion_conv); + recipient_onion_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = RouteParameters_set_max_path_length(&this_arg_conv, &recipient_onion_conv, is_keysend, best_block_height); + return tag_ptr(ret_conv, true); } -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); +int8_tArray CS_LDK_RouteParameters_write(int64_t obj) { + LDKRouteParameters obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = RouteParameters_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -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); +int64_t CS_LDK_RouteParameters_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); + *ret_conv = RouteParameters_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -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_PaymentParameters_free(int64_t this_obj) { + LDKPaymentParameters this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + PaymentParameters_free(this_obj_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); +int64_t CS_LDK_PaymentParameters_get_payee(int64_t this_ptr) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); + *ret_copy = PaymentParameters_get_payee(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -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); +void CS_LDK_PaymentParameters_set_payee(int64_t this_ptr, int64_t val) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKPayee val_conv = *(LDKPayee*)(val_ptr); + val_conv = Payee_clone((LDKPayee*)untag_ptr(val)); + PaymentParameters_set_payee(&this_ptr_conv, val_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); +int64_t CS_LDK_PaymentParameters_get_expiry_time(int64_t this_ptr) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = PaymentParameters_get_expiry_time(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_Refund_free(int64_t this_obj) { - LDKRefund this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Refund_free(this_obj_conv); +void CS_LDK_PaymentParameters_set_expiry_time(int64_t this_ptr, int64_t val) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + PaymentParameters_set_expiry_time(&this_ptr_conv, val_conv); } -static inline uint64_t Refund_clone_ptr(LDKRefund *NONNULL_PTR arg) { - LDKRefund ret_var = Refund_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_Refund_clone_ptr(int64_t arg) { - LDKRefund arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = Refund_clone_ptr(&arg_conv); +int32_t CS_LDK_PaymentParameters_get_max_total_cltv_expiry_delta(int64_t this_ptr) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = PaymentParameters_get_max_total_cltv_expiry_delta(&this_ptr_conv); return ret_conv; } -int64_t CS_LDK_Refund_clone(int64_t orig) { - LDKRefund orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKRefund ret_var = Refund_clone(&orig_conv); - int64_t ret_ref = 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_PaymentParameters_set_max_total_cltv_expiry_delta(int64_t this_ptr, int32_t val) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + PaymentParameters_set_max_total_cltv_expiry_delta(&this_ptr_conv, val); } -int64_t CS_LDK_Refund_description(int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = Refund_description(&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; +int8_t CS_LDK_PaymentParameters_get_max_path_count(int64_t this_ptr) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_t ret_conv = PaymentParameters_get_max_path_count(&this_ptr_conv); + return ret_conv; } -int64_t CS_LDK_Refund_absolute_expiry(int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = Refund_absolute_expiry(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_PaymentParameters_set_max_path_count(int64_t this_ptr, int8_t val) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + PaymentParameters_set_max_path_count(&this_ptr_conv, val); } -jboolean CS_LDK_Refund_is_expired(int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = Refund_is_expired(&this_arg_conv); +int8_t CS_LDK_PaymentParameters_get_max_path_length(int64_t this_ptr) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_t ret_conv = PaymentParameters_get_max_path_length(&this_ptr_conv); return ret_conv; } -jboolean CS_LDK_Refund_is_expired_no_std(int64_t this_arg, int64_t duration_since_epoch) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = Refund_is_expired_no_std(&this_arg_conv, duration_since_epoch); +void CS_LDK_PaymentParameters_set_max_path_length(int64_t this_ptr, int8_t val) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + PaymentParameters_set_max_path_length(&this_ptr_conv, val); +} + +int8_t CS_LDK_PaymentParameters_get_max_channel_saturation_power_of_half(int64_t this_ptr) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_t ret_conv = PaymentParameters_get_max_channel_saturation_power_of_half(&this_ptr_conv); return ret_conv; } -int64_t CS_LDK_Refund_issuer(int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = Refund_issuer(&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_PaymentParameters_set_max_channel_saturation_power_of_half(int64_t this_ptr, int8_t val) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + PaymentParameters_set_max_channel_saturation_power_of_half(&this_ptr_conv, val); } -int64_tArray CS_LDK_Refund_paths(int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_BlindedPathZ ret_var = Refund_paths(&this_arg_conv); +int64_tArray CS_LDK_PaymentParameters_get_previously_failed_channels(int64_t this_ptr) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u64Z ret_var = PaymentParameters_get_previously_failed_channels(&this_ptr_conv); int64_tArray ret_arr = NULL; ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t n = 0; n < ret_var.datalen; n++) { - LDKBlindedPath 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; + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; } FREE(ret_var.data); return ret_arr; } -int8_tArray CS_LDK_Refund_payer_metadata(int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKu8slice ret_var = Refund_payer_metadata(&this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - return ret_arr; +void CS_LDK_PaymentParameters_set_previously_failed_channels(int64_t this_ptr, int64_tArray val) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u64Z val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = val->elems; + for (size_t g = 0; g < val_constr.datalen; g++) { + int64_t val_conv_6 = val_vals[g]; + val_constr.data[g] = val_conv_6; + } + FREE(val); + PaymentParameters_set_previously_failed_channels(&this_ptr_conv, val_constr); } -int8_tArray CS_LDK_Refund_chain(int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, Refund_chain(&this_arg_conv).data, 32); +int64_tArray CS_LDK_PaymentParameters_get_previously_failed_blinded_path_idxs(int64_t this_ptr) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u64Z ret_var = PaymentParameters_get_previously_failed_blinded_path_idxs(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + + FREE(ret_var.data); return ret_arr; } -int64_t CS_LDK_Refund_amount_msats(int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = Refund_amount_msats(&this_arg_conv); - return ret_conv; +void CS_LDK_PaymentParameters_set_previously_failed_blinded_path_idxs(int64_t this_ptr, int64_tArray val) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u64Z val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = val->elems; + for (size_t g = 0; g < val_constr.datalen; g++) { + int64_t val_conv_6 = val_vals[g]; + val_constr.data[g] = val_conv_6; + } + FREE(val); + PaymentParameters_set_previously_failed_blinded_path_idxs(&this_ptr_conv, val_constr); } -int64_t CS_LDK_Refund_features(int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKInvoiceRequestFeatures ret_var = Refund_features(&this_arg_conv); +int64_t CS_LDK_PaymentParameters_new(int64_t payee_arg, int64_t expiry_time_arg, int32_t max_total_cltv_expiry_delta_arg, int8_t max_path_count_arg, int8_t max_path_length_arg, int8_t max_channel_saturation_power_of_half_arg, int64_tArray previously_failed_channels_arg, int64_tArray previously_failed_blinded_path_idxs_arg) { + void* payee_arg_ptr = untag_ptr(payee_arg); + CHECK_ACCESS(payee_arg_ptr); + LDKPayee payee_arg_conv = *(LDKPayee*)(payee_arg_ptr); + payee_arg_conv = Payee_clone((LDKPayee*)untag_ptr(payee_arg)); + void* expiry_time_arg_ptr = untag_ptr(expiry_time_arg); + CHECK_ACCESS(expiry_time_arg_ptr); + LDKCOption_u64Z expiry_time_arg_conv = *(LDKCOption_u64Z*)(expiry_time_arg_ptr); + expiry_time_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(expiry_time_arg)); + LDKCVec_u64Z previously_failed_channels_arg_constr; + previously_failed_channels_arg_constr.datalen = previously_failed_channels_arg->arr_len; + if (previously_failed_channels_arg_constr.datalen > 0) + previously_failed_channels_arg_constr.data = MALLOC(previously_failed_channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + else + previously_failed_channels_arg_constr.data = NULL; + int64_t* previously_failed_channels_arg_vals = previously_failed_channels_arg->elems; + for (size_t g = 0; g < previously_failed_channels_arg_constr.datalen; g++) { + int64_t previously_failed_channels_arg_conv_6 = previously_failed_channels_arg_vals[g]; + previously_failed_channels_arg_constr.data[g] = previously_failed_channels_arg_conv_6; + } + FREE(previously_failed_channels_arg); + LDKCVec_u64Z previously_failed_blinded_path_idxs_arg_constr; + previously_failed_blinded_path_idxs_arg_constr.datalen = previously_failed_blinded_path_idxs_arg->arr_len; + if (previously_failed_blinded_path_idxs_arg_constr.datalen > 0) + previously_failed_blinded_path_idxs_arg_constr.data = MALLOC(previously_failed_blinded_path_idxs_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + else + previously_failed_blinded_path_idxs_arg_constr.data = NULL; + int64_t* previously_failed_blinded_path_idxs_arg_vals = previously_failed_blinded_path_idxs_arg->elems; + for (size_t g = 0; g < previously_failed_blinded_path_idxs_arg_constr.datalen; g++) { + int64_t previously_failed_blinded_path_idxs_arg_conv_6 = previously_failed_blinded_path_idxs_arg_vals[g]; + previously_failed_blinded_path_idxs_arg_constr.data[g] = previously_failed_blinded_path_idxs_arg_conv_6; + } + FREE(previously_failed_blinded_path_idxs_arg); + LDKPaymentParameters ret_var = PaymentParameters_new(payee_arg_conv, expiry_time_arg_conv, max_total_cltv_expiry_delta_arg, max_path_count_arg, max_path_length_arg, max_channel_saturation_power_of_half_arg, previously_failed_channels_arg_constr, previously_failed_blinded_path_idxs_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); return ret_ref; } -int64_t CS_LDK_Refund_quantity(int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = Refund_quantity(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +static inline uint64_t PaymentParameters_clone_ptr(LDKPaymentParameters *NONNULL_PTR arg) { + LDKPaymentParameters ret_var = PaymentParameters_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; } - -int8_tArray CS_LDK_Refund_payer_id(int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, Refund_payer_id(&this_arg_conv).compressed_form, 33); - return ret_arr; +int64_t CS_LDK_PaymentParameters_clone_ptr(int64_t arg) { + LDKPaymentParameters arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = PaymentParameters_clone_ptr(&arg_conv); + return ret_conv; } -int64_t CS_LDK_Refund_payer_note(int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = Refund_payer_note(&this_arg_conv); +int64_t CS_LDK_PaymentParameters_clone(int64_t orig) { + LDKPaymentParameters orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKPaymentParameters ret_var = PaymentParameters_clone(&orig_conv); int64_t ret_ref = 0; 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_Refund_hash(int64_t o) { - LDKRefund o_conv; +int64_t CS_LDK_PaymentParameters_hash(int64_t o) { + LDKPaymentParameters o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv.is_owned = false; - int64_t ret_conv = Refund_hash(&o_conv); + int64_t ret_conv = PaymentParameters_hash(&o_conv); return ret_conv; } -int8_tArray CS_LDK_Refund_write(int64_t obj) { - LDKRefund obj_conv; +jboolean CS_LDK_PaymentParameters_eq(int64_t a, int64_t b) { + LDKPaymentParameters a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKPaymentParameters b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = PaymentParameters_eq(&a_conv, &b_conv); + return ret_conv; +} + +int8_tArray CS_LDK_PaymentParameters_write(int64_t obj) { + LDKPaymentParameters obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = Refund_write(&obj_conv); + LDKCVec_u8Z ret_var = PaymentParameters_write(&obj_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_Refund_from_str(jstring s) { - LDKStr s_conv = str_ref_to_owned_c(s); - LDKCResult_RefundBolt12ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundBolt12ParseErrorZ), "LDKCResult_RefundBolt12ParseErrorZ"); - *ret_conv = Refund_from_str(s_conv); +int64_t CS_LDK_PaymentParameters_read(int8_tArray ser, int32_t arg) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ"); + *ret_conv = PaymentParameters_read(ser_ref, arg); + FREE(ser); return tag_ptr(ret_conv, true); } -jstring CS_LDK_Refund_to_str(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; - LDKStr ret_str = Refund_to_str(&o_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; +int64_t CS_LDK_PaymentParameters_from_node_id(int8_tArray payee_pubkey, int32_t final_cltv_expiry_delta) { + LDKPublicKey payee_pubkey_ref; + CHECK(payee_pubkey->arr_len == 33); + memcpy(payee_pubkey_ref.compressed_form, payee_pubkey->elems, 33); FREE(payee_pubkey); + LDKPaymentParameters ret_var = PaymentParameters_from_node_id(payee_pubkey_ref, final_cltv_expiry_delta); + int64_t ret_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_UtxoLookupError_clone(int64_t orig) { - LDKUtxoLookupError* orig_conv = (LDKUtxoLookupError*)untag_ptr(orig); - int32_t ret_conv = LDKUtxoLookupError_to_cs(UtxoLookupError_clone(orig_conv)); - return ret_conv; +int64_t CS_LDK_PaymentParameters_for_keysend(int8_tArray payee_pubkey, int32_t final_cltv_expiry_delta, jboolean allow_mpp) { + LDKPublicKey payee_pubkey_ref; + CHECK(payee_pubkey->arr_len == 33); + memcpy(payee_pubkey_ref.compressed_form, payee_pubkey->elems, 33); FREE(payee_pubkey); + LDKPaymentParameters ret_var = PaymentParameters_for_keysend(payee_pubkey_ref, final_cltv_expiry_delta, allow_mpp); + int64_t ret_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_UtxoLookupError_unknown_chain() { - int32_t ret_conv = LDKUtxoLookupError_to_cs(UtxoLookupError_unknown_chain()); - return ret_conv; +int64_t CS_LDK_PaymentParameters_from_bolt12_invoice(int64_t invoice) { + LDKBolt12Invoice invoice_conv; + invoice_conv.inner = untag_ptr(invoice); + invoice_conv.is_owned = ptr_is_owned(invoice); + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); + invoice_conv.is_owned = false; + LDKPaymentParameters ret_var = PaymentParameters_from_bolt12_invoice(&invoice_conv); + int64_t ret_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_UtxoLookupError_unknown_tx() { - int32_t ret_conv = LDKUtxoLookupError_to_cs(UtxoLookupError_unknown_tx()); - return ret_conv; +int64_t CS_LDK_PaymentParameters_blinded(int64_tArray blinded_route_hints) { + LDKCVec_BlindedPaymentPathZ blinded_route_hints_constr; + blinded_route_hints_constr.datalen = blinded_route_hints->arr_len; + if (blinded_route_hints_constr.datalen > 0) + blinded_route_hints_constr.data = MALLOC(blinded_route_hints_constr.datalen * sizeof(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); + else + blinded_route_hints_constr.data = NULL; + int64_t* blinded_route_hints_vals = blinded_route_hints->elems; + for (size_t u = 0; u < blinded_route_hints_constr.datalen; u++) { + int64_t blinded_route_hints_conv_20 = blinded_route_hints_vals[u]; + LDKBlindedPaymentPath blinded_route_hints_conv_20_conv; + blinded_route_hints_conv_20_conv.inner = untag_ptr(blinded_route_hints_conv_20); + blinded_route_hints_conv_20_conv.is_owned = ptr_is_owned(blinded_route_hints_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_route_hints_conv_20_conv); + blinded_route_hints_conv_20_conv = BlindedPaymentPath_clone(&blinded_route_hints_conv_20_conv); + blinded_route_hints_constr.data[u] = blinded_route_hints_conv_20_conv; + } + FREE(blinded_route_hints); + LDKPaymentParameters ret_var = PaymentParameters_blinded(blinded_route_hints_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); + return ret_ref; } -void CS_LDK_UtxoResult_free(int64_t this_ptr) { +void CS_LDK_Payee_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); - LDKUtxoResult this_ptr_conv = *(LDKUtxoResult*)(this_ptr_ptr); + LDKPayee this_ptr_conv = *(LDKPayee*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - UtxoResult_free(this_ptr_conv); + Payee_free(this_ptr_conv); } -static inline uint64_t UtxoResult_clone_ptr(LDKUtxoResult *NONNULL_PTR arg) { - LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult"); - *ret_copy = UtxoResult_clone(arg); +static inline uint64_t Payee_clone_ptr(LDKPayee *NONNULL_PTR arg) { + LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); + *ret_copy = Payee_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_UtxoResult_clone_ptr(int64_t arg) { - LDKUtxoResult* arg_conv = (LDKUtxoResult*)untag_ptr(arg); - int64_t ret_conv = UtxoResult_clone_ptr(arg_conv); - return ret_conv; +int64_t CS_LDK_Payee_clone_ptr(int64_t arg) { + LDKPayee* arg_conv = (LDKPayee*)untag_ptr(arg); + int64_t ret_conv = Payee_clone_ptr(arg_conv); + return ret_conv; } -int64_t CS_LDK_UtxoResult_clone(int64_t orig) { - LDKUtxoResult* orig_conv = (LDKUtxoResult*)untag_ptr(orig); - LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult"); - *ret_copy = UtxoResult_clone(orig_conv); +int64_t CS_LDK_Payee_clone(int64_t orig) { + LDKPayee* orig_conv = (LDKPayee*)untag_ptr(orig); + LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); + *ret_copy = Payee_clone(orig_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_UtxoResult_sync(int64_t a) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKCResult_TxOutUtxoLookupErrorZ a_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(a_ptr); - a_conv = CResult_TxOutUtxoLookupErrorZ_clone((LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(a)); - LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult"); - *ret_copy = UtxoResult_sync(a_conv); +int64_t CS_LDK_Payee_blinded(int64_tArray route_hints, int64_t features) { + LDKCVec_BlindedPaymentPathZ route_hints_constr; + route_hints_constr.datalen = route_hints->arr_len; + if (route_hints_constr.datalen > 0) + route_hints_constr.data = MALLOC(route_hints_constr.datalen * sizeof(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); + else + route_hints_constr.data = NULL; + int64_t* route_hints_vals = route_hints->elems; + for (size_t u = 0; u < route_hints_constr.datalen; u++) { + int64_t route_hints_conv_20 = route_hints_vals[u]; + LDKBlindedPaymentPath route_hints_conv_20_conv; + route_hints_conv_20_conv.inner = untag_ptr(route_hints_conv_20); + route_hints_conv_20_conv.is_owned = ptr_is_owned(route_hints_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_hints_conv_20_conv); + route_hints_conv_20_conv = BlindedPaymentPath_clone(&route_hints_conv_20_conv); + route_hints_constr.data[u] = route_hints_conv_20_conv; + } + FREE(route_hints); + LDKBolt12InvoiceFeatures features_conv; + features_conv.inner = untag_ptr(features); + features_conv.is_owned = ptr_is_owned(features); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); + features_conv = Bolt12InvoiceFeatures_clone(&features_conv); + LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); + *ret_copy = Payee_blinded(route_hints_constr, features_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_UtxoResult_async(int64_t a) { - LDKUtxoFuture a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = UtxoFuture_clone(&a_conv); - LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult"); - *ret_copy = UtxoResult_async(a_conv); +int64_t CS_LDK_Payee_clear(int8_tArray node_id, int64_tArray route_hints, int64_t features, int32_t final_cltv_expiry_delta) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKCVec_RouteHintZ route_hints_constr; + route_hints_constr.datalen = route_hints->arr_len; + if (route_hints_constr.datalen > 0) + route_hints_constr.data = MALLOC(route_hints_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements"); + else + route_hints_constr.data = NULL; + int64_t* route_hints_vals = route_hints->elems; + for (size_t l = 0; l < route_hints_constr.datalen; l++) { + int64_t route_hints_conv_11 = route_hints_vals[l]; + LDKRouteHint route_hints_conv_11_conv; + route_hints_conv_11_conv.inner = untag_ptr(route_hints_conv_11); + route_hints_conv_11_conv.is_owned = ptr_is_owned(route_hints_conv_11); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_hints_conv_11_conv); + route_hints_conv_11_conv = RouteHint_clone(&route_hints_conv_11_conv); + route_hints_constr.data[l] = route_hints_conv_11_conv; + } + FREE(route_hints); + LDKBolt11InvoiceFeatures features_conv; + features_conv.inner = untag_ptr(features); + features_conv.is_owned = ptr_is_owned(features); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); + features_conv = Bolt11InvoiceFeatures_clone(&features_conv); + LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); + *ret_copy = Payee_clear(node_id_ref, route_hints_constr, features_conv, final_cltv_expiry_delta); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void CS_LDK_UtxoLookup_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); - LDKUtxoLookup this_ptr_conv = *(LDKUtxoLookup*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - UtxoLookup_free(this_ptr_conv); +int64_t CS_LDK_Payee_hash(int64_t o) { + LDKPayee* o_conv = (LDKPayee*)untag_ptr(o); + int64_t ret_conv = Payee_hash(o_conv); + return ret_conv; } -void CS_LDK_UtxoFuture_free(int64_t this_obj) { - LDKUtxoFuture this_obj_conv; +jboolean CS_LDK_Payee_eq(int64_t a, int64_t b) { + LDKPayee* a_conv = (LDKPayee*)untag_ptr(a); + LDKPayee* b_conv = (LDKPayee*)untag_ptr(b); + jboolean ret_conv = Payee_eq(a_conv, b_conv); + return ret_conv; +} + +int8_tArray CS_LDK_RouteHint_write(int64_t obj) { + LDKRouteHint obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = RouteHint_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_RouteHint_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); + *ret_conv = RouteHint_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray CS_LDK_RouteHintHop_write(int64_t obj) { + LDKRouteHintHop obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = RouteHintHop_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_RouteHintHop_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); + *ret_conv = RouteHintHop_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_FirstHopCandidate_free(int64_t this_obj) { + LDKFirstHopCandidate this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - UtxoFuture_free(this_obj_conv); + FirstHopCandidate_free(this_obj_conv); } -static inline uint64_t UtxoFuture_clone_ptr(LDKUtxoFuture *NONNULL_PTR arg) { - LDKUtxoFuture ret_var = UtxoFuture_clone(arg); +static inline uint64_t FirstHopCandidate_clone_ptr(LDKFirstHopCandidate *NONNULL_PTR arg) { + LDKFirstHopCandidate ret_var = FirstHopCandidate_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_UtxoFuture_clone_ptr(int64_t arg) { - LDKUtxoFuture arg_conv; +int64_t CS_LDK_FirstHopCandidate_clone_ptr(int64_t arg) { + LDKFirstHopCandidate arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = UtxoFuture_clone_ptr(&arg_conv); + int64_t ret_conv = FirstHopCandidate_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_UtxoFuture_clone(int64_t orig) { - LDKUtxoFuture orig_conv; +int64_t CS_LDK_FirstHopCandidate_clone(int64_t orig) { + LDKFirstHopCandidate orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKUtxoFuture ret_var = UtxoFuture_clone(&orig_conv); + LDKFirstHopCandidate ret_var = FirstHopCandidate_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_UtxoFuture_new() { - LDKUtxoFuture ret_var = UtxoFuture_new(); +void CS_LDK_PublicHopCandidate_free(int64_t this_obj) { + LDKPublicHopCandidate this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + PublicHopCandidate_free(this_obj_conv); +} + +int64_t CS_LDK_PublicHopCandidate_get_short_channel_id(int64_t this_ptr) { + LDKPublicHopCandidate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = PublicHopCandidate_get_short_channel_id(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_PublicHopCandidate_set_short_channel_id(int64_t this_ptr, int64_t val) { + LDKPublicHopCandidate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + PublicHopCandidate_set_short_channel_id(&this_ptr_conv, val); +} + +static inline uint64_t PublicHopCandidate_clone_ptr(LDKPublicHopCandidate *NONNULL_PTR arg) { + LDKPublicHopCandidate ret_var = PublicHopCandidate_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; } - -void CS_LDK_UtxoFuture_resolve_without_forwarding(int64_t this_arg, int64_t graph, int64_t result) { - LDKUtxoFuture this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNetworkGraph graph_conv; - graph_conv.inner = untag_ptr(graph); - graph_conv.is_owned = ptr_is_owned(graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(graph_conv); - graph_conv.is_owned = false; - void* result_ptr = untag_ptr(result); - CHECK_ACCESS(result_ptr); - LDKCResult_TxOutUtxoLookupErrorZ result_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(result_ptr); - UtxoFuture_resolve_without_forwarding(&this_arg_conv, &graph_conv, result_conv); +int64_t CS_LDK_PublicHopCandidate_clone_ptr(int64_t arg) { + LDKPublicHopCandidate 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 = PublicHopCandidate_clone_ptr(&arg_conv); + return ret_conv; } -void CS_LDK_UtxoFuture_resolve(int64_t this_arg, int64_t graph, int64_t gossip, int64_t result) { - LDKUtxoFuture this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNetworkGraph graph_conv; - graph_conv.inner = untag_ptr(graph); - graph_conv.is_owned = ptr_is_owned(graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(graph_conv); - graph_conv.is_owned = false; - LDKP2PGossipSync gossip_conv; - gossip_conv.inner = untag_ptr(gossip); - gossip_conv.is_owned = ptr_is_owned(gossip); - CHECK_INNER_FIELD_ACCESS_OR_NULL(gossip_conv); - gossip_conv.is_owned = false; - void* result_ptr = untag_ptr(result); - CHECK_ACCESS(result_ptr); - LDKCResult_TxOutUtxoLookupErrorZ result_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(result_ptr); - UtxoFuture_resolve(&this_arg_conv, &graph_conv, &gossip_conv, result_conv); +int64_t CS_LDK_PublicHopCandidate_clone(int64_t orig) { + LDKPublicHopCandidate 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; + LDKPublicHopCandidate ret_var = PublicHopCandidate_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_NodeId_free(int64_t this_obj) { - LDKNodeId this_obj_conv; +void CS_LDK_PrivateHopCandidate_free(int64_t this_obj) { + LDKPrivateHopCandidate this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - NodeId_free(this_obj_conv); + PrivateHopCandidate_free(this_obj_conv); } -static inline uint64_t NodeId_clone_ptr(LDKNodeId *NONNULL_PTR arg) { - LDKNodeId ret_var = NodeId_clone(arg); +static inline uint64_t PrivateHopCandidate_clone_ptr(LDKPrivateHopCandidate *NONNULL_PTR arg) { + LDKPrivateHopCandidate ret_var = PrivateHopCandidate_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_NodeId_clone_ptr(int64_t arg) { - LDKNodeId arg_conv; +int64_t CS_LDK_PrivateHopCandidate_clone_ptr(int64_t arg) { + LDKPrivateHopCandidate arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = NodeId_clone_ptr(&arg_conv); + int64_t ret_conv = PrivateHopCandidate_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_NodeId_clone(int64_t orig) { - LDKNodeId orig_conv; +int64_t CS_LDK_PrivateHopCandidate_clone(int64_t orig) { + LDKPrivateHopCandidate orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKNodeId ret_var = NodeId_clone(&orig_conv); + LDKPrivateHopCandidate ret_var = PrivateHopCandidate_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_NodeId_from_pubkey(int8_tArray pubkey) { - LDKPublicKey pubkey_ref; - CHECK(pubkey->arr_len == 33); - memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); FREE(pubkey); - LDKNodeId ret_var = NodeId_from_pubkey(pubkey_ref); +void CS_LDK_BlindedPathCandidate_free(int64_t this_obj) { + LDKBlindedPathCandidate this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + BlindedPathCandidate_free(this_obj_conv); +} + +static inline uint64_t BlindedPathCandidate_clone_ptr(LDKBlindedPathCandidate *NONNULL_PTR arg) { + LDKBlindedPathCandidate ret_var = BlindedPathCandidate_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_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); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKu8slice ret_var = NodeId_as_slice(&this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - return ret_arr; -} - -int8_tArray CS_LDK_NodeId_as_array(int64_t this_arg) { - LDKNodeId this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, *NodeId_as_array(&this_arg_conv), 33); - return ret_arr; -} - -int64_t CS_LDK_NodeId_as_pubkey(int64_t this_arg) { - LDKNodeId this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_PublicKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecp256k1ErrorZ), "LDKCResult_PublicKeySecp256k1ErrorZ"); - *ret_conv = NodeId_as_pubkey(&this_arg_conv); - return tag_ptr(ret_conv, true); -} - -jstring CS_LDK_NodeId_to_str(int64_t o) { - LDKNodeId o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = NodeId_to_str(&o_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; -} - -int64_t CS_LDK_NodeId_hash(int64_t o) { - LDKNodeId o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = NodeId_hash(&o_conv); +int64_t CS_LDK_BlindedPathCandidate_clone_ptr(int64_t arg) { + LDKBlindedPathCandidate 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 = BlindedPathCandidate_clone_ptr(&arg_conv); return ret_conv; } -int8_tArray CS_LDK_NodeId_write(int64_t obj) { - LDKNodeId obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = NodeId_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -int64_t CS_LDK_NodeId_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); - *ret_conv = NodeId_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_BlindedPathCandidate_clone(int64_t orig) { + LDKBlindedPathCandidate 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; + LDKBlindedPathCandidate ret_var = BlindedPathCandidate_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_NetworkGraph_free(int64_t this_obj) { - LDKNetworkGraph this_obj_conv; +void CS_LDK_OneHopBlindedPathCandidate_free(int64_t this_obj) { + LDKOneHopBlindedPathCandidate this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - NetworkGraph_free(this_obj_conv); + OneHopBlindedPathCandidate_free(this_obj_conv); } -void CS_LDK_ReadOnlyNetworkGraph_free(int64_t this_obj) { - LDKReadOnlyNetworkGraph this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ReadOnlyNetworkGraph_free(this_obj_conv); +static inline uint64_t OneHopBlindedPathCandidate_clone_ptr(LDKOneHopBlindedPathCandidate *NONNULL_PTR arg) { + LDKOneHopBlindedPathCandidate ret_var = OneHopBlindedPathCandidate_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_OneHopBlindedPathCandidate_clone_ptr(int64_t arg) { + LDKOneHopBlindedPathCandidate 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 = OneHopBlindedPathCandidate_clone_ptr(&arg_conv); + return ret_conv; } -void CS_LDK_NetworkUpdate_free(int64_t this_ptr) { +int64_t CS_LDK_OneHopBlindedPathCandidate_clone(int64_t orig) { + LDKOneHopBlindedPathCandidate 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; + LDKOneHopBlindedPathCandidate ret_var = OneHopBlindedPathCandidate_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_CandidateRouteHop_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); - LDKNetworkUpdate this_ptr_conv = *(LDKNetworkUpdate*)(this_ptr_ptr); + LDKCandidateRouteHop this_ptr_conv = *(LDKCandidateRouteHop*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - NetworkUpdate_free(this_ptr_conv); + CandidateRouteHop_free(this_ptr_conv); } -static inline uint64_t NetworkUpdate_clone_ptr(LDKNetworkUpdate *NONNULL_PTR arg) { - LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); - *ret_copy = NetworkUpdate_clone(arg); +static inline uint64_t CandidateRouteHop_clone_ptr(LDKCandidateRouteHop *NONNULL_PTR arg) { + LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); + *ret_copy = CandidateRouteHop_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_NetworkUpdate_clone_ptr(int64_t arg) { - LDKNetworkUpdate* arg_conv = (LDKNetworkUpdate*)untag_ptr(arg); - int64_t ret_conv = NetworkUpdate_clone_ptr(arg_conv); +int64_t CS_LDK_CandidateRouteHop_clone_ptr(int64_t arg) { + LDKCandidateRouteHop* arg_conv = (LDKCandidateRouteHop*)untag_ptr(arg); + int64_t ret_conv = CandidateRouteHop_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_NetworkUpdate_clone(int64_t orig) { - LDKNetworkUpdate* orig_conv = (LDKNetworkUpdate*)untag_ptr(orig); - LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); - *ret_copy = NetworkUpdate_clone(orig_conv); +int64_t CS_LDK_CandidateRouteHop_clone(int64_t orig) { + LDKCandidateRouteHop* orig_conv = (LDKCandidateRouteHop*)untag_ptr(orig); + LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); + *ret_copy = CandidateRouteHop_clone(orig_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_NetworkUpdate_channel_update_message(int64_t msg) { - LDKChannelUpdate msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ChannelUpdate_clone(&msg_conv); - LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); - *ret_copy = NetworkUpdate_channel_update_message(msg_conv); +int64_t CS_LDK_CandidateRouteHop_first_hop(int64_t a) { + LDKFirstHopCandidate a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = FirstHopCandidate_clone(&a_conv); + LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); + *ret_copy = CandidateRouteHop_first_hop(a_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_NetworkUpdate_channel_failure(int64_t short_channel_id, jboolean is_permanent) { - LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); - *ret_copy = NetworkUpdate_channel_failure(short_channel_id, is_permanent); +int64_t CS_LDK_CandidateRouteHop_public_hop(int64_t a) { + LDKPublicHopCandidate a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = PublicHopCandidate_clone(&a_conv); + LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); + *ret_copy = CandidateRouteHop_public_hop(a_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_NetworkUpdate_node_failure(int8_tArray node_id, jboolean is_permanent) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); - *ret_copy = NetworkUpdate_node_failure(node_id_ref, is_permanent); +int64_t CS_LDK_CandidateRouteHop_private_hop(int64_t a) { + LDKPrivateHopCandidate a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = PrivateHopCandidate_clone(&a_conv); + LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); + *ret_copy = CandidateRouteHop_private_hop(a_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -jboolean CS_LDK_NetworkUpdate_eq(int64_t a, int64_t b) { - LDKNetworkUpdate* a_conv = (LDKNetworkUpdate*)untag_ptr(a); - LDKNetworkUpdate* b_conv = (LDKNetworkUpdate*)untag_ptr(b); - jboolean ret_conv = NetworkUpdate_eq(a_conv, b_conv); - return ret_conv; -} - -int8_tArray CS_LDK_NetworkUpdate_write(int64_t obj) { - LDKNetworkUpdate* obj_conv = (LDKNetworkUpdate*)untag_ptr(obj); - LDKCVec_u8Z ret_var = NetworkUpdate_write(obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +int64_t CS_LDK_CandidateRouteHop_blinded(int64_t a) { + LDKBlindedPathCandidate a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = BlindedPathCandidate_clone(&a_conv); + LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); + *ret_copy = CandidateRouteHop_blinded(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_NetworkUpdate_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); - *ret_conv = NetworkUpdate_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_CandidateRouteHop_one_hop_blinded(int64_t a) { + LDKOneHopBlindedPathCandidate a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = OneHopBlindedPathCandidate_clone(&a_conv); + LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); + *ret_copy = CandidateRouteHop_one_hop_blinded(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_P2PGossipSync_free(int64_t this_obj) { - LDKP2PGossipSync this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - P2PGossipSync_free(this_obj_conv); +int64_t CS_LDK_CandidateRouteHop_globally_unique_short_channel_id(int64_t this_arg) { + LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = CandidateRouteHop_globally_unique_short_channel_id(this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_P2PGossipSync_new(int64_t network_graph, int64_t utxo_lookup, int64_t logger) { +int32_t CS_LDK_CandidateRouteHop_cltv_expiry_delta(int64_t this_arg) { + LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); + int32_t ret_conv = CandidateRouteHop_cltv_expiry_delta(this_arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CandidateRouteHop_htlc_minimum_msat(int64_t this_arg) { + LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); + int64_t ret_conv = CandidateRouteHop_htlc_minimum_msat(this_arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CandidateRouteHop_fees(int64_t this_arg) { + LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); + LDKRoutingFees ret_var = CandidateRouteHop_fees(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_CandidateRouteHop_source(int64_t this_arg) { + LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); + LDKNodeId ret_var = CandidateRouteHop_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_CandidateRouteHop_target(int64_t this_arg) { + LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); + LDKNodeId ret_var = CandidateRouteHop_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; +} + +int64_t CS_LDK_find_route(int8_tArray our_node_pubkey, int64_t route_params, int64_t network_graph, int64_tArray first_hops, int64_t logger, int64_t scorer, int64_t score_params, int8_tArray random_seed_bytes) { + LDKPublicKey our_node_pubkey_ref; + CHECK(our_node_pubkey->arr_len == 33); + memcpy(our_node_pubkey_ref.compressed_form, our_node_pubkey->elems, 33); FREE(our_node_pubkey); + LDKRouteParameters route_params_conv; + route_params_conv.inner = untag_ptr(route_params); + route_params_conv.is_owned = ptr_is_owned(route_params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); + route_params_conv.is_owned = false; LDKNetworkGraph network_graph_conv; network_graph_conv.inner = untag_ptr(network_graph); network_graph_conv.is_owned = ptr_is_owned(network_graph); CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); network_graph_conv.is_owned = false; - void* utxo_lookup_ptr = untag_ptr(utxo_lookup); - CHECK_ACCESS(utxo_lookup_ptr); - LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr); - // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ - if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) { - // Manually implement clone for Java trait instances - if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some); + LDKCVec_ChannelDetailsZ first_hops_constr; + LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL; + if (first_hops != NULL) { + first_hops_constr.datalen = first_hops->arr_len; + if (first_hops_constr.datalen > 0) + first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); + else + first_hops_constr.data = NULL; + int64_t* first_hops_vals = first_hops->elems; + for (size_t q = 0; q < first_hops_constr.datalen; q++) { + int64_t first_hops_conv_16 = first_hops_vals[q]; + LDKChannelDetails first_hops_conv_16_conv; + first_hops_conv_16_conv.inner = untag_ptr(first_hops_conv_16); + first_hops_conv_16_conv.is_owned = ptr_is_owned(first_hops_conv_16); + CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv); + first_hops_conv_16_conv.is_owned = false; + first_hops_constr.data[q] = first_hops_conv_16_conv; } + FREE(first_hops); + first_hops_ptr = &first_hops_constr; } void* logger_ptr = untag_ptr(logger); CHECK_ACCESS(logger_ptr); @@ -69808,1206 +73564,1378 @@ int64_t CS_LDK_P2PGossipSync_new(int64_t network_graph, int64_t utxo_lookup, in // If this_arg is a JCalls struct, then we need to increment the refcnt in it. LDKLogger_JCalls_cloned(&logger_conv); } - LDKP2PGossipSync ret_var = P2PGossipSync_new(&network_graph_conv, utxo_lookup_conv, logger_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + void* scorer_ptr = untag_ptr(scorer); + if (ptr_is_owned(scorer)) { CHECK_ACCESS(scorer_ptr); } + LDKScoreLookUp* scorer_conv = (LDKScoreLookUp*)scorer_ptr; + LDKProbabilisticScoringFeeParameters score_params_conv; + score_params_conv.inner = untag_ptr(score_params); + score_params_conv.is_owned = ptr_is_owned(score_params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(score_params_conv); + score_params_conv.is_owned = false; + uint8_t random_seed_bytes_arr[32]; + CHECK(random_seed_bytes->arr_len == 32); + memcpy(random_seed_bytes_arr, random_seed_bytes->elems, 32); FREE(random_seed_bytes); + uint8_t (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr; + LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); + *ret_conv = find_route(our_node_pubkey_ref, &route_params_conv, &network_graph_conv, first_hops_ptr, logger_conv, scorer_conv, &score_params_conv, random_seed_bytes_ref); + if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); } + return tag_ptr(ret_conv, true); } -void CS_LDK_P2PGossipSync_add_utxo_lookup(int64_t this_arg, int64_t utxo_lookup) { - LDKP2PGossipSync this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - void* utxo_lookup_ptr = untag_ptr(utxo_lookup); - CHECK_ACCESS(utxo_lookup_ptr); - LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr); - // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ - if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) { - // Manually implement clone for Java trait instances - if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some); - } +int64_t CS_LDK_build_route_from_hops(int8_tArray our_node_pubkey, ptrArray hops, int64_t route_params, int64_t network_graph, int64_t logger, int8_tArray random_seed_bytes) { + LDKPublicKey our_node_pubkey_ref; + CHECK(our_node_pubkey->arr_len == 33); + memcpy(our_node_pubkey_ref.compressed_form, our_node_pubkey->elems, 33); FREE(our_node_pubkey); + LDKCVec_PublicKeyZ hops_constr; + hops_constr.datalen = hops->arr_len; + if (hops_constr.datalen > 0) + hops_constr.data = MALLOC(hops_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); + else + hops_constr.data = NULL; + int8_tArray* hops_vals = (void*) hops->elems; + for (size_t i = 0; i < hops_constr.datalen; i++) { + int8_tArray hops_conv_8 = hops_vals[i]; + LDKPublicKey hops_conv_8_ref; + CHECK(hops_conv_8->arr_len == 33); + memcpy(hops_conv_8_ref.compressed_form, hops_conv_8->elems, 33); FREE(hops_conv_8); + hops_constr.data[i] = hops_conv_8_ref; } - P2PGossipSync_add_utxo_lookup(&this_arg_conv, utxo_lookup_conv); + FREE(hops); + LDKRouteParameters route_params_conv; + route_params_conv.inner = untag_ptr(route_params); + route_params_conv.is_owned = ptr_is_owned(route_params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); + route_params_conv.is_owned = false; + LDKNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + uint8_t random_seed_bytes_arr[32]; + CHECK(random_seed_bytes->arr_len == 32); + memcpy(random_seed_bytes_arr, random_seed_bytes->elems, 32); FREE(random_seed_bytes); + uint8_t (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr; + LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); + *ret_conv = build_route_from_hops(our_node_pubkey_ref, hops_constr, &route_params_conv, &network_graph_conv, logger_conv, random_seed_bytes_ref); + return tag_ptr(ret_conv, true); } -void CS_LDK_NetworkGraph_handle_network_update(int64_t this_arg, int64_t network_update) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNetworkUpdate* network_update_conv = (LDKNetworkUpdate*)untag_ptr(network_update); - NetworkGraph_handle_network_update(&this_arg_conv, network_update_conv); +void CS_LDK_ScoreLookUp_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); + LDKScoreLookUp this_ptr_conv = *(LDKScoreLookUp*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + ScoreLookUp_free(this_ptr_conv); } -int8_tArray CS_LDK_NetworkGraph_get_chain_hash(int64_t this_arg) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, NetworkGraph_get_chain_hash(&this_arg_conv).data, 32); - return ret_arr; +void CS_LDK_ScoreUpdate_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); + LDKScoreUpdate this_ptr_conv = *(LDKScoreUpdate*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + ScoreUpdate_free(this_ptr_conv); } -int64_t CS_LDK_verify_node_announcement(int64_t msg) { - LDKNodeAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = verify_node_announcement(&msg_conv); - return tag_ptr(ret_conv, true); +void CS_LDK_Score_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); + LDKScore this_ptr_conv = *(LDKScore*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Score_free(this_ptr_conv); } -int64_t CS_LDK_verify_channel_announcement(int64_t msg) { - LDKChannelAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = verify_channel_announcement(&msg_conv); - return tag_ptr(ret_conv, true); +void CS_LDK_LockableScore_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); + LDKLockableScore this_ptr_conv = *(LDKLockableScore*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + LockableScore_free(this_ptr_conv); } -int64_t CS_LDK_P2PGossipSync_as_RoutingMessageHandler(int64_t this_arg) { - LDKP2PGossipSync this_arg_conv; +void CS_LDK_WriteableScore_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); + LDKWriteableScore this_ptr_conv = *(LDKWriteableScore*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + WriteableScore_free(this_ptr_conv); +} + +void CS_LDK_MultiThreadedLockableScore_free(int64_t this_obj) { + LDKMultiThreadedLockableScore this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + MultiThreadedLockableScore_free(this_obj_conv); +} + +int64_t CS_LDK_MultiThreadedLockableScore_as_LockableScore(int64_t this_arg) { + LDKMultiThreadedLockableScore this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler"); - *ret_ret = P2PGossipSync_as_RoutingMessageHandler(&this_arg_conv); + LDKLockableScore* ret_ret = MALLOC(sizeof(LDKLockableScore), "LDKLockableScore"); + *ret_ret = MultiThreadedLockableScore_as_LockableScore(&this_arg_conv); return tag_ptr(ret_ret, true); } -int64_t CS_LDK_P2PGossipSync_as_MessageSendEventsProvider(int64_t this_arg) { - LDKP2PGossipSync this_arg_conv; +int8_tArray CS_LDK_MultiThreadedLockableScore_write(int64_t obj) { + LDKMultiThreadedLockableScore obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = MultiThreadedLockableScore_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_MultiThreadedLockableScore_as_WriteableScore(int64_t this_arg) { + LDKMultiThreadedLockableScore this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); - *ret_ret = P2PGossipSync_as_MessageSendEventsProvider(&this_arg_conv); + LDKWriteableScore* ret_ret = MALLOC(sizeof(LDKWriteableScore), "LDKWriteableScore"); + *ret_ret = MultiThreadedLockableScore_as_WriteableScore(&this_arg_conv); return tag_ptr(ret_ret, true); } -void CS_LDK_ChannelUpdateInfo_free(int64_t this_obj) { - LDKChannelUpdateInfo this_obj_conv; +int64_t CS_LDK_MultiThreadedLockableScore_new(int64_t score) { + void* score_ptr = untag_ptr(score); + CHECK_ACCESS(score_ptr); + LDKScore score_conv = *(LDKScore*)(score_ptr); + if (score_conv.free == LDKScore_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKScore_JCalls_cloned(&score_conv); + } + LDKMultiThreadedLockableScore ret_var = MultiThreadedLockableScore_new(score_conv); + int64_t ret_ref = 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_MultiThreadedScoreLockRead_free(int64_t this_obj) { + LDKMultiThreadedScoreLockRead this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelUpdateInfo_free(this_obj_conv); -} - -int32_t CS_LDK_ChannelUpdateInfo_get_last_update(int64_t this_ptr) { - LDKChannelUpdateInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int32_t ret_conv = ChannelUpdateInfo_get_last_update(&this_ptr_conv); - return ret_conv; + MultiThreadedScoreLockRead_free(this_obj_conv); } -void CS_LDK_ChannelUpdateInfo_set_last_update(int64_t this_ptr, int32_t val) { - LDKChannelUpdateInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelUpdateInfo_set_last_update(&this_ptr_conv, val); +void CS_LDK_MultiThreadedScoreLockWrite_free(int64_t this_obj) { + LDKMultiThreadedScoreLockWrite this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + MultiThreadedScoreLockWrite_free(this_obj_conv); } -jboolean CS_LDK_ChannelUpdateInfo_get_enabled(int64_t this_ptr) { - LDKChannelUpdateInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - jboolean ret_conv = ChannelUpdateInfo_get_enabled(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_MultiThreadedScoreLockRead_as_ScoreLookUp(int64_t this_arg) { + LDKMultiThreadedScoreLockRead this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKScoreLookUp* ret_ret = MALLOC(sizeof(LDKScoreLookUp), "LDKScoreLookUp"); + *ret_ret = MultiThreadedScoreLockRead_as_ScoreLookUp(&this_arg_conv); + return tag_ptr(ret_ret, true); } -void CS_LDK_ChannelUpdateInfo_set_enabled(int64_t this_ptr, jboolean val) { - LDKChannelUpdateInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelUpdateInfo_set_enabled(&this_ptr_conv, val); +int8_tArray CS_LDK_MultiThreadedScoreLockWrite_write(int64_t obj) { + LDKMultiThreadedScoreLockWrite 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 = MultiThreadedScoreLockWrite_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -int16_t CS_LDK_ChannelUpdateInfo_get_cltv_expiry_delta(int64_t this_ptr) { - LDKChannelUpdateInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int16_t ret_conv = ChannelUpdateInfo_get_cltv_expiry_delta(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_MultiThreadedScoreLockWrite_as_ScoreUpdate(int64_t this_arg) { + LDKMultiThreadedScoreLockWrite this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKScoreUpdate* ret_ret = MALLOC(sizeof(LDKScoreUpdate), "LDKScoreUpdate"); + *ret_ret = MultiThreadedScoreLockWrite_as_ScoreUpdate(&this_arg_conv); + return tag_ptr(ret_ret, true); } -void CS_LDK_ChannelUpdateInfo_set_cltv_expiry_delta(int64_t this_ptr, int16_t val) { - LDKChannelUpdateInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelUpdateInfo_set_cltv_expiry_delta(&this_ptr_conv, val); +void CS_LDK_ChannelUsage_free(int64_t this_obj) { + LDKChannelUsage this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelUsage_free(this_obj_conv); } -int64_t CS_LDK_ChannelUpdateInfo_get_htlc_minimum_msat(int64_t this_ptr) { - LDKChannelUpdateInfo this_ptr_conv; +int64_t CS_LDK_ChannelUsage_get_amount_msat(int64_t this_ptr) { + LDKChannelUsage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelUpdateInfo_get_htlc_minimum_msat(&this_ptr_conv); + int64_t ret_conv = ChannelUsage_get_amount_msat(&this_ptr_conv); return ret_conv; } -void CS_LDK_ChannelUpdateInfo_set_htlc_minimum_msat(int64_t this_ptr, int64_t val) { - LDKChannelUpdateInfo this_ptr_conv; +void CS_LDK_ChannelUsage_set_amount_msat(int64_t this_ptr, int64_t val) { + LDKChannelUsage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelUpdateInfo_set_htlc_minimum_msat(&this_ptr_conv, val); + ChannelUsage_set_amount_msat(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelUpdateInfo_get_htlc_maximum_msat(int64_t this_ptr) { - LDKChannelUpdateInfo this_ptr_conv; +int64_t CS_LDK_ChannelUsage_get_inflight_htlc_msat(int64_t this_ptr) { + LDKChannelUsage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelUpdateInfo_get_htlc_maximum_msat(&this_ptr_conv); + int64_t ret_conv = ChannelUsage_get_inflight_htlc_msat(&this_ptr_conv); return ret_conv; } -void CS_LDK_ChannelUpdateInfo_set_htlc_maximum_msat(int64_t this_ptr, int64_t val) { - LDKChannelUpdateInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelUpdateInfo_set_htlc_maximum_msat(&this_ptr_conv, val); -} - -int64_t CS_LDK_ChannelUpdateInfo_get_fees(int64_t this_ptr) { - LDKChannelUpdateInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKRoutingFees ret_var = ChannelUpdateInfo_get_fees(&this_ptr_conv); - int64_t ret_ref = 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_ChannelUpdateInfo_set_fees(int64_t this_ptr, int64_t val) { - LDKChannelUpdateInfo this_ptr_conv; +void CS_LDK_ChannelUsage_set_inflight_htlc_msat(int64_t this_ptr, int64_t val) { + LDKChannelUsage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKRoutingFees val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = RoutingFees_clone(&val_conv); - ChannelUpdateInfo_set_fees(&this_ptr_conv, val_conv); + ChannelUsage_set_inflight_htlc_msat(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelUpdateInfo_get_last_update_message(int64_t this_ptr) { - LDKChannelUpdateInfo this_ptr_conv; +int64_t CS_LDK_ChannelUsage_get_effective_capacity(int64_t this_ptr) { + LDKChannelUsage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelUpdate ret_var = ChannelUpdateInfo_get_last_update_message(&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); + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = ChannelUsage_get_effective_capacity(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void CS_LDK_ChannelUpdateInfo_set_last_update_message(int64_t this_ptr, int64_t val) { - LDKChannelUpdateInfo this_ptr_conv; +void CS_LDK_ChannelUsage_set_effective_capacity(int64_t this_ptr, int64_t val) { + LDKChannelUsage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelUpdate val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelUpdate_clone(&val_conv); - ChannelUpdateInfo_set_last_update_message(&this_ptr_conv, val_conv); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKEffectiveCapacity val_conv = *(LDKEffectiveCapacity*)(val_ptr); + val_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(val)); + ChannelUsage_set_effective_capacity(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelUpdateInfo_new(int32_t last_update_arg, jboolean enabled_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg, int64_t fees_arg, int64_t last_update_message_arg) { - LDKRoutingFees fees_arg_conv; - fees_arg_conv.inner = untag_ptr(fees_arg); - fees_arg_conv.is_owned = ptr_is_owned(fees_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv); - fees_arg_conv = RoutingFees_clone(&fees_arg_conv); - LDKChannelUpdate last_update_message_arg_conv; - last_update_message_arg_conv.inner = untag_ptr(last_update_message_arg); - last_update_message_arg_conv.is_owned = ptr_is_owned(last_update_message_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(last_update_message_arg_conv); - last_update_message_arg_conv = ChannelUpdate_clone(&last_update_message_arg_conv); - LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_new(last_update_arg, enabled_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, fees_arg_conv, last_update_message_arg_conv); +int64_t CS_LDK_ChannelUsage_new(int64_t amount_msat_arg, int64_t inflight_htlc_msat_arg, int64_t effective_capacity_arg) { + void* effective_capacity_arg_ptr = untag_ptr(effective_capacity_arg); + CHECK_ACCESS(effective_capacity_arg_ptr); + LDKEffectiveCapacity effective_capacity_arg_conv = *(LDKEffectiveCapacity*)(effective_capacity_arg_ptr); + effective_capacity_arg_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(effective_capacity_arg)); + LDKChannelUsage ret_var = ChannelUsage_new(amount_msat_arg, inflight_htlc_msat_arg, effective_capacity_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t ChannelUpdateInfo_clone_ptr(LDKChannelUpdateInfo *NONNULL_PTR arg) { - LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_clone(arg); +static inline uint64_t ChannelUsage_clone_ptr(LDKChannelUsage *NONNULL_PTR arg) { + LDKChannelUsage ret_var = ChannelUsage_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_ChannelUpdateInfo_clone_ptr(int64_t arg) { - LDKChannelUpdateInfo arg_conv; +int64_t CS_LDK_ChannelUsage_clone_ptr(int64_t arg) { + LDKChannelUsage arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = ChannelUpdateInfo_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelUsage_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_ChannelUpdateInfo_clone(int64_t orig) { - LDKChannelUpdateInfo orig_conv; +int64_t CS_LDK_ChannelUsage_clone(int64_t orig) { + LDKChannelUsage orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_clone(&orig_conv); + LDKChannelUsage ret_var = ChannelUsage_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_ChannelUpdateInfo_eq(int64_t a, int64_t b) { - LDKChannelUpdateInfo a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKChannelUpdateInfo b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = ChannelUpdateInfo_eq(&a_conv, &b_conv); - return ret_conv; +void CS_LDK_FixedPenaltyScorer_free(int64_t this_obj) { + LDKFixedPenaltyScorer this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + FixedPenaltyScorer_free(this_obj_conv); } -jstring CS_LDK_ChannelUpdateInfo_to_str(int64_t o) { - LDKChannelUpdateInfo o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = ChannelUpdateInfo_to_str(&o_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); +static inline uint64_t FixedPenaltyScorer_clone_ptr(LDKFixedPenaltyScorer *NONNULL_PTR arg) { + LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_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_FixedPenaltyScorer_clone_ptr(int64_t arg) { + LDKFixedPenaltyScorer arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = FixedPenaltyScorer_clone_ptr(&arg_conv); return ret_conv; } -int8_tArray CS_LDK_ChannelUpdateInfo_write(int64_t obj) { - LDKChannelUpdateInfo obj_conv; +int64_t CS_LDK_FixedPenaltyScorer_clone(int64_t orig) { + LDKFixedPenaltyScorer orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(&orig_conv); + int64_t ret_ref = 0; + 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_FixedPenaltyScorer_with_penalty(int64_t penalty_msat) { + LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_with_penalty(penalty_msat); + int64_t ret_ref = 0; + 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_FixedPenaltyScorer_as_ScoreLookUp(int64_t this_arg) { + LDKFixedPenaltyScorer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKScoreLookUp* ret_ret = MALLOC(sizeof(LDKScoreLookUp), "LDKScoreLookUp"); + *ret_ret = FixedPenaltyScorer_as_ScoreLookUp(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +int64_t CS_LDK_FixedPenaltyScorer_as_ScoreUpdate(int64_t this_arg) { + LDKFixedPenaltyScorer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKScoreUpdate* ret_ret = MALLOC(sizeof(LDKScoreUpdate), "LDKScoreUpdate"); + *ret_ret = FixedPenaltyScorer_as_ScoreUpdate(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +int8_tArray CS_LDK_FixedPenaltyScorer_write(int64_t obj) { + LDKFixedPenaltyScorer obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ChannelUpdateInfo_write(&obj_conv); + LDKCVec_u8Z ret_var = FixedPenaltyScorer_write(&obj_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_ChannelUpdateInfo_read(int8_tArray ser) { +int64_t CS_LDK_FixedPenaltyScorer_read(int8_tArray ser, int64_t arg) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ"); - *ret_conv = ChannelUpdateInfo_read(ser_ref); + LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); + *ret_conv = FixedPenaltyScorer_read(ser_ref, arg); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_ChannelInfo_free(int64_t this_obj) { - LDKChannelInfo this_obj_conv; +void CS_LDK_ProbabilisticScorer_free(int64_t this_obj) { + LDKProbabilisticScorer this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelInfo_free(this_obj_conv); + ProbabilisticScorer_free(this_obj_conv); } -int64_t CS_LDK_ChannelInfo_get_features(int64_t this_ptr) { - LDKChannelInfo this_ptr_conv; +void CS_LDK_ProbabilisticScoringFeeParameters_free(int64_t this_obj) { + LDKProbabilisticScoringFeeParameters this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ProbabilisticScoringFeeParameters_free(this_obj_conv); +} + +int64_t CS_LDK_ProbabilisticScoringFeeParameters_get_base_penalty_msat(int64_t this_ptr) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelFeatures ret_var = ChannelInfo_get_features(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + int64_t ret_conv = ProbabilisticScoringFeeParameters_get_base_penalty_msat(&this_ptr_conv); + return ret_conv; } -void CS_LDK_ChannelInfo_set_features(int64_t this_ptr, int64_t val) { - LDKChannelInfo this_ptr_conv; +void CS_LDK_ProbabilisticScoringFeeParameters_set_base_penalty_msat(int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelFeatures val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelFeatures_clone(&val_conv); - ChannelInfo_set_features(&this_ptr_conv, val_conv); + ProbabilisticScoringFeeParameters_set_base_penalty_msat(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelInfo_get_node_one(int64_t this_ptr) { - LDKChannelInfo this_ptr_conv; +int64_t CS_LDK_ProbabilisticScoringFeeParameters_get_base_penalty_amount_multiplier_msat(int64_t this_ptr) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeId ret_var = ChannelInfo_get_node_one(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + int64_t ret_conv = ProbabilisticScoringFeeParameters_get_base_penalty_amount_multiplier_msat(&this_ptr_conv); + return ret_conv; } -void CS_LDK_ChannelInfo_set_node_one(int64_t this_ptr, int64_t val) { - LDKChannelInfo this_ptr_conv; +void CS_LDK_ProbabilisticScoringFeeParameters_set_base_penalty_amount_multiplier_msat(int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeId val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = NodeId_clone(&val_conv); - ChannelInfo_set_node_one(&this_ptr_conv, val_conv); + ProbabilisticScoringFeeParameters_set_base_penalty_amount_multiplier_msat(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelInfo_get_one_to_two(int64_t this_ptr) { - LDKChannelInfo this_ptr_conv; +int64_t CS_LDK_ProbabilisticScoringFeeParameters_get_liquidity_penalty_multiplier_msat(int64_t this_ptr) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelUpdateInfo ret_var = ChannelInfo_get_one_to_two(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + int64_t ret_conv = ProbabilisticScoringFeeParameters_get_liquidity_penalty_multiplier_msat(&this_ptr_conv); + return ret_conv; } -void CS_LDK_ChannelInfo_set_one_to_two(int64_t this_ptr, int64_t val) { - LDKChannelInfo this_ptr_conv; +void CS_LDK_ProbabilisticScoringFeeParameters_set_liquidity_penalty_multiplier_msat(int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelUpdateInfo val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelUpdateInfo_clone(&val_conv); - ChannelInfo_set_one_to_two(&this_ptr_conv, val_conv); + ProbabilisticScoringFeeParameters_set_liquidity_penalty_multiplier_msat(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelInfo_get_node_two(int64_t this_ptr) { - LDKChannelInfo this_ptr_conv; +int64_t CS_LDK_ProbabilisticScoringFeeParameters_get_liquidity_penalty_amount_multiplier_msat(int64_t this_ptr) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeId ret_var = ChannelInfo_get_node_two(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + int64_t ret_conv = ProbabilisticScoringFeeParameters_get_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv); + return ret_conv; } -void CS_LDK_ChannelInfo_set_node_two(int64_t this_ptr, int64_t val) { - LDKChannelInfo this_ptr_conv; +void CS_LDK_ProbabilisticScoringFeeParameters_set_liquidity_penalty_amount_multiplier_msat(int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeId val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = NodeId_clone(&val_conv); - ChannelInfo_set_node_two(&this_ptr_conv, val_conv); + ProbabilisticScoringFeeParameters_set_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelInfo_get_two_to_one(int64_t this_ptr) { - LDKChannelInfo this_ptr_conv; +int64_t CS_LDK_ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_multiplier_msat(int64_t this_ptr) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelUpdateInfo ret_var = ChannelInfo_get_two_to_one(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + int64_t ret_conv = ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_multiplier_msat(&this_ptr_conv); + return ret_conv; } -void CS_LDK_ChannelInfo_set_two_to_one(int64_t this_ptr, int64_t val) { - LDKChannelInfo this_ptr_conv; +void CS_LDK_ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_multiplier_msat(int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelUpdateInfo val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelUpdateInfo_clone(&val_conv); - ChannelInfo_set_two_to_one(&this_ptr_conv, val_conv); + ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_multiplier_msat(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelInfo_get_capacity_sats(int64_t this_ptr) { - LDKChannelInfo this_ptr_conv; +int64_t CS_LDK_ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_amount_multiplier_msat(int64_t this_ptr) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelInfo_get_capacity_sats(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + int64_t ret_conv = ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv); + return ret_conv; } -void CS_LDK_ChannelInfo_set_capacity_sats(int64_t this_ptr, int64_t val) { - LDKChannelInfo this_ptr_conv; +void CS_LDK_ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_amount_multiplier_msat(int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - ChannelInfo_set_capacity_sats(&this_ptr_conv, val_conv); + ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelInfo_get_announcement_message(int64_t this_ptr) { - LDKChannelInfo this_ptr_conv; +int64_t CS_LDK_ProbabilisticScoringFeeParameters_get_anti_probing_penalty_msat(int64_t this_ptr) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelAnnouncement ret_var = ChannelInfo_get_announcement_message(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + int64_t ret_conv = ProbabilisticScoringFeeParameters_get_anti_probing_penalty_msat(&this_ptr_conv); + return ret_conv; } -void CS_LDK_ChannelInfo_set_announcement_message(int64_t this_ptr, int64_t val) { - LDKChannelInfo this_ptr_conv; +void CS_LDK_ProbabilisticScoringFeeParameters_set_anti_probing_penalty_msat(int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelAnnouncement val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelAnnouncement_clone(&val_conv); - ChannelInfo_set_announcement_message(&this_ptr_conv, val_conv); -} - -static inline uint64_t ChannelInfo_clone_ptr(LDKChannelInfo *NONNULL_PTR arg) { - LDKChannelInfo ret_var = ChannelInfo_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_ChannelInfo_clone_ptr(int64_t arg) { - LDKChannelInfo arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = ChannelInfo_clone_ptr(&arg_conv); - return ret_conv; -} - -int64_t CS_LDK_ChannelInfo_clone(int64_t orig) { - LDKChannelInfo orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKChannelInfo ret_var = ChannelInfo_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + ProbabilisticScoringFeeParameters_set_anti_probing_penalty_msat(&this_ptr_conv, val); } -jboolean CS_LDK_ChannelInfo_eq(int64_t a, int64_t b) { - LDKChannelInfo a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKChannelInfo b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = ChannelInfo_eq(&a_conv, &b_conv); +int64_t CS_LDK_ProbabilisticScoringFeeParameters_get_considered_impossible_penalty_msat(int64_t this_ptr) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = ProbabilisticScoringFeeParameters_get_considered_impossible_penalty_msat(&this_ptr_conv); return ret_conv; } -int64_t CS_LDK_ChannelInfo_get_directional_info(int64_t this_arg, int8_t channel_flags) { - LDKChannelInfo this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelUpdateInfo ret_var = ChannelInfo_get_directional_info(&this_arg_conv, channel_flags); - int64_t ret_ref = 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_ProbabilisticScoringFeeParameters_set_considered_impossible_penalty_msat(int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ProbabilisticScoringFeeParameters_set_considered_impossible_penalty_msat(&this_ptr_conv, val); } -jstring CS_LDK_ChannelInfo_to_str(int64_t o) { - LDKChannelInfo o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = ChannelInfo_to_str(&o_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); +jboolean CS_LDK_ProbabilisticScoringFeeParameters_get_linear_success_probability(int64_t this_ptr) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = ProbabilisticScoringFeeParameters_get_linear_success_probability(&this_ptr_conv); return ret_conv; } -int8_tArray CS_LDK_ChannelInfo_write(int64_t obj) { - LDKChannelInfo obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ChannelInfo_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -int64_t CS_LDK_ChannelInfo_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); - *ret_conv = ChannelInfo_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -void CS_LDK_DirectedChannelInfo_free(int64_t this_obj) { - LDKDirectedChannelInfo this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - DirectedChannelInfo_free(this_obj_conv); +void CS_LDK_ProbabilisticScoringFeeParameters_set_linear_success_probability(int64_t this_ptr, jboolean val) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ProbabilisticScoringFeeParameters_set_linear_success_probability(&this_ptr_conv, val); } -static inline uint64_t DirectedChannelInfo_clone_ptr(LDKDirectedChannelInfo *NONNULL_PTR arg) { - LDKDirectedChannelInfo ret_var = DirectedChannelInfo_clone(arg); +static inline uint64_t ProbabilisticScoringFeeParameters_clone_ptr(LDKProbabilisticScoringFeeParameters *NONNULL_PTR arg) { + LDKProbabilisticScoringFeeParameters ret_var = ProbabilisticScoringFeeParameters_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_DirectedChannelInfo_clone_ptr(int64_t arg) { - LDKDirectedChannelInfo arg_conv; +int64_t CS_LDK_ProbabilisticScoringFeeParameters_clone_ptr(int64_t arg) { + LDKProbabilisticScoringFeeParameters arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = DirectedChannelInfo_clone_ptr(&arg_conv); + int64_t ret_conv = ProbabilisticScoringFeeParameters_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_DirectedChannelInfo_clone(int64_t orig) { - LDKDirectedChannelInfo orig_conv; +int64_t CS_LDK_ProbabilisticScoringFeeParameters_clone(int64_t orig) { + LDKProbabilisticScoringFeeParameters orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKDirectedChannelInfo ret_var = DirectedChannelInfo_clone(&orig_conv); + LDKProbabilisticScoringFeeParameters ret_var = ProbabilisticScoringFeeParameters_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_DirectedChannelInfo_channel(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; - LDKChannelInfo ret_var = DirectedChannelInfo_channel(&this_arg_conv); +int64_t CS_LDK_ProbabilisticScoringFeeParameters_default() { + LDKProbabilisticScoringFeeParameters ret_var = ProbabilisticScoringFeeParameters_default(); int64_t ret_ref = 0; 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_effective_capacity(int64_t this_arg) { - LDKDirectedChannelInfo this_arg_conv; +void CS_LDK_ProbabilisticScoringFeeParameters_add_banned(int64_t this_arg, int64_t node_id) { + LDKProbabilisticScoringFeeParameters this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = DirectedChannelInfo_effective_capacity(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKNodeId node_id_conv; + node_id_conv.inner = untag_ptr(node_id); + node_id_conv.is_owned = ptr_is_owned(node_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); + node_id_conv.is_owned = false; + ProbabilisticScoringFeeParameters_add_banned(&this_arg_conv, &node_id_conv); } -int64_t CS_LDK_DirectedChannelInfo_source(int64_t this_arg) { - LDKDirectedChannelInfo this_arg_conv; +void CS_LDK_ProbabilisticScoringFeeParameters_add_banned_from_list(int64_t this_arg, int64_tArray node_ids) { + LDKProbabilisticScoringFeeParameters this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_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; + LDKCVec_NodeIdZ node_ids_constr; + node_ids_constr.datalen = node_ids->arr_len; + if (node_ids_constr.datalen > 0) + node_ids_constr.data = MALLOC(node_ids_constr.datalen * sizeof(LDKNodeId), "LDKCVec_NodeIdZ Elements"); + else + node_ids_constr.data = NULL; + int64_t* node_ids_vals = node_ids->elems; + for (size_t i = 0; i < node_ids_constr.datalen; i++) { + int64_t node_ids_conv_8 = node_ids_vals[i]; + LDKNodeId node_ids_conv_8_conv; + node_ids_conv_8_conv.inner = untag_ptr(node_ids_conv_8); + node_ids_conv_8_conv.is_owned = ptr_is_owned(node_ids_conv_8); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_ids_conv_8_conv); + node_ids_conv_8_conv = NodeId_clone(&node_ids_conv_8_conv); + node_ids_constr.data[i] = node_ids_conv_8_conv; + } + FREE(node_ids); + ProbabilisticScoringFeeParameters_add_banned_from_list(&this_arg_conv, node_ids_constr); } -int64_t CS_LDK_DirectedChannelInfo_target(int64_t this_arg) { - LDKDirectedChannelInfo this_arg_conv; +void CS_LDK_ProbabilisticScoringFeeParameters_remove_banned(int64_t this_arg, int64_t node_id) { + LDKProbabilisticScoringFeeParameters this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_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; + LDKNodeId node_id_conv; + node_id_conv.inner = untag_ptr(node_id); + node_id_conv.is_owned = ptr_is_owned(node_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); + node_id_conv.is_owned = false; + ProbabilisticScoringFeeParameters_remove_banned(&this_arg_conv, &node_id_conv); } -void CS_LDK_EffectiveCapacity_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); - LDKEffectiveCapacity this_ptr_conv = *(LDKEffectiveCapacity*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - EffectiveCapacity_free(this_ptr_conv); +void CS_LDK_ProbabilisticScoringFeeParameters_set_manual_penalty(int64_t this_arg, int64_t node_id, int64_t penalty) { + LDKProbabilisticScoringFeeParameters this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeId node_id_conv; + node_id_conv.inner = untag_ptr(node_id); + node_id_conv.is_owned = ptr_is_owned(node_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); + node_id_conv.is_owned = false; + ProbabilisticScoringFeeParameters_set_manual_penalty(&this_arg_conv, &node_id_conv, penalty); } -static inline uint64_t EffectiveCapacity_clone_ptr(LDKEffectiveCapacity *NONNULL_PTR arg) { - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_ProbabilisticScoringFeeParameters_remove_manual_penalty(int64_t this_arg, int64_t node_id) { + LDKProbabilisticScoringFeeParameters this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeId node_id_conv; + node_id_conv.inner = untag_ptr(node_id); + node_id_conv.is_owned = ptr_is_owned(node_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); + node_id_conv.is_owned = false; + ProbabilisticScoringFeeParameters_remove_manual_penalty(&this_arg_conv, &node_id_conv); } -int64_t CS_LDK_EffectiveCapacity_clone_ptr(int64_t arg) { - LDKEffectiveCapacity* arg_conv = (LDKEffectiveCapacity*)untag_ptr(arg); - int64_t ret_conv = EffectiveCapacity_clone_ptr(arg_conv); - return ret_conv; + +void CS_LDK_ProbabilisticScoringFeeParameters_clear_manual_penalties(int64_t this_arg) { + LDKProbabilisticScoringFeeParameters this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ProbabilisticScoringFeeParameters_clear_manual_penalties(&this_arg_conv); } -int64_t CS_LDK_EffectiveCapacity_clone(int64_t orig) { - LDKEffectiveCapacity* orig_conv = (LDKEffectiveCapacity*)untag_ptr(orig); - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_EffectiveCapacity_exact_liquidity(int64_t liquidity_msat) { - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_exact_liquidity(liquidity_msat); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_EffectiveCapacity_advertised_max_htlc(int64_t amount_msat) { - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_advertised_max_htlc(amount_msat); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_EffectiveCapacity_total(int64_t capacity_msat, int64_t htlc_maximum_msat) { - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_total(capacity_msat, htlc_maximum_msat); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_EffectiveCapacity_infinite() { - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_infinite(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_EffectiveCapacity_hint_max_htlc(int64_t amount_msat) { - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_hint_max_htlc(amount_msat); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_EffectiveCapacity_unknown() { - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_unknown(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_EffectiveCapacity_as_msat(int64_t this_arg) { - LDKEffectiveCapacity* this_arg_conv = (LDKEffectiveCapacity*)untag_ptr(this_arg); - int64_t ret_conv = EffectiveCapacity_as_msat(this_arg_conv); - return ret_conv; -} - -void CS_LDK_RoutingFees_free(int64_t this_obj) { - LDKRoutingFees this_obj_conv; +void CS_LDK_ProbabilisticScoringDecayParameters_free(int64_t this_obj) { + LDKProbabilisticScoringDecayParameters this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - RoutingFees_free(this_obj_conv); + ProbabilisticScoringDecayParameters_free(this_obj_conv); } -int32_t CS_LDK_RoutingFees_get_base_msat(int64_t this_ptr) { - LDKRoutingFees this_ptr_conv; +int64_t CS_LDK_ProbabilisticScoringDecayParameters_get_historical_no_updates_half_life(int64_t this_ptr) { + LDKProbabilisticScoringDecayParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int32_t ret_conv = RoutingFees_get_base_msat(&this_ptr_conv); + int64_t ret_conv = ProbabilisticScoringDecayParameters_get_historical_no_updates_half_life(&this_ptr_conv); return ret_conv; } -void CS_LDK_RoutingFees_set_base_msat(int64_t this_ptr, int32_t val) { - LDKRoutingFees this_ptr_conv; +void CS_LDK_ProbabilisticScoringDecayParameters_set_historical_no_updates_half_life(int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringDecayParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - RoutingFees_set_base_msat(&this_ptr_conv, val); + ProbabilisticScoringDecayParameters_set_historical_no_updates_half_life(&this_ptr_conv, val); } -int32_t CS_LDK_RoutingFees_get_proportional_millionths(int64_t this_ptr) { - LDKRoutingFees this_ptr_conv; +int64_t CS_LDK_ProbabilisticScoringDecayParameters_get_liquidity_offset_half_life(int64_t this_ptr) { + LDKProbabilisticScoringDecayParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int32_t ret_conv = RoutingFees_get_proportional_millionths(&this_ptr_conv); + int64_t ret_conv = ProbabilisticScoringDecayParameters_get_liquidity_offset_half_life(&this_ptr_conv); return ret_conv; } -void CS_LDK_RoutingFees_set_proportional_millionths(int64_t this_ptr, int32_t val) { - LDKRoutingFees this_ptr_conv; +void CS_LDK_ProbabilisticScoringDecayParameters_set_liquidity_offset_half_life(int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringDecayParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - RoutingFees_set_proportional_millionths(&this_ptr_conv, val); + ProbabilisticScoringDecayParameters_set_liquidity_offset_half_life(&this_ptr_conv, val); } -int64_t CS_LDK_RoutingFees_new(int32_t base_msat_arg, int32_t proportional_millionths_arg) { - LDKRoutingFees ret_var = RoutingFees_new(base_msat_arg, proportional_millionths_arg); +int64_t CS_LDK_ProbabilisticScoringDecayParameters_new(int64_t historical_no_updates_half_life_arg, int64_t liquidity_offset_half_life_arg) { + LDKProbabilisticScoringDecayParameters ret_var = ProbabilisticScoringDecayParameters_new(historical_no_updates_half_life_arg, liquidity_offset_half_life_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; } -jboolean CS_LDK_RoutingFees_eq(int64_t a, int64_t b) { - LDKRoutingFees a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKRoutingFees b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = RoutingFees_eq(&a_conv, &b_conv); - return ret_conv; -} - -static inline uint64_t RoutingFees_clone_ptr(LDKRoutingFees *NONNULL_PTR arg) { - LDKRoutingFees ret_var = RoutingFees_clone(arg); +static inline uint64_t ProbabilisticScoringDecayParameters_clone_ptr(LDKProbabilisticScoringDecayParameters *NONNULL_PTR arg) { + LDKProbabilisticScoringDecayParameters ret_var = ProbabilisticScoringDecayParameters_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_RoutingFees_clone_ptr(int64_t arg) { - LDKRoutingFees arg_conv; +int64_t CS_LDK_ProbabilisticScoringDecayParameters_clone_ptr(int64_t arg) { + LDKProbabilisticScoringDecayParameters arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = RoutingFees_clone_ptr(&arg_conv); + int64_t ret_conv = ProbabilisticScoringDecayParameters_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_RoutingFees_clone(int64_t orig) { - LDKRoutingFees orig_conv; +int64_t CS_LDK_ProbabilisticScoringDecayParameters_clone(int64_t orig) { + LDKProbabilisticScoringDecayParameters orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKRoutingFees ret_var = RoutingFees_clone(&orig_conv); + LDKProbabilisticScoringDecayParameters ret_var = ProbabilisticScoringDecayParameters_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_RoutingFees_hash(int64_t o) { - LDKRoutingFees o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = RoutingFees_hash(&o_conv); - return ret_conv; +int64_t CS_LDK_ProbabilisticScoringDecayParameters_default() { + LDKProbabilisticScoringDecayParameters ret_var = ProbabilisticScoringDecayParameters_default(); + int64_t ret_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_RoutingFees_write(int64_t obj) { - LDKRoutingFees obj_conv; +int64_t CS_LDK_ProbabilisticScorer_new(int64_t decay_params, int64_t network_graph, int64_t logger) { + LDKProbabilisticScoringDecayParameters decay_params_conv; + decay_params_conv.inner = untag_ptr(decay_params); + decay_params_conv.is_owned = ptr_is_owned(decay_params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(decay_params_conv); + decay_params_conv = ProbabilisticScoringDecayParameters_clone(&decay_params_conv); + LDKNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKProbabilisticScorer ret_var = ProbabilisticScorer_new(decay_params_conv, &network_graph_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; +} + +void CS_LDK_ProbabilisticScorer_debug_log_liquidity_stats(int64_t this_arg) { + LDKProbabilisticScorer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ProbabilisticScorer_debug_log_liquidity_stats(&this_arg_conv); +} + +int64_t CS_LDK_ProbabilisticScorer_estimated_channel_liquidity_range(int64_t this_arg, int64_t scid, int64_t target) { + LDKProbabilisticScorer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeId target_conv; + target_conv.inner = untag_ptr(target); + target_conv.is_owned = ptr_is_owned(target); + CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); + target_conv.is_owned = false; + LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ"); + *ret_copy = ProbabilisticScorer_estimated_channel_liquidity_range(&this_arg_conv, scid, &target_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_ProbabilisticScorer_historical_estimated_channel_liquidity_probabilities(int64_t this_arg, int64_t scid, int64_t target) { + LDKProbabilisticScorer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeId target_conv; + target_conv.inner = untag_ptr(target); + target_conv.is_owned = ptr_is_owned(target); + CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); + target_conv.is_owned = false; + LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ), "LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ"); + *ret_copy = ProbabilisticScorer_historical_estimated_channel_liquidity_probabilities(&this_arg_conv, scid, &target_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_ProbabilisticScorer_historical_estimated_payment_success_probability(int64_t this_arg, int64_t scid, int64_t target, int64_t amount_msat, int64_t params) { + LDKProbabilisticScorer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeId target_conv; + target_conv.inner = untag_ptr(target); + target_conv.is_owned = ptr_is_owned(target); + CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); + target_conv.is_owned = false; + LDKProbabilisticScoringFeeParameters params_conv; + params_conv.inner = untag_ptr(params); + params_conv.is_owned = ptr_is_owned(params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); + params_conv.is_owned = false; + LDKCOption_f64Z *ret_copy = MALLOC(sizeof(LDKCOption_f64Z), "LDKCOption_f64Z"); + *ret_copy = ProbabilisticScorer_historical_estimated_payment_success_probability(&this_arg_conv, scid, &target_conv, amount_msat, ¶ms_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_ProbabilisticScorer_as_ScoreLookUp(int64_t this_arg) { + LDKProbabilisticScorer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKScoreLookUp* ret_ret = MALLOC(sizeof(LDKScoreLookUp), "LDKScoreLookUp"); + *ret_ret = ProbabilisticScorer_as_ScoreLookUp(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +int64_t CS_LDK_ProbabilisticScorer_as_ScoreUpdate(int64_t this_arg) { + LDKProbabilisticScorer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKScoreUpdate* ret_ret = MALLOC(sizeof(LDKScoreUpdate), "LDKScoreUpdate"); + *ret_ret = ProbabilisticScorer_as_ScoreUpdate(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +int64_t CS_LDK_ProbabilisticScorer_as_Score(int64_t this_arg) { + LDKProbabilisticScorer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore"); + *ret_ret = ProbabilisticScorer_as_Score(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +int8_tArray CS_LDK_ProbabilisticScorer_write(int64_t obj) { + LDKProbabilisticScorer obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = RoutingFees_write(&obj_conv); + LDKCVec_u8Z ret_var = ProbabilisticScorer_write(&obj_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_RoutingFees_read(int8_tArray ser) { +int64_t CS_LDK_ProbabilisticScorer_read(int8_tArray ser, int64_t arg_a, int64_t arg_b, int64_t arg_c) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); - *ret_conv = RoutingFees_read(ser_ref); + LDKProbabilisticScoringDecayParameters arg_a_conv; + arg_a_conv.inner = untag_ptr(arg_a); + arg_a_conv.is_owned = ptr_is_owned(arg_a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_a_conv); + arg_a_conv = ProbabilisticScoringDecayParameters_clone(&arg_a_conv); + LDKNetworkGraph arg_b_conv; + arg_b_conv.inner = untag_ptr(arg_b); + arg_b_conv.is_owned = ptr_is_owned(arg_b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_b_conv); + arg_b_conv.is_owned = false; + void* arg_c_ptr = untag_ptr(arg_c); + CHECK_ACCESS(arg_c_ptr); + LDKLogger arg_c_conv = *(LDKLogger*)(arg_c_ptr); + if (arg_c_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&arg_c_conv); + } + LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ"); + *ret_conv = ProbabilisticScorer_read(ser_ref, arg_a_conv, &arg_b_conv, arg_c_conv); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_NodeAnnouncementInfo_free(int64_t this_obj) { - LDKNodeAnnouncementInfo this_obj_conv; +void CS_LDK_DelayedPaymentOutputDescriptor_free(int64_t this_obj) { + LDKDelayedPaymentOutputDescriptor this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - NodeAnnouncementInfo_free(this_obj_conv); + DelayedPaymentOutputDescriptor_free(this_obj_conv); } -int64_t CS_LDK_NodeAnnouncementInfo_get_features(int64_t this_ptr) { - LDKNodeAnnouncementInfo this_ptr_conv; +int64_t CS_LDK_DelayedPaymentOutputDescriptor_get_outpoint(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; - LDKNodeFeatures ret_var = NodeAnnouncementInfo_get_features(&this_ptr_conv); + LDKOutPoint ret_var = DelayedPaymentOutputDescriptor_get_outpoint(&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_NodeAnnouncementInfo_set_features(int64_t this_ptr, int64_t val) { - LDKNodeAnnouncementInfo this_ptr_conv; +void CS_LDK_DelayedPaymentOutputDescriptor_set_outpoint(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; - LDKNodeFeatures val_conv; + LDKOutPoint val_conv; val_conv.inner = untag_ptr(val); val_conv.is_owned = ptr_is_owned(val); CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = NodeFeatures_clone(&val_conv); - NodeAnnouncementInfo_set_features(&this_ptr_conv, val_conv); + val_conv = OutPoint_clone(&val_conv); + DelayedPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv); +} + +int8_tArray CS_LDK_DelayedPaymentOutputDescriptor_get_per_commitment_point(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; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, DelayedPaymentOutputDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form, 33); + return ret_arr; +} + +void CS_LDK_DelayedPaymentOutputDescriptor_set_per_commitment_point(int64_t this_ptr, int8_tArray 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; + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + DelayedPaymentOutputDescriptor_set_per_commitment_point(&this_ptr_conv, val_ref); } -int32_t CS_LDK_NodeAnnouncementInfo_get_last_update(int64_t this_ptr) { - LDKNodeAnnouncementInfo this_ptr_conv; +int16_t CS_LDK_DelayedPaymentOutputDescriptor_get_to_self_delay(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; - int32_t ret_conv = NodeAnnouncementInfo_get_last_update(&this_ptr_conv); + int16_t ret_conv = DelayedPaymentOutputDescriptor_get_to_self_delay(&this_ptr_conv); return ret_conv; } -void CS_LDK_NodeAnnouncementInfo_set_last_update(int64_t this_ptr, int32_t val) { - LDKNodeAnnouncementInfo this_ptr_conv; +void CS_LDK_DelayedPaymentOutputDescriptor_set_to_self_delay(int64_t this_ptr, int16_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; - NodeAnnouncementInfo_set_last_update(&this_ptr_conv, val); + DelayedPaymentOutputDescriptor_set_to_self_delay(&this_ptr_conv, val); } -int8_tArray CS_LDK_NodeAnnouncementInfo_get_rgb(int64_t this_ptr) { - LDKNodeAnnouncementInfo this_ptr_conv; +int64_t CS_LDK_DelayedPaymentOutputDescriptor_get_output(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; - int8_tArray ret_arr = init_int8_tArray(3, __LINE__); - memcpy(ret_arr->elems, *NodeAnnouncementInfo_get_rgb(&this_ptr_conv), 3); - return ret_arr; + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = DelayedPaymentOutputDescriptor_get_output(&this_ptr_conv); + return tag_ptr(ret_ref, true); } -void CS_LDK_NodeAnnouncementInfo_set_rgb(int64_t this_ptr, int8_tArray val) { - LDKNodeAnnouncementInfo this_ptr_conv; +void CS_LDK_DelayedPaymentOutputDescriptor_set_output(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; - LDKThreeBytes val_ref; - CHECK(val->arr_len == 3); - memcpy(val_ref.data, val->elems, 3); FREE(val); - NodeAnnouncementInfo_set_rgb(&this_ptr_conv, val_ref); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); + val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val)); + DelayedPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv); } -int64_t CS_LDK_NodeAnnouncementInfo_get_alias(int64_t this_ptr) { - LDKNodeAnnouncementInfo this_ptr_conv; +int64_t CS_LDK_DelayedPaymentOutputDescriptor_get_revocation_pubkey(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; - LDKNodeAlias ret_var = NodeAnnouncementInfo_get_alias(&this_ptr_conv); + LDKRevocationKey ret_var = DelayedPaymentOutputDescriptor_get_revocation_pubkey(&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_NodeAnnouncementInfo_set_alias(int64_t this_ptr, int64_t val) { - LDKNodeAnnouncementInfo this_ptr_conv; +void CS_LDK_DelayedPaymentOutputDescriptor_set_revocation_pubkey(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; - LDKNodeAlias val_conv; + LDKRevocationKey val_conv; val_conv.inner = untag_ptr(val); val_conv.is_owned = ptr_is_owned(val); CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = NodeAlias_clone(&val_conv); - NodeAnnouncementInfo_set_alias(&this_ptr_conv, val_conv); + val_conv = RevocationKey_clone(&val_conv); + DelayedPaymentOutputDescriptor_set_revocation_pubkey(&this_ptr_conv, val_conv); +} + +int8_tArray CS_LDK_DelayedPaymentOutputDescriptor_get_channel_keys_id(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; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *DelayedPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv), 32); + return ret_arr; +} + +void CS_LDK_DelayedPaymentOutputDescriptor_set_channel_keys_id(int64_t this_ptr, int8_tArray 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; + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + DelayedPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref); +} + +int64_t CS_LDK_DelayedPaymentOutputDescriptor_get_channel_value_satoshis(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; + int64_t ret_conv = DelayedPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_DelayedPaymentOutputDescriptor_set_channel_value_satoshis(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; + DelayedPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); } -int64_t CS_LDK_NodeAnnouncementInfo_get_announcement_message(int64_t this_ptr) { - LDKNodeAnnouncementInfo this_ptr_conv; +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; - LDKNodeAnnouncement ret_var = NodeAnnouncementInfo_get_announcement_message(&this_ptr_conv); + 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_NodeAnnouncementInfo_set_announcement_message(int64_t this_ptr, int64_t val) { - LDKNodeAnnouncementInfo this_ptr_conv; +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; - LDKNodeAnnouncement val_conv; + 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 = NodeAnnouncement_clone(&val_conv); - NodeAnnouncementInfo_set_announcement_message(&this_ptr_conv, val_conv); + val_conv = ChannelTransactionParameters_clone(&val_conv); + DelayedPaymentOutputDescriptor_set_channel_transaction_parameters(&this_ptr_conv, val_conv); } -int64_t CS_LDK_NodeAnnouncementInfo_new(int64_t features_arg, int32_t last_update_arg, int8_tArray rgb_arg, int64_t alias_arg, int64_t announcement_message_arg) { - LDKNodeFeatures features_arg_conv; - features_arg_conv.inner = untag_ptr(features_arg); - features_arg_conv.is_owned = ptr_is_owned(features_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); - features_arg_conv = NodeFeatures_clone(&features_arg_conv); - LDKThreeBytes rgb_arg_ref; - CHECK(rgb_arg->arr_len == 3); - memcpy(rgb_arg_ref.data, rgb_arg->elems, 3); FREE(rgb_arg); - LDKNodeAlias alias_arg_conv; - alias_arg_conv.inner = untag_ptr(alias_arg); - alias_arg_conv.is_owned = ptr_is_owned(alias_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(alias_arg_conv); - alias_arg_conv = NodeAlias_clone(&alias_arg_conv); - LDKNodeAnnouncement announcement_message_arg_conv; - announcement_message_arg_conv.inner = untag_ptr(announcement_message_arg); - announcement_message_arg_conv.is_owned = ptr_is_owned(announcement_message_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_message_arg_conv); - announcement_message_arg_conv = NodeAnnouncement_clone(&announcement_message_arg_conv); - LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_new(features_arg_conv, last_update_arg, rgb_arg_ref, alias_arg_conv, announcement_message_arg_conv); +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); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); + outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); + 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); + void* output_arg_ptr = untag_ptr(output_arg); + CHECK_ACCESS(output_arg_ptr); + LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr); + output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg)); + LDKRevocationKey revocation_pubkey_arg_conv; + revocation_pubkey_arg_conv.inner = untag_ptr(revocation_pubkey_arg); + revocation_pubkey_arg_conv.is_owned = ptr_is_owned(revocation_pubkey_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(revocation_pubkey_arg_conv); + revocation_pubkey_arg_conv = RevocationKey_clone(&revocation_pubkey_arg_conv); + 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); + 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); return ret_ref; } -static inline uint64_t NodeAnnouncementInfo_clone_ptr(LDKNodeAnnouncementInfo *NONNULL_PTR arg) { - LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(arg); +static inline uint64_t DelayedPaymentOutputDescriptor_clone_ptr(LDKDelayedPaymentOutputDescriptor *NONNULL_PTR arg) { + LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_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_NodeAnnouncementInfo_clone_ptr(int64_t arg) { - LDKNodeAnnouncementInfo arg_conv; +int64_t CS_LDK_DelayedPaymentOutputDescriptor_clone_ptr(int64_t arg) { + LDKDelayedPaymentOutputDescriptor arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = NodeAnnouncementInfo_clone_ptr(&arg_conv); + int64_t ret_conv = DelayedPaymentOutputDescriptor_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_NodeAnnouncementInfo_clone(int64_t orig) { - LDKNodeAnnouncementInfo orig_conv; +int64_t CS_LDK_DelayedPaymentOutputDescriptor_clone(int64_t orig) { + LDKDelayedPaymentOutputDescriptor orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(&orig_conv); + LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_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_NodeAnnouncementInfo_eq(int64_t a, int64_t b) { - LDKNodeAnnouncementInfo a_conv; +int64_t CS_LDK_DelayedPaymentOutputDescriptor_hash(int64_t o) { + LDKDelayedPaymentOutputDescriptor o_conv; + 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 = DelayedPaymentOutputDescriptor_hash(&o_conv); + return ret_conv; +} + +jboolean CS_LDK_DelayedPaymentOutputDescriptor_eq(int64_t a, int64_t b) { + LDKDelayedPaymentOutputDescriptor a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKNodeAnnouncementInfo b_conv; + LDKDelayedPaymentOutputDescriptor b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = NodeAnnouncementInfo_eq(&a_conv, &b_conv); + jboolean ret_conv = DelayedPaymentOutputDescriptor_eq(&a_conv, &b_conv); return ret_conv; } -int64_tArray CS_LDK_NodeAnnouncementInfo_addresses(int64_t this_arg) { - LDKNodeAnnouncementInfo this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_SocketAddressZ ret_var = NodeAnnouncementInfo_addresses(&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 p = 0; p < ret_var.datalen; p++) { - LDKSocketAddress *ret_conv_15_copy = MALLOC(sizeof(LDKSocketAddress), "LDKSocketAddress"); - *ret_conv_15_copy = ret_var.data[p]; - int64_t ret_conv_15_ref = tag_ptr(ret_conv_15_copy, true); - ret_arr_ptr[p] = ret_conv_15_ref; - } - - FREE(ret_var.data); - return ret_arr; -} - -int8_tArray CS_LDK_NodeAnnouncementInfo_write(int64_t obj) { - LDKNodeAnnouncementInfo obj_conv; +int8_tArray CS_LDK_DelayedPaymentOutputDescriptor_write(int64_t obj) { + LDKDelayedPaymentOutputDescriptor obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = NodeAnnouncementInfo_write(&obj_conv); + LDKCVec_u8Z ret_var = DelayedPaymentOutputDescriptor_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_NodeAnnouncementInfo_read(int8_tArray ser) { +int64_t CS_LDK_DelayedPaymentOutputDescriptor_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); - *ret_conv = NodeAnnouncementInfo_read(ser_ref); + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = DelayedPaymentOutputDescriptor_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_NodeAlias_free(int64_t this_obj) { - LDKNodeAlias this_obj_conv; +void CS_LDK_StaticPaymentOutputDescriptor_free(int64_t this_obj) { + LDKStaticPaymentOutputDescriptor this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - NodeAlias_free(this_obj_conv); + StaticPaymentOutputDescriptor_free(this_obj_conv); } -int8_tArray CS_LDK_NodeAlias_get_a(int64_t this_ptr) { - LDKNodeAlias this_ptr_conv; +int64_t CS_LDK_StaticPaymentOutputDescriptor_get_outpoint(int64_t this_ptr) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *NodeAlias_get_a(&this_ptr_conv), 32); + LDKOutPoint ret_var = StaticPaymentOutputDescriptor_get_outpoint(&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_StaticPaymentOutputDescriptor_set_outpoint(int64_t this_ptr, int64_t val) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKOutPoint val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = OutPoint_clone(&val_conv); + StaticPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_StaticPaymentOutputDescriptor_get_output(int64_t this_ptr) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = StaticPaymentOutputDescriptor_get_output(&this_ptr_conv); + return tag_ptr(ret_ref, true); +} + +void CS_LDK_StaticPaymentOutputDescriptor_set_output(int64_t this_ptr, int64_t val) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); + val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val)); + StaticPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv); +} + +int8_tArray CS_LDK_StaticPaymentOutputDescriptor_get_channel_keys_id(int64_t this_ptr) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(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, *StaticPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv), 32); return ret_arr; } -void CS_LDK_NodeAlias_set_a(int64_t this_ptr, int8_tArray val) { - LDKNodeAlias this_ptr_conv; +void CS_LDK_StaticPaymentOutputDescriptor_set_channel_keys_id(int64_t this_ptr, int8_tArray val) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -71015,11951 +74943,13271 @@ void CS_LDK_NodeAlias_set_a(int64_t this_ptr, int8_tArray val) { LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); memcpy(val_ref.data, val->elems, 32); FREE(val); - NodeAlias_set_a(&this_ptr_conv, val_ref); + StaticPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref); } -int64_t CS_LDK_NodeAlias_new(int8_tArray a_arg) { - LDKThirtyTwoBytes a_arg_ref; - CHECK(a_arg->arr_len == 32); - memcpy(a_arg_ref.data, a_arg->elems, 32); FREE(a_arg); - LDKNodeAlias ret_var = NodeAlias_new(a_arg_ref); +int64_t CS_LDK_StaticPaymentOutputDescriptor_get_channel_value_satoshis(int64_t this_ptr) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = StaticPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_StaticPaymentOutputDescriptor_set_channel_value_satoshis(int64_t this_ptr, int64_t val) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + StaticPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); +} + +int64_t CS_LDK_StaticPaymentOutputDescriptor_get_channel_transaction_parameters(int64_t this_ptr) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = StaticPaymentOutputDescriptor_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; } -static inline uint64_t NodeAlias_clone_ptr(LDKNodeAlias *NONNULL_PTR arg) { - LDKNodeAlias ret_var = NodeAlias_clone(arg); +void CS_LDK_StaticPaymentOutputDescriptor_set_channel_transaction_parameters(int64_t this_ptr, int64_t val) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + StaticPaymentOutputDescriptor_set_channel_transaction_parameters(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_StaticPaymentOutputDescriptor_new(int64_t outpoint_arg, int64_t output_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); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); + outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); + void* output_arg_ptr = untag_ptr(output_arg); + CHECK_ACCESS(output_arg_ptr); + LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr); + output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg)); + 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); + 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); + LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_new(outpoint_arg_conv, output_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); return ret_ref; } -int64_t CS_LDK_NodeAlias_clone_ptr(int64_t arg) { - LDKNodeAlias arg_conv; + +static inline uint64_t StaticPaymentOutputDescriptor_clone_ptr(LDKStaticPaymentOutputDescriptor *NONNULL_PTR arg) { + LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_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_StaticPaymentOutputDescriptor_clone_ptr(int64_t arg) { + LDKStaticPaymentOutputDescriptor arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = NodeAlias_clone_ptr(&arg_conv); + int64_t ret_conv = StaticPaymentOutputDescriptor_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_NodeAlias_clone(int64_t orig) { - LDKNodeAlias orig_conv; +int64_t CS_LDK_StaticPaymentOutputDescriptor_clone(int64_t orig) { + LDKStaticPaymentOutputDescriptor orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKNodeAlias ret_var = NodeAlias_clone(&orig_conv); + LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_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_NodeAlias_hash(int64_t o) { - LDKNodeAlias o_conv; +int64_t CS_LDK_StaticPaymentOutputDescriptor_hash(int64_t o) { + LDKStaticPaymentOutputDescriptor o_conv; 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 = NodeAlias_hash(&o_conv); + int64_t ret_conv = StaticPaymentOutputDescriptor_hash(&o_conv); return ret_conv; } -jboolean CS_LDK_NodeAlias_eq(int64_t a, int64_t b) { - LDKNodeAlias a_conv; +jboolean CS_LDK_StaticPaymentOutputDescriptor_eq(int64_t a, int64_t b) { + LDKStaticPaymentOutputDescriptor a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKNodeAlias b_conv; + LDKStaticPaymentOutputDescriptor b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = NodeAlias_eq(&a_conv, &b_conv); + jboolean ret_conv = StaticPaymentOutputDescriptor_eq(&a_conv, &b_conv); return ret_conv; } -jstring CS_LDK_NodeAlias_to_str(int64_t o) { - LDKNodeAlias o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = NodeAlias_to_str(&o_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); +int64_t CS_LDK_StaticPaymentOutputDescriptor_witness_script(int64_t this_arg) { + LDKStaticPaymentOutputDescriptor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = StaticPaymentOutputDescriptor_witness_script(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_StaticPaymentOutputDescriptor_max_witness_length(int64_t this_arg) { + LDKStaticPaymentOutputDescriptor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int64_t ret_conv = StaticPaymentOutputDescriptor_max_witness_length(&this_arg_conv); return ret_conv; } -int8_tArray CS_LDK_NodeAlias_write(int64_t obj) { - LDKNodeAlias obj_conv; +int8_tArray CS_LDK_StaticPaymentOutputDescriptor_write(int64_t obj) { + LDKStaticPaymentOutputDescriptor obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = NodeAlias_write(&obj_conv); + LDKCVec_u8Z ret_var = StaticPaymentOutputDescriptor_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_NodeAlias_read(int8_tArray ser) { +int64_t CS_LDK_StaticPaymentOutputDescriptor_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ"); - *ret_conv = NodeAlias_read(ser_ref); + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = StaticPaymentOutputDescriptor_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_NodeInfo_free(int64_t this_obj) { - LDKNodeInfo this_obj_conv; +void CS_LDK_SpendableOutputDescriptor_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); + LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + SpendableOutputDescriptor_free(this_ptr_conv); +} + +static inline uint64_t SpendableOutputDescriptor_clone_ptr(LDKSpendableOutputDescriptor *NONNULL_PTR arg) { + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = SpendableOutputDescriptor_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_SpendableOutputDescriptor_clone_ptr(int64_t arg) { + LDKSpendableOutputDescriptor* arg_conv = (LDKSpendableOutputDescriptor*)untag_ptr(arg); + int64_t ret_conv = SpendableOutputDescriptor_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_SpendableOutputDescriptor_clone(int64_t orig) { + LDKSpendableOutputDescriptor* orig_conv = (LDKSpendableOutputDescriptor*)untag_ptr(orig); + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = SpendableOutputDescriptor_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_SpendableOutputDescriptor_static_output(int64_t outpoint, int64_t output, int8_tArray channel_keys_id) { + 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); + void* output_ptr = untag_ptr(output); + CHECK_ACCESS(output_ptr); + LDKTxOut output_conv = *(LDKTxOut*)(output_ptr); + output_conv = TxOut_clone((LDKTxOut*)untag_ptr(output)); + LDKThirtyTwoBytes channel_keys_id_ref; + CHECK(channel_keys_id->arr_len == 32); + memcpy(channel_keys_id_ref.data, channel_keys_id->elems, 32); FREE(channel_keys_id); + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = SpendableOutputDescriptor_static_output(outpoint_conv, output_conv, channel_keys_id_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_SpendableOutputDescriptor_delayed_payment_output(int64_t a) { + LDKDelayedPaymentOutputDescriptor a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = DelayedPaymentOutputDescriptor_clone(&a_conv); + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = SpendableOutputDescriptor_delayed_payment_output(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_SpendableOutputDescriptor_static_payment_output(int64_t a) { + LDKStaticPaymentOutputDescriptor a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = StaticPaymentOutputDescriptor_clone(&a_conv); + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = SpendableOutputDescriptor_static_payment_output(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_SpendableOutputDescriptor_hash(int64_t o) { + LDKSpendableOutputDescriptor* o_conv = (LDKSpendableOutputDescriptor*)untag_ptr(o); + int64_t ret_conv = SpendableOutputDescriptor_hash(o_conv); + return ret_conv; +} + +jboolean CS_LDK_SpendableOutputDescriptor_eq(int64_t a, int64_t b) { + LDKSpendableOutputDescriptor* a_conv = (LDKSpendableOutputDescriptor*)untag_ptr(a); + LDKSpendableOutputDescriptor* b_conv = (LDKSpendableOutputDescriptor*)untag_ptr(b); + jboolean ret_conv = SpendableOutputDescriptor_eq(a_conv, b_conv); + return ret_conv; +} + +int8_tArray CS_LDK_SpendableOutputDescriptor_write(int64_t obj) { + LDKSpendableOutputDescriptor* obj_conv = (LDKSpendableOutputDescriptor*)untag_ptr(obj); + LDKCVec_u8Z ret_var = SpendableOutputDescriptor_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_SpendableOutputDescriptor_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); + *ret_conv = SpendableOutputDescriptor_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_SpendableOutputDescriptor_create_spendable_outputs_psbt(int64_tArray descriptors, int64_tArray outputs, int8_tArray change_destination_script, int32_t feerate_sat_per_1000_weight, int64_t locktime) { + 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_C2Tuple_CVec_u8Zu64ZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ), "LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ"); + *ret_conv = SpendableOutputDescriptor_create_spendable_outputs_psbt(descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight, locktime_conv); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_ChannelDerivationParameters_free(int64_t this_obj) { + LDKChannelDerivationParameters this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - NodeInfo_free(this_obj_conv); + ChannelDerivationParameters_free(this_obj_conv); } -int64_tArray CS_LDK_NodeInfo_get_channels(int64_t this_ptr) { - LDKNodeInfo this_ptr_conv; +int64_t CS_LDK_ChannelDerivationParameters_get_value_satoshis(int64_t this_ptr) { + LDKChannelDerivationParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u64Z ret_var = NodeInfo_get_channels(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t g = 0; g < ret_var.datalen; g++) { - int64_t ret_conv_6_conv = ret_var.data[g]; - ret_arr_ptr[g] = ret_conv_6_conv; - } - - FREE(ret_var.data); + int64_t ret_conv = ChannelDerivationParameters_get_value_satoshis(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_ChannelDerivationParameters_set_value_satoshis(int64_t this_ptr, int64_t val) { + LDKChannelDerivationParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelDerivationParameters_set_value_satoshis(&this_ptr_conv, val); +} + +int8_tArray CS_LDK_ChannelDerivationParameters_get_keys_id(int64_t this_ptr) { + LDKChannelDerivationParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(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, *ChannelDerivationParameters_get_keys_id(&this_ptr_conv), 32); return ret_arr; } -void CS_LDK_NodeInfo_set_channels(int64_t this_ptr, int64_tArray val) { - LDKNodeInfo this_ptr_conv; +void CS_LDK_ChannelDerivationParameters_set_keys_id(int64_t this_ptr, int8_tArray val) { + LDKChannelDerivationParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u64Z val_constr; - val_constr.datalen = val->arr_len; - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = val->elems; - for (size_t g = 0; g < val_constr.datalen; g++) { - int64_t val_conv_6 = val_vals[g]; - val_constr.data[g] = val_conv_6; - } - FREE(val); - NodeInfo_set_channels(&this_ptr_conv, val_constr); + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + ChannelDerivationParameters_set_keys_id(&this_ptr_conv, val_ref); } -int64_t CS_LDK_NodeInfo_get_announcement_info(int64_t this_ptr) { - LDKNodeInfo this_ptr_conv; +int64_t CS_LDK_ChannelDerivationParameters_get_transaction_parameters(int64_t this_ptr) { + LDKChannelDerivationParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeAnnouncementInfo ret_var = NodeInfo_get_announcement_info(&this_ptr_conv); + LDKChannelTransactionParameters ret_var = ChannelDerivationParameters_get_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_NodeInfo_set_announcement_info(int64_t this_ptr, int64_t val) { - LDKNodeInfo this_ptr_conv; +void CS_LDK_ChannelDerivationParameters_set_transaction_parameters(int64_t this_ptr, int64_t val) { + LDKChannelDerivationParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeAnnouncementInfo val_conv; + 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 = NodeAnnouncementInfo_clone(&val_conv); - NodeInfo_set_announcement_info(&this_ptr_conv, val_conv); + val_conv = ChannelTransactionParameters_clone(&val_conv); + ChannelDerivationParameters_set_transaction_parameters(&this_ptr_conv, val_conv); } -int64_t CS_LDK_NodeInfo_new(int64_tArray channels_arg, int64_t announcement_info_arg) { - LDKCVec_u64Z channels_arg_constr; - channels_arg_constr.datalen = channels_arg->arr_len; - if (channels_arg_constr.datalen > 0) - channels_arg_constr.data = MALLOC(channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); - else - channels_arg_constr.data = NULL; - int64_t* channels_arg_vals = channels_arg->elems; - for (size_t g = 0; g < channels_arg_constr.datalen; g++) { - int64_t channels_arg_conv_6 = channels_arg_vals[g]; - channels_arg_constr.data[g] = channels_arg_conv_6; - } - FREE(channels_arg); - LDKNodeAnnouncementInfo announcement_info_arg_conv; - announcement_info_arg_conv.inner = untag_ptr(announcement_info_arg); - announcement_info_arg_conv.is_owned = ptr_is_owned(announcement_info_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_info_arg_conv); - announcement_info_arg_conv = NodeAnnouncementInfo_clone(&announcement_info_arg_conv); - LDKNodeInfo ret_var = NodeInfo_new(channels_arg_constr, announcement_info_arg_conv); +int64_t CS_LDK_ChannelDerivationParameters_new(int64_t value_satoshis_arg, int8_tArray keys_id_arg, int64_t transaction_parameters_arg) { + LDKThirtyTwoBytes keys_id_arg_ref; + CHECK(keys_id_arg->arr_len == 32); + memcpy(keys_id_arg_ref.data, keys_id_arg->elems, 32); FREE(keys_id_arg); + LDKChannelTransactionParameters transaction_parameters_arg_conv; + transaction_parameters_arg_conv.inner = untag_ptr(transaction_parameters_arg); + transaction_parameters_arg_conv.is_owned = ptr_is_owned(transaction_parameters_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(transaction_parameters_arg_conv); + transaction_parameters_arg_conv = ChannelTransactionParameters_clone(&transaction_parameters_arg_conv); + LDKChannelDerivationParameters ret_var = ChannelDerivationParameters_new(value_satoshis_arg, keys_id_arg_ref, 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); return ret_ref; } -static inline uint64_t NodeInfo_clone_ptr(LDKNodeInfo *NONNULL_PTR arg) { - LDKNodeInfo ret_var = NodeInfo_clone(arg); +static inline uint64_t ChannelDerivationParameters_clone_ptr(LDKChannelDerivationParameters *NONNULL_PTR arg) { + LDKChannelDerivationParameters ret_var = ChannelDerivationParameters_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_NodeInfo_clone_ptr(int64_t arg) { - LDKNodeInfo arg_conv; +int64_t CS_LDK_ChannelDerivationParameters_clone_ptr(int64_t arg) { + LDKChannelDerivationParameters arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = NodeInfo_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelDerivationParameters_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_NodeInfo_clone(int64_t orig) { - LDKNodeInfo orig_conv; +int64_t CS_LDK_ChannelDerivationParameters_clone(int64_t orig) { + LDKChannelDerivationParameters orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKNodeInfo ret_var = NodeInfo_clone(&orig_conv); + LDKChannelDerivationParameters ret_var = ChannelDerivationParameters_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_NodeInfo_eq(int64_t a, int64_t b) { - LDKNodeInfo a_conv; +jboolean CS_LDK_ChannelDerivationParameters_eq(int64_t a, int64_t b) { + LDKChannelDerivationParameters a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKNodeInfo b_conv; + LDKChannelDerivationParameters b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = NodeInfo_eq(&a_conv, &b_conv); - return ret_conv; -} - -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; -} - -jstring CS_LDK_NodeInfo_to_str(int64_t o) { - LDKNodeInfo o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = NodeInfo_to_str(&o_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); + jboolean ret_conv = ChannelDerivationParameters_eq(&a_conv, &b_conv); return ret_conv; } -int8_tArray CS_LDK_NodeInfo_write(int64_t obj) { - LDKNodeInfo obj_conv; +int8_tArray CS_LDK_ChannelDerivationParameters_write(int64_t obj) { + LDKChannelDerivationParameters obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = NodeInfo_write(&obj_conv); + LDKCVec_u8Z ret_var = ChannelDerivationParameters_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_NodeInfo_read(int8_tArray ser) { +int64_t CS_LDK_ChannelDerivationParameters_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); - *ret_conv = NodeInfo_read(ser_ref); + LDKCResult_ChannelDerivationParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDerivationParametersDecodeErrorZ), "LDKCResult_ChannelDerivationParametersDecodeErrorZ"); + *ret_conv = ChannelDerivationParameters_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -int8_tArray CS_LDK_NetworkGraph_write(int64_t obj) { - LDKNetworkGraph obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = NetworkGraph_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; -} +void CS_LDK_HTLCDescriptor_free(int64_t this_obj) { + LDKHTLCDescriptor this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + HTLCDescriptor_free(this_obj_conv); +} -int64_t CS_LDK_NetworkGraph_read(int8_tArray ser, int64_t arg) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - void* arg_ptr = untag_ptr(arg); - CHECK_ACCESS(arg_ptr); - LDKLogger arg_conv = *(LDKLogger*)(arg_ptr); - if (arg_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&arg_conv); - } - LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); - *ret_conv = NetworkGraph_read(ser_ref, arg_conv); - FREE(ser); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_HTLCDescriptor_get_channel_derivation_parameters(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; + LDKChannelDerivationParameters ret_var = HTLCDescriptor_get_channel_derivation_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; } -jstring CS_LDK_NetworkGraph_to_str(int64_t o) { - LDKNetworkGraph o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = NetworkGraph_to_str(&o_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); +void CS_LDK_HTLCDescriptor_set_channel_derivation_parameters(int64_t this_ptr, int64_t 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; + LDKChannelDerivationParameters 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 = ChannelDerivationParameters_clone(&val_conv); + 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); + this_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 = HTLCDescriptor_get_per_commitment_number(&this_ptr_conv); return ret_conv; } -int64_t CS_LDK_NetworkGraph_new(int32_t network, int64_t logger) { - LDKNetwork network_conv = LDKNetwork_from_cs(network); - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKNetworkGraph ret_var = NetworkGraph_new(network_conv, logger_conv); +void CS_LDK_HTLCDescriptor_set_per_commitment_number(int64_t this_ptr, int64_t 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; + HTLCDescriptor_set_per_commitment_number(&this_ptr_conv, val); +} + +int8_tArray CS_LDK_HTLCDescriptor_get_per_commitment_point(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(33, __LINE__); + memcpy(ret_arr->elems, HTLCDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form, 33); + return ret_arr; +} + +void CS_LDK_HTLCDescriptor_set_per_commitment_point(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; + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + HTLCDescriptor_set_per_commitment_point(&this_ptr_conv, val_ref); +} + +int32_t CS_LDK_HTLCDescriptor_get_feerate_per_kw(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; + int32_t ret_conv = HTLCDescriptor_get_feerate_per_kw(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_HTLCDescriptor_set_feerate_per_kw(int64_t this_ptr, int32_t 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; + HTLCDescriptor_set_feerate_per_kw(&this_ptr_conv, val); +} + +int64_t CS_LDK_HTLCDescriptor_get_htlc(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; + LDKHTLCOutputInCommitment ret_var = HTLCDescriptor_get_htlc(&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; } -int64_t CS_LDK_NetworkGraph_read_only(int64_t this_arg) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKReadOnlyNetworkGraph ret_var = NetworkGraph_read_only(&this_arg_conv); +void CS_LDK_HTLCDescriptor_set_htlc(int64_t this_ptr, int64_t 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; + LDKHTLCOutputInCommitment 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 = HTLCOutputInCommitment_clone(&val_conv); + HTLCDescriptor_set_htlc(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_HTLCDescriptor_get_preimage(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; + LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); + *ret_copy = HTLCDescriptor_get_preimage(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_HTLCDescriptor_set_preimage(int64_t this_ptr, int64_t 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; + 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)); + HTLCDescriptor_set_preimage(&this_ptr_conv, val_conv); +} + +int8_tArray CS_LDK_HTLCDescriptor_get_counterparty_sig(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(64, __LINE__); + memcpy(ret_arr->elems, HTLCDescriptor_get_counterparty_sig(&this_ptr_conv).compact_form, 64); + return ret_arr; +} + +void CS_LDK_HTLCDescriptor_set_counterparty_sig(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; + LDKECDSASignature val_ref; + CHECK(val->arr_len == 64); + memcpy(val_ref.compact_form, val->elems, 64); FREE(val); + 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; } -int64_t CS_LDK_NetworkGraph_get_last_rapid_gossip_sync_timestamp(int64_t this_arg) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); - *ret_copy = NetworkGraph_get_last_rapid_gossip_sync_timestamp(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +static inline uint64_t HTLCDescriptor_clone_ptr(LDKHTLCDescriptor *NONNULL_PTR arg) { + LDKHTLCDescriptor ret_var = HTLCDescriptor_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_HTLCDescriptor_clone_ptr(int64_t arg) { + LDKHTLCDescriptor 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 = HTLCDescriptor_clone_ptr(&arg_conv); + return ret_conv; +} -void CS_LDK_NetworkGraph_set_last_rapid_gossip_sync_timestamp(int64_t this_arg, int32_t last_rapid_gossip_sync_timestamp) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - NetworkGraph_set_last_rapid_gossip_sync_timestamp(&this_arg_conv, last_rapid_gossip_sync_timestamp); +int64_t CS_LDK_HTLCDescriptor_clone(int64_t orig) { + LDKHTLCDescriptor 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; + LDKHTLCDescriptor ret_var = HTLCDescriptor_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_NetworkGraph_update_node_from_announcement(int64_t this_arg, int64_t msg) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_update_node_from_announcement(&this_arg_conv, &msg_conv); - return tag_ptr(ret_conv, true); +jboolean CS_LDK_HTLCDescriptor_eq(int64_t a, int64_t b) { + LDKHTLCDescriptor a_conv; + 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; + LDKHTLCDescriptor 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 = HTLCDescriptor_eq(&a_conv, &b_conv); + return ret_conv; } -int64_t CS_LDK_NetworkGraph_update_node_from_unsigned_announcement(int64_t this_arg, int64_t msg) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKUnsignedNodeAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_update_node_from_unsigned_announcement(&this_arg_conv, &msg_conv); - return tag_ptr(ret_conv, true); +int8_tArray CS_LDK_HTLCDescriptor_write(int64_t obj) { + LDKHTLCDescriptor 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 = HTLCDescriptor_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_NetworkGraph_update_channel_from_announcement(int64_t this_arg, int64_t msg, int64_t utxo_lookup) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - void* utxo_lookup_ptr = untag_ptr(utxo_lookup); - CHECK_ACCESS(utxo_lookup_ptr); - LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr); - // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ - if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) { - // Manually implement clone for Java trait instances - if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some); - } - } - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_update_channel_from_announcement(&this_arg_conv, &msg_conv, utxo_lookup_conv); +int64_t CS_LDK_HTLCDescriptor_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_HTLCDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCDescriptorDecodeErrorZ), "LDKCResult_HTLCDescriptorDecodeErrorZ"); + *ret_conv = HTLCDescriptor_read(ser_ref); + FREE(ser); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_NetworkGraph_update_channel_from_announcement_no_lookup(int64_t this_arg, int64_t msg) { - LDKNetworkGraph this_arg_conv; +int64_t CS_LDK_HTLCDescriptor_outpoint(int64_t this_arg) { + LDKHTLCDescriptor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKChannelAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_update_channel_from_announcement_no_lookup(&this_arg_conv, &msg_conv); - return tag_ptr(ret_conv, true); + LDKOutPoint ret_var = HTLCDescriptor_outpoint(&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_NetworkGraph_update_channel_from_unsigned_announcement(int64_t this_arg, int64_t msg, int64_t utxo_lookup) { - LDKNetworkGraph this_arg_conv; +int64_t CS_LDK_HTLCDescriptor_previous_utxo(int64_t this_arg) { + LDKHTLCDescriptor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKUnsignedChannelAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - void* utxo_lookup_ptr = untag_ptr(utxo_lookup); - CHECK_ACCESS(utxo_lookup_ptr); - LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr); - // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ - if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) { - // Manually implement clone for Java trait instances - if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some); - } - } - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_update_channel_from_unsigned_announcement(&this_arg_conv, &msg_conv, utxo_lookup_conv); - return tag_ptr(ret_conv, true); + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = HTLCDescriptor_previous_utxo(&this_arg_conv); + return tag_ptr(ret_ref, true); } -int64_t CS_LDK_NetworkGraph_add_channel_from_partial_announcement(int64_t this_arg, int64_t short_channel_id, int64_t timestamp, int64_t features, int8_tArray node_id_1, int8_tArray node_id_2) { - LDKNetworkGraph this_arg_conv; +int64_t CS_LDK_HTLCDescriptor_unsigned_tx_input(int64_t this_arg) { + LDKHTLCDescriptor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKChannelFeatures features_conv; - features_conv.inner = untag_ptr(features); - features_conv.is_owned = ptr_is_owned(features); - CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); - features_conv = ChannelFeatures_clone(&features_conv); - LDKPublicKey node_id_1_ref; - CHECK(node_id_1->arr_len == 33); - memcpy(node_id_1_ref.compressed_form, node_id_1->elems, 33); FREE(node_id_1); - LDKPublicKey node_id_2_ref; - CHECK(node_id_2->arr_len == 33); - memcpy(node_id_2_ref.compressed_form, node_id_2->elems, 33); FREE(node_id_2); - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_add_channel_from_partial_announcement(&this_arg_conv, short_channel_id, timestamp, features_conv, node_id_1_ref, node_id_2_ref); - return tag_ptr(ret_conv, true); + LDKTxIn* ret_ref = MALLOC(sizeof(LDKTxIn), "LDKTxIn"); + *ret_ref = HTLCDescriptor_unsigned_tx_input(&this_arg_conv); + return tag_ptr(ret_ref, true); } -void CS_LDK_NetworkGraph_channel_failed_permanent(int64_t this_arg, int64_t short_channel_id) { - LDKNetworkGraph this_arg_conv; +int64_t CS_LDK_HTLCDescriptor_tx_output(int64_t this_arg) { + LDKHTLCDescriptor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NetworkGraph_channel_failed_permanent(&this_arg_conv, short_channel_id); + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = HTLCDescriptor_tx_output(&this_arg_conv); + return tag_ptr(ret_ref, true); } -void CS_LDK_NetworkGraph_node_failed_permanent(int64_t this_arg, int8_tArray node_id) { - LDKNetworkGraph this_arg_conv; +int8_tArray CS_LDK_HTLCDescriptor_witness_script(int64_t this_arg) { + LDKHTLCDescriptor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - NetworkGraph_node_failed_permanent(&this_arg_conv, node_id_ref); + LDKCVec_u8Z ret_var = HTLCDescriptor_witness_script(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -void CS_LDK_NetworkGraph_remove_stale_channels_and_tracking(int64_t this_arg) { - LDKNetworkGraph this_arg_conv; +int8_tArray CS_LDK_HTLCDescriptor_tx_input_witness(int64_t this_arg, int8_tArray signature, int8_tArray witness_script) { + LDKHTLCDescriptor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NetworkGraph_remove_stale_channels_and_tracking(&this_arg_conv); + LDKECDSASignature signature_ref; + CHECK(signature->arr_len == 64); + memcpy(signature_ref.compact_form, signature->elems, 64); FREE(signature); + LDKu8slice witness_script_ref; + witness_script_ref.datalen = witness_script->arr_len; + witness_script_ref.data = witness_script->elems; + LDKWitness ret_var = HTLCDescriptor_tx_input_witness(&this_arg_conv, signature_ref, witness_script_ref); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + Witness_free(ret_var); + FREE(witness_script); + return ret_arr; } -void CS_LDK_NetworkGraph_remove_stale_channels_and_tracking_with_time(int64_t this_arg, int64_t current_time_unix) { - LDKNetworkGraph this_arg_conv; +int64_t CS_LDK_HTLCDescriptor_derive_channel_signer(int64_t this_arg, int64_t signer_provider) { + LDKHTLCDescriptor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NetworkGraph_remove_stale_channels_and_tracking_with_time(&this_arg_conv, current_time_unix); + void* signer_provider_ptr = untag_ptr(signer_provider); + if (ptr_is_owned(signer_provider)) { CHECK_ACCESS(signer_provider_ptr); } + LDKSignerProvider* signer_provider_conv = (LDKSignerProvider*)signer_provider_ptr; + LDKEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner"); + *ret_ret = HTLCDescriptor_derive_channel_signer(&this_arg_conv, signer_provider_conv); + return tag_ptr(ret_ret, true); } -int64_t CS_LDK_NetworkGraph_update_channel(int64_t this_arg, int64_t msg) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelUpdate msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_update_channel(&this_arg_conv, &msg_conv); - return tag_ptr(ret_conv, true); +void CS_LDK_ChannelSigner_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); + LDKChannelSigner this_ptr_conv = *(LDKChannelSigner*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + ChannelSigner_free(this_ptr_conv); } -int64_t CS_LDK_NetworkGraph_update_channel_unsigned(int64_t this_arg, int64_t msg) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKUnsignedChannelUpdate msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_update_channel_unsigned(&this_arg_conv, &msg_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_NetworkGraph_verify_channel_update(int64_t this_arg, int64_t msg) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelUpdate msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_verify_channel_update(&this_arg_conv, &msg_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_ReadOnlyNetworkGraph_channel(int64_t this_arg, int64_t short_channel_id) { - LDKReadOnlyNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelInfo ret_var = ReadOnlyNetworkGraph_channel(&this_arg_conv, short_channel_id); - int64_t ret_ref = 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_ReadOnlyNetworkGraph_list_channels(int64_t this_arg) { - LDKReadOnlyNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_u64Z ret_var = ReadOnlyNetworkGraph_list_channels(&this_arg_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t g = 0; g < ret_var.datalen; g++) { - int64_t ret_conv_6_conv = ret_var.data[g]; - ret_arr_ptr[g] = ret_conv_6_conv; - } - - FREE(ret_var.data); - return ret_arr; -} - -int64_t CS_LDK_ReadOnlyNetworkGraph_node(int64_t this_arg, int64_t node_id) { - LDKReadOnlyNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId node_id_conv; - node_id_conv.inner = untag_ptr(node_id); - node_id_conv.is_owned = ptr_is_owned(node_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); - node_id_conv.is_owned = false; - LDKNodeInfo ret_var = ReadOnlyNetworkGraph_node(&this_arg_conv, &node_id_conv); - int64_t ret_ref = 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_ReadOnlyNetworkGraph_list_nodes(int64_t this_arg) { - LDKReadOnlyNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_NodeIdZ ret_var = ReadOnlyNetworkGraph_list_nodes(&this_arg_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t i = 0; i < ret_var.datalen; i++) { - LDKNodeId ret_conv_8_var = ret_var.data[i]; - int64_t ret_conv_8_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_8_var); - ret_conv_8_ref = tag_ptr(ret_conv_8_var.inner, ret_conv_8_var.is_owned); - ret_arr_ptr[i] = ret_conv_8_ref; - } - - FREE(ret_var.data); - return ret_arr; -} - -int64_t CS_LDK_ReadOnlyNetworkGraph_get_addresses(int64_t this_arg, int8_tArray pubkey) { - LDKReadOnlyNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPublicKey pubkey_ref; - CHECK(pubkey->arr_len == 33); - memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); FREE(pubkey); - LDKCOption_CVec_SocketAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_SocketAddressZZ), "LDKCOption_CVec_SocketAddressZZ"); - *ret_copy = ReadOnlyNetworkGraph_get_addresses(&this_arg_conv, pubkey_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -void CS_LDK_DefaultRouter_free(int64_t this_obj) { - LDKDefaultRouter this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - DefaultRouter_free(this_obj_conv); -} - -int64_t CS_LDK_DefaultRouter_new(int64_t network_graph, int64_t logger, int64_t entropy_source, int64_t scorer, int64_t score_params) { - LDKNetworkGraph network_graph_conv; - network_graph_conv.inner = untag_ptr(network_graph); - network_graph_conv.is_owned = ptr_is_owned(network_graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - network_graph_conv.is_owned = false; - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - void* scorer_ptr = untag_ptr(scorer); - CHECK_ACCESS(scorer_ptr); - LDKLockableScore scorer_conv = *(LDKLockableScore*)(scorer_ptr); - if (scorer_conv.free == LDKLockableScore_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLockableScore_JCalls_cloned(&scorer_conv); - } - LDKProbabilisticScoringFeeParameters score_params_conv; - score_params_conv.inner = untag_ptr(score_params); - score_params_conv.is_owned = ptr_is_owned(score_params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(score_params_conv); - score_params_conv = ProbabilisticScoringFeeParameters_clone(&score_params_conv); - LDKDefaultRouter ret_var = DefaultRouter_new(&network_graph_conv, logger_conv, entropy_source_conv, scorer_conv, score_params_conv); - int64_t ret_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_Recipient_clone(int64_t orig) { + LDKRecipient* orig_conv = (LDKRecipient*)untag_ptr(orig); + int32_t ret_conv = LDKRecipient_to_cs(Recipient_clone(orig_conv)); + return ret_conv; } -int64_t CS_LDK_DefaultRouter_as_Router(int64_t this_arg) { - LDKDefaultRouter this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKRouter* ret_ret = MALLOC(sizeof(LDKRouter), "LDKRouter"); - *ret_ret = DefaultRouter_as_Router(&this_arg_conv); - return tag_ptr(ret_ret, true); +int32_t CS_LDK_Recipient_node() { + int32_t ret_conv = LDKRecipient_to_cs(Recipient_node()); + return ret_conv; } -int64_t CS_LDK_DefaultRouter_as_MessageRouter(int64_t this_arg) { - LDKDefaultRouter this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKMessageRouter* ret_ret = MALLOC(sizeof(LDKMessageRouter), "LDKMessageRouter"); - *ret_ret = DefaultRouter_as_MessageRouter(&this_arg_conv); - return tag_ptr(ret_ret, true); +int32_t CS_LDK_Recipient_phantom_node() { + int32_t ret_conv = LDKRecipient_to_cs(Recipient_phantom_node()); + return ret_conv; } -void CS_LDK_Router_free(int64_t this_ptr) { +void CS_LDK_EntropySource_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); - LDKRouter this_ptr_conv = *(LDKRouter*)(this_ptr_ptr); + LDKEntropySource this_ptr_conv = *(LDKEntropySource*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - Router_free(this_ptr_conv); -} - -void CS_LDK_ScorerAccountingForInFlightHtlcs_free(int64_t this_obj) { - LDKScorerAccountingForInFlightHtlcs this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ScorerAccountingForInFlightHtlcs_free(this_obj_conv); -} - -int64_t CS_LDK_ScorerAccountingForInFlightHtlcs_new(int64_t scorer, int64_t inflight_htlcs) { - void* scorer_ptr = untag_ptr(scorer); - CHECK_ACCESS(scorer_ptr); - LDKScoreLookUp scorer_conv = *(LDKScoreLookUp*)(scorer_ptr); - if (scorer_conv.free == LDKScoreLookUp_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKScoreLookUp_JCalls_cloned(&scorer_conv); - } - LDKInFlightHtlcs inflight_htlcs_conv; - inflight_htlcs_conv.inner = untag_ptr(inflight_htlcs); - inflight_htlcs_conv.is_owned = ptr_is_owned(inflight_htlcs); - CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_conv); - inflight_htlcs_conv.is_owned = false; - LDKScorerAccountingForInFlightHtlcs ret_var = ScorerAccountingForInFlightHtlcs_new(scorer_conv, &inflight_htlcs_conv); - int64_t ret_ref = 0; - 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_ScorerAccountingForInFlightHtlcs_as_ScoreLookUp(int64_t this_arg) { - LDKScorerAccountingForInFlightHtlcs this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKScoreLookUp* ret_ret = MALLOC(sizeof(LDKScoreLookUp), "LDKScoreLookUp"); - *ret_ret = ScorerAccountingForInFlightHtlcs_as_ScoreLookUp(&this_arg_conv); - return tag_ptr(ret_ret, true); -} - -void CS_LDK_InFlightHtlcs_free(int64_t this_obj) { - LDKInFlightHtlcs this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InFlightHtlcs_free(this_obj_conv); -} - -static inline uint64_t InFlightHtlcs_clone_ptr(LDKInFlightHtlcs *NONNULL_PTR arg) { - LDKInFlightHtlcs ret_var = InFlightHtlcs_clone(arg); - int64_t ret_ref = 0; - 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_InFlightHtlcs_clone_ptr(int64_t arg) { - LDKInFlightHtlcs arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = InFlightHtlcs_clone_ptr(&arg_conv); - return ret_conv; -} - -int64_t CS_LDK_InFlightHtlcs_clone(int64_t orig) { - LDKInFlightHtlcs orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKInFlightHtlcs ret_var = InFlightHtlcs_clone(&orig_conv); - int64_t ret_ref = 0; - 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_InFlightHtlcs_new() { - LDKInFlightHtlcs ret_var = InFlightHtlcs_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; -} - -void CS_LDK_InFlightHtlcs_process_path(int64_t this_arg, int64_t path, int8_tArray payer_node_id) { - LDKInFlightHtlcs this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPath path_conv; - path_conv.inner = untag_ptr(path); - path_conv.is_owned = ptr_is_owned(path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); - path_conv.is_owned = false; - LDKPublicKey payer_node_id_ref; - CHECK(payer_node_id->arr_len == 33); - memcpy(payer_node_id_ref.compressed_form, payer_node_id->elems, 33); FREE(payer_node_id); - InFlightHtlcs_process_path(&this_arg_conv, &path_conv, payer_node_id_ref); + EntropySource_free(this_ptr_conv); } -void CS_LDK_InFlightHtlcs_add_inflight_htlc(int64_t this_arg, int64_t source, int64_t target, int64_t channel_scid, int64_t used_msat) { - LDKInFlightHtlcs this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId source_conv; - source_conv.inner = untag_ptr(source); - source_conv.is_owned = ptr_is_owned(source); - CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv); - source_conv.is_owned = false; - LDKNodeId target_conv; - target_conv.inner = untag_ptr(target); - target_conv.is_owned = ptr_is_owned(target); - CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); - target_conv.is_owned = false; - InFlightHtlcs_add_inflight_htlc(&this_arg_conv, &source_conv, &target_conv, channel_scid, used_msat); +void CS_LDK_NodeSigner_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); + LDKNodeSigner this_ptr_conv = *(LDKNodeSigner*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + NodeSigner_free(this_ptr_conv); } -int64_t CS_LDK_InFlightHtlcs_used_liquidity_msat(int64_t this_arg, int64_t source, int64_t target, int64_t channel_scid) { - LDKInFlightHtlcs this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId source_conv; - source_conv.inner = untag_ptr(source); - source_conv.is_owned = ptr_is_owned(source); - CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv); - source_conv.is_owned = false; - LDKNodeId target_conv; - target_conv.inner = untag_ptr(target); - target_conv.is_owned = ptr_is_owned(target); - CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); - target_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = InFlightHtlcs_used_liquidity_msat(&this_arg_conv, &source_conv, &target_conv, channel_scid); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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); } -int8_tArray CS_LDK_InFlightHtlcs_write(int64_t obj) { - LDKInFlightHtlcs obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = InFlightHtlcs_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +void CS_LDK_SignerProvider_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); + LDKSignerProvider this_ptr_conv = *(LDKSignerProvider*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + SignerProvider_free(this_ptr_conv); } -int64_t CS_LDK_InFlightHtlcs_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ"); - *ret_conv = InFlightHtlcs_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void 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_RouteHop_free(int64_t this_obj) { - LDKRouteHop this_obj_conv; +void CS_LDK_InMemorySigner_free(int64_t this_obj) { + LDKInMemorySigner this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - RouteHop_free(this_obj_conv); + InMemorySigner_free(this_obj_conv); } -int8_tArray CS_LDK_RouteHop_get_pubkey(int64_t this_ptr) { - LDKRouteHop this_ptr_conv; +int8_tArray CS_LDK_InMemorySigner_get_funding_key(int64_t this_ptr) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, RouteHop_get_pubkey(&this_ptr_conv).compressed_form, 33); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *InMemorySigner_get_funding_key(&this_ptr_conv), 32); return ret_arr; } -void CS_LDK_RouteHop_set_pubkey(int64_t this_ptr, int8_tArray val) { - LDKRouteHop this_ptr_conv; +void CS_LDK_InMemorySigner_set_funding_key(int64_t this_ptr, int8_tArray val) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - RouteHop_set_pubkey(&this_ptr_conv, val_ref); + LDKSecretKey val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.bytes, val->elems, 32); FREE(val); + InMemorySigner_set_funding_key(&this_ptr_conv, val_ref); } -int64_t CS_LDK_RouteHop_get_node_features(int64_t this_ptr) { - LDKRouteHop this_ptr_conv; +int8_tArray CS_LDK_InMemorySigner_get_revocation_base_key(int64_t this_ptr) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeFeatures ret_var = RouteHop_get_node_features(&this_ptr_conv); - int64_t ret_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 ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *InMemorySigner_get_revocation_base_key(&this_ptr_conv), 32); + return ret_arr; } -void CS_LDK_RouteHop_set_node_features(int64_t this_ptr, int64_t val) { - LDKRouteHop this_ptr_conv; +void CS_LDK_InMemorySigner_set_revocation_base_key(int64_t this_ptr, int8_tArray val) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeFeatures val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = NodeFeatures_clone(&val_conv); - RouteHop_set_node_features(&this_ptr_conv, val_conv); + LDKSecretKey val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.bytes, val->elems, 32); FREE(val); + InMemorySigner_set_revocation_base_key(&this_ptr_conv, val_ref); } -int64_t CS_LDK_RouteHop_get_short_channel_id(int64_t this_ptr) { - LDKRouteHop this_ptr_conv; +int8_tArray CS_LDK_InMemorySigner_get_payment_key(int64_t this_ptr) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = RouteHop_get_short_channel_id(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *InMemorySigner_get_payment_key(&this_ptr_conv), 32); + return ret_arr; } -void CS_LDK_RouteHop_set_short_channel_id(int64_t this_ptr, int64_t val) { - LDKRouteHop this_ptr_conv; +void CS_LDK_InMemorySigner_set_payment_key(int64_t this_ptr, int8_tArray val) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - RouteHop_set_short_channel_id(&this_ptr_conv, val); + LDKSecretKey val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.bytes, val->elems, 32); FREE(val); + InMemorySigner_set_payment_key(&this_ptr_conv, val_ref); } -int64_t CS_LDK_RouteHop_get_channel_features(int64_t this_ptr) { - LDKRouteHop this_ptr_conv; +int8_tArray CS_LDK_InMemorySigner_get_delayed_payment_base_key(int64_t this_ptr) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelFeatures ret_var = RouteHop_get_channel_features(&this_ptr_conv); - int64_t ret_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 ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *InMemorySigner_get_delayed_payment_base_key(&this_ptr_conv), 32); + return ret_arr; } -void CS_LDK_RouteHop_set_channel_features(int64_t this_ptr, int64_t val) { - LDKRouteHop this_ptr_conv; +void CS_LDK_InMemorySigner_set_delayed_payment_base_key(int64_t this_ptr, int8_tArray val) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelFeatures val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelFeatures_clone(&val_conv); - RouteHop_set_channel_features(&this_ptr_conv, val_conv); + LDKSecretKey val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.bytes, val->elems, 32); FREE(val); + InMemorySigner_set_delayed_payment_base_key(&this_ptr_conv, val_ref); } -int64_t CS_LDK_RouteHop_get_fee_msat(int64_t this_ptr) { - LDKRouteHop this_ptr_conv; +int8_tArray CS_LDK_InMemorySigner_get_htlc_base_key(int64_t this_ptr) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = RouteHop_get_fee_msat(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *InMemorySigner_get_htlc_base_key(&this_ptr_conv), 32); + return ret_arr; } -void CS_LDK_RouteHop_set_fee_msat(int64_t this_ptr, int64_t val) { - LDKRouteHop this_ptr_conv; +void CS_LDK_InMemorySigner_set_htlc_base_key(int64_t this_ptr, int8_tArray val) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - RouteHop_set_fee_msat(&this_ptr_conv, val); + LDKSecretKey val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.bytes, val->elems, 32); FREE(val); + InMemorySigner_set_htlc_base_key(&this_ptr_conv, val_ref); } -int32_t CS_LDK_RouteHop_get_cltv_expiry_delta(int64_t this_ptr) { - LDKRouteHop this_ptr_conv; +int8_tArray CS_LDK_InMemorySigner_get_commitment_seed(int64_t this_ptr) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int32_t ret_conv = RouteHop_get_cltv_expiry_delta(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *InMemorySigner_get_commitment_seed(&this_ptr_conv), 32); + return ret_arr; } -void CS_LDK_RouteHop_set_cltv_expiry_delta(int64_t this_ptr, int32_t val) { - LDKRouteHop this_ptr_conv; +void CS_LDK_InMemorySigner_set_commitment_seed(int64_t this_ptr, int8_tArray val) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - RouteHop_set_cltv_expiry_delta(&this_ptr_conv, val); + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + InMemorySigner_set_commitment_seed(&this_ptr_conv, val_ref); } -jboolean CS_LDK_RouteHop_get_maybe_announced_channel(int64_t this_ptr) { - LDKRouteHop this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - jboolean ret_conv = RouteHop_get_maybe_announced_channel(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_RouteHop_set_maybe_announced_channel(int64_t this_ptr, jboolean val) { - LDKRouteHop this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - RouteHop_set_maybe_announced_channel(&this_ptr_conv, val); -} - -int64_t CS_LDK_RouteHop_new(int8_tArray pubkey_arg, int64_t node_features_arg, int64_t short_channel_id_arg, int64_t channel_features_arg, int64_t fee_msat_arg, int32_t cltv_expiry_delta_arg, jboolean maybe_announced_channel_arg) { - LDKPublicKey pubkey_arg_ref; - CHECK(pubkey_arg->arr_len == 33); - memcpy(pubkey_arg_ref.compressed_form, pubkey_arg->elems, 33); FREE(pubkey_arg); - LDKNodeFeatures node_features_arg_conv; - node_features_arg_conv.inner = untag_ptr(node_features_arg); - node_features_arg_conv.is_owned = ptr_is_owned(node_features_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(node_features_arg_conv); - node_features_arg_conv = NodeFeatures_clone(&node_features_arg_conv); - LDKChannelFeatures channel_features_arg_conv; - channel_features_arg_conv.inner = untag_ptr(channel_features_arg); - channel_features_arg_conv.is_owned = ptr_is_owned(channel_features_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_features_arg_conv); - channel_features_arg_conv = ChannelFeatures_clone(&channel_features_arg_conv); - LDKRouteHop ret_var = RouteHop_new(pubkey_arg_ref, node_features_arg_conv, short_channel_id_arg, channel_features_arg_conv, fee_msat_arg, cltv_expiry_delta_arg, maybe_announced_channel_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 RouteHop_clone_ptr(LDKRouteHop *NONNULL_PTR arg) { - LDKRouteHop ret_var = RouteHop_clone(arg); +static inline uint64_t InMemorySigner_clone_ptr(LDKInMemorySigner *NONNULL_PTR arg) { + LDKInMemorySigner ret_var = InMemorySigner_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_RouteHop_clone_ptr(int64_t arg) { - LDKRouteHop arg_conv; +int64_t CS_LDK_InMemorySigner_clone_ptr(int64_t arg) { + LDKInMemorySigner arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = RouteHop_clone_ptr(&arg_conv); + int64_t ret_conv = InMemorySigner_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_RouteHop_clone(int64_t orig) { - LDKRouteHop orig_conv; +int64_t CS_LDK_InMemorySigner_clone(int64_t orig) { + LDKInMemorySigner orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKRouteHop ret_var = RouteHop_clone(&orig_conv); + LDKInMemorySigner ret_var = InMemorySigner_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_RouteHop_hash(int64_t o) { - LDKRouteHop o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = RouteHop_hash(&o_conv); - return ret_conv; -} - -jboolean CS_LDK_RouteHop_eq(int64_t a, int64_t b) { - LDKRouteHop a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKRouteHop b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = RouteHop_eq(&a_conv, &b_conv); - return ret_conv; -} - -int8_tArray CS_LDK_RouteHop_write(int64_t obj) { - LDKRouteHop obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = RouteHop_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -int64_t CS_LDK_RouteHop_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); - *ret_conv = RouteHop_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -void CS_LDK_BlindedTail_free(int64_t this_obj) { - LDKBlindedTail this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BlindedTail_free(this_obj_conv); -} - -int64_tArray CS_LDK_BlindedTail_get_hops(int64_t this_ptr) { - LDKBlindedTail this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_BlindedHopZ ret_var = BlindedTail_get_hops(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t m = 0; m < ret_var.datalen; m++) { - LDKBlindedHop ret_conv_12_var = ret_var.data[m]; - int64_t ret_conv_12_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_var); - ret_conv_12_ref = tag_ptr(ret_conv_12_var.inner, ret_conv_12_var.is_owned); - ret_arr_ptr[m] = ret_conv_12_ref; - } - - FREE(ret_var.data); - return ret_arr; -} - -void CS_LDK_BlindedTail_set_hops(int64_t this_ptr, int64_tArray val) { - LDKBlindedTail this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_BlindedHopZ val_constr; - val_constr.datalen = val->arr_len; - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKBlindedHop), "LDKCVec_BlindedHopZ Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = val->elems; - for (size_t m = 0; m < val_constr.datalen; m++) { - int64_t val_conv_12 = val_vals[m]; - LDKBlindedHop val_conv_12_conv; - val_conv_12_conv.inner = untag_ptr(val_conv_12); - val_conv_12_conv.is_owned = ptr_is_owned(val_conv_12); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_12_conv); - val_conv_12_conv = BlindedHop_clone(&val_conv_12_conv); - val_constr.data[m] = val_conv_12_conv; - } - FREE(val); - BlindedTail_set_hops(&this_ptr_conv, val_constr); -} - -int8_tArray CS_LDK_BlindedTail_get_blinding_point(int64_t this_ptr) { - LDKBlindedTail this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, BlindedTail_get_blinding_point(&this_ptr_conv).compressed_form, 33); - return ret_arr; -} - -void CS_LDK_BlindedTail_set_blinding_point(int64_t this_ptr, int8_tArray val) { - LDKBlindedTail this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - BlindedTail_set_blinding_point(&this_ptr_conv, val_ref); +int64_t CS_LDK_InMemorySigner_new(int8_tArray funding_key, int8_tArray revocation_base_key, int8_tArray payment_key, int8_tArray delayed_payment_base_key, int8_tArray htlc_base_key, int8_tArray commitment_seed, int64_t channel_value_satoshis, int8_tArray channel_keys_id, int8_tArray rand_bytes_unique_start) { + LDKSecretKey funding_key_ref; + CHECK(funding_key->arr_len == 32); + memcpy(funding_key_ref.bytes, funding_key->elems, 32); FREE(funding_key); + LDKSecretKey revocation_base_key_ref; + CHECK(revocation_base_key->arr_len == 32); + memcpy(revocation_base_key_ref.bytes, revocation_base_key->elems, 32); FREE(revocation_base_key); + LDKSecretKey payment_key_ref; + CHECK(payment_key->arr_len == 32); + memcpy(payment_key_ref.bytes, payment_key->elems, 32); FREE(payment_key); + LDKSecretKey delayed_payment_base_key_ref; + CHECK(delayed_payment_base_key->arr_len == 32); + memcpy(delayed_payment_base_key_ref.bytes, delayed_payment_base_key->elems, 32); FREE(delayed_payment_base_key); + LDKSecretKey htlc_base_key_ref; + CHECK(htlc_base_key->arr_len == 32); + memcpy(htlc_base_key_ref.bytes, htlc_base_key->elems, 32); FREE(htlc_base_key); + LDKThirtyTwoBytes commitment_seed_ref; + CHECK(commitment_seed->arr_len == 32); + memcpy(commitment_seed_ref.data, commitment_seed->elems, 32); FREE(commitment_seed); + LDKThirtyTwoBytes channel_keys_id_ref; + CHECK(channel_keys_id->arr_len == 32); + memcpy(channel_keys_id_ref.data, channel_keys_id->elems, 32); FREE(channel_keys_id); + LDKThirtyTwoBytes rand_bytes_unique_start_ref; + CHECK(rand_bytes_unique_start->arr_len == 32); + memcpy(rand_bytes_unique_start_ref.data, rand_bytes_unique_start->elems, 32); FREE(rand_bytes_unique_start); + LDKInMemorySigner ret_var = InMemorySigner_new(funding_key_ref, revocation_base_key_ref, payment_key_ref, delayed_payment_base_key_ref, htlc_base_key_ref, commitment_seed_ref, channel_value_satoshis, channel_keys_id_ref, rand_bytes_unique_start_ref); + int64_t ret_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_BlindedTail_get_excess_final_cltv_expiry_delta(int64_t this_ptr) { - LDKBlindedTail this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int32_t ret_conv = BlindedTail_get_excess_final_cltv_expiry_delta(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_InMemorySigner_counterparty_pubkeys(int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelPublicKeys ret_var = InMemorySigner_counterparty_pubkeys(&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_BlindedTail_set_excess_final_cltv_expiry_delta(int64_t this_ptr, int32_t val) { - LDKBlindedTail this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - BlindedTail_set_excess_final_cltv_expiry_delta(&this_ptr_conv, val); +int64_t CS_LDK_InMemorySigner_counterparty_selected_contest_delay(int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); + *ret_copy = InMemorySigner_counterparty_selected_contest_delay(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_BlindedTail_get_final_value_msat(int64_t this_ptr) { - LDKBlindedTail this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = BlindedTail_get_final_value_msat(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_InMemorySigner_holder_selected_contest_delay(int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); + *ret_copy = InMemorySigner_holder_selected_contest_delay(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_BlindedTail_set_final_value_msat(int64_t this_ptr, int64_t val) { - LDKBlindedTail this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - BlindedTail_set_final_value_msat(&this_ptr_conv, val); +int64_t CS_LDK_InMemorySigner_is_outbound(int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCOption_boolZ *ret_copy = MALLOC(sizeof(LDKCOption_boolZ), "LDKCOption_boolZ"); + *ret_copy = InMemorySigner_is_outbound(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_BlindedTail_new(int64_tArray hops_arg, int8_tArray blinding_point_arg, int32_t excess_final_cltv_expiry_delta_arg, int64_t final_value_msat_arg) { - LDKCVec_BlindedHopZ hops_arg_constr; - hops_arg_constr.datalen = hops_arg->arr_len; - if (hops_arg_constr.datalen > 0) - hops_arg_constr.data = MALLOC(hops_arg_constr.datalen * sizeof(LDKBlindedHop), "LDKCVec_BlindedHopZ Elements"); - else - hops_arg_constr.data = NULL; - int64_t* hops_arg_vals = hops_arg->elems; - for (size_t m = 0; m < hops_arg_constr.datalen; m++) { - int64_t hops_arg_conv_12 = hops_arg_vals[m]; - LDKBlindedHop hops_arg_conv_12_conv; - hops_arg_conv_12_conv.inner = untag_ptr(hops_arg_conv_12); - hops_arg_conv_12_conv.is_owned = ptr_is_owned(hops_arg_conv_12); - CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_arg_conv_12_conv); - hops_arg_conv_12_conv = BlindedHop_clone(&hops_arg_conv_12_conv); - hops_arg_constr.data[m] = hops_arg_conv_12_conv; - } - FREE(hops_arg); - LDKPublicKey blinding_point_arg_ref; - CHECK(blinding_point_arg->arr_len == 33); - memcpy(blinding_point_arg_ref.compressed_form, blinding_point_arg->elems, 33); FREE(blinding_point_arg); - LDKBlindedTail ret_var = BlindedTail_new(hops_arg_constr, blinding_point_arg_ref, excess_final_cltv_expiry_delta_arg, final_value_msat_arg); +int64_t CS_LDK_InMemorySigner_funding_outpoint(int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKOutPoint ret_var = InMemorySigner_funding_outpoint(&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; } -static inline uint64_t BlindedTail_clone_ptr(LDKBlindedTail *NONNULL_PTR arg) { - LDKBlindedTail ret_var = BlindedTail_clone(arg); +int64_t CS_LDK_InMemorySigner_get_channel_parameters(int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelTransactionParameters ret_var = InMemorySigner_get_channel_parameters(&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_BlindedTail_clone_ptr(int64_t arg) { - LDKBlindedTail arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = BlindedTail_clone_ptr(&arg_conv); - return ret_conv; -} -int64_t CS_LDK_BlindedTail_clone(int64_t orig) { - LDKBlindedTail orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKBlindedTail ret_var = BlindedTail_clone(&orig_conv); +int64_t CS_LDK_InMemorySigner_channel_type_features(int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelTypeFeatures ret_var = InMemorySigner_channel_type_features(&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_BlindedTail_hash(int64_t o) { - LDKBlindedTail o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = BlindedTail_hash(&o_conv); - return ret_conv; +int64_t CS_LDK_InMemorySigner_sign_counterparty_payment_input(int64_t this_arg, int8_tArray spend_tx, int64_t input_idx, int64_t descriptor) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKTransaction spend_tx_ref; + spend_tx_ref.datalen = spend_tx->arr_len; + spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); + memcpy(spend_tx_ref.data, spend_tx->elems, spend_tx_ref.datalen); FREE(spend_tx); + spend_tx_ref.data_is_owned = true; + LDKStaticPaymentOutputDescriptor descriptor_conv; + descriptor_conv.inner = untag_ptr(descriptor); + descriptor_conv.is_owned = ptr_is_owned(descriptor); + CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); + descriptor_conv.is_owned = false; + LDKCResult_WitnessNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_WitnessNoneZ), "LDKCResult_WitnessNoneZ"); + *ret_conv = InMemorySigner_sign_counterparty_payment_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_BlindedTail_eq(int64_t a, int64_t b) { - LDKBlindedTail a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKBlindedTail b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = BlindedTail_eq(&a_conv, &b_conv); - return ret_conv; +int64_t CS_LDK_InMemorySigner_sign_dynamic_p2wsh_input(int64_t this_arg, int8_tArray spend_tx, int64_t input_idx, int64_t descriptor) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKTransaction spend_tx_ref; + spend_tx_ref.datalen = spend_tx->arr_len; + spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); + memcpy(spend_tx_ref.data, spend_tx->elems, spend_tx_ref.datalen); FREE(spend_tx); + spend_tx_ref.data_is_owned = true; + LDKDelayedPaymentOutputDescriptor descriptor_conv; + descriptor_conv.inner = untag_ptr(descriptor); + descriptor_conv.is_owned = ptr_is_owned(descriptor); + CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); + descriptor_conv.is_owned = false; + LDKCResult_WitnessNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_WitnessNoneZ), "LDKCResult_WitnessNoneZ"); + *ret_conv = InMemorySigner_sign_dynamic_p2wsh_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); + return tag_ptr(ret_conv, true); } -int8_tArray CS_LDK_BlindedTail_write(int64_t obj) { - LDKBlindedTail obj_conv; +int64_t CS_LDK_InMemorySigner_as_EntropySource(int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource"); + *ret_ret = InMemorySigner_as_EntropySource(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +int64_t CS_LDK_InMemorySigner_as_ChannelSigner(int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelSigner* ret_ret = MALLOC(sizeof(LDKChannelSigner), "LDKChannelSigner"); + *ret_ret = InMemorySigner_as_ChannelSigner(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +int64_t CS_LDK_InMemorySigner_as_EcdsaChannelSigner(int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner"); + *ret_ret = InMemorySigner_as_EcdsaChannelSigner(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +int8_tArray CS_LDK_InMemorySigner_write(int64_t obj) { + LDKInMemorySigner 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 = BlindedTail_write(&obj_conv); + LDKCVec_u8Z ret_var = InMemorySigner_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_BlindedTail_read(int8_tArray ser) { +int64_t CS_LDK_InMemorySigner_read(int8_tArray ser, int64_t arg) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_BlindedTailDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedTailDecodeErrorZ), "LDKCResult_BlindedTailDecodeErrorZ"); - *ret_conv = BlindedTail_read(ser_ref); + void* arg_ptr = untag_ptr(arg); + CHECK_ACCESS(arg_ptr); + LDKEntropySource arg_conv = *(LDKEntropySource*)(arg_ptr); + if (arg_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&arg_conv); + } + LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); + *ret_conv = InMemorySigner_read(ser_ref, arg_conv); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_Path_free(int64_t this_obj) { - LDKPath this_obj_conv; +void CS_LDK_KeysManager_free(int64_t this_obj) { + LDKKeysManager this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Path_free(this_obj_conv); + KeysManager_free(this_obj_conv); } -int64_tArray CS_LDK_Path_get_hops(int64_t this_ptr) { - LDKPath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_RouteHopZ ret_var = Path_get_hops(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t k = 0; k < ret_var.datalen; k++) { - LDKRouteHop 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; - } - - FREE(ret_var.data); +int64_t CS_LDK_KeysManager_new(int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos) { + uint8_t seed_arr[32]; + CHECK(seed->arr_len == 32); + memcpy(seed_arr, seed->elems, 32); FREE(seed); + uint8_t (*seed_ref)[32] = &seed_arr; + LDKKeysManager ret_var = KeysManager_new(seed_ref, starting_time_secs, starting_time_nanos); + int64_t ret_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_KeysManager_get_node_secret_key(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; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, KeysManager_get_node_secret_key(&this_arg_conv).bytes, 32); return ret_arr; } -void CS_LDK_Path_set_hops(int64_t this_ptr, int64_tArray val) { - LDKPath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_RouteHopZ val_constr; - val_constr.datalen = val->arr_len; - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = val->elems; - for (size_t k = 0; k < val_constr.datalen; k++) { - int64_t val_conv_10 = val_vals[k]; - LDKRouteHop val_conv_10_conv; - val_conv_10_conv.inner = untag_ptr(val_conv_10); - val_conv_10_conv.is_owned = ptr_is_owned(val_conv_10); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_10_conv); - val_conv_10_conv = RouteHop_clone(&val_conv_10_conv); - val_constr.data[k] = val_conv_10_conv; - } - FREE(val); - Path_set_hops(&this_ptr_conv, val_constr); -} - -int64_t CS_LDK_Path_get_blinded_tail(int64_t this_ptr) { - LDKPath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKBlindedTail ret_var = Path_get_blinded_tail(&this_ptr_conv); +int64_t CS_LDK_KeysManager_derive_channel_keys(int64_t this_arg, int64_t channel_value_satoshis, int8_tArray params) { + LDKKeysManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + uint8_t params_arr[32]; + CHECK(params->arr_len == 32); + memcpy(params_arr, params->elems, 32); FREE(params); + uint8_t (*params_ref)[32] = ¶ms_arr; + LDKInMemorySigner ret_var = KeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_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; } -void CS_LDK_Path_set_blinded_tail(int64_t this_ptr, int64_t val) { - LDKPath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKBlindedTail val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = BlindedTail_clone(&val_conv); - Path_set_blinded_tail(&this_ptr_conv, val_conv); -} - -int64_t CS_LDK_Path_new(int64_tArray hops_arg, int64_t blinded_tail_arg) { - LDKCVec_RouteHopZ hops_arg_constr; - hops_arg_constr.datalen = hops_arg->arr_len; - if (hops_arg_constr.datalen > 0) - hops_arg_constr.data = MALLOC(hops_arg_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); +int64_t CS_LDK_KeysManager_sign_spendable_outputs_psbt(int64_t this_arg, int64_tArray descriptors, int8_tArray psbt) { + 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 - hops_arg_constr.data = NULL; - int64_t* hops_arg_vals = hops_arg->elems; - for (size_t k = 0; k < hops_arg_constr.datalen; k++) { - int64_t hops_arg_conv_10 = hops_arg_vals[k]; - LDKRouteHop hops_arg_conv_10_conv; - hops_arg_conv_10_conv.inner = untag_ptr(hops_arg_conv_10); - hops_arg_conv_10_conv.is_owned = ptr_is_owned(hops_arg_conv_10); - CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_arg_conv_10_conv); - hops_arg_conv_10_conv = RouteHop_clone(&hops_arg_conv_10_conv); - hops_arg_constr.data[k] = hops_arg_conv_10_conv; + 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(hops_arg); - LDKBlindedTail blinded_tail_arg_conv; - blinded_tail_arg_conv.inner = untag_ptr(blinded_tail_arg); - blinded_tail_arg_conv.is_owned = ptr_is_owned(blinded_tail_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_tail_arg_conv); - blinded_tail_arg_conv = BlindedTail_clone(&blinded_tail_arg_conv); - LDKPath ret_var = Path_new(hops_arg_constr, blinded_tail_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + FREE(descriptors); + LDKCVec_u8Z psbt_ref; + psbt_ref.datalen = psbt->arr_len; + psbt_ref.data = MALLOC(psbt_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(psbt_ref.data, psbt->elems, psbt_ref.datalen); FREE(psbt); + LDKCResult_CVec_u8ZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZNoneZ), "LDKCResult_CVec_u8ZNoneZ"); + *ret_conv = KeysManager_sign_spendable_outputs_psbt(&this_arg_conv, descriptors_constr, psbt_ref); + return tag_ptr(ret_conv, true); } -static inline uint64_t Path_clone_ptr(LDKPath *NONNULL_PTR arg) { - LDKPath ret_var = Path_clone(arg); +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; + 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_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; + 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_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; + LDKOutputSpender* ret_ret = MALLOC(sizeof(LDKOutputSpender), "LDKOutputSpender"); + *ret_ret = KeysManager_as_OutputSpender(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +int64_t CS_LDK_KeysManager_as_SignerProvider(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; + LDKSignerProvider* ret_ret = MALLOC(sizeof(LDKSignerProvider), "LDKSignerProvider"); + *ret_ret = KeysManager_as_SignerProvider(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +void CS_LDK_PhantomKeysManager_free(int64_t this_obj) { + LDKPhantomKeysManager this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + PhantomKeysManager_free(this_obj_conv); +} + +int64_t CS_LDK_PhantomKeysManager_as_EntropySource(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; + LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource"); + *ret_ret = PhantomKeysManager_as_EntropySource(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +int64_t CS_LDK_PhantomKeysManager_as_NodeSigner(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; + LDKNodeSigner* ret_ret = MALLOC(sizeof(LDKNodeSigner), "LDKNodeSigner"); + *ret_ret = PhantomKeysManager_as_NodeSigner(&this_arg_conv); + 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); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKSignerProvider* ret_ret = MALLOC(sizeof(LDKSignerProvider), "LDKSignerProvider"); + *ret_ret = PhantomKeysManager_as_SignerProvider(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +int64_t CS_LDK_PhantomKeysManager_new(int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos, int8_tArray cross_node_seed) { + uint8_t seed_arr[32]; + CHECK(seed->arr_len == 32); + memcpy(seed_arr, seed->elems, 32); FREE(seed); + uint8_t (*seed_ref)[32] = &seed_arr; + uint8_t cross_node_seed_arr[32]; + CHECK(cross_node_seed->arr_len == 32); + memcpy(cross_node_seed_arr, cross_node_seed->elems, 32); FREE(cross_node_seed); + uint8_t (*cross_node_seed_ref)[32] = &cross_node_seed_arr; + LDKPhantomKeysManager ret_var = PhantomKeysManager_new(seed_ref, starting_time_secs, starting_time_nanos, cross_node_seed_ref); int64_t ret_ref = 0; 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_Path_clone_ptr(int64_t arg) { - LDKPath arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = Path_clone_ptr(&arg_conv); - return ret_conv; -} -int64_t CS_LDK_Path_clone(int64_t orig) { - LDKPath orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKPath ret_var = Path_clone(&orig_conv); +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); + this_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 params_arr[32]; + CHECK(params->arr_len == 32); + memcpy(params_arr, params->elems, 32); FREE(params); + uint8_t (*params_ref)[32] = ¶ms_arr; + LDKInMemorySigner ret_var = PhantomKeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_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_Path_hash(int64_t o) { - LDKPath o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = Path_hash(&o_conv); - return ret_conv; -} - -jboolean CS_LDK_Path_eq(int64_t a, int64_t b) { - LDKPath a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKPath b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = Path_eq(&a_conv, &b_conv); - return ret_conv; -} - -int64_t CS_LDK_Path_fee_msat(int64_t this_arg) { - LDKPath this_arg_conv; +int8_tArray CS_LDK_PhantomKeysManager_get_node_secret_key(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; - int64_t ret_conv = Path_fee_msat(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, PhantomKeysManager_get_node_secret_key(&this_arg_conv).bytes, 32); + return ret_arr; } -int64_t CS_LDK_Path_final_value_msat(int64_t this_arg) { - LDKPath this_arg_conv; +int8_tArray CS_LDK_PhantomKeysManager_get_phantom_node_secret_key(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; - int64_t ret_conv = Path_final_value_msat(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, PhantomKeysManager_get_phantom_node_secret_key(&this_arg_conv).bytes, 32); + return ret_arr; } -int64_t CS_LDK_Path_final_cltv_expiry_delta(int64_t this_arg) { - LDKPath this_arg_conv; +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; - LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); - *ret_copy = Path_final_cltv_expiry_delta(&this_arg_conv); + LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource"); + *ret_ret = RandomBytes_as_EntropySource(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +static inline uint64_t EcdsaChannelSigner_clone_ptr(LDKEcdsaChannelSigner *NONNULL_PTR arg) { + LDKEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner"); + *ret_ret = EcdsaChannelSigner_clone(arg); + return tag_ptr(ret_ret, true); +} +int64_t CS_LDK_EcdsaChannelSigner_clone_ptr(int64_t arg) { + void* arg_ptr = untag_ptr(arg); + if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); } + LDKEcdsaChannelSigner* arg_conv = (LDKEcdsaChannelSigner*)arg_ptr; + int64_t ret_conv = EcdsaChannelSigner_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_EcdsaChannelSigner_clone(int64_t orig) { + void* orig_ptr = untag_ptr(orig); + if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); } + LDKEcdsaChannelSigner* orig_conv = (LDKEcdsaChannelSigner*)orig_ptr; + LDKEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner"); + *ret_ret = EcdsaChannelSigner_clone(orig_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); + CHECK_ACCESS(this_ptr_ptr); + LDKEcdsaChannelSigner this_ptr_conv = *(LDKEcdsaChannelSigner*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + EcdsaChannelSigner_free(this_ptr_conv); +} + +void CS_LDK_AsyncPaymentsMessageHandler_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); + LDKAsyncPaymentsMessageHandler this_ptr_conv = *(LDKAsyncPaymentsMessageHandler*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + AsyncPaymentsMessageHandler_free(this_ptr_conv); +} + +void CS_LDK_AsyncPaymentsMessage_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); + LDKAsyncPaymentsMessage this_ptr_conv = *(LDKAsyncPaymentsMessage*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + AsyncPaymentsMessage_free(this_ptr_conv); +} + +static inline uint64_t AsyncPaymentsMessage_clone_ptr(LDKAsyncPaymentsMessage *NONNULL_PTR arg) { + LDKAsyncPaymentsMessage *ret_copy = MALLOC(sizeof(LDKAsyncPaymentsMessage), "LDKAsyncPaymentsMessage"); + *ret_copy = AsyncPaymentsMessage_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } +int64_t CS_LDK_AsyncPaymentsMessage_clone_ptr(int64_t arg) { + LDKAsyncPaymentsMessage* arg_conv = (LDKAsyncPaymentsMessage*)untag_ptr(arg); + int64_t ret_conv = AsyncPaymentsMessage_clone_ptr(arg_conv); + return ret_conv; +} -void CS_LDK_Route_free(int64_t this_obj) { - LDKRoute this_obj_conv; +int64_t CS_LDK_AsyncPaymentsMessage_clone(int64_t orig) { + LDKAsyncPaymentsMessage* orig_conv = (LDKAsyncPaymentsMessage*)untag_ptr(orig); + LDKAsyncPaymentsMessage *ret_copy = MALLOC(sizeof(LDKAsyncPaymentsMessage), "LDKAsyncPaymentsMessage"); + *ret_copy = AsyncPaymentsMessage_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_AsyncPaymentsMessage_held_htlc_available(int64_t a) { + LDKHeldHtlcAvailable a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = HeldHtlcAvailable_clone(&a_conv); + LDKAsyncPaymentsMessage *ret_copy = MALLOC(sizeof(LDKAsyncPaymentsMessage), "LDKAsyncPaymentsMessage"); + *ret_copy = AsyncPaymentsMessage_held_htlc_available(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_AsyncPaymentsMessage_release_held_htlc(int64_t a) { + LDKReleaseHeldHtlc a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = ReleaseHeldHtlc_clone(&a_conv); + LDKAsyncPaymentsMessage *ret_copy = MALLOC(sizeof(LDKAsyncPaymentsMessage), "LDKAsyncPaymentsMessage"); + *ret_copy = AsyncPaymentsMessage_release_held_htlc(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_HeldHtlcAvailable_free(int64_t this_obj) { + LDKHeldHtlcAvailable this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Route_free(this_obj_conv); + HeldHtlcAvailable_free(this_obj_conv); } -int64_tArray CS_LDK_Route_get_paths(int64_t this_ptr) { - LDKRoute this_ptr_conv; +int8_tArray CS_LDK_HeldHtlcAvailable_get_payment_release_secret(int64_t this_ptr) { + LDKHeldHtlcAvailable this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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_PathZ ret_var = Route_get_paths(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t g = 0; g < ret_var.datalen; g++) { - LDKPath ret_conv_6_var = ret_var.data[g]; - int64_t ret_conv_6_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_6_var); - ret_conv_6_ref = tag_ptr(ret_conv_6_var.inner, ret_conv_6_var.is_owned); - ret_arr_ptr[g] = ret_conv_6_ref; - } - - FREE(ret_var.data); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *HeldHtlcAvailable_get_payment_release_secret(&this_ptr_conv), 32); return ret_arr; } -void CS_LDK_Route_set_paths(int64_t this_ptr, int64_tArray val) { - LDKRoute this_ptr_conv; +void CS_LDK_HeldHtlcAvailable_set_payment_release_secret(int64_t this_ptr, int8_tArray val) { + LDKHeldHtlcAvailable this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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_PathZ val_constr; - val_constr.datalen = val->arr_len; - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKPath), "LDKCVec_PathZ Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = val->elems; - for (size_t g = 0; g < val_constr.datalen; g++) { - int64_t val_conv_6 = val_vals[g]; - LDKPath val_conv_6_conv; - val_conv_6_conv.inner = untag_ptr(val_conv_6); - val_conv_6_conv.is_owned = ptr_is_owned(val_conv_6); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_6_conv); - val_conv_6_conv = Path_clone(&val_conv_6_conv); - val_constr.data[g] = val_conv_6_conv; - } - FREE(val); - Route_set_paths(&this_ptr_conv, val_constr); + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + HeldHtlcAvailable_set_payment_release_secret(&this_ptr_conv, val_ref); } -int64_t CS_LDK_Route_get_route_params(int64_t this_ptr) { - LDKRoute this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKRouteParameters ret_var = Route_get_route_params(&this_ptr_conv); +int64_t CS_LDK_HeldHtlcAvailable_new(int8_tArray payment_release_secret_arg) { + LDKThirtyTwoBytes payment_release_secret_arg_ref; + CHECK(payment_release_secret_arg->arr_len == 32); + memcpy(payment_release_secret_arg_ref.data, payment_release_secret_arg->elems, 32); FREE(payment_release_secret_arg); + LDKHeldHtlcAvailable ret_var = HeldHtlcAvailable_new(payment_release_secret_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; } -void CS_LDK_Route_set_route_params(int64_t this_ptr, int64_t val) { - LDKRoute this_ptr_conv; +static inline uint64_t HeldHtlcAvailable_clone_ptr(LDKHeldHtlcAvailable *NONNULL_PTR arg) { + LDKHeldHtlcAvailable ret_var = HeldHtlcAvailable_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_HeldHtlcAvailable_clone_ptr(int64_t arg) { + LDKHeldHtlcAvailable 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 = HeldHtlcAvailable_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_HeldHtlcAvailable_clone(int64_t orig) { + LDKHeldHtlcAvailable 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; + LDKHeldHtlcAvailable ret_var = HeldHtlcAvailable_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_ReleaseHeldHtlc_free(int64_t this_obj) { + LDKReleaseHeldHtlc this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ReleaseHeldHtlc_free(this_obj_conv); +} + +int8_tArray CS_LDK_ReleaseHeldHtlc_get_payment_release_secret(int64_t this_ptr) { + LDKReleaseHeldHtlc this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKRouteParameters 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 = RouteParameters_clone(&val_conv); - Route_set_route_params(&this_ptr_conv, val_conv); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *ReleaseHeldHtlc_get_payment_release_secret(&this_ptr_conv), 32); + return ret_arr; } -int64_t CS_LDK_Route_new(int64_tArray paths_arg, int64_t route_params_arg) { - LDKCVec_PathZ paths_arg_constr; - paths_arg_constr.datalen = paths_arg->arr_len; - if (paths_arg_constr.datalen > 0) - paths_arg_constr.data = MALLOC(paths_arg_constr.datalen * sizeof(LDKPath), "LDKCVec_PathZ Elements"); - else - paths_arg_constr.data = NULL; - int64_t* paths_arg_vals = paths_arg->elems; - for (size_t g = 0; g < paths_arg_constr.datalen; g++) { - int64_t paths_arg_conv_6 = paths_arg_vals[g]; - LDKPath paths_arg_conv_6_conv; - paths_arg_conv_6_conv.inner = untag_ptr(paths_arg_conv_6); - paths_arg_conv_6_conv.is_owned = ptr_is_owned(paths_arg_conv_6); - CHECK_INNER_FIELD_ACCESS_OR_NULL(paths_arg_conv_6_conv); - paths_arg_conv_6_conv = Path_clone(&paths_arg_conv_6_conv); - paths_arg_constr.data[g] = paths_arg_conv_6_conv; - } - FREE(paths_arg); - LDKRouteParameters route_params_arg_conv; - route_params_arg_conv.inner = untag_ptr(route_params_arg); - route_params_arg_conv.is_owned = ptr_is_owned(route_params_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_arg_conv); - route_params_arg_conv = RouteParameters_clone(&route_params_arg_conv); - LDKRoute ret_var = Route_new(paths_arg_constr, route_params_arg_conv); +void CS_LDK_ReleaseHeldHtlc_set_payment_release_secret(int64_t this_ptr, int8_tArray val) { + LDKReleaseHeldHtlc this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + ReleaseHeldHtlc_set_payment_release_secret(&this_ptr_conv, val_ref); +} + +int64_t CS_LDK_ReleaseHeldHtlc_new(int8_tArray payment_release_secret_arg) { + LDKThirtyTwoBytes payment_release_secret_arg_ref; + CHECK(payment_release_secret_arg->arr_len == 32); + memcpy(payment_release_secret_arg_ref.data, payment_release_secret_arg->elems, 32); FREE(payment_release_secret_arg); + LDKReleaseHeldHtlc ret_var = ReleaseHeldHtlc_new(payment_release_secret_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 Route_clone_ptr(LDKRoute *NONNULL_PTR arg) { - LDKRoute ret_var = Route_clone(arg); +static inline uint64_t ReleaseHeldHtlc_clone_ptr(LDKReleaseHeldHtlc *NONNULL_PTR arg) { + LDKReleaseHeldHtlc ret_var = ReleaseHeldHtlc_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_Route_clone_ptr(int64_t arg) { - LDKRoute arg_conv; +int64_t CS_LDK_ReleaseHeldHtlc_clone_ptr(int64_t arg) { + LDKReleaseHeldHtlc arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Route_clone_ptr(&arg_conv); + int64_t ret_conv = ReleaseHeldHtlc_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_Route_clone(int64_t orig) { - LDKRoute orig_conv; +int64_t CS_LDK_ReleaseHeldHtlc_clone(int64_t orig) { + LDKReleaseHeldHtlc orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKRoute ret_var = Route_clone(&orig_conv); + LDKReleaseHeldHtlc ret_var = ReleaseHeldHtlc_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_Route_hash(int64_t o) { - LDKRoute o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = Route_hash(&o_conv); - return ret_conv; +int64_t CS_LDK_ReleaseHeldHtlc_as_OnionMessageContents(int64_t this_arg) { + LDKReleaseHeldHtlc this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *ret_ret = ReleaseHeldHtlc_as_OnionMessageContents(&this_arg_conv); + return tag_ptr(ret_ret, true); } -jboolean CS_LDK_Route_eq(int64_t a, int64_t b) { - LDKRoute a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKRoute b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = Route_eq(&a_conv, &b_conv); - return ret_conv; -} - -int64_t CS_LDK_Route_get_total_fees(int64_t this_arg) { - LDKRoute this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = Route_get_total_fees(&this_arg_conv); - return ret_conv; -} - -int64_t CS_LDK_Route_get_total_amount(int64_t this_arg) { - LDKRoute this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = Route_get_total_amount(&this_arg_conv); - return ret_conv; -} - -jstring CS_LDK_Route_to_str(int64_t o) { - LDKRoute o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = Route_to_str(&o_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; -} - -int8_tArray CS_LDK_Route_write(int64_t obj) { - LDKRoute obj_conv; +int8_tArray CS_LDK_HeldHtlcAvailable_write(int64_t obj) { + LDKHeldHtlcAvailable obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = Route_write(&obj_conv); + LDKCVec_u8Z ret_var = HeldHtlcAvailable_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_Route_read(int8_tArray ser) { +int64_t CS_LDK_HeldHtlcAvailable_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); - *ret_conv = Route_read(ser_ref); + LDKCResult_HeldHtlcAvailableDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HeldHtlcAvailableDecodeErrorZ), "LDKCResult_HeldHtlcAvailableDecodeErrorZ"); + *ret_conv = HeldHtlcAvailable_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_RouteParameters_free(int64_t this_obj) { - LDKRouteParameters this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - RouteParameters_free(this_obj_conv); +int8_tArray CS_LDK_ReleaseHeldHtlc_write(int64_t obj) { + LDKReleaseHeldHtlc 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 = ReleaseHeldHtlc_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_RouteParameters_get_payment_params(int64_t this_ptr) { - LDKRouteParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPaymentParameters ret_var = RouteParameters_get_payment_params(&this_ptr_conv); - int64_t ret_ref = 0; - 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_ReleaseHeldHtlc_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReleaseHeldHtlcDecodeErrorZ), "LDKCResult_ReleaseHeldHtlcDecodeErrorZ"); + *ret_conv = ReleaseHeldHtlc_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -void CS_LDK_RouteParameters_set_payment_params(int64_t this_ptr, int64_t val) { - LDKRouteParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPaymentParameters val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = PaymentParameters_clone(&val_conv); - RouteParameters_set_payment_params(&this_ptr_conv, val_conv); +jboolean CS_LDK_AsyncPaymentsMessage_is_known_type(int64_t tlv_type) { + jboolean ret_conv = AsyncPaymentsMessage_is_known_type(tlv_type); + return ret_conv; } -int64_t CS_LDK_RouteParameters_get_final_value_msat(int64_t this_ptr) { - LDKRouteParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = RouteParameters_get_final_value_msat(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_AsyncPaymentsMessage_as_OnionMessageContents(int64_t this_arg) { + LDKAsyncPaymentsMessage* this_arg_conv = (LDKAsyncPaymentsMessage*)untag_ptr(this_arg); + LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *ret_ret = AsyncPaymentsMessage_as_OnionMessageContents(this_arg_conv); + return tag_ptr(ret_ret, true); } -void CS_LDK_RouteParameters_set_final_value_msat(int64_t this_ptr, int64_t val) { - LDKRouteParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - RouteParameters_set_final_value_msat(&this_ptr_conv, val); +int8_tArray CS_LDK_AsyncPaymentsMessage_write(int64_t obj) { + LDKAsyncPaymentsMessage* obj_conv = (LDKAsyncPaymentsMessage*)untag_ptr(obj); + LDKCVec_u8Z ret_var = AsyncPaymentsMessage_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_RouteParameters_get_max_total_routing_fee_msat(int64_t this_ptr) { - LDKRouteParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = RouteParameters_get_max_total_routing_fee_msat(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_AsyncPaymentsMessage_read(int8_tArray ser, int64_t arg) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AsyncPaymentsMessageDecodeErrorZ), "LDKCResult_AsyncPaymentsMessageDecodeErrorZ"); + *ret_conv = AsyncPaymentsMessage_read(ser_ref, arg); + FREE(ser); + return tag_ptr(ret_conv, true); } -void CS_LDK_RouteParameters_set_max_total_routing_fee_msat(int64_t this_ptr, int64_t val) { - LDKRouteParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - 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)); - RouteParameters_set_max_total_routing_fee_msat(&this_ptr_conv, val_conv); +void CS_LDK_OnionMessenger_free(int64_t this_obj) { + LDKOnionMessenger this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OnionMessenger_free(this_obj_conv); } -int64_t CS_LDK_RouteParameters_new(int64_t payment_params_arg, int64_t final_value_msat_arg, int64_t max_total_routing_fee_msat_arg) { - LDKPaymentParameters payment_params_arg_conv; - payment_params_arg_conv.inner = untag_ptr(payment_params_arg); - payment_params_arg_conv.is_owned = ptr_is_owned(payment_params_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_params_arg_conv); - payment_params_arg_conv = PaymentParameters_clone(&payment_params_arg_conv); - void* max_total_routing_fee_msat_arg_ptr = untag_ptr(max_total_routing_fee_msat_arg); - CHECK_ACCESS(max_total_routing_fee_msat_arg_ptr); - LDKCOption_u64Z max_total_routing_fee_msat_arg_conv = *(LDKCOption_u64Z*)(max_total_routing_fee_msat_arg_ptr); - max_total_routing_fee_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(max_total_routing_fee_msat_arg)); - LDKRouteParameters ret_var = RouteParameters_new(payment_params_arg_conv, final_value_msat_arg, max_total_routing_fee_msat_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_Responder_free(int64_t this_obj) { + LDKResponder this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Responder_free(this_obj_conv); } -static inline uint64_t RouteParameters_clone_ptr(LDKRouteParameters *NONNULL_PTR arg) { - LDKRouteParameters ret_var = RouteParameters_clone(arg); +static inline uint64_t Responder_clone_ptr(LDKResponder *NONNULL_PTR arg) { + LDKResponder ret_var = Responder_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_RouteParameters_clone_ptr(int64_t arg) { - LDKRouteParameters arg_conv; +int64_t CS_LDK_Responder_clone_ptr(int64_t arg) { + LDKResponder arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = RouteParameters_clone_ptr(&arg_conv); + int64_t ret_conv = Responder_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_RouteParameters_clone(int64_t orig) { - LDKRouteParameters orig_conv; +int64_t CS_LDK_Responder_clone(int64_t orig) { + LDKResponder orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKRouteParameters ret_var = RouteParameters_clone(&orig_conv); + LDKResponder ret_var = Responder_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_RouteParameters_hash(int64_t o) { - LDKRouteParameters o_conv; - 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 = RouteParameters_hash(&o_conv); - return ret_conv; -} - -jboolean CS_LDK_RouteParameters_eq(int64_t a, int64_t b) { - LDKRouteParameters a_conv; +jboolean CS_LDK_Responder_eq(int64_t a, int64_t b) { + LDKResponder a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKRouteParameters b_conv; + LDKResponder b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = RouteParameters_eq(&a_conv, &b_conv); + jboolean ret_conv = Responder_eq(&a_conv, &b_conv); return ret_conv; } -int64_t CS_LDK_RouteParameters_from_payment_params_and_value(int64_t payment_params, int64_t final_value_msat) { - LDKPaymentParameters payment_params_conv; - payment_params_conv.inner = untag_ptr(payment_params); - payment_params_conv.is_owned = ptr_is_owned(payment_params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_params_conv); - payment_params_conv = PaymentParameters_clone(&payment_params_conv); - LDKRouteParameters ret_var = RouteParameters_from_payment_params_and_value(payment_params_conv, final_value_msat); - int64_t ret_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_RouteParameters_write(int64_t obj) { - LDKRouteParameters obj_conv; +int8_tArray CS_LDK_Responder_write(int64_t obj) { + LDKResponder obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = RouteParameters_write(&obj_conv); + LDKCVec_u8Z ret_var = Responder_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_RouteParameters_read(int8_tArray ser) { +int64_t CS_LDK_Responder_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); - *ret_conv = RouteParameters_read(ser_ref); + LDKCResult_ResponderDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ResponderDecodeErrorZ), "LDKCResult_ResponderDecodeErrorZ"); + *ret_conv = Responder_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_PaymentParameters_free(int64_t this_obj) { - LDKPaymentParameters this_obj_conv; +int64_t CS_LDK_Responder_respond(int64_t this_arg) { + LDKResponder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = Responder_clone(&this_arg_conv); + LDKResponseInstruction ret_var = Responder_respond(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_Responder_respond_with_reply_path(int64_t this_arg, int64_t context) { + LDKResponder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = Responder_clone(&this_arg_conv); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKMessageContext context_conv = *(LDKMessageContext*)(context_ptr); + context_conv = MessageContext_clone((LDKMessageContext*)untag_ptr(context)); + LDKResponseInstruction ret_var = Responder_respond_with_reply_path(this_arg_conv, context_conv); + int64_t ret_ref = 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_ResponseInstruction_free(int64_t this_obj) { + LDKResponseInstruction this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PaymentParameters_free(this_obj_conv); + ResponseInstruction_free(this_obj_conv); } -int64_t CS_LDK_PaymentParameters_get_payee(int64_t this_ptr) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); - *ret_copy = PaymentParameters_get_payee(&this_ptr_conv); +static inline uint64_t ResponseInstruction_clone_ptr(LDKResponseInstruction *NONNULL_PTR arg) { + LDKResponseInstruction ret_var = ResponseInstruction_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_ResponseInstruction_clone_ptr(int64_t arg) { + LDKResponseInstruction 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 = ResponseInstruction_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_ResponseInstruction_clone(int64_t orig) { + LDKResponseInstruction 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; + LDKResponseInstruction ret_var = ResponseInstruction_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_MessageSendInstructions_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); + LDKMessageSendInstructions this_ptr_conv = *(LDKMessageSendInstructions*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + MessageSendInstructions_free(this_ptr_conv); +} + +static inline uint64_t MessageSendInstructions_clone_ptr(LDKMessageSendInstructions *NONNULL_PTR arg) { + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = MessageSendInstructions_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } +int64_t CS_LDK_MessageSendInstructions_clone_ptr(int64_t arg) { + LDKMessageSendInstructions* arg_conv = (LDKMessageSendInstructions*)untag_ptr(arg); + int64_t ret_conv = MessageSendInstructions_clone_ptr(arg_conv); + return ret_conv; +} -void CS_LDK_PaymentParameters_set_payee(int64_t this_ptr, int64_t val) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKPayee val_conv = *(LDKPayee*)(val_ptr); - val_conv = Payee_clone((LDKPayee*)untag_ptr(val)); - PaymentParameters_set_payee(&this_ptr_conv, val_conv); +int64_t CS_LDK_MessageSendInstructions_clone(int64_t orig) { + LDKMessageSendInstructions* orig_conv = (LDKMessageSendInstructions*)untag_ptr(orig); + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = MessageSendInstructions_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_PaymentParameters_get_expiry_time(int64_t this_ptr) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = PaymentParameters_get_expiry_time(&this_ptr_conv); +int64_t CS_LDK_MessageSendInstructions_with_specified_reply_path(int64_t destination, int64_t reply_path) { + void* destination_ptr = untag_ptr(destination); + CHECK_ACCESS(destination_ptr); + LDKDestination destination_conv = *(LDKDestination*)(destination_ptr); + destination_conv = Destination_clone((LDKDestination*)untag_ptr(destination)); + LDKBlindedMessagePath 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 = BlindedMessagePath_clone(&reply_path_conv); + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = MessageSendInstructions_with_specified_reply_path(destination_conv, reply_path_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void CS_LDK_PaymentParameters_set_expiry_time(int64_t this_ptr, int64_t val) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - PaymentParameters_set_expiry_time(&this_ptr_conv, val_conv); +int64_t CS_LDK_MessageSendInstructions_with_reply_path(int64_t destination, int64_t context) { + void* destination_ptr = untag_ptr(destination); + CHECK_ACCESS(destination_ptr); + LDKDestination destination_conv = *(LDKDestination*)(destination_ptr); + destination_conv = Destination_clone((LDKDestination*)untag_ptr(destination)); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKMessageContext context_conv = *(LDKMessageContext*)(context_ptr); + context_conv = MessageContext_clone((LDKMessageContext*)untag_ptr(context)); + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = MessageSendInstructions_with_reply_path(destination_conv, context_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int32_t CS_LDK_PaymentParameters_get_max_total_cltv_expiry_delta(int64_t this_ptr) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int32_t ret_conv = PaymentParameters_get_max_total_cltv_expiry_delta(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_MessageSendInstructions_without_reply_path(int64_t destination) { + void* destination_ptr = untag_ptr(destination); + CHECK_ACCESS(destination_ptr); + LDKDestination destination_conv = *(LDKDestination*)(destination_ptr); + destination_conv = Destination_clone((LDKDestination*)untag_ptr(destination)); + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = MessageSendInstructions_without_reply_path(destination_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_PaymentParameters_set_max_total_cltv_expiry_delta(int64_t this_ptr, int32_t val) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - PaymentParameters_set_max_total_cltv_expiry_delta(&this_ptr_conv, val); +int64_t CS_LDK_MessageSendInstructions_for_reply(int64_t instructions) { + LDKResponseInstruction instructions_conv; + instructions_conv.inner = untag_ptr(instructions); + instructions_conv.is_owned = ptr_is_owned(instructions); + CHECK_INNER_FIELD_ACCESS_OR_NULL(instructions_conv); + instructions_conv = ResponseInstruction_clone(&instructions_conv); + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = MessageSendInstructions_for_reply(instructions_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int8_t CS_LDK_PaymentParameters_get_max_path_count(int64_t this_ptr) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_t ret_conv = PaymentParameters_get_max_path_count(&this_ptr_conv); - return ret_conv; +void CS_LDK_MessageRouter_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); + LDKMessageRouter this_ptr_conv = *(LDKMessageRouter*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + MessageRouter_free(this_ptr_conv); } -void CS_LDK_PaymentParameters_set_max_path_count(int64_t this_ptr, int8_t val) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - PaymentParameters_set_max_path_count(&this_ptr_conv, val); +void CS_LDK_DefaultMessageRouter_free(int64_t this_obj) { + LDKDefaultMessageRouter this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + DefaultMessageRouter_free(this_obj_conv); } -int8_t CS_LDK_PaymentParameters_get_max_channel_saturation_power_of_half(int64_t this_ptr) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_t ret_conv = PaymentParameters_get_max_channel_saturation_power_of_half(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_DefaultMessageRouter_new(int64_t network_graph, int64_t entropy_source) { + LDKNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; + void* 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); + } + LDKDefaultMessageRouter ret_var = DefaultMessageRouter_new(&network_graph_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_PaymentParameters_set_max_channel_saturation_power_of_half(int64_t this_ptr, int8_t val) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - PaymentParameters_set_max_channel_saturation_power_of_half(&this_ptr_conv, val); +int64_t CS_LDK_DefaultMessageRouter_as_MessageRouter(int64_t this_arg) { + LDKDefaultMessageRouter this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKMessageRouter* ret_ret = MALLOC(sizeof(LDKMessageRouter), "LDKMessageRouter"); + *ret_ret = DefaultMessageRouter_as_MessageRouter(&this_arg_conv); + return tag_ptr(ret_ret, true); } -int64_tArray CS_LDK_PaymentParameters_get_previously_failed_channels(int64_t this_ptr) { - LDKPaymentParameters this_ptr_conv; +void CS_LDK_OnionMessagePath_free(int64_t this_obj) { + LDKOnionMessagePath this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OnionMessagePath_free(this_obj_conv); +} + +ptrArray CS_LDK_OnionMessagePath_get_intermediate_nodes(int64_t this_ptr) { + LDKOnionMessagePath this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u64Z ret_var = PaymentParameters_get_previously_failed_channels(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t g = 0; g < ret_var.datalen; g++) { - int64_t ret_conv_6_conv = ret_var.data[g]; - ret_arr_ptr[g] = ret_conv_6_conv; + LDKCVec_PublicKeyZ ret_var = OnionMessagePath_get_intermediate_nodes(&this_ptr_conv); + ptrArray ret_arr = NULL; + ret_arr = init_ptrArray(ret_var.datalen, __LINE__); + int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8); + for (size_t i = 0; i < ret_var.datalen; i++) { + int8_tArray ret_conv_8_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_conv_8_arr->elems, ret_var.data[i].compressed_form, 33); + ret_arr_ptr[i] = ret_conv_8_arr; } FREE(ret_var.data); return ret_arr; } -void CS_LDK_PaymentParameters_set_previously_failed_channels(int64_t this_ptr, int64_tArray val) { - LDKPaymentParameters this_ptr_conv; +void CS_LDK_OnionMessagePath_set_intermediate_nodes(int64_t this_ptr, ptrArray val) { + LDKOnionMessagePath this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u64Z val_constr; + LDKCVec_PublicKeyZ val_constr; val_constr.datalen = val->arr_len; if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); else val_constr.data = NULL; - int64_t* val_vals = val->elems; - for (size_t g = 0; g < val_constr.datalen; g++) { - int64_t val_conv_6 = val_vals[g]; - val_constr.data[g] = val_conv_6; + int8_tArray* val_vals = (void*) val->elems; + for (size_t i = 0; i < val_constr.datalen; i++) { + int8_tArray val_conv_8 = val_vals[i]; + LDKPublicKey val_conv_8_ref; + CHECK(val_conv_8->arr_len == 33); + memcpy(val_conv_8_ref.compressed_form, val_conv_8->elems, 33); FREE(val_conv_8); + val_constr.data[i] = val_conv_8_ref; } FREE(val); - PaymentParameters_set_previously_failed_channels(&this_ptr_conv, val_constr); + OnionMessagePath_set_intermediate_nodes(&this_ptr_conv, val_constr); } -int64_tArray CS_LDK_PaymentParameters_get_previously_failed_blinded_path_idxs(int64_t this_ptr) { - LDKPaymentParameters this_ptr_conv; +int64_t CS_LDK_OnionMessagePath_get_destination(int64_t this_ptr) { + LDKOnionMessagePath this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u64Z ret_var = PaymentParameters_get_previously_failed_blinded_path_idxs(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t g = 0; g < ret_var.datalen; g++) { - int64_t ret_conv_6_conv = ret_var.data[g]; - ret_arr_ptr[g] = ret_conv_6_conv; - } - - FREE(ret_var.data); - return ret_arr; + LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); + *ret_copy = OnionMessagePath_get_destination(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_PaymentParameters_set_previously_failed_blinded_path_idxs(int64_t this_ptr, int64_tArray val) { - LDKPaymentParameters this_ptr_conv; +void CS_LDK_OnionMessagePath_set_destination(int64_t this_ptr, int64_t val) { + LDKOnionMessagePath this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u64Z val_constr; - val_constr.datalen = val->arr_len; - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = val->elems; - for (size_t g = 0; g < val_constr.datalen; g++) { - int64_t val_conv_6 = val_vals[g]; - val_constr.data[g] = val_conv_6; - } - FREE(val); - PaymentParameters_set_previously_failed_blinded_path_idxs(&this_ptr_conv, val_constr); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKDestination val_conv = *(LDKDestination*)(val_ptr); + val_conv = Destination_clone((LDKDestination*)untag_ptr(val)); + OnionMessagePath_set_destination(&this_ptr_conv, val_conv); } -int64_t CS_LDK_PaymentParameters_new(int64_t payee_arg, int64_t expiry_time_arg, int32_t max_total_cltv_expiry_delta_arg, int8_t max_path_count_arg, int8_t max_channel_saturation_power_of_half_arg, int64_tArray previously_failed_channels_arg, int64_tArray previously_failed_blinded_path_idxs_arg) { - void* payee_arg_ptr = untag_ptr(payee_arg); - CHECK_ACCESS(payee_arg_ptr); - LDKPayee payee_arg_conv = *(LDKPayee*)(payee_arg_ptr); - payee_arg_conv = Payee_clone((LDKPayee*)untag_ptr(payee_arg)); - void* expiry_time_arg_ptr = untag_ptr(expiry_time_arg); - CHECK_ACCESS(expiry_time_arg_ptr); - LDKCOption_u64Z expiry_time_arg_conv = *(LDKCOption_u64Z*)(expiry_time_arg_ptr); - expiry_time_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(expiry_time_arg)); - LDKCVec_u64Z previously_failed_channels_arg_constr; - previously_failed_channels_arg_constr.datalen = previously_failed_channels_arg->arr_len; - if (previously_failed_channels_arg_constr.datalen > 0) - previously_failed_channels_arg_constr.data = MALLOC(previously_failed_channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); - else - previously_failed_channels_arg_constr.data = NULL; - int64_t* previously_failed_channels_arg_vals = previously_failed_channels_arg->elems; - for (size_t g = 0; g < previously_failed_channels_arg_constr.datalen; g++) { - int64_t previously_failed_channels_arg_conv_6 = previously_failed_channels_arg_vals[g]; - previously_failed_channels_arg_constr.data[g] = previously_failed_channels_arg_conv_6; - } - FREE(previously_failed_channels_arg); - LDKCVec_u64Z previously_failed_blinded_path_idxs_arg_constr; - previously_failed_blinded_path_idxs_arg_constr.datalen = previously_failed_blinded_path_idxs_arg->arr_len; - if (previously_failed_blinded_path_idxs_arg_constr.datalen > 0) - previously_failed_blinded_path_idxs_arg_constr.data = MALLOC(previously_failed_blinded_path_idxs_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); - else - previously_failed_blinded_path_idxs_arg_constr.data = NULL; - int64_t* previously_failed_blinded_path_idxs_arg_vals = previously_failed_blinded_path_idxs_arg->elems; - for (size_t g = 0; g < previously_failed_blinded_path_idxs_arg_constr.datalen; g++) { - int64_t previously_failed_blinded_path_idxs_arg_conv_6 = previously_failed_blinded_path_idxs_arg_vals[g]; - previously_failed_blinded_path_idxs_arg_constr.data[g] = previously_failed_blinded_path_idxs_arg_conv_6; +int64_t CS_LDK_OnionMessagePath_get_first_node_addresses(int64_t this_ptr) { + LDKOnionMessagePath this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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_SocketAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_SocketAddressZZ), "LDKCOption_CVec_SocketAddressZZ"); + *ret_copy = OnionMessagePath_get_first_node_addresses(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_OnionMessagePath_set_first_node_addresses(int64_t this_ptr, int64_t val) { + LDKOnionMessagePath this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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_SocketAddressZZ val_conv = *(LDKCOption_CVec_SocketAddressZZ*)(val_ptr); + val_conv = COption_CVec_SocketAddressZZ_clone((LDKCOption_CVec_SocketAddressZZ*)untag_ptr(val)); + OnionMessagePath_set_first_node_addresses(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_OnionMessagePath_new(ptrArray intermediate_nodes_arg, int64_t destination_arg, int64_t first_node_addresses_arg) { + LDKCVec_PublicKeyZ intermediate_nodes_arg_constr; + intermediate_nodes_arg_constr.datalen = intermediate_nodes_arg->arr_len; + if (intermediate_nodes_arg_constr.datalen > 0) + intermediate_nodes_arg_constr.data = MALLOC(intermediate_nodes_arg_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); + else + intermediate_nodes_arg_constr.data = NULL; + int8_tArray* intermediate_nodes_arg_vals = (void*) intermediate_nodes_arg->elems; + for (size_t i = 0; i < intermediate_nodes_arg_constr.datalen; i++) { + int8_tArray intermediate_nodes_arg_conv_8 = intermediate_nodes_arg_vals[i]; + LDKPublicKey intermediate_nodes_arg_conv_8_ref; + CHECK(intermediate_nodes_arg_conv_8->arr_len == 33); + memcpy(intermediate_nodes_arg_conv_8_ref.compressed_form, intermediate_nodes_arg_conv_8->elems, 33); FREE(intermediate_nodes_arg_conv_8); + intermediate_nodes_arg_constr.data[i] = intermediate_nodes_arg_conv_8_ref; } - FREE(previously_failed_blinded_path_idxs_arg); - LDKPaymentParameters ret_var = PaymentParameters_new(payee_arg_conv, expiry_time_arg_conv, max_total_cltv_expiry_delta_arg, max_path_count_arg, max_channel_saturation_power_of_half_arg, previously_failed_channels_arg_constr, previously_failed_blinded_path_idxs_arg_constr); + FREE(intermediate_nodes_arg); + void* destination_arg_ptr = untag_ptr(destination_arg); + CHECK_ACCESS(destination_arg_ptr); + LDKDestination destination_arg_conv = *(LDKDestination*)(destination_arg_ptr); + destination_arg_conv = Destination_clone((LDKDestination*)untag_ptr(destination_arg)); + void* first_node_addresses_arg_ptr = untag_ptr(first_node_addresses_arg); + CHECK_ACCESS(first_node_addresses_arg_ptr); + LDKCOption_CVec_SocketAddressZZ first_node_addresses_arg_conv = *(LDKCOption_CVec_SocketAddressZZ*)(first_node_addresses_arg_ptr); + first_node_addresses_arg_conv = COption_CVec_SocketAddressZZ_clone((LDKCOption_CVec_SocketAddressZZ*)untag_ptr(first_node_addresses_arg)); + LDKOnionMessagePath ret_var = OnionMessagePath_new(intermediate_nodes_arg_constr, destination_arg_conv, first_node_addresses_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 PaymentParameters_clone_ptr(LDKPaymentParameters *NONNULL_PTR arg) { - LDKPaymentParameters ret_var = PaymentParameters_clone(arg); +static inline uint64_t OnionMessagePath_clone_ptr(LDKOnionMessagePath *NONNULL_PTR arg) { + LDKOnionMessagePath ret_var = OnionMessagePath_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_PaymentParameters_clone_ptr(int64_t arg) { - LDKPaymentParameters arg_conv; +int64_t CS_LDK_OnionMessagePath_clone_ptr(int64_t arg) { + LDKOnionMessagePath arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = PaymentParameters_clone_ptr(&arg_conv); + int64_t ret_conv = OnionMessagePath_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_PaymentParameters_clone(int64_t orig) { - LDKPaymentParameters orig_conv; +int64_t CS_LDK_OnionMessagePath_clone(int64_t orig) { + LDKOnionMessagePath orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKPaymentParameters ret_var = PaymentParameters_clone(&orig_conv); + LDKOnionMessagePath ret_var = OnionMessagePath_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_PaymentParameters_hash(int64_t o) { - LDKPaymentParameters o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = PaymentParameters_hash(&o_conv); +int8_tArray CS_LDK_OnionMessagePath_first_node(int64_t this_arg) { + LDKOnionMessagePath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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, OnionMessagePath_first_node(&this_arg_conv).compressed_form, 33); + return ret_arr; +} + +void CS_LDK_Destination_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); + LDKDestination this_ptr_conv = *(LDKDestination*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Destination_free(this_ptr_conv); +} + +static inline uint64_t Destination_clone_ptr(LDKDestination *NONNULL_PTR arg) { + LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); + *ret_copy = Destination_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_Destination_clone_ptr(int64_t arg) { + LDKDestination* arg_conv = (LDKDestination*)untag_ptr(arg); + int64_t ret_conv = Destination_clone_ptr(arg_conv); return ret_conv; } -jboolean CS_LDK_PaymentParameters_eq(int64_t a, int64_t b) { - LDKPaymentParameters a_conv; +int64_t CS_LDK_Destination_clone(int64_t orig) { + LDKDestination* orig_conv = (LDKDestination*)untag_ptr(orig); + LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); + *ret_copy = Destination_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_Destination_node(int8_tArray a) { + LDKPublicKey a_ref; + CHECK(a->arr_len == 33); + memcpy(a_ref.compressed_form, a->elems, 33); FREE(a); + LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); + *ret_copy = Destination_node(a_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_Destination_blinded_path(int64_t a) { + LDKBlindedMessagePath a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKPaymentParameters b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = PaymentParameters_eq(&a_conv, &b_conv); + a_conv = BlindedMessagePath_clone(&a_conv); + LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); + *ret_copy = Destination_blinded_path(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + 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; } -int8_tArray CS_LDK_PaymentParameters_write(int64_t obj) { - LDKPaymentParameters obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = PaymentParameters_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +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; } -int64_t CS_LDK_PaymentParameters_read(int8_tArray ser, int32_t arg) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ"); - *ret_conv = PaymentParameters_read(ser_ref, arg); - FREE(ser); - return tag_ptr(ret_conv, true); +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); } -int64_t CS_LDK_PaymentParameters_from_node_id(int8_tArray payee_pubkey, int32_t final_cltv_expiry_delta) { - LDKPublicKey payee_pubkey_ref; - CHECK(payee_pubkey->arr_len == 33); - memcpy(payee_pubkey_ref.compressed_form, payee_pubkey->elems, 33); FREE(payee_pubkey); - LDKPaymentParameters ret_var = PaymentParameters_from_node_id(payee_pubkey_ref, final_cltv_expiry_delta); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +void CS_LDK_SendSuccess_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); + LDKSendSuccess this_ptr_conv = *(LDKSendSuccess*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + SendSuccess_free(this_ptr_conv); +} + +static inline uint64_t SendSuccess_clone_ptr(LDKSendSuccess *NONNULL_PTR arg) { + LDKSendSuccess *ret_copy = MALLOC(sizeof(LDKSendSuccess), "LDKSendSuccess"); + *ret_copy = SendSuccess_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } +int64_t CS_LDK_SendSuccess_clone_ptr(int64_t arg) { + LDKSendSuccess* arg_conv = (LDKSendSuccess*)untag_ptr(arg); + int64_t ret_conv = SendSuccess_clone_ptr(arg_conv); + return ret_conv; +} -int64_t CS_LDK_PaymentParameters_for_keysend(int8_tArray payee_pubkey, int32_t final_cltv_expiry_delta, jboolean allow_mpp) { - LDKPublicKey payee_pubkey_ref; - CHECK(payee_pubkey->arr_len == 33); - memcpy(payee_pubkey_ref.compressed_form, payee_pubkey->elems, 33); FREE(payee_pubkey); - LDKPaymentParameters ret_var = PaymentParameters_for_keysend(payee_pubkey_ref, final_cltv_expiry_delta, allow_mpp); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +int64_t CS_LDK_SendSuccess_clone(int64_t orig) { + LDKSendSuccess* orig_conv = (LDKSendSuccess*)untag_ptr(orig); + LDKSendSuccess *ret_copy = MALLOC(sizeof(LDKSendSuccess), "LDKSendSuccess"); + *ret_copy = SendSuccess_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_PaymentParameters_from_bolt12_invoice(int64_t invoice) { - LDKBolt12Invoice invoice_conv; - invoice_conv.inner = untag_ptr(invoice); - invoice_conv.is_owned = ptr_is_owned(invoice); - CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); - invoice_conv.is_owned = false; - LDKPaymentParameters ret_var = PaymentParameters_from_bolt12_invoice(&invoice_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +int64_t CS_LDK_SendSuccess_buffered() { + LDKSendSuccess *ret_copy = MALLOC(sizeof(LDKSendSuccess), "LDKSendSuccess"); + *ret_copy = SendSuccess_buffered(); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_PaymentParameters_blinded(int64_tArray blinded_route_hints) { - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ blinded_route_hints_constr; - blinded_route_hints_constr.datalen = blinded_route_hints->arr_len; - if (blinded_route_hints_constr.datalen > 0) - blinded_route_hints_constr.data = MALLOC(blinded_route_hints_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); - else - blinded_route_hints_constr.data = NULL; - int64_t* blinded_route_hints_vals = blinded_route_hints->elems; - for (size_t l = 0; l < blinded_route_hints_constr.datalen; l++) { - int64_t blinded_route_hints_conv_37 = blinded_route_hints_vals[l]; - void* blinded_route_hints_conv_37_ptr = untag_ptr(blinded_route_hints_conv_37); - CHECK_ACCESS(blinded_route_hints_conv_37_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ blinded_route_hints_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(blinded_route_hints_conv_37_ptr); - blinded_route_hints_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(blinded_route_hints_conv_37)); - blinded_route_hints_constr.data[l] = blinded_route_hints_conv_37_conv; - } - FREE(blinded_route_hints); - LDKPaymentParameters ret_var = PaymentParameters_blinded(blinded_route_hints_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); +int64_t CS_LDK_SendSuccess_buffered_awaiting_connection(int8_tArray a) { + LDKPublicKey a_ref; + CHECK(a->arr_len == 33); + memcpy(a_ref.compressed_form, a->elems, 33); FREE(a); + LDKSendSuccess *ret_copy = MALLOC(sizeof(LDKSendSuccess), "LDKSendSuccess"); + *ret_copy = SendSuccess_buffered_awaiting_connection(a_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void CS_LDK_Payee_free(int64_t this_ptr) { +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); + jboolean ret_conv = SendSuccess_eq(a_conv, b_conv); + return ret_conv; +} + +void CS_LDK_SendError_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); - LDKPayee this_ptr_conv = *(LDKPayee*)(this_ptr_ptr); + LDKSendError this_ptr_conv = *(LDKSendError*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - Payee_free(this_ptr_conv); + SendError_free(this_ptr_conv); } -static inline uint64_t Payee_clone_ptr(LDKPayee *NONNULL_PTR arg) { - LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); - *ret_copy = Payee_clone(arg); +static inline uint64_t SendError_clone_ptr(LDKSendError *NONNULL_PTR arg) { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Payee_clone_ptr(int64_t arg) { - LDKPayee* arg_conv = (LDKPayee*)untag_ptr(arg); - int64_t ret_conv = Payee_clone_ptr(arg_conv); +int64_t CS_LDK_SendError_clone_ptr(int64_t arg) { + LDKSendError* arg_conv = (LDKSendError*)untag_ptr(arg); + int64_t ret_conv = SendError_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_Payee_clone(int64_t orig) { - LDKPayee* orig_conv = (LDKPayee*)untag_ptr(orig); - LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); - *ret_copy = Payee_clone(orig_conv); +int64_t CS_LDK_SendError_clone(int64_t orig) { + LDKSendError* orig_conv = (LDKSendError*)untag_ptr(orig); + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_clone(orig_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Payee_blinded(int64_tArray route_hints, int64_t features) { - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ route_hints_constr; - route_hints_constr.datalen = route_hints->arr_len; - if (route_hints_constr.datalen > 0) - route_hints_constr.data = MALLOC(route_hints_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); - else - route_hints_constr.data = NULL; - int64_t* route_hints_vals = route_hints->elems; - for (size_t l = 0; l < route_hints_constr.datalen; l++) { - int64_t route_hints_conv_37 = route_hints_vals[l]; - void* route_hints_conv_37_ptr = untag_ptr(route_hints_conv_37); - CHECK_ACCESS(route_hints_conv_37_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ route_hints_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(route_hints_conv_37_ptr); - route_hints_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(route_hints_conv_37)); - route_hints_constr.data[l] = route_hints_conv_37_conv; - } - FREE(route_hints); - LDKBolt12InvoiceFeatures features_conv; - features_conv.inner = untag_ptr(features); - features_conv.is_owned = ptr_is_owned(features); - CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); - features_conv = Bolt12InvoiceFeatures_clone(&features_conv); - LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); - *ret_copy = Payee_blinded(route_hints_constr, features_conv); +int64_t CS_LDK_SendError_secp256k1(int32_t a) { + LDKSecp256k1Error a_conv = LDKSecp256k1Error_from_cs(a); + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_secp256k1(a_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Payee_clear(int8_tArray node_id, int64_tArray route_hints, int64_t features, int32_t final_cltv_expiry_delta) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKCVec_RouteHintZ route_hints_constr; - route_hints_constr.datalen = route_hints->arr_len; - if (route_hints_constr.datalen > 0) - route_hints_constr.data = MALLOC(route_hints_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements"); - else - route_hints_constr.data = NULL; - int64_t* route_hints_vals = route_hints->elems; - for (size_t l = 0; l < route_hints_constr.datalen; l++) { - int64_t route_hints_conv_11 = route_hints_vals[l]; - LDKRouteHint route_hints_conv_11_conv; - route_hints_conv_11_conv.inner = untag_ptr(route_hints_conv_11); - route_hints_conv_11_conv.is_owned = ptr_is_owned(route_hints_conv_11); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_hints_conv_11_conv); - route_hints_conv_11_conv = RouteHint_clone(&route_hints_conv_11_conv); - route_hints_constr.data[l] = route_hints_conv_11_conv; - } - FREE(route_hints); - LDKBolt11InvoiceFeatures features_conv; - features_conv.inner = untag_ptr(features); - features_conv.is_owned = ptr_is_owned(features); - CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); - features_conv = Bolt11InvoiceFeatures_clone(&features_conv); - LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); - *ret_copy = Payee_clear(node_id_ref, route_hints_constr, features_conv, final_cltv_expiry_delta); +int64_t CS_LDK_SendError_too_big_packet() { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_too_big_packet(); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Payee_hash(int64_t o) { - LDKPayee* o_conv = (LDKPayee*)untag_ptr(o); - int64_t ret_conv = Payee_hash(o_conv); - return ret_conv; +int64_t CS_LDK_SendError_too_few_blinded_hops() { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_too_few_blinded_hops(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_Payee_eq(int64_t a, int64_t b) { - LDKPayee* a_conv = (LDKPayee*)untag_ptr(a); - LDKPayee* b_conv = (LDKPayee*)untag_ptr(b); - jboolean ret_conv = Payee_eq(a_conv, b_conv); - return ret_conv; +int64_t CS_LDK_SendError_invalid_first_hop(int8_tArray a) { + LDKPublicKey a_ref; + CHECK(a->arr_len == 33); + memcpy(a_ref.compressed_form, a->elems, 33); FREE(a); + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_invalid_first_hop(a_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_RouteHint_free(int64_t this_obj) { - LDKRouteHint this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - RouteHint_free(this_obj_conv); +int64_t CS_LDK_SendError_path_not_found() { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_path_not_found(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_tArray CS_LDK_RouteHint_get_a(int64_t this_ptr) { - LDKRouteHint this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_RouteHintHopZ ret_var = RouteHint_get_a(&this_ptr_conv); - 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 o = 0; o < ret_var.datalen; o++) { - LDKRouteHintHop ret_conv_14_var = ret_var.data[o]; - int64_t ret_conv_14_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var); - ret_conv_14_ref = tag_ptr(ret_conv_14_var.inner, ret_conv_14_var.is_owned); - ret_arr_ptr[o] = ret_conv_14_ref; - } - - FREE(ret_var.data); - return ret_arr; +int64_t CS_LDK_SendError_invalid_message() { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_invalid_message(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_RouteHint_set_a(int64_t this_ptr, int64_tArray val) { - LDKRouteHint this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_RouteHintHopZ val_constr; - val_constr.datalen = val->arr_len; - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = val->elems; - for (size_t o = 0; o < val_constr.datalen; o++) { - int64_t val_conv_14 = val_vals[o]; - LDKRouteHintHop val_conv_14_conv; - val_conv_14_conv.inner = untag_ptr(val_conv_14); - val_conv_14_conv.is_owned = ptr_is_owned(val_conv_14); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_14_conv); - val_conv_14_conv = RouteHintHop_clone(&val_conv_14_conv); - val_constr.data[o] = val_conv_14_conv; - } - FREE(val); - RouteHint_set_a(&this_ptr_conv, val_constr); +int64_t CS_LDK_SendError_buffer_full() { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_buffer_full(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_RouteHint_new(int64_tArray a_arg) { - LDKCVec_RouteHintHopZ a_arg_constr; - a_arg_constr.datalen = a_arg->arr_len; - if (a_arg_constr.datalen > 0) - a_arg_constr.data = MALLOC(a_arg_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements"); - else - a_arg_constr.data = NULL; - int64_t* a_arg_vals = a_arg->elems; - for (size_t o = 0; o < a_arg_constr.datalen; o++) { - int64_t a_arg_conv_14 = a_arg_vals[o]; - LDKRouteHintHop a_arg_conv_14_conv; - a_arg_conv_14_conv.inner = untag_ptr(a_arg_conv_14); - a_arg_conv_14_conv.is_owned = ptr_is_owned(a_arg_conv_14); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_arg_conv_14_conv); - a_arg_conv_14_conv = RouteHintHop_clone(&a_arg_conv_14_conv); - a_arg_constr.data[o] = a_arg_conv_14_conv; - } - FREE(a_arg); - LDKRouteHint ret_var = RouteHint_new(a_arg_constr); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +int64_t CS_LDK_SendError_get_node_id_failed() { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_get_node_id_failed(); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline uint64_t RouteHint_clone_ptr(LDKRouteHint *NONNULL_PTR arg) { - LDKRouteHint ret_var = RouteHint_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); +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_RouteHint_clone_ptr(int64_t arg) { - LDKRouteHint arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = RouteHint_clone_ptr(&arg_conv); - return ret_conv; -} -int64_t CS_LDK_RouteHint_clone(int64_t orig) { - LDKRouteHint orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKRouteHint ret_var = RouteHint_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); +int64_t CS_LDK_SendError_blinded_path_advance_failed() { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_blinded_path_advance_failed(); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_RouteHint_hash(int64_t o) { - LDKRouteHint o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = RouteHint_hash(&o_conv); +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_RouteHint_eq(int64_t a, int64_t b) { - LDKRouteHint a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKRouteHint b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = RouteHint_eq(&a_conv, &b_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); + jboolean ret_conv = SendError_eq(a_conv, b_conv); return ret_conv; } -int8_tArray CS_LDK_RouteHint_write(int64_t obj) { - LDKRouteHint obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = RouteHint_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); +void CS_LDK_CustomOnionMessageHandler_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); + LDKCustomOnionMessageHandler this_ptr_conv = *(LDKCustomOnionMessageHandler*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + CustomOnionMessageHandler_free(this_ptr_conv); +} + +void CS_LDK_PeeledOnion_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); + LDKPeeledOnion this_ptr_conv = *(LDKPeeledOnion*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + PeeledOnion_free(this_ptr_conv); +} + +static inline uint64_t PeeledOnion_clone_ptr(LDKPeeledOnion *NONNULL_PTR arg) { + LDKPeeledOnion *ret_copy = MALLOC(sizeof(LDKPeeledOnion), "LDKPeeledOnion"); + *ret_copy = PeeledOnion_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_PeeledOnion_clone_ptr(int64_t arg) { + LDKPeeledOnion* arg_conv = (LDKPeeledOnion*)untag_ptr(arg); + int64_t ret_conv = PeeledOnion_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_PeeledOnion_clone(int64_t orig) { + LDKPeeledOnion* orig_conv = (LDKPeeledOnion*)untag_ptr(orig); + LDKPeeledOnion *ret_copy = MALLOC(sizeof(LDKPeeledOnion), "LDKPeeledOnion"); + *ret_copy = PeeledOnion_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +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_conv, b_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_PeeledOnion_receive(int64_t a, int64_t b, int64_t c) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKParsedOnionMessageContents a_conv = *(LDKParsedOnionMessageContents*)(a_ptr); + a_conv = ParsedOnionMessageContents_clone((LDKParsedOnionMessageContents*)untag_ptr(a)); + void* b_ptr = untag_ptr(b); + CHECK_ACCESS(b_ptr); + LDKCOption_MessageContextZ b_conv = *(LDKCOption_MessageContextZ*)(b_ptr); + b_conv = COption_MessageContextZ_clone((LDKCOption_MessageContextZ*)untag_ptr(b)); + LDKBlindedMessagePath 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 = BlindedMessagePath_clone(&c_conv); + LDKPeeledOnion *ret_copy = MALLOC(sizeof(LDKPeeledOnion), "LDKPeeledOnion"); + *ret_copy = PeeledOnion_receive(a_conv, b_conv, c_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +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); + } + LDKBlindedMessagePath 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 = BlindedMessagePath_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); + 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); + } + LDKBlindedMessagePath 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 = BlindedMessagePath_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, node_id_lookup_conv, path_conv, contents_conv, reply_path_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_peel_onion_message(int64_t msg, int64_t node_signer, int64_t logger, int64_t custom_handler) { + LDKOnionMessage msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + void* custom_handler_ptr = untag_ptr(custom_handler); + CHECK_ACCESS(custom_handler_ptr); + LDKCustomOnionMessageHandler custom_handler_conv = *(LDKCustomOnionMessageHandler*)(custom_handler_ptr); + if (custom_handler_conv.free == LDKCustomOnionMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKCustomOnionMessageHandler_JCalls_cloned(&custom_handler_conv); + } + LDKCResult_PeeledOnionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PeeledOnionNoneZ), "LDKCResult_PeeledOnionNoneZ"); + *ret_conv = peel_onion_message(&msg_conv, node_signer_conv, logger_conv, custom_handler_conv); + 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 node_id_lookup, int64_t message_router, int64_t offers_handler, int64_t async_payments_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); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + void* 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); + if (message_router_conv.free == LDKMessageRouter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKMessageRouter_JCalls_cloned(&message_router_conv); + } + void* offers_handler_ptr = untag_ptr(offers_handler); + CHECK_ACCESS(offers_handler_ptr); + LDKOffersMessageHandler offers_handler_conv = *(LDKOffersMessageHandler*)(offers_handler_ptr); + if (offers_handler_conv.free == LDKOffersMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOffersMessageHandler_JCalls_cloned(&offers_handler_conv); + } + void* async_payments_handler_ptr = untag_ptr(async_payments_handler); + CHECK_ACCESS(async_payments_handler_ptr); + LDKAsyncPaymentsMessageHandler async_payments_handler_conv = *(LDKAsyncPaymentsMessageHandler*)(async_payments_handler_ptr); + if (async_payments_handler_conv.free == LDKAsyncPaymentsMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKAsyncPaymentsMessageHandler_JCalls_cloned(&async_payments_handler_conv); + } + void* custom_handler_ptr = untag_ptr(custom_handler); + CHECK_ACCESS(custom_handler_ptr); + LDKCustomOnionMessageHandler custom_handler_conv = *(LDKCustomOnionMessageHandler*)(custom_handler_ptr); + if (custom_handler_conv.free == LDKCustomOnionMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKCustomOnionMessageHandler_JCalls_cloned(&custom_handler_conv); + } + LDKOnionMessenger ret_var = OnionMessenger_new(entropy_source_conv, node_signer_conv, logger_conv, node_id_lookup_conv, message_router_conv, offers_handler_conv, async_payments_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); + return ret_ref; +} + +int64_t CS_LDK_OnionMessenger_new_with_offline_peer_interception(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 async_payments_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); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + void* 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); + if (message_router_conv.free == LDKMessageRouter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKMessageRouter_JCalls_cloned(&message_router_conv); + } + void* offers_handler_ptr = untag_ptr(offers_handler); + CHECK_ACCESS(offers_handler_ptr); + LDKOffersMessageHandler offers_handler_conv = *(LDKOffersMessageHandler*)(offers_handler_ptr); + if (offers_handler_conv.free == LDKOffersMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOffersMessageHandler_JCalls_cloned(&offers_handler_conv); + } + void* async_payments_handler_ptr = untag_ptr(async_payments_handler); + CHECK_ACCESS(async_payments_handler_ptr); + LDKAsyncPaymentsMessageHandler async_payments_handler_conv = *(LDKAsyncPaymentsMessageHandler*)(async_payments_handler_ptr); + if (async_payments_handler_conv.free == LDKAsyncPaymentsMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKAsyncPaymentsMessageHandler_JCalls_cloned(&async_payments_handler_conv); + } + void* custom_handler_ptr = untag_ptr(custom_handler); + CHECK_ACCESS(custom_handler_ptr); + LDKCustomOnionMessageHandler custom_handler_conv = *(LDKCustomOnionMessageHandler*)(custom_handler_ptr); + if (custom_handler_conv.free == LDKCustomOnionMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKCustomOnionMessageHandler_JCalls_cloned(&custom_handler_conv); + } + LDKOnionMessenger ret_var = OnionMessenger_new_with_offline_peer_interception(entropy_source_conv, node_signer_conv, logger_conv, node_id_lookup_conv, message_router_conv, offers_handler_conv, async_payments_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); + return ret_ref; +} + +int64_t CS_LDK_OnionMessenger_send_onion_message(int64_t this_arg, int64_t contents, int64_t instructions) { + LDKOnionMessenger this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + 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); + } + void* instructions_ptr = untag_ptr(instructions); + CHECK_ACCESS(instructions_ptr); + LDKMessageSendInstructions instructions_conv = *(LDKMessageSendInstructions*)(instructions_ptr); + instructions_conv = MessageSendInstructions_clone((LDKMessageSendInstructions*)untag_ptr(instructions)); + LDKCResult_SendSuccessSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SendSuccessSendErrorZ), "LDKCResult_SendSuccessSendErrorZ"); + *ret_conv = OnionMessenger_send_onion_message(&this_arg_conv, contents_conv, instructions_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_OnionMessenger_forward_onion_message(int64_t this_arg, int64_t message, int8_tArray peer_node_id) { + LDKOnionMessenger this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKOnionMessage 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 = OnionMessage_clone(&message_conv); + LDKPublicKey peer_node_id_ref; + CHECK(peer_node_id->arr_len == 33); + memcpy(peer_node_id_ref.compressed_form, peer_node_id->elems, 33); FREE(peer_node_id); + LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ"); + *ret_conv = OnionMessenger_forward_onion_message(&this_arg_conv, message_conv, peer_node_id_ref); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_OnionMessenger_handle_onion_message_response(int64_t this_arg, int64_t response, int64_t instructions) { + LDKOnionMessenger this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + void* response_ptr = untag_ptr(response); + CHECK_ACCESS(response_ptr); + LDKOnionMessageContents response_conv = *(LDKOnionMessageContents*)(response_ptr); + if (response_conv.free == LDKOnionMessageContents_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOnionMessageContents_JCalls_cloned(&response_conv); + } + LDKResponseInstruction instructions_conv; + instructions_conv.inner = untag_ptr(instructions); + instructions_conv.is_owned = ptr_is_owned(instructions); + CHECK_INNER_FIELD_ACCESS_OR_NULL(instructions_conv); + instructions_conv = ResponseInstruction_clone(&instructions_conv); + LDKCResult_SendSuccessSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SendSuccessSendErrorZ), "LDKCResult_SendSuccessSendErrorZ"); + *ret_conv = OnionMessenger_handle_onion_message_response(&this_arg_conv, response_conv, instructions_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_OnionMessenger_get_update_future(int64_t this_arg) { + LDKOnionMessenger this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKFuture ret_var = OnionMessenger_get_update_future(&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_OnionMessenger_as_EventsProvider(int64_t this_arg) { + LDKOnionMessenger this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); + *ret_ret = OnionMessenger_as_EventsProvider(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +int64_t CS_LDK_OnionMessenger_as_OnionMessageHandler(int64_t this_arg) { + LDKOnionMessenger this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKOnionMessageHandler* ret_ret = MALLOC(sizeof(LDKOnionMessageHandler), "LDKOnionMessageHandler"); + *ret_ret = OnionMessenger_as_OnionMessageHandler(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +void CS_LDK_OffersMessageHandler_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); + LDKOffersMessageHandler this_ptr_conv = *(LDKOffersMessageHandler*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + OffersMessageHandler_free(this_ptr_conv); +} + +void CS_LDK_OffersMessage_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); + LDKOffersMessage this_ptr_conv = *(LDKOffersMessage*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + OffersMessage_free(this_ptr_conv); +} + +static inline uint64_t OffersMessage_clone_ptr(LDKOffersMessage *NONNULL_PTR arg) { + LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); + *ret_copy = OffersMessage_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_OffersMessage_clone_ptr(int64_t arg) { + LDKOffersMessage* arg_conv = (LDKOffersMessage*)untag_ptr(arg); + int64_t ret_conv = OffersMessage_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_OffersMessage_clone(int64_t orig) { + LDKOffersMessage* orig_conv = (LDKOffersMessage*)untag_ptr(orig); + LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); + *ret_copy = OffersMessage_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_OffersMessage_invoice_request(int64_t a) { + LDKInvoiceRequest a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = InvoiceRequest_clone(&a_conv); + LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); + *ret_copy = OffersMessage_invoice_request(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_OffersMessage_invoice(int64_t a) { + LDKBolt12Invoice a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = Bolt12Invoice_clone(&a_conv); + LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); + *ret_copy = OffersMessage_invoice(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_OffersMessage_invoice_error(int64_t a) { + LDKInvoiceError a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = InvoiceError_clone(&a_conv); + LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); + *ret_copy = OffersMessage_invoice_error(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +jboolean CS_LDK_OffersMessage_is_known_type(int64_t tlv_type) { + jboolean ret_conv = OffersMessage_is_known_type(tlv_type); + return ret_conv; +} + +int64_t CS_LDK_OffersMessage_as_OnionMessageContents(int64_t this_arg) { + LDKOffersMessage* this_arg_conv = (LDKOffersMessage*)untag_ptr(this_arg); + LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *ret_ret = OffersMessage_as_OnionMessageContents(this_arg_conv); + return tag_ptr(ret_ret, true); +} + +int8_tArray CS_LDK_OffersMessage_write(int64_t obj) { + LDKOffersMessage* obj_conv = (LDKOffersMessage*)untag_ptr(obj); + LDKCVec_u8Z ret_var = OffersMessage_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_RouteHint_read(int8_tArray ser) { +int64_t CS_LDK_OffersMessage_read(int8_tArray ser, int64_t arg_a, int64_t arg_b) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); - *ret_conv = RouteHint_read(ser_ref); + void* arg_b_ptr = untag_ptr(arg_b); + if (ptr_is_owned(arg_b)) { CHECK_ACCESS(arg_b_ptr); } + LDKLogger* arg_b_conv = (LDKLogger*)arg_b_ptr; + LDKCResult_OffersMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersMessageDecodeErrorZ), "LDKCResult_OffersMessageDecodeErrorZ"); + *ret_conv = OffersMessage_read(ser_ref, arg_a, arg_b_conv); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_RouteHintHop_free(int64_t this_obj) { - LDKRouteHintHop this_obj_conv; +void CS_LDK_Packet_free(int64_t this_obj) { + LDKPacket this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - RouteHintHop_free(this_obj_conv); + Packet_free(this_obj_conv); } -int8_tArray CS_LDK_RouteHintHop_get_src_node_id(int64_t this_ptr) { - LDKRouteHintHop this_ptr_conv; +int8_t CS_LDK_Packet_get_version(int64_t this_ptr) { + LDKPacket this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, RouteHintHop_get_src_node_id(&this_ptr_conv).compressed_form, 33); - return ret_arr; + int8_t ret_conv = Packet_get_version(&this_ptr_conv); + return ret_conv; } -void CS_LDK_RouteHintHop_set_src_node_id(int64_t this_ptr, int8_tArray val) { - LDKRouteHintHop this_ptr_conv; +void CS_LDK_Packet_set_version(int64_t this_ptr, int8_t val) { + LDKPacket this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - RouteHintHop_set_src_node_id(&this_ptr_conv, val_ref); + Packet_set_version(&this_ptr_conv, val); } -int64_t CS_LDK_RouteHintHop_get_short_channel_id(int64_t this_ptr) { - LDKRouteHintHop this_ptr_conv; +int8_tArray CS_LDK_Packet_get_public_key(int64_t this_ptr) { + LDKPacket this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = RouteHintHop_get_short_channel_id(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, Packet_get_public_key(&this_ptr_conv).compressed_form, 33); + return ret_arr; } -void CS_LDK_RouteHintHop_set_short_channel_id(int64_t this_ptr, int64_t val) { - LDKRouteHintHop this_ptr_conv; +void CS_LDK_Packet_set_public_key(int64_t this_ptr, int8_tArray val) { + LDKPacket this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - RouteHintHop_set_short_channel_id(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + Packet_set_public_key(&this_ptr_conv, val_ref); } -int64_t CS_LDK_RouteHintHop_get_fees(int64_t this_ptr) { - LDKRouteHintHop this_ptr_conv; +int8_tArray CS_LDK_Packet_get_hop_data(int64_t this_ptr) { + LDKPacket this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKRoutingFees ret_var = RouteHintHop_get_fees(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + LDKCVec_u8Z ret_var = Packet_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_RouteHintHop_set_fees(int64_t this_ptr, int64_t val) { - LDKRouteHintHop this_ptr_conv; +void CS_LDK_Packet_set_hop_data(int64_t this_ptr, int8_tArray val) { + LDKPacket this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKRoutingFees val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = RoutingFees_clone(&val_conv); - RouteHintHop_set_fees(&this_ptr_conv, val_conv); -} - -int16_t CS_LDK_RouteHintHop_get_cltv_expiry_delta(int64_t this_ptr) { - LDKRouteHintHop this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int16_t ret_conv = RouteHintHop_get_cltv_expiry_delta(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_RouteHintHop_set_cltv_expiry_delta(int64_t this_ptr, int16_t val) { - LDKRouteHintHop this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - RouteHintHop_set_cltv_expiry_delta(&this_ptr_conv, val); -} - -int64_t CS_LDK_RouteHintHop_get_htlc_minimum_msat(int64_t this_ptr) { - LDKRouteHintHop this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = RouteHintHop_get_htlc_minimum_msat(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -void CS_LDK_RouteHintHop_set_htlc_minimum_msat(int64_t this_ptr, int64_t val) { - LDKRouteHintHop this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - RouteHintHop_set_htlc_minimum_msat(&this_ptr_conv, val_conv); + 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); + Packet_set_hop_data(&this_ptr_conv, val_ref); } -int64_t CS_LDK_RouteHintHop_get_htlc_maximum_msat(int64_t this_ptr) { - LDKRouteHintHop this_ptr_conv; +int8_tArray CS_LDK_Packet_get_hmac(int64_t this_ptr) { + LDKPacket this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = RouteHintHop_get_htlc_maximum_msat(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *Packet_get_hmac(&this_ptr_conv), 32); + return ret_arr; } -void CS_LDK_RouteHintHop_set_htlc_maximum_msat(int64_t this_ptr, int64_t val) { - LDKRouteHintHop this_ptr_conv; +void CS_LDK_Packet_set_hmac(int64_t this_ptr, int8_tArray val) { + LDKPacket this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - RouteHintHop_set_htlc_maximum_msat(&this_ptr_conv, val_conv); + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + Packet_set_hmac(&this_ptr_conv, val_ref); } -int64_t CS_LDK_RouteHintHop_new(int8_tArray src_node_id_arg, int64_t short_channel_id_arg, int64_t fees_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg) { - LDKPublicKey src_node_id_arg_ref; - CHECK(src_node_id_arg->arr_len == 33); - memcpy(src_node_id_arg_ref.compressed_form, src_node_id_arg->elems, 33); FREE(src_node_id_arg); - LDKRoutingFees fees_arg_conv; - fees_arg_conv.inner = untag_ptr(fees_arg); - fees_arg_conv.is_owned = ptr_is_owned(fees_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv); - fees_arg_conv = RoutingFees_clone(&fees_arg_conv); - void* htlc_minimum_msat_arg_ptr = untag_ptr(htlc_minimum_msat_arg); - CHECK_ACCESS(htlc_minimum_msat_arg_ptr); - LDKCOption_u64Z htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_minimum_msat_arg_ptr); - htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_minimum_msat_arg)); - void* htlc_maximum_msat_arg_ptr = untag_ptr(htlc_maximum_msat_arg); - CHECK_ACCESS(htlc_maximum_msat_arg_ptr); - LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_arg_ptr); - htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_maximum_msat_arg)); - LDKRouteHintHop ret_var = RouteHintHop_new(src_node_id_arg_ref, short_channel_id_arg, fees_arg_conv, cltv_expiry_delta_arg, htlc_minimum_msat_arg_conv, htlc_maximum_msat_arg_conv); +int64_t CS_LDK_Packet_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); + LDKPacket ret_var = Packet_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 RouteHintHop_clone_ptr(LDKRouteHintHop *NONNULL_PTR arg) { - LDKRouteHintHop ret_var = RouteHintHop_clone(arg); +static inline uint64_t Packet_clone_ptr(LDKPacket *NONNULL_PTR arg) { + LDKPacket ret_var = Packet_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_RouteHintHop_clone_ptr(int64_t arg) { - LDKRouteHintHop arg_conv; +int64_t CS_LDK_Packet_clone_ptr(int64_t arg) { + LDKPacket arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = RouteHintHop_clone_ptr(&arg_conv); + int64_t ret_conv = Packet_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_RouteHintHop_clone(int64_t orig) { - LDKRouteHintHop orig_conv; +int64_t CS_LDK_Packet_clone(int64_t orig) { + LDKPacket orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKRouteHintHop ret_var = RouteHintHop_clone(&orig_conv); + LDKPacket ret_var = Packet_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_RouteHintHop_hash(int64_t o) { - LDKRouteHintHop o_conv; +int64_t CS_LDK_Packet_hash(int64_t o) { + LDKPacket o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv.is_owned = false; - int64_t ret_conv = RouteHintHop_hash(&o_conv); + int64_t ret_conv = Packet_hash(&o_conv); return ret_conv; } -jboolean CS_LDK_RouteHintHop_eq(int64_t a, int64_t b) { - LDKRouteHintHop a_conv; +jboolean CS_LDK_Packet_eq(int64_t a, int64_t b) { + LDKPacket a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKRouteHintHop b_conv; + LDKPacket b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = RouteHintHop_eq(&a_conv, &b_conv); + jboolean ret_conv = Packet_eq(&a_conv, &b_conv); return ret_conv; } -int8_tArray CS_LDK_RouteHintHop_write(int64_t obj) { - LDKRouteHintHop obj_conv; +int8_tArray CS_LDK_Packet_write(int64_t obj) { + LDKPacket obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = RouteHintHop_write(&obj_conv); + LDKCVec_u8Z ret_var = Packet_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_RouteHintHop_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); - *ret_conv = RouteHintHop_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void CS_LDK_ParsedOnionMessageContents_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); + LDKParsedOnionMessageContents this_ptr_conv = *(LDKParsedOnionMessageContents*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + ParsedOnionMessageContents_free(this_ptr_conv); } -void CS_LDK_FirstHopCandidate_free(int64_t this_obj) { - LDKFirstHopCandidate this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - FirstHopCandidate_free(this_obj_conv); +static inline uint64_t ParsedOnionMessageContents_clone_ptr(LDKParsedOnionMessageContents *NONNULL_PTR arg) { + LDKParsedOnionMessageContents *ret_copy = MALLOC(sizeof(LDKParsedOnionMessageContents), "LDKParsedOnionMessageContents"); + *ret_copy = ParsedOnionMessageContents_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_ParsedOnionMessageContents_clone_ptr(int64_t arg) { + LDKParsedOnionMessageContents* arg_conv = (LDKParsedOnionMessageContents*)untag_ptr(arg); + int64_t ret_conv = ParsedOnionMessageContents_clone_ptr(arg_conv); + return ret_conv; } -static inline uint64_t FirstHopCandidate_clone_ptr(LDKFirstHopCandidate *NONNULL_PTR arg) { - LDKFirstHopCandidate ret_var = FirstHopCandidate_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); +int64_t CS_LDK_ParsedOnionMessageContents_clone(int64_t orig) { + LDKParsedOnionMessageContents* orig_conv = (LDKParsedOnionMessageContents*)untag_ptr(orig); + LDKParsedOnionMessageContents *ret_copy = MALLOC(sizeof(LDKParsedOnionMessageContents), "LDKParsedOnionMessageContents"); + *ret_copy = ParsedOnionMessageContents_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_FirstHopCandidate_clone_ptr(int64_t arg) { - LDKFirstHopCandidate 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 = FirstHopCandidate_clone_ptr(&arg_conv); + +int64_t CS_LDK_ParsedOnionMessageContents_offers(int64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKOffersMessage a_conv = *(LDKOffersMessage*)(a_ptr); + a_conv = OffersMessage_clone((LDKOffersMessage*)untag_ptr(a)); + LDKParsedOnionMessageContents *ret_copy = MALLOC(sizeof(LDKParsedOnionMessageContents), "LDKParsedOnionMessageContents"); + *ret_copy = ParsedOnionMessageContents_offers(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_ParsedOnionMessageContents_custom(int64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKOnionMessageContents a_conv = *(LDKOnionMessageContents*)(a_ptr); + if (a_conv.free == LDKOnionMessageContents_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOnionMessageContents_JCalls_cloned(&a_conv); + } + LDKParsedOnionMessageContents *ret_copy = MALLOC(sizeof(LDKParsedOnionMessageContents), "LDKParsedOnionMessageContents"); + *ret_copy = ParsedOnionMessageContents_custom(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_ParsedOnionMessageContents_as_OnionMessageContents(int64_t this_arg) { + LDKParsedOnionMessageContents* this_arg_conv = (LDKParsedOnionMessageContents*)untag_ptr(this_arg); + LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *ret_ret = ParsedOnionMessageContents_as_OnionMessageContents(this_arg_conv); + return tag_ptr(ret_ret, true); +} + +int8_tArray CS_LDK_ParsedOnionMessageContents_write(int64_t obj) { + LDKParsedOnionMessageContents* obj_conv = (LDKParsedOnionMessageContents*)untag_ptr(obj); + LDKCVec_u8Z ret_var = ParsedOnionMessageContents_write(obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +static inline uint64_t OnionMessageContents_clone_ptr(LDKOnionMessageContents *NONNULL_PTR arg) { + LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *ret_ret = OnionMessageContents_clone(arg); + return tag_ptr(ret_ret, true); +} +int64_t CS_LDK_OnionMessageContents_clone_ptr(int64_t arg) { + void* arg_ptr = untag_ptr(arg); + if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); } + LDKOnionMessageContents* arg_conv = (LDKOnionMessageContents*)arg_ptr; + int64_t ret_conv = OnionMessageContents_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_FirstHopCandidate_clone(int64_t orig) { - LDKFirstHopCandidate 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; - LDKFirstHopCandidate ret_var = FirstHopCandidate_clone(&orig_conv); +int64_t CS_LDK_OnionMessageContents_clone(int64_t orig) { + void* orig_ptr = untag_ptr(orig); + if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); } + LDKOnionMessageContents* orig_conv = (LDKOnionMessageContents*)orig_ptr; + LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *ret_ret = OnionMessageContents_clone(orig_conv); + return tag_ptr(ret_ret, true); +} + +void CS_LDK_OnionMessageContents_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); + LDKOnionMessageContents this_ptr_conv = *(LDKOnionMessageContents*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + OnionMessageContents_free(this_ptr_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; } -void CS_LDK_PublicHopCandidate_free(int64_t this_obj) { - LDKPublicHopCandidate this_obj_conv; +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); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PublicHopCandidate_free(this_obj_conv); + BlindedHop_free(this_obj_conv); } -int64_t CS_LDK_PublicHopCandidate_get_short_channel_id(int64_t this_ptr) { - LDKPublicHopCandidate this_ptr_conv; +int8_tArray CS_LDK_BlindedHop_get_blinded_node_id(int64_t this_ptr) { + LDKBlindedHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = PublicHopCandidate_get_short_channel_id(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, BlindedHop_get_blinded_node_id(&this_ptr_conv).compressed_form, 33); + return ret_arr; } -void CS_LDK_PublicHopCandidate_set_short_channel_id(int64_t this_ptr, int64_t val) { - LDKPublicHopCandidate this_ptr_conv; +void CS_LDK_BlindedHop_set_blinded_node_id(int64_t this_ptr, int8_tArray val) { + LDKBlindedHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - PublicHopCandidate_set_short_channel_id(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + BlindedHop_set_blinded_node_id(&this_ptr_conv, val_ref); } -static inline uint64_t PublicHopCandidate_clone_ptr(LDKPublicHopCandidate *NONNULL_PTR arg) { - LDKPublicHopCandidate ret_var = PublicHopCandidate_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; +int8_tArray CS_LDK_BlindedHop_get_encrypted_payload(int64_t this_ptr) { + LDKBlindedHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = BlindedHop_get_encrypted_payload(&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; } -int64_t CS_LDK_PublicHopCandidate_clone_ptr(int64_t arg) { - LDKPublicHopCandidate 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 = PublicHopCandidate_clone_ptr(&arg_conv); - return ret_conv; + +void CS_LDK_BlindedHop_set_encrypted_payload(int64_t this_ptr, int8_tArray val) { + LDKBlindedHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + BlindedHop_set_encrypted_payload(&this_ptr_conv, val_ref); } -int64_t CS_LDK_PublicHopCandidate_clone(int64_t orig) { - LDKPublicHopCandidate 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; - LDKPublicHopCandidate ret_var = PublicHopCandidate_clone(&orig_conv); +int64_t CS_LDK_BlindedHop_new(int8_tArray blinded_node_id_arg, int8_tArray encrypted_payload_arg) { + LDKPublicKey blinded_node_id_arg_ref; + CHECK(blinded_node_id_arg->arr_len == 33); + memcpy(blinded_node_id_arg_ref.compressed_form, blinded_node_id_arg->elems, 33); FREE(blinded_node_id_arg); + LDKCVec_u8Z encrypted_payload_arg_ref; + encrypted_payload_arg_ref.datalen = encrypted_payload_arg->arr_len; + encrypted_payload_arg_ref.data = MALLOC(encrypted_payload_arg_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(encrypted_payload_arg_ref.data, encrypted_payload_arg->elems, encrypted_payload_arg_ref.datalen); FREE(encrypted_payload_arg); + LDKBlindedHop ret_var = BlindedHop_new(blinded_node_id_arg_ref, encrypted_payload_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; } -void CS_LDK_PrivateHopCandidate_free(int64_t this_obj) { - LDKPrivateHopCandidate this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PrivateHopCandidate_free(this_obj_conv); -} - -static inline uint64_t PrivateHopCandidate_clone_ptr(LDKPrivateHopCandidate *NONNULL_PTR arg) { - LDKPrivateHopCandidate ret_var = PrivateHopCandidate_clone(arg); +static inline uint64_t BlindedHop_clone_ptr(LDKBlindedHop *NONNULL_PTR arg) { + LDKBlindedHop ret_var = BlindedHop_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_PrivateHopCandidate_clone_ptr(int64_t arg) { - LDKPrivateHopCandidate arg_conv; +int64_t CS_LDK_BlindedHop_clone_ptr(int64_t arg) { + LDKBlindedHop arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = PrivateHopCandidate_clone_ptr(&arg_conv); + int64_t ret_conv = BlindedHop_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_PrivateHopCandidate_clone(int64_t orig) { - LDKPrivateHopCandidate orig_conv; +int64_t CS_LDK_BlindedHop_clone(int64_t orig) { + LDKBlindedHop orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKPrivateHopCandidate ret_var = PrivateHopCandidate_clone(&orig_conv); + LDKBlindedHop ret_var = BlindedHop_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_BlindedPathCandidate_free(int64_t this_obj) { - LDKBlindedPathCandidate this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BlindedPathCandidate_free(this_obj_conv); +int64_t CS_LDK_BlindedHop_hash(int64_t o) { + LDKBlindedHop o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = BlindedHop_hash(&o_conv); + return ret_conv; } -static inline uint64_t BlindedPathCandidate_clone_ptr(LDKBlindedPathCandidate *NONNULL_PTR arg) { - LDKBlindedPathCandidate ret_var = BlindedPathCandidate_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_BlindedPathCandidate_clone_ptr(int64_t arg) { - LDKBlindedPathCandidate arg_conv; +jboolean CS_LDK_BlindedHop_eq(int64_t a, int64_t b) { + LDKBlindedHop a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKBlindedHop b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = BlindedHop_eq(&a_conv, &b_conv); + return ret_conv; +} + +int8_tArray CS_LDK_BlindedHop_write(int64_t obj) { + LDKBlindedHop obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = BlindedHop_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_BlindedHop_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); + *ret_conv = BlindedHop_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_BlindedPayInfo_free(int64_t this_obj) { + LDKBlindedPayInfo this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + BlindedPayInfo_free(this_obj_conv); +} + +int32_t CS_LDK_BlindedPayInfo_get_fee_base_msat(int64_t this_ptr) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = BlindedPayInfo_get_fee_base_msat(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_BlindedPayInfo_set_fee_base_msat(int64_t this_ptr, int32_t val) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + BlindedPayInfo_set_fee_base_msat(&this_ptr_conv, val); +} + +int32_t CS_LDK_BlindedPayInfo_get_fee_proportional_millionths(int64_t this_ptr) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = BlindedPayInfo_get_fee_proportional_millionths(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_BlindedPayInfo_set_fee_proportional_millionths(int64_t this_ptr, int32_t val) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + BlindedPayInfo_set_fee_proportional_millionths(&this_ptr_conv, val); +} + +int16_t CS_LDK_BlindedPayInfo_get_cltv_expiry_delta(int64_t this_ptr) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int16_t ret_conv = BlindedPayInfo_get_cltv_expiry_delta(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_BlindedPayInfo_set_cltv_expiry_delta(int64_t this_ptr, int16_t val) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + BlindedPayInfo_set_cltv_expiry_delta(&this_ptr_conv, val); +} + +int64_t CS_LDK_BlindedPayInfo_get_htlc_minimum_msat(int64_t this_ptr) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = BlindedPayInfo_get_htlc_minimum_msat(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_BlindedPayInfo_set_htlc_minimum_msat(int64_t this_ptr, int64_t val) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + BlindedPayInfo_set_htlc_minimum_msat(&this_ptr_conv, val); +} + +int64_t CS_LDK_BlindedPayInfo_get_htlc_maximum_msat(int64_t this_ptr) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = BlindedPayInfo_get_htlc_maximum_msat(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_BlindedPayInfo_set_htlc_maximum_msat(int64_t this_ptr, int64_t val) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + BlindedPayInfo_set_htlc_maximum_msat(&this_ptr_conv, val); +} + +int64_t CS_LDK_BlindedPayInfo_get_features(int64_t this_ptr) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBlindedHopFeatures ret_var = BlindedPayInfo_get_features(&this_ptr_conv); + int64_t ret_ref = 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_BlindedPayInfo_set_features(int64_t this_ptr, int64_t val) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBlindedHopFeatures val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = BlindedHopFeatures_clone(&val_conv); + BlindedPayInfo_set_features(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_BlindedPayInfo_new(int32_t fee_base_msat_arg, int32_t fee_proportional_millionths_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg, int64_t features_arg) { + LDKBlindedHopFeatures features_arg_conv; + features_arg_conv.inner = untag_ptr(features_arg); + features_arg_conv.is_owned = ptr_is_owned(features_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); + features_arg_conv = BlindedHopFeatures_clone(&features_arg_conv); + LDKBlindedPayInfo ret_var = BlindedPayInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, features_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t BlindedPayInfo_clone_ptr(LDKBlindedPayInfo *NONNULL_PTR arg) { + LDKBlindedPayInfo ret_var = BlindedPayInfo_clone(arg); + int64_t ret_ref = 0; + 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_BlindedPayInfo_clone_ptr(int64_t arg) { + LDKBlindedPayInfo arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = BlindedPathCandidate_clone_ptr(&arg_conv); + int64_t ret_conv = BlindedPayInfo_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_BlindedPathCandidate_clone(int64_t orig) { - LDKBlindedPathCandidate orig_conv; +int64_t CS_LDK_BlindedPayInfo_clone(int64_t orig) { + LDKBlindedPayInfo orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBlindedPathCandidate ret_var = BlindedPathCandidate_clone(&orig_conv); + LDKBlindedPayInfo ret_var = BlindedPayInfo_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_OneHopBlindedPathCandidate_free(int64_t this_obj) { - LDKOneHopBlindedPathCandidate this_obj_conv; +int64_t CS_LDK_BlindedPayInfo_hash(int64_t o) { + LDKBlindedPayInfo o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = BlindedPayInfo_hash(&o_conv); + return ret_conv; +} + +jboolean CS_LDK_BlindedPayInfo_eq(int64_t a, int64_t b) { + LDKBlindedPayInfo a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKBlindedPayInfo b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = BlindedPayInfo_eq(&a_conv, &b_conv); + return ret_conv; +} + +int8_tArray CS_LDK_BlindedPayInfo_write(int64_t obj) { + LDKBlindedPayInfo obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = BlindedPayInfo_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_BlindedPayInfo_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); + *ret_conv = BlindedPayInfo_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_BlindedPaymentPath_free(int64_t this_obj) { + LDKBlindedPaymentPath this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - OneHopBlindedPathCandidate_free(this_obj_conv); + BlindedPaymentPath_free(this_obj_conv); } -static inline uint64_t OneHopBlindedPathCandidate_clone_ptr(LDKOneHopBlindedPathCandidate *NONNULL_PTR arg) { - LDKOneHopBlindedPathCandidate ret_var = OneHopBlindedPathCandidate_clone(arg); +int64_t CS_LDK_BlindedPaymentPath_get_payinfo(int64_t this_ptr) { + LDKBlindedPaymentPath this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBlindedPayInfo ret_var = BlindedPaymentPath_get_payinfo(&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; } -int64_t CS_LDK_OneHopBlindedPathCandidate_clone_ptr(int64_t arg) { - LDKOneHopBlindedPathCandidate arg_conv; + +void CS_LDK_BlindedPaymentPath_set_payinfo(int64_t this_ptr, int64_t val) { + LDKBlindedPaymentPath this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBlindedPayInfo 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 = BlindedPayInfo_clone(&val_conv); + BlindedPaymentPath_set_payinfo(&this_ptr_conv, val_conv); +} + +static inline uint64_t BlindedPaymentPath_clone_ptr(LDKBlindedPaymentPath *NONNULL_PTR arg) { + LDKBlindedPaymentPath ret_var = BlindedPaymentPath_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_BlindedPaymentPath_clone_ptr(int64_t arg) { + LDKBlindedPaymentPath 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 = OneHopBlindedPathCandidate_clone_ptr(&arg_conv); + int64_t ret_conv = BlindedPaymentPath_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_OneHopBlindedPathCandidate_clone(int64_t orig) { - LDKOneHopBlindedPathCandidate orig_conv; +int64_t CS_LDK_BlindedPaymentPath_clone(int64_t orig) { + LDKBlindedPaymentPath 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; - LDKOneHopBlindedPathCandidate ret_var = OneHopBlindedPathCandidate_clone(&orig_conv); + LDKBlindedPaymentPath ret_var = BlindedPaymentPath_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_CandidateRouteHop_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); - LDKCandidateRouteHop this_ptr_conv = *(LDKCandidateRouteHop*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - CandidateRouteHop_free(this_ptr_conv); -} - -static inline uint64_t CandidateRouteHop_clone_ptr(LDKCandidateRouteHop *NONNULL_PTR arg) { - LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); - *ret_copy = CandidateRouteHop_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -int64_t CS_LDK_CandidateRouteHop_clone_ptr(int64_t arg) { - LDKCandidateRouteHop* arg_conv = (LDKCandidateRouteHop*)untag_ptr(arg); - int64_t ret_conv = CandidateRouteHop_clone_ptr(arg_conv); +int64_t CS_LDK_BlindedPaymentPath_hash(int64_t o) { + LDKBlindedPaymentPath o_conv; + 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 = BlindedPaymentPath_hash(&o_conv); return ret_conv; } -int64_t CS_LDK_CandidateRouteHop_clone(int64_t orig) { - LDKCandidateRouteHop* orig_conv = (LDKCandidateRouteHop*)untag_ptr(orig); - LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); - *ret_copy = CandidateRouteHop_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_CandidateRouteHop_first_hop(int64_t a) { - LDKFirstHopCandidate a_conv; +jboolean CS_LDK_BlindedPaymentPath_eq(int64_t a, int64_t b) { + LDKBlindedPaymentPath a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = FirstHopCandidate_clone(&a_conv); - LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); - *ret_copy = CandidateRouteHop_first_hop(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + a_conv.is_owned = false; + LDKBlindedPaymentPath 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 = BlindedPaymentPath_eq(&a_conv, &b_conv); + return ret_conv; } -int64_t CS_LDK_CandidateRouteHop_public_hop(int64_t a) { - LDKPublicHopCandidate a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = PublicHopCandidate_clone(&a_conv); - LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); - *ret_copy = CandidateRouteHop_public_hop(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_BlindedPaymentPath_one_hop(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); + LDKReceiveTlvs payee_tlvs_conv; + payee_tlvs_conv.inner = untag_ptr(payee_tlvs); + payee_tlvs_conv.is_owned = ptr_is_owned(payee_tlvs); + 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); + 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_BlindedPaymentPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPaymentPathNoneZ), "LDKCResult_BlindedPaymentPathNoneZ"); + *ret_conv = BlindedPaymentPath_one_hop(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_CandidateRouteHop_private_hop(int64_t a) { - LDKPrivateHopCandidate a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = PrivateHopCandidate_clone(&a_conv); - LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); - *ret_copy = CandidateRouteHop_private_hop(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_BlindedPaymentPath_new(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_PaymentForwardNodeZ intermediate_nodes_constr; + intermediate_nodes_constr.datalen = intermediate_nodes->arr_len; + if (intermediate_nodes_constr.datalen > 0) + intermediate_nodes_constr.data = MALLOC(intermediate_nodes_constr.datalen * sizeof(LDKPaymentForwardNode), "LDKCVec_PaymentForwardNodeZ Elements"); + else + intermediate_nodes_constr.data = NULL; + int64_t* intermediate_nodes_vals = intermediate_nodes->elems; + for (size_t u = 0; u < intermediate_nodes_constr.datalen; u++) { + int64_t intermediate_nodes_conv_20 = intermediate_nodes_vals[u]; + LDKPaymentForwardNode intermediate_nodes_conv_20_conv; + intermediate_nodes_conv_20_conv.inner = untag_ptr(intermediate_nodes_conv_20); + intermediate_nodes_conv_20_conv.is_owned = ptr_is_owned(intermediate_nodes_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(intermediate_nodes_conv_20_conv); + intermediate_nodes_conv_20_conv = PaymentForwardNode_clone(&intermediate_nodes_conv_20_conv); + intermediate_nodes_constr.data[u] = intermediate_nodes_conv_20_conv; + } + FREE(intermediate_nodes); + 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); + LDKReceiveTlvs payee_tlvs_conv; + payee_tlvs_conv.inner = untag_ptr(payee_tlvs); + payee_tlvs_conv.is_owned = ptr_is_owned(payee_tlvs); + 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); + 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_BlindedPaymentPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPaymentPathNoneZ), "LDKCResult_BlindedPaymentPathNoneZ"); + *ret_conv = BlindedPaymentPath_new(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_CandidateRouteHop_blinded(int64_t a) { - LDKBlindedPathCandidate a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = BlindedPathCandidate_clone(&a_conv); - LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); - *ret_copy = CandidateRouteHop_blinded(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +int64_t CS_LDK_BlindedPaymentPath_public_introduction_node_id(int64_t this_arg, int64_t network_graph) { + LDKBlindedPaymentPath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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 = BlindedPaymentPath_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; } -int64_t CS_LDK_CandidateRouteHop_one_hop_blinded(int64_t a) { - LDKOneHopBlindedPathCandidate a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = OneHopBlindedPathCandidate_clone(&a_conv); - LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); - *ret_copy = CandidateRouteHop_one_hop_blinded(a_conv); +int64_t CS_LDK_BlindedPaymentPath_introduction_node(int64_t this_arg) { + LDKBlindedPaymentPath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); + *ret_copy = BlindedPaymentPath_introduction_node(&this_arg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_CandidateRouteHop_globally_unique_short_channel_id(int64_t this_arg) { - LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = CandidateRouteHop_globally_unique_short_channel_id(this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int8_tArray CS_LDK_BlindedPaymentPath_blinding_point(int64_t this_arg) { + LDKBlindedPaymentPath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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, BlindedPaymentPath_blinding_point(&this_arg_conv).compressed_form, 33); + return ret_arr; } -int32_t CS_LDK_CandidateRouteHop_cltv_expiry_delta(int64_t this_arg) { - LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); - int32_t ret_conv = CandidateRouteHop_cltv_expiry_delta(this_arg_conv); - return ret_conv; +int64_tArray CS_LDK_BlindedPaymentPath_blinded_hops(int64_t this_arg) { + LDKBlindedPaymentPath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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_BlindedHopZ ret_var = BlindedPaymentPath_blinded_hops(&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 m = 0; m < ret_var.datalen; m++) { + LDKBlindedHop ret_conv_12_var = ret_var.data[m]; + int64_t ret_conv_12_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_var); + ret_conv_12_ref = tag_ptr(ret_conv_12_var.inner, ret_conv_12_var.is_owned); + ret_arr_ptr[m] = ret_conv_12_ref; + } + + FREE(ret_var.data); + return ret_arr; } -int64_t CS_LDK_CandidateRouteHop_htlc_minimum_msat(int64_t this_arg) { - LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); - int64_t ret_conv = CandidateRouteHop_htlc_minimum_msat(this_arg_conv); - return ret_conv; +int64_t CS_LDK_BlindedPaymentPath_advance_path_by_one(int64_t this_arg, int64_t node_signer, int64_t node_id_lookup) { + LDKBlindedPaymentPath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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* 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; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = BlindedPaymentPath_advance_path_by_one(&this_arg_conv, node_signer_conv, node_id_lookup_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CandidateRouteHop_fees(int64_t this_arg) { - LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); - LDKRoutingFees ret_var = CandidateRouteHop_fees(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_PaymentForwardNode_free(int64_t this_obj) { + LDKPaymentForwardNode this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + PaymentForwardNode_free(this_obj_conv); } -int64_t CS_LDK_CandidateRouteHop_source(int64_t this_arg) { - LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); - LDKNodeId ret_var = CandidateRouteHop_source(this_arg_conv); +int64_t CS_LDK_PaymentForwardNode_get_tlvs(int64_t this_ptr) { + LDKPaymentForwardNode this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKForwardTlvs ret_var = PaymentForwardNode_get_tlvs(&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; } -int64_t CS_LDK_CandidateRouteHop_target(int64_t this_arg) { - LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); - LDKNodeId ret_var = CandidateRouteHop_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_PaymentForwardNode_set_tlvs(int64_t this_ptr, int64_t val) { + LDKPaymentForwardNode this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKForwardTlvs 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 = ForwardTlvs_clone(&val_conv); + PaymentForwardNode_set_tlvs(&this_ptr_conv, val_conv); } -int64_t CS_LDK_find_route(int8_tArray our_node_pubkey, int64_t route_params, int64_t network_graph, int64_tArray first_hops, int64_t logger, int64_t scorer, int64_t score_params, int8_tArray random_seed_bytes) { - LDKPublicKey our_node_pubkey_ref; - CHECK(our_node_pubkey->arr_len == 33); - memcpy(our_node_pubkey_ref.compressed_form, our_node_pubkey->elems, 33); FREE(our_node_pubkey); - LDKRouteParameters route_params_conv; - route_params_conv.inner = untag_ptr(route_params); - route_params_conv.is_owned = ptr_is_owned(route_params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); - route_params_conv.is_owned = false; - LDKNetworkGraph network_graph_conv; - network_graph_conv.inner = untag_ptr(network_graph); - network_graph_conv.is_owned = ptr_is_owned(network_graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - network_graph_conv.is_owned = false; - LDKCVec_ChannelDetailsZ first_hops_constr; - LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL; - if (first_hops != NULL) { - first_hops_constr.datalen = first_hops->arr_len; - if (first_hops_constr.datalen > 0) - first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); - else - first_hops_constr.data = NULL; - int64_t* first_hops_vals = first_hops->elems; - for (size_t q = 0; q < first_hops_constr.datalen; q++) { - int64_t first_hops_conv_16 = first_hops_vals[q]; - LDKChannelDetails first_hops_conv_16_conv; - first_hops_conv_16_conv.inner = untag_ptr(first_hops_conv_16); - first_hops_conv_16_conv.is_owned = ptr_is_owned(first_hops_conv_16); - CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv); - first_hops_conv_16_conv.is_owned = false; - first_hops_constr.data[q] = first_hops_conv_16_conv; - } - FREE(first_hops); - first_hops_ptr = &first_hops_constr; - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - void* scorer_ptr = untag_ptr(scorer); - if (ptr_is_owned(scorer)) { CHECK_ACCESS(scorer_ptr); } - LDKScoreLookUp* scorer_conv = (LDKScoreLookUp*)scorer_ptr; - LDKProbabilisticScoringFeeParameters score_params_conv; - score_params_conv.inner = untag_ptr(score_params); - score_params_conv.is_owned = ptr_is_owned(score_params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(score_params_conv); - score_params_conv.is_owned = false; - uint8_t random_seed_bytes_arr[32]; - CHECK(random_seed_bytes->arr_len == 32); - memcpy(random_seed_bytes_arr, random_seed_bytes->elems, 32); FREE(random_seed_bytes); - uint8_t (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr; - LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); - *ret_conv = find_route(our_node_pubkey_ref, &route_params_conv, &network_graph_conv, first_hops_ptr, logger_conv, scorer_conv, &score_params_conv, random_seed_bytes_ref); - if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); } - return tag_ptr(ret_conv, true); +int8_tArray CS_LDK_PaymentForwardNode_get_node_id(int64_t this_ptr) { + LDKPaymentForwardNode this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(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, PaymentForwardNode_get_node_id(&this_ptr_conv).compressed_form, 33); + return ret_arr; } -int64_t CS_LDK_build_route_from_hops(int8_tArray our_node_pubkey, ptrArray hops, int64_t route_params, int64_t network_graph, int64_t logger, int8_tArray random_seed_bytes) { - LDKPublicKey our_node_pubkey_ref; - CHECK(our_node_pubkey->arr_len == 33); - memcpy(our_node_pubkey_ref.compressed_form, our_node_pubkey->elems, 33); FREE(our_node_pubkey); - LDKCVec_PublicKeyZ hops_constr; - hops_constr.datalen = hops->arr_len; - if (hops_constr.datalen > 0) - hops_constr.data = MALLOC(hops_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); - else - hops_constr.data = NULL; - int8_tArray* hops_vals = (void*) hops->elems; - for (size_t i = 0; i < hops_constr.datalen; i++) { - int8_tArray hops_conv_8 = hops_vals[i]; - LDKPublicKey hops_conv_8_ref; - CHECK(hops_conv_8->arr_len == 33); - memcpy(hops_conv_8_ref.compressed_form, hops_conv_8->elems, 33); FREE(hops_conv_8); - hops_constr.data[i] = hops_conv_8_ref; - } - FREE(hops); - LDKRouteParameters route_params_conv; - route_params_conv.inner = untag_ptr(route_params); - route_params_conv.is_owned = ptr_is_owned(route_params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); - route_params_conv.is_owned = false; - LDKNetworkGraph network_graph_conv; - network_graph_conv.inner = untag_ptr(network_graph); - network_graph_conv.is_owned = ptr_is_owned(network_graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - network_graph_conv.is_owned = false; - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - uint8_t random_seed_bytes_arr[32]; - CHECK(random_seed_bytes->arr_len == 32); - memcpy(random_seed_bytes_arr, random_seed_bytes->elems, 32); FREE(random_seed_bytes); - uint8_t (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr; - LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); - *ret_conv = build_route_from_hops(our_node_pubkey_ref, hops_constr, &route_params_conv, &network_graph_conv, logger_conv, random_seed_bytes_ref); - return tag_ptr(ret_conv, true); +void CS_LDK_PaymentForwardNode_set_node_id(int64_t this_ptr, int8_tArray val) { + LDKPaymentForwardNode this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + PaymentForwardNode_set_node_id(&this_ptr_conv, val_ref); } -void CS_LDK_ScoreLookUp_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); - LDKScoreLookUp this_ptr_conv = *(LDKScoreLookUp*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - ScoreLookUp_free(this_ptr_conv); +int64_t CS_LDK_PaymentForwardNode_get_htlc_maximum_msat(int64_t this_ptr) { + LDKPaymentForwardNode this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = PaymentForwardNode_get_htlc_maximum_msat(&this_ptr_conv); + return ret_conv; } -void CS_LDK_ScoreUpdate_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); - LDKScoreUpdate this_ptr_conv = *(LDKScoreUpdate*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - ScoreUpdate_free(this_ptr_conv); +void CS_LDK_PaymentForwardNode_set_htlc_maximum_msat(int64_t this_ptr, int64_t val) { + LDKPaymentForwardNode this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + PaymentForwardNode_set_htlc_maximum_msat(&this_ptr_conv, val); } -void CS_LDK_Score_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); - LDKScore this_ptr_conv = *(LDKScore*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Score_free(this_ptr_conv); +int64_t CS_LDK_PaymentForwardNode_new(int64_t tlvs_arg, int8_tArray node_id_arg, int64_t htlc_maximum_msat_arg) { + LDKForwardTlvs tlvs_arg_conv; + tlvs_arg_conv.inner = untag_ptr(tlvs_arg); + tlvs_arg_conv.is_owned = ptr_is_owned(tlvs_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(tlvs_arg_conv); + tlvs_arg_conv = ForwardTlvs_clone(&tlvs_arg_conv); + LDKPublicKey node_id_arg_ref; + CHECK(node_id_arg->arr_len == 33); + memcpy(node_id_arg_ref.compressed_form, node_id_arg->elems, 33); FREE(node_id_arg); + LDKPaymentForwardNode ret_var = PaymentForwardNode_new(tlvs_arg_conv, node_id_arg_ref, htlc_maximum_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); + return ret_ref; } -void CS_LDK_LockableScore_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); - LDKLockableScore this_ptr_conv = *(LDKLockableScore*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - LockableScore_free(this_ptr_conv); +static inline uint64_t PaymentForwardNode_clone_ptr(LDKPaymentForwardNode *NONNULL_PTR arg) { + LDKPaymentForwardNode ret_var = PaymentForwardNode_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_PaymentForwardNode_clone_ptr(int64_t arg) { + LDKPaymentForwardNode 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 = PaymentForwardNode_clone_ptr(&arg_conv); + return ret_conv; } -void CS_LDK_WriteableScore_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); - LDKWriteableScore this_ptr_conv = *(LDKWriteableScore*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - WriteableScore_free(this_ptr_conv); +int64_t CS_LDK_PaymentForwardNode_clone(int64_t orig) { + LDKPaymentForwardNode 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; + LDKPaymentForwardNode ret_var = PaymentForwardNode_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_MultiThreadedLockableScore_free(int64_t this_obj) { - LDKMultiThreadedLockableScore this_obj_conv; +void CS_LDK_ForwardTlvs_free(int64_t this_obj) { + LDKForwardTlvs this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - MultiThreadedLockableScore_free(this_obj_conv); + ForwardTlvs_free(this_obj_conv); } -int64_t CS_LDK_MultiThreadedLockableScore_as_LockableScore(int64_t this_arg) { - LDKMultiThreadedLockableScore this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKLockableScore* ret_ret = MALLOC(sizeof(LDKLockableScore), "LDKLockableScore"); - *ret_ret = MultiThreadedLockableScore_as_LockableScore(&this_arg_conv); - return tag_ptr(ret_ret, true); +int64_t CS_LDK_ForwardTlvs_get_short_channel_id(int64_t this_ptr) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = ForwardTlvs_get_short_channel_id(&this_ptr_conv); + return ret_conv; } -int8_tArray CS_LDK_MultiThreadedLockableScore_write(int64_t obj) { - LDKMultiThreadedLockableScore obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = MultiThreadedLockableScore_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +void CS_LDK_ForwardTlvs_set_short_channel_id(int64_t this_ptr, int64_t val) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ForwardTlvs_set_short_channel_id(&this_ptr_conv, val); } -int64_t CS_LDK_MultiThreadedLockableScore_as_WriteableScore(int64_t this_arg) { - LDKMultiThreadedLockableScore this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKWriteableScore* ret_ret = MALLOC(sizeof(LDKWriteableScore), "LDKWriteableScore"); - *ret_ret = MultiThreadedLockableScore_as_WriteableScore(&this_arg_conv); - return tag_ptr(ret_ret, true); +int64_t CS_LDK_ForwardTlvs_get_payment_relay(int64_t this_ptr) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPaymentRelay ret_var = ForwardTlvs_get_payment_relay(&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; } -int64_t CS_LDK_MultiThreadedLockableScore_new(int64_t score) { - void* score_ptr = untag_ptr(score); - CHECK_ACCESS(score_ptr); - LDKScore score_conv = *(LDKScore*)(score_ptr); - if (score_conv.free == LDKScore_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKScore_JCalls_cloned(&score_conv); - } - LDKMultiThreadedLockableScore ret_var = MultiThreadedLockableScore_new(score_conv); +void CS_LDK_ForwardTlvs_set_payment_relay(int64_t this_ptr, int64_t val) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPaymentRelay 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 = PaymentRelay_clone(&val_conv); + ForwardTlvs_set_payment_relay(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_ForwardTlvs_get_payment_constraints(int64_t this_ptr) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPaymentConstraints ret_var = ForwardTlvs_get_payment_constraints(&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_MultiThreadedScoreLockRead_free(int64_t this_obj) { - LDKMultiThreadedScoreLockRead this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - MultiThreadedScoreLockRead_free(this_obj_conv); +void CS_LDK_ForwardTlvs_set_payment_constraints(int64_t this_ptr, int64_t val) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPaymentConstraints 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 = PaymentConstraints_clone(&val_conv); + ForwardTlvs_set_payment_constraints(&this_ptr_conv, val_conv); } -void CS_LDK_MultiThreadedScoreLockWrite_free(int64_t this_obj) { - LDKMultiThreadedScoreLockWrite this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - MultiThreadedScoreLockWrite_free(this_obj_conv); +int64_t CS_LDK_ForwardTlvs_get_features(int64_t this_ptr) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBlindedHopFeatures ret_var = ForwardTlvs_get_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; } -int64_t CS_LDK_MultiThreadedScoreLockRead_as_ScoreLookUp(int64_t this_arg) { - LDKMultiThreadedScoreLockRead this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKScoreLookUp* ret_ret = MALLOC(sizeof(LDKScoreLookUp), "LDKScoreLookUp"); - *ret_ret = MultiThreadedScoreLockRead_as_ScoreLookUp(&this_arg_conv); - return tag_ptr(ret_ret, true); +void CS_LDK_ForwardTlvs_set_features(int64_t this_ptr, int64_t val) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBlindedHopFeatures val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = BlindedHopFeatures_clone(&val_conv); + ForwardTlvs_set_features(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_MultiThreadedScoreLockWrite_write(int64_t obj) { - LDKMultiThreadedScoreLockWrite 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 = MultiThreadedScoreLockWrite_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); +int8_tArray CS_LDK_ForwardTlvs_get_next_blinding_override(int64_t this_ptr) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(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, ForwardTlvs_get_next_blinding_override(&this_ptr_conv).compressed_form, 33); return ret_arr; } -int64_t CS_LDK_MultiThreadedScoreLockWrite_as_ScoreUpdate(int64_t this_arg) { - LDKMultiThreadedScoreLockWrite this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKScoreUpdate* ret_ret = MALLOC(sizeof(LDKScoreUpdate), "LDKScoreUpdate"); - *ret_ret = MultiThreadedScoreLockWrite_as_ScoreUpdate(&this_arg_conv); - return tag_ptr(ret_ret, true); +void CS_LDK_ForwardTlvs_set_next_blinding_override(int64_t this_ptr, int8_tArray val) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + ForwardTlvs_set_next_blinding_override(&this_ptr_conv, val_ref); } -void CS_LDK_ChannelUsage_free(int64_t this_obj) { - LDKChannelUsage this_obj_conv; +int64_t CS_LDK_ForwardTlvs_new(int64_t short_channel_id_arg, int64_t payment_relay_arg, int64_t payment_constraints_arg, int64_t features_arg, int8_tArray next_blinding_override_arg) { + LDKPaymentRelay payment_relay_arg_conv; + payment_relay_arg_conv.inner = untag_ptr(payment_relay_arg); + payment_relay_arg_conv.is_owned = ptr_is_owned(payment_relay_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_relay_arg_conv); + payment_relay_arg_conv = PaymentRelay_clone(&payment_relay_arg_conv); + LDKPaymentConstraints payment_constraints_arg_conv; + payment_constraints_arg_conv.inner = untag_ptr(payment_constraints_arg); + 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); + LDKBlindedHopFeatures features_arg_conv; + features_arg_conv.inner = untag_ptr(features_arg); + features_arg_conv.is_owned = ptr_is_owned(features_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); + features_arg_conv = BlindedHopFeatures_clone(&features_arg_conv); + LDKPublicKey next_blinding_override_arg_ref; + CHECK(next_blinding_override_arg->arr_len == 33); + memcpy(next_blinding_override_arg_ref.compressed_form, next_blinding_override_arg->elems, 33); FREE(next_blinding_override_arg); + LDKForwardTlvs ret_var = ForwardTlvs_new(short_channel_id_arg, payment_relay_arg_conv, payment_constraints_arg_conv, features_arg_conv, next_blinding_override_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 ForwardTlvs_clone_ptr(LDKForwardTlvs *NONNULL_PTR arg) { + LDKForwardTlvs ret_var = ForwardTlvs_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_ForwardTlvs_clone_ptr(int64_t arg) { + LDKForwardTlvs 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 = ForwardTlvs_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_ForwardTlvs_clone(int64_t orig) { + LDKForwardTlvs 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; + LDKForwardTlvs ret_var = ForwardTlvs_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_ReceiveTlvs_free(int64_t this_obj) { + LDKReceiveTlvs this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelUsage_free(this_obj_conv); + ReceiveTlvs_free(this_obj_conv); } -int64_t CS_LDK_ChannelUsage_get_amount_msat(int64_t this_ptr) { - LDKChannelUsage this_ptr_conv; +int8_tArray CS_LDK_ReceiveTlvs_get_payment_secret(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; - int64_t ret_conv = ChannelUsage_get_amount_msat(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *ReceiveTlvs_get_payment_secret(&this_ptr_conv), 32); + return ret_arr; } -void CS_LDK_ChannelUsage_set_amount_msat(int64_t this_ptr, int64_t val) { - LDKChannelUsage this_ptr_conv; +void CS_LDK_ReceiveTlvs_set_payment_secret(int64_t this_ptr, int8_tArray 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; - ChannelUsage_set_amount_msat(&this_ptr_conv, val); + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + ReceiveTlvs_set_payment_secret(&this_ptr_conv, val_ref); } -int64_t CS_LDK_ChannelUsage_get_inflight_htlc_msat(int64_t this_ptr) { - LDKChannelUsage this_ptr_conv; +int64_t CS_LDK_ReceiveTlvs_get_payment_constraints(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; - int64_t ret_conv = ChannelUsage_get_inflight_htlc_msat(&this_ptr_conv); - return ret_conv; + LDKPaymentConstraints ret_var = ReceiveTlvs_get_payment_constraints(&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_ChannelUsage_set_inflight_htlc_msat(int64_t this_ptr, int64_t val) { - LDKChannelUsage this_ptr_conv; +void CS_LDK_ReceiveTlvs_set_payment_constraints(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; - ChannelUsage_set_inflight_htlc_msat(&this_ptr_conv, val); + LDKPaymentConstraints 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 = PaymentConstraints_clone(&val_conv); + ReceiveTlvs_set_payment_constraints(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelUsage_get_effective_capacity(int64_t this_ptr) { - LDKChannelUsage this_ptr_conv; +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; - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = ChannelUsage_get_effective_capacity(&this_ptr_conv); + 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_ChannelUsage_set_effective_capacity(int64_t this_ptr, int64_t val) { - LDKChannelUsage this_ptr_conv; +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); - LDKEffectiveCapacity val_conv = *(LDKEffectiveCapacity*)(val_ptr); - val_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(val)); - ChannelUsage_set_effective_capacity(&this_ptr_conv, val_conv); + 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_ChannelUsage_new(int64_t amount_msat_arg, int64_t inflight_htlc_msat_arg, int64_t effective_capacity_arg) { - void* effective_capacity_arg_ptr = untag_ptr(effective_capacity_arg); - CHECK_ACCESS(effective_capacity_arg_ptr); - LDKEffectiveCapacity effective_capacity_arg_conv = *(LDKEffectiveCapacity*)(effective_capacity_arg_ptr); - effective_capacity_arg_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(effective_capacity_arg)); - LDKChannelUsage ret_var = ChannelUsage_new(amount_msat_arg, inflight_htlc_msat_arg, effective_capacity_arg_conv); +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); + LDKPaymentConstraints payment_constraints_arg_conv; + payment_constraints_arg_conv.inner = untag_ptr(payment_constraints_arg); + 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); + 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); return ret_ref; } -static inline uint64_t ChannelUsage_clone_ptr(LDKChannelUsage *NONNULL_PTR arg) { - LDKChannelUsage ret_var = ChannelUsage_clone(arg); +static inline uint64_t ReceiveTlvs_clone_ptr(LDKReceiveTlvs *NONNULL_PTR arg) { + LDKReceiveTlvs ret_var = ReceiveTlvs_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_ChannelUsage_clone_ptr(int64_t arg) { - LDKChannelUsage arg_conv; +int64_t CS_LDK_ReceiveTlvs_clone_ptr(int64_t arg) { + LDKReceiveTlvs arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = ChannelUsage_clone_ptr(&arg_conv); + int64_t ret_conv = ReceiveTlvs_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_ChannelUsage_clone(int64_t orig) { - LDKChannelUsage orig_conv; +int64_t CS_LDK_ReceiveTlvs_clone(int64_t orig) { + LDKReceiveTlvs orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKChannelUsage ret_var = ChannelUsage_clone(&orig_conv); + LDKReceiveTlvs ret_var = ReceiveTlvs_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_FixedPenaltyScorer_free(int64_t this_obj) { - LDKFixedPenaltyScorer this_obj_conv; +void CS_LDK_PaymentRelay_free(int64_t this_obj) { + LDKPaymentRelay this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - FixedPenaltyScorer_free(this_obj_conv); + PaymentRelay_free(this_obj_conv); } -static inline uint64_t FixedPenaltyScorer_clone_ptr(LDKFixedPenaltyScorer *NONNULL_PTR arg) { - LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_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_FixedPenaltyScorer_clone_ptr(int64_t arg) { - LDKFixedPenaltyScorer arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = FixedPenaltyScorer_clone_ptr(&arg_conv); - return ret_conv; -} - -int64_t CS_LDK_FixedPenaltyScorer_clone(int64_t orig) { - LDKFixedPenaltyScorer orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(&orig_conv); - int64_t ret_ref = 0; - 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_FixedPenaltyScorer_with_penalty(int64_t penalty_msat) { - LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_with_penalty(penalty_msat); - int64_t ret_ref = 0; - 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_FixedPenaltyScorer_as_ScoreLookUp(int64_t this_arg) { - LDKFixedPenaltyScorer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKScoreLookUp* ret_ret = MALLOC(sizeof(LDKScoreLookUp), "LDKScoreLookUp"); - *ret_ret = FixedPenaltyScorer_as_ScoreLookUp(&this_arg_conv); - return tag_ptr(ret_ret, true); -} - -int64_t CS_LDK_FixedPenaltyScorer_as_ScoreUpdate(int64_t this_arg) { - LDKFixedPenaltyScorer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKScoreUpdate* ret_ret = MALLOC(sizeof(LDKScoreUpdate), "LDKScoreUpdate"); - *ret_ret = FixedPenaltyScorer_as_ScoreUpdate(&this_arg_conv); - return tag_ptr(ret_ret, true); -} - -int8_tArray CS_LDK_FixedPenaltyScorer_write(int64_t obj) { - LDKFixedPenaltyScorer obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = FixedPenaltyScorer_write(&obj_conv); - int8_tArray 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_FixedPenaltyScorer_read(int8_tArray ser, int64_t arg) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); - *ret_conv = FixedPenaltyScorer_read(ser_ref, arg); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -void CS_LDK_ProbabilisticScorer_free(int64_t this_obj) { - LDKProbabilisticScorer this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ProbabilisticScorer_free(this_obj_conv); -} - -void CS_LDK_ProbabilisticScoringFeeParameters_free(int64_t this_obj) { - LDKProbabilisticScoringFeeParameters this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ProbabilisticScoringFeeParameters_free(this_obj_conv); -} - -int64_t CS_LDK_ProbabilisticScoringFeeParameters_get_base_penalty_msat(int64_t this_ptr) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +int16_t CS_LDK_PaymentRelay_get_cltv_expiry_delta(int64_t this_ptr) { + LDKPaymentRelay this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = ProbabilisticScoringFeeParameters_get_base_penalty_msat(&this_ptr_conv); + int16_t ret_conv = PaymentRelay_get_cltv_expiry_delta(&this_ptr_conv); return ret_conv; } -void CS_LDK_ProbabilisticScoringFeeParameters_set_base_penalty_msat(int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +void CS_LDK_PaymentRelay_set_cltv_expiry_delta(int64_t this_ptr, int16_t val) { + LDKPaymentRelay this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_base_penalty_msat(&this_ptr_conv, val); + PaymentRelay_set_cltv_expiry_delta(&this_ptr_conv, val); } -int64_t CS_LDK_ProbabilisticScoringFeeParameters_get_base_penalty_amount_multiplier_msat(int64_t this_ptr) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +int32_t CS_LDK_PaymentRelay_get_fee_proportional_millionths(int64_t this_ptr) { + LDKPaymentRelay this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = ProbabilisticScoringFeeParameters_get_base_penalty_amount_multiplier_msat(&this_ptr_conv); + int32_t ret_conv = PaymentRelay_get_fee_proportional_millionths(&this_ptr_conv); return ret_conv; } -void CS_LDK_ProbabilisticScoringFeeParameters_set_base_penalty_amount_multiplier_msat(int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +void CS_LDK_PaymentRelay_set_fee_proportional_millionths(int64_t this_ptr, int32_t val) { + LDKPaymentRelay this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_base_penalty_amount_multiplier_msat(&this_ptr_conv, val); + PaymentRelay_set_fee_proportional_millionths(&this_ptr_conv, val); } -int64_t CS_LDK_ProbabilisticScoringFeeParameters_get_liquidity_penalty_multiplier_msat(int64_t this_ptr) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +int32_t CS_LDK_PaymentRelay_get_fee_base_msat(int64_t this_ptr) { + LDKPaymentRelay this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = ProbabilisticScoringFeeParameters_get_liquidity_penalty_multiplier_msat(&this_ptr_conv); + int32_t ret_conv = PaymentRelay_get_fee_base_msat(&this_ptr_conv); return ret_conv; } -void CS_LDK_ProbabilisticScoringFeeParameters_set_liquidity_penalty_multiplier_msat(int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +void CS_LDK_PaymentRelay_set_fee_base_msat(int64_t this_ptr, int32_t val) { + LDKPaymentRelay this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_liquidity_penalty_multiplier_msat(&this_ptr_conv, val); + PaymentRelay_set_fee_base_msat(&this_ptr_conv, val); } -int64_t CS_LDK_ProbabilisticScoringFeeParameters_get_liquidity_penalty_amount_multiplier_msat(int64_t this_ptr) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = ProbabilisticScoringFeeParameters_get_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_PaymentRelay_new(int16_t cltv_expiry_delta_arg, int32_t fee_proportional_millionths_arg, int32_t fee_base_msat_arg) { + LDKPaymentRelay ret_var = PaymentRelay_new(cltv_expiry_delta_arg, fee_proportional_millionths_arg, fee_base_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); + return ret_ref; } -void CS_LDK_ProbabilisticScoringFeeParameters_set_liquidity_penalty_amount_multiplier_msat(int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val); +static inline uint64_t PaymentRelay_clone_ptr(LDKPaymentRelay *NONNULL_PTR arg) { + LDKPaymentRelay ret_var = PaymentRelay_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_ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_multiplier_msat(int64_t this_ptr) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_multiplier_msat(&this_ptr_conv); +int64_t CS_LDK_PaymentRelay_clone_ptr(int64_t arg) { + LDKPaymentRelay 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 = PaymentRelay_clone_ptr(&arg_conv); return ret_conv; } -void CS_LDK_ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_multiplier_msat(int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_multiplier_msat(&this_ptr_conv, val); -} - -int64_t CS_LDK_ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_amount_multiplier_msat(int64_t this_ptr) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_PaymentRelay_clone(int64_t orig) { + LDKPaymentRelay 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; + LDKPaymentRelay ret_var = PaymentRelay_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_ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_amount_multiplier_msat(int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val); +void CS_LDK_PaymentConstraints_free(int64_t this_obj) { + LDKPaymentConstraints this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + PaymentConstraints_free(this_obj_conv); } -int64_t CS_LDK_ProbabilisticScoringFeeParameters_get_anti_probing_penalty_msat(int64_t this_ptr) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +int32_t CS_LDK_PaymentConstraints_get_max_cltv_expiry(int64_t this_ptr) { + LDKPaymentConstraints this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = ProbabilisticScoringFeeParameters_get_anti_probing_penalty_msat(&this_ptr_conv); + int32_t ret_conv = PaymentConstraints_get_max_cltv_expiry(&this_ptr_conv); return ret_conv; } -void CS_LDK_ProbabilisticScoringFeeParameters_set_anti_probing_penalty_msat(int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +void CS_LDK_PaymentConstraints_set_max_cltv_expiry(int64_t this_ptr, int32_t val) { + LDKPaymentConstraints this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_anti_probing_penalty_msat(&this_ptr_conv, val); + PaymentConstraints_set_max_cltv_expiry(&this_ptr_conv, val); } -int64_t CS_LDK_ProbabilisticScoringFeeParameters_get_considered_impossible_penalty_msat(int64_t this_ptr) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +int64_t CS_LDK_PaymentConstraints_get_htlc_minimum_msat(int64_t this_ptr) { + LDKPaymentConstraints this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = ProbabilisticScoringFeeParameters_get_considered_impossible_penalty_msat(&this_ptr_conv); + int64_t ret_conv = PaymentConstraints_get_htlc_minimum_msat(&this_ptr_conv); return ret_conv; } -void CS_LDK_ProbabilisticScoringFeeParameters_set_considered_impossible_penalty_msat(int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_considered_impossible_penalty_msat(&this_ptr_conv, val); -} - -jboolean CS_LDK_ProbabilisticScoringFeeParameters_get_linear_success_probability(int64_t this_ptr) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +void CS_LDK_PaymentConstraints_set_htlc_minimum_msat(int64_t this_ptr, int64_t val) { + LDKPaymentConstraints this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = ProbabilisticScoringFeeParameters_get_linear_success_probability(&this_ptr_conv); - return ret_conv; + PaymentConstraints_set_htlc_minimum_msat(&this_ptr_conv, val); } -void CS_LDK_ProbabilisticScoringFeeParameters_set_linear_success_probability(int64_t this_ptr, jboolean val) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_linear_success_probability(&this_ptr_conv, val); +int64_t CS_LDK_PaymentConstraints_new(int32_t max_cltv_expiry_arg, int64_t htlc_minimum_msat_arg) { + LDKPaymentConstraints ret_var = PaymentConstraints_new(max_cltv_expiry_arg, htlc_minimum_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); + return ret_ref; } -static inline uint64_t ProbabilisticScoringFeeParameters_clone_ptr(LDKProbabilisticScoringFeeParameters *NONNULL_PTR arg) { - LDKProbabilisticScoringFeeParameters ret_var = ProbabilisticScoringFeeParameters_clone(arg); +static inline uint64_t PaymentConstraints_clone_ptr(LDKPaymentConstraints *NONNULL_PTR arg) { + LDKPaymentConstraints ret_var = PaymentConstraints_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_ProbabilisticScoringFeeParameters_clone_ptr(int64_t arg) { - LDKProbabilisticScoringFeeParameters arg_conv; +int64_t CS_LDK_PaymentConstraints_clone_ptr(int64_t arg) { + LDKPaymentConstraints 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 = ProbabilisticScoringFeeParameters_clone_ptr(&arg_conv); + int64_t ret_conv = PaymentConstraints_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_ProbabilisticScoringFeeParameters_clone(int64_t orig) { - LDKProbabilisticScoringFeeParameters orig_conv; +int64_t CS_LDK_PaymentConstraints_clone(int64_t orig) { + LDKPaymentConstraints 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; - LDKProbabilisticScoringFeeParameters ret_var = ProbabilisticScoringFeeParameters_clone(&orig_conv); + LDKPaymentConstraints ret_var = PaymentConstraints_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_ProbabilisticScoringFeeParameters_default() { - LDKProbabilisticScoringFeeParameters ret_var = ProbabilisticScoringFeeParameters_default(); - int64_t ret_ref = 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_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); } -void CS_LDK_ProbabilisticScoringFeeParameters_add_banned(int64_t this_arg, int64_t node_id) { - LDKProbabilisticScoringFeeParameters this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId node_id_conv; - node_id_conv.inner = untag_ptr(node_id); - node_id_conv.is_owned = ptr_is_owned(node_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); - node_id_conv.is_owned = false; - ProbabilisticScoringFeeParameters_add_banned(&this_arg_conv, &node_id_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; } -void CS_LDK_ProbabilisticScoringFeeParameters_add_banned_from_list(int64_t this_arg, int64_tArray node_ids) { - LDKProbabilisticScoringFeeParameters this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_NodeIdZ node_ids_constr; - node_ids_constr.datalen = node_ids->arr_len; - if (node_ids_constr.datalen > 0) - node_ids_constr.data = MALLOC(node_ids_constr.datalen * sizeof(LDKNodeId), "LDKCVec_NodeIdZ Elements"); - else - node_ids_constr.data = NULL; - int64_t* node_ids_vals = node_ids->elems; - for (size_t i = 0; i < node_ids_constr.datalen; i++) { - int64_t node_ids_conv_8 = node_ids_vals[i]; - LDKNodeId node_ids_conv_8_conv; - node_ids_conv_8_conv.inner = untag_ptr(node_ids_conv_8); - node_ids_conv_8_conv.is_owned = ptr_is_owned(node_ids_conv_8); - CHECK_INNER_FIELD_ACCESS_OR_NULL(node_ids_conv_8_conv); - node_ids_conv_8_conv = NodeId_clone(&node_ids_conv_8_conv); - node_ids_constr.data[i] = node_ids_conv_8_conv; - } - FREE(node_ids); - ProbabilisticScoringFeeParameters_add_banned_from_list(&this_arg_conv, node_ids_constr); +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; } -void CS_LDK_ProbabilisticScoringFeeParameters_remove_banned(int64_t this_arg, int64_t node_id) { - LDKProbabilisticScoringFeeParameters this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId node_id_conv; - node_id_conv.inner = untag_ptr(node_id); - node_id_conv.is_owned = ptr_is_owned(node_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); - node_id_conv.is_owned = false; - ProbabilisticScoringFeeParameters_remove_banned(&this_arg_conv, &node_id_conv); +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; } -void CS_LDK_ProbabilisticScoringFeeParameters_set_manual_penalty(int64_t this_arg, int64_t node_id, int64_t penalty) { - LDKProbabilisticScoringFeeParameters this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId node_id_conv; - node_id_conv.inner = untag_ptr(node_id); - node_id_conv.is_owned = ptr_is_owned(node_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); - node_id_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_manual_penalty(&this_arg_conv, &node_id_conv, penalty); +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; } -void CS_LDK_ProbabilisticScoringFeeParameters_remove_manual_penalty(int64_t this_arg, int64_t node_id) { - LDKProbabilisticScoringFeeParameters this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId node_id_conv; - node_id_conv.inner = untag_ptr(node_id); - node_id_conv.is_owned = ptr_is_owned(node_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); - node_id_conv.is_owned = false; - ProbabilisticScoringFeeParameters_remove_manual_penalty(&this_arg_conv, &node_id_conv); +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; } -void CS_LDK_ProbabilisticScoringFeeParameters_clear_manual_penalties(int64_t this_arg) { - LDKProbabilisticScoringFeeParameters this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - ProbabilisticScoringFeeParameters_clear_manual_penalties(&this_arg_conv); +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_ProbabilisticScoringDecayParameters_free(int64_t this_obj) { - LDKProbabilisticScoringDecayParameters this_obj_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); - ProbabilisticScoringDecayParameters_free(this_obj_conv); -} - -int64_t CS_LDK_ProbabilisticScoringDecayParameters_get_historical_no_updates_half_life(int64_t this_ptr) { - LDKProbabilisticScoringDecayParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = ProbabilisticScoringDecayParameters_get_historical_no_updates_half_life(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_ProbabilisticScoringDecayParameters_set_historical_no_updates_half_life(int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringDecayParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ProbabilisticScoringDecayParameters_set_historical_no_updates_half_life(&this_ptr_conv, val); -} - -int64_t CS_LDK_ProbabilisticScoringDecayParameters_get_liquidity_offset_half_life(int64_t this_ptr) { - LDKProbabilisticScoringDecayParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = ProbabilisticScoringDecayParameters_get_liquidity_offset_half_life(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_ProbabilisticScoringDecayParameters_set_liquidity_offset_half_life(int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringDecayParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ProbabilisticScoringDecayParameters_set_liquidity_offset_half_life(&this_ptr_conv, val); -} - -int64_t CS_LDK_ProbabilisticScoringDecayParameters_new(int64_t historical_no_updates_half_life_arg, int64_t liquidity_offset_half_life_arg) { - LDKProbabilisticScoringDecayParameters ret_var = ProbabilisticScoringDecayParameters_new(historical_no_updates_half_life_arg, liquidity_offset_half_life_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; + UnknownPaymentContext_free(this_obj_conv); } -static inline uint64_t ProbabilisticScoringDecayParameters_clone_ptr(LDKProbabilisticScoringDecayParameters *NONNULL_PTR arg) { - LDKProbabilisticScoringDecayParameters ret_var = ProbabilisticScoringDecayParameters_clone(arg); +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_ProbabilisticScoringDecayParameters_clone_ptr(int64_t arg) { - LDKProbabilisticScoringDecayParameters arg_conv; +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 = ProbabilisticScoringDecayParameters_clone_ptr(&arg_conv); + int64_t ret_conv = UnknownPaymentContext_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_ProbabilisticScoringDecayParameters_clone(int64_t orig) { - LDKProbabilisticScoringDecayParameters orig_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; - LDKProbabilisticScoringDecayParameters ret_var = ProbabilisticScoringDecayParameters_clone(&orig_conv); + 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; } -int64_t CS_LDK_ProbabilisticScoringDecayParameters_default() { - LDKProbabilisticScoringDecayParameters ret_var = ProbabilisticScoringDecayParameters_default(); - int64_t ret_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; } -int64_t CS_LDK_ProbabilisticScorer_new(int64_t decay_params, int64_t network_graph, int64_t logger) { - LDKProbabilisticScoringDecayParameters decay_params_conv; - decay_params_conv.inner = untag_ptr(decay_params); - decay_params_conv.is_owned = ptr_is_owned(decay_params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(decay_params_conv); - decay_params_conv = ProbabilisticScoringDecayParameters_clone(&decay_params_conv); - LDKNetworkGraph network_graph_conv; - network_graph_conv.inner = untag_ptr(network_graph); - network_graph_conv.is_owned = ptr_is_owned(network_graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - network_graph_conv.is_owned = false; - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKProbabilisticScorer ret_var = ProbabilisticScorer_new(decay_params_conv, &network_graph_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; -} - -void CS_LDK_ProbabilisticScorer_debug_log_liquidity_stats(int64_t this_arg) { - LDKProbabilisticScorer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - ProbabilisticScorer_debug_log_liquidity_stats(&this_arg_conv); -} - -int64_t CS_LDK_ProbabilisticScorer_estimated_channel_liquidity_range(int64_t this_arg, int64_t scid, int64_t target) { - LDKProbabilisticScorer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId target_conv; - target_conv.inner = untag_ptr(target); - target_conv.is_owned = ptr_is_owned(target); - CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); - target_conv.is_owned = false; - LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ"); - *ret_copy = ProbabilisticScorer_estimated_channel_liquidity_range(&this_arg_conv, scid, &target_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_ProbabilisticScorer_historical_estimated_channel_liquidity_probabilities(int64_t this_arg, int64_t scid, int64_t target) { - LDKProbabilisticScorer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId target_conv; - target_conv.inner = untag_ptr(target); - target_conv.is_owned = ptr_is_owned(target); - CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); - target_conv.is_owned = false; - LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ), "LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ"); - *ret_copy = ProbabilisticScorer_historical_estimated_channel_liquidity_probabilities(&this_arg_conv, scid, &target_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_ProbabilisticScorer_historical_estimated_payment_success_probability(int64_t this_arg, int64_t scid, int64_t target, int64_t amount_msat, int64_t params) { - LDKProbabilisticScorer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId target_conv; - target_conv.inner = untag_ptr(target); - target_conv.is_owned = ptr_is_owned(target); - CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); - target_conv.is_owned = false; - LDKProbabilisticScoringFeeParameters params_conv; - params_conv.inner = untag_ptr(params); - params_conv.is_owned = ptr_is_owned(params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); - params_conv.is_owned = false; - LDKCOption_f64Z *ret_copy = MALLOC(sizeof(LDKCOption_f64Z), "LDKCOption_f64Z"); - *ret_copy = ProbabilisticScorer_historical_estimated_payment_success_probability(&this_arg_conv, scid, &target_conv, amount_msat, ¶ms_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_ProbabilisticScorer_as_ScoreLookUp(int64_t this_arg) { - LDKProbabilisticScorer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKScoreLookUp* ret_ret = MALLOC(sizeof(LDKScoreLookUp), "LDKScoreLookUp"); - *ret_ret = ProbabilisticScorer_as_ScoreLookUp(&this_arg_conv); - return tag_ptr(ret_ret, true); -} - -int64_t CS_LDK_ProbabilisticScorer_as_ScoreUpdate(int64_t this_arg) { - LDKProbabilisticScorer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKScoreUpdate* ret_ret = MALLOC(sizeof(LDKScoreUpdate), "LDKScoreUpdate"); - *ret_ret = ProbabilisticScorer_as_ScoreUpdate(&this_arg_conv); - return tag_ptr(ret_ret, true); -} - -int64_t CS_LDK_ProbabilisticScorer_as_Score(int64_t this_arg) { - LDKProbabilisticScorer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore"); - *ret_ret = ProbabilisticScorer_as_Score(&this_arg_conv); - return tag_ptr(ret_ret, true); -} - -int8_tArray CS_LDK_ProbabilisticScorer_write(int64_t obj) { - LDKProbabilisticScorer obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ProbabilisticScorer_write(&obj_conv); - int8_tArray 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_ProbabilisticScorer_read(int8_tArray ser, int64_t arg_a, int64_t arg_b, int64_t arg_c) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKProbabilisticScoringDecayParameters arg_a_conv; - arg_a_conv.inner = untag_ptr(arg_a); - arg_a_conv.is_owned = ptr_is_owned(arg_a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_a_conv); - arg_a_conv = ProbabilisticScoringDecayParameters_clone(&arg_a_conv); - LDKNetworkGraph arg_b_conv; - arg_b_conv.inner = untag_ptr(arg_b); - arg_b_conv.is_owned = ptr_is_owned(arg_b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_b_conv); - arg_b_conv.is_owned = false; - void* arg_c_ptr = untag_ptr(arg_c); - CHECK_ACCESS(arg_c_ptr); - LDKLogger arg_c_conv = *(LDKLogger*)(arg_c_ptr); - if (arg_c_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&arg_c_conv); - } - LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ"); - *ret_conv = ProbabilisticScorer_read(ser_ref, arg_a_conv, &arg_b_conv, arg_c_conv); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -void CS_LDK_DelayedPaymentOutputDescriptor_free(int64_t this_obj) { - LDKDelayedPaymentOutputDescriptor this_obj_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); - DelayedPaymentOutputDescriptor_free(this_obj_conv); + Bolt12OfferContext_free(this_obj_conv); } -int64_t CS_LDK_DelayedPaymentOutputDescriptor_get_outpoint(int64_t this_ptr) { - LDKDelayedPaymentOutputDescriptor this_ptr_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; - LDKOutPoint ret_var = DelayedPaymentOutputDescriptor_get_outpoint(&this_ptr_conv); + 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_DelayedPaymentOutputDescriptor_set_outpoint(int64_t this_ptr, int64_t val) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; +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; - LDKOutPoint val_conv; + 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 = OutPoint_clone(&val_conv); - DelayedPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv); -} - -int8_tArray CS_LDK_DelayedPaymentOutputDescriptor_get_per_commitment_point(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; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, DelayedPaymentOutputDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form, 33); - return ret_arr; -} - -void CS_LDK_DelayedPaymentOutputDescriptor_set_per_commitment_point(int64_t this_ptr, int8_tArray 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; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - DelayedPaymentOutputDescriptor_set_per_commitment_point(&this_ptr_conv, val_ref); -} - -int16_t CS_LDK_DelayedPaymentOutputDescriptor_get_to_self_delay(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; - int16_t ret_conv = DelayedPaymentOutputDescriptor_get_to_self_delay(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_DelayedPaymentOutputDescriptor_set_to_self_delay(int64_t this_ptr, int16_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; - DelayedPaymentOutputDescriptor_set_to_self_delay(&this_ptr_conv, val); -} - -int64_t CS_LDK_DelayedPaymentOutputDescriptor_get_output(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; - LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); - *ret_ref = DelayedPaymentOutputDescriptor_get_output(&this_ptr_conv); - return tag_ptr(ret_ref, true); -} - -void CS_LDK_DelayedPaymentOutputDescriptor_set_output(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; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); - val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val)); - DelayedPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv); + val_conv = OfferId_clone(&val_conv); + Bolt12OfferContext_set_offer_id(&this_ptr_conv, val_conv); } -int64_t CS_LDK_DelayedPaymentOutputDescriptor_get_revocation_pubkey(int64_t this_ptr) { - LDKDelayedPaymentOutputDescriptor this_ptr_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; - LDKRevocationKey ret_var = DelayedPaymentOutputDescriptor_get_revocation_pubkey(&this_ptr_conv); + 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_DelayedPaymentOutputDescriptor_set_revocation_pubkey(int64_t this_ptr, int64_t val) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; +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; - LDKRevocationKey val_conv; + 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 = RevocationKey_clone(&val_conv); - DelayedPaymentOutputDescriptor_set_revocation_pubkey(&this_ptr_conv, val_conv); + val_conv = InvoiceRequestFields_clone(&val_conv); + Bolt12OfferContext_set_invoice_request(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_DelayedPaymentOutputDescriptor_get_channel_keys_id(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; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *DelayedPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv), 32); - return ret_arr; +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; } -void CS_LDK_DelayedPaymentOutputDescriptor_set_channel_keys_id(int64_t this_ptr, int8_tArray 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; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - DelayedPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_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_DelayedPaymentOutputDescriptor_get_channel_value_satoshis(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; - int64_t ret_conv = DelayedPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv); +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; } -void CS_LDK_DelayedPaymentOutputDescriptor_set_channel_value_satoshis(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; - DelayedPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); -} - -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 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; } -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); +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; } -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); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); - outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); - 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); - void* output_arg_ptr = untag_ptr(output_arg); - CHECK_ACCESS(output_arg_ptr); - LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr); - output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg)); - LDKRevocationKey revocation_pubkey_arg_conv; - revocation_pubkey_arg_conv.inner = untag_ptr(revocation_pubkey_arg); - revocation_pubkey_arg_conv.is_owned = ptr_is_owned(revocation_pubkey_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(revocation_pubkey_arg_conv); - revocation_pubkey_arg_conv = RevocationKey_clone(&revocation_pubkey_arg_conv); - 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); - 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); +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 DelayedPaymentOutputDescriptor_clone_ptr(LDKDelayedPaymentOutputDescriptor *NONNULL_PTR arg) { - LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(arg); +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_DelayedPaymentOutputDescriptor_clone_ptr(int64_t arg) { - LDKDelayedPaymentOutputDescriptor arg_conv; +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 = DelayedPaymentOutputDescriptor_clone_ptr(&arg_conv); + int64_t ret_conv = Bolt12RefundContext_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_DelayedPaymentOutputDescriptor_clone(int64_t orig) { - LDKDelayedPaymentOutputDescriptor orig_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; - LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(&orig_conv); + 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; } -int64_t CS_LDK_DelayedPaymentOutputDescriptor_hash(int64_t o) { - LDKDelayedPaymentOutputDescriptor o_conv; - 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 = DelayedPaymentOutputDescriptor_hash(&o_conv); - return ret_conv; -} - -jboolean CS_LDK_DelayedPaymentOutputDescriptor_eq(int64_t a, int64_t b) { - LDKDelayedPaymentOutputDescriptor a_conv; +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; - LDKDelayedPaymentOutputDescriptor b_conv; + 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 = DelayedPaymentOutputDescriptor_eq(&a_conv, &b_conv); + jboolean ret_conv = Bolt12RefundContext_eq(&a_conv, &b_conv); return ret_conv; } -int8_tArray CS_LDK_DelayedPaymentOutputDescriptor_write(int64_t obj) { - LDKDelayedPaymentOutputDescriptor obj_conv; +int8_tArray CS_LDK_ForwardTlvs_write(int64_t obj) { + LDKForwardTlvs 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 = DelayedPaymentOutputDescriptor_write(&obj_conv); + LDKCVec_u8Z ret_var = ForwardTlvs_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_DelayedPaymentOutputDescriptor_read(int8_tArray ser) { +int8_tArray CS_LDK_ReceiveTlvs_write(int64_t obj) { + LDKReceiveTlvs 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 = ReceiveTlvs_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_PaymentRelay_write(int64_t obj) { + LDKPaymentRelay 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 = PaymentRelay_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_PaymentRelay_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); - *ret_conv = DelayedPaymentOutputDescriptor_read(ser_ref); + LDKCResult_PaymentRelayDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentRelayDecodeErrorZ), "LDKCResult_PaymentRelayDecodeErrorZ"); + *ret_conv = PaymentRelay_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_StaticPaymentOutputDescriptor_free(int64_t this_obj) { - LDKStaticPaymentOutputDescriptor this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - StaticPaymentOutputDescriptor_free(this_obj_conv); +int8_tArray CS_LDK_PaymentConstraints_write(int64_t obj) { + LDKPaymentConstraints 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 = PaymentConstraints_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_StaticPaymentOutputDescriptor_get_outpoint(int64_t this_ptr) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKOutPoint ret_var = StaticPaymentOutputDescriptor_get_outpoint(&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; +int64_t CS_LDK_PaymentConstraints_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_PaymentConstraintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentConstraintsDecodeErrorZ), "LDKCResult_PaymentConstraintsDecodeErrorZ"); + *ret_conv = PaymentConstraints_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -void CS_LDK_StaticPaymentOutputDescriptor_set_outpoint(int64_t this_ptr, int64_t val) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKOutPoint val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = OutPoint_clone(&val_conv); - StaticPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv); -} - -int64_t CS_LDK_StaticPaymentOutputDescriptor_get_output(int64_t this_ptr) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); - *ret_ref = StaticPaymentOutputDescriptor_get_output(&this_ptr_conv); - return tag_ptr(ret_ref, 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; } -void CS_LDK_StaticPaymentOutputDescriptor_set_output(int64_t this_ptr, int64_t val) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); - val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val)); - StaticPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv); +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_StaticPaymentOutputDescriptor_get_channel_keys_id(int64_t this_ptr) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(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, *StaticPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv), 32); +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; } -void CS_LDK_StaticPaymentOutputDescriptor_set_channel_keys_id(int64_t this_ptr, int8_tArray val) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - StaticPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref); +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); } -int64_t CS_LDK_StaticPaymentOutputDescriptor_get_channel_value_satoshis(int64_t this_ptr) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = StaticPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv); - return ret_conv; +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; } -void CS_LDK_StaticPaymentOutputDescriptor_set_channel_value_satoshis(int64_t this_ptr, int64_t val) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - StaticPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); +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); } -int64_t CS_LDK_StaticPaymentOutputDescriptor_get_channel_transaction_parameters(int64_t this_ptr) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = StaticPaymentOutputDescriptor_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; +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; } -void CS_LDK_StaticPaymentOutputDescriptor_set_channel_transaction_parameters(int64_t this_ptr, int64_t val) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - StaticPaymentOutputDescriptor_set_channel_transaction_parameters(&this_ptr_conv, val_conv); +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); } -int64_t CS_LDK_StaticPaymentOutputDescriptor_new(int64_t outpoint_arg, int64_t output_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); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); - outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); - void* output_arg_ptr = untag_ptr(output_arg); - CHECK_ACCESS(output_arg_ptr); - LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr); - output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg)); - 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); - 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); - LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_new(outpoint_arg_conv, output_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); - return ret_ref; +void CS_LDK_BlindedMessagePath_free(int64_t this_obj) { + LDKBlindedMessagePath this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + BlindedMessagePath_free(this_obj_conv); } -static inline uint64_t StaticPaymentOutputDescriptor_clone_ptr(LDKStaticPaymentOutputDescriptor *NONNULL_PTR arg) { - LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(arg); +static inline uint64_t BlindedMessagePath_clone_ptr(LDKBlindedMessagePath *NONNULL_PTR arg) { + LDKBlindedMessagePath ret_var = BlindedMessagePath_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_StaticPaymentOutputDescriptor_clone_ptr(int64_t arg) { - LDKStaticPaymentOutputDescriptor arg_conv; +int64_t CS_LDK_BlindedMessagePath_clone_ptr(int64_t arg) { + LDKBlindedMessagePath 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 = StaticPaymentOutputDescriptor_clone_ptr(&arg_conv); + int64_t ret_conv = BlindedMessagePath_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_StaticPaymentOutputDescriptor_clone(int64_t orig) { - LDKStaticPaymentOutputDescriptor orig_conv; +int64_t CS_LDK_BlindedMessagePath_clone(int64_t orig) { + LDKBlindedMessagePath 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; - LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(&orig_conv); + LDKBlindedMessagePath ret_var = BlindedMessagePath_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_StaticPaymentOutputDescriptor_hash(int64_t o) { - LDKStaticPaymentOutputDescriptor o_conv; +int64_t CS_LDK_BlindedMessagePath_hash(int64_t o) { + LDKBlindedMessagePath o_conv; 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 = StaticPaymentOutputDescriptor_hash(&o_conv); + int64_t ret_conv = BlindedMessagePath_hash(&o_conv); return ret_conv; } -jboolean CS_LDK_StaticPaymentOutputDescriptor_eq(int64_t a, int64_t b) { - LDKStaticPaymentOutputDescriptor a_conv; +jboolean CS_LDK_BlindedMessagePath_eq(int64_t a, int64_t b) { + LDKBlindedMessagePath a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKStaticPaymentOutputDescriptor b_conv; + LDKBlindedMessagePath b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = StaticPaymentOutputDescriptor_eq(&a_conv, &b_conv); + jboolean ret_conv = BlindedMessagePath_eq(&a_conv, &b_conv); return ret_conv; } -int64_t CS_LDK_StaticPaymentOutputDescriptor_witness_script(int64_t this_arg) { - LDKStaticPaymentOutputDescriptor this_arg_conv; +int8_tArray CS_LDK_BlindedMessagePath_write(int64_t obj) { + LDKBlindedMessagePath 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 = BlindedMessagePath_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_BlindedMessagePath_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_BlindedMessagePathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathDecodeErrorZ), "LDKCResult_BlindedMessagePathDecodeErrorZ"); + *ret_conv = BlindedMessagePath_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_BlindedMessagePath_one_hop(int8_tArray recipient_node_id, int64_t context, int64_t entropy_source) { + LDKPublicKey recipient_node_id_ref; + CHECK(recipient_node_id->arr_len == 33); + memcpy(recipient_node_id_ref.compressed_form, recipient_node_id->elems, 33); FREE(recipient_node_id); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKMessageContext context_conv = *(LDKMessageContext*)(context_ptr); + context_conv = MessageContext_clone((LDKMessageContext*)untag_ptr(context)); + 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); + } + LDKCResult_BlindedMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathNoneZ), "LDKCResult_BlindedMessagePathNoneZ"); + *ret_conv = BlindedMessagePath_one_hop(recipient_node_id_ref, context_conv, entropy_source_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_BlindedMessagePath_new(int64_tArray intermediate_nodes, int8_tArray recipient_node_id, int64_t context, int64_t entropy_source) { + LDKCVec_MessageForwardNodeZ intermediate_nodes_constr; + intermediate_nodes_constr.datalen = intermediate_nodes->arr_len; + if (intermediate_nodes_constr.datalen > 0) + intermediate_nodes_constr.data = MALLOC(intermediate_nodes_constr.datalen * sizeof(LDKMessageForwardNode), "LDKCVec_MessageForwardNodeZ Elements"); + else + intermediate_nodes_constr.data = NULL; + int64_t* intermediate_nodes_vals = intermediate_nodes->elems; + for (size_t u = 0; u < intermediate_nodes_constr.datalen; u++) { + int64_t intermediate_nodes_conv_20 = intermediate_nodes_vals[u]; + LDKMessageForwardNode intermediate_nodes_conv_20_conv; + intermediate_nodes_conv_20_conv.inner = untag_ptr(intermediate_nodes_conv_20); + intermediate_nodes_conv_20_conv.is_owned = ptr_is_owned(intermediate_nodes_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(intermediate_nodes_conv_20_conv); + intermediate_nodes_conv_20_conv = MessageForwardNode_clone(&intermediate_nodes_conv_20_conv); + intermediate_nodes_constr.data[u] = intermediate_nodes_conv_20_conv; + } + FREE(intermediate_nodes); + LDKPublicKey recipient_node_id_ref; + CHECK(recipient_node_id->arr_len == 33); + memcpy(recipient_node_id_ref.compressed_form, recipient_node_id->elems, 33); FREE(recipient_node_id); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKMessageContext context_conv = *(LDKMessageContext*)(context_ptr); + context_conv = MessageContext_clone((LDKMessageContext*)untag_ptr(context)); + 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); + } + LDKCResult_BlindedMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathNoneZ), "LDKCResult_BlindedMessagePathNoneZ"); + *ret_conv = BlindedMessagePath_new(intermediate_nodes_constr, recipient_node_id_ref, context_conv, entropy_source_conv); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_BlindedMessagePath_use_compact_introduction_node(int64_t this_arg, int64_t network_graph) { + LDKBlindedMessagePath this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = StaticPaymentOutputDescriptor_witness_script(&this_arg_conv); + 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; + BlindedMessagePath_use_compact_introduction_node(&this_arg_conv, &network_graph_conv); +} + +int64_t CS_LDK_BlindedMessagePath_public_introduction_node_id(int64_t this_arg, int64_t network_graph) { + LDKBlindedMessagePath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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 = BlindedMessagePath_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; +} + +int64_t CS_LDK_BlindedMessagePath_introduction_node(int64_t this_arg) { + LDKBlindedMessagePath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); + *ret_copy = BlindedMessagePath_introduction_node(&this_arg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_StaticPaymentOutputDescriptor_max_witness_length(int64_t this_arg) { - LDKStaticPaymentOutputDescriptor this_arg_conv; +int8_tArray CS_LDK_BlindedMessagePath_blinding_point(int64_t this_arg) { + LDKBlindedMessagePath this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - int64_t ret_conv = StaticPaymentOutputDescriptor_max_witness_length(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, BlindedMessagePath_blinding_point(&this_arg_conv).compressed_form, 33); + return ret_arr; } -int8_tArray CS_LDK_StaticPaymentOutputDescriptor_write(int64_t obj) { - LDKStaticPaymentOutputDescriptor 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 = StaticPaymentOutputDescriptor_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); +int64_tArray CS_LDK_BlindedMessagePath_blinded_hops(int64_t this_arg) { + LDKBlindedMessagePath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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_BlindedHopZ ret_var = BlindedMessagePath_blinded_hops(&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 m = 0; m < ret_var.datalen; m++) { + LDKBlindedHop ret_conv_12_var = ret_var.data[m]; + int64_t ret_conv_12_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_var); + ret_conv_12_ref = tag_ptr(ret_conv_12_var.inner, ret_conv_12_var.is_owned); + ret_arr_ptr[m] = ret_conv_12_ref; + } + + FREE(ret_var.data); return ret_arr; } -int64_t CS_LDK_StaticPaymentOutputDescriptor_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); - *ret_conv = StaticPaymentOutputDescriptor_read(ser_ref); - FREE(ser); +int64_t CS_LDK_BlindedMessagePath_advance_path_by_one(int64_t this_arg, int64_t node_signer, int64_t node_id_lookup) { + LDKBlindedMessagePath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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* 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; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = BlindedMessagePath_advance_path_by_one(&this_arg_conv, node_signer_conv, node_id_lookup_conv); return tag_ptr(ret_conv, true); } -void CS_LDK_SpendableOutputDescriptor_free(int64_t this_ptr) { +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); - LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)(this_ptr_ptr); + LDKNextMessageHop this_ptr_conv = *(LDKNextMessageHop*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - SpendableOutputDescriptor_free(this_ptr_conv); + NextMessageHop_free(this_ptr_conv); } -static inline uint64_t SpendableOutputDescriptor_clone_ptr(LDKSpendableOutputDescriptor *NONNULL_PTR arg) { - LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_copy = SpendableOutputDescriptor_clone(arg); +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_SpendableOutputDescriptor_clone_ptr(int64_t arg) { - LDKSpendableOutputDescriptor* arg_conv = (LDKSpendableOutputDescriptor*)untag_ptr(arg); - int64_t ret_conv = SpendableOutputDescriptor_clone_ptr(arg_conv); +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_SpendableOutputDescriptor_clone(int64_t orig) { - LDKSpendableOutputDescriptor* orig_conv = (LDKSpendableOutputDescriptor*)untag_ptr(orig); - LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_copy = SpendableOutputDescriptor_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_SpendableOutputDescriptor_static_output(int64_t outpoint, int64_t output, int8_tArray channel_keys_id) { - 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); - void* output_ptr = untag_ptr(output); - CHECK_ACCESS(output_ptr); - LDKTxOut output_conv = *(LDKTxOut*)(output_ptr); - output_conv = TxOut_clone((LDKTxOut*)untag_ptr(output)); - LDKThirtyTwoBytes channel_keys_id_ref; - CHECK(channel_keys_id->arr_len == 32); - memcpy(channel_keys_id_ref.data, channel_keys_id->elems, 32); FREE(channel_keys_id); - LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_copy = SpendableOutputDescriptor_static_output(outpoint_conv, output_conv, channel_keys_id_ref); +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_SpendableOutputDescriptor_delayed_payment_output(int64_t a) { - LDKDelayedPaymentOutputDescriptor a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = DelayedPaymentOutputDescriptor_clone(&a_conv); - LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_copy = SpendableOutputDescriptor_delayed_payment_output(a_conv); +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_SpendableOutputDescriptor_static_payment_output(int64_t a) { - LDKStaticPaymentOutputDescriptor a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = StaticPaymentOutputDescriptor_clone(&a_conv); - LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_copy = SpendableOutputDescriptor_static_payment_output(a_conv); +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_SpendableOutputDescriptor_hash(int64_t o) { - LDKSpendableOutputDescriptor* o_conv = (LDKSpendableOutputDescriptor*)untag_ptr(o); - int64_t ret_conv = SpendableOutputDescriptor_hash(o_conv); +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_SpendableOutputDescriptor_eq(int64_t a, int64_t b) { - LDKSpendableOutputDescriptor* a_conv = (LDKSpendableOutputDescriptor*)untag_ptr(a); - LDKSpendableOutputDescriptor* b_conv = (LDKSpendableOutputDescriptor*)untag_ptr(b); - jboolean ret_conv = SpendableOutputDescriptor_eq(a_conv, b_conv); +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; } -int8_tArray CS_LDK_SpendableOutputDescriptor_write(int64_t obj) { - LDKSpendableOutputDescriptor* obj_conv = (LDKSpendableOutputDescriptor*)untag_ptr(obj); - LDKCVec_u8Z ret_var = SpendableOutputDescriptor_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_SpendableOutputDescriptor_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); - *ret_conv = SpendableOutputDescriptor_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_SpendableOutputDescriptor_create_spendable_outputs_psbt(int64_tArray descriptors, int64_tArray outputs, int8_tArray change_destination_script, int32_t feerate_sat_per_1000_weight, int64_t locktime) { - 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_C2Tuple_CVec_u8Zu64ZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ), "LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ"); - *ret_conv = SpendableOutputDescriptor_create_spendable_outputs_psbt(descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight, locktime_conv); - return tag_ptr(ret_conv, true); -} - -void CS_LDK_ChannelDerivationParameters_free(int64_t this_obj) { - LDKChannelDerivationParameters this_obj_conv; +void CS_LDK_MessageForwardNode_free(int64_t this_obj) { + LDKMessageForwardNode this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelDerivationParameters_free(this_obj_conv); + MessageForwardNode_free(this_obj_conv); } -int64_t CS_LDK_ChannelDerivationParameters_get_value_satoshis(int64_t this_ptr) { - LDKChannelDerivationParameters this_ptr_conv; +int8_tArray CS_LDK_MessageForwardNode_get_node_id(int64_t this_ptr) { + LDKMessageForwardNode this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = ChannelDerivationParameters_get_value_satoshis(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, MessageForwardNode_get_node_id(&this_ptr_conv).compressed_form, 33); + return ret_arr; } -void CS_LDK_ChannelDerivationParameters_set_value_satoshis(int64_t this_ptr, int64_t val) { - LDKChannelDerivationParameters this_ptr_conv; +void CS_LDK_MessageForwardNode_set_node_id(int64_t this_ptr, int8_tArray val) { + LDKMessageForwardNode this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelDerivationParameters_set_value_satoshis(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + MessageForwardNode_set_node_id(&this_ptr_conv, val_ref); } -int8_tArray CS_LDK_ChannelDerivationParameters_get_keys_id(int64_t this_ptr) { - LDKChannelDerivationParameters this_ptr_conv; +int64_t CS_LDK_MessageForwardNode_get_short_channel_id(int64_t this_ptr) { + LDKMessageForwardNode this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(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, *ChannelDerivationParameters_get_keys_id(&this_ptr_conv), 32); - return ret_arr; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = MessageForwardNode_get_short_channel_id(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_ChannelDerivationParameters_set_keys_id(int64_t this_ptr, int8_tArray val) { - LDKChannelDerivationParameters this_ptr_conv; +void CS_LDK_MessageForwardNode_set_short_channel_id(int64_t this_ptr, int64_t val) { + LDKMessageForwardNode this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - ChannelDerivationParameters_set_keys_id(&this_ptr_conv, val_ref); -} - -int64_t CS_LDK_ChannelDerivationParameters_get_transaction_parameters(int64_t this_ptr) { - LDKChannelDerivationParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = ChannelDerivationParameters_get_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_ChannelDerivationParameters_set_transaction_parameters(int64_t this_ptr, int64_t val) { - LDKChannelDerivationParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - ChannelDerivationParameters_set_transaction_parameters(&this_ptr_conv, val_conv); + 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)); + MessageForwardNode_set_short_channel_id(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelDerivationParameters_new(int64_t value_satoshis_arg, int8_tArray keys_id_arg, int64_t transaction_parameters_arg) { - LDKThirtyTwoBytes keys_id_arg_ref; - CHECK(keys_id_arg->arr_len == 32); - memcpy(keys_id_arg_ref.data, keys_id_arg->elems, 32); FREE(keys_id_arg); - LDKChannelTransactionParameters transaction_parameters_arg_conv; - transaction_parameters_arg_conv.inner = untag_ptr(transaction_parameters_arg); - transaction_parameters_arg_conv.is_owned = ptr_is_owned(transaction_parameters_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(transaction_parameters_arg_conv); - transaction_parameters_arg_conv = ChannelTransactionParameters_clone(&transaction_parameters_arg_conv); - LDKChannelDerivationParameters ret_var = ChannelDerivationParameters_new(value_satoshis_arg, keys_id_arg_ref, transaction_parameters_arg_conv); +int64_t CS_LDK_MessageForwardNode_new(int8_tArray node_id_arg, int64_t short_channel_id_arg) { + LDKPublicKey node_id_arg_ref; + CHECK(node_id_arg->arr_len == 33); + memcpy(node_id_arg_ref.compressed_form, node_id_arg->elems, 33); FREE(node_id_arg); + 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)); + LDKMessageForwardNode ret_var = MessageForwardNode_new(node_id_arg_ref, short_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); return ret_ref; } -static inline uint64_t ChannelDerivationParameters_clone_ptr(LDKChannelDerivationParameters *NONNULL_PTR arg) { - LDKChannelDerivationParameters ret_var = ChannelDerivationParameters_clone(arg); +static inline uint64_t MessageForwardNode_clone_ptr(LDKMessageForwardNode *NONNULL_PTR arg) { + LDKMessageForwardNode ret_var = MessageForwardNode_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_ChannelDerivationParameters_clone_ptr(int64_t arg) { - LDKChannelDerivationParameters arg_conv; +int64_t CS_LDK_MessageForwardNode_clone_ptr(int64_t arg) { + LDKMessageForwardNode 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 = ChannelDerivationParameters_clone_ptr(&arg_conv); + int64_t ret_conv = MessageForwardNode_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_ChannelDerivationParameters_clone(int64_t orig) { - LDKChannelDerivationParameters orig_conv; +int64_t CS_LDK_MessageForwardNode_clone(int64_t orig) { + LDKMessageForwardNode 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; - LDKChannelDerivationParameters ret_var = ChannelDerivationParameters_clone(&orig_conv); + LDKMessageForwardNode ret_var = MessageForwardNode_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_ChannelDerivationParameters_eq(int64_t a, int64_t b) { - LDKChannelDerivationParameters a_conv; +int64_t CS_LDK_MessageForwardNode_hash(int64_t o) { + LDKMessageForwardNode o_conv; + 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 = MessageForwardNode_hash(&o_conv); + return ret_conv; +} + +jboolean CS_LDK_MessageForwardNode_eq(int64_t a, int64_t b) { + LDKMessageForwardNode a_conv; 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; - LDKChannelDerivationParameters b_conv; + LDKMessageForwardNode 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 = ChannelDerivationParameters_eq(&a_conv, &b_conv); + jboolean ret_conv = MessageForwardNode_eq(&a_conv, &b_conv); return ret_conv; } -int8_tArray CS_LDK_ChannelDerivationParameters_write(int64_t obj) { - LDKChannelDerivationParameters 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 = ChannelDerivationParameters_write(&obj_conv); +void CS_LDK_MessageContext_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); + LDKMessageContext this_ptr_conv = *(LDKMessageContext*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + MessageContext_free(this_ptr_conv); +} + +static inline uint64_t MessageContext_clone_ptr(LDKMessageContext *NONNULL_PTR arg) { + LDKMessageContext *ret_copy = MALLOC(sizeof(LDKMessageContext), "LDKMessageContext"); + *ret_copy = MessageContext_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_MessageContext_clone_ptr(int64_t arg) { + LDKMessageContext* arg_conv = (LDKMessageContext*)untag_ptr(arg); + int64_t ret_conv = MessageContext_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_MessageContext_clone(int64_t orig) { + LDKMessageContext* orig_conv = (LDKMessageContext*)untag_ptr(orig); + LDKMessageContext *ret_copy = MALLOC(sizeof(LDKMessageContext), "LDKMessageContext"); + *ret_copy = MessageContext_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_MessageContext_offers(int64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKOffersContext a_conv = *(LDKOffersContext*)(a_ptr); + a_conv = OffersContext_clone((LDKOffersContext*)untag_ptr(a)); + LDKMessageContext *ret_copy = MALLOC(sizeof(LDKMessageContext), "LDKMessageContext"); + *ret_copy = MessageContext_offers(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_MessageContext_custom(int8_tArray a) { + LDKCVec_u8Z a_ref; + a_ref.datalen = a->arr_len; + a_ref.data = MALLOC(a_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(a_ref.data, a->elems, a_ref.datalen); FREE(a); + LDKMessageContext *ret_copy = MALLOC(sizeof(LDKMessageContext), "LDKMessageContext"); + *ret_copy = MessageContext_custom(a_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_OffersContext_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); + LDKOffersContext this_ptr_conv = *(LDKOffersContext*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + OffersContext_free(this_ptr_conv); +} + +static inline uint64_t OffersContext_clone_ptr(LDKOffersContext *NONNULL_PTR arg) { + LDKOffersContext *ret_copy = MALLOC(sizeof(LDKOffersContext), "LDKOffersContext"); + *ret_copy = OffersContext_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_OffersContext_clone_ptr(int64_t arg) { + LDKOffersContext* arg_conv = (LDKOffersContext*)untag_ptr(arg); + int64_t ret_conv = OffersContext_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_OffersContext_clone(int64_t orig) { + LDKOffersContext* orig_conv = (LDKOffersContext*)untag_ptr(orig); + LDKOffersContext *ret_copy = MALLOC(sizeof(LDKOffersContext), "LDKOffersContext"); + *ret_copy = OffersContext_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_OffersContext_invoice_request(int64_t nonce) { + LDKNonce nonce_conv; + nonce_conv.inner = untag_ptr(nonce); + nonce_conv.is_owned = ptr_is_owned(nonce); + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_conv); + nonce_conv = Nonce_clone(&nonce_conv); + LDKOffersContext *ret_copy = MALLOC(sizeof(LDKOffersContext), "LDKOffersContext"); + *ret_copy = OffersContext_invoice_request(nonce_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_OffersContext_outbound_payment(int8_tArray payment_id, int64_t nonce, int8_tArray hmac) { + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + LDKNonce nonce_conv; + nonce_conv.inner = untag_ptr(nonce); + nonce_conv.is_owned = ptr_is_owned(nonce); + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_conv); + nonce_conv = Nonce_clone(&nonce_conv); + LDKThirtyTwoBytes hmac_ref; + CHECK(hmac->arr_len == 32); + memcpy(hmac_ref.data, hmac->elems, 32); FREE(hmac); + LDKOffersContext *ret_copy = MALLOC(sizeof(LDKOffersContext), "LDKOffersContext"); + *ret_copy = OffersContext_outbound_payment(payment_id_ref, nonce_conv, hmac_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_OffersContext_inbound_payment(int8_tArray payment_hash) { + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKOffersContext *ret_copy = MALLOC(sizeof(LDKOffersContext), "LDKOffersContext"); + *ret_copy = OffersContext_inbound_payment(payment_hash_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +jboolean CS_LDK_OffersContext_eq(int64_t a, int64_t b) { + LDKOffersContext* a_conv = (LDKOffersContext*)untag_ptr(a); + LDKOffersContext* b_conv = (LDKOffersContext*)untag_ptr(b); + jboolean ret_conv = OffersContext_eq(a_conv, b_conv); + return ret_conv; +} + +int8_tArray CS_LDK_MessageContext_write(int64_t obj) { + LDKMessageContext* obj_conv = (LDKMessageContext*)untag_ptr(obj); + LDKCVec_u8Z ret_var = MessageContext_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_ChannelDerivationParameters_read(int8_tArray ser) { +int64_t CS_LDK_MessageContext_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_ChannelDerivationParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDerivationParametersDecodeErrorZ), "LDKCResult_ChannelDerivationParametersDecodeErrorZ"); - *ret_conv = ChannelDerivationParameters_read(ser_ref); + LDKCResult_MessageContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_MessageContextDecodeErrorZ), "LDKCResult_MessageContextDecodeErrorZ"); + *ret_conv = MessageContext_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_HTLCDescriptor_free(int64_t this_obj) { - LDKHTLCDescriptor this_obj_conv; +int8_tArray CS_LDK_OffersContext_write(int64_t obj) { + LDKOffersContext* obj_conv = (LDKOffersContext*)untag_ptr(obj); + LDKCVec_u8Z ret_var = OffersContext_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_OffersContext_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_OffersContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersContextDecodeErrorZ), "LDKCResult_OffersContextDecodeErrorZ"); + *ret_conv = OffersContext_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_FundingInfo_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); + LDKFundingInfo this_ptr_conv = *(LDKFundingInfo*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + FundingInfo_free(this_ptr_conv); +} + +static inline uint64_t FundingInfo_clone_ptr(LDKFundingInfo *NONNULL_PTR arg) { + LDKFundingInfo *ret_copy = MALLOC(sizeof(LDKFundingInfo), "LDKFundingInfo"); + *ret_copy = FundingInfo_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_FundingInfo_clone_ptr(int64_t arg) { + LDKFundingInfo* arg_conv = (LDKFundingInfo*)untag_ptr(arg); + int64_t ret_conv = FundingInfo_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_FundingInfo_clone(int64_t orig) { + LDKFundingInfo* orig_conv = (LDKFundingInfo*)untag_ptr(orig); + LDKFundingInfo *ret_copy = MALLOC(sizeof(LDKFundingInfo), "LDKFundingInfo"); + *ret_copy = FundingInfo_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_FundingInfo_tx(int8_tArray transaction) { + LDKTransaction transaction_ref; + transaction_ref.datalen = transaction->arr_len; + transaction_ref.data = MALLOC(transaction_ref.datalen, "LDKTransaction Bytes"); + memcpy(transaction_ref.data, transaction->elems, transaction_ref.datalen); FREE(transaction); + transaction_ref.data_is_owned = true; + LDKFundingInfo *ret_copy = MALLOC(sizeof(LDKFundingInfo), "LDKFundingInfo"); + *ret_copy = FundingInfo_tx(transaction_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_FundingInfo_out_point(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); + LDKFundingInfo *ret_copy = MALLOC(sizeof(LDKFundingInfo), "LDKFundingInfo"); + *ret_copy = FundingInfo_out_point(outpoint_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +jboolean CS_LDK_FundingInfo_eq(int64_t a, int64_t b) { + LDKFundingInfo* a_conv = (LDKFundingInfo*)untag_ptr(a); + LDKFundingInfo* b_conv = (LDKFundingInfo*)untag_ptr(b); + jboolean ret_conv = FundingInfo_eq(a_conv, b_conv); + return ret_conv; +} + +int8_tArray CS_LDK_FundingInfo_write(int64_t obj) { + LDKFundingInfo* obj_conv = (LDKFundingInfo*)untag_ptr(obj); + LDKCVec_u8Z ret_var = FundingInfo_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_FundingInfo_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_FundingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingInfoDecodeErrorZ), "LDKCResult_FundingInfoDecodeErrorZ"); + *ret_conv = FundingInfo_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); + CHECK_ACCESS(this_ptr_ptr); + LDKPaymentPurpose this_ptr_conv = *(LDKPaymentPurpose*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + PaymentPurpose_free(this_ptr_conv); +} + +static inline uint64_t PaymentPurpose_clone_ptr(LDKPaymentPurpose *NONNULL_PTR arg) { + LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); + *ret_copy = PaymentPurpose_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_PaymentPurpose_clone_ptr(int64_t arg) { + LDKPaymentPurpose* arg_conv = (LDKPaymentPurpose*)untag_ptr(arg); + int64_t ret_conv = PaymentPurpose_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_PaymentPurpose_clone(int64_t orig) { + LDKPaymentPurpose* orig_conv = (LDKPaymentPurpose*)untag_ptr(orig); + LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); + *ret_copy = PaymentPurpose_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +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); + 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); + 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_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; +} + +int64_t CS_LDK_PaymentPurpose_spontaneous_payment(int8_tArray a) { + LDKThirtyTwoBytes a_ref; + CHECK(a->arr_len == 32); + memcpy(a_ref.data, a->elems, 32); FREE(a); + LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); + *ret_copy = PaymentPurpose_spontaneous_payment(a_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +jboolean CS_LDK_PaymentPurpose_eq(int64_t a, int64_t b) { + LDKPaymentPurpose* a_conv = (LDKPaymentPurpose*)untag_ptr(a); + LDKPaymentPurpose* b_conv = (LDKPaymentPurpose*)untag_ptr(b); + jboolean ret_conv = PaymentPurpose_eq(a_conv, b_conv); + return ret_conv; +} + +int64_t CS_LDK_PaymentPurpose_preimage(int64_t this_arg) { + LDKPaymentPurpose* this_arg_conv = (LDKPaymentPurpose*)untag_ptr(this_arg); + LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); + *ret_copy = PaymentPurpose_preimage(this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int8_tArray CS_LDK_PaymentPurpose_write(int64_t obj) { + LDKPaymentPurpose* obj_conv = (LDKPaymentPurpose*)untag_ptr(obj); + LDKCVec_u8Z ret_var = PaymentPurpose_write(obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_PaymentPurpose_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); + *ret_conv = PaymentPurpose_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_ClaimedHTLC_free(int64_t this_obj) { + LDKClaimedHTLC this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - HTLCDescriptor_free(this_obj_conv); + ClaimedHTLC_free(this_obj_conv); } -int64_t CS_LDK_HTLCDescriptor_get_channel_derivation_parameters(int64_t this_ptr) { - LDKHTLCDescriptor this_ptr_conv; +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; - LDKChannelDerivationParameters ret_var = HTLCDescriptor_get_channel_derivation_parameters(&this_ptr_conv); + 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_HTLCDescriptor_set_channel_derivation_parameters(int64_t this_ptr, int64_t val) { - LDKHTLCDescriptor this_ptr_conv; +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; - LDKChannelDerivationParameters 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 = ChannelDerivationParameters_clone(&val_conv); - HTLCDescriptor_set_channel_derivation_parameters(&this_ptr_conv, val_conv); + val_conv = ChannelId_clone(&val_conv); + ClaimedHTLC_set_channel_id(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_HTLCDescriptor_get_commitment_txid(int64_t this_ptr) { - LDKHTLCDescriptor this_ptr_conv; +int8_tArray CS_LDK_ClaimedHTLC_get_user_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, *HTLCDescriptor_get_commitment_txid(&this_ptr_conv), 32); + int8_tArray ret_arr = init_int8_tArray(16, __LINE__); + memcpy(ret_arr->elems, ClaimedHTLC_get_user_channel_id(&this_ptr_conv).le_bytes, 16); return ret_arr; } -void CS_LDK_HTLCDescriptor_set_commitment_txid(int64_t this_ptr, int8_tArray val) { - LDKHTLCDescriptor this_ptr_conv; +void CS_LDK_ClaimedHTLC_set_user_channel_id(int64_t this_ptr, int8_tArray 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); - HTLCDescriptor_set_commitment_txid(&this_ptr_conv, val_ref); + LDKU128 val_ref; + CHECK(val->arr_len == 16); + memcpy(val_ref.le_bytes, val->elems, 16); FREE(val); + ClaimedHTLC_set_user_channel_id(&this_ptr_conv, val_ref); } -int64_t CS_LDK_HTLCDescriptor_get_per_commitment_number(int64_t this_ptr) { - LDKHTLCDescriptor this_ptr_conv; +int32_t CS_LDK_ClaimedHTLC_get_cltv_expiry(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; - int64_t ret_conv = HTLCDescriptor_get_per_commitment_number(&this_ptr_conv); + int32_t ret_conv = ClaimedHTLC_get_cltv_expiry(&this_ptr_conv); return ret_conv; } -void CS_LDK_HTLCDescriptor_set_per_commitment_number(int64_t this_ptr, int64_t val) { - LDKHTLCDescriptor this_ptr_conv; +void CS_LDK_ClaimedHTLC_set_cltv_expiry(int64_t this_ptr, int32_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; - HTLCDescriptor_set_per_commitment_number(&this_ptr_conv, val); + ClaimedHTLC_set_cltv_expiry(&this_ptr_conv, val); } -int8_tArray CS_LDK_HTLCDescriptor_get_per_commitment_point(int64_t this_ptr) { - LDKHTLCDescriptor this_ptr_conv; +int64_t CS_LDK_ClaimedHTLC_get_value_msat(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(33, __LINE__); - memcpy(ret_arr->elems, HTLCDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form, 33); - return ret_arr; + int64_t ret_conv = ClaimedHTLC_get_value_msat(&this_ptr_conv); + return ret_conv; } -void CS_LDK_HTLCDescriptor_set_per_commitment_point(int64_t this_ptr, int8_tArray val) { - LDKHTLCDescriptor this_ptr_conv; +void CS_LDK_ClaimedHTLC_set_value_msat(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; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - HTLCDescriptor_set_per_commitment_point(&this_ptr_conv, val_ref); + ClaimedHTLC_set_value_msat(&this_ptr_conv, val); } -int32_t CS_LDK_HTLCDescriptor_get_feerate_per_kw(int64_t this_ptr) { - LDKHTLCDescriptor this_ptr_conv; +int64_t CS_LDK_ClaimedHTLC_get_counterparty_skimmed_fee_msat(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; - int32_t ret_conv = HTLCDescriptor_get_feerate_per_kw(&this_ptr_conv); + int64_t ret_conv = ClaimedHTLC_get_counterparty_skimmed_fee_msat(&this_ptr_conv); return ret_conv; } -void CS_LDK_HTLCDescriptor_set_feerate_per_kw(int64_t this_ptr, int32_t val) { - LDKHTLCDescriptor this_ptr_conv; +void CS_LDK_ClaimedHTLC_set_counterparty_skimmed_fee_msat(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; - HTLCDescriptor_set_feerate_per_kw(&this_ptr_conv, val); + ClaimedHTLC_set_counterparty_skimmed_fee_msat(&this_ptr_conv, val); } -int64_t CS_LDK_HTLCDescriptor_get_htlc(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; - LDKHTLCOutputInCommitment ret_var = HTLCDescriptor_get_htlc(&this_ptr_conv); +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_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); return ret_ref; } -void CS_LDK_HTLCDescriptor_set_htlc(int64_t this_ptr, int64_t 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; - LDKHTLCOutputInCommitment 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 = HTLCOutputInCommitment_clone(&val_conv); - HTLCDescriptor_set_htlc(&this_ptr_conv, val_conv); -} - -int64_t CS_LDK_HTLCDescriptor_get_preimage(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; - LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); - *ret_copy = HTLCDescriptor_get_preimage(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +static inline uint64_t ClaimedHTLC_clone_ptr(LDKClaimedHTLC *NONNULL_PTR arg) { + LDKClaimedHTLC ret_var = ClaimedHTLC_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_ClaimedHTLC_clone_ptr(int64_t arg) { + LDKClaimedHTLC 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 = ClaimedHTLC_clone_ptr(&arg_conv); + return ret_conv; +} -void CS_LDK_HTLCDescriptor_set_preimage(int64_t this_ptr, int64_t 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; - 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)); - HTLCDescriptor_set_preimage(&this_ptr_conv, val_conv); +int64_t CS_LDK_ClaimedHTLC_clone(int64_t orig) { + LDKClaimedHTLC 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; + LDKClaimedHTLC ret_var = ClaimedHTLC_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; } -int8_tArray CS_LDK_HTLCDescriptor_get_counterparty_sig(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(64, __LINE__); - memcpy(ret_arr->elems, HTLCDescriptor_get_counterparty_sig(&this_ptr_conv).compact_form, 64); - return ret_arr; +jboolean CS_LDK_ClaimedHTLC_eq(int64_t a, int64_t b) { + LDKClaimedHTLC a_conv; + 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; + LDKClaimedHTLC 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 = ClaimedHTLC_eq(&a_conv, &b_conv); + return ret_conv; } -void CS_LDK_HTLCDescriptor_set_counterparty_sig(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; - LDKECDSASignature val_ref; - CHECK(val->arr_len == 64); - memcpy(val_ref.compact_form, val->elems, 64); FREE(val); - 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; - 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_HTLCDescriptor_clone_ptr(int64_t arg) { - LDKHTLCDescriptor 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 = HTLCDescriptor_clone_ptr(&arg_conv); - return ret_conv; -} - -int64_t CS_LDK_HTLCDescriptor_clone(int64_t orig) { - LDKHTLCDescriptor 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; - LDKHTLCDescriptor ret_var = HTLCDescriptor_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_HTLCDescriptor_eq(int64_t a, int64_t b) { - LDKHTLCDescriptor a_conv; - 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; - LDKHTLCDescriptor 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 = HTLCDescriptor_eq(&a_conv, &b_conv); - return ret_conv; -} - -int8_tArray CS_LDK_HTLCDescriptor_write(int64_t obj) { - LDKHTLCDescriptor obj_conv; +int8_tArray CS_LDK_ClaimedHTLC_write(int64_t obj) { + LDKClaimedHTLC 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 = HTLCDescriptor_write(&obj_conv); + LDKCVec_u8Z ret_var = ClaimedHTLC_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_HTLCDescriptor_read(int8_tArray ser) { +int64_t CS_LDK_ClaimedHTLC_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_HTLCDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCDescriptorDecodeErrorZ), "LDKCResult_HTLCDescriptorDecodeErrorZ"); - *ret_conv = HTLCDescriptor_read(ser_ref); + LDKCResult_ClaimedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClaimedHTLCDecodeErrorZ), "LDKCResult_ClaimedHTLCDecodeErrorZ"); + *ret_conv = ClaimedHTLC_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_HTLCDescriptor_outpoint(int64_t this_arg) { - LDKHTLCDescriptor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOutPoint ret_var = HTLCDescriptor_outpoint(&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); +void CS_LDK_PathFailure_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); + LDKPathFailure this_ptr_conv = *(LDKPathFailure*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + PathFailure_free(this_ptr_conv); +} + +static inline uint64_t PathFailure_clone_ptr(LDKPathFailure *NONNULL_PTR arg) { + LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure"); + *ret_copy = PathFailure_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } +int64_t CS_LDK_PathFailure_clone_ptr(int64_t arg) { + LDKPathFailure* arg_conv = (LDKPathFailure*)untag_ptr(arg); + int64_t ret_conv = PathFailure_clone_ptr(arg_conv); + return ret_conv; +} -int64_t CS_LDK_HTLCDescriptor_previous_utxo(int64_t this_arg) { - LDKHTLCDescriptor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); - *ret_ref = HTLCDescriptor_previous_utxo(&this_arg_conv); - return tag_ptr(ret_ref, true); +int64_t CS_LDK_PathFailure_clone(int64_t orig) { + LDKPathFailure* orig_conv = (LDKPathFailure*)untag_ptr(orig); + LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure"); + *ret_copy = PathFailure_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_HTLCDescriptor_unsigned_tx_input(int64_t this_arg) { - LDKHTLCDescriptor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKTxIn* ret_ref = MALLOC(sizeof(LDKTxIn), "LDKTxIn"); - *ret_ref = HTLCDescriptor_unsigned_tx_input(&this_arg_conv); - return tag_ptr(ret_ref, true); +int64_t CS_LDK_PathFailure_initial_send(int64_t err) { + void* err_ptr = untag_ptr(err); + CHECK_ACCESS(err_ptr); + LDKAPIError err_conv = *(LDKAPIError*)(err_ptr); + err_conv = APIError_clone((LDKAPIError*)untag_ptr(err)); + LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure"); + *ret_copy = PathFailure_initial_send(err_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_HTLCDescriptor_tx_output(int64_t this_arg) { - LDKHTLCDescriptor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); - *ret_ref = HTLCDescriptor_tx_output(&this_arg_conv); - return tag_ptr(ret_ref, true); +int64_t CS_LDK_PathFailure_on_path(int64_t network_update) { + void* network_update_ptr = untag_ptr(network_update); + CHECK_ACCESS(network_update_ptr); + LDKCOption_NetworkUpdateZ network_update_conv = *(LDKCOption_NetworkUpdateZ*)(network_update_ptr); + network_update_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)untag_ptr(network_update)); + LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure"); + *ret_copy = PathFailure_on_path(network_update_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int8_tArray CS_LDK_HTLCDescriptor_witness_script(int64_t this_arg) { - LDKHTLCDescriptor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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 ret_var = HTLCDescriptor_witness_script(&this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +jboolean CS_LDK_PathFailure_eq(int64_t a, int64_t b) { + LDKPathFailure* a_conv = (LDKPathFailure*)untag_ptr(a); + LDKPathFailure* b_conv = (LDKPathFailure*)untag_ptr(b); + jboolean ret_conv = PathFailure_eq(a_conv, b_conv); + return ret_conv; } -int8_tArray CS_LDK_HTLCDescriptor_tx_input_witness(int64_t this_arg, int8_tArray signature, int8_tArray witness_script) { - LDKHTLCDescriptor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKECDSASignature signature_ref; - CHECK(signature->arr_len == 64); - memcpy(signature_ref.compact_form, signature->elems, 64); FREE(signature); - LDKu8slice witness_script_ref; - witness_script_ref.datalen = witness_script->arr_len; - witness_script_ref.data = witness_script->elems; - LDKWitness ret_var = HTLCDescriptor_tx_input_witness(&this_arg_conv, signature_ref, witness_script_ref); +int8_tArray CS_LDK_PathFailure_write(int64_t obj) { + LDKPathFailure* obj_conv = (LDKPathFailure*)untag_ptr(obj); + LDKCVec_u8Z ret_var = PathFailure_write(obj_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - Witness_free(ret_var); - FREE(witness_script); + CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_HTLCDescriptor_derive_channel_signer(int64_t this_arg, int64_t signer_provider) { - LDKHTLCDescriptor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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* signer_provider_ptr = untag_ptr(signer_provider); - if (ptr_is_owned(signer_provider)) { CHECK_ACCESS(signer_provider_ptr); } - LDKSignerProvider* signer_provider_conv = (LDKSignerProvider*)signer_provider_ptr; - LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner"); - *ret_ret = HTLCDescriptor_derive_channel_signer(&this_arg_conv, signer_provider_conv); - return tag_ptr(ret_ret, true); +int64_t CS_LDK_PathFailure_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ"); + *ret_conv = PathFailure_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -void CS_LDK_ChannelSigner_free(int64_t this_ptr) { +void CS_LDK_ClosureReason_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); - LDKChannelSigner this_ptr_conv = *(LDKChannelSigner*)(this_ptr_ptr); + LDKClosureReason this_ptr_conv = *(LDKClosureReason*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - ChannelSigner_free(this_ptr_conv); + ClosureReason_free(this_ptr_conv); } -int32_t CS_LDK_Recipient_clone(int64_t orig) { - LDKRecipient* orig_conv = (LDKRecipient*)untag_ptr(orig); - int32_t ret_conv = LDKRecipient_to_cs(Recipient_clone(orig_conv)); +static inline uint64_t ClosureReason_clone_ptr(LDKClosureReason *NONNULL_PTR arg) { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_ClosureReason_clone_ptr(int64_t arg) { + LDKClosureReason* arg_conv = (LDKClosureReason*)untag_ptr(arg); + int64_t ret_conv = ClosureReason_clone_ptr(arg_conv); return ret_conv; } -int32_t CS_LDK_Recipient_node() { - int32_t ret_conv = LDKRecipient_to_cs(Recipient_node()); - return ret_conv; +int64_t CS_LDK_ClosureReason_clone(int64_t orig) { + LDKClosureReason* orig_conv = (LDKClosureReason*)untag_ptr(orig); + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int32_t CS_LDK_Recipient_phantom_node() { - int32_t ret_conv = LDKRecipient_to_cs(Recipient_phantom_node()); - return ret_conv; +int64_t CS_LDK_ClosureReason_counterparty_force_closed(int64_t peer_msg) { + LDKUntrustedString peer_msg_conv; + peer_msg_conv.inner = untag_ptr(peer_msg); + peer_msg_conv.is_owned = ptr_is_owned(peer_msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(peer_msg_conv); + peer_msg_conv = UntrustedString_clone(&peer_msg_conv); + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_counterparty_force_closed(peer_msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_EntropySource_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); - LDKEntropySource this_ptr_conv = *(LDKEntropySource*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - EntropySource_free(this_ptr_conv); +int64_t CS_LDK_ClosureReason_holder_force_closed(int64_t broadcasted_latest_txn) { + void* broadcasted_latest_txn_ptr = untag_ptr(broadcasted_latest_txn); + CHECK_ACCESS(broadcasted_latest_txn_ptr); + LDKCOption_boolZ broadcasted_latest_txn_conv = *(LDKCOption_boolZ*)(broadcasted_latest_txn_ptr); + broadcasted_latest_txn_conv = COption_boolZ_clone((LDKCOption_boolZ*)untag_ptr(broadcasted_latest_txn)); + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_holder_force_closed(broadcasted_latest_txn_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_NodeSigner_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); - LDKNodeSigner this_ptr_conv = *(LDKNodeSigner*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - NodeSigner_free(this_ptr_conv); +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; } -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); +int64_t CS_LDK_ClosureReason_counterparty_initiated_cooperative_closure() { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_counterparty_initiated_cooperative_closure(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_SignerProvider_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); - LDKSignerProvider this_ptr_conv = *(LDKSignerProvider*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - SignerProvider_free(this_ptr_conv); +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; } -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); +int64_t CS_LDK_ClosureReason_commitment_tx_confirmed() { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_commitment_tx_confirmed(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_InMemorySigner_free(int64_t this_obj) { - LDKInMemorySigner this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InMemorySigner_free(this_obj_conv); +int64_t CS_LDK_ClosureReason_funding_timed_out() { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_funding_timed_out(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int8_tArray CS_LDK_InMemorySigner_get_funding_key(int64_t this_ptr) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(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, *InMemorySigner_get_funding_key(&this_ptr_conv), 32); - return ret_arr; +int64_t CS_LDK_ClosureReason_processing_error(jstring err) { + LDKStr err_conv = str_ref_to_owned_c(err); + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_processing_error(err_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_InMemorySigner_set_funding_key(int64_t this_ptr, int8_tArray val) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKSecretKey val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.bytes, val->elems, 32); FREE(val); - InMemorySigner_set_funding_key(&this_ptr_conv, val_ref); +int64_t CS_LDK_ClosureReason_disconnected_peer() { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_disconnected_peer(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int8_tArray CS_LDK_InMemorySigner_get_revocation_base_key(int64_t this_ptr) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(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, *InMemorySigner_get_revocation_base_key(&this_ptr_conv), 32); - return ret_arr; +int64_t CS_LDK_ClosureReason_outdated_channel_manager() { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_outdated_channel_manager(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_InMemorySigner_set_revocation_base_key(int64_t this_ptr, int8_tArray val) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKSecretKey val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.bytes, val->elems, 32); FREE(val); - InMemorySigner_set_revocation_base_key(&this_ptr_conv, val_ref); +int64_t CS_LDK_ClosureReason_counterparty_coop_closed_unfunded_channel() { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_counterparty_coop_closed_unfunded_channel(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int8_tArray CS_LDK_InMemorySigner_get_payment_key(int64_t this_ptr) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(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, *InMemorySigner_get_payment_key(&this_ptr_conv), 32); - return ret_arr; +int64_t CS_LDK_ClosureReason_funding_batch_closure() { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_funding_batch_closure(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_InMemorySigner_set_payment_key(int64_t this_ptr, int8_tArray val) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKSecretKey val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.bytes, val->elems, 32); FREE(val); - InMemorySigner_set_payment_key(&this_ptr_conv, val_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; } -int8_tArray CS_LDK_InMemorySigner_get_delayed_payment_base_key(int64_t this_ptr) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(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, *InMemorySigner_get_delayed_payment_base_key(&this_ptr_conv), 32); - return ret_arr; +int64_t CS_LDK_ClosureReason_peer_feerate_too_low(int32_t peer_feerate_sat_per_kw, int32_t required_feerate_sat_per_kw) { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_peer_feerate_too_low(peer_feerate_sat_per_kw, required_feerate_sat_per_kw); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_InMemorySigner_set_delayed_payment_base_key(int64_t this_ptr, int8_tArray val) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKSecretKey val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.bytes, val->elems, 32); FREE(val); - InMemorySigner_set_delayed_payment_base_key(&this_ptr_conv, val_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); + jboolean ret_conv = ClosureReason_eq(a_conv, b_conv); + return ret_conv; } -int8_tArray CS_LDK_InMemorySigner_get_htlc_base_key(int64_t this_ptr) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(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, *InMemorySigner_get_htlc_base_key(&this_ptr_conv), 32); +jstring CS_LDK_ClosureReason_to_str(int64_t o) { + LDKClosureReason* o_conv = (LDKClosureReason*)untag_ptr(o); + LDKStr ret_str = ClosureReason_to_str(o_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +int8_tArray CS_LDK_ClosureReason_write(int64_t obj) { + LDKClosureReason* obj_conv = (LDKClosureReason*)untag_ptr(obj); + LDKCVec_u8Z ret_var = ClosureReason_write(obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); return ret_arr; } -void CS_LDK_InMemorySigner_set_htlc_base_key(int64_t this_ptr, int8_tArray val) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKSecretKey val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.bytes, val->elems, 32); FREE(val); - InMemorySigner_set_htlc_base_key(&this_ptr_conv, val_ref); +int64_t CS_LDK_ClosureReason_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = ClosureReason_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -int8_tArray CS_LDK_InMemorySigner_get_commitment_seed(int64_t this_ptr) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(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, *InMemorySigner_get_commitment_seed(&this_ptr_conv), 32); - return ret_arr; +void CS_LDK_HTLCDestination_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); + LDKHTLCDestination this_ptr_conv = *(LDKHTLCDestination*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + HTLCDestination_free(this_ptr_conv); } -void CS_LDK_InMemorySigner_set_commitment_seed(int64_t this_ptr, int8_tArray val) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - InMemorySigner_set_commitment_seed(&this_ptr_conv, val_ref); -} - -static inline uint64_t InMemorySigner_clone_ptr(LDKInMemorySigner *NONNULL_PTR arg) { - LDKInMemorySigner ret_var = InMemorySigner_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); +static inline uint64_t HTLCDestination_clone_ptr(LDKHTLCDestination *NONNULL_PTR arg) { + LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); + *ret_copy = HTLCDestination_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_InMemorySigner_clone_ptr(int64_t arg) { - LDKInMemorySigner 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 = InMemorySigner_clone_ptr(&arg_conv); +int64_t CS_LDK_HTLCDestination_clone_ptr(int64_t arg) { + LDKHTLCDestination* arg_conv = (LDKHTLCDestination*)untag_ptr(arg); + int64_t ret_conv = HTLCDestination_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_InMemorySigner_clone(int64_t orig) { - LDKInMemorySigner 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; - LDKInMemorySigner ret_var = InMemorySigner_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_InMemorySigner_new(int8_tArray funding_key, int8_tArray revocation_base_key, int8_tArray payment_key, int8_tArray delayed_payment_base_key, int8_tArray htlc_base_key, int8_tArray commitment_seed, int64_t channel_value_satoshis, int8_tArray channel_keys_id, int8_tArray rand_bytes_unique_start) { - LDKSecretKey funding_key_ref; - CHECK(funding_key->arr_len == 32); - memcpy(funding_key_ref.bytes, funding_key->elems, 32); FREE(funding_key); - LDKSecretKey revocation_base_key_ref; - CHECK(revocation_base_key->arr_len == 32); - memcpy(revocation_base_key_ref.bytes, revocation_base_key->elems, 32); FREE(revocation_base_key); - LDKSecretKey payment_key_ref; - CHECK(payment_key->arr_len == 32); - memcpy(payment_key_ref.bytes, payment_key->elems, 32); FREE(payment_key); - LDKSecretKey delayed_payment_base_key_ref; - CHECK(delayed_payment_base_key->arr_len == 32); - memcpy(delayed_payment_base_key_ref.bytes, delayed_payment_base_key->elems, 32); FREE(delayed_payment_base_key); - LDKSecretKey htlc_base_key_ref; - CHECK(htlc_base_key->arr_len == 32); - memcpy(htlc_base_key_ref.bytes, htlc_base_key->elems, 32); FREE(htlc_base_key); - LDKThirtyTwoBytes commitment_seed_ref; - CHECK(commitment_seed->arr_len == 32); - memcpy(commitment_seed_ref.data, commitment_seed->elems, 32); FREE(commitment_seed); - LDKThirtyTwoBytes channel_keys_id_ref; - CHECK(channel_keys_id->arr_len == 32); - memcpy(channel_keys_id_ref.data, channel_keys_id->elems, 32); FREE(channel_keys_id); - LDKThirtyTwoBytes rand_bytes_unique_start_ref; - CHECK(rand_bytes_unique_start->arr_len == 32); - memcpy(rand_bytes_unique_start_ref.data, rand_bytes_unique_start->elems, 32); FREE(rand_bytes_unique_start); - LDKInMemorySigner ret_var = InMemorySigner_new(funding_key_ref, revocation_base_key_ref, payment_key_ref, delayed_payment_base_key_ref, htlc_base_key_ref, commitment_seed_ref, channel_value_satoshis, channel_keys_id_ref, rand_bytes_unique_start_ref); - int64_t ret_ref = 0; - 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_InMemorySigner_counterparty_pubkeys(int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelPublicKeys ret_var = InMemorySigner_counterparty_pubkeys(&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_InMemorySigner_counterparty_selected_contest_delay(int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); - *ret_copy = InMemorySigner_counterparty_selected_contest_delay(&this_arg_conv); +int64_t CS_LDK_HTLCDestination_clone(int64_t orig) { + LDKHTLCDestination* orig_conv = (LDKHTLCDestination*)untag_ptr(orig); + LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); + *ret_copy = HTLCDestination_clone(orig_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_InMemorySigner_holder_selected_contest_delay(int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); - *ret_copy = InMemorySigner_holder_selected_contest_delay(&this_arg_conv); +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); + 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_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_InMemorySigner_is_outbound(int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_boolZ *ret_copy = MALLOC(sizeof(LDKCOption_boolZ), "LDKCOption_boolZ"); - *ret_copy = InMemorySigner_is_outbound(&this_arg_conv); +int64_t CS_LDK_HTLCDestination_unknown_next_hop(int64_t requested_forward_scid) { + LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); + *ret_copy = HTLCDestination_unknown_next_hop(requested_forward_scid); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_InMemorySigner_funding_outpoint(int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOutPoint ret_var = InMemorySigner_funding_outpoint(&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); +int64_t CS_LDK_HTLCDestination_invalid_forward(int64_t requested_forward_scid) { + LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); + *ret_copy = HTLCDestination_invalid_forward(requested_forward_scid); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_InMemorySigner_get_channel_parameters(int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelTransactionParameters ret_var = InMemorySigner_get_channel_parameters(&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); +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_InMemorySigner_channel_type_features(int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelTypeFeatures ret_var = InMemorySigner_channel_type_features(&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); +int64_t CS_LDK_HTLCDestination_failed_payment(int8_tArray payment_hash) { + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); + *ret_copy = HTLCDestination_failed_payment(payment_hash_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_InMemorySigner_sign_counterparty_payment_input(int64_t this_arg, int8_tArray spend_tx, int64_t input_idx, int64_t descriptor) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKTransaction spend_tx_ref; - spend_tx_ref.datalen = spend_tx->arr_len; - spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); - memcpy(spend_tx_ref.data, spend_tx->elems, spend_tx_ref.datalen); FREE(spend_tx); - spend_tx_ref.data_is_owned = true; - LDKStaticPaymentOutputDescriptor descriptor_conv; - descriptor_conv.inner = untag_ptr(descriptor); - descriptor_conv.is_owned = ptr_is_owned(descriptor); - CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); - descriptor_conv.is_owned = false; - LDKCResult_WitnessNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_WitnessNoneZ), "LDKCResult_WitnessNoneZ"); - *ret_conv = InMemorySigner_sign_counterparty_payment_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_InMemorySigner_sign_dynamic_p2wsh_input(int64_t this_arg, int8_tArray spend_tx, int64_t input_idx, int64_t descriptor) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKTransaction spend_tx_ref; - spend_tx_ref.datalen = spend_tx->arr_len; - spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); - memcpy(spend_tx_ref.data, spend_tx->elems, spend_tx_ref.datalen); FREE(spend_tx); - spend_tx_ref.data_is_owned = true; - LDKDelayedPaymentOutputDescriptor descriptor_conv; - descriptor_conv.inner = untag_ptr(descriptor); - descriptor_conv.is_owned = ptr_is_owned(descriptor); - CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); - descriptor_conv.is_owned = false; - LDKCResult_WitnessNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_WitnessNoneZ), "LDKCResult_WitnessNoneZ"); - *ret_conv = InMemorySigner_sign_dynamic_p2wsh_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_InMemorySigner_as_EntropySource(int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource"); - *ret_ret = InMemorySigner_as_EntropySource(&this_arg_conv); - return tag_ptr(ret_ret, true); -} - -int64_t CS_LDK_InMemorySigner_as_ChannelSigner(int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelSigner* ret_ret = MALLOC(sizeof(LDKChannelSigner), "LDKChannelSigner"); - *ret_ret = InMemorySigner_as_ChannelSigner(&this_arg_conv); - return tag_ptr(ret_ret, true); -} - -int64_t CS_LDK_InMemorySigner_as_EcdsaChannelSigner(int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner"); - *ret_ret = InMemorySigner_as_EcdsaChannelSigner(&this_arg_conv); - return tag_ptr(ret_ret, true); -} - -int64_t CS_LDK_InMemorySigner_as_WriteableEcdsaChannelSigner(int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner"); - *ret_ret = InMemorySigner_as_WriteableEcdsaChannelSigner(&this_arg_conv); - return tag_ptr(ret_ret, true); +jboolean CS_LDK_HTLCDestination_eq(int64_t a, int64_t b) { + LDKHTLCDestination* a_conv = (LDKHTLCDestination*)untag_ptr(a); + LDKHTLCDestination* b_conv = (LDKHTLCDestination*)untag_ptr(b); + jboolean ret_conv = HTLCDestination_eq(a_conv, b_conv); + return ret_conv; } -int8_tArray CS_LDK_InMemorySigner_write(int64_t obj) { - LDKInMemorySigner 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 = InMemorySigner_write(&obj_conv); +int8_tArray CS_LDK_HTLCDestination_write(int64_t obj) { + LDKHTLCDestination* obj_conv = (LDKHTLCDestination*)untag_ptr(obj); + LDKCVec_u8Z ret_var = HTLCDestination_write(obj_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_InMemorySigner_read(int8_tArray ser, int64_t arg) { +int64_t CS_LDK_HTLCDestination_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - void* arg_ptr = untag_ptr(arg); - CHECK_ACCESS(arg_ptr); - LDKEntropySource arg_conv = *(LDKEntropySource*)(arg_ptr); - if (arg_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&arg_conv); - } - LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); - *ret_conv = InMemorySigner_read(ser_ref, arg_conv); + LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ"); + *ret_conv = HTLCDestination_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_KeysManager_free(int64_t this_obj) { - LDKKeysManager this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - KeysManager_free(this_obj_conv); +int32_t CS_LDK_PaymentFailureReason_clone(int64_t orig) { + LDKPaymentFailureReason* orig_conv = (LDKPaymentFailureReason*)untag_ptr(orig); + int32_t ret_conv = LDKPaymentFailureReason_to_cs(PaymentFailureReason_clone(orig_conv)); + return ret_conv; } -int64_t CS_LDK_KeysManager_new(int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos) { - uint8_t seed_arr[32]; - CHECK(seed->arr_len == 32); - memcpy(seed_arr, seed->elems, 32); FREE(seed); - uint8_t (*seed_ref)[32] = &seed_arr; - LDKKeysManager ret_var = KeysManager_new(seed_ref, starting_time_secs, starting_time_nanos); - int64_t ret_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_PaymentFailureReason_recipient_rejected() { + int32_t ret_conv = LDKPaymentFailureReason_to_cs(PaymentFailureReason_recipient_rejected()); + return ret_conv; } -int8_tArray CS_LDK_KeysManager_get_node_secret_key(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; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, KeysManager_get_node_secret_key(&this_arg_conv).bytes, 32); - return ret_arr; +int32_t CS_LDK_PaymentFailureReason_user_abandoned() { + int32_t ret_conv = LDKPaymentFailureReason_to_cs(PaymentFailureReason_user_abandoned()); + return ret_conv; } -int64_t CS_LDK_KeysManager_derive_channel_keys(int64_t this_arg, int64_t channel_value_satoshis, int8_tArray params) { - LDKKeysManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - uint8_t params_arr[32]; - CHECK(params->arr_len == 32); - memcpy(params_arr, params->elems, 32); FREE(params); - uint8_t (*params_ref)[32] = ¶ms_arr; - LDKInMemorySigner ret_var = KeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_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; +int32_t CS_LDK_PaymentFailureReason_retries_exhausted() { + int32_t ret_conv = LDKPaymentFailureReason_to_cs(PaymentFailureReason_retries_exhausted()); + return ret_conv; } -int64_t CS_LDK_KeysManager_sign_spendable_outputs_psbt(int64_t this_arg, int64_tArray descriptors, int8_tArray psbt) { - 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_u8Z psbt_ref; - psbt_ref.datalen = psbt->arr_len; - psbt_ref.data = MALLOC(psbt_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(psbt_ref.data, psbt->elems, psbt_ref.datalen); FREE(psbt); - LDKCResult_CVec_u8ZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZNoneZ), "LDKCResult_CVec_u8ZNoneZ"); - *ret_conv = KeysManager_sign_spendable_outputs_psbt(&this_arg_conv, descriptors_constr, psbt_ref); - return tag_ptr(ret_conv, true); +int32_t CS_LDK_PaymentFailureReason_payment_expired() { + int32_t ret_conv = LDKPaymentFailureReason_to_cs(PaymentFailureReason_payment_expired()); + return ret_conv; } -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; - LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource"); - *ret_ret = KeysManager_as_EntropySource(&this_arg_conv); - return tag_ptr(ret_ret, true); +int32_t CS_LDK_PaymentFailureReason_route_not_found() { + int32_t ret_conv = LDKPaymentFailureReason_to_cs(PaymentFailureReason_route_not_found()); + return ret_conv; } -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; - LDKNodeSigner* ret_ret = MALLOC(sizeof(LDKNodeSigner), "LDKNodeSigner"); - *ret_ret = KeysManager_as_NodeSigner(&this_arg_conv); - return tag_ptr(ret_ret, true); +int32_t CS_LDK_PaymentFailureReason_unexpected_error() { + int32_t ret_conv = LDKPaymentFailureReason_to_cs(PaymentFailureReason_unexpected_error()); + return ret_conv; } -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; - LDKOutputSpender* ret_ret = MALLOC(sizeof(LDKOutputSpender), "LDKOutputSpender"); - *ret_ret = KeysManager_as_OutputSpender(&this_arg_conv); - return tag_ptr(ret_ret, true); +int32_t CS_LDK_PaymentFailureReason_unknown_required_features() { + int32_t ret_conv = LDKPaymentFailureReason_to_cs(PaymentFailureReason_unknown_required_features()); + return ret_conv; } -int64_t CS_LDK_KeysManager_as_SignerProvider(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; - LDKSignerProvider* ret_ret = MALLOC(sizeof(LDKSignerProvider), "LDKSignerProvider"); - *ret_ret = KeysManager_as_SignerProvider(&this_arg_conv); - return tag_ptr(ret_ret, true); +int32_t CS_LDK_PaymentFailureReason_invoice_request_expired() { + int32_t ret_conv = LDKPaymentFailureReason_to_cs(PaymentFailureReason_invoice_request_expired()); + return ret_conv; } -void CS_LDK_PhantomKeysManager_free(int64_t this_obj) { - LDKPhantomKeysManager this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PhantomKeysManager_free(this_obj_conv); +int32_t CS_LDK_PaymentFailureReason_invoice_request_rejected() { + int32_t ret_conv = LDKPaymentFailureReason_to_cs(PaymentFailureReason_invoice_request_rejected()); + return ret_conv; } -int64_t CS_LDK_PhantomKeysManager_as_EntropySource(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; - LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource"); - *ret_ret = PhantomKeysManager_as_EntropySource(&this_arg_conv); - return tag_ptr(ret_ret, true); +jboolean CS_LDK_PaymentFailureReason_eq(int64_t a, int64_t b) { + LDKPaymentFailureReason* a_conv = (LDKPaymentFailureReason*)untag_ptr(a); + LDKPaymentFailureReason* b_conv = (LDKPaymentFailureReason*)untag_ptr(b); + jboolean ret_conv = PaymentFailureReason_eq(a_conv, b_conv); + return ret_conv; } -int64_t CS_LDK_PhantomKeysManager_as_NodeSigner(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; - LDKNodeSigner* ret_ret = MALLOC(sizeof(LDKNodeSigner), "LDKNodeSigner"); - *ret_ret = PhantomKeysManager_as_NodeSigner(&this_arg_conv); - return tag_ptr(ret_ret, true); +int8_tArray CS_LDK_PaymentFailureReason_write(int64_t obj) { + LDKPaymentFailureReason* obj_conv = (LDKPaymentFailureReason*)untag_ptr(obj); + LDKCVec_u8Z ret_var = PaymentFailureReason_write(obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -int64_t 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_PaymentFailureReason_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ), "LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ"); + *ret_conv = PaymentFailureReason_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_PhantomKeysManager_as_SignerProvider(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; - LDKSignerProvider* ret_ret = MALLOC(sizeof(LDKSignerProvider), "LDKSignerProvider"); - *ret_ret = PhantomKeysManager_as_SignerProvider(&this_arg_conv); - return tag_ptr(ret_ret, true); +void CS_LDK_Event_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); + LDKEvent this_ptr_conv = *(LDKEvent*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Event_free(this_ptr_conv); } -int64_t CS_LDK_PhantomKeysManager_new(int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos, int8_tArray cross_node_seed) { - uint8_t seed_arr[32]; - CHECK(seed->arr_len == 32); - memcpy(seed_arr, seed->elems, 32); FREE(seed); - uint8_t (*seed_ref)[32] = &seed_arr; - uint8_t cross_node_seed_arr[32]; - CHECK(cross_node_seed->arr_len == 32); - memcpy(cross_node_seed_arr, cross_node_seed->elems, 32); FREE(cross_node_seed); - uint8_t (*cross_node_seed_ref)[32] = &cross_node_seed_arr; - LDKPhantomKeysManager ret_var = PhantomKeysManager_new(seed_ref, starting_time_secs, starting_time_nanos, cross_node_seed_ref); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +static inline uint64_t Event_clone_ptr(LDKEvent *NONNULL_PTR arg) { + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } +int64_t CS_LDK_Event_clone_ptr(int64_t arg) { + LDKEvent* arg_conv = (LDKEvent*)untag_ptr(arg); + int64_t ret_conv = Event_clone_ptr(arg_conv); + return ret_conv; +} -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); - this_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 params_arr[32]; - CHECK(params->arr_len == 32); - memcpy(params_arr, params->elems, 32); FREE(params); - uint8_t (*params_ref)[32] = ¶ms_arr; - LDKInMemorySigner ret_var = PhantomKeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_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); +int64_t CS_LDK_Event_clone(int64_t orig) { + LDKEvent* orig_conv = (LDKEvent*)untag_ptr(orig); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int8_tArray CS_LDK_PhantomKeysManager_get_node_secret_key(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; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, PhantomKeysManager_get_node_secret_key(&this_arg_conv).bytes, 32); - return ret_arr; -} - -int8_tArray CS_LDK_PhantomKeysManager_get_phantom_node_secret_key(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; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, PhantomKeysManager_get_phantom_node_secret_key(&this_arg_conv).bytes, 32); - return ret_arr; -} - -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_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); + LDKCVec_u8Z output_script_ref; + output_script_ref.datalen = output_script->arr_len; + output_script_ref.data = MALLOC(output_script_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(output_script_ref.data, output_script->elems, output_script_ref.datalen); FREE(output_script); + LDKU128 user_channel_id_ref; + CHECK(user_channel_id->arr_len == 16); + memcpy(user_channel_id_ref.le_bytes, user_channel_id->elems, 16); FREE(user_channel_id); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_funding_generation_ready(temporary_channel_id_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; } -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); +int64_t CS_LDK_Event_funding_tx_broadcast_safe(int64_t channel_id, int8_tArray user_channel_id, int64_t funding_txo, int8_tArray counterparty_node_id, int64_t former_temporary_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); + 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); + 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); + 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); + 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); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_funding_tx_broadcast_safe(channel_id_conv, user_channel_id_ref, funding_txo_conv, counterparty_node_id_ref, former_temporary_channel_id_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); 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); +int64_t CS_LDK_Event_payment_claimable(int8_tArray receiver_node_id, int8_tArray payment_hash, int64_t onion_fields, int64_t amount_msat, int64_t counterparty_skimmed_fee_msat, int64_t purpose, int64_t via_channel_id, int64_t via_user_channel_id, int64_t claim_deadline) { + LDKPublicKey receiver_node_id_ref; + CHECK(receiver_node_id->arr_len == 33); + memcpy(receiver_node_id_ref.compressed_form, receiver_node_id->elems, 33); FREE(receiver_node_id); + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKRecipientOnionFields onion_fields_conv; + onion_fields_conv.inner = untag_ptr(onion_fields); + onion_fields_conv.is_owned = ptr_is_owned(onion_fields); + CHECK_INNER_FIELD_ACCESS_OR_NULL(onion_fields_conv); + onion_fields_conv = RecipientOnionFields_clone(&onion_fields_conv); + void* purpose_ptr = untag_ptr(purpose); + CHECK_ACCESS(purpose_ptr); + LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr); + purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose)); + 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); + via_user_channel_id_conv = COption_U128Z_clone((LDKCOption_U128Z*)untag_ptr(via_user_channel_id)); + void* claim_deadline_ptr = untag_ptr(claim_deadline); + CHECK_ACCESS(claim_deadline_ptr); + LDKCOption_u32Z claim_deadline_conv = *(LDKCOption_u32Z*)(claim_deadline_ptr); + claim_deadline_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(claim_deadline)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_claimable(receiver_node_id_ref, payment_hash_ref, onion_fields_conv, amount_msat, counterparty_skimmed_fee_msat, purpose_conv, via_channel_id_conv, via_user_channel_id_conv, claim_deadline_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_EcdsaChannelSigner_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); - LDKEcdsaChannelSigner this_ptr_conv = *(LDKEcdsaChannelSigner*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - EcdsaChannelSigner_free(this_ptr_conv); +int64_t CS_LDK_Event_payment_claimed(int8_tArray receiver_node_id, int8_tArray payment_hash, int64_t amount_msat, int64_t purpose, int64_tArray htlcs, int64_t sender_intended_total_msat, int64_t onion_fields) { + LDKPublicKey receiver_node_id_ref; + CHECK(receiver_node_id->arr_len == 33); + memcpy(receiver_node_id_ref.compressed_form, receiver_node_id->elems, 33); FREE(receiver_node_id); + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + void* purpose_ptr = untag_ptr(purpose); + CHECK_ACCESS(purpose_ptr); + LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr); + purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose)); + LDKCVec_ClaimedHTLCZ htlcs_constr; + htlcs_constr.datalen = htlcs->arr_len; + if (htlcs_constr.datalen > 0) + htlcs_constr.data = MALLOC(htlcs_constr.datalen * sizeof(LDKClaimedHTLC), "LDKCVec_ClaimedHTLCZ Elements"); + else + htlcs_constr.data = NULL; + int64_t* htlcs_vals = htlcs->elems; + for (size_t n = 0; n < htlcs_constr.datalen; n++) { + int64_t htlcs_conv_13 = htlcs_vals[n]; + LDKClaimedHTLC htlcs_conv_13_conv; + htlcs_conv_13_conv.inner = untag_ptr(htlcs_conv_13); + htlcs_conv_13_conv.is_owned = ptr_is_owned(htlcs_conv_13); + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlcs_conv_13_conv); + htlcs_conv_13_conv = ClaimedHTLC_clone(&htlcs_conv_13_conv); + htlcs_constr.data[n] = htlcs_conv_13_conv; + } + FREE(htlcs); + void* sender_intended_total_msat_ptr = untag_ptr(sender_intended_total_msat); + CHECK_ACCESS(sender_intended_total_msat_ptr); + LDKCOption_u64Z sender_intended_total_msat_conv = *(LDKCOption_u64Z*)(sender_intended_total_msat_ptr); + sender_intended_total_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(sender_intended_total_msat)); + LDKRecipientOnionFields onion_fields_conv; + onion_fields_conv.inner = untag_ptr(onion_fields); + onion_fields_conv.is_owned = ptr_is_owned(onion_fields); + CHECK_INNER_FIELD_ACCESS_OR_NULL(onion_fields_conv); + onion_fields_conv = RecipientOnionFields_clone(&onion_fields_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_claimed(receiver_node_id_ref, payment_hash_ref, amount_msat, purpose_conv, htlcs_constr, sender_intended_total_msat_conv, onion_fields_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -static inline uint64_t WriteableEcdsaChannelSigner_clone_ptr(LDKWriteableEcdsaChannelSigner *NONNULL_PTR arg) { - LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner"); - *ret_ret = WriteableEcdsaChannelSigner_clone(arg); - return tag_ptr(ret_ret, true); -} -int64_t CS_LDK_WriteableEcdsaChannelSigner_clone_ptr(int64_t arg) { - void* arg_ptr = untag_ptr(arg); - if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); } - LDKWriteableEcdsaChannelSigner* arg_conv = (LDKWriteableEcdsaChannelSigner*)arg_ptr; - int64_t ret_conv = WriteableEcdsaChannelSigner_clone_ptr(arg_conv); - return ret_conv; +int64_t CS_LDK_Event_connection_needed(int8_tArray node_id, int64_tArray addresses) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKCVec_SocketAddressZ addresses_constr; + addresses_constr.datalen = addresses->arr_len; + if (addresses_constr.datalen > 0) + addresses_constr.data = MALLOC(addresses_constr.datalen * sizeof(LDKSocketAddress), "LDKCVec_SocketAddressZ Elements"); + else + addresses_constr.data = NULL; + int64_t* addresses_vals = addresses->elems; + for (size_t p = 0; p < addresses_constr.datalen; p++) { + int64_t addresses_conv_15 = addresses_vals[p]; + void* addresses_conv_15_ptr = untag_ptr(addresses_conv_15); + CHECK_ACCESS(addresses_conv_15_ptr); + LDKSocketAddress addresses_conv_15_conv = *(LDKSocketAddress*)(addresses_conv_15_ptr); + addresses_conv_15_conv = SocketAddress_clone((LDKSocketAddress*)untag_ptr(addresses_conv_15)); + addresses_constr.data[p] = addresses_conv_15_conv; + } + FREE(addresses); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_connection_needed(node_id_ref, addresses_constr); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_WriteableEcdsaChannelSigner_clone(int64_t orig) { - void* orig_ptr = untag_ptr(orig); - if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); } - LDKWriteableEcdsaChannelSigner* orig_conv = (LDKWriteableEcdsaChannelSigner*)orig_ptr; - LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner"); - *ret_ret = WriteableEcdsaChannelSigner_clone(orig_conv); - return tag_ptr(ret_ret, true); +int64_t CS_LDK_Event_invoice_received(int8_tArray payment_id, int64_t invoice, int64_t context, int64_t responder) { + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + LDKBolt12Invoice invoice_conv; + invoice_conv.inner = untag_ptr(invoice); + invoice_conv.is_owned = ptr_is_owned(invoice); + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); + invoice_conv = Bolt12Invoice_clone(&invoice_conv); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKCOption_OffersContextZ context_conv = *(LDKCOption_OffersContextZ*)(context_ptr); + context_conv = COption_OffersContextZ_clone((LDKCOption_OffersContextZ*)untag_ptr(context)); + LDKResponder responder_conv; + responder_conv.inner = untag_ptr(responder); + responder_conv.is_owned = ptr_is_owned(responder); + CHECK_INNER_FIELD_ACCESS_OR_NULL(responder_conv); + responder_conv = Responder_clone(&responder_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_invoice_received(payment_id_ref, invoice_conv, context_conv, responder_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_WriteableEcdsaChannelSigner_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); - LDKWriteableEcdsaChannelSigner this_ptr_conv = *(LDKWriteableEcdsaChannelSigner*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - WriteableEcdsaChannelSigner_free(this_ptr_conv); +int64_t CS_LDK_Event_payment_sent(int64_t payment_id, int8_tArray payment_preimage, int8_tArray payment_hash, int64_t fee_paid_msat) { + void* payment_id_ptr = untag_ptr(payment_id); + CHECK_ACCESS(payment_id_ptr); + LDKCOption_ThirtyTwoBytesZ payment_id_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_id_ptr); + payment_id_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_id)); + LDKThirtyTwoBytes payment_preimage_ref; + CHECK(payment_preimage->arr_len == 32); + memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + void* fee_paid_msat_ptr = untag_ptr(fee_paid_msat); + CHECK_ACCESS(fee_paid_msat_ptr); + LDKCOption_u64Z fee_paid_msat_conv = *(LDKCOption_u64Z*)(fee_paid_msat_ptr); + fee_paid_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(fee_paid_msat)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_sent(payment_id_conv, payment_preimage_ref, payment_hash_ref, fee_paid_msat_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_OnionMessenger_free(int64_t this_obj) { - LDKOnionMessenger this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - OnionMessenger_free(this_obj_conv); +int64_t CS_LDK_Event_payment_failed(int8_tArray payment_id, int64_t payment_hash, int64_t reason) { + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + void* payment_hash_ptr = untag_ptr(payment_hash); + CHECK_ACCESS(payment_hash_ptr); + LDKCOption_ThirtyTwoBytesZ payment_hash_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_ptr); + payment_hash_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash)); + void* reason_ptr = untag_ptr(reason); + CHECK_ACCESS(reason_ptr); + LDKCOption_PaymentFailureReasonZ reason_conv = *(LDKCOption_PaymentFailureReasonZ*)(reason_ptr); + reason_conv = COption_PaymentFailureReasonZ_clone((LDKCOption_PaymentFailureReasonZ*)untag_ptr(reason)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_failed(payment_id_ref, payment_hash_conv, reason_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_MessageRouter_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); - LDKMessageRouter this_ptr_conv = *(LDKMessageRouter*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - MessageRouter_free(this_ptr_conv); +int64_t CS_LDK_Event_payment_path_successful(int8_tArray payment_id, int64_t payment_hash, int64_t path) { + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + void* payment_hash_ptr = untag_ptr(payment_hash); + CHECK_ACCESS(payment_hash_ptr); + LDKCOption_ThirtyTwoBytesZ payment_hash_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_ptr); + payment_hash_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash)); + LDKPath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv = Path_clone(&path_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_path_successful(payment_id_ref, payment_hash_conv, path_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_DefaultMessageRouter_free(int64_t this_obj) { - LDKDefaultMessageRouter this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - DefaultMessageRouter_free(this_obj_conv); +int64_t CS_LDK_Event_payment_path_failed(int64_t payment_id, int8_tArray payment_hash, jboolean payment_failed_permanently, int64_t failure, int64_t path, int64_t short_channel_id) { + void* payment_id_ptr = untag_ptr(payment_id); + CHECK_ACCESS(payment_id_ptr); + LDKCOption_ThirtyTwoBytesZ payment_id_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_id_ptr); + payment_id_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_id)); + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + void* failure_ptr = untag_ptr(failure); + CHECK_ACCESS(failure_ptr); + LDKPathFailure failure_conv = *(LDKPathFailure*)(failure_ptr); + failure_conv = PathFailure_clone((LDKPathFailure*)untag_ptr(failure)); + LDKPath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv = Path_clone(&path_conv); + void* short_channel_id_ptr = untag_ptr(short_channel_id); + CHECK_ACCESS(short_channel_id_ptr); + LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr); + short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_path_failed(payment_id_conv, payment_hash_ref, payment_failed_permanently, failure_conv, path_conv, short_channel_id_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_DefaultMessageRouter_new(int64_t network_graph, int64_t entropy_source) { - LDKNetworkGraph network_graph_conv; - network_graph_conv.inner = untag_ptr(network_graph); - network_graph_conv.is_owned = ptr_is_owned(network_graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - network_graph_conv.is_owned = false; - void* 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); - } - LDKDefaultMessageRouter ret_var = DefaultMessageRouter_new(&network_graph_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); +int64_t CS_LDK_Event_probe_successful(int8_tArray payment_id, int8_tArray payment_hash, int64_t path) { + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKPath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv = Path_clone(&path_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_probe_successful(payment_id_ref, payment_hash_ref, path_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_DefaultMessageRouter_as_MessageRouter(int64_t this_arg) { - LDKDefaultMessageRouter this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKMessageRouter* ret_ret = MALLOC(sizeof(LDKMessageRouter), "LDKMessageRouter"); - *ret_ret = DefaultMessageRouter_as_MessageRouter(&this_arg_conv); - return tag_ptr(ret_ret, true); +int64_t CS_LDK_Event_probe_failed(int8_tArray payment_id, int8_tArray payment_hash, int64_t path, int64_t short_channel_id) { + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKPath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv = Path_clone(&path_conv); + void* short_channel_id_ptr = untag_ptr(short_channel_id); + CHECK_ACCESS(short_channel_id_ptr); + LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr); + short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_probe_failed(payment_id_ref, payment_hash_ref, path_conv, short_channel_id_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_OnionMessagePath_free(int64_t this_obj) { - LDKOnionMessagePath this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - OnionMessagePath_free(this_obj_conv); +int64_t CS_LDK_Event_pending_htlcs_forwardable(int64_t time_forwardable) { + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_pending_htlcs_forwardable(time_forwardable); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -ptrArray CS_LDK_OnionMessagePath_get_intermediate_nodes(int64_t this_ptr) { - LDKOnionMessagePath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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_PublicKeyZ ret_var = OnionMessagePath_get_intermediate_nodes(&this_ptr_conv); - ptrArray ret_arr = NULL; - ret_arr = init_ptrArray(ret_var.datalen, __LINE__); - int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8); - for (size_t i = 0; i < ret_var.datalen; i++) { - int8_tArray ret_conv_8_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_conv_8_arr->elems, ret_var.data[i].compressed_form, 33); - ret_arr_ptr[i] = ret_conv_8_arr; - } - - FREE(ret_var.data); - return ret_arr; +int64_t CS_LDK_Event_htlcintercepted(int8_tArray intercept_id, int64_t requested_next_hop_scid, int8_tArray payment_hash, int64_t inbound_amount_msat, int64_t expected_outbound_amount_msat) { + LDKThirtyTwoBytes intercept_id_ref; + CHECK(intercept_id->arr_len == 32); + memcpy(intercept_id_ref.data, intercept_id->elems, 32); FREE(intercept_id); + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_htlcintercepted(intercept_id_ref, requested_next_hop_scid, payment_hash_ref, inbound_amount_msat, expected_outbound_amount_msat); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_OnionMessagePath_set_intermediate_nodes(int64_t this_ptr, ptrArray val) { - LDKOnionMessagePath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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_PublicKeyZ val_constr; - val_constr.datalen = val->arr_len; - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); +int64_t CS_LDK_Event_spendable_outputs(int64_tArray outputs, int64_t channel_id) { + LDKCVec_SpendableOutputDescriptorZ outputs_constr; + outputs_constr.datalen = outputs->arr_len; + if (outputs_constr.datalen > 0) + outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); else - val_constr.data = NULL; - int8_tArray* val_vals = (void*) val->elems; - for (size_t i = 0; i < val_constr.datalen; i++) { - int8_tArray val_conv_8 = val_vals[i]; - LDKPublicKey val_conv_8_ref; - CHECK(val_conv_8->arr_len == 33); - memcpy(val_conv_8_ref.compressed_form, val_conv_8->elems, 33); FREE(val_conv_8); - val_constr.data[i] = val_conv_8_ref; + outputs_constr.data = NULL; + int64_t* outputs_vals = outputs->elems; + for (size_t b = 0; b < outputs_constr.datalen; b++) { + int64_t outputs_conv_27 = outputs_vals[b]; + void* outputs_conv_27_ptr = untag_ptr(outputs_conv_27); + CHECK_ACCESS(outputs_conv_27_ptr); + LDKSpendableOutputDescriptor outputs_conv_27_conv = *(LDKSpendableOutputDescriptor*)(outputs_conv_27_ptr); + outputs_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(outputs_conv_27)); + outputs_constr.data[b] = outputs_conv_27_conv; } - FREE(val); - OnionMessagePath_set_intermediate_nodes(&this_ptr_conv, val_constr); + FREE(outputs); + 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_OnionMessagePath_get_destination(int64_t this_ptr) { - LDKOnionMessagePath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); - *ret_copy = OnionMessagePath_get_destination(&this_ptr_conv); +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, 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; } -void CS_LDK_OnionMessagePath_set_destination(int64_t this_ptr, int64_t val) { - LDKOnionMessagePath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - LDKDestination val_conv = *(LDKDestination*)(val_ptr); - val_conv = Destination_clone((LDKDestination*)untag_ptr(val)); - OnionMessagePath_set_destination(&this_ptr_conv, val_conv); -} - -int64_t CS_LDK_OnionMessagePath_get_first_node_addresses(int64_t this_ptr) { - LDKOnionMessagePath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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_SocketAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_SocketAddressZZ), "LDKCOption_CVec_SocketAddressZZ"); - *ret_copy = OnionMessagePath_get_first_node_addresses(&this_ptr_conv); +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); + 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); + 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); + 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_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; } -void CS_LDK_OnionMessagePath_set_first_node_addresses(int64_t this_ptr, int64_t val) { - LDKOnionMessagePath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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_SocketAddressZZ val_conv = *(LDKCOption_CVec_SocketAddressZZ*)(val_ptr); - val_conv = COption_CVec_SocketAddressZZ_clone((LDKCOption_CVec_SocketAddressZZ*)untag_ptr(val)); - OnionMessagePath_set_first_node_addresses(&this_ptr_conv, val_conv); -} - -int64_t CS_LDK_OnionMessagePath_new(ptrArray intermediate_nodes_arg, int64_t destination_arg, int64_t first_node_addresses_arg) { - LDKCVec_PublicKeyZ intermediate_nodes_arg_constr; - intermediate_nodes_arg_constr.datalen = intermediate_nodes_arg->arr_len; - if (intermediate_nodes_arg_constr.datalen > 0) - intermediate_nodes_arg_constr.data = MALLOC(intermediate_nodes_arg_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); - else - intermediate_nodes_arg_constr.data = NULL; - int8_tArray* intermediate_nodes_arg_vals = (void*) intermediate_nodes_arg->elems; - for (size_t i = 0; i < intermediate_nodes_arg_constr.datalen; i++) { - int8_tArray intermediate_nodes_arg_conv_8 = intermediate_nodes_arg_vals[i]; - LDKPublicKey intermediate_nodes_arg_conv_8_ref; - CHECK(intermediate_nodes_arg_conv_8->arr_len == 33); - memcpy(intermediate_nodes_arg_conv_8_ref.compressed_form, intermediate_nodes_arg_conv_8->elems, 33); FREE(intermediate_nodes_arg_conv_8); - intermediate_nodes_arg_constr.data[i] = intermediate_nodes_arg_conv_8_ref; - } - FREE(intermediate_nodes_arg); - void* destination_arg_ptr = untag_ptr(destination_arg); - CHECK_ACCESS(destination_arg_ptr); - LDKDestination destination_arg_conv = *(LDKDestination*)(destination_arg_ptr); - destination_arg_conv = Destination_clone((LDKDestination*)untag_ptr(destination_arg)); - void* first_node_addresses_arg_ptr = untag_ptr(first_node_addresses_arg); - CHECK_ACCESS(first_node_addresses_arg_ptr); - LDKCOption_CVec_SocketAddressZZ first_node_addresses_arg_conv = *(LDKCOption_CVec_SocketAddressZZ*)(first_node_addresses_arg_ptr); - LDKOnionMessagePath ret_var = OnionMessagePath_new(intermediate_nodes_arg_constr, destination_arg_conv, first_node_addresses_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); +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); + LDKPublicKey counterparty_node_id_ref; + CHECK(counterparty_node_id->arr_len == 33); + memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); + LDKChannelTypeFeatures channel_type_conv; + channel_type_conv.inner = untag_ptr(channel_type); + channel_type_conv.is_owned = ptr_is_owned(channel_type); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_conv); + channel_type_conv = ChannelTypeFeatures_clone(&channel_type_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_channel_ready(channel_id_conv, user_channel_id_ref, counterparty_node_id_ref, channel_type_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline uint64_t OnionMessagePath_clone_ptr(LDKOnionMessagePath *NONNULL_PTR arg) { - LDKOnionMessagePath ret_var = OnionMessagePath_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); +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); + void* reason_ptr = untag_ptr(reason); + CHECK_ACCESS(reason_ptr); + LDKClosureReason reason_conv = *(LDKClosureReason*)(reason_ptr); + reason_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(reason)); + LDKPublicKey counterparty_node_id_ref; + CHECK(counterparty_node_id->arr_len == 33); + memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); + void* channel_capacity_sats_ptr = untag_ptr(channel_capacity_sats); + CHECK_ACCESS(channel_capacity_sats_ptr); + LDKCOption_u64Z channel_capacity_sats_conv = *(LDKCOption_u64Z*)(channel_capacity_sats_ptr); + channel_capacity_sats_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(channel_capacity_sats)); + LDKOutPoint channel_funding_txo_conv; + channel_funding_txo_conv.inner = untag_ptr(channel_funding_txo); + channel_funding_txo_conv.is_owned = ptr_is_owned(channel_funding_txo); + 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_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_OnionMessagePath_clone_ptr(int64_t arg) { - LDKOnionMessagePath 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 = OnionMessagePath_clone_ptr(&arg_conv); - return ret_conv; -} -int64_t CS_LDK_OnionMessagePath_clone(int64_t orig) { - LDKOnionMessagePath 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; - LDKOnionMessagePath ret_var = OnionMessagePath_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); +int64_t CS_LDK_Event_discard_funding(int64_t channel_id, int64_t funding_info) { + 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* funding_info_ptr = untag_ptr(funding_info); + CHECK_ACCESS(funding_info_ptr); + LDKFundingInfo funding_info_conv = *(LDKFundingInfo*)(funding_info_ptr); + funding_info_conv = FundingInfo_clone((LDKFundingInfo*)untag_ptr(funding_info)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_discard_funding(channel_id_conv, funding_info_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int8_tArray CS_LDK_OnionMessagePath_first_node(int64_t this_arg) { - LDKOnionMessagePath this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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, OnionMessagePath_first_node(&this_arg_conv).compressed_form, 33); - return ret_arr; -} - -void CS_LDK_Destination_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); - LDKDestination this_ptr_conv = *(LDKDestination*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Destination_free(this_ptr_conv); +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, jboolean is_announced, int64_t params) { + 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); + 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); + LDKChannelParameters params_conv; + params_conv.inner = untag_ptr(params); + params_conv.is_owned = ptr_is_owned(params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); + params_conv = ChannelParameters_clone(¶ms_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_open_channel_request(temporary_channel_id_conv, counterparty_node_id_ref, funding_satoshis, push_msat, channel_type_conv, is_announced, params_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -static inline uint64_t Destination_clone_ptr(LDKDestination *NONNULL_PTR arg) { - LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); - *ret_copy = Destination_clone(arg); +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_conv, failed_next_destination_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Destination_clone_ptr(int64_t arg) { - LDKDestination* arg_conv = (LDKDestination*)untag_ptr(arg); - int64_t ret_conv = Destination_clone_ptr(arg_conv); - return ret_conv; -} -int64_t CS_LDK_Destination_clone(int64_t orig) { - LDKDestination* orig_conv = (LDKDestination*)untag_ptr(orig); - LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); - *ret_copy = Destination_clone(orig_conv); +int64_t CS_LDK_Event_bump_transaction(int64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKBumpTransactionEvent a_conv = *(LDKBumpTransactionEvent*)(a_ptr); + a_conv = BumpTransactionEvent_clone((LDKBumpTransactionEvent*)untag_ptr(a)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_bump_transaction(a_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Destination_node(int8_tArray a) { - LDKPublicKey a_ref; - CHECK(a->arr_len == 33); - memcpy(a_ref.compressed_form, a->elems, 33); FREE(a); - LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); - *ret_copy = Destination_node(a_ref); +int64_t CS_LDK_Event_onion_message_intercepted(int8_tArray peer_node_id, int64_t message) { + LDKPublicKey peer_node_id_ref; + CHECK(peer_node_id->arr_len == 33); + memcpy(peer_node_id_ref.compressed_form, peer_node_id->elems, 33); FREE(peer_node_id); + LDKOnionMessage 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 = OnionMessage_clone(&message_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_onion_message_intercepted(peer_node_id_ref, message_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Destination_blinded_path(int64_t a) { - LDKBlindedPath a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = BlindedPath_clone(&a_conv); - LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); - *ret_copy = Destination_blinded_path(a_conv); +int64_t CS_LDK_Event_onion_message_peer_connected(int8_tArray peer_node_id) { + LDKPublicKey peer_node_id_ref; + CHECK(peer_node_id->arr_len == 33); + memcpy(peer_node_id_ref.compressed_form, peer_node_id->elems, 33); FREE(peer_node_id); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_onion_message_peer_connected(peer_node_id_ref); int64_t ret_ref = tag_ptr(ret_copy, true); 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); +jboolean CS_LDK_Event_eq(int64_t a, int64_t b) { + LDKEvent* a_conv = (LDKEvent*)untag_ptr(a); + LDKEvent* b_conv = (LDKEvent*)untag_ptr(b); + jboolean ret_conv = Event_eq(a_conv, b_conv); return ret_conv; } -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; +int8_tArray CS_LDK_Event_write(int64_t obj) { + LDKEvent* obj_conv = (LDKEvent*)untag_ptr(obj); + LDKCVec_u8Z ret_var = Event_write(obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -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); +int64_t CS_LDK_Event_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = Event_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -void CS_LDK_SendSuccess_free(int64_t this_ptr) { +void CS_LDK_MessageSendEvent_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); - LDKSendSuccess this_ptr_conv = *(LDKSendSuccess*)(this_ptr_ptr); + LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - SendSuccess_free(this_ptr_conv); + MessageSendEvent_free(this_ptr_conv); } -static inline uint64_t SendSuccess_clone_ptr(LDKSendSuccess *NONNULL_PTR arg) { - LDKSendSuccess *ret_copy = MALLOC(sizeof(LDKSendSuccess), "LDKSendSuccess"); - *ret_copy = SendSuccess_clone(arg); +static inline uint64_t MessageSendEvent_clone_ptr(LDKMessageSendEvent *NONNULL_PTR arg) { + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_SendSuccess_clone_ptr(int64_t arg) { - LDKSendSuccess* arg_conv = (LDKSendSuccess*)untag_ptr(arg); - int64_t ret_conv = SendSuccess_clone_ptr(arg_conv); +int64_t CS_LDK_MessageSendEvent_clone_ptr(int64_t arg) { + LDKMessageSendEvent* arg_conv = (LDKMessageSendEvent*)untag_ptr(arg); + int64_t ret_conv = MessageSendEvent_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_SendSuccess_clone(int64_t orig) { - LDKSendSuccess* orig_conv = (LDKSendSuccess*)untag_ptr(orig); - LDKSendSuccess *ret_copy = MALLOC(sizeof(LDKSendSuccess), "LDKSendSuccess"); - *ret_copy = SendSuccess_clone(orig_conv); +int64_t CS_LDK_MessageSendEvent_clone(int64_t orig) { + LDKMessageSendEvent* orig_conv = (LDKMessageSendEvent*)untag_ptr(orig); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_clone(orig_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_SendSuccess_buffered() { - LDKSendSuccess *ret_copy = MALLOC(sizeof(LDKSendSuccess), "LDKSendSuccess"); - *ret_copy = SendSuccess_buffered(); +int64_t CS_LDK_MessageSendEvent_send_accept_channel(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKAcceptChannel msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = AcceptChannel_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_accept_channel(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_SendSuccess_buffered_awaiting_connection(int8_tArray a) { - LDKPublicKey a_ref; - CHECK(a->arr_len == 33); - memcpy(a_ref.compressed_form, a->elems, 33); FREE(a); - LDKSendSuccess *ret_copy = MALLOC(sizeof(LDKSendSuccess), "LDKSendSuccess"); - *ret_copy = SendSuccess_buffered_awaiting_connection(a_ref); +int64_t CS_LDK_MessageSendEvent_send_accept_channel_v2(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKAcceptChannelV2 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 = AcceptChannelV2_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_accept_channel_v2(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); 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); - jboolean ret_conv = SendSuccess_eq(a_conv, b_conv); - return ret_conv; -} - -void CS_LDK_SendError_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); - LDKSendError this_ptr_conv = *(LDKSendError*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - SendError_free(this_ptr_conv); -} - -static inline uint64_t SendError_clone_ptr(LDKSendError *NONNULL_PTR arg) { - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_clone(arg); +int64_t CS_LDK_MessageSendEvent_send_open_channel(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKOpenChannel msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = OpenChannel_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_open_channel(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_SendError_clone_ptr(int64_t arg) { - LDKSendError* arg_conv = (LDKSendError*)untag_ptr(arg); - int64_t ret_conv = SendError_clone_ptr(arg_conv); - return ret_conv; -} -int64_t CS_LDK_SendError_clone(int64_t orig) { - LDKSendError* orig_conv = (LDKSendError*)untag_ptr(orig); - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_clone(orig_conv); +int64_t CS_LDK_MessageSendEvent_send_open_channel_v2(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKOpenChannelV2 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 = OpenChannelV2_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_open_channel_v2(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_SendError_secp256k1(int32_t a) { - LDKSecp256k1Error a_conv = LDKSecp256k1Error_from_cs(a); - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_secp256k1(a_conv); +int64_t CS_LDK_MessageSendEvent_send_funding_created(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKFundingCreated msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = FundingCreated_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_funding_created(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_SendError_too_big_packet() { - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_too_big_packet(); +int64_t CS_LDK_MessageSendEvent_send_funding_signed(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKFundingSigned msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = FundingSigned_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_funding_signed(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_SendError_too_few_blinded_hops() { - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_too_few_blinded_hops(); +int64_t CS_LDK_MessageSendEvent_send_stfu(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKStfu 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 = Stfu_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_stfu(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_SendError_invalid_first_hop(int8_tArray a) { - LDKPublicKey a_ref; - CHECK(a->arr_len == 33); - memcpy(a_ref.compressed_form, a->elems, 33); FREE(a); - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_invalid_first_hop(a_ref); +int64_t CS_LDK_MessageSendEvent_send_splice_init(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKSpliceInit 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 = SpliceInit_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_splice_init(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_SendError_path_not_found() { - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_path_not_found(); +int64_t CS_LDK_MessageSendEvent_send_splice_ack(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + 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 = SpliceAck_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_splice_ack(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_SendError_invalid_message() { - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_invalid_message(); +int64_t CS_LDK_MessageSendEvent_send_splice_locked(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + 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 = SpliceLocked_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_splice_locked(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_SendError_buffer_full() { - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_buffer_full(); +int64_t CS_LDK_MessageSendEvent_send_tx_add_input(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKTxAddInput 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 = TxAddInput_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_tx_add_input(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_SendError_get_node_id_failed() { - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_get_node_id_failed(); +int64_t CS_LDK_MessageSendEvent_send_tx_add_output(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKTxAddOutput 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 = TxAddOutput_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_tx_add_output(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); 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 CS_LDK_MessageSendEvent_send_tx_remove_input(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKTxRemoveInput 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 = TxRemoveInput_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_tx_remove_input(node_id_ref, msg_conv); 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(); +int64_t CS_LDK_MessageSendEvent_send_tx_remove_output(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKTxRemoveOutput 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 = TxRemoveOutput_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_tx_remove_output(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); 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); - jboolean ret_conv = SendError_eq(a_conv, b_conv); - return ret_conv; -} - -void CS_LDK_CustomOnionMessageHandler_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); - LDKCustomOnionMessageHandler this_ptr_conv = *(LDKCustomOnionMessageHandler*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - CustomOnionMessageHandler_free(this_ptr_conv); -} - -void CS_LDK_PeeledOnion_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); - LDKPeeledOnion this_ptr_conv = *(LDKPeeledOnion*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - PeeledOnion_free(this_ptr_conv); -} - -static inline uint64_t PeeledOnion_clone_ptr(LDKPeeledOnion *NONNULL_PTR arg) { - LDKPeeledOnion *ret_copy = MALLOC(sizeof(LDKPeeledOnion), "LDKPeeledOnion"); - *ret_copy = PeeledOnion_clone(arg); +int64_t CS_LDK_MessageSendEvent_send_tx_complete(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKTxComplete 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 = TxComplete_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_tx_complete(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_PeeledOnion_clone_ptr(int64_t arg) { - LDKPeeledOnion* arg_conv = (LDKPeeledOnion*)untag_ptr(arg); - int64_t ret_conv = PeeledOnion_clone_ptr(arg_conv); - return ret_conv; -} -int64_t CS_LDK_PeeledOnion_clone(int64_t orig) { - LDKPeeledOnion* orig_conv = (LDKPeeledOnion*)untag_ptr(orig); - LDKPeeledOnion *ret_copy = MALLOC(sizeof(LDKPeeledOnion), "LDKPeeledOnion"); - *ret_copy = PeeledOnion_clone(orig_conv); +int64_t CS_LDK_MessageSendEvent_send_tx_signatures(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKTxSignatures 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 = TxSignatures_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_tx_signatures(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -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_conv, b_conv); +int64_t CS_LDK_MessageSendEvent_send_tx_init_rbf(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKTxInitRbf 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 = TxInitRbf_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_tx_init_rbf(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_PeeledOnion_receive(int64_t a, int8_tArray b, int64_t c) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKParsedOnionMessageContents a_conv = *(LDKParsedOnionMessageContents*)(a_ptr); - a_conv = ParsedOnionMessageContents_clone((LDKParsedOnionMessageContents*)untag_ptr(a)); - LDKThirtyTwoBytes b_ref; - CHECK(b->arr_len == 32); - memcpy(b_ref.data, b->elems, 32); FREE(b); - LDKBlindedPath 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 = BlindedPath_clone(&c_conv); - LDKPeeledOnion *ret_copy = MALLOC(sizeof(LDKPeeledOnion), "LDKPeeledOnion"); - *ret_copy = PeeledOnion_receive(a_conv, b_ref, c_conv); +int64_t CS_LDK_MessageSendEvent_send_tx_ack_rbf(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKTxAckRbf 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 = TxAckRbf_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_tx_ack_rbf(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -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); - 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(entropy_source_conv, node_signer_conv, node_id_lookup_conv, path_conv, contents_conv, reply_path_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_peel_onion_message(int64_t msg, int64_t node_signer, int64_t logger, int64_t custom_handler) { - LDKOnionMessage msg_conv; +int64_t CS_LDK_MessageSendEvent_send_tx_abort(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKTxAbort msg_conv; msg_conv.inner = untag_ptr(msg); msg_conv.is_owned = ptr_is_owned(msg); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - void* custom_handler_ptr = untag_ptr(custom_handler); - CHECK_ACCESS(custom_handler_ptr); - LDKCustomOnionMessageHandler custom_handler_conv = *(LDKCustomOnionMessageHandler*)(custom_handler_ptr); - if (custom_handler_conv.free == LDKCustomOnionMessageHandler_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKCustomOnionMessageHandler_JCalls_cloned(&custom_handler_conv); - } - LDKCResult_PeeledOnionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PeeledOnionNoneZ), "LDKCResult_PeeledOnionNoneZ"); - *ret_conv = peel_onion_message(&msg_conv, node_signer_conv, logger_conv, custom_handler_conv); - return tag_ptr(ret_conv, true); + msg_conv = TxAbort_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_tx_abort(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -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); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - void* 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); - if (message_router_conv.free == LDKMessageRouter_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKMessageRouter_JCalls_cloned(&message_router_conv); - } - void* offers_handler_ptr = untag_ptr(offers_handler); - CHECK_ACCESS(offers_handler_ptr); - LDKOffersMessageHandler offers_handler_conv = *(LDKOffersMessageHandler*)(offers_handler_ptr); - if (offers_handler_conv.free == LDKOffersMessageHandler_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKOffersMessageHandler_JCalls_cloned(&offers_handler_conv); - } - void* custom_handler_ptr = untag_ptr(custom_handler); - CHECK_ACCESS(custom_handler_ptr); - LDKCustomOnionMessageHandler custom_handler_conv = *(LDKCustomOnionMessageHandler*)(custom_handler_ptr); - if (custom_handler_conv.free == LDKCustomOnionMessageHandler_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKCustomOnionMessageHandler_JCalls_cloned(&custom_handler_conv); - } - LDKOnionMessenger ret_var = OnionMessenger_new(entropy_source_conv, node_signer_conv, logger_conv, 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); +int64_t CS_LDK_MessageSendEvent_send_channel_ready(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKChannelReady msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = ChannelReady_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_channel_ready(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_OnionMessenger_send_onion_message(int64_t this_arg, int64_t contents, int64_t destination, int64_t reply_path) { - LDKOnionMessenger this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - 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); - } - void* destination_ptr = untag_ptr(destination); - CHECK_ACCESS(destination_ptr); - LDKDestination destination_conv = *(LDKDestination*)(destination_ptr); - destination_conv = Destination_clone((LDKDestination*)untag_ptr(destination)); - 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_SendSuccessSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SendSuccessSendErrorZ), "LDKCResult_SendSuccessSendErrorZ"); - *ret_conv = OnionMessenger_send_onion_message(&this_arg_conv, contents_conv, destination_conv, reply_path_conv); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_MessageSendEvent_send_announcement_signatures(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKAnnouncementSignatures msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = AnnouncementSignatures_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_announcement_signatures(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_OnionMessenger_as_OnionMessageHandler(int64_t this_arg) { - LDKOnionMessenger this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOnionMessageHandler* ret_ret = MALLOC(sizeof(LDKOnionMessageHandler), "LDKOnionMessageHandler"); - *ret_ret = OnionMessenger_as_OnionMessageHandler(&this_arg_conv); - return tag_ptr(ret_ret, true); +int64_t CS_LDK_MessageSendEvent_update_htlcs(int8_tArray node_id, int64_t updates) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKCommitmentUpdate updates_conv; + updates_conv.inner = untag_ptr(updates); + updates_conv.is_owned = ptr_is_owned(updates); + CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv); + updates_conv = CommitmentUpdate_clone(&updates_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_update_htlcs(node_id_ref, updates_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_OffersMessageHandler_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); - LDKOffersMessageHandler this_ptr_conv = *(LDKOffersMessageHandler*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - OffersMessageHandler_free(this_ptr_conv); +int64_t CS_LDK_MessageSendEvent_send_revoke_and_ack(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKRevokeAndACK msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = RevokeAndACK_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_revoke_and_ack(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_OffersMessage_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); - LDKOffersMessage this_ptr_conv = *(LDKOffersMessage*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - OffersMessage_free(this_ptr_conv); +int64_t CS_LDK_MessageSendEvent_send_closing_signed(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKClosingSigned msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = ClosingSigned_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_closing_signed(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -static inline uint64_t OffersMessage_clone_ptr(LDKOffersMessage *NONNULL_PTR arg) { - LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); - *ret_copy = OffersMessage_clone(arg); +int64_t CS_LDK_MessageSendEvent_send_shutdown(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKShutdown msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = Shutdown_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_shutdown(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_OffersMessage_clone_ptr(int64_t arg) { - LDKOffersMessage* arg_conv = (LDKOffersMessage*)untag_ptr(arg); - int64_t ret_conv = OffersMessage_clone_ptr(arg_conv); - return ret_conv; -} -int64_t CS_LDK_OffersMessage_clone(int64_t orig) { - LDKOffersMessage* orig_conv = (LDKOffersMessage*)untag_ptr(orig); - LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); - *ret_copy = OffersMessage_clone(orig_conv); +int64_t CS_LDK_MessageSendEvent_send_channel_reestablish(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKChannelReestablish msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = ChannelReestablish_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_channel_reestablish(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_OffersMessage_invoice_request(int64_t a) { - LDKInvoiceRequest a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = InvoiceRequest_clone(&a_conv); - LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); - *ret_copy = OffersMessage_invoice_request(a_conv); +int64_t CS_LDK_MessageSendEvent_send_channel_announcement(int8_tArray node_id, int64_t msg, int64_t update_msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKChannelAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = ChannelAnnouncement_clone(&msg_conv); + LDKChannelUpdate update_msg_conv; + update_msg_conv.inner = untag_ptr(update_msg); + update_msg_conv.is_owned = ptr_is_owned(update_msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv); + update_msg_conv = ChannelUpdate_clone(&update_msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_channel_announcement(node_id_ref, msg_conv, update_msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_OffersMessage_invoice(int64_t a) { - LDKBolt12Invoice a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = Bolt12Invoice_clone(&a_conv); - LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); - *ret_copy = OffersMessage_invoice(a_conv); +int64_t CS_LDK_MessageSendEvent_broadcast_channel_announcement(int64_t msg, int64_t update_msg) { + LDKChannelAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = ChannelAnnouncement_clone(&msg_conv); + LDKChannelUpdate update_msg_conv; + update_msg_conv.inner = untag_ptr(update_msg); + update_msg_conv.is_owned = ptr_is_owned(update_msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv); + update_msg_conv = ChannelUpdate_clone(&update_msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_broadcast_channel_announcement(msg_conv, update_msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_OffersMessage_invoice_error(int64_t a) { - LDKInvoiceError a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = InvoiceError_clone(&a_conv); - LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); - *ret_copy = OffersMessage_invoice_error(a_conv); +int64_t CS_LDK_MessageSendEvent_broadcast_channel_update(int64_t msg) { + LDKChannelUpdate msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = ChannelUpdate_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_broadcast_channel_update(msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -jboolean CS_LDK_OffersMessage_is_known_type(int64_t tlv_type) { - jboolean ret_conv = OffersMessage_is_known_type(tlv_type); - return ret_conv; +int64_t CS_LDK_MessageSendEvent_broadcast_node_announcement(int64_t msg) { + LDKNodeAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = NodeAnnouncement_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_broadcast_node_announcement(msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_OffersMessage_as_OnionMessageContents(int64_t this_arg) { - LDKOffersMessage* this_arg_conv = (LDKOffersMessage*)untag_ptr(this_arg); - LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); - *ret_ret = OffersMessage_as_OnionMessageContents(this_arg_conv); - return tag_ptr(ret_ret, true); +int64_t CS_LDK_MessageSendEvent_send_channel_update(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKChannelUpdate msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = ChannelUpdate_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_channel_update(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int8_tArray CS_LDK_OffersMessage_write(int64_t obj) { - LDKOffersMessage* obj_conv = (LDKOffersMessage*)untag_ptr(obj); - LDKCVec_u8Z ret_var = OffersMessage_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_MessageSendEvent_handle_error(int8_tArray node_id, int64_t action) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + void* action_ptr = untag_ptr(action); + CHECK_ACCESS(action_ptr); + LDKErrorAction action_conv = *(LDKErrorAction*)(action_ptr); + action_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(action)); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_handle_error(node_id_ref, action_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_OffersMessage_read(int8_tArray ser, int64_t arg_a, int64_t arg_b) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - void* arg_b_ptr = untag_ptr(arg_b); - if (ptr_is_owned(arg_b)) { CHECK_ACCESS(arg_b_ptr); } - LDKLogger* arg_b_conv = (LDKLogger*)arg_b_ptr; - LDKCResult_OffersMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersMessageDecodeErrorZ), "LDKCResult_OffersMessageDecodeErrorZ"); - *ret_conv = OffersMessage_read(ser_ref, arg_a, arg_b_conv); - FREE(ser); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_MessageSendEvent_send_channel_range_query(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKQueryChannelRange msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = QueryChannelRange_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_channel_range_query(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_Packet_free(int64_t this_obj) { - LDKPacket this_obj_conv; +int64_t CS_LDK_MessageSendEvent_send_short_ids_query(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKQueryShortChannelIds msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = QueryShortChannelIds_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_short_ids_query(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_MessageSendEvent_send_reply_channel_range(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKReplyChannelRange msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = ReplyChannelRange_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_reply_channel_range(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_MessageSendEvent_send_gossip_timestamp_filter(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKGossipTimestampFilter msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = GossipTimestampFilter_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_gossip_timestamp_filter(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_MessageSendEventsProvider_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); + LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + MessageSendEventsProvider_free(this_ptr_conv); +} + +void CS_LDK_EventsProvider_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); + LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + EventsProvider_free(this_ptr_conv); +} + +void CS_LDK_ReplayEvent_free(int64_t this_obj) { + LDKReplayEvent this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Packet_free(this_obj_conv); + ReplayEvent_free(this_obj_conv); } -int8_t CS_LDK_Packet_get_version(int64_t this_ptr) { - LDKPacket this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_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 = Packet_get_version(&this_ptr_conv); +int64_t CS_LDK_ReplayEvent_new() { + LDKReplayEvent ret_var = ReplayEvent_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 ReplayEvent_clone_ptr(LDKReplayEvent *NONNULL_PTR arg) { + LDKReplayEvent ret_var = ReplayEvent_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_ReplayEvent_clone_ptr(int64_t arg) { + LDKReplayEvent 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 = ReplayEvent_clone_ptr(&arg_conv); return ret_conv; } -void CS_LDK_Packet_set_version(int64_t this_ptr, int8_t val) { - LDKPacket this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - Packet_set_version(&this_ptr_conv, val); +int64_t CS_LDK_ReplayEvent_clone(int64_t orig) { + LDKReplayEvent 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; + LDKReplayEvent ret_var = ReplayEvent_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; } -int8_tArray CS_LDK_Packet_get_public_key(int64_t this_ptr) { - LDKPacket this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(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, Packet_get_public_key(&this_ptr_conv).compressed_form, 33); - return ret_arr; +void CS_LDK_EventHandler_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); + LDKEventHandler this_ptr_conv = *(LDKEventHandler*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + EventHandler_free(this_ptr_conv); } -void CS_LDK_Packet_set_public_key(int64_t this_ptr, int8_tArray val) { - LDKPacket this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - Packet_set_public_key(&this_ptr_conv, val_ref); +void CS_LDK_AnchorDescriptor_free(int64_t this_obj) { + LDKAnchorDescriptor this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + AnchorDescriptor_free(this_obj_conv); } -int8_tArray CS_LDK_Packet_get_hop_data(int64_t this_ptr) { - LDKPacket this_ptr_conv; +int64_t CS_LDK_AnchorDescriptor_get_channel_derivation_parameters(int64_t this_ptr) { + LDKAnchorDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = Packet_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; + LDKChannelDerivationParameters ret_var = AnchorDescriptor_get_channel_derivation_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_Packet_set_hop_data(int64_t this_ptr, int8_tArray val) { - LDKPacket this_ptr_conv; +void CS_LDK_AnchorDescriptor_set_channel_derivation_parameters(int64_t this_ptr, int64_t val) { + LDKAnchorDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - Packet_set_hop_data(&this_ptr_conv, val_ref); + LDKChannelDerivationParameters 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 = ChannelDerivationParameters_clone(&val_conv); + AnchorDescriptor_set_channel_derivation_parameters(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_Packet_get_hmac(int64_t this_ptr) { - LDKPacket this_ptr_conv; +int64_t CS_LDK_AnchorDescriptor_get_outpoint(int64_t this_ptr) { + LDKAnchorDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(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, *Packet_get_hmac(&this_ptr_conv), 32); - return ret_arr; + LDKOutPoint ret_var = AnchorDescriptor_get_outpoint(&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_Packet_set_hmac(int64_t this_ptr, int8_tArray val) { - LDKPacket this_ptr_conv; +void CS_LDK_AnchorDescriptor_set_outpoint(int64_t this_ptr, int64_t val) { + LDKAnchorDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - Packet_set_hmac(&this_ptr_conv, val_ref); + LDKOutPoint val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = OutPoint_clone(&val_conv); + AnchorDescriptor_set_outpoint(&this_ptr_conv, val_conv); } -int64_t CS_LDK_Packet_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); - LDKPacket ret_var = Packet_new(version_arg, public_key_arg_ref, hop_data_arg_ref, hmac_arg_ref); +int64_t CS_LDK_AnchorDescriptor_new(int64_t channel_derivation_parameters_arg, int64_t outpoint_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); + LDKOutPoint outpoint_arg_conv; + outpoint_arg_conv.inner = untag_ptr(outpoint_arg); + outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); + outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); + LDKAnchorDescriptor ret_var = AnchorDescriptor_new(channel_derivation_parameters_arg_conv, outpoint_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 Packet_clone_ptr(LDKPacket *NONNULL_PTR arg) { - LDKPacket ret_var = Packet_clone(arg); +static inline uint64_t AnchorDescriptor_clone_ptr(LDKAnchorDescriptor *NONNULL_PTR arg) { + LDKAnchorDescriptor ret_var = AnchorDescriptor_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_Packet_clone_ptr(int64_t arg) { - LDKPacket arg_conv; +int64_t CS_LDK_AnchorDescriptor_clone_ptr(int64_t arg) { + LDKAnchorDescriptor 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 = Packet_clone_ptr(&arg_conv); + int64_t ret_conv = AnchorDescriptor_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_Packet_clone(int64_t orig) { - LDKPacket orig_conv; +int64_t CS_LDK_AnchorDescriptor_clone(int64_t orig) { + LDKAnchorDescriptor 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; - LDKPacket ret_var = Packet_clone(&orig_conv); + LDKAnchorDescriptor ret_var = AnchorDescriptor_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_Packet_hash(int64_t o) { - LDKPacket o_conv; - 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 = Packet_hash(&o_conv); - return ret_conv; -} - -jboolean CS_LDK_Packet_eq(int64_t a, int64_t b) { - LDKPacket a_conv; +jboolean CS_LDK_AnchorDescriptor_eq(int64_t a, int64_t b) { + LDKAnchorDescriptor a_conv; 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; - LDKPacket b_conv; + LDKAnchorDescriptor 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 = Packet_eq(&a_conv, &b_conv); + jboolean ret_conv = AnchorDescriptor_eq(&a_conv, &b_conv); return ret_conv; } -int8_tArray CS_LDK_Packet_write(int64_t obj) { - LDKPacket 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 = Packet_write(&obj_conv); +int64_t CS_LDK_AnchorDescriptor_previous_utxo(int64_t this_arg) { + LDKAnchorDescriptor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = AnchorDescriptor_previous_utxo(&this_arg_conv); + return tag_ptr(ret_ref, true); +} + +int64_t CS_LDK_AnchorDescriptor_unsigned_tx_input(int64_t this_arg) { + LDKAnchorDescriptor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKTxIn* ret_ref = MALLOC(sizeof(LDKTxIn), "LDKTxIn"); + *ret_ref = AnchorDescriptor_unsigned_tx_input(&this_arg_conv); + return tag_ptr(ret_ref, true); +} + +int8_tArray CS_LDK_AnchorDescriptor_witness_script(int64_t this_arg) { + LDKAnchorDescriptor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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 ret_var = AnchorDescriptor_witness_script(&this_arg_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } -void CS_LDK_ParsedOnionMessageContents_free(int64_t this_ptr) { +int8_tArray CS_LDK_AnchorDescriptor_tx_input_witness(int64_t this_arg, int8_tArray signature) { + LDKAnchorDescriptor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKECDSASignature signature_ref; + CHECK(signature->arr_len == 64); + memcpy(signature_ref.compact_form, signature->elems, 64); FREE(signature); + LDKWitness ret_var = AnchorDescriptor_tx_input_witness(&this_arg_conv, signature_ref); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + Witness_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_AnchorDescriptor_derive_channel_signer(int64_t this_arg, int64_t signer_provider) { + LDKAnchorDescriptor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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* signer_provider_ptr = untag_ptr(signer_provider); + if (ptr_is_owned(signer_provider)) { CHECK_ACCESS(signer_provider_ptr); } + LDKSignerProvider* signer_provider_conv = (LDKSignerProvider*)signer_provider_ptr; + LDKEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner"); + *ret_ret = AnchorDescriptor_derive_channel_signer(&this_arg_conv, signer_provider_conv); + return tag_ptr(ret_ret, true); +} + +void CS_LDK_BumpTransactionEvent_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); - LDKParsedOnionMessageContents this_ptr_conv = *(LDKParsedOnionMessageContents*)(this_ptr_ptr); + LDKBumpTransactionEvent this_ptr_conv = *(LDKBumpTransactionEvent*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - ParsedOnionMessageContents_free(this_ptr_conv); + BumpTransactionEvent_free(this_ptr_conv); } -static inline uint64_t ParsedOnionMessageContents_clone_ptr(LDKParsedOnionMessageContents *NONNULL_PTR arg) { - LDKParsedOnionMessageContents *ret_copy = MALLOC(sizeof(LDKParsedOnionMessageContents), "LDKParsedOnionMessageContents"); - *ret_copy = ParsedOnionMessageContents_clone(arg); +static inline uint64_t BumpTransactionEvent_clone_ptr(LDKBumpTransactionEvent *NONNULL_PTR arg) { + LDKBumpTransactionEvent *ret_copy = MALLOC(sizeof(LDKBumpTransactionEvent), "LDKBumpTransactionEvent"); + *ret_copy = BumpTransactionEvent_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_ParsedOnionMessageContents_clone_ptr(int64_t arg) { - LDKParsedOnionMessageContents* arg_conv = (LDKParsedOnionMessageContents*)untag_ptr(arg); - int64_t ret_conv = ParsedOnionMessageContents_clone_ptr(arg_conv); +int64_t CS_LDK_BumpTransactionEvent_clone_ptr(int64_t arg) { + LDKBumpTransactionEvent* arg_conv = (LDKBumpTransactionEvent*)untag_ptr(arg); + int64_t ret_conv = BumpTransactionEvent_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_ParsedOnionMessageContents_clone(int64_t orig) { - LDKParsedOnionMessageContents* orig_conv = (LDKParsedOnionMessageContents*)untag_ptr(orig); - LDKParsedOnionMessageContents *ret_copy = MALLOC(sizeof(LDKParsedOnionMessageContents), "LDKParsedOnionMessageContents"); - *ret_copy = ParsedOnionMessageContents_clone(orig_conv); +int64_t CS_LDK_BumpTransactionEvent_clone(int64_t orig) { + LDKBumpTransactionEvent* orig_conv = (LDKBumpTransactionEvent*)untag_ptr(orig); + LDKBumpTransactionEvent *ret_copy = MALLOC(sizeof(LDKBumpTransactionEvent), "LDKBumpTransactionEvent"); + *ret_copy = BumpTransactionEvent_clone(orig_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_ParsedOnionMessageContents_offers(int64_t a) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKOffersMessage a_conv = *(LDKOffersMessage*)(a_ptr); - a_conv = OffersMessage_clone((LDKOffersMessage*)untag_ptr(a)); - LDKParsedOnionMessageContents *ret_copy = MALLOC(sizeof(LDKParsedOnionMessageContents), "LDKParsedOnionMessageContents"); - *ret_copy = ParsedOnionMessageContents_offers(a_conv); +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); + LDKTransaction commitment_tx_ref; + commitment_tx_ref.datalen = commitment_tx->arr_len; + commitment_tx_ref.data = MALLOC(commitment_tx_ref.datalen, "LDKTransaction Bytes"); + memcpy(commitment_tx_ref.data, commitment_tx->elems, commitment_tx_ref.datalen); FREE(commitment_tx); + commitment_tx_ref.data_is_owned = true; + LDKAnchorDescriptor anchor_descriptor_conv; + anchor_descriptor_conv.inner = untag_ptr(anchor_descriptor); + anchor_descriptor_conv.is_owned = ptr_is_owned(anchor_descriptor); + CHECK_INNER_FIELD_ACCESS_OR_NULL(anchor_descriptor_conv); + anchor_descriptor_conv = AnchorDescriptor_clone(&anchor_descriptor_conv); + LDKCVec_HTLCOutputInCommitmentZ pending_htlcs_constr; + pending_htlcs_constr.datalen = pending_htlcs->arr_len; + if (pending_htlcs_constr.datalen > 0) + pending_htlcs_constr.data = MALLOC(pending_htlcs_constr.datalen * sizeof(LDKHTLCOutputInCommitment), "LDKCVec_HTLCOutputInCommitmentZ Elements"); + else + pending_htlcs_constr.data = NULL; + int64_t* pending_htlcs_vals = pending_htlcs->elems; + for (size_t y = 0; y < pending_htlcs_constr.datalen; y++) { + int64_t pending_htlcs_conv_24 = pending_htlcs_vals[y]; + LDKHTLCOutputInCommitment pending_htlcs_conv_24_conv; + pending_htlcs_conv_24_conv.inner = untag_ptr(pending_htlcs_conv_24); + pending_htlcs_conv_24_conv.is_owned = ptr_is_owned(pending_htlcs_conv_24); + CHECK_INNER_FIELD_ACCESS_OR_NULL(pending_htlcs_conv_24_conv); + pending_htlcs_conv_24_conv = HTLCOutputInCommitment_clone(&pending_htlcs_conv_24_conv); + pending_htlcs_constr.data[y] = pending_htlcs_conv_24_conv; + } + FREE(pending_htlcs); + LDKBumpTransactionEvent *ret_copy = MALLOC(sizeof(LDKBumpTransactionEvent), "LDKBumpTransactionEvent"); + *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_ParsedOnionMessageContents_custom(int64_t a) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKOnionMessageContents a_conv = *(LDKOnionMessageContents*)(a_ptr); - if (a_conv.free == LDKOnionMessageContents_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKOnionMessageContents_JCalls_cloned(&a_conv); +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); + LDKCVec_HTLCDescriptorZ htlc_descriptors_constr; + htlc_descriptors_constr.datalen = htlc_descriptors->arr_len; + if (htlc_descriptors_constr.datalen > 0) + htlc_descriptors_constr.data = MALLOC(htlc_descriptors_constr.datalen * sizeof(LDKHTLCDescriptor), "LDKCVec_HTLCDescriptorZ Elements"); + else + htlc_descriptors_constr.data = NULL; + int64_t* htlc_descriptors_vals = htlc_descriptors->elems; + for (size_t q = 0; q < htlc_descriptors_constr.datalen; q++) { + int64_t htlc_descriptors_conv_16 = htlc_descriptors_vals[q]; + LDKHTLCDescriptor htlc_descriptors_conv_16_conv; + htlc_descriptors_conv_16_conv.inner = untag_ptr(htlc_descriptors_conv_16); + htlc_descriptors_conv_16_conv.is_owned = ptr_is_owned(htlc_descriptors_conv_16); + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_descriptors_conv_16_conv); + htlc_descriptors_conv_16_conv = HTLCDescriptor_clone(&htlc_descriptors_conv_16_conv); + htlc_descriptors_constr.data[q] = htlc_descriptors_conv_16_conv; } - LDKParsedOnionMessageContents *ret_copy = MALLOC(sizeof(LDKParsedOnionMessageContents), "LDKParsedOnionMessageContents"); - *ret_copy = ParsedOnionMessageContents_custom(a_conv); + FREE(htlc_descriptors); + LDKBumpTransactionEvent *ret_copy = MALLOC(sizeof(LDKBumpTransactionEvent), "LDKBumpTransactionEvent"); + *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; } -int64_t CS_LDK_ParsedOnionMessageContents_as_OnionMessageContents(int64_t this_arg) { - LDKParsedOnionMessageContents* this_arg_conv = (LDKParsedOnionMessageContents*)untag_ptr(this_arg); - LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); - *ret_ret = ParsedOnionMessageContents_as_OnionMessageContents(this_arg_conv); - return tag_ptr(ret_ret, true); +jboolean CS_LDK_BumpTransactionEvent_eq(int64_t a, int64_t b) { + LDKBumpTransactionEvent* a_conv = (LDKBumpTransactionEvent*)untag_ptr(a); + LDKBumpTransactionEvent* b_conv = (LDKBumpTransactionEvent*)untag_ptr(b); + jboolean ret_conv = BumpTransactionEvent_eq(a_conv, b_conv); + return ret_conv; } -int8_tArray CS_LDK_ParsedOnionMessageContents_write(int64_t obj) { - LDKParsedOnionMessageContents* obj_conv = (LDKParsedOnionMessageContents*)untag_ptr(obj); - LDKCVec_u8Z ret_var = ParsedOnionMessageContents_write(obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +void CS_LDK_Input_free(int64_t this_obj) { + LDKInput this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Input_free(this_obj_conv); } -static inline uint64_t OnionMessageContents_clone_ptr(LDKOnionMessageContents *NONNULL_PTR arg) { - LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); - *ret_ret = OnionMessageContents_clone(arg); - return tag_ptr(ret_ret, true); -} -int64_t CS_LDK_OnionMessageContents_clone_ptr(int64_t arg) { - void* arg_ptr = untag_ptr(arg); - if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); } - LDKOnionMessageContents* arg_conv = (LDKOnionMessageContents*)arg_ptr; - int64_t ret_conv = OnionMessageContents_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_OnionMessageContents_clone(int64_t orig) { - void* orig_ptr = untag_ptr(orig); - if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); } - LDKOnionMessageContents* orig_conv = (LDKOnionMessageContents*)orig_ptr; - LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); - *ret_ret = OnionMessageContents_clone(orig_conv); - return tag_ptr(ret_ret, true); -} - -void CS_LDK_OnionMessageContents_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); - LDKOnionMessageContents this_ptr_conv = *(LDKOnionMessageContents*)(this_ptr_ptr); - FREE(untag_ptr(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); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BlindedPath_free(this_obj_conv); -} - -int64_t CS_LDK_BlindedPath_get_introduction_node(int64_t this_ptr) { - LDKBlindedPath this_ptr_conv; +int64_t CS_LDK_Input_get_outpoint(int64_t this_ptr) { + LDKInput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - 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); + LDKOutPoint ret_var = Input_get_outpoint(&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_BlindedPath_set_introduction_node(int64_t this_ptr, int64_t val) { - LDKBlindedPath this_ptr_conv; +void CS_LDK_Input_set_outpoint(int64_t this_ptr, int64_t val) { + LDKInput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - LDKIntroductionNode val_conv = *(LDKIntroductionNode*)(val_ptr); - val_conv = IntroductionNode_clone((LDKIntroductionNode*)untag_ptr(val)); - BlindedPath_set_introduction_node(&this_ptr_conv, val_conv); + LDKOutPoint val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = OutPoint_clone(&val_conv); + Input_set_outpoint(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_BlindedPath_get_blinding_point(int64_t this_ptr) { - LDKBlindedPath this_ptr_conv; +int64_t CS_LDK_Input_get_previous_utxo(int64_t this_ptr) { + LDKInput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(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_blinding_point(&this_ptr_conv).compressed_form, 33); - return ret_arr; + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = Input_get_previous_utxo(&this_ptr_conv); + return tag_ptr(ret_ref, true); } -void CS_LDK_BlindedPath_set_blinding_point(int64_t this_ptr, int8_tArray val) { - LDKBlindedPath this_ptr_conv; +void CS_LDK_Input_set_previous_utxo(int64_t this_ptr, int64_t val) { + LDKInput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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_blinding_point(&this_ptr_conv, val_ref); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); + val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val)); + Input_set_previous_utxo(&this_ptr_conv, val_conv); } -int64_tArray CS_LDK_BlindedPath_get_blinded_hops(int64_t this_ptr) { - LDKBlindedPath this_ptr_conv; +int64_t CS_LDK_Input_get_satisfaction_weight(int64_t this_ptr) { + LDKInput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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_BlindedHopZ ret_var = BlindedPath_get_blinded_hops(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t m = 0; m < ret_var.datalen; m++) { - LDKBlindedHop ret_conv_12_var = ret_var.data[m]; - int64_t ret_conv_12_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_var); - ret_conv_12_ref = tag_ptr(ret_conv_12_var.inner, ret_conv_12_var.is_owned); - ret_arr_ptr[m] = ret_conv_12_ref; - } - - FREE(ret_var.data); - return ret_arr; + int64_t ret_conv = Input_get_satisfaction_weight(&this_ptr_conv); + return ret_conv; } -void CS_LDK_BlindedPath_set_blinded_hops(int64_t this_ptr, int64_tArray val) { - LDKBlindedPath this_ptr_conv; +void CS_LDK_Input_set_satisfaction_weight(int64_t this_ptr, int64_t val) { + LDKInput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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_BlindedHopZ val_constr; - val_constr.datalen = val->arr_len; - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKBlindedHop), "LDKCVec_BlindedHopZ Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = val->elems; - for (size_t m = 0; m < val_constr.datalen; m++) { - int64_t val_conv_12 = val_vals[m]; - LDKBlindedHop val_conv_12_conv; - val_conv_12_conv.inner = untag_ptr(val_conv_12); - val_conv_12_conv.is_owned = ptr_is_owned(val_conv_12); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_12_conv); - val_conv_12_conv = BlindedHop_clone(&val_conv_12_conv); - val_constr.data[m] = val_conv_12_conv; - } - FREE(val); - BlindedPath_set_blinded_hops(&this_ptr_conv, val_constr); + Input_set_satisfaction_weight(&this_ptr_conv, val); } -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); - LDKCVec_BlindedHopZ blinded_hops_arg_constr; - blinded_hops_arg_constr.datalen = blinded_hops_arg->arr_len; - if (blinded_hops_arg_constr.datalen > 0) - blinded_hops_arg_constr.data = MALLOC(blinded_hops_arg_constr.datalen * sizeof(LDKBlindedHop), "LDKCVec_BlindedHopZ Elements"); - else - blinded_hops_arg_constr.data = NULL; - int64_t* blinded_hops_arg_vals = blinded_hops_arg->elems; - for (size_t m = 0; m < blinded_hops_arg_constr.datalen; m++) { - int64_t blinded_hops_arg_conv_12 = blinded_hops_arg_vals[m]; - LDKBlindedHop blinded_hops_arg_conv_12_conv; - blinded_hops_arg_conv_12_conv.inner = untag_ptr(blinded_hops_arg_conv_12); - blinded_hops_arg_conv_12_conv.is_owned = ptr_is_owned(blinded_hops_arg_conv_12); - CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_hops_arg_conv_12_conv); - blinded_hops_arg_conv_12_conv = BlindedHop_clone(&blinded_hops_arg_conv_12_conv); - blinded_hops_arg_constr.data[m] = blinded_hops_arg_conv_12_conv; - } - FREE(blinded_hops_arg); - LDKBlindedPath ret_var = BlindedPath_new(introduction_node_arg_conv, blinding_point_arg_ref, blinded_hops_arg_constr); +int64_t CS_LDK_Input_new(int64_t outpoint_arg, int64_t previous_utxo_arg, int64_t satisfaction_weight_arg) { + LDKOutPoint outpoint_arg_conv; + outpoint_arg_conv.inner = untag_ptr(outpoint_arg); + outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); + outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); + void* previous_utxo_arg_ptr = untag_ptr(previous_utxo_arg); + CHECK_ACCESS(previous_utxo_arg_ptr); + LDKTxOut previous_utxo_arg_conv = *(LDKTxOut*)(previous_utxo_arg_ptr); + previous_utxo_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(previous_utxo_arg)); + LDKInput ret_var = Input_new(outpoint_arg_conv, previous_utxo_arg_conv, satisfaction_weight_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 BlindedPath_clone_ptr(LDKBlindedPath *NONNULL_PTR arg) { - LDKBlindedPath ret_var = BlindedPath_clone(arg); +static inline uint64_t Input_clone_ptr(LDKInput *NONNULL_PTR arg) { + LDKInput ret_var = Input_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_BlindedPath_clone_ptr(int64_t arg) { - LDKBlindedPath arg_conv; +int64_t CS_LDK_Input_clone_ptr(int64_t arg) { + LDKInput arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = BlindedPath_clone_ptr(&arg_conv); + int64_t ret_conv = Input_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_BlindedPath_clone(int64_t orig) { - LDKBlindedPath orig_conv; +int64_t CS_LDK_Input_clone(int64_t orig) { + LDKInput orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBlindedPath ret_var = BlindedPath_clone(&orig_conv); + LDKInput ret_var = Input_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_BlindedPath_hash(int64_t o) { - LDKBlindedPath o_conv; +int64_t CS_LDK_Input_hash(int64_t o) { + LDKInput o_conv; 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 = BlindedPath_hash(&o_conv); + int64_t ret_conv = Input_hash(&o_conv); return ret_conv; } -jboolean CS_LDK_BlindedPath_eq(int64_t a, int64_t b) { - LDKBlindedPath a_conv; +jboolean CS_LDK_Input_eq(int64_t a, int64_t b) { + LDKInput a_conv; 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; - LDKBlindedPath b_conv; + LDKInput 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 = BlindedPath_eq(&a_conv, &b_conv); - 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); + jboolean ret_conv = Input_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; +void CS_LDK_Utxo_free(int64_t this_obj) { + LDKUtxo this_obj_conv; this_obj_conv.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); + Utxo_free(this_obj_conv); } -int64_t CS_LDK_EmptyNodeIdLookUp_new() { - LDKEmptyNodeIdLookUp ret_var = EmptyNodeIdLookUp_new(); +int64_t CS_LDK_Utxo_get_outpoint(int64_t this_ptr) { + LDKUtxo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKOutPoint ret_var = Utxo_get_outpoint(&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; } -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); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BlindedHop_free(this_obj_conv); +void CS_LDK_Utxo_set_outpoint(int64_t this_ptr, int64_t val) { + LDKUtxo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKOutPoint val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = OutPoint_clone(&val_conv); + Utxo_set_outpoint(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_BlindedHop_get_blinded_node_id(int64_t this_ptr) { - LDKBlindedHop this_ptr_conv; +int64_t CS_LDK_Utxo_get_output(int64_t this_ptr) { + LDKUtxo this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(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, BlindedHop_get_blinded_node_id(&this_ptr_conv).compressed_form, 33); - return ret_arr; + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = Utxo_get_output(&this_ptr_conv); + return tag_ptr(ret_ref, true); } -void CS_LDK_BlindedHop_set_blinded_node_id(int64_t this_ptr, int8_tArray val) { - LDKBlindedHop this_ptr_conv; +void CS_LDK_Utxo_set_output(int64_t this_ptr, int64_t val) { + LDKUtxo this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - BlindedHop_set_blinded_node_id(&this_ptr_conv, val_ref); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); + val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val)); + Utxo_set_output(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_BlindedHop_get_encrypted_payload(int64_t this_ptr) { - LDKBlindedHop this_ptr_conv; +int64_t CS_LDK_Utxo_get_satisfaction_weight(int64_t this_ptr) { + LDKUtxo this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = BlindedHop_get_encrypted_payload(&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; + int64_t ret_conv = Utxo_get_satisfaction_weight(&this_ptr_conv); + return ret_conv; } -void CS_LDK_BlindedHop_set_encrypted_payload(int64_t this_ptr, int8_tArray val) { - LDKBlindedHop this_ptr_conv; +void CS_LDK_Utxo_set_satisfaction_weight(int64_t this_ptr, int64_t val) { + LDKUtxo this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - BlindedHop_set_encrypted_payload(&this_ptr_conv, val_ref); + Utxo_set_satisfaction_weight(&this_ptr_conv, val); } -int64_t CS_LDK_BlindedHop_new(int8_tArray blinded_node_id_arg, int8_tArray encrypted_payload_arg) { - LDKPublicKey blinded_node_id_arg_ref; - CHECK(blinded_node_id_arg->arr_len == 33); - memcpy(blinded_node_id_arg_ref.compressed_form, blinded_node_id_arg->elems, 33); FREE(blinded_node_id_arg); - LDKCVec_u8Z encrypted_payload_arg_ref; - encrypted_payload_arg_ref.datalen = encrypted_payload_arg->arr_len; - encrypted_payload_arg_ref.data = MALLOC(encrypted_payload_arg_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(encrypted_payload_arg_ref.data, encrypted_payload_arg->elems, encrypted_payload_arg_ref.datalen); FREE(encrypted_payload_arg); - LDKBlindedHop ret_var = BlindedHop_new(blinded_node_id_arg_ref, encrypted_payload_arg_ref); +int64_t CS_LDK_Utxo_new(int64_t outpoint_arg, int64_t output_arg, int64_t satisfaction_weight_arg) { + LDKOutPoint outpoint_arg_conv; + outpoint_arg_conv.inner = untag_ptr(outpoint_arg); + outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); + outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); + void* output_arg_ptr = untag_ptr(output_arg); + CHECK_ACCESS(output_arg_ptr); + LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr); + output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg)); + LDKUtxo ret_var = Utxo_new(outpoint_arg_conv, output_arg_conv, satisfaction_weight_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 BlindedHop_clone_ptr(LDKBlindedHop *NONNULL_PTR arg) { - LDKBlindedHop ret_var = BlindedHop_clone(arg); +static inline uint64_t Utxo_clone_ptr(LDKUtxo *NONNULL_PTR arg) { + LDKUtxo ret_var = Utxo_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_BlindedHop_clone_ptr(int64_t arg) { - LDKBlindedHop arg_conv; +int64_t CS_LDK_Utxo_clone_ptr(int64_t arg) { + LDKUtxo arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = BlindedHop_clone_ptr(&arg_conv); + int64_t ret_conv = Utxo_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_BlindedHop_clone(int64_t orig) { - LDKBlindedHop orig_conv; +int64_t CS_LDK_Utxo_clone(int64_t orig) { + LDKUtxo orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBlindedHop ret_var = BlindedHop_clone(&orig_conv); + LDKUtxo ret_var = Utxo_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_BlindedHop_hash(int64_t o) { - LDKBlindedHop o_conv; +int64_t CS_LDK_Utxo_hash(int64_t o) { + LDKUtxo o_conv; 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 = BlindedHop_hash(&o_conv); + int64_t ret_conv = Utxo_hash(&o_conv); return ret_conv; } -jboolean CS_LDK_BlindedHop_eq(int64_t a, int64_t b) { - LDKBlindedHop a_conv; +jboolean CS_LDK_Utxo_eq(int64_t a, int64_t b) { + LDKUtxo a_conv; 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; - LDKBlindedHop b_conv; + LDKUtxo 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 = BlindedHop_eq(&a_conv, &b_conv); + jboolean ret_conv = Utxo_eq(&a_conv, &b_conv); return ret_conv; } -int64_t CS_LDK_BlindedPath_one_hop_for_message(int8_tArray recipient_node_id, int64_t entropy_source) { - LDKPublicKey recipient_node_id_ref; - 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); - 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); +int64_t CS_LDK_Utxo_new_p2pkh(int64_t outpoint, int64_t value, int8_tArray pubkey_hash) { + 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); + 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; + LDKUtxo ret_var = Utxo_new_p2pkh(outpoint_conv, value, pubkey_hash_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_BlindedPath_new_for_message(ptrArray node_pks, int64_t entropy_source) { - LDKCVec_PublicKeyZ node_pks_constr; - node_pks_constr.datalen = node_pks->arr_len; - if (node_pks_constr.datalen > 0) - node_pks_constr.data = MALLOC(node_pks_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); - else - node_pks_constr.data = NULL; - int8_tArray* node_pks_vals = (void*) node_pks->elems; - for (size_t i = 0; i < node_pks_constr.datalen; i++) { - int8_tArray node_pks_conv_8 = node_pks_vals[i]; - LDKPublicKey node_pks_conv_8_ref; - CHECK(node_pks_conv_8->arr_len == 33); - memcpy(node_pks_conv_8_ref.compressed_form, node_pks_conv_8->elems, 33); FREE(node_pks_conv_8); - node_pks_constr.data[i] = node_pks_conv_8_ref; - } - FREE(node_pks); - 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); - } - 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); +void CS_LDK_CoinSelection_free(int64_t this_obj) { + LDKCoinSelection this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + CoinSelection_free(this_obj_conv); } -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); - LDKReceiveTlvs payee_tlvs_conv; - payee_tlvs_conv.inner = untag_ptr(payee_tlvs); - payee_tlvs_conv.is_owned = ptr_is_owned(payee_tlvs); - 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); - 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); +int64_tArray CS_LDK_CoinSelection_get_confirmed_utxos(int64_t this_ptr) { + LDKCoinSelection this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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_UtxoZ ret_var = CoinSelection_get_confirmed_utxos(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t g = 0; g < ret_var.datalen; g++) { + LDKUtxo ret_conv_6_var = ret_var.data[g]; + int64_t ret_conv_6_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_6_var); + ret_conv_6_ref = tag_ptr(ret_conv_6_var.inner, ret_conv_6_var.is_owned); + ret_arr_ptr[g] = ret_conv_6_ref; } - 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, min_final_cltv_expiry_delta, entropy_source_conv); - return tag_ptr(ret_conv, true); + + FREE(ret_var.data); + return ret_arr; } -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) - intermediate_nodes_constr.data = MALLOC(intermediate_nodes_constr.datalen * sizeof(LDKForwardNode), "LDKCVec_ForwardNodeZ Elements"); - else - intermediate_nodes_constr.data = NULL; - int64_t* intermediate_nodes_vals = intermediate_nodes->elems; - for (size_t n = 0; n < intermediate_nodes_constr.datalen; n++) { - int64_t intermediate_nodes_conv_13 = intermediate_nodes_vals[n]; - LDKForwardNode intermediate_nodes_conv_13_conv; - intermediate_nodes_conv_13_conv.inner = untag_ptr(intermediate_nodes_conv_13); - intermediate_nodes_conv_13_conv.is_owned = ptr_is_owned(intermediate_nodes_conv_13); - CHECK_INNER_FIELD_ACCESS_OR_NULL(intermediate_nodes_conv_13_conv); - intermediate_nodes_conv_13_conv = ForwardNode_clone(&intermediate_nodes_conv_13_conv); - intermediate_nodes_constr.data[n] = intermediate_nodes_conv_13_conv; - } - FREE(intermediate_nodes); - 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); - LDKReceiveTlvs payee_tlvs_conv; - payee_tlvs_conv.inner = untag_ptr(payee_tlvs); - payee_tlvs_conv.is_owned = ptr_is_owned(payee_tlvs); - 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); - 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, 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); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = BlindedPath_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -int64_t CS_LDK_BlindedPath_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ"); - *ret_conv = BlindedPath_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -int8_tArray CS_LDK_BlindedHop_write(int64_t obj) { - LDKBlindedHop obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = BlindedHop_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -int64_t CS_LDK_BlindedHop_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); - *ret_conv = BlindedHop_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -void CS_LDK_ForwardNode_free(int64_t this_obj) { - LDKForwardNode this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ForwardNode_free(this_obj_conv); -} - -int64_t CS_LDK_ForwardNode_get_tlvs(int64_t this_ptr) { - LDKForwardNode this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKForwardTlvs ret_var = ForwardNode_get_tlvs(&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_ForwardNode_set_tlvs(int64_t this_ptr, int64_t val) { - LDKForwardNode this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKForwardTlvs 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 = ForwardTlvs_clone(&val_conv); - ForwardNode_set_tlvs(&this_ptr_conv, val_conv); -} - -int8_tArray CS_LDK_ForwardNode_get_node_id(int64_t this_ptr) { - LDKForwardNode this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(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, ForwardNode_get_node_id(&this_ptr_conv).compressed_form, 33); - return ret_arr; -} - -void CS_LDK_ForwardNode_set_node_id(int64_t this_ptr, int8_tArray val) { - LDKForwardNode this_ptr_conv; +void CS_LDK_CoinSelection_set_confirmed_utxos(int64_t this_ptr, int64_tArray val) { + LDKCoinSelection this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - ForwardNode_set_node_id(&this_ptr_conv, val_ref); + LDKCVec_UtxoZ val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUtxo), "LDKCVec_UtxoZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = val->elems; + for (size_t g = 0; g < val_constr.datalen; g++) { + int64_t val_conv_6 = val_vals[g]; + LDKUtxo val_conv_6_conv; + val_conv_6_conv.inner = untag_ptr(val_conv_6); + val_conv_6_conv.is_owned = ptr_is_owned(val_conv_6); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_6_conv); + val_conv_6_conv = Utxo_clone(&val_conv_6_conv); + val_constr.data[g] = val_conv_6_conv; + } + FREE(val); + CoinSelection_set_confirmed_utxos(&this_ptr_conv, val_constr); } -int64_t CS_LDK_ForwardNode_get_htlc_maximum_msat(int64_t this_ptr) { - LDKForwardNode this_ptr_conv; +int64_t CS_LDK_CoinSelection_get_change_output(int64_t this_ptr) { + LDKCoinSelection this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = ForwardNode_get_htlc_maximum_msat(&this_ptr_conv); - return ret_conv; + LDKCOption_TxOutZ *ret_copy = MALLOC(sizeof(LDKCOption_TxOutZ), "LDKCOption_TxOutZ"); + *ret_copy = CoinSelection_get_change_output(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_ForwardNode_set_htlc_maximum_msat(int64_t this_ptr, int64_t val) { - LDKForwardNode this_ptr_conv; +void CS_LDK_CoinSelection_set_change_output(int64_t this_ptr, int64_t val) { + LDKCoinSelection this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ForwardNode_set_htlc_maximum_msat(&this_ptr_conv, val); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_TxOutZ val_conv = *(LDKCOption_TxOutZ*)(val_ptr); + val_conv = COption_TxOutZ_clone((LDKCOption_TxOutZ*)untag_ptr(val)); + CoinSelection_set_change_output(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ForwardNode_new(int64_t tlvs_arg, int8_tArray node_id_arg, int64_t htlc_maximum_msat_arg) { - LDKForwardTlvs tlvs_arg_conv; - tlvs_arg_conv.inner = untag_ptr(tlvs_arg); - tlvs_arg_conv.is_owned = ptr_is_owned(tlvs_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(tlvs_arg_conv); - tlvs_arg_conv = ForwardTlvs_clone(&tlvs_arg_conv); - LDKPublicKey node_id_arg_ref; - CHECK(node_id_arg->arr_len == 33); - memcpy(node_id_arg_ref.compressed_form, node_id_arg->elems, 33); FREE(node_id_arg); - LDKForwardNode ret_var = ForwardNode_new(tlvs_arg_conv, node_id_arg_ref, htlc_maximum_msat_arg); +int64_t CS_LDK_CoinSelection_new(int64_tArray confirmed_utxos_arg, int64_t change_output_arg) { + LDKCVec_UtxoZ confirmed_utxos_arg_constr; + confirmed_utxos_arg_constr.datalen = confirmed_utxos_arg->arr_len; + if (confirmed_utxos_arg_constr.datalen > 0) + confirmed_utxos_arg_constr.data = MALLOC(confirmed_utxos_arg_constr.datalen * sizeof(LDKUtxo), "LDKCVec_UtxoZ Elements"); + else + confirmed_utxos_arg_constr.data = NULL; + int64_t* confirmed_utxos_arg_vals = confirmed_utxos_arg->elems; + for (size_t g = 0; g < confirmed_utxos_arg_constr.datalen; g++) { + int64_t confirmed_utxos_arg_conv_6 = confirmed_utxos_arg_vals[g]; + LDKUtxo confirmed_utxos_arg_conv_6_conv; + confirmed_utxos_arg_conv_6_conv.inner = untag_ptr(confirmed_utxos_arg_conv_6); + confirmed_utxos_arg_conv_6_conv.is_owned = ptr_is_owned(confirmed_utxos_arg_conv_6); + CHECK_INNER_FIELD_ACCESS_OR_NULL(confirmed_utxos_arg_conv_6_conv); + confirmed_utxos_arg_conv_6_conv = Utxo_clone(&confirmed_utxos_arg_conv_6_conv); + confirmed_utxos_arg_constr.data[g] = confirmed_utxos_arg_conv_6_conv; + } + FREE(confirmed_utxos_arg); + void* change_output_arg_ptr = untag_ptr(change_output_arg); + CHECK_ACCESS(change_output_arg_ptr); + LDKCOption_TxOutZ change_output_arg_conv = *(LDKCOption_TxOutZ*)(change_output_arg_ptr); + change_output_arg_conv = COption_TxOutZ_clone((LDKCOption_TxOutZ*)untag_ptr(change_output_arg)); + LDKCoinSelection ret_var = CoinSelection_new(confirmed_utxos_arg_constr, change_output_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 ForwardNode_clone_ptr(LDKForwardNode *NONNULL_PTR arg) { - LDKForwardNode ret_var = ForwardNode_clone(arg); +static inline uint64_t CoinSelection_clone_ptr(LDKCoinSelection *NONNULL_PTR arg) { + LDKCoinSelection ret_var = CoinSelection_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_ForwardNode_clone_ptr(int64_t arg) { - LDKForwardNode arg_conv; +int64_t CS_LDK_CoinSelection_clone_ptr(int64_t arg) { + LDKCoinSelection 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 = ForwardNode_clone_ptr(&arg_conv); + int64_t ret_conv = CoinSelection_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_ForwardNode_clone(int64_t orig) { - LDKForwardNode orig_conv; +int64_t CS_LDK_CoinSelection_clone(int64_t orig) { + LDKCoinSelection 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; - LDKForwardNode ret_var = ForwardNode_clone(&orig_conv); + LDKCoinSelection ret_var = CoinSelection_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_ForwardTlvs_free(int64_t this_obj) { - LDKForwardTlvs this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ForwardTlvs_free(this_obj_conv); +void CS_LDK_CoinSelectionSource_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); + LDKCoinSelectionSource this_ptr_conv = *(LDKCoinSelectionSource*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + CoinSelectionSource_free(this_ptr_conv); } -int64_t CS_LDK_ForwardTlvs_get_short_channel_id(int64_t this_ptr) { - LDKForwardTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = ForwardTlvs_get_short_channel_id(&this_ptr_conv); - return ret_conv; +void CS_LDK_WalletSource_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); + LDKWalletSource this_ptr_conv = *(LDKWalletSource*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + WalletSource_free(this_ptr_conv); } -void CS_LDK_ForwardTlvs_set_short_channel_id(int64_t this_ptr, int64_t val) { - LDKForwardTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ForwardTlvs_set_short_channel_id(&this_ptr_conv, val); +void CS_LDK_Wallet_free(int64_t this_obj) { + LDKWallet this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Wallet_free(this_obj_conv); } -int64_t CS_LDK_ForwardTlvs_get_payment_relay(int64_t this_ptr) { - LDKForwardTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPaymentRelay ret_var = ForwardTlvs_get_payment_relay(&this_ptr_conv); +int64_t CS_LDK_Wallet_new(int64_t source, int64_t logger) { + void* source_ptr = untag_ptr(source); + CHECK_ACCESS(source_ptr); + LDKWalletSource source_conv = *(LDKWalletSource*)(source_ptr); + if (source_conv.free == LDKWalletSource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKWalletSource_JCalls_cloned(&source_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); + } + LDKWallet ret_var = Wallet_new(source_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; } -void CS_LDK_ForwardTlvs_set_payment_relay(int64_t this_ptr, int64_t val) { - LDKForwardTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPaymentRelay 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 = PaymentRelay_clone(&val_conv); - ForwardTlvs_set_payment_relay(&this_ptr_conv, val_conv); -} - -int64_t CS_LDK_ForwardTlvs_get_payment_constraints(int64_t this_ptr) { - LDKForwardTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPaymentConstraints ret_var = ForwardTlvs_get_payment_constraints(&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; +int64_t CS_LDK_Wallet_as_CoinSelectionSource(int64_t this_arg) { + LDKWallet this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCoinSelectionSource* ret_ret = MALLOC(sizeof(LDKCoinSelectionSource), "LDKCoinSelectionSource"); + *ret_ret = Wallet_as_CoinSelectionSource(&this_arg_conv); + return tag_ptr(ret_ret, true); } -void CS_LDK_ForwardTlvs_set_payment_constraints(int64_t this_ptr, int64_t val) { - LDKForwardTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPaymentConstraints 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 = PaymentConstraints_clone(&val_conv); - ForwardTlvs_set_payment_constraints(&this_ptr_conv, val_conv); +void CS_LDK_BumpTransactionEventHandler_free(int64_t this_obj) { + LDKBumpTransactionEventHandler this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + BumpTransactionEventHandler_free(this_obj_conv); } -int64_t CS_LDK_ForwardTlvs_get_features(int64_t this_ptr) { - LDKForwardTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKBlindedHopFeatures ret_var = ForwardTlvs_get_features(&this_ptr_conv); +int64_t CS_LDK_BumpTransactionEventHandler_new(int64_t broadcaster, int64_t utxo_source, int64_t signer_provider, int64_t logger) { + 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* utxo_source_ptr = untag_ptr(utxo_source); + CHECK_ACCESS(utxo_source_ptr); + LDKCoinSelectionSource utxo_source_conv = *(LDKCoinSelectionSource*)(utxo_source_ptr); + if (utxo_source_conv.free == LDKCoinSelectionSource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKCoinSelectionSource_JCalls_cloned(&utxo_source_conv); + } + void* signer_provider_ptr = untag_ptr(signer_provider); + CHECK_ACCESS(signer_provider_ptr); + LDKSignerProvider signer_provider_conv = *(LDKSignerProvider*)(signer_provider_ptr); + if (signer_provider_conv.free == LDKSignerProvider_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKSignerProvider_JCalls_cloned(&signer_provider_conv); + } + void* 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); + } + LDKBumpTransactionEventHandler ret_var = BumpTransactionEventHandler_new(broadcaster_conv, utxo_source_conv, signer_provider_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; } -void CS_LDK_ForwardTlvs_set_features(int64_t this_ptr, int64_t val) { - LDKForwardTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKBlindedHopFeatures val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = BlindedHopFeatures_clone(&val_conv); - ForwardTlvs_set_features(&this_ptr_conv, val_conv); +void CS_LDK_BumpTransactionEventHandler_handle_event(int64_t this_arg, int64_t event) { + LDKBumpTransactionEventHandler this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKBumpTransactionEvent* event_conv = (LDKBumpTransactionEvent*)untag_ptr(event); + BumpTransactionEventHandler_handle_event(&this_arg_conv, event_conv); } -int64_t CS_LDK_ForwardTlvs_new(int64_t short_channel_id_arg, int64_t payment_relay_arg, int64_t payment_constraints_arg, int64_t features_arg) { - LDKPaymentRelay payment_relay_arg_conv; - payment_relay_arg_conv.inner = untag_ptr(payment_relay_arg); - payment_relay_arg_conv.is_owned = ptr_is_owned(payment_relay_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_relay_arg_conv); - payment_relay_arg_conv = PaymentRelay_clone(&payment_relay_arg_conv); - LDKPaymentConstraints payment_constraints_arg_conv; - payment_constraints_arg_conv.inner = untag_ptr(payment_constraints_arg); - 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); - LDKBlindedHopFeatures features_arg_conv; - features_arg_conv.inner = untag_ptr(features_arg); - features_arg_conv.is_owned = ptr_is_owned(features_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); - features_arg_conv = BlindedHopFeatures_clone(&features_arg_conv); - LDKForwardTlvs ret_var = ForwardTlvs_new(short_channel_id_arg, payment_relay_arg_conv, payment_constraints_arg_conv, features_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_InitFeatures_eq(int64_t a, int64_t b) { + LDKInitFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKInitFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = InitFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -static inline uint64_t ForwardTlvs_clone_ptr(LDKForwardTlvs *NONNULL_PTR arg) { - LDKForwardTlvs ret_var = ForwardTlvs_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_ForwardTlvs_clone_ptr(int64_t arg) { - LDKForwardTlvs 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 = ForwardTlvs_clone_ptr(&arg_conv); +jboolean CS_LDK_NodeFeatures_eq(int64_t a, int64_t b) { + LDKNodeFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKNodeFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_eq(&a_conv, &b_conv); return ret_conv; } -int64_t CS_LDK_ForwardTlvs_clone(int64_t orig) { - LDKForwardTlvs 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; - LDKForwardTlvs ret_var = ForwardTlvs_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_ChannelFeatures_eq(int64_t a, int64_t b) { + LDKChannelFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKChannelFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ChannelFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -void CS_LDK_ReceiveTlvs_free(int64_t this_obj) { - LDKReceiveTlvs this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ReceiveTlvs_free(this_obj_conv); +jboolean CS_LDK_Bolt11InvoiceFeatures_eq(int64_t a, int64_t b) { + LDKBolt11InvoiceFeatures a_conv; + 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; + LDKBolt11InvoiceFeatures 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 = Bolt11InvoiceFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -int8_tArray CS_LDK_ReceiveTlvs_get_payment_secret(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; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *ReceiveTlvs_get_payment_secret(&this_ptr_conv), 32); - return ret_arr; +jboolean CS_LDK_OfferFeatures_eq(int64_t a, int64_t b) { + LDKOfferFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKOfferFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = OfferFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -void CS_LDK_ReceiveTlvs_set_payment_secret(int64_t this_ptr, int8_tArray 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; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - ReceiveTlvs_set_payment_secret(&this_ptr_conv, val_ref); +jboolean CS_LDK_InvoiceRequestFeatures_eq(int64_t a, int64_t b) { + LDKInvoiceRequestFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKInvoiceRequestFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = InvoiceRequestFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -int64_t CS_LDK_ReceiveTlvs_get_payment_constraints(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; - LDKPaymentConstraints ret_var = ReceiveTlvs_get_payment_constraints(&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_ReceiveTlvs_set_payment_constraints(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; - LDKPaymentConstraints 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 = PaymentConstraints_clone(&val_conv); - ReceiveTlvs_set_payment_constraints(&this_ptr_conv, val_conv); -} - -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; +jboolean CS_LDK_Bolt12InvoiceFeatures_eq(int64_t a, int64_t b) { + LDKBolt12InvoiceFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKBolt12InvoiceFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = Bolt12InvoiceFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -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); +jboolean CS_LDK_BlindedHopFeatures_eq(int64_t a, int64_t b) { + LDKBlindedHopFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKBlindedHopFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = BlindedHopFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -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); - LDKPaymentConstraints payment_constraints_arg_conv; - payment_constraints_arg_conv.inner = untag_ptr(payment_constraints_arg); - 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); - 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); - return ret_ref; +jboolean CS_LDK_ChannelTypeFeatures_eq(int64_t a, int64_t b) { + LDKChannelTypeFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKChannelTypeFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -static inline uint64_t ReceiveTlvs_clone_ptr(LDKReceiveTlvs *NONNULL_PTR arg) { - LDKReceiveTlvs ret_var = ReceiveTlvs_clone(arg); +static inline uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg) { + LDKInitFeatures ret_var = InitFeatures_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_ReceiveTlvs_clone_ptr(int64_t arg) { - LDKReceiveTlvs arg_conv; +int64_t CS_LDK_InitFeatures_clone_ptr(int64_t arg) { + LDKInitFeatures arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = ReceiveTlvs_clone_ptr(&arg_conv); + int64_t ret_conv = InitFeatures_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_ReceiveTlvs_clone(int64_t orig) { - LDKReceiveTlvs orig_conv; +int64_t CS_LDK_InitFeatures_clone(int64_t orig) { + LDKInitFeatures orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKReceiveTlvs ret_var = ReceiveTlvs_clone(&orig_conv); + LDKInitFeatures ret_var = InitFeatures_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_PaymentRelay_free(int64_t this_obj) { - LDKPaymentRelay this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PaymentRelay_free(this_obj_conv); -} - -int16_t CS_LDK_PaymentRelay_get_cltv_expiry_delta(int64_t this_ptr) { - LDKPaymentRelay this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = PaymentRelay_get_cltv_expiry_delta(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_PaymentRelay_set_cltv_expiry_delta(int64_t this_ptr, int16_t val) { - LDKPaymentRelay this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - PaymentRelay_set_cltv_expiry_delta(&this_ptr_conv, val); -} - -int32_t CS_LDK_PaymentRelay_get_fee_proportional_millionths(int64_t this_ptr) { - LDKPaymentRelay this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = PaymentRelay_get_fee_proportional_millionths(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_PaymentRelay_set_fee_proportional_millionths(int64_t this_ptr, int32_t val) { - LDKPaymentRelay this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - PaymentRelay_set_fee_proportional_millionths(&this_ptr_conv, val); +static inline uint64_t NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg) { + LDKNodeFeatures ret_var = NodeFeatures_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; } - -int32_t CS_LDK_PaymentRelay_get_fee_base_msat(int64_t this_ptr) { - LDKPaymentRelay this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = PaymentRelay_get_fee_base_msat(&this_ptr_conv); +int64_t CS_LDK_NodeFeatures_clone_ptr(int64_t arg) { + LDKNodeFeatures arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = NodeFeatures_clone_ptr(&arg_conv); return ret_conv; } -void CS_LDK_PaymentRelay_set_fee_base_msat(int64_t this_ptr, int32_t val) { - LDKPaymentRelay this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - PaymentRelay_set_fee_base_msat(&this_ptr_conv, val); -} - -int64_t CS_LDK_PaymentRelay_new(int16_t cltv_expiry_delta_arg, int32_t fee_proportional_millionths_arg, int32_t fee_base_msat_arg) { - LDKPaymentRelay ret_var = PaymentRelay_new(cltv_expiry_delta_arg, fee_proportional_millionths_arg, fee_base_msat_arg); +int64_t CS_LDK_NodeFeatures_clone(int64_t orig) { + LDKNodeFeatures orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKNodeFeatures ret_var = NodeFeatures_clone(&orig_conv); int64_t ret_ref = 0; 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 PaymentRelay_clone_ptr(LDKPaymentRelay *NONNULL_PTR arg) { - LDKPaymentRelay ret_var = PaymentRelay_clone(arg); +static inline uint64_t ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg) { + LDKChannelFeatures ret_var = ChannelFeatures_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_PaymentRelay_clone_ptr(int64_t arg) { - LDKPaymentRelay arg_conv; +int64_t CS_LDK_ChannelFeatures_clone_ptr(int64_t arg) { + LDKChannelFeatures arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = PaymentRelay_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelFeatures_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_PaymentRelay_clone(int64_t orig) { - LDKPaymentRelay orig_conv; +int64_t CS_LDK_ChannelFeatures_clone(int64_t orig) { + LDKChannelFeatures orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKPaymentRelay ret_var = PaymentRelay_clone(&orig_conv); + LDKChannelFeatures ret_var = ChannelFeatures_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_PaymentConstraints_free(int64_t this_obj) { - LDKPaymentConstraints this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PaymentConstraints_free(this_obj_conv); -} - -int32_t CS_LDK_PaymentConstraints_get_max_cltv_expiry(int64_t this_ptr) { - LDKPaymentConstraints this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = PaymentConstraints_get_max_cltv_expiry(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_PaymentConstraints_set_max_cltv_expiry(int64_t this_ptr, int32_t val) { - LDKPaymentConstraints this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - PaymentConstraints_set_max_cltv_expiry(&this_ptr_conv, val); +static inline uint64_t Bolt11InvoiceFeatures_clone_ptr(LDKBolt11InvoiceFeatures *NONNULL_PTR arg) { + LDKBolt11InvoiceFeatures ret_var = Bolt11InvoiceFeatures_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_PaymentConstraints_get_htlc_minimum_msat(int64_t this_ptr) { - LDKPaymentConstraints this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = PaymentConstraints_get_htlc_minimum_msat(&this_ptr_conv); +int64_t CS_LDK_Bolt11InvoiceFeatures_clone_ptr(int64_t arg) { + LDKBolt11InvoiceFeatures 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 = Bolt11InvoiceFeatures_clone_ptr(&arg_conv); return ret_conv; } -void CS_LDK_PaymentConstraints_set_htlc_minimum_msat(int64_t this_ptr, int64_t val) { - LDKPaymentConstraints this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - PaymentConstraints_set_htlc_minimum_msat(&this_ptr_conv, val); -} - -int64_t CS_LDK_PaymentConstraints_new(int32_t max_cltv_expiry_arg, int64_t htlc_minimum_msat_arg) { - LDKPaymentConstraints ret_var = PaymentConstraints_new(max_cltv_expiry_arg, htlc_minimum_msat_arg); +int64_t CS_LDK_Bolt11InvoiceFeatures_clone(int64_t orig) { + LDKBolt11InvoiceFeatures 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; + LDKBolt11InvoiceFeatures ret_var = Bolt11InvoiceFeatures_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; } -static inline uint64_t PaymentConstraints_clone_ptr(LDKPaymentConstraints *NONNULL_PTR arg) { - LDKPaymentConstraints ret_var = PaymentConstraints_clone(arg); +static inline uint64_t OfferFeatures_clone_ptr(LDKOfferFeatures *NONNULL_PTR arg) { + LDKOfferFeatures ret_var = OfferFeatures_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_PaymentConstraints_clone_ptr(int64_t arg) { - LDKPaymentConstraints arg_conv; +int64_t CS_LDK_OfferFeatures_clone_ptr(int64_t arg) { + LDKOfferFeatures arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = PaymentConstraints_clone_ptr(&arg_conv); + int64_t ret_conv = OfferFeatures_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_PaymentConstraints_clone(int64_t orig) { - LDKPaymentConstraints orig_conv; +int64_t CS_LDK_OfferFeatures_clone(int64_t orig) { + LDKOfferFeatures orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKPaymentConstraints ret_var = PaymentConstraints_clone(&orig_conv); + LDKOfferFeatures ret_var = OfferFeatures_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_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); +static inline uint64_t InvoiceRequestFeatures_clone_ptr(LDKInvoiceRequestFeatures *NONNULL_PTR arg) { + LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_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; +int64_t CS_LDK_InvoiceRequestFeatures_clone_ptr(int64_t arg) { + LDKInvoiceRequestFeatures arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = UnknownPaymentContext_clone_ptr(&arg_conv); + int64_t ret_conv = InvoiceRequestFeatures_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_UnknownPaymentContext_clone(int64_t orig) { - LDKUnknownPaymentContext orig_conv; +int64_t CS_LDK_InvoiceRequestFeatures_clone(int64_t orig) { + LDKInvoiceRequestFeatures orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKUnknownPaymentContext ret_var = UnknownPaymentContext_clone(&orig_conv); + LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_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; +static inline uint64_t Bolt12InvoiceFeatures_clone_ptr(LDKBolt12InvoiceFeatures *NONNULL_PTR arg) { + LDKBolt12InvoiceFeatures ret_var = Bolt12InvoiceFeatures_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; } - -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_Bolt12InvoiceFeatures_clone_ptr(int64_t arg) { + LDKBolt12InvoiceFeatures arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = Bolt12InvoiceFeatures_clone_ptr(&arg_conv); + return ret_conv; } -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 CS_LDK_Bolt12InvoiceFeatures_clone(int64_t orig) { + LDKBolt12InvoiceFeatures orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKBolt12InvoiceFeatures ret_var = Bolt12InvoiceFeatures_clone(&orig_conv); int64_t ret_ref = 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); +static inline uint64_t BlindedHopFeatures_clone_ptr(LDKBlindedHopFeatures *NONNULL_PTR arg) { + LDKBlindedHopFeatures ret_var = BlindedHopFeatures_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; } - -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_BlindedHopFeatures_clone_ptr(int64_t arg) { + LDKBlindedHopFeatures arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = BlindedHopFeatures_clone_ptr(&arg_conv); + return ret_conv; } -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 CS_LDK_BlindedHopFeatures_clone(int64_t orig) { + LDKBlindedHopFeatures orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKBlindedHopFeatures ret_var = BlindedHopFeatures_clone(&orig_conv); int64_t ret_ref = 0; 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); +static inline uint64_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg) { + LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_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; +int64_t CS_LDK_ChannelTypeFeatures_clone_ptr(int64_t arg) { + LDKChannelTypeFeatures arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Bolt12OfferContext_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelTypeFeatures_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_Bolt12OfferContext_clone(int64_t orig) { - LDKBolt12OfferContext orig_conv; +int64_t CS_LDK_ChannelTypeFeatures_clone(int64_t orig) { + LDKChannelTypeFeatures orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBolt12OfferContext ret_var = Bolt12OfferContext_clone(&orig_conv); + LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_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); +int64_t CS_LDK_InitFeatures_hash(int64_t o) { + LDKInitFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = InitFeatures_hash(&o_conv); return ret_conv; } -void CS_LDK_Bolt12RefundContext_free(int64_t this_obj) { - LDKBolt12RefundContext this_obj_conv; +int64_t CS_LDK_NodeFeatures_hash(int64_t o) { + LDKNodeFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = NodeFeatures_hash(&o_conv); + return ret_conv; +} + +int64_t CS_LDK_ChannelFeatures_hash(int64_t o) { + LDKChannelFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = ChannelFeatures_hash(&o_conv); + return ret_conv; +} + +int64_t CS_LDK_Bolt11InvoiceFeatures_hash(int64_t o) { + LDKBolt11InvoiceFeatures o_conv; + 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 = Bolt11InvoiceFeatures_hash(&o_conv); + return ret_conv; +} + +int64_t CS_LDK_OfferFeatures_hash(int64_t o) { + LDKOfferFeatures o_conv; + 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 = OfferFeatures_hash(&o_conv); + return ret_conv; +} + +int64_t CS_LDK_InvoiceRequestFeatures_hash(int64_t o) { + LDKInvoiceRequestFeatures o_conv; + 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 = InvoiceRequestFeatures_hash(&o_conv); + return ret_conv; +} + +int64_t CS_LDK_Bolt12InvoiceFeatures_hash(int64_t o) { + LDKBolt12InvoiceFeatures o_conv; + 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 = Bolt12InvoiceFeatures_hash(&o_conv); + return ret_conv; +} + +int64_t CS_LDK_BlindedHopFeatures_hash(int64_t o) { + LDKBlindedHopFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = BlindedHopFeatures_hash(&o_conv); + return ret_conv; +} + +int64_t CS_LDK_ChannelTypeFeatures_hash(int64_t o) { + LDKChannelTypeFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = ChannelTypeFeatures_hash(&o_conv); + return ret_conv; +} + +void CS_LDK_InitFeatures_free(int64_t this_obj) { + LDKInitFeatures this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Bolt12RefundContext_free(this_obj_conv); + InitFeatures_free(this_obj_conv); } -int64_t CS_LDK_Bolt12RefundContext_new() { - LDKBolt12RefundContext ret_var = Bolt12RefundContext_new(); +void CS_LDK_NodeFeatures_free(int64_t this_obj) { + LDKNodeFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + NodeFeatures_free(this_obj_conv); +} + +void CS_LDK_ChannelFeatures_free(int64_t this_obj) { + LDKChannelFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelFeatures_free(this_obj_conv); +} + +void CS_LDK_Bolt11InvoiceFeatures_free(int64_t this_obj) { + LDKBolt11InvoiceFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Bolt11InvoiceFeatures_free(this_obj_conv); +} + +void CS_LDK_OfferFeatures_free(int64_t this_obj) { + LDKOfferFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OfferFeatures_free(this_obj_conv); +} + +void CS_LDK_InvoiceRequestFeatures_free(int64_t this_obj) { + LDKInvoiceRequestFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InvoiceRequestFeatures_free(this_obj_conv); +} + +void CS_LDK_Bolt12InvoiceFeatures_free(int64_t this_obj) { + LDKBolt12InvoiceFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Bolt12InvoiceFeatures_free(this_obj_conv); +} + +void CS_LDK_BlindedHopFeatures_free(int64_t this_obj) { + LDKBlindedHopFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + BlindedHopFeatures_free(this_obj_conv); +} + +void CS_LDK_ChannelTypeFeatures_free(int64_t this_obj) { + LDKChannelTypeFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelTypeFeatures_free(this_obj_conv); +} + +int64_t CS_LDK_Bolt11InvoiceFeatures_for_keysend(jboolean allow_mpp) { + LDKBolt11InvoiceFeatures ret_var = Bolt11InvoiceFeatures_for_keysend(allow_mpp); int64_t ret_ref = 0; 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 CS_LDK_ChannelTypeFeatures_only_static_remote_key() { + LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_only_static_remote_key(); int64_t ret_ref = 0; 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 CS_LDK_ChannelTypeFeatures_anchors_zero_htlc_fee_and_dependencies() { + LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_anchors_zero_htlc_fee_and_dependencies(); int64_t ret_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); - 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 = ForwardTlvs_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_InitFeatures_empty() { + LDKInitFeatures ret_var = InitFeatures_empty(); + int64_t ret_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_ReceiveTlvs_write(int64_t obj) { - LDKReceiveTlvs 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 = ReceiveTlvs_write(&obj_conv); +int8_tArray CS_LDK_InitFeatures_le_flags(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; + LDKu8slice ret_var = InitFeatures_le_flags(&this_arg_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); return ret_arr; } -int8_tArray CS_LDK_PaymentRelay_write(int64_t obj) { - LDKPaymentRelay 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 = PaymentRelay_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +jboolean CS_LDK_InitFeatures_supports_any_optional_bits(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_any_optional_bits(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_PaymentRelay_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_PaymentRelayDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentRelayDecodeErrorZ), "LDKCResult_PaymentRelayDecodeErrorZ"); - *ret_conv = PaymentRelay_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +jboolean CS_LDK_InitFeatures_requires_unknown_bits_from(int64_t this_arg, int64_t other) { + 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; + LDKInitFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); + return ret_conv; } -int8_tArray CS_LDK_PaymentConstraints_write(int64_t obj) { - LDKPaymentConstraints 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 = PaymentConstraints_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); +int64_tArray CS_LDK_InitFeatures_required_unknown_bits_from(int64_t this_arg, int64_t other) { + 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; + LDKInitFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + LDKCVec_u64Z ret_var = InitFeatures_required_unknown_bits_from(&this_arg_conv, &other_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 g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + + FREE(ret_var.data); return ret_arr; } -int64_t CS_LDK_PaymentConstraints_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_PaymentConstraintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentConstraintsDecodeErrorZ), "LDKCResult_PaymentConstraintsDecodeErrorZ"); - *ret_conv = PaymentConstraints_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +jboolean CS_LDK_InitFeatures_requires_unknown_bits(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_unknown_bits(&this_arg_conv); + return ret_conv; } -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; +jboolean CS_LDK_InitFeatures_supports_unknown_bits(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_unknown_bits(&this_arg_conv); + return ret_conv; } -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); +int64_t CS_LDK_InitFeatures_set_required_feature_bit(int64_t this_arg, int64_t bit) { + 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; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = InitFeatures_set_required_feature_bit(&this_arg_conv, bit); 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_InitFeatures_set_optional_feature_bit(int64_t this_arg, int64_t bit) { + 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; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = InitFeatures_set_optional_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -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); +int64_t CS_LDK_InitFeatures_set_required_custom_bit(int64_t this_arg, int64_t bit) { + 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; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = InitFeatures_set_required_custom_bit(&this_arg_conv, bit); 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_InitFeatures_set_optional_custom_bit(int64_t this_arg, int64_t bit) { + 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; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = InitFeatures_set_optional_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -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); +int64_t CS_LDK_NodeFeatures_empty() { + LDKNodeFeatures ret_var = NodeFeatures_empty(); + int64_t ret_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_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 CS_LDK_NodeFeatures_le_flags(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; + LDKu8slice ret_var = NodeFeatures_le_flags(&this_arg_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); return ret_arr; } -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); +jboolean CS_LDK_NodeFeatures_supports_any_optional_bits(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_any_optional_bits(&this_arg_conv); + return ret_conv; } -void CS_LDK_PaymentPurpose_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); - LDKPaymentPurpose this_ptr_conv = *(LDKPaymentPurpose*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - PaymentPurpose_free(this_ptr_conv); +jboolean CS_LDK_NodeFeatures_requires_unknown_bits_from(int64_t this_arg, int64_t other) { + 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; + LDKNodeFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); + return ret_conv; } -static inline uint64_t PaymentPurpose_clone_ptr(LDKPaymentPurpose *NONNULL_PTR arg) { - LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); - *ret_copy = PaymentPurpose_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_tArray CS_LDK_NodeFeatures_required_unknown_bits_from(int64_t this_arg, int64_t other) { + 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; + LDKNodeFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + LDKCVec_u64Z ret_var = NodeFeatures_required_unknown_bits_from(&this_arg_conv, &other_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 g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + + FREE(ret_var.data); + return ret_arr; } -int64_t CS_LDK_PaymentPurpose_clone_ptr(int64_t arg) { - LDKPaymentPurpose* arg_conv = (LDKPaymentPurpose*)untag_ptr(arg); - int64_t ret_conv = PaymentPurpose_clone_ptr(arg_conv); + +jboolean CS_LDK_NodeFeatures_requires_unknown_bits(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_unknown_bits(&this_arg_conv); return ret_conv; } -int64_t CS_LDK_PaymentPurpose_clone(int64_t orig) { - LDKPaymentPurpose* orig_conv = (LDKPaymentPurpose*)untag_ptr(orig); - LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); - *ret_copy = PaymentPurpose_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_NodeFeatures_supports_unknown_bits(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_unknown_bits(&this_arg_conv); + return ret_conv; } -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); - 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); - 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_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; -} - -int64_t CS_LDK_PaymentPurpose_spontaneous_payment(int8_tArray a) { - LDKThirtyTwoBytes a_ref; - CHECK(a->arr_len == 32); - memcpy(a_ref.data, a->elems, 32); FREE(a); - LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); - *ret_copy = PaymentPurpose_spontaneous_payment(a_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -jboolean CS_LDK_PaymentPurpose_eq(int64_t a, int64_t b) { - LDKPaymentPurpose* a_conv = (LDKPaymentPurpose*)untag_ptr(a); - LDKPaymentPurpose* b_conv = (LDKPaymentPurpose*)untag_ptr(b); - jboolean ret_conv = PaymentPurpose_eq(a_conv, b_conv); - return ret_conv; -} - -int64_t CS_LDK_PaymentPurpose_preimage(int64_t this_arg) { - LDKPaymentPurpose* this_arg_conv = (LDKPaymentPurpose*)untag_ptr(this_arg); - LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); - *ret_copy = PaymentPurpose_preimage(this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_NodeFeatures_set_required_feature_bit(int64_t this_arg, int64_t bit) { + 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; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = NodeFeatures_set_required_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int8_tArray CS_LDK_PaymentPurpose_write(int64_t obj) { - LDKPaymentPurpose* obj_conv = (LDKPaymentPurpose*)untag_ptr(obj); - LDKCVec_u8Z ret_var = PaymentPurpose_write(obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +int64_t CS_LDK_NodeFeatures_set_optional_feature_bit(int64_t this_arg, int64_t bit) { + 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; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = NodeFeatures_set_optional_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_PaymentPurpose_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); - *ret_conv = PaymentPurpose_read(ser_ref); - FREE(ser); +int64_t CS_LDK_NodeFeatures_set_required_custom_bit(int64_t this_arg, int64_t bit) { + 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; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = NodeFeatures_set_required_custom_bit(&this_arg_conv, bit); return tag_ptr(ret_conv, true); } -void CS_LDK_ClaimedHTLC_free(int64_t this_obj) { - LDKClaimedHTLC this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ClaimedHTLC_free(this_obj_conv); +int64_t CS_LDK_NodeFeatures_set_optional_custom_bit(int64_t this_arg, int64_t bit) { + 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; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = NodeFeatures_set_optional_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -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; - LDKChannelId ret_var = ClaimedHTLC_get_channel_id(&this_ptr_conv); +int64_t CS_LDK_ChannelFeatures_empty() { + LDKChannelFeatures ret_var = ChannelFeatures_empty(); int64_t ret_ref = 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, 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; - 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) { - 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(16, __LINE__); - memcpy(ret_arr->elems, ClaimedHTLC_get_user_channel_id(&this_ptr_conv).le_bytes, 16); +int8_tArray CS_LDK_ChannelFeatures_le_flags(int64_t this_arg) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKu8slice ret_var = ChannelFeatures_le_flags(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); return ret_arr; } -void CS_LDK_ClaimedHTLC_set_user_channel_id(int64_t this_ptr, int8_tArray 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; - LDKU128 val_ref; - CHECK(val->arr_len == 16); - memcpy(val_ref.le_bytes, val->elems, 16); FREE(val); - ClaimedHTLC_set_user_channel_id(&this_ptr_conv, val_ref); +jboolean CS_LDK_ChannelFeatures_supports_any_optional_bits(int64_t this_arg) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelFeatures_supports_any_optional_bits(&this_arg_conv); + return ret_conv; } -int32_t CS_LDK_ClaimedHTLC_get_cltv_expiry(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; - int32_t ret_conv = ClaimedHTLC_get_cltv_expiry(&this_ptr_conv); +jboolean CS_LDK_ChannelFeatures_requires_unknown_bits_from(int64_t this_arg, int64_t other) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + jboolean ret_conv = ChannelFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); return ret_conv; } -void CS_LDK_ClaimedHTLC_set_cltv_expiry(int64_t this_ptr, int32_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; - ClaimedHTLC_set_cltv_expiry(&this_ptr_conv, val); +int64_tArray CS_LDK_ChannelFeatures_required_unknown_bits_from(int64_t this_arg, int64_t other) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + LDKCVec_u64Z ret_var = ChannelFeatures_required_unknown_bits_from(&this_arg_conv, &other_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 g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + + FREE(ret_var.data); + return ret_arr; } -int64_t CS_LDK_ClaimedHTLC_get_value_msat(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; - int64_t ret_conv = ClaimedHTLC_get_value_msat(&this_ptr_conv); +jboolean CS_LDK_ChannelFeatures_requires_unknown_bits(int64_t this_arg) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelFeatures_requires_unknown_bits(&this_arg_conv); return ret_conv; } -void CS_LDK_ClaimedHTLC_set_value_msat(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; - ClaimedHTLC_set_value_msat(&this_ptr_conv, val); -} - -int64_t CS_LDK_ClaimedHTLC_get_counterparty_skimmed_fee_msat(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; - int64_t ret_conv = ClaimedHTLC_get_counterparty_skimmed_fee_msat(&this_ptr_conv); +jboolean CS_LDK_ChannelFeatures_supports_unknown_bits(int64_t this_arg) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelFeatures_supports_unknown_bits(&this_arg_conv); return ret_conv; } -void CS_LDK_ClaimedHTLC_set_counterparty_skimmed_fee_msat(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; - ClaimedHTLC_set_counterparty_skimmed_fee_msat(&this_ptr_conv, val); +int64_t CS_LDK_ChannelFeatures_set_required_feature_bit(int64_t this_arg, int64_t bit) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelFeatures_set_required_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -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_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); - return ret_ref; +int64_t CS_LDK_ChannelFeatures_set_optional_feature_bit(int64_t this_arg, int64_t bit) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelFeatures_set_optional_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -static inline uint64_t ClaimedHTLC_clone_ptr(LDKClaimedHTLC *NONNULL_PTR arg) { - LDKClaimedHTLC ret_var = ClaimedHTLC_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_ChannelFeatures_set_required_custom_bit(int64_t this_arg, int64_t bit) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelFeatures_set_required_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ClaimedHTLC_clone_ptr(int64_t arg) { - LDKClaimedHTLC 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 = ClaimedHTLC_clone_ptr(&arg_conv); - return ret_conv; + +int64_t CS_LDK_ChannelFeatures_set_optional_custom_bit(int64_t this_arg, int64_t bit) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelFeatures_set_optional_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ClaimedHTLC_clone(int64_t orig) { - LDKClaimedHTLC 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; - LDKClaimedHTLC ret_var = ClaimedHTLC_clone(&orig_conv); +int64_t CS_LDK_Bolt11InvoiceFeatures_empty() { + LDKBolt11InvoiceFeatures ret_var = Bolt11InvoiceFeatures_empty(); int64_t ret_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_ClaimedHTLC_eq(int64_t a, int64_t b) { - LDKClaimedHTLC a_conv; - 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; - LDKClaimedHTLC 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 = ClaimedHTLC_eq(&a_conv, &b_conv); - return ret_conv; -} - -int8_tArray CS_LDK_ClaimedHTLC_write(int64_t obj) { - LDKClaimedHTLC 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 = ClaimedHTLC_write(&obj_conv); +int8_tArray CS_LDK_Bolt11InvoiceFeatures_le_flags(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; + LDKu8slice ret_var = Bolt11InvoiceFeatures_le_flags(&this_arg_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_ClaimedHTLC_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_ClaimedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClaimedHTLCDecodeErrorZ), "LDKCResult_ClaimedHTLCDecodeErrorZ"); - *ret_conv = ClaimedHTLC_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -void CS_LDK_PathFailure_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); - LDKPathFailure this_ptr_conv = *(LDKPathFailure*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - PathFailure_free(this_ptr_conv); -} - -static inline uint64_t PathFailure_clone_ptr(LDKPathFailure *NONNULL_PTR arg) { - LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure"); - *ret_copy = PathFailure_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -int64_t CS_LDK_PathFailure_clone_ptr(int64_t arg) { - LDKPathFailure* arg_conv = (LDKPathFailure*)untag_ptr(arg); - int64_t ret_conv = PathFailure_clone_ptr(arg_conv); +jboolean CS_LDK_Bolt11InvoiceFeatures_supports_any_optional_bits(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_any_optional_bits(&this_arg_conv); return ret_conv; } -int64_t CS_LDK_PathFailure_clone(int64_t orig) { - LDKPathFailure* orig_conv = (LDKPathFailure*)untag_ptr(orig); - LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure"); - *ret_copy = PathFailure_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_Bolt11InvoiceFeatures_requires_unknown_bits_from(int64_t this_arg, int64_t other) { + 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; + LDKBolt11InvoiceFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + jboolean ret_conv = Bolt11InvoiceFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); + return ret_conv; } -int64_t CS_LDK_PathFailure_initial_send(int64_t err) { - void* err_ptr = untag_ptr(err); - CHECK_ACCESS(err_ptr); - LDKAPIError err_conv = *(LDKAPIError*)(err_ptr); - err_conv = APIError_clone((LDKAPIError*)untag_ptr(err)); - LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure"); - *ret_copy = PathFailure_initial_send(err_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_tArray CS_LDK_Bolt11InvoiceFeatures_required_unknown_bits_from(int64_t this_arg, int64_t other) { + 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; + LDKBolt11InvoiceFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + LDKCVec_u64Z ret_var = Bolt11InvoiceFeatures_required_unknown_bits_from(&this_arg_conv, &other_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 g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + + FREE(ret_var.data); + return ret_arr; } -int64_t CS_LDK_PathFailure_on_path(int64_t network_update) { - void* network_update_ptr = untag_ptr(network_update); - CHECK_ACCESS(network_update_ptr); - LDKCOption_NetworkUpdateZ network_update_conv = *(LDKCOption_NetworkUpdateZ*)(network_update_ptr); - network_update_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)untag_ptr(network_update)); - LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure"); - *ret_copy = PathFailure_on_path(network_update_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_Bolt11InvoiceFeatures_requires_unknown_bits(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_unknown_bits(&this_arg_conv); + return ret_conv; } -jboolean CS_LDK_PathFailure_eq(int64_t a, int64_t b) { - LDKPathFailure* a_conv = (LDKPathFailure*)untag_ptr(a); - LDKPathFailure* b_conv = (LDKPathFailure*)untag_ptr(b); - jboolean ret_conv = PathFailure_eq(a_conv, b_conv); +jboolean CS_LDK_Bolt11InvoiceFeatures_supports_unknown_bits(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_unknown_bits(&this_arg_conv); return ret_conv; } -int8_tArray CS_LDK_PathFailure_write(int64_t obj) { - LDKPathFailure* obj_conv = (LDKPathFailure*)untag_ptr(obj); - LDKCVec_u8Z ret_var = PathFailure_write(obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +int64_t CS_LDK_Bolt11InvoiceFeatures_set_required_feature_bit(int64_t this_arg, int64_t bit) { + 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; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = Bolt11InvoiceFeatures_set_required_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_PathFailure_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ"); - *ret_conv = PathFailure_read(ser_ref); - FREE(ser); +int64_t CS_LDK_Bolt11InvoiceFeatures_set_optional_feature_bit(int64_t this_arg, int64_t bit) { + 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; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = Bolt11InvoiceFeatures_set_optional_feature_bit(&this_arg_conv, bit); return tag_ptr(ret_conv, true); } -void CS_LDK_ClosureReason_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); - LDKClosureReason this_ptr_conv = *(LDKClosureReason*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - ClosureReason_free(this_ptr_conv); -} - -static inline uint64_t ClosureReason_clone_ptr(LDKClosureReason *NONNULL_PTR arg) { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -int64_t CS_LDK_ClosureReason_clone_ptr(int64_t arg) { - LDKClosureReason* arg_conv = (LDKClosureReason*)untag_ptr(arg); - int64_t ret_conv = ClosureReason_clone_ptr(arg_conv); - return ret_conv; +int64_t CS_LDK_Bolt11InvoiceFeatures_set_required_custom_bit(int64_t this_arg, int64_t bit) { + 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; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = Bolt11InvoiceFeatures_set_required_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ClosureReason_clone(int64_t orig) { - LDKClosureReason* orig_conv = (LDKClosureReason*)untag_ptr(orig); - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_Bolt11InvoiceFeatures_set_optional_custom_bit(int64_t this_arg, int64_t bit) { + 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; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = Bolt11InvoiceFeatures_set_optional_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ClosureReason_counterparty_force_closed(int64_t peer_msg) { - LDKUntrustedString peer_msg_conv; - peer_msg_conv.inner = untag_ptr(peer_msg); - peer_msg_conv.is_owned = ptr_is_owned(peer_msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(peer_msg_conv); - peer_msg_conv = UntrustedString_clone(&peer_msg_conv); - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_counterparty_force_closed(peer_msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +int64_t CS_LDK_OfferFeatures_empty() { + LDKOfferFeatures ret_var = OfferFeatures_empty(); + int64_t ret_ref = 0; + 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_ClosureReason_holder_force_closed() { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_holder_force_closed(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int8_tArray CS_LDK_OfferFeatures_le_flags(int64_t this_arg) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKu8slice ret_var = OfferFeatures_le_flags(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + return ret_arr; } -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; +jboolean CS_LDK_OfferFeatures_supports_any_optional_bits(int64_t this_arg) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = OfferFeatures_supports_any_optional_bits(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_ClosureReason_counterparty_initiated_cooperative_closure() { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_counterparty_initiated_cooperative_closure(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_OfferFeatures_requires_unknown_bits_from(int64_t this_arg, int64_t other) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKOfferFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + jboolean ret_conv = OfferFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); + return ret_conv; } -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; +int64_tArray CS_LDK_OfferFeatures_required_unknown_bits_from(int64_t this_arg, int64_t other) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKOfferFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + LDKCVec_u64Z ret_var = OfferFeatures_required_unknown_bits_from(&this_arg_conv, &other_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 g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + + FREE(ret_var.data); + return ret_arr; } -int64_t CS_LDK_ClosureReason_commitment_tx_confirmed() { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_commitment_tx_confirmed(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_OfferFeatures_requires_unknown_bits(int64_t this_arg) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = OfferFeatures_requires_unknown_bits(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_ClosureReason_funding_timed_out() { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_funding_timed_out(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_OfferFeatures_supports_unknown_bits(int64_t this_arg) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = OfferFeatures_supports_unknown_bits(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_ClosureReason_processing_error(jstring err) { - LDKStr err_conv = str_ref_to_owned_c(err); - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_processing_error(err_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_OfferFeatures_set_required_feature_bit(int64_t this_arg, int64_t bit) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = OfferFeatures_set_required_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ClosureReason_disconnected_peer() { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_disconnected_peer(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_OfferFeatures_set_optional_feature_bit(int64_t this_arg, int64_t bit) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = OfferFeatures_set_optional_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ClosureReason_outdated_channel_manager() { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_outdated_channel_manager(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_OfferFeatures_set_required_custom_bit(int64_t this_arg, int64_t bit) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = OfferFeatures_set_required_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ClosureReason_counterparty_coop_closed_unfunded_channel() { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_counterparty_coop_closed_unfunded_channel(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_OfferFeatures_set_optional_custom_bit(int64_t this_arg, int64_t bit) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = OfferFeatures_set_optional_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ClosureReason_funding_batch_closure() { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_funding_batch_closure(); - int64_t ret_ref = tag_ptr(ret_copy, true); +int64_t CS_LDK_InvoiceRequestFeatures_empty() { + LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_empty(); + int64_t ret_ref = 0; + 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_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; +int8_tArray CS_LDK_InvoiceRequestFeatures_le_flags(int64_t this_arg) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKu8slice ret_var = InvoiceRequestFeatures_le_flags(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + return ret_arr; } -jboolean CS_LDK_ClosureReason_eq(int64_t a, int64_t b) { - LDKClosureReason* a_conv = (LDKClosureReason*)untag_ptr(a); - LDKClosureReason* b_conv = (LDKClosureReason*)untag_ptr(b); - jboolean ret_conv = ClosureReason_eq(a_conv, b_conv); +jboolean CS_LDK_InvoiceRequestFeatures_supports_any_optional_bits(int64_t this_arg) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InvoiceRequestFeatures_supports_any_optional_bits(&this_arg_conv); return ret_conv; } -jstring CS_LDK_ClosureReason_to_str(int64_t o) { - LDKClosureReason* o_conv = (LDKClosureReason*)untag_ptr(o); - LDKStr ret_str = ClosureReason_to_str(o_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); +jboolean CS_LDK_InvoiceRequestFeatures_requires_unknown_bits_from(int64_t this_arg, int64_t other) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKInvoiceRequestFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + jboolean ret_conv = InvoiceRequestFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); return ret_conv; } -int8_tArray CS_LDK_ClosureReason_write(int64_t obj) { - LDKClosureReason* obj_conv = (LDKClosureReason*)untag_ptr(obj); - LDKCVec_u8Z ret_var = ClosureReason_write(obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); +int64_tArray CS_LDK_InvoiceRequestFeatures_required_unknown_bits_from(int64_t this_arg, int64_t other) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKInvoiceRequestFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + LDKCVec_u64Z ret_var = InvoiceRequestFeatures_required_unknown_bits_from(&this_arg_conv, &other_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 g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + + FREE(ret_var.data); return ret_arr; } -int64_t CS_LDK_ClosureReason_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); - *ret_conv = ClosureReason_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -void CS_LDK_HTLCDestination_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); - LDKHTLCDestination this_ptr_conv = *(LDKHTLCDestination*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - HTLCDestination_free(this_ptr_conv); -} - -static inline uint64_t HTLCDestination_clone_ptr(LDKHTLCDestination *NONNULL_PTR arg) { - LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); - *ret_copy = HTLCDestination_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -int64_t CS_LDK_HTLCDestination_clone_ptr(int64_t arg) { - LDKHTLCDestination* arg_conv = (LDKHTLCDestination*)untag_ptr(arg); - int64_t ret_conv = HTLCDestination_clone_ptr(arg_conv); +jboolean CS_LDK_InvoiceRequestFeatures_requires_unknown_bits(int64_t this_arg) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InvoiceRequestFeatures_requires_unknown_bits(&this_arg_conv); return ret_conv; } -int64_t CS_LDK_HTLCDestination_clone(int64_t orig) { - LDKHTLCDestination* orig_conv = (LDKHTLCDestination*)untag_ptr(orig); - LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); - *ret_copy = HTLCDestination_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_InvoiceRequestFeatures_supports_unknown_bits(int64_t this_arg) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InvoiceRequestFeatures_supports_unknown_bits(&this_arg_conv); + return ret_conv; } -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); - 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_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_InvoiceRequestFeatures_set_required_feature_bit(int64_t this_arg, int64_t bit) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = InvoiceRequestFeatures_set_required_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_HTLCDestination_unknown_next_hop(int64_t requested_forward_scid) { - LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); - *ret_copy = HTLCDestination_unknown_next_hop(requested_forward_scid); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_InvoiceRequestFeatures_set_optional_feature_bit(int64_t this_arg, int64_t bit) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = InvoiceRequestFeatures_set_optional_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_HTLCDestination_invalid_forward(int64_t requested_forward_scid) { - LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); - *ret_copy = HTLCDestination_invalid_forward(requested_forward_scid); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_InvoiceRequestFeatures_set_required_custom_bit(int64_t this_arg, int64_t bit) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = InvoiceRequestFeatures_set_required_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -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_InvoiceRequestFeatures_set_optional_custom_bit(int64_t this_arg, int64_t bit) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = InvoiceRequestFeatures_set_optional_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_HTLCDestination_failed_payment(int8_tArray payment_hash) { - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); - *ret_copy = HTLCDestination_failed_payment(payment_hash_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); +int64_t CS_LDK_Bolt12InvoiceFeatures_empty() { + LDKBolt12InvoiceFeatures ret_var = Bolt12InvoiceFeatures_empty(); + int64_t ret_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_HTLCDestination_eq(int64_t a, int64_t b) { - LDKHTLCDestination* a_conv = (LDKHTLCDestination*)untag_ptr(a); - LDKHTLCDestination* b_conv = (LDKHTLCDestination*)untag_ptr(b); - jboolean ret_conv = HTLCDestination_eq(a_conv, b_conv); - return ret_conv; -} - -int8_tArray CS_LDK_HTLCDestination_write(int64_t obj) { - LDKHTLCDestination* obj_conv = (LDKHTLCDestination*)untag_ptr(obj); - LDKCVec_u8Z ret_var = HTLCDestination_write(obj_conv); +int8_tArray CS_LDK_Bolt12InvoiceFeatures_le_flags(int64_t this_arg) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKu8slice ret_var = Bolt12InvoiceFeatures_le_flags(&this_arg_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_HTLCDestination_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ"); - *ret_conv = HTLCDestination_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -int32_t CS_LDK_PaymentFailureReason_clone(int64_t orig) { - LDKPaymentFailureReason* orig_conv = (LDKPaymentFailureReason*)untag_ptr(orig); - int32_t ret_conv = LDKPaymentFailureReason_to_cs(PaymentFailureReason_clone(orig_conv)); +jboolean CS_LDK_Bolt12InvoiceFeatures_supports_any_optional_bits(int64_t this_arg) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt12InvoiceFeatures_supports_any_optional_bits(&this_arg_conv); return ret_conv; } -int32_t CS_LDK_PaymentFailureReason_recipient_rejected() { - int32_t ret_conv = LDKPaymentFailureReason_to_cs(PaymentFailureReason_recipient_rejected()); +jboolean CS_LDK_Bolt12InvoiceFeatures_requires_unknown_bits_from(int64_t this_arg, int64_t other) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKBolt12InvoiceFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + jboolean ret_conv = Bolt12InvoiceFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); return ret_conv; } -int32_t CS_LDK_PaymentFailureReason_user_abandoned() { - int32_t ret_conv = LDKPaymentFailureReason_to_cs(PaymentFailureReason_user_abandoned()); - return ret_conv; +int64_tArray CS_LDK_Bolt12InvoiceFeatures_required_unknown_bits_from(int64_t this_arg, int64_t other) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKBolt12InvoiceFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + LDKCVec_u64Z ret_var = Bolt12InvoiceFeatures_required_unknown_bits_from(&this_arg_conv, &other_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 g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + + FREE(ret_var.data); + return ret_arr; } -int32_t CS_LDK_PaymentFailureReason_retries_exhausted() { - int32_t ret_conv = LDKPaymentFailureReason_to_cs(PaymentFailureReason_retries_exhausted()); +jboolean CS_LDK_Bolt12InvoiceFeatures_requires_unknown_bits(int64_t this_arg) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt12InvoiceFeatures_requires_unknown_bits(&this_arg_conv); return ret_conv; } -int32_t CS_LDK_PaymentFailureReason_payment_expired() { - int32_t ret_conv = LDKPaymentFailureReason_to_cs(PaymentFailureReason_payment_expired()); +jboolean CS_LDK_Bolt12InvoiceFeatures_supports_unknown_bits(int64_t this_arg) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt12InvoiceFeatures_supports_unknown_bits(&this_arg_conv); return ret_conv; } -int32_t CS_LDK_PaymentFailureReason_route_not_found() { - int32_t ret_conv = LDKPaymentFailureReason_to_cs(PaymentFailureReason_route_not_found()); - return ret_conv; +int64_t CS_LDK_Bolt12InvoiceFeatures_set_required_feature_bit(int64_t this_arg, int64_t bit) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = Bolt12InvoiceFeatures_set_required_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int32_t CS_LDK_PaymentFailureReason_unexpected_error() { - int32_t ret_conv = LDKPaymentFailureReason_to_cs(PaymentFailureReason_unexpected_error()); - return ret_conv; +int64_t CS_LDK_Bolt12InvoiceFeatures_set_optional_feature_bit(int64_t this_arg, int64_t bit) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = Bolt12InvoiceFeatures_set_optional_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_PaymentFailureReason_eq(int64_t a, int64_t b) { - LDKPaymentFailureReason* a_conv = (LDKPaymentFailureReason*)untag_ptr(a); - LDKPaymentFailureReason* b_conv = (LDKPaymentFailureReason*)untag_ptr(b); - jboolean ret_conv = PaymentFailureReason_eq(a_conv, b_conv); - return ret_conv; +int64_t CS_LDK_Bolt12InvoiceFeatures_set_required_custom_bit(int64_t this_arg, int64_t bit) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = Bolt12InvoiceFeatures_set_required_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int8_tArray CS_LDK_PaymentFailureReason_write(int64_t obj) { - LDKPaymentFailureReason* obj_conv = (LDKPaymentFailureReason*)untag_ptr(obj); - LDKCVec_u8Z ret_var = PaymentFailureReason_write(obj_conv); +int64_t CS_LDK_Bolt12InvoiceFeatures_set_optional_custom_bit(int64_t this_arg, int64_t bit) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = Bolt12InvoiceFeatures_set_optional_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_BlindedHopFeatures_empty() { + LDKBlindedHopFeatures ret_var = BlindedHopFeatures_empty(); + int64_t ret_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_BlindedHopFeatures_le_flags(int64_t this_arg) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKu8slice ret_var = BlindedHopFeatures_le_flags(&this_arg_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_PaymentFailureReason_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_PaymentFailureReasonDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentFailureReasonDecodeErrorZ), "LDKCResult_PaymentFailureReasonDecodeErrorZ"); - *ret_conv = PaymentFailureReason_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +jboolean CS_LDK_BlindedHopFeatures_supports_any_optional_bits(int64_t this_arg) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = BlindedHopFeatures_supports_any_optional_bits(&this_arg_conv); + return ret_conv; } -void CS_LDK_Event_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); - LDKEvent this_ptr_conv = *(LDKEvent*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Event_free(this_ptr_conv); +jboolean CS_LDK_BlindedHopFeatures_requires_unknown_bits_from(int64_t this_arg, int64_t other) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKBlindedHopFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + jboolean ret_conv = BlindedHopFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); + return ret_conv; } -static inline uint64_t Event_clone_ptr(LDKEvent *NONNULL_PTR arg) { - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_tArray CS_LDK_BlindedHopFeatures_required_unknown_bits_from(int64_t this_arg, int64_t other) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKBlindedHopFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + LDKCVec_u64Z ret_var = BlindedHopFeatures_required_unknown_bits_from(&this_arg_conv, &other_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 g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + + FREE(ret_var.data); + return ret_arr; } -int64_t CS_LDK_Event_clone_ptr(int64_t arg) { - LDKEvent* arg_conv = (LDKEvent*)untag_ptr(arg); - int64_t ret_conv = Event_clone_ptr(arg_conv); + +jboolean CS_LDK_BlindedHopFeatures_requires_unknown_bits(int64_t this_arg) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = BlindedHopFeatures_requires_unknown_bits(&this_arg_conv); return ret_conv; } -int64_t CS_LDK_Event_clone(int64_t orig) { - LDKEvent* orig_conv = (LDKEvent*)untag_ptr(orig); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_BlindedHopFeatures_supports_unknown_bits(int64_t this_arg) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = BlindedHopFeatures_supports_unknown_bits(&this_arg_conv); + return ret_conv; } -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); - LDKCVec_u8Z output_script_ref; - output_script_ref.datalen = output_script->arr_len; - output_script_ref.data = MALLOC(output_script_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(output_script_ref.data, output_script->elems, output_script_ref.datalen); FREE(output_script); - LDKU128 user_channel_id_ref; - CHECK(user_channel_id->arr_len == 16); - memcpy(user_channel_id_ref.le_bytes, user_channel_id->elems, 16); FREE(user_channel_id); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_funding_generation_ready(temporary_channel_id_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; +int64_t CS_LDK_BlindedHopFeatures_set_required_feature_bit(int64_t this_arg, int64_t bit) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = BlindedHopFeatures_set_required_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_Event_payment_claimable(int8_tArray receiver_node_id, int8_tArray payment_hash, int64_t onion_fields, int64_t amount_msat, int64_t counterparty_skimmed_fee_msat, int64_t purpose, int64_t via_channel_id, int64_t via_user_channel_id, int64_t claim_deadline) { - LDKPublicKey receiver_node_id_ref; - CHECK(receiver_node_id->arr_len == 33); - memcpy(receiver_node_id_ref.compressed_form, receiver_node_id->elems, 33); FREE(receiver_node_id); - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - LDKRecipientOnionFields onion_fields_conv; - onion_fields_conv.inner = untag_ptr(onion_fields); - onion_fields_conv.is_owned = ptr_is_owned(onion_fields); - CHECK_INNER_FIELD_ACCESS_OR_NULL(onion_fields_conv); - onion_fields_conv = RecipientOnionFields_clone(&onion_fields_conv); - void* purpose_ptr = untag_ptr(purpose); - CHECK_ACCESS(purpose_ptr); - LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr); - purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose)); - 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); - via_user_channel_id_conv = COption_U128Z_clone((LDKCOption_U128Z*)untag_ptr(via_user_channel_id)); - void* claim_deadline_ptr = untag_ptr(claim_deadline); - CHECK_ACCESS(claim_deadline_ptr); - LDKCOption_u32Z claim_deadline_conv = *(LDKCOption_u32Z*)(claim_deadline_ptr); - claim_deadline_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(claim_deadline)); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_claimable(receiver_node_id_ref, payment_hash_ref, onion_fields_conv, amount_msat, counterparty_skimmed_fee_msat, purpose_conv, via_channel_id_conv, via_user_channel_id_conv, claim_deadline_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_BlindedHopFeatures_set_optional_feature_bit(int64_t this_arg, int64_t bit) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = BlindedHopFeatures_set_optional_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_Event_payment_claimed(int8_tArray receiver_node_id, int8_tArray payment_hash, int64_t amount_msat, int64_t purpose, int64_tArray htlcs, int64_t sender_intended_total_msat) { - LDKPublicKey receiver_node_id_ref; - CHECK(receiver_node_id->arr_len == 33); - memcpy(receiver_node_id_ref.compressed_form, receiver_node_id->elems, 33); FREE(receiver_node_id); - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - void* purpose_ptr = untag_ptr(purpose); - CHECK_ACCESS(purpose_ptr); - LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr); - purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose)); - LDKCVec_ClaimedHTLCZ htlcs_constr; - htlcs_constr.datalen = htlcs->arr_len; - if (htlcs_constr.datalen > 0) - htlcs_constr.data = MALLOC(htlcs_constr.datalen * sizeof(LDKClaimedHTLC), "LDKCVec_ClaimedHTLCZ Elements"); - else - htlcs_constr.data = NULL; - int64_t* htlcs_vals = htlcs->elems; - for (size_t n = 0; n < htlcs_constr.datalen; n++) { - int64_t htlcs_conv_13 = htlcs_vals[n]; - LDKClaimedHTLC htlcs_conv_13_conv; - htlcs_conv_13_conv.inner = untag_ptr(htlcs_conv_13); - htlcs_conv_13_conv.is_owned = ptr_is_owned(htlcs_conv_13); - CHECK_INNER_FIELD_ACCESS_OR_NULL(htlcs_conv_13_conv); - htlcs_conv_13_conv = ClaimedHTLC_clone(&htlcs_conv_13_conv); - htlcs_constr.data[n] = htlcs_conv_13_conv; - } - FREE(htlcs); - void* sender_intended_total_msat_ptr = untag_ptr(sender_intended_total_msat); - CHECK_ACCESS(sender_intended_total_msat_ptr); - LDKCOption_u64Z sender_intended_total_msat_conv = *(LDKCOption_u64Z*)(sender_intended_total_msat_ptr); - sender_intended_total_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(sender_intended_total_msat)); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_claimed(receiver_node_id_ref, payment_hash_ref, amount_msat, purpose_conv, htlcs_constr, sender_intended_total_msat_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_BlindedHopFeatures_set_required_custom_bit(int64_t this_arg, int64_t bit) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = BlindedHopFeatures_set_required_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_Event_connection_needed(int8_tArray node_id, int64_tArray addresses) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKCVec_SocketAddressZ addresses_constr; - addresses_constr.datalen = addresses->arr_len; - if (addresses_constr.datalen > 0) - addresses_constr.data = MALLOC(addresses_constr.datalen * sizeof(LDKSocketAddress), "LDKCVec_SocketAddressZ Elements"); - else - addresses_constr.data = NULL; - int64_t* addresses_vals = addresses->elems; - for (size_t p = 0; p < addresses_constr.datalen; p++) { - int64_t addresses_conv_15 = addresses_vals[p]; - void* addresses_conv_15_ptr = untag_ptr(addresses_conv_15); - CHECK_ACCESS(addresses_conv_15_ptr); - LDKSocketAddress addresses_conv_15_conv = *(LDKSocketAddress*)(addresses_conv_15_ptr); - addresses_constr.data[p] = addresses_conv_15_conv; - } - FREE(addresses); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_connection_needed(node_id_ref, addresses_constr); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_BlindedHopFeatures_set_optional_custom_bit(int64_t this_arg, int64_t bit) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = BlindedHopFeatures_set_optional_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_Event_invoice_request_failed(int8_tArray payment_id) { - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_invoice_request_failed(payment_id_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); +int64_t CS_LDK_ChannelTypeFeatures_empty() { + LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_empty(); + int64_t ret_ref = 0; + 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_Event_payment_sent(int64_t payment_id, int8_tArray payment_preimage, int8_tArray payment_hash, int64_t fee_paid_msat) { - void* payment_id_ptr = untag_ptr(payment_id); - CHECK_ACCESS(payment_id_ptr); - LDKCOption_ThirtyTwoBytesZ payment_id_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_id_ptr); - payment_id_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_id)); - LDKThirtyTwoBytes payment_preimage_ref; - CHECK(payment_preimage->arr_len == 32); - memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - void* fee_paid_msat_ptr = untag_ptr(fee_paid_msat); - CHECK_ACCESS(fee_paid_msat_ptr); - LDKCOption_u64Z fee_paid_msat_conv = *(LDKCOption_u64Z*)(fee_paid_msat_ptr); - fee_paid_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(fee_paid_msat)); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_sent(payment_id_conv, payment_preimage_ref, payment_hash_ref, fee_paid_msat_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int8_tArray CS_LDK_ChannelTypeFeatures_le_flags(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKu8slice ret_var = ChannelTypeFeatures_le_flags(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + return ret_arr; } -int64_t CS_LDK_Event_payment_failed(int8_tArray payment_id, int8_tArray payment_hash, int64_t reason) { - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - void* reason_ptr = untag_ptr(reason); - CHECK_ACCESS(reason_ptr); - LDKCOption_PaymentFailureReasonZ reason_conv = *(LDKCOption_PaymentFailureReasonZ*)(reason_ptr); - reason_conv = COption_PaymentFailureReasonZ_clone((LDKCOption_PaymentFailureReasonZ*)untag_ptr(reason)); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_failed(payment_id_ref, payment_hash_ref, reason_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_ChannelTypeFeatures_supports_any_optional_bits(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_supports_any_optional_bits(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_Event_payment_path_successful(int8_tArray payment_id, int64_t payment_hash, int64_t path) { - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - void* payment_hash_ptr = untag_ptr(payment_hash); - CHECK_ACCESS(payment_hash_ptr); - LDKCOption_ThirtyTwoBytesZ payment_hash_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_ptr); - payment_hash_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash)); - LDKPath path_conv; - path_conv.inner = untag_ptr(path); - path_conv.is_owned = ptr_is_owned(path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); - path_conv = Path_clone(&path_conv); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_path_successful(payment_id_ref, payment_hash_conv, path_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_ChannelTypeFeatures_requires_unknown_bits_from(int64_t this_arg, int64_t other) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelTypeFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); + return ret_conv; } -int64_t CS_LDK_Event_payment_path_failed(int64_t payment_id, int8_tArray payment_hash, jboolean payment_failed_permanently, int64_t failure, int64_t path, int64_t short_channel_id) { - void* payment_id_ptr = untag_ptr(payment_id); - CHECK_ACCESS(payment_id_ptr); - LDKCOption_ThirtyTwoBytesZ payment_id_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_id_ptr); - payment_id_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_id)); - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - void* failure_ptr = untag_ptr(failure); - CHECK_ACCESS(failure_ptr); - LDKPathFailure failure_conv = *(LDKPathFailure*)(failure_ptr); - failure_conv = PathFailure_clone((LDKPathFailure*)untag_ptr(failure)); - LDKPath path_conv; - path_conv.inner = untag_ptr(path); - path_conv.is_owned = ptr_is_owned(path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); - path_conv = Path_clone(&path_conv); - void* short_channel_id_ptr = untag_ptr(short_channel_id); - CHECK_ACCESS(short_channel_id_ptr); - LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr); - short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id)); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_path_failed(payment_id_conv, payment_hash_ref, payment_failed_permanently, failure_conv, path_conv, short_channel_id_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_tArray CS_LDK_ChannelTypeFeatures_required_unknown_bits_from(int64_t this_arg, int64_t other) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelTypeFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + LDKCVec_u64Z ret_var = ChannelTypeFeatures_required_unknown_bits_from(&this_arg_conv, &other_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 g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + + FREE(ret_var.data); + return ret_arr; } -int64_t CS_LDK_Event_probe_successful(int8_tArray payment_id, int8_tArray payment_hash, int64_t path) { - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - LDKPath path_conv; - path_conv.inner = untag_ptr(path); - path_conv.is_owned = ptr_is_owned(path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); - path_conv = Path_clone(&path_conv); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_probe_successful(payment_id_ref, payment_hash_ref, path_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_ChannelTypeFeatures_requires_unknown_bits(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_requires_unknown_bits(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_Event_probe_failed(int8_tArray payment_id, int8_tArray payment_hash, int64_t path, int64_t short_channel_id) { - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - LDKPath path_conv; - path_conv.inner = untag_ptr(path); - path_conv.is_owned = ptr_is_owned(path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); - path_conv = Path_clone(&path_conv); - void* short_channel_id_ptr = untag_ptr(short_channel_id); - CHECK_ACCESS(short_channel_id_ptr); - LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr); - short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id)); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_probe_failed(payment_id_ref, payment_hash_ref, path_conv, short_channel_id_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_ChannelTypeFeatures_supports_unknown_bits(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_supports_unknown_bits(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_Event_pending_htlcs_forwardable(int64_t time_forwardable) { - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_pending_htlcs_forwardable(time_forwardable); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_ChannelTypeFeatures_set_required_feature_bit(int64_t this_arg, int64_t bit) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelTypeFeatures_set_required_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_Event_htlcintercepted(int8_tArray intercept_id, int64_t requested_next_hop_scid, int8_tArray payment_hash, int64_t inbound_amount_msat, int64_t expected_outbound_amount_msat) { - LDKThirtyTwoBytes intercept_id_ref; - CHECK(intercept_id->arr_len == 32); - memcpy(intercept_id_ref.data, intercept_id->elems, 32); FREE(intercept_id); - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_htlcintercepted(intercept_id_ref, requested_next_hop_scid, payment_hash_ref, inbound_amount_msat, expected_outbound_amount_msat); - int64_t ret_ref = tag_ptr(ret_copy, true); +int64_t CS_LDK_ChannelTypeFeatures_set_optional_feature_bit(int64_t this_arg, int64_t bit) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelTypeFeatures_set_optional_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_ChannelTypeFeatures_set_required_custom_bit(int64_t this_arg, int64_t bit) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelTypeFeatures_set_required_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_ChannelTypeFeatures_set_optional_custom_bit(int64_t this_arg, int64_t bit) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelTypeFeatures_set_optional_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_InitFeatures_clear_upfront_shutdown_script(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 = InitFeatures_clone(&this_arg_conv); + LDKInitFeatures ret_var = InitFeatures_clear_upfront_shutdown_script(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_Event_spendable_outputs(int64_tArray outputs, int64_t channel_id) { - LDKCVec_SpendableOutputDescriptorZ outputs_constr; - outputs_constr.datalen = outputs->arr_len; - if (outputs_constr.datalen > 0) - outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); - else - outputs_constr.data = NULL; - int64_t* outputs_vals = outputs->elems; - for (size_t b = 0; b < outputs_constr.datalen; b++) { - int64_t outputs_conv_27 = outputs_vals[b]; - void* outputs_conv_27_ptr = untag_ptr(outputs_conv_27); - CHECK_ACCESS(outputs_conv_27_ptr); - LDKSpendableOutputDescriptor outputs_conv_27_conv = *(LDKSpendableOutputDescriptor*)(outputs_conv_27_ptr); - outputs_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(outputs_conv_27)); - outputs_constr.data[b] = outputs_conv_27_conv; - } - FREE(outputs); - 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); +int64_t CS_LDK_NodeFeatures_clear_upfront_shutdown_script(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 = NodeFeatures_clone(&this_arg_conv); + LDKNodeFeatures ret_var = NodeFeatures_clear_upfront_shutdown_script(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_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, 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); +int64_t CS_LDK_InitFeatures_clear_shutdown_anysegwit(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 = InitFeatures_clone(&this_arg_conv); + LDKInitFeatures ret_var = InitFeatures_clear_shutdown_anysegwit(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_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); - 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); - 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); - 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_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); +int64_t CS_LDK_NodeFeatures_clear_shutdown_anysegwit(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 = NodeFeatures_clone(&this_arg_conv); + LDKNodeFeatures ret_var = NodeFeatures_clear_shutdown_anysegwit(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_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); - LDKPublicKey counterparty_node_id_ref; - CHECK(counterparty_node_id->arr_len == 33); - memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); - LDKChannelTypeFeatures channel_type_conv; - channel_type_conv.inner = untag_ptr(channel_type); - channel_type_conv.is_owned = ptr_is_owned(channel_type); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_conv); - channel_type_conv = ChannelTypeFeatures_clone(&channel_type_conv); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_channel_ready(channel_id_conv, user_channel_id_ref, counterparty_node_id_ref, channel_type_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +int64_t CS_LDK_InitFeatures_clear_wumbo(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 = InitFeatures_clone(&this_arg_conv); + LDKInitFeatures ret_var = InitFeatures_clear_wumbo(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_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); - void* reason_ptr = untag_ptr(reason); - CHECK_ACCESS(reason_ptr); - LDKClosureReason reason_conv = *(LDKClosureReason*)(reason_ptr); - reason_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(reason)); - LDKPublicKey counterparty_node_id_ref; - CHECK(counterparty_node_id->arr_len == 33); - memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); - void* channel_capacity_sats_ptr = untag_ptr(channel_capacity_sats); - CHECK_ACCESS(channel_capacity_sats_ptr); - LDKCOption_u64Z channel_capacity_sats_conv = *(LDKCOption_u64Z*)(channel_capacity_sats_ptr); - channel_capacity_sats_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(channel_capacity_sats)); - LDKOutPoint channel_funding_txo_conv; - channel_funding_txo_conv.inner = untag_ptr(channel_funding_txo); - channel_funding_txo_conv.is_owned = ptr_is_owned(channel_funding_txo); - 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_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); +int64_t CS_LDK_NodeFeatures_clear_wumbo(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 = NodeFeatures_clone(&this_arg_conv); + LDKNodeFeatures ret_var = NodeFeatures_clear_wumbo(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_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_conv, transaction_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_InitFeatures_clear_scid_privacy(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_clear_scid_privacy(&this_arg_conv); } -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); - LDKChannelTypeFeatures channel_type_conv; - channel_type_conv.inner = untag_ptr(channel_type); - channel_type_conv.is_owned = ptr_is_owned(channel_type); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_conv); - channel_type_conv = ChannelTypeFeatures_clone(&channel_type_conv); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_open_channel_request(temporary_channel_id_conv, counterparty_node_id_ref, funding_satoshis, push_msat, channel_type_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_NodeFeatures_clear_scid_privacy(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_clear_scid_privacy(&this_arg_conv); +} + +void CS_LDK_ChannelTypeFeatures_clear_scid_privacy(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_clear_scid_privacy(&this_arg_conv); +} + +void CS_LDK_InitFeatures_clear_anchors_zero_fee_htlc_tx(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_clear_anchors_zero_fee_htlc_tx(&this_arg_conv); +} + +void CS_LDK_NodeFeatures_clear_anchors_zero_fee_htlc_tx(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_clear_anchors_zero_fee_htlc_tx(&this_arg_conv); +} + +void CS_LDK_ChannelTypeFeatures_clear_anchors_zero_fee_htlc_tx(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_clear_anchors_zero_fee_htlc_tx(&this_arg_conv); +} + +void CS_LDK_InitFeatures_clear_route_blinding(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_clear_route_blinding(&this_arg_conv); +} + +void CS_LDK_NodeFeatures_clear_route_blinding(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_clear_route_blinding(&this_arg_conv); +} + +void CS_LDK_InitFeatures_set_data_loss_protect_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_data_loss_protect_optional(&this_arg_conv); +} + +void CS_LDK_InitFeatures_set_data_loss_protect_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_data_loss_protect_required(&this_arg_conv); +} + +jboolean CS_LDK_InitFeatures_supports_data_loss_protect(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_data_loss_protect(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_NodeFeatures_set_data_loss_protect_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_data_loss_protect_optional(&this_arg_conv); +} + +void CS_LDK_NodeFeatures_set_data_loss_protect_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_data_loss_protect_required(&this_arg_conv); +} + +jboolean CS_LDK_NodeFeatures_supports_data_loss_protect(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_data_loss_protect(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_InitFeatures_requires_data_loss_protect(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_data_loss_protect(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_NodeFeatures_requires_data_loss_protect(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_data_loss_protect(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_InitFeatures_set_initial_routing_sync_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_initial_routing_sync_optional(&this_arg_conv); +} + +void CS_LDK_InitFeatures_set_initial_routing_sync_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_initial_routing_sync_required(&this_arg_conv); +} + +jboolean CS_LDK_InitFeatures_initial_routing_sync(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_initial_routing_sync(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_InitFeatures_set_upfront_shutdown_script_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_upfront_shutdown_script_optional(&this_arg_conv); +} + +void CS_LDK_InitFeatures_set_upfront_shutdown_script_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_upfront_shutdown_script_required(&this_arg_conv); +} + +jboolean CS_LDK_InitFeatures_supports_upfront_shutdown_script(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_upfront_shutdown_script(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_NodeFeatures_set_upfront_shutdown_script_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_upfront_shutdown_script_optional(&this_arg_conv); +} + +void CS_LDK_NodeFeatures_set_upfront_shutdown_script_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_upfront_shutdown_script_required(&this_arg_conv); +} + +jboolean CS_LDK_NodeFeatures_supports_upfront_shutdown_script(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_upfront_shutdown_script(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_InitFeatures_requires_upfront_shutdown_script(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_upfront_shutdown_script(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_NodeFeatures_requires_upfront_shutdown_script(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_upfront_shutdown_script(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_InitFeatures_set_gossip_queries_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_gossip_queries_optional(&this_arg_conv); +} + +void CS_LDK_InitFeatures_set_gossip_queries_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_gossip_queries_required(&this_arg_conv); +} + +jboolean CS_LDK_InitFeatures_supports_gossip_queries(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_gossip_queries(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_NodeFeatures_set_gossip_queries_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_gossip_queries_optional(&this_arg_conv); +} + +void CS_LDK_NodeFeatures_set_gossip_queries_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_gossip_queries_required(&this_arg_conv); +} + +jboolean CS_LDK_NodeFeatures_supports_gossip_queries(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_gossip_queries(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_InitFeatures_requires_gossip_queries(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_gossip_queries(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_NodeFeatures_requires_gossip_queries(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_gossip_queries(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_InitFeatures_set_variable_length_onion_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_variable_length_onion_optional(&this_arg_conv); +} + +void CS_LDK_InitFeatures_set_variable_length_onion_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_variable_length_onion_required(&this_arg_conv); +} + +jboolean CS_LDK_InitFeatures_supports_variable_length_onion(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_variable_length_onion(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_NodeFeatures_set_variable_length_onion_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_variable_length_onion_optional(&this_arg_conv); +} + +void CS_LDK_NodeFeatures_set_variable_length_onion_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_variable_length_onion_required(&this_arg_conv); +} + +jboolean CS_LDK_NodeFeatures_supports_variable_length_onion(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_variable_length_onion(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_Bolt11InvoiceFeatures_set_variable_length_onion_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_variable_length_onion_optional(&this_arg_conv); +} + +void CS_LDK_Bolt11InvoiceFeatures_set_variable_length_onion_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_variable_length_onion_required(&this_arg_conv); +} + +jboolean CS_LDK_Bolt11InvoiceFeatures_supports_variable_length_onion(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_variable_length_onion(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_InitFeatures_requires_variable_length_onion(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_variable_length_onion(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_NodeFeatures_requires_variable_length_onion(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_variable_length_onion(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_Bolt11InvoiceFeatures_requires_variable_length_onion(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_variable_length_onion(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_InitFeatures_set_static_remote_key_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_static_remote_key_optional(&this_arg_conv); +} + +void CS_LDK_InitFeatures_set_static_remote_key_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_static_remote_key_required(&this_arg_conv); +} + +jboolean CS_LDK_InitFeatures_supports_static_remote_key(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_static_remote_key(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_NodeFeatures_set_static_remote_key_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_static_remote_key_optional(&this_arg_conv); +} + +void CS_LDK_NodeFeatures_set_static_remote_key_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_static_remote_key_required(&this_arg_conv); +} + +jboolean CS_LDK_NodeFeatures_supports_static_remote_key(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_static_remote_key(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_ChannelTypeFeatures_set_static_remote_key_optional(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_static_remote_key_optional(&this_arg_conv); +} + +void CS_LDK_ChannelTypeFeatures_set_static_remote_key_required(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_static_remote_key_required(&this_arg_conv); +} + +jboolean CS_LDK_ChannelTypeFeatures_supports_static_remote_key(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_supports_static_remote_key(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_InitFeatures_requires_static_remote_key(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_static_remote_key(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_NodeFeatures_requires_static_remote_key(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_static_remote_key(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_ChannelTypeFeatures_requires_static_remote_key(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_requires_static_remote_key(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_InitFeatures_set_payment_secret_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_payment_secret_optional(&this_arg_conv); +} + +void CS_LDK_InitFeatures_set_payment_secret_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_payment_secret_required(&this_arg_conv); +} + +jboolean CS_LDK_InitFeatures_supports_payment_secret(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_payment_secret(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_NodeFeatures_set_payment_secret_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_payment_secret_optional(&this_arg_conv); +} + +void CS_LDK_NodeFeatures_set_payment_secret_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_payment_secret_required(&this_arg_conv); +} + +jboolean CS_LDK_NodeFeatures_supports_payment_secret(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_payment_secret(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_Bolt11InvoiceFeatures_set_payment_secret_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_payment_secret_optional(&this_arg_conv); +} + +void CS_LDK_Bolt11InvoiceFeatures_set_payment_secret_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_payment_secret_required(&this_arg_conv); +} + +jboolean CS_LDK_Bolt11InvoiceFeatures_supports_payment_secret(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_payment_secret(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_InitFeatures_requires_payment_secret(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_payment_secret(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_NodeFeatures_requires_payment_secret(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_payment_secret(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_Bolt11InvoiceFeatures_requires_payment_secret(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_payment_secret(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_InitFeatures_set_basic_mpp_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_basic_mpp_optional(&this_arg_conv); +} + +void CS_LDK_InitFeatures_set_basic_mpp_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_basic_mpp_required(&this_arg_conv); +} + +jboolean CS_LDK_InitFeatures_supports_basic_mpp(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_basic_mpp(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_NodeFeatures_set_basic_mpp_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_basic_mpp_optional(&this_arg_conv); +} + +void CS_LDK_NodeFeatures_set_basic_mpp_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_basic_mpp_required(&this_arg_conv); +} + +jboolean CS_LDK_NodeFeatures_supports_basic_mpp(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_basic_mpp(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_Bolt11InvoiceFeatures_set_basic_mpp_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_basic_mpp_optional(&this_arg_conv); +} + +void CS_LDK_Bolt11InvoiceFeatures_set_basic_mpp_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_basic_mpp_required(&this_arg_conv); +} + +jboolean CS_LDK_Bolt11InvoiceFeatures_supports_basic_mpp(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_basic_mpp(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_Bolt12InvoiceFeatures_set_basic_mpp_optional(int64_t this_arg) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + Bolt12InvoiceFeatures_set_basic_mpp_optional(&this_arg_conv); +} + +void CS_LDK_Bolt12InvoiceFeatures_set_basic_mpp_required(int64_t this_arg) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + Bolt12InvoiceFeatures_set_basic_mpp_required(&this_arg_conv); +} + +jboolean CS_LDK_Bolt12InvoiceFeatures_supports_basic_mpp(int64_t this_arg) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt12InvoiceFeatures_supports_basic_mpp(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_InitFeatures_requires_basic_mpp(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_basic_mpp(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_NodeFeatures_requires_basic_mpp(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_basic_mpp(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_Bolt11InvoiceFeatures_requires_basic_mpp(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_basic_mpp(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_Bolt12InvoiceFeatures_requires_basic_mpp(int64_t this_arg) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt12InvoiceFeatures_requires_basic_mpp(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_InitFeatures_set_wumbo_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_wumbo_optional(&this_arg_conv); +} + +void CS_LDK_InitFeatures_set_wumbo_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_wumbo_required(&this_arg_conv); +} + +jboolean CS_LDK_InitFeatures_supports_wumbo(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_wumbo(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_NodeFeatures_set_wumbo_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_wumbo_optional(&this_arg_conv); +} + +void CS_LDK_NodeFeatures_set_wumbo_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_wumbo_required(&this_arg_conv); +} + +jboolean CS_LDK_NodeFeatures_supports_wumbo(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_wumbo(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_InitFeatures_requires_wumbo(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_wumbo(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_NodeFeatures_requires_wumbo(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_wumbo(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_InitFeatures_set_anchors_nonzero_fee_htlc_tx_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_anchors_nonzero_fee_htlc_tx_optional(&this_arg_conv); +} + +void CS_LDK_InitFeatures_set_anchors_nonzero_fee_htlc_tx_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_anchors_nonzero_fee_htlc_tx_required(&this_arg_conv); +} + +jboolean CS_LDK_InitFeatures_supports_anchors_nonzero_fee_htlc_tx(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_anchors_nonzero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_NodeFeatures_set_anchors_nonzero_fee_htlc_tx_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_anchors_nonzero_fee_htlc_tx_optional(&this_arg_conv); +} + +void CS_LDK_NodeFeatures_set_anchors_nonzero_fee_htlc_tx_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_anchors_nonzero_fee_htlc_tx_required(&this_arg_conv); +} + +jboolean CS_LDK_NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(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_anchors_nonzero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(&this_arg_conv); +} + +void CS_LDK_ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(&this_arg_conv); +} + +jboolean CS_LDK_ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_InitFeatures_requires_anchors_nonzero_fee_htlc_tx(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_anchors_nonzero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(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_anchors_nonzero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_InitFeatures_set_anchors_zero_fee_htlc_tx_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_anchors_zero_fee_htlc_tx_optional(&this_arg_conv); +} + +void CS_LDK_InitFeatures_set_anchors_zero_fee_htlc_tx_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_anchors_zero_fee_htlc_tx_required(&this_arg_conv); +} + +jboolean CS_LDK_InitFeatures_supports_anchors_zero_fee_htlc_tx(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_anchors_zero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_NodeFeatures_set_anchors_zero_fee_htlc_tx_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_anchors_zero_fee_htlc_tx_optional(&this_arg_conv); +} + +void CS_LDK_NodeFeatures_set_anchors_zero_fee_htlc_tx_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_anchors_zero_fee_htlc_tx_required(&this_arg_conv); +} + +jboolean CS_LDK_NodeFeatures_supports_anchors_zero_fee_htlc_tx(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_anchors_zero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(&this_arg_conv); +} + +void CS_LDK_ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(&this_arg_conv); +} + +jboolean CS_LDK_ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_InitFeatures_requires_anchors_zero_fee_htlc_tx(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_anchors_zero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_NodeFeatures_requires_anchors_zero_fee_htlc_tx(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_anchors_zero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_InitFeatures_set_route_blinding_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_route_blinding_optional(&this_arg_conv); +} + +void CS_LDK_InitFeatures_set_route_blinding_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_route_blinding_required(&this_arg_conv); +} + +jboolean CS_LDK_InitFeatures_supports_route_blinding(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_route_blinding(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_NodeFeatures_set_route_blinding_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_route_blinding_optional(&this_arg_conv); +} + +void CS_LDK_NodeFeatures_set_route_blinding_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_route_blinding_required(&this_arg_conv); +} + +jboolean CS_LDK_NodeFeatures_supports_route_blinding(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_route_blinding(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_InitFeatures_requires_route_blinding(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_route_blinding(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_NodeFeatures_requires_route_blinding(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_route_blinding(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_InitFeatures_set_shutdown_any_segwit_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_shutdown_any_segwit_optional(&this_arg_conv); +} + +void CS_LDK_InitFeatures_set_shutdown_any_segwit_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_shutdown_any_segwit_required(&this_arg_conv); +} + +jboolean CS_LDK_InitFeatures_supports_shutdown_anysegwit(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_shutdown_anysegwit(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_NodeFeatures_set_shutdown_any_segwit_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_shutdown_any_segwit_optional(&this_arg_conv); +} + +void CS_LDK_NodeFeatures_set_shutdown_any_segwit_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_shutdown_any_segwit_required(&this_arg_conv); +} + +jboolean CS_LDK_NodeFeatures_supports_shutdown_anysegwit(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_shutdown_anysegwit(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_InitFeatures_requires_shutdown_anysegwit(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_shutdown_anysegwit(&this_arg_conv); + return ret_conv; } -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_conv, failed_next_destination_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_NodeFeatures_requires_shutdown_anysegwit(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_shutdown_anysegwit(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_Event_bump_transaction(int64_t a) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKBumpTransactionEvent a_conv = *(LDKBumpTransactionEvent*)(a_ptr); - a_conv = BumpTransactionEvent_clone((LDKBumpTransactionEvent*)untag_ptr(a)); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_bump_transaction(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_InitFeatures_set_taproot_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_taproot_optional(&this_arg_conv); } -jboolean CS_LDK_Event_eq(int64_t a, int64_t b) { - LDKEvent* a_conv = (LDKEvent*)untag_ptr(a); - LDKEvent* b_conv = (LDKEvent*)untag_ptr(b); - jboolean ret_conv = Event_eq(a_conv, b_conv); +void CS_LDK_InitFeatures_set_taproot_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_taproot_required(&this_arg_conv); +} + +jboolean CS_LDK_InitFeatures_supports_taproot(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_taproot(&this_arg_conv); return ret_conv; } -int8_tArray CS_LDK_Event_write(int64_t obj) { - LDKEvent* obj_conv = (LDKEvent*)untag_ptr(obj); - LDKCVec_u8Z ret_var = Event_write(obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +void CS_LDK_NodeFeatures_set_taproot_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_taproot_optional(&this_arg_conv); } -int64_t CS_LDK_Event_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); - *ret_conv = Event_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void CS_LDK_NodeFeatures_set_taproot_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_taproot_required(&this_arg_conv); } -void CS_LDK_MessageSendEvent_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); - LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - MessageSendEvent_free(this_ptr_conv); +jboolean CS_LDK_NodeFeatures_supports_taproot(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_taproot(&this_arg_conv); + return ret_conv; } -static inline uint64_t MessageSendEvent_clone_ptr(LDKMessageSendEvent *NONNULL_PTR arg) { - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_ChannelTypeFeatures_set_taproot_optional(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_taproot_optional(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_clone_ptr(int64_t arg) { - LDKMessageSendEvent* arg_conv = (LDKMessageSendEvent*)untag_ptr(arg); - int64_t ret_conv = MessageSendEvent_clone_ptr(arg_conv); - return ret_conv; + +void CS_LDK_ChannelTypeFeatures_set_taproot_required(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_taproot_required(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_clone(int64_t orig) { - LDKMessageSendEvent* orig_conv = (LDKMessageSendEvent*)untag_ptr(orig); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_ChannelTypeFeatures_supports_taproot(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_supports_taproot(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_send_accept_channel(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKAcceptChannel msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = AcceptChannel_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_accept_channel(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_InitFeatures_requires_taproot(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_taproot(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_send_accept_channel_v2(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKAcceptChannelV2 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 = AcceptChannelV2_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_accept_channel_v2(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_NodeFeatures_requires_taproot(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_taproot(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_send_open_channel(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKOpenChannel msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = OpenChannel_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_open_channel(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_ChannelTypeFeatures_requires_taproot(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_requires_taproot(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_send_open_channel_v2(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKOpenChannelV2 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 = OpenChannelV2_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_open_channel_v2(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_InitFeatures_set_onion_messages_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_onion_messages_optional(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_send_funding_created(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKFundingCreated msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = FundingCreated_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_funding_created(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_InitFeatures_set_onion_messages_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_onion_messages_required(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_send_funding_signed(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKFundingSigned msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = FundingSigned_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_funding_signed(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_InitFeatures_supports_onion_messages(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_onion_messages(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_send_stfu(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKStfu 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 = Stfu_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_stfu(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_NodeFeatures_set_onion_messages_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_onion_messages_optional(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_send_splice(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - 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 = Splice_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_splice(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_NodeFeatures_set_onion_messages_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_onion_messages_required(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_send_splice_ack(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - 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 = SpliceAck_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_splice_ack(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_NodeFeatures_supports_onion_messages(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_onion_messages(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_send_splice_locked(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - 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 = SpliceLocked_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_splice_locked(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_InitFeatures_requires_onion_messages(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_onion_messages(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_send_tx_add_input(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKTxAddInput 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 = TxAddInput_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_tx_add_input(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_NodeFeatures_requires_onion_messages(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_onion_messages(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_send_tx_add_output(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKTxAddOutput 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 = TxAddOutput_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_tx_add_output(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_InitFeatures_set_channel_type_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_channel_type_optional(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_send_tx_remove_input(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKTxRemoveInput 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 = TxRemoveInput_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_tx_remove_input(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_InitFeatures_set_channel_type_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_channel_type_required(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_send_tx_remove_output(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKTxRemoveOutput 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 = TxRemoveOutput_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_tx_remove_output(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_InitFeatures_supports_channel_type(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_channel_type(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_send_tx_complete(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKTxComplete 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 = TxComplete_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_tx_complete(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_NodeFeatures_set_channel_type_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_channel_type_optional(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_send_tx_signatures(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKTxSignatures 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 = TxSignatures_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_tx_signatures(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_NodeFeatures_set_channel_type_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_channel_type_required(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_send_tx_init_rbf(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKTxInitRbf 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 = TxInitRbf_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_tx_init_rbf(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_NodeFeatures_supports_channel_type(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_channel_type(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_send_tx_ack_rbf(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKTxAckRbf 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 = TxAckRbf_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_tx_ack_rbf(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_InitFeatures_requires_channel_type(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_channel_type(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_NodeFeatures_requires_channel_type(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_channel_type(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_send_tx_abort(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKTxAbort 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 = TxAbort_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_tx_abort(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_InitFeatures_set_scid_privacy_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_scid_privacy_optional(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_send_channel_ready(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKChannelReady msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ChannelReady_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_channel_ready(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_InitFeatures_set_scid_privacy_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_scid_privacy_required(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_send_announcement_signatures(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKAnnouncementSignatures msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = AnnouncementSignatures_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_announcement_signatures(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_InitFeatures_supports_scid_privacy(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_scid_privacy(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_update_htlcs(int8_tArray node_id, int64_t updates) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKCommitmentUpdate updates_conv; - updates_conv.inner = untag_ptr(updates); - updates_conv.is_owned = ptr_is_owned(updates); - CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv); - updates_conv = CommitmentUpdate_clone(&updates_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_update_htlcs(node_id_ref, updates_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_NodeFeatures_set_scid_privacy_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_scid_privacy_optional(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_send_revoke_and_ack(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKRevokeAndACK msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = RevokeAndACK_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_revoke_and_ack(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_NodeFeatures_set_scid_privacy_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_scid_privacy_required(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_send_closing_signed(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKClosingSigned msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ClosingSigned_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_closing_signed(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_NodeFeatures_supports_scid_privacy(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_scid_privacy(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_send_shutdown(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKShutdown msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = Shutdown_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_shutdown(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_ChannelTypeFeatures_set_scid_privacy_optional(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_scid_privacy_optional(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_send_channel_reestablish(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKChannelReestablish msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ChannelReestablish_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_channel_reestablish(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_ChannelTypeFeatures_set_scid_privacy_required(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_scid_privacy_required(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_send_channel_announcement(int8_tArray node_id, int64_t msg, int64_t update_msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKChannelAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ChannelAnnouncement_clone(&msg_conv); - LDKChannelUpdate update_msg_conv; - update_msg_conv.inner = untag_ptr(update_msg); - update_msg_conv.is_owned = ptr_is_owned(update_msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv); - update_msg_conv = ChannelUpdate_clone(&update_msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_channel_announcement(node_id_ref, msg_conv, update_msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_ChannelTypeFeatures_supports_scid_privacy(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_supports_scid_privacy(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_broadcast_channel_announcement(int64_t msg, int64_t update_msg) { - LDKChannelAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ChannelAnnouncement_clone(&msg_conv); - LDKChannelUpdate update_msg_conv; - update_msg_conv.inner = untag_ptr(update_msg); - update_msg_conv.is_owned = ptr_is_owned(update_msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv); - update_msg_conv = ChannelUpdate_clone(&update_msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_broadcast_channel_announcement(msg_conv, update_msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_InitFeatures_requires_scid_privacy(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_scid_privacy(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_broadcast_channel_update(int64_t msg) { - LDKChannelUpdate msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ChannelUpdate_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_broadcast_channel_update(msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_NodeFeatures_requires_scid_privacy(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_scid_privacy(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_broadcast_node_announcement(int64_t msg) { - LDKNodeAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = NodeAnnouncement_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_broadcast_node_announcement(msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_ChannelTypeFeatures_requires_scid_privacy(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_requires_scid_privacy(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_send_channel_update(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKChannelUpdate msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ChannelUpdate_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_channel_update(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_Bolt11InvoiceFeatures_set_payment_metadata_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_payment_metadata_optional(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_handle_error(int8_tArray node_id, int64_t action) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - void* action_ptr = untag_ptr(action); - CHECK_ACCESS(action_ptr); - LDKErrorAction action_conv = *(LDKErrorAction*)(action_ptr); - action_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(action)); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_handle_error(node_id_ref, action_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_Bolt11InvoiceFeatures_set_payment_metadata_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_payment_metadata_required(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_send_channel_range_query(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKQueryChannelRange msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = QueryChannelRange_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_channel_range_query(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_Bolt11InvoiceFeatures_supports_payment_metadata(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_payment_metadata(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_send_short_ids_query(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKQueryShortChannelIds msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = QueryShortChannelIds_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_short_ids_query(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_Bolt11InvoiceFeatures_requires_payment_metadata(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_payment_metadata(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_MessageSendEvent_send_reply_channel_range(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKReplyChannelRange msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ReplyChannelRange_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_reply_channel_range(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_InitFeatures_set_zero_conf_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_zero_conf_optional(&this_arg_conv); } -int64_t CS_LDK_MessageSendEvent_send_gossip_timestamp_filter(int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKGossipTimestampFilter msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = GossipTimestampFilter_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_gossip_timestamp_filter(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_InitFeatures_set_zero_conf_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_zero_conf_required(&this_arg_conv); } -void CS_LDK_MessageSendEventsProvider_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); - LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - MessageSendEventsProvider_free(this_ptr_conv); +jboolean CS_LDK_InitFeatures_supports_zero_conf(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_zero_conf(&this_arg_conv); + return ret_conv; } -void CS_LDK_EventsProvider_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); - LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - EventsProvider_free(this_ptr_conv); +void CS_LDK_NodeFeatures_set_zero_conf_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_zero_conf_optional(&this_arg_conv); } -void CS_LDK_EventHandler_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); - LDKEventHandler this_ptr_conv = *(LDKEventHandler*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - EventHandler_free(this_ptr_conv); +void CS_LDK_NodeFeatures_set_zero_conf_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_zero_conf_required(&this_arg_conv); } -void CS_LDK_AnchorDescriptor_free(int64_t this_obj) { - LDKAnchorDescriptor this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - AnchorDescriptor_free(this_obj_conv); +jboolean CS_LDK_NodeFeatures_supports_zero_conf(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_zero_conf(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_AnchorDescriptor_get_channel_derivation_parameters(int64_t this_ptr) { - LDKAnchorDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelDerivationParameters ret_var = AnchorDescriptor_get_channel_derivation_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_ChannelTypeFeatures_set_zero_conf_optional(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_zero_conf_optional(&this_arg_conv); } -void CS_LDK_AnchorDescriptor_set_channel_derivation_parameters(int64_t this_ptr, int64_t val) { - LDKAnchorDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelDerivationParameters 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 = ChannelDerivationParameters_clone(&val_conv); - AnchorDescriptor_set_channel_derivation_parameters(&this_ptr_conv, val_conv); +void CS_LDK_ChannelTypeFeatures_set_zero_conf_required(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_zero_conf_required(&this_arg_conv); } -int64_t CS_LDK_AnchorDescriptor_get_outpoint(int64_t this_ptr) { - LDKAnchorDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKOutPoint ret_var = AnchorDescriptor_get_outpoint(&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; +jboolean CS_LDK_ChannelTypeFeatures_supports_zero_conf(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_supports_zero_conf(&this_arg_conv); + return ret_conv; } -void CS_LDK_AnchorDescriptor_set_outpoint(int64_t this_ptr, int64_t val) { - LDKAnchorDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKOutPoint val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = OutPoint_clone(&val_conv); - AnchorDescriptor_set_outpoint(&this_ptr_conv, val_conv); +jboolean CS_LDK_InitFeatures_requires_zero_conf(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_zero_conf(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_NodeFeatures_requires_zero_conf(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_zero_conf(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_AnchorDescriptor_new(int64_t channel_derivation_parameters_arg, int64_t outpoint_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); - LDKOutPoint outpoint_arg_conv; - outpoint_arg_conv.inner = untag_ptr(outpoint_arg); - outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); - outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); - LDKAnchorDescriptor ret_var = AnchorDescriptor_new(channel_derivation_parameters_arg_conv, outpoint_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_ChannelTypeFeatures_requires_zero_conf(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_requires_zero_conf(&this_arg_conv); + return ret_conv; } -static inline uint64_t AnchorDescriptor_clone_ptr(LDKAnchorDescriptor *NONNULL_PTR arg) { - LDKAnchorDescriptor ret_var = AnchorDescriptor_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; +void CS_LDK_NodeFeatures_set_keysend_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_keysend_optional(&this_arg_conv); } -int64_t CS_LDK_AnchorDescriptor_clone_ptr(int64_t arg) { - LDKAnchorDescriptor 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 = AnchorDescriptor_clone_ptr(&arg_conv); - return ret_conv; + +void CS_LDK_NodeFeatures_set_keysend_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_keysend_required(&this_arg_conv); } -int64_t CS_LDK_AnchorDescriptor_clone(int64_t orig) { - LDKAnchorDescriptor 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; - LDKAnchorDescriptor ret_var = AnchorDescriptor_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_NodeFeatures_supports_keysend(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_keysend(&this_arg_conv); + return ret_conv; } -jboolean CS_LDK_AnchorDescriptor_eq(int64_t a, int64_t b) { - LDKAnchorDescriptor a_conv; - 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; - LDKAnchorDescriptor 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 = AnchorDescriptor_eq(&a_conv, &b_conv); +jboolean CS_LDK_NodeFeatures_requires_keysend(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_keysend(&this_arg_conv); return ret_conv; } -int64_t CS_LDK_AnchorDescriptor_previous_utxo(int64_t this_arg) { - LDKAnchorDescriptor this_arg_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; - LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); - *ret_ref = AnchorDescriptor_previous_utxo(&this_arg_conv); - return tag_ptr(ret_ref, true); + InitFeatures_set_trampoline_routing_optional(&this_arg_conv); } -int64_t CS_LDK_AnchorDescriptor_unsigned_tx_input(int64_t this_arg) { - LDKAnchorDescriptor 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; - LDKTxIn* ret_ref = MALLOC(sizeof(LDKTxIn), "LDKTxIn"); - *ret_ref = AnchorDescriptor_unsigned_tx_input(&this_arg_conv); - return tag_ptr(ret_ref, true); + InitFeatures_set_trampoline_routing_required(&this_arg_conv); } -int8_tArray CS_LDK_AnchorDescriptor_witness_script(int64_t this_arg) { - LDKAnchorDescriptor 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; - LDKCVec_u8Z ret_var = AnchorDescriptor_witness_script(&this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; + jboolean ret_conv = InitFeatures_supports_trampoline_routing(&this_arg_conv); + return ret_conv; } -int8_tArray CS_LDK_AnchorDescriptor_tx_input_witness(int64_t this_arg, int8_tArray signature) { - LDKAnchorDescriptor this_arg_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; - LDKECDSASignature signature_ref; - CHECK(signature->arr_len == 64); - memcpy(signature_ref.compact_form, signature->elems, 64); FREE(signature); - LDKWitness ret_var = AnchorDescriptor_tx_input_witness(&this_arg_conv, signature_ref); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - Witness_free(ret_var); - return ret_arr; + NodeFeatures_set_trampoline_routing_optional(&this_arg_conv); } -int64_t CS_LDK_AnchorDescriptor_derive_channel_signer(int64_t this_arg, int64_t signer_provider) { - LDKAnchorDescriptor 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; - void* signer_provider_ptr = untag_ptr(signer_provider); - if (ptr_is_owned(signer_provider)) { CHECK_ACCESS(signer_provider_ptr); } - LDKSignerProvider* signer_provider_conv = (LDKSignerProvider*)signer_provider_ptr; - LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner"); - *ret_ret = AnchorDescriptor_derive_channel_signer(&this_arg_conv, signer_provider_conv); - return tag_ptr(ret_ret, true); + NodeFeatures_set_trampoline_routing_required(&this_arg_conv); } -void CS_LDK_BumpTransactionEvent_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); - LDKBumpTransactionEvent this_ptr_conv = *(LDKBumpTransactionEvent*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - BumpTransactionEvent_free(this_ptr_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; } -static inline uint64_t BumpTransactionEvent_clone_ptr(LDKBumpTransactionEvent *NONNULL_PTR arg) { - LDKBumpTransactionEvent *ret_copy = MALLOC(sizeof(LDKBumpTransactionEvent), "LDKBumpTransactionEvent"); - *ret_copy = BumpTransactionEvent_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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); } -int64_t CS_LDK_BumpTransactionEvent_clone_ptr(int64_t arg) { - LDKBumpTransactionEvent* arg_conv = (LDKBumpTransactionEvent*)untag_ptr(arg); - int64_t ret_conv = BumpTransactionEvent_clone_ptr(arg_conv); - return ret_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); } -int64_t CS_LDK_BumpTransactionEvent_clone(int64_t orig) { - LDKBumpTransactionEvent* orig_conv = (LDKBumpTransactionEvent*)untag_ptr(orig); - LDKBumpTransactionEvent *ret_copy = MALLOC(sizeof(LDKBumpTransactionEvent), "LDKBumpTransactionEvent"); - *ret_copy = BumpTransactionEvent_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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; } -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); - LDKTransaction commitment_tx_ref; - commitment_tx_ref.datalen = commitment_tx->arr_len; - commitment_tx_ref.data = MALLOC(commitment_tx_ref.datalen, "LDKTransaction Bytes"); - memcpy(commitment_tx_ref.data, commitment_tx->elems, commitment_tx_ref.datalen); FREE(commitment_tx); - commitment_tx_ref.data_is_owned = true; - LDKAnchorDescriptor anchor_descriptor_conv; - anchor_descriptor_conv.inner = untag_ptr(anchor_descriptor); - anchor_descriptor_conv.is_owned = ptr_is_owned(anchor_descriptor); - CHECK_INNER_FIELD_ACCESS_OR_NULL(anchor_descriptor_conv); - anchor_descriptor_conv = AnchorDescriptor_clone(&anchor_descriptor_conv); - LDKCVec_HTLCOutputInCommitmentZ pending_htlcs_constr; - pending_htlcs_constr.datalen = pending_htlcs->arr_len; - if (pending_htlcs_constr.datalen > 0) - pending_htlcs_constr.data = MALLOC(pending_htlcs_constr.datalen * sizeof(LDKHTLCOutputInCommitment), "LDKCVec_HTLCOutputInCommitmentZ Elements"); - else - pending_htlcs_constr.data = NULL; - int64_t* pending_htlcs_vals = pending_htlcs->elems; - for (size_t y = 0; y < pending_htlcs_constr.datalen; y++) { - int64_t pending_htlcs_conv_24 = pending_htlcs_vals[y]; - LDKHTLCOutputInCommitment pending_htlcs_conv_24_conv; - pending_htlcs_conv_24_conv.inner = untag_ptr(pending_htlcs_conv_24); - pending_htlcs_conv_24_conv.is_owned = ptr_is_owned(pending_htlcs_conv_24); - CHECK_INNER_FIELD_ACCESS_OR_NULL(pending_htlcs_conv_24_conv); - pending_htlcs_conv_24_conv = HTLCOutputInCommitment_clone(&pending_htlcs_conv_24_conv); - pending_htlcs_constr.data[y] = pending_htlcs_conv_24_conv; - } - FREE(pending_htlcs); - LDKBumpTransactionEvent *ret_copy = MALLOC(sizeof(LDKBumpTransactionEvent), "LDKBumpTransactionEvent"); - *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; +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; } -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); - LDKCVec_HTLCDescriptorZ htlc_descriptors_constr; - htlc_descriptors_constr.datalen = htlc_descriptors->arr_len; - if (htlc_descriptors_constr.datalen > 0) - htlc_descriptors_constr.data = MALLOC(htlc_descriptors_constr.datalen * sizeof(LDKHTLCDescriptor), "LDKCVec_HTLCDescriptorZ Elements"); - else - htlc_descriptors_constr.data = NULL; - int64_t* htlc_descriptors_vals = htlc_descriptors->elems; - for (size_t q = 0; q < htlc_descriptors_constr.datalen; q++) { - int64_t htlc_descriptors_conv_16 = htlc_descriptors_vals[q]; - LDKHTLCDescriptor htlc_descriptors_conv_16_conv; - htlc_descriptors_conv_16_conv.inner = untag_ptr(htlc_descriptors_conv_16); - htlc_descriptors_conv_16_conv.is_owned = ptr_is_owned(htlc_descriptors_conv_16); - CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_descriptors_conv_16_conv); - htlc_descriptors_conv_16_conv = HTLCDescriptor_clone(&htlc_descriptors_conv_16_conv); - htlc_descriptors_constr.data[q] = htlc_descriptors_conv_16_conv; - } - FREE(htlc_descriptors); - LDKBumpTransactionEvent *ret_copy = MALLOC(sizeof(LDKBumpTransactionEvent), "LDKBumpTransactionEvent"); - *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; +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_BumpTransactionEvent_eq(int64_t a, int64_t b) { - LDKBumpTransactionEvent* a_conv = (LDKBumpTransactionEvent*)untag_ptr(a); - LDKBumpTransactionEvent* b_conv = (LDKBumpTransactionEvent*)untag_ptr(b); - jboolean ret_conv = BumpTransactionEvent_eq(a_conv, b_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_Input_free(int64_t this_obj) { - LDKInput this_obj_conv; +void CS_LDK_RoutingFees_free(int64_t this_obj) { + LDKRoutingFees this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Input_free(this_obj_conv); + RoutingFees_free(this_obj_conv); } -int64_t CS_LDK_Input_get_outpoint(int64_t this_ptr) { - LDKInput this_ptr_conv; +int32_t CS_LDK_RoutingFees_get_base_msat(int64_t this_ptr) { + LDKRoutingFees this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKOutPoint ret_var = Input_get_outpoint(&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; + int32_t ret_conv = RoutingFees_get_base_msat(&this_ptr_conv); + return ret_conv; } -void CS_LDK_Input_set_outpoint(int64_t this_ptr, int64_t val) { - LDKInput this_ptr_conv; +void CS_LDK_RoutingFees_set_base_msat(int64_t this_ptr, int32_t val) { + LDKRoutingFees this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKOutPoint val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = OutPoint_clone(&val_conv); - Input_set_outpoint(&this_ptr_conv, val_conv); + RoutingFees_set_base_msat(&this_ptr_conv, val); } -int64_t CS_LDK_Input_get_previous_utxo(int64_t this_ptr) { - LDKInput this_ptr_conv; +int32_t CS_LDK_RoutingFees_get_proportional_millionths(int64_t this_ptr) { + LDKRoutingFees this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); - *ret_ref = Input_get_previous_utxo(&this_ptr_conv); - return tag_ptr(ret_ref, true); + int32_t ret_conv = RoutingFees_get_proportional_millionths(&this_ptr_conv); + return ret_conv; } -void CS_LDK_Input_set_previous_utxo(int64_t this_ptr, int64_t val) { - LDKInput this_ptr_conv; +void CS_LDK_RoutingFees_set_proportional_millionths(int64_t this_ptr, int32_t val) { + LDKRoutingFees this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); - val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val)); - Input_set_previous_utxo(&this_ptr_conv, val_conv); + RoutingFees_set_proportional_millionths(&this_ptr_conv, val); } -int64_t CS_LDK_Input_get_satisfaction_weight(int64_t this_ptr) { - LDKInput this_ptr_conv; +int64_t CS_LDK_RoutingFees_new(int32_t base_msat_arg, int32_t proportional_millionths_arg) { + LDKRoutingFees ret_var = RoutingFees_new(base_msat_arg, proportional_millionths_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; +} + +jboolean CS_LDK_RoutingFees_eq(int64_t a, int64_t b) { + LDKRoutingFees a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKRoutingFees b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = RoutingFees_eq(&a_conv, &b_conv); + return ret_conv; +} + +static inline uint64_t RoutingFees_clone_ptr(LDKRoutingFees *NONNULL_PTR arg) { + LDKRoutingFees ret_var = RoutingFees_clone(arg); + int64_t ret_ref = 0; + 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_RoutingFees_clone_ptr(int64_t arg) { + LDKRoutingFees arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = RoutingFees_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_RoutingFees_clone(int64_t orig) { + LDKRoutingFees orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKRoutingFees ret_var = RoutingFees_clone(&orig_conv); + int64_t ret_ref = 0; + 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_RoutingFees_hash(int64_t o) { + LDKRoutingFees o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = RoutingFees_hash(&o_conv); + return ret_conv; +} + +void CS_LDK_RouteHint_free(int64_t this_obj) { + LDKRouteHint this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + RouteHint_free(this_obj_conv); +} + +int64_tArray CS_LDK_RouteHint_get_a(int64_t this_ptr) { + LDKRouteHint this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = Input_get_satisfaction_weight(&this_ptr_conv); - return ret_conv; + LDKCVec_RouteHintHopZ ret_var = RouteHint_get_a(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t o = 0; o < ret_var.datalen; o++) { + LDKRouteHintHop ret_conv_14_var = ret_var.data[o]; + int64_t ret_conv_14_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var); + ret_conv_14_ref = tag_ptr(ret_conv_14_var.inner, ret_conv_14_var.is_owned); + ret_arr_ptr[o] = ret_conv_14_ref; + } + + FREE(ret_var.data); + return ret_arr; } -void CS_LDK_Input_set_satisfaction_weight(int64_t this_ptr, int64_t val) { - LDKInput this_ptr_conv; +void CS_LDK_RouteHint_set_a(int64_t this_ptr, int64_tArray val) { + LDKRouteHint this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - Input_set_satisfaction_weight(&this_ptr_conv, val); + LDKCVec_RouteHintHopZ val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = val->elems; + for (size_t o = 0; o < val_constr.datalen; o++) { + int64_t val_conv_14 = val_vals[o]; + LDKRouteHintHop val_conv_14_conv; + val_conv_14_conv.inner = untag_ptr(val_conv_14); + val_conv_14_conv.is_owned = ptr_is_owned(val_conv_14); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_14_conv); + val_conv_14_conv = RouteHintHop_clone(&val_conv_14_conv); + val_constr.data[o] = val_conv_14_conv; + } + FREE(val); + RouteHint_set_a(&this_ptr_conv, val_constr); } -int64_t CS_LDK_Input_new(int64_t outpoint_arg, int64_t previous_utxo_arg, int64_t satisfaction_weight_arg) { - LDKOutPoint outpoint_arg_conv; - outpoint_arg_conv.inner = untag_ptr(outpoint_arg); - outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); - outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); - void* previous_utxo_arg_ptr = untag_ptr(previous_utxo_arg); - CHECK_ACCESS(previous_utxo_arg_ptr); - LDKTxOut previous_utxo_arg_conv = *(LDKTxOut*)(previous_utxo_arg_ptr); - previous_utxo_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(previous_utxo_arg)); - LDKInput ret_var = Input_new(outpoint_arg_conv, previous_utxo_arg_conv, satisfaction_weight_arg); +int64_t CS_LDK_RouteHint_new(int64_tArray a_arg) { + LDKCVec_RouteHintHopZ a_arg_constr; + a_arg_constr.datalen = a_arg->arr_len; + if (a_arg_constr.datalen > 0) + a_arg_constr.data = MALLOC(a_arg_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements"); + else + a_arg_constr.data = NULL; + int64_t* a_arg_vals = a_arg->elems; + for (size_t o = 0; o < a_arg_constr.datalen; o++) { + int64_t a_arg_conv_14 = a_arg_vals[o]; + LDKRouteHintHop a_arg_conv_14_conv; + a_arg_conv_14_conv.inner = untag_ptr(a_arg_conv_14); + a_arg_conv_14_conv.is_owned = ptr_is_owned(a_arg_conv_14); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_arg_conv_14_conv); + a_arg_conv_14_conv = RouteHintHop_clone(&a_arg_conv_14_conv); + a_arg_constr.data[o] = a_arg_conv_14_conv; + } + FREE(a_arg); + LDKRouteHint ret_var = RouteHint_new(a_arg_constr); int64_t ret_ref = 0; 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 Input_clone_ptr(LDKInput *NONNULL_PTR arg) { - LDKInput ret_var = Input_clone(arg); +static inline uint64_t RouteHint_clone_ptr(LDKRouteHint *NONNULL_PTR arg) { + LDKRouteHint ret_var = RouteHint_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_Input_clone_ptr(int64_t arg) { - LDKInput arg_conv; +int64_t CS_LDK_RouteHint_clone_ptr(int64_t arg) { + LDKRouteHint arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Input_clone_ptr(&arg_conv); + int64_t ret_conv = RouteHint_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_Input_clone(int64_t orig) { - LDKInput orig_conv; +int64_t CS_LDK_RouteHint_clone(int64_t orig) { + LDKRouteHint orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKInput ret_var = Input_clone(&orig_conv); + LDKRouteHint ret_var = RouteHint_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_Input_hash(int64_t o) { - LDKInput o_conv; +int64_t CS_LDK_RouteHint_hash(int64_t o) { + LDKRouteHint o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv.is_owned = false; - int64_t ret_conv = Input_hash(&o_conv); + int64_t ret_conv = RouteHint_hash(&o_conv); return ret_conv; } -jboolean CS_LDK_Input_eq(int64_t a, int64_t b) { - LDKInput a_conv; +jboolean CS_LDK_RouteHint_eq(int64_t a, int64_t b) { + LDKRouteHint a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKInput b_conv; + LDKRouteHint b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = Input_eq(&a_conv, &b_conv); + jboolean ret_conv = RouteHint_eq(&a_conv, &b_conv); return ret_conv; } -void CS_LDK_Utxo_free(int64_t this_obj) { - LDKUtxo this_obj_conv; +void CS_LDK_RouteHintHop_free(int64_t this_obj) { + LDKRouteHintHop this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Utxo_free(this_obj_conv); + RouteHintHop_free(this_obj_conv); } -int64_t CS_LDK_Utxo_get_outpoint(int64_t this_ptr) { - LDKUtxo this_ptr_conv; +int8_tArray CS_LDK_RouteHintHop_get_src_node_id(int64_t this_ptr) { + LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKOutPoint ret_var = Utxo_get_outpoint(&this_ptr_conv); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, RouteHintHop_get_src_node_id(&this_ptr_conv).compressed_form, 33); + return ret_arr; +} + +void CS_LDK_RouteHintHop_set_src_node_id(int64_t this_ptr, int8_tArray val) { + LDKRouteHintHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + RouteHintHop_set_src_node_id(&this_ptr_conv, val_ref); +} + +int64_t CS_LDK_RouteHintHop_get_short_channel_id(int64_t this_ptr) { + LDKRouteHintHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = RouteHintHop_get_short_channel_id(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_RouteHintHop_set_short_channel_id(int64_t this_ptr, int64_t val) { + LDKRouteHintHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + RouteHintHop_set_short_channel_id(&this_ptr_conv, val); +} + +int64_t CS_LDK_RouteHintHop_get_fees(int64_t this_ptr) { + LDKRouteHintHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKRoutingFees ret_var = RouteHintHop_get_fees(&this_ptr_conv); int64_t ret_ref = 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_Utxo_set_outpoint(int64_t this_ptr, int64_t val) { - LDKUtxo this_ptr_conv; +void CS_LDK_RouteHintHop_set_fees(int64_t this_ptr, int64_t val) { + LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKOutPoint val_conv; + LDKRoutingFees val_conv; val_conv.inner = untag_ptr(val); val_conv.is_owned = ptr_is_owned(val); CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = OutPoint_clone(&val_conv); - Utxo_set_outpoint(&this_ptr_conv, val_conv); + val_conv = RoutingFees_clone(&val_conv); + RouteHintHop_set_fees(&this_ptr_conv, val_conv); } -int64_t CS_LDK_Utxo_get_output(int64_t this_ptr) { - LDKUtxo this_ptr_conv; +int16_t CS_LDK_RouteHintHop_get_cltv_expiry_delta(int64_t this_ptr) { + LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); - *ret_ref = Utxo_get_output(&this_ptr_conv); - return tag_ptr(ret_ref, true); + int16_t ret_conv = RouteHintHop_get_cltv_expiry_delta(&this_ptr_conv); + return ret_conv; } -void CS_LDK_Utxo_set_output(int64_t this_ptr, int64_t val) { - LDKUtxo this_ptr_conv; +void CS_LDK_RouteHintHop_set_cltv_expiry_delta(int64_t this_ptr, int16_t val) { + LDKRouteHintHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + RouteHintHop_set_cltv_expiry_delta(&this_ptr_conv, val); +} + +int64_t CS_LDK_RouteHintHop_get_htlc_minimum_msat(int64_t this_ptr) { + LDKRouteHintHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = RouteHintHop_get_htlc_minimum_msat(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_RouteHintHop_set_htlc_minimum_msat(int64_t this_ptr, int64_t val) { + LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; void* val_ptr = untag_ptr(val); CHECK_ACCESS(val_ptr); - LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); - val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val)); - Utxo_set_output(&this_ptr_conv, val_conv); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + RouteHintHop_set_htlc_minimum_msat(&this_ptr_conv, val_conv); } -int64_t CS_LDK_Utxo_get_satisfaction_weight(int64_t this_ptr) { - LDKUtxo this_ptr_conv; +int64_t CS_LDK_RouteHintHop_get_htlc_maximum_msat(int64_t this_ptr) { + LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = Utxo_get_satisfaction_weight(&this_ptr_conv); - return ret_conv; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = RouteHintHop_get_htlc_maximum_msat(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_Utxo_set_satisfaction_weight(int64_t this_ptr, int64_t val) { - LDKUtxo this_ptr_conv; +void CS_LDK_RouteHintHop_set_htlc_maximum_msat(int64_t this_ptr, int64_t val) { + LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - Utxo_set_satisfaction_weight(&this_ptr_conv, val); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + RouteHintHop_set_htlc_maximum_msat(&this_ptr_conv, val_conv); } -int64_t CS_LDK_Utxo_new(int64_t outpoint_arg, int64_t output_arg, int64_t satisfaction_weight_arg) { - LDKOutPoint outpoint_arg_conv; - outpoint_arg_conv.inner = untag_ptr(outpoint_arg); - outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); - outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); - void* output_arg_ptr = untag_ptr(output_arg); - CHECK_ACCESS(output_arg_ptr); - LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr); - output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg)); - LDKUtxo ret_var = Utxo_new(outpoint_arg_conv, output_arg_conv, satisfaction_weight_arg); +int64_t CS_LDK_RouteHintHop_new(int8_tArray src_node_id_arg, int64_t short_channel_id_arg, int64_t fees_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg) { + LDKPublicKey src_node_id_arg_ref; + CHECK(src_node_id_arg->arr_len == 33); + memcpy(src_node_id_arg_ref.compressed_form, src_node_id_arg->elems, 33); FREE(src_node_id_arg); + LDKRoutingFees fees_arg_conv; + fees_arg_conv.inner = untag_ptr(fees_arg); + fees_arg_conv.is_owned = ptr_is_owned(fees_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv); + fees_arg_conv = RoutingFees_clone(&fees_arg_conv); + void* htlc_minimum_msat_arg_ptr = untag_ptr(htlc_minimum_msat_arg); + CHECK_ACCESS(htlc_minimum_msat_arg_ptr); + LDKCOption_u64Z htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_minimum_msat_arg_ptr); + htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_minimum_msat_arg)); + void* htlc_maximum_msat_arg_ptr = untag_ptr(htlc_maximum_msat_arg); + CHECK_ACCESS(htlc_maximum_msat_arg_ptr); + LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_arg_ptr); + htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_maximum_msat_arg)); + LDKRouteHintHop ret_var = RouteHintHop_new(src_node_id_arg_ref, short_channel_id_arg, fees_arg_conv, cltv_expiry_delta_arg, htlc_minimum_msat_arg_conv, htlc_maximum_msat_arg_conv); int64_t ret_ref = 0; 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 Utxo_clone_ptr(LDKUtxo *NONNULL_PTR arg) { - LDKUtxo ret_var = Utxo_clone(arg); +static inline uint64_t RouteHintHop_clone_ptr(LDKRouteHintHop *NONNULL_PTR arg) { + LDKRouteHintHop ret_var = RouteHintHop_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_Utxo_clone_ptr(int64_t arg) { - LDKUtxo arg_conv; +int64_t CS_LDK_RouteHintHop_clone_ptr(int64_t arg) { + LDKRouteHintHop arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Utxo_clone_ptr(&arg_conv); + int64_t ret_conv = RouteHintHop_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_Utxo_clone(int64_t orig) { - LDKUtxo orig_conv; +int64_t CS_LDK_RouteHintHop_clone(int64_t orig) { + LDKRouteHintHop orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKUtxo ret_var = Utxo_clone(&orig_conv); + LDKRouteHintHop ret_var = RouteHintHop_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_Utxo_hash(int64_t o) { - LDKUtxo o_conv; +int64_t CS_LDK_RouteHintHop_hash(int64_t o) { + LDKRouteHintHop o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv.is_owned = false; - int64_t ret_conv = Utxo_hash(&o_conv); + int64_t ret_conv = RouteHintHop_hash(&o_conv); return ret_conv; } -jboolean CS_LDK_Utxo_eq(int64_t a, int64_t b) { - LDKUtxo a_conv; +jboolean CS_LDK_RouteHintHop_eq(int64_t a, int64_t b) { + LDKRouteHintHop a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKUtxo b_conv; + LDKRouteHintHop b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = Utxo_eq(&a_conv, &b_conv); + jboolean ret_conv = RouteHintHop_eq(&a_conv, &b_conv); return ret_conv; } -int64_t CS_LDK_Utxo_new_p2pkh(int64_t outpoint, int64_t value, int8_tArray pubkey_hash) { - 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); - 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; - LDKUtxo ret_var = Utxo_new_p2pkh(outpoint_conv, value, pubkey_hash_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; -} - -void CS_LDK_CoinSelection_free(int64_t this_obj) { - LDKCoinSelection this_obj_conv; +void CS_LDK_UntrustedString_free(int64_t this_obj) { + LDKUntrustedString this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - CoinSelection_free(this_obj_conv); -} - -int64_tArray CS_LDK_CoinSelection_get_confirmed_utxos(int64_t this_ptr) { - LDKCoinSelection this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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_UtxoZ ret_var = CoinSelection_get_confirmed_utxos(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t g = 0; g < ret_var.datalen; g++) { - LDKUtxo ret_conv_6_var = ret_var.data[g]; - int64_t ret_conv_6_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_6_var); - ret_conv_6_ref = tag_ptr(ret_conv_6_var.inner, ret_conv_6_var.is_owned); - ret_arr_ptr[g] = ret_conv_6_ref; - } - - FREE(ret_var.data); - return ret_arr; -} - -void CS_LDK_CoinSelection_set_confirmed_utxos(int64_t this_ptr, int64_tArray val) { - LDKCoinSelection this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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_UtxoZ val_constr; - val_constr.datalen = val->arr_len; - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUtxo), "LDKCVec_UtxoZ Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = val->elems; - for (size_t g = 0; g < val_constr.datalen; g++) { - int64_t val_conv_6 = val_vals[g]; - LDKUtxo val_conv_6_conv; - val_conv_6_conv.inner = untag_ptr(val_conv_6); - val_conv_6_conv.is_owned = ptr_is_owned(val_conv_6); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_6_conv); - val_conv_6_conv = Utxo_clone(&val_conv_6_conv); - val_constr.data[g] = val_conv_6_conv; - } - FREE(val); - CoinSelection_set_confirmed_utxos(&this_ptr_conv, val_constr); + UntrustedString_free(this_obj_conv); } -int64_t CS_LDK_CoinSelection_get_change_output(int64_t this_ptr) { - LDKCoinSelection this_ptr_conv; +jstring CS_LDK_UntrustedString_get_a(int64_t this_ptr) { + LDKUntrustedString this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_TxOutZ *ret_copy = MALLOC(sizeof(LDKCOption_TxOutZ), "LDKCOption_TxOutZ"); - *ret_copy = CoinSelection_get_change_output(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKStr ret_str = UntrustedString_get_a(&this_ptr_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; } -void CS_LDK_CoinSelection_set_change_output(int64_t this_ptr, int64_t val) { - LDKCoinSelection this_ptr_conv; +void CS_LDK_UntrustedString_set_a(int64_t this_ptr, jstring val) { + LDKUntrustedString this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_TxOutZ val_conv = *(LDKCOption_TxOutZ*)(val_ptr); - val_conv = COption_TxOutZ_clone((LDKCOption_TxOutZ*)untag_ptr(val)); - CoinSelection_set_change_output(&this_ptr_conv, val_conv); + LDKStr val_conv = str_ref_to_owned_c(val); + UntrustedString_set_a(&this_ptr_conv, val_conv); } -int64_t CS_LDK_CoinSelection_new(int64_tArray confirmed_utxos_arg, int64_t change_output_arg) { - LDKCVec_UtxoZ confirmed_utxos_arg_constr; - confirmed_utxos_arg_constr.datalen = confirmed_utxos_arg->arr_len; - if (confirmed_utxos_arg_constr.datalen > 0) - confirmed_utxos_arg_constr.data = MALLOC(confirmed_utxos_arg_constr.datalen * sizeof(LDKUtxo), "LDKCVec_UtxoZ Elements"); - else - confirmed_utxos_arg_constr.data = NULL; - int64_t* confirmed_utxos_arg_vals = confirmed_utxos_arg->elems; - for (size_t g = 0; g < confirmed_utxos_arg_constr.datalen; g++) { - int64_t confirmed_utxos_arg_conv_6 = confirmed_utxos_arg_vals[g]; - LDKUtxo confirmed_utxos_arg_conv_6_conv; - confirmed_utxos_arg_conv_6_conv.inner = untag_ptr(confirmed_utxos_arg_conv_6); - confirmed_utxos_arg_conv_6_conv.is_owned = ptr_is_owned(confirmed_utxos_arg_conv_6); - CHECK_INNER_FIELD_ACCESS_OR_NULL(confirmed_utxos_arg_conv_6_conv); - confirmed_utxos_arg_conv_6_conv = Utxo_clone(&confirmed_utxos_arg_conv_6_conv); - confirmed_utxos_arg_constr.data[g] = confirmed_utxos_arg_conv_6_conv; - } - FREE(confirmed_utxos_arg); - void* change_output_arg_ptr = untag_ptr(change_output_arg); - CHECK_ACCESS(change_output_arg_ptr); - LDKCOption_TxOutZ change_output_arg_conv = *(LDKCOption_TxOutZ*)(change_output_arg_ptr); - change_output_arg_conv = COption_TxOutZ_clone((LDKCOption_TxOutZ*)untag_ptr(change_output_arg)); - LDKCoinSelection ret_var = CoinSelection_new(confirmed_utxos_arg_constr, change_output_arg_conv); +int64_t CS_LDK_UntrustedString_new(jstring a_arg) { + LDKStr a_arg_conv = str_ref_to_owned_c(a_arg); + LDKUntrustedString ret_var = UntrustedString_new(a_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 CoinSelection_clone_ptr(LDKCoinSelection *NONNULL_PTR arg) { - LDKCoinSelection ret_var = CoinSelection_clone(arg); +static inline uint64_t UntrustedString_clone_ptr(LDKUntrustedString *NONNULL_PTR arg) { + LDKUntrustedString ret_var = UntrustedString_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_CoinSelection_clone_ptr(int64_t arg) { - LDKCoinSelection arg_conv; +int64_t CS_LDK_UntrustedString_clone_ptr(int64_t arg) { + LDKUntrustedString arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = CoinSelection_clone_ptr(&arg_conv); + int64_t ret_conv = UntrustedString_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_CoinSelection_clone(int64_t orig) { - LDKCoinSelection orig_conv; +int64_t CS_LDK_UntrustedString_clone(int64_t orig) { + LDKUntrustedString orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKCoinSelection ret_var = CoinSelection_clone(&orig_conv); + LDKUntrustedString ret_var = UntrustedString_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_CoinSelectionSource_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); - LDKCoinSelectionSource this_ptr_conv = *(LDKCoinSelectionSource*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - CoinSelectionSource_free(this_ptr_conv); +jboolean CS_LDK_UntrustedString_eq(int64_t a, int64_t b) { + LDKUntrustedString a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKUntrustedString b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = UntrustedString_eq(&a_conv, &b_conv); + return ret_conv; } -void CS_LDK_WalletSource_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); - LDKWalletSource this_ptr_conv = *(LDKWalletSource*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - WalletSource_free(this_ptr_conv); +int64_t CS_LDK_UntrustedString_hash(int64_t o) { + LDKUntrustedString o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = UntrustedString_hash(&o_conv); + return ret_conv; } -void CS_LDK_Wallet_free(int64_t this_obj) { - LDKWallet this_obj_conv; +jstring CS_LDK_UntrustedString_to_str(int64_t o) { + LDKUntrustedString o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = UntrustedString_to_str(&o_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +void CS_LDK_PrintableString_free(int64_t this_obj) { + LDKPrintableString this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Wallet_free(this_obj_conv); -} - -int64_t CS_LDK_Wallet_new(int64_t source, int64_t logger) { - void* source_ptr = untag_ptr(source); - CHECK_ACCESS(source_ptr); - LDKWalletSource source_conv = *(LDKWalletSource*)(source_ptr); - if (source_conv.free == LDKWalletSource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKWalletSource_JCalls_cloned(&source_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); - } - LDKWallet ret_var = Wallet_new(source_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; + PrintableString_free(this_obj_conv); } -int64_t CS_LDK_Wallet_as_CoinSelectionSource(int64_t this_arg) { - LDKWallet this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCoinSelectionSource* ret_ret = MALLOC(sizeof(LDKCoinSelectionSource), "LDKCoinSelectionSource"); - *ret_ret = Wallet_as_CoinSelectionSource(&this_arg_conv); - return tag_ptr(ret_ret, true); +jstring CS_LDK_PrintableString_get_a(int64_t this_ptr) { + LDKPrintableString this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKStr ret_str = PrintableString_get_a(&this_ptr_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; } -void CS_LDK_BumpTransactionEventHandler_free(int64_t this_obj) { - LDKBumpTransactionEventHandler this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BumpTransactionEventHandler_free(this_obj_conv); +void CS_LDK_PrintableString_set_a(int64_t this_ptr, jstring val) { + LDKPrintableString this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKStr val_conv = str_ref_to_owned_c(val); + PrintableString_set_a(&this_ptr_conv, val_conv); } -int64_t CS_LDK_BumpTransactionEventHandler_new(int64_t broadcaster, int64_t utxo_source, int64_t signer_provider, int64_t logger) { - 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* utxo_source_ptr = untag_ptr(utxo_source); - CHECK_ACCESS(utxo_source_ptr); - LDKCoinSelectionSource utxo_source_conv = *(LDKCoinSelectionSource*)(utxo_source_ptr); - if (utxo_source_conv.free == LDKCoinSelectionSource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKCoinSelectionSource_JCalls_cloned(&utxo_source_conv); - } - void* signer_provider_ptr = untag_ptr(signer_provider); - CHECK_ACCESS(signer_provider_ptr); - LDKSignerProvider signer_provider_conv = *(LDKSignerProvider*)(signer_provider_ptr); - if (signer_provider_conv.free == LDKSignerProvider_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKSignerProvider_JCalls_cloned(&signer_provider_conv); - } - void* 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); - } - LDKBumpTransactionEventHandler ret_var = BumpTransactionEventHandler_new(broadcaster_conv, utxo_source_conv, signer_provider_conv, logger_conv); +int64_t CS_LDK_PrintableString_new(jstring a_arg) { + LDKStr a_arg_conv = str_ref_to_owned_c(a_arg); + LDKPrintableString ret_var = PrintableString_new(a_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_BumpTransactionEventHandler_handle_event(int64_t this_arg, int64_t event) { - LDKBumpTransactionEventHandler this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKBumpTransactionEvent* event_conv = (LDKBumpTransactionEvent*)untag_ptr(event); - BumpTransactionEventHandler_handle_event(&this_arg_conv, event_conv); +jstring CS_LDK_PrintableString_to_str(int64_t o) { + LDKPrintableString o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = PrintableString_to_str(&o_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; } void CS_LDK_FilesystemStore_free(int64_t this_obj) { @@ -83050,7 +88298,7 @@ int64_t CS_LDK_GossipSync_none() { return ret_ref; } -int64_t CS_LDK_BackgroundProcessor_start(int64_t persister, int64_t event_handler, int64_t chain_monitor, int64_t channel_manager, int64_t gossip_sync, int64_t peer_manager, int64_t logger, int64_t scorer) { +int64_t CS_LDK_BackgroundProcessor_start(int64_t persister, int64_t event_handler, int64_t chain_monitor, int64_t channel_manager, int64_t onion_messenger, int64_t gossip_sync, int64_t peer_manager, int64_t logger, int64_t scorer) { void* persister_ptr = untag_ptr(persister); CHECK_ACCESS(persister_ptr); LDKPersister persister_conv = *(LDKPersister*)(persister_ptr); @@ -83075,6 +88323,11 @@ int64_t CS_LDK_BackgroundProcessor_start(int64_t persister, int64_t event_handl 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; + LDKOnionMessenger onion_messenger_conv; + onion_messenger_conv.inner = untag_ptr(onion_messenger); + onion_messenger_conv.is_owned = ptr_is_owned(onion_messenger); + CHECK_INNER_FIELD_ACCESS_OR_NULL(onion_messenger_conv); + onion_messenger_conv.is_owned = false; void* gossip_sync_ptr = untag_ptr(gossip_sync); CHECK_ACCESS(gossip_sync_ptr); LDKGossipSync gossip_sync_conv = *(LDKGossipSync*)(gossip_sync_ptr); @@ -83102,7 +88355,7 @@ int64_t CS_LDK_BackgroundProcessor_start(int64_t persister, int64_t event_handl LDKWriteableScore_JCalls_cloned(&scorer_conv.some); } } - LDKBackgroundProcessor ret_var = BackgroundProcessor_start(persister_conv, event_handler_conv, &chain_monitor_conv, &channel_manager_conv, gossip_sync_conv, &peer_manager_conv, logger_conv, scorer_conv); + LDKBackgroundProcessor ret_var = BackgroundProcessor_start(persister_conv, event_handler_conv, &chain_monitor_conv, &channel_manager_conv, &onion_messenger_conv, gossip_sync_conv, &peer_manager_conv, logger_conv, scorer_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -84286,6 +89539,40 @@ void CS_LDK_Bolt11InvoiceSignature_free(int64_t this_obj) { Bolt11InvoiceSignature_free(this_obj_conv); } +int8_tArray CS_LDK_Bolt11InvoiceSignature_get_a(int64_t this_ptr) { + LDKBolt11InvoiceSignature this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(68, __LINE__); + memcpy(ret_arr->elems, Bolt11InvoiceSignature_get_a(&this_ptr_conv).serialized_form, 68); + return ret_arr; +} + +void CS_LDK_Bolt11InvoiceSignature_set_a(int64_t this_ptr, int8_tArray val) { + LDKBolt11InvoiceSignature this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKRecoverableSignature val_ref; + CHECK(val->arr_len == 68); + memcpy(val_ref.serialized_form, val->elems, 68); FREE(val); + Bolt11InvoiceSignature_set_a(&this_ptr_conv, val_ref); +} + +int64_t CS_LDK_Bolt11InvoiceSignature_new(int8_tArray a_arg) { + LDKRecoverableSignature a_arg_ref; + CHECK(a_arg->arr_len == 68); + memcpy(a_arg_ref.serialized_form, a_arg->elems, 68); FREE(a_arg); + LDKBolt11InvoiceSignature ret_var = Bolt11InvoiceSignature_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 Bolt11InvoiceSignature_clone_ptr(LDKBolt11InvoiceSignature *NONNULL_PTR arg) { LDKBolt11InvoiceSignature ret_var = Bolt11InvoiceSignature_clone(arg); int64_t ret_ref = 0; @@ -85016,6 +90303,19 @@ int64_t CS_LDK_Description_into_inner(int64_t this_arg) { return ret_ref; } +int64_t CS_LDK_Description_as_inner(int64_t this_arg) { + LDKDescription this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKUntrustedString ret_var = Description_as_inner(&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; +} + jstring CS_LDK_Description_to_str(int64_t o) { LDKDescription o_conv; o_conv.inner = untag_ptr(o); @@ -85269,334 +90569,6 @@ jstring CS_LDK_SignOrCreationError_to_str(int64_t o) { return ret_conv; } -int64_t CS_LDK_payment_parameters_from_zero_amount_invoice(int64_t invoice, int64_t amount_msat) { - LDKBolt11Invoice invoice_conv; - invoice_conv.inner = untag_ptr(invoice); - invoice_conv.is_owned = ptr_is_owned(invoice); - CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); - invoice_conv.is_owned = false; - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); - *ret_conv = payment_parameters_from_zero_amount_invoice(&invoice_conv, amount_msat); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_payment_parameters_from_invoice(int64_t invoice) { - LDKBolt11Invoice invoice_conv; - invoice_conv.inner = untag_ptr(invoice); - invoice_conv.is_owned = ptr_is_owned(invoice); - CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); - invoice_conv.is_owned = false; - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); - *ret_conv = payment_parameters_from_invoice(&invoice_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_create_phantom_invoice(int64_t amt_msat, int64_t payment_hash, jstring description, int32_t invoice_expiry_delta_secs, int64_tArray phantom_route_hints, int64_t entropy_source, int64_t node_signer, int64_t logger, int32_t network, int64_t min_final_cltv_expiry_delta, int64_t duration_since_epoch) { - void* amt_msat_ptr = untag_ptr(amt_msat); - CHECK_ACCESS(amt_msat_ptr); - LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); - amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); - void* payment_hash_ptr = untag_ptr(payment_hash); - CHECK_ACCESS(payment_hash_ptr); - LDKCOption_ThirtyTwoBytesZ payment_hash_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_ptr); - payment_hash_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash)); - LDKStr description_conv = str_ref_to_owned_c(description); - LDKCVec_PhantomRouteHintsZ phantom_route_hints_constr; - phantom_route_hints_constr.datalen = phantom_route_hints->arr_len; - if (phantom_route_hints_constr.datalen > 0) - phantom_route_hints_constr.data = MALLOC(phantom_route_hints_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements"); - else - phantom_route_hints_constr.data = NULL; - int64_t* phantom_route_hints_vals = phantom_route_hints->elems; - for (size_t t = 0; t < phantom_route_hints_constr.datalen; t++) { - int64_t phantom_route_hints_conv_19 = phantom_route_hints_vals[t]; - LDKPhantomRouteHints phantom_route_hints_conv_19_conv; - phantom_route_hints_conv_19_conv.inner = untag_ptr(phantom_route_hints_conv_19); - phantom_route_hints_conv_19_conv.is_owned = ptr_is_owned(phantom_route_hints_conv_19); - CHECK_INNER_FIELD_ACCESS_OR_NULL(phantom_route_hints_conv_19_conv); - phantom_route_hints_conv_19_conv = PhantomRouteHints_clone(&phantom_route_hints_conv_19_conv); - phantom_route_hints_constr.data[t] = phantom_route_hints_conv_19_conv; - } - FREE(phantom_route_hints); - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKCurrency network_conv = LDKCurrency_from_cs(network); - void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); - CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); - LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); - min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = create_phantom_invoice(amt_msat_conv, payment_hash_conv, description_conv, invoice_expiry_delta_secs, phantom_route_hints_constr, entropy_source_conv, node_signer_conv, logger_conv, network_conv, min_final_cltv_expiry_delta_conv, duration_since_epoch); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_create_phantom_invoice_with_description_hash(int64_t amt_msat, int64_t payment_hash, int32_t invoice_expiry_delta_secs, int64_t description_hash, int64_tArray phantom_route_hints, int64_t entropy_source, int64_t node_signer, int64_t logger, int32_t network, int64_t min_final_cltv_expiry_delta, int64_t duration_since_epoch) { - void* amt_msat_ptr = untag_ptr(amt_msat); - CHECK_ACCESS(amt_msat_ptr); - LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); - amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); - void* payment_hash_ptr = untag_ptr(payment_hash); - CHECK_ACCESS(payment_hash_ptr); - LDKCOption_ThirtyTwoBytesZ payment_hash_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_ptr); - payment_hash_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash)); - LDKSha256 description_hash_conv; - description_hash_conv.inner = untag_ptr(description_hash); - description_hash_conv.is_owned = ptr_is_owned(description_hash); - CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv); - description_hash_conv = Sha256_clone(&description_hash_conv); - LDKCVec_PhantomRouteHintsZ phantom_route_hints_constr; - phantom_route_hints_constr.datalen = phantom_route_hints->arr_len; - if (phantom_route_hints_constr.datalen > 0) - phantom_route_hints_constr.data = MALLOC(phantom_route_hints_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements"); - else - phantom_route_hints_constr.data = NULL; - int64_t* phantom_route_hints_vals = phantom_route_hints->elems; - for (size_t t = 0; t < phantom_route_hints_constr.datalen; t++) { - int64_t phantom_route_hints_conv_19 = phantom_route_hints_vals[t]; - LDKPhantomRouteHints phantom_route_hints_conv_19_conv; - phantom_route_hints_conv_19_conv.inner = untag_ptr(phantom_route_hints_conv_19); - phantom_route_hints_conv_19_conv.is_owned = ptr_is_owned(phantom_route_hints_conv_19); - CHECK_INNER_FIELD_ACCESS_OR_NULL(phantom_route_hints_conv_19_conv); - phantom_route_hints_conv_19_conv = PhantomRouteHints_clone(&phantom_route_hints_conv_19_conv); - phantom_route_hints_constr.data[t] = phantom_route_hints_conv_19_conv; - } - FREE(phantom_route_hints); - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKCurrency network_conv = LDKCurrency_from_cs(network); - void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); - CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); - LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); - min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = create_phantom_invoice_with_description_hash(amt_msat_conv, payment_hash_conv, invoice_expiry_delta_secs, description_hash_conv, phantom_route_hints_constr, entropy_source_conv, node_signer_conv, logger_conv, network_conv, min_final_cltv_expiry_delta_conv, duration_since_epoch); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_create_invoice_from_channelmanager(int64_t channelmanager, int64_t node_signer, int64_t logger, int32_t network, int64_t amt_msat, jstring description, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { - LDKChannelManager channelmanager_conv; - channelmanager_conv.inner = untag_ptr(channelmanager); - channelmanager_conv.is_owned = ptr_is_owned(channelmanager); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); - channelmanager_conv.is_owned = false; - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKCurrency network_conv = LDKCurrency_from_cs(network); - void* amt_msat_ptr = untag_ptr(amt_msat); - CHECK_ACCESS(amt_msat_ptr); - LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); - amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); - LDKStr description_conv = str_ref_to_owned_c(description); - void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); - CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); - LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); - min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = create_invoice_from_channelmanager(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_conv, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_create_invoice_from_channelmanager_with_description_hash(int64_t channelmanager, int64_t node_signer, int64_t logger, int32_t network, int64_t amt_msat, int64_t description_hash, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { - LDKChannelManager channelmanager_conv; - channelmanager_conv.inner = untag_ptr(channelmanager); - channelmanager_conv.is_owned = ptr_is_owned(channelmanager); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); - channelmanager_conv.is_owned = false; - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKCurrency network_conv = LDKCurrency_from_cs(network); - void* amt_msat_ptr = untag_ptr(amt_msat); - CHECK_ACCESS(amt_msat_ptr); - LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); - amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); - LDKSha256 description_hash_conv; - description_hash_conv.inner = untag_ptr(description_hash); - description_hash_conv.is_owned = ptr_is_owned(description_hash); - CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv); - description_hash_conv = Sha256_clone(&description_hash_conv); - void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); - CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); - LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); - min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = create_invoice_from_channelmanager_with_description_hash(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_hash_conv, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(int64_t channelmanager, int64_t node_signer, int64_t logger, int32_t network, int64_t amt_msat, int64_t description_hash, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { - LDKChannelManager channelmanager_conv; - channelmanager_conv.inner = untag_ptr(channelmanager); - channelmanager_conv.is_owned = ptr_is_owned(channelmanager); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); - channelmanager_conv.is_owned = false; - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKCurrency network_conv = LDKCurrency_from_cs(network); - void* amt_msat_ptr = untag_ptr(amt_msat); - CHECK_ACCESS(amt_msat_ptr); - LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); - amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); - LDKSha256 description_hash_conv; - description_hash_conv.inner = untag_ptr(description_hash); - description_hash_conv.is_owned = ptr_is_owned(description_hash); - CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv); - description_hash_conv = Sha256_clone(&description_hash_conv); - void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); - CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); - LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); - min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_hash_conv, duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_create_invoice_from_channelmanager_and_duration_since_epoch(int64_t channelmanager, int64_t node_signer, int64_t logger, int32_t network, int64_t amt_msat, jstring description, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { - LDKChannelManager channelmanager_conv; - channelmanager_conv.inner = untag_ptr(channelmanager); - channelmanager_conv.is_owned = ptr_is_owned(channelmanager); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); - channelmanager_conv.is_owned = false; - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKCurrency network_conv = LDKCurrency_from_cs(network); - void* amt_msat_ptr = untag_ptr(amt_msat); - CHECK_ACCESS(amt_msat_ptr); - LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); - amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); - LDKStr description_conv = str_ref_to_owned_c(description); - void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); - CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); - LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); - min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = create_invoice_from_channelmanager_and_duration_since_epoch(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_conv, duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(int64_t channelmanager, int64_t node_signer, int64_t logger, int32_t network, int64_t amt_msat, jstring description, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs, int8_tArray payment_hash, int64_t min_final_cltv_expiry_delta) { - LDKChannelManager channelmanager_conv; - channelmanager_conv.inner = untag_ptr(channelmanager); - channelmanager_conv.is_owned = ptr_is_owned(channelmanager); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); - channelmanager_conv.is_owned = false; - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKCurrency network_conv = LDKCurrency_from_cs(network); - void* amt_msat_ptr = untag_ptr(amt_msat); - CHECK_ACCESS(amt_msat_ptr); - LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); - amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); - LDKStr description_conv = str_ref_to_owned_c(description); - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); - CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); - LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); - min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_conv, duration_since_epoch, invoice_expiry_delta_secs, payment_hash_ref, min_final_cltv_expiry_delta_conv); - return tag_ptr(ret_conv, true); -} - int64_t CS_LDK_SiPrefix_from_str(jstring s) { LDKStr s_conv = str_ref_to_owned_c(s); LDKCResult_SiPrefixBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixBolt11ParseErrorZ), "LDKCResult_SiPrefixBolt11ParseErrorZ"); diff --git a/c_sharp/src/org/ldk/enums/BalanceSource.cs b/c_sharp/src/org/ldk/enums/BalanceSource.cs new file mode 100644 index 00000000..8e819e93 --- /dev/null +++ b/c_sharp/src/org/ldk/enums/BalanceSource.cs @@ -0,0 +1,22 @@ +namespace org { namespace ldk { namespace enums {/** + * Indicates whether the balance is derived from a cooperative close, a force-close + * (for holder or counterparty), or whether it is for an HTLC. + */ +public enum BalanceSource { + /** + * The channel was force closed by the holder. + */ + LDKBalanceSource_HolderForceClosed, + /** + * The channel was force closed by the counterparty. + */ + LDKBalanceSource_CounterpartyForceClosed, + /** + * The channel was cooperatively closed. + */ + LDKBalanceSource_CoopClose, + /** + * This balance is the result of an HTLC. + */ + LDKBalanceSource_Htlc, +}} } } diff --git a/c_sharp/src/org/ldk/enums/Bolt12SemanticError.cs b/c_sharp/src/org/ldk/enums/Bolt12SemanticError.cs index 5d26fe2f..941e527e 100644 --- a/c_sharp/src/org/ldk/enums/Bolt12SemanticError.cs +++ b/c_sharp/src/org/ldk/enums/Bolt12SemanticError.cs @@ -110,6 +110,10 @@ public enum Bolt12SemanticError { * An invoice payment hash was expected but was missing. */ LDKBolt12SemanticError_MissingPaymentHash, + /** + * An invoice payment hash was provided but was not expected. + */ + LDKBolt12SemanticError_UnexpectedPaymentHash, /** * A signature was expected but was missing. */ diff --git a/c_sharp/src/org/ldk/enums/ConfirmationTarget.cs b/c_sharp/src/org/ldk/enums/ConfirmationTarget.cs index d2a4d73a..318ac4b9 100644 --- a/c_sharp/src/org/ldk/enums/ConfirmationTarget.cs +++ b/c_sharp/src/org/ldk/enums/ConfirmationTarget.cs @@ -3,13 +3,23 @@ namespace org { namespace ldk { namespace enums {/** * estimation. */ public enum ConfirmationTarget { + /** + * The most aggressive (i.e. highest) feerate estimate available. + * + * This is used to sanity-check our counterparty's feerates and should be as conservative as + * possible to ensure that we don't confuse a peer using a very conservative estimator for one + * trying to burn channel balance to dust. + */ + LDKConfirmationTarget_MaximumFeeEstimate, /** * We have some funds available on chain which we need to spend prior to some expiry time at - * which point our counterparty may be able to steal them. Generally we have in the high tens - * to low hundreds of blocks to get our transaction on-chain, but we shouldn't risk too low a - * fee - this should be a relatively high priority feerate. + * which point our counterparty may be able to steal them. + * + * Generally we have in the high tens to low hundreds of blocks to get our transaction + * on-chain (it doesn't have to happen in the next few blocks!), but we shouldn't risk too low + * a fee - this should be a relatively high priority feerate. */ - LDKConfirmationTarget_OnChainSweep, + LDKConfirmationTarget_UrgentOnChainSweep, /** * This is the lowest feerate we will allow our channel counterparty to have in an anchor * channel in order to close the channel if a channel party goes away. @@ -91,14 +101,18 @@ public enum ConfirmationTarget { */ LDKConfirmationTarget_ChannelCloseMinimum, /** - * The feerate [`OutputSweeper`] will use on transactions spending - * [`SpendableOutputDescriptor`]s after a channel closure. + * The feerate used to claim on-chain funds when there is no particular urgency to do so. + * + * It is used to get commitment transactions without any HTLCs confirmed in [`ChannelMonitor`] + * and by [`OutputSweeper`] 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. * + * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor * [`OutputSweeper`]: crate::util::sweep::OutputSweeper * [`SpendableOutputDescriptor`]: crate::sign::SpendableOutputDescriptor */ diff --git a/c_sharp/src/org/ldk/enums/CreationError.cs b/c_sharp/src/org/ldk/enums/CreationError.cs index 71d37306..da57695f 100644 --- a/c_sharp/src/org/ldk/enums/CreationError.cs +++ b/c_sharp/src/org/ldk/enums/CreationError.cs @@ -19,16 +19,11 @@ public enum CreationError { */ LDKCreationError_InvalidAmount, /** - * Route hints were required for this invoice and were missing. Applies to - * [phantom invoices]. - * - * [phantom invoices]: crate::utils::create_phantom_invoice + * Route hints were required for this invoice and were missing. */ LDKCreationError_MissingRouteHints, /** - * The provided `min_final_cltv_expiry_delta` was less than [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. - * - * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA + * The provided `min_final_cltv_expiry_delta` was less than rust-lightning's minimum. */ LDKCreationError_MinFinalCltvExpiryDeltaTooShort, }} } } diff --git a/c_sharp/src/org/ldk/enums/Direction.cs b/c_sharp/src/org/ldk/enums/Direction.cs index 2bf28ee5..26533dcd 100644 --- a/c_sharp/src/org/ldk/enums/Direction.cs +++ b/c_sharp/src/org/ldk/enums/Direction.cs @@ -1,6 +1,6 @@ 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. + * The side of a channel that is the [`IntroductionNode`] in a blinded path. [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 diff --git a/c_sharp/src/org/ldk/enums/PaymentFailureReason.cs b/c_sharp/src/org/ldk/enums/PaymentFailureReason.cs index 2b1f21d5..57af0e6a 100644 --- a/c_sharp/src/org/ldk/enums/PaymentFailureReason.cs +++ b/c_sharp/src/org/ldk/enums/PaymentFailureReason.cs @@ -4,6 +4,12 @@ namespace org { namespace ldk { namespace enums {/** public enum PaymentFailureReason { /** * The intended recipient rejected our payment. + * + * Also used for [`UnknownRequiredFeatures`] and [`InvoiceRequestRejected`] when downgrading to + * version prior to 0.0.124. + * + * [`UnknownRequiredFeatures`]: Self::UnknownRequiredFeatures + * [`InvoiceRequestRejected`]: Self::InvoiceRequestRejected */ LDKPaymentFailureReason_RecipientRejected, /** @@ -25,7 +31,10 @@ public enum PaymentFailureReason { * The payment expired while retrying, based on the provided * [`PaymentParameters::expiry_time`]. * + * Also used for [`InvoiceRequestExpired`] when downgrading to version prior to 0.0.124. + * * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time + * [`InvoiceRequestExpired`]: Self::InvoiceRequestExpired */ LDKPaymentFailureReason_PaymentExpired, /** @@ -41,4 +50,18 @@ public enum PaymentFailureReason { * your router. */ LDKPaymentFailureReason_UnexpectedError, + /** + * An invoice was received that required unknown features. + */ + LDKPaymentFailureReason_UnknownRequiredFeatures, + /** + * A [`Bolt12Invoice`] was not received in a reasonable amount of time. + */ + LDKPaymentFailureReason_InvoiceRequestExpired, + /** + * An [`InvoiceRequest`] for the payment was rejected by the recipient. + * + * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest + */ + LDKPaymentFailureReason_InvoiceRequestRejected, }} } } diff --git a/c_sharp/src/org/ldk/enums/RetryableSendFailure.cs b/c_sharp/src/org/ldk/enums/RetryableSendFailure.cs index 400a2ca3..904b4db6 100644 --- a/c_sharp/src/org/ldk/enums/RetryableSendFailure.cs +++ b/c_sharp/src/org/ldk/enums/RetryableSendFailure.cs @@ -27,4 +27,12 @@ public enum RetryableSendFailure { * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed */ LDKRetryableSendFailure_DuplicatePayment, + /** + * The [`RecipientOnionFields::payment_metadata`], [`RecipientOnionFields::custom_tlvs`], or + * [`BlindedPaymentPath`]s provided are too large and caused us to exceed the maximum onion + * packet size of 1300 bytes. + * + * [`BlindedPaymentPath`]: crate::blinded_path::payment::BlindedPaymentPath + */ + LDKRetryableSendFailure_OnionPacketSizeExceeded, }} } } diff --git a/c_sharp/src/org/ldk/enums/Secp256k1Error.cs b/c_sharp/src/org/ldk/enums/Secp256k1Error.cs index 21cab853..5cb0f79b 100644 --- a/c_sharp/src/org/ldk/enums/Secp256k1Error.cs +++ b/c_sharp/src/org/ldk/enums/Secp256k1Error.cs @@ -46,4 +46,8 @@ public enum Secp256k1Error { * The only valid parity values are 0 or 1. */ LDKSecp256k1Error_InvalidParityValue, + /** + * Invalid Elligator Swift Value + */ + LDKSecp256k1Error_InvalidEllSwift, }} } } diff --git a/c_sharp/src/org/ldk/impl/bindings.cs b/c_sharp/src/org/ldk/impl/bindings.cs index 1737fdc6..1ad0bc15 100644 --- a/c_sharp/src/org/ldk/impl/bindings.cs +++ b/c_sharp/src/org/ldk/impl/bindings.cs @@ -35,6 +35,12 @@ internal class bindings { [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); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKDecodeError_ty_from_ptr")] public static extern long LDKDecodeError_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKDecodeError_Io_get_io")] public static extern IOError LDKDecodeError_Io_get_io(long ptr); + // struct LDKRefund CResult_RefundDecodeErrorZ_get_ok(LDKCResult_RefundDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RefundDecodeErrorZ_get_ok")] public static extern long CResult_RefundDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_RefundDecodeErrorZ_get_err(LDKCResult_RefundDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RefundDecodeErrorZ_get_err")] public static extern long CResult_RefundDecodeErrorZ_get_err(long _owner); // struct LDKRefund CResult_RefundBolt12ParseErrorZ_get_ok(LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RefundBolt12ParseErrorZ_get_ok")] public static extern long CResult_RefundBolt12ParseErrorZ_get_ok(long _owner); // struct LDKBolt12ParseError CResult_RefundBolt12ParseErrorZ_get_err(LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR owner); @@ -42,8 +48,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKRetry_ty_from_ptr")] public static extern long LDKRetry_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKRetry_Attempts_get_attempts")] public static extern int LDKRetry_Attempts_get_attempts(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKRetry_Timeout_get_timeout")] public static extern long LDKRetry_Timeout_get_timeout(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKDecodeError_ty_from_ptr")] public static extern long LDKDecodeError_ty_from_ptr(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKDecodeError_Io_get_io")] public static extern IOError LDKDecodeError_Io_get_io(long ptr); // struct LDKRetry CResult_RetryDecodeErrorZ_get_ok(LDKCResult_RetryDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RetryDecodeErrorZ_get_ok")] public static extern long CResult_RetryDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_RetryDecodeErrorZ_get_err(LDKCResult_RetryDecodeErrorZ *NONNULL_PTR owner); @@ -103,10 +107,10 @@ internal class bindings { [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); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ThirtyTwoBytesNoneZ_get_err")] public static extern void CResult_ThirtyTwoBytesNoneZ_get_err(long _owner); - // struct LDKBlindedPayInfo CResult_BlindedPayInfoDecodeErrorZ_get_ok(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_get_ok")] public static extern long CResult_BlindedPayInfoDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_BlindedPayInfoDecodeErrorZ_get_err(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_get_err")] public static extern long CResult_BlindedPayInfoDecodeErrorZ_get_err(long _owner); + // struct LDKBolt12Invoice CResult_Bolt12InvoiceDecodeErrorZ_get_ok(LDKCResult_Bolt12InvoiceDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12InvoiceDecodeErrorZ_get_ok")] public static extern long CResult_Bolt12InvoiceDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_Bolt12InvoiceDecodeErrorZ_get_err(LDKCResult_Bolt12InvoiceDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12InvoiceDecodeErrorZ_get_err")] public static extern long CResult_Bolt12InvoiceDecodeErrorZ_get_err(long _owner); // struct LDKDelayedPaymentOutputDescriptor CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok")] public static extern long CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner); @@ -143,14 +147,18 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HTLCDescriptorDecodeErrorZ_get_ok")] public static extern long CResult_HTLCDescriptorDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_HTLCDescriptorDecodeErrorZ_get_err(LDKCResult_HTLCDescriptorDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HTLCDescriptorDecodeErrorZ_get_err")] public static extern long CResult_HTLCDescriptorDecodeErrorZ_get_err(long _owner); - // void CResult_NoneNoneZ_get_ok(LDKCResult_NoneNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneNoneZ_get_ok")] public static extern void CResult_NoneNoneZ_get_ok(long _owner); - // void CResult_NoneNoneZ_get_err(LDKCResult_NoneNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneNoneZ_get_err")] public static extern void CResult_NoneNoneZ_get_err(long _owner); // struct LDKPublicKey CResult_PublicKeyNoneZ_get_ok(LDKCResult_PublicKeyNoneZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeyNoneZ_get_ok")] public static extern long CResult_PublicKeyNoneZ_get_ok(long _owner); // void CResult_PublicKeyNoneZ_get_err(LDKCResult_PublicKeyNoneZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeyNoneZ_get_err")] public static extern void CResult_PublicKeyNoneZ_get_err(long _owner); + // struct LDKThirtyTwoBytes CResult__u832NoneZ_get_ok(LDKCResult__u832NoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult__u832NoneZ_get_ok")] public static extern long CResult__u832NoneZ_get_ok(long _owner); + // void CResult__u832NoneZ_get_err(LDKCResult__u832NoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult__u832NoneZ_get_err")] public static extern void CResult__u832NoneZ_get_err(long _owner); + // void CResult_NoneNoneZ_get_ok(LDKCResult_NoneNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneNoneZ_get_ok")] public static extern void CResult_NoneNoneZ_get_ok(long _owner); + // void CResult_NoneNoneZ_get_err(LDKCResult_NoneNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneNoneZ_get_err")] public static extern void CResult_NoneNoneZ_get_err(long _owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_BigEndianScalarZ_ty_from_ptr")] public static extern long LDKCOption_BigEndianScalarZ_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_BigEndianScalarZ_Some_get_some")] public static extern long LDKCOption_BigEndianScalarZ_Some_get_some(long ptr); // struct LDKRecoverableSignature CResult_RecoverableSignatureNoneZ_get_ok(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR owner); @@ -198,9 +206,9 @@ internal class bindings { ret[1] = i; return ret; } - // LDKPublicKey ChannelSigner_get_per_commitment_point LDKChannelSigner *NONNULL_PTR this_arg, uint64_t idx + // LDKCResult_PublicKeyNoneZ ChannelSigner_get_per_commitment_point LDKChannelSigner *NONNULL_PTR this_arg, uint64_t idx [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelSigner_get_per_commitment_point")] public static extern long ChannelSigner_get_per_commitment_point(long _this_arg, long _idx); - // LDKThirtyTwoBytes ChannelSigner_release_commitment_secret LDKChannelSigner *NONNULL_PTR this_arg, uint64_t idx + // LDKCResult__u832NoneZ ChannelSigner_release_commitment_secret LDKChannelSigner *NONNULL_PTR this_arg, uint64_t idx [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelSigner_release_commitment_secret")] public static extern long ChannelSigner_release_commitment_secret(long _this_arg, long _idx); // LDKCResult_NoneNoneZ ChannelSigner_validate_holder_commitment LDKChannelSigner *NONNULL_PTR this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR holder_tx, struct LDKCVec_ThirtyTwoBytesZ outbound_htlc_preimages [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelSigner_validate_holder_commitment")] public static extern long ChannelSigner_validate_holder_commitment(long _this_arg, long _holder_tx, long _outbound_htlc_preimages); @@ -258,32 +266,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EcdsaChannelSigner_sign_holder_anchor_input")] public static extern long EcdsaChannelSigner_sign_holder_anchor_input(long _this_arg, long _anchor_tx, long _input); // LDKCResult_ECDSASignatureNoneZ EcdsaChannelSigner_sign_channel_announcement_with_funding_key LDKEcdsaChannelSigner *NONNULL_PTR this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EcdsaChannelSigner_sign_channel_announcement_with_funding_key")] public static extern long EcdsaChannelSigner_sign_channel_announcement_with_funding_key(long _this_arg, long _msg); - public interface LDKWriteableEcdsaChannelSigner { - long write(); - } - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKWriteableEcdsaChannelSigner_new")] public static extern long LDKWriteableEcdsaChannelSigner_new_native(long impl_idx, long EcdsaChannelSigner, long ChannelSigner, long pubkeys); - public static long[] LDKWriteableEcdsaChannelSigner_new(LDKWriteableEcdsaChannelSigner impl, long EcdsaChannelSigner, long ChannelSigner, long pubkeys) { - 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] = LDKWriteableEcdsaChannelSigner_new_native(i, EcdsaChannelSigner, ChannelSigner, pubkeys); - ret[1] = i; - return ret; - } - // LDKCVec_u8Z WriteableEcdsaChannelSigner_write LDKWriteableEcdsaChannelSigner *NONNULL_PTR this_arg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WriteableEcdsaChannelSigner_write")] public static extern long WriteableEcdsaChannelSigner_write(long _this_arg); - // struct LDKWriteableEcdsaChannelSigner CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_ok(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_ok")] public static extern long CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_err(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_err")] public static extern long CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_err(long _owner); + // struct LDKEcdsaChannelSigner CResult_EcdsaChannelSignerDecodeErrorZ_get_ok(LDKCResult_EcdsaChannelSignerDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_EcdsaChannelSignerDecodeErrorZ_get_ok")] public static extern long CResult_EcdsaChannelSignerDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_EcdsaChannelSignerDecodeErrorZ_get_err(LDKCResult_EcdsaChannelSignerDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_EcdsaChannelSignerDecodeErrorZ_get_err")] public static extern long CResult_EcdsaChannelSignerDecodeErrorZ_get_err(long _owner); // struct LDKCVec_u8Z CResult_CVec_u8ZNoneZ_get_ok(LDKCResult_CVec_u8ZNoneZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_u8ZNoneZ_get_ok")] public static extern long CResult_CVec_u8ZNoneZ_get_ok(long _owner); // void CResult_CVec_u8ZNoneZ_get_err(LDKCResult_CVec_u8ZNoneZ *NONNULL_PTR owner); @@ -419,26 +405,32 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneIOErrorZ_get_ok")] public static extern void CResult_NoneIOErrorZ_get_ok(long _owner); // enum LDKIOError CResult_NoneIOErrorZ_get_err(LDKCResult_NoneIOErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneIOErrorZ_get_err")] public static extern IOError CResult_NoneIOErrorZ_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); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_b")] public static extern long C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_b(long _owner); + // struct LDKRouteParameters C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_c(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_c")] public static extern long C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_c(long _owner); + // struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_ok(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR owner); + [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 LDKRoute CResult_RouteLightningErrorZ_get_ok(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteLightningErrorZ_get_ok")] public static extern long CResult_RouteLightningErrorZ_get_ok(long _owner); // struct LDKLightningError CResult_RouteLightningErrorZ_get_err(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteLightningErrorZ_get_err")] public static extern long CResult_RouteLightningErrorZ_get_err(long _owner); - // struct LDKBlindedPayInfo C2Tuple_BlindedPayInfoBlindedPathZ_get_a(LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_BlindedPayInfoBlindedPathZ_get_a")] public static extern long C2Tuple_BlindedPayInfoBlindedPathZ_get_a(long _owner); - // struct LDKBlindedPath C2Tuple_BlindedPayInfoBlindedPathZ_get_b(LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_BlindedPayInfoBlindedPathZ_get_b")] public static extern long C2Tuple_BlindedPayInfoBlindedPathZ_get_b(long _owner); - // struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_ok(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_ok")] public static extern long CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_ok(long _owner); - // void CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_err(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_err")] public static extern void CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_err(long _owner); + // struct LDKCVec_BlindedPaymentPathZ CResult_CVec_BlindedPaymentPathZNoneZ_get_ok(LDKCResult_CVec_BlindedPaymentPathZNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_BlindedPaymentPathZNoneZ_get_ok")] public static extern long CResult_CVec_BlindedPaymentPathZNoneZ_get_ok(long _owner); + // void CResult_CVec_BlindedPaymentPathZNoneZ_get_err(LDKCResult_CVec_BlindedPaymentPathZNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_BlindedPaymentPathZNoneZ_get_err")] public static extern void CResult_CVec_BlindedPaymentPathZNoneZ_get_err(long _owner); // struct LDKOnionMessagePath CResult_OnionMessagePathNoneZ_get_ok(LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OnionMessagePathNoneZ_get_ok")] public static extern long CResult_OnionMessagePathNoneZ_get_ok(long _owner); // void CResult_OnionMessagePathNoneZ_get_err(LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OnionMessagePathNoneZ_get_err")] public static extern void CResult_OnionMessagePathNoneZ_get_err(long _owner); - // struct LDKCVec_BlindedPathZ CResult_CVec_BlindedPathZNoneZ_get_ok(LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_BlindedPathZNoneZ_get_ok")] public static extern long CResult_CVec_BlindedPathZNoneZ_get_ok(long _owner); - // void CResult_CVec_BlindedPathZNoneZ_get_err(LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_BlindedPathZNoneZ_get_err")] public static extern void CResult_CVec_BlindedPathZNoneZ_get_err(long _owner); + // struct LDKCVec_BlindedMessagePathZ CResult_CVec_BlindedMessagePathZNoneZ_get_ok(LDKCResult_CVec_BlindedMessagePathZNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_BlindedMessagePathZNoneZ_get_ok")] public static extern long CResult_CVec_BlindedMessagePathZNoneZ_get_ok(long _owner); + // void CResult_CVec_BlindedMessagePathZNoneZ_get_err(LDKCResult_CVec_BlindedMessagePathZNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_BlindedMessagePathZNoneZ_get_err")] public static extern void CResult_CVec_BlindedMessagePathZNoneZ_get_err(long _owner); // struct LDKInFlightHtlcs CResult_InFlightHtlcsDecodeErrorZ_get_ok(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InFlightHtlcsDecodeErrorZ_get_ok")] public static extern long CResult_InFlightHtlcsDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_InFlightHtlcsDecodeErrorZ_get_err(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner); @@ -537,7 +529,10 @@ internal class bindings { [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_HolderForceClosed_get_broadcasted_latest_txn")] public static extern long LDKClosureReason_HolderForceClosed_get_broadcasted_latest_txn(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_LDKClosureReason_PeerFeerateTooLow_get_peer_feerate_sat_per_kw")] public static extern int LDKClosureReason_PeerFeerateTooLow_get_peer_feerate_sat_per_kw(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKClosureReason_PeerFeerateTooLow_get_required_feerate_sat_per_kw")] public static extern int LDKClosureReason_PeerFeerateTooLow_get_required_feerate_sat_per_kw(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); @@ -603,6 +598,10 @@ internal class bindings { [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_OfferDecodeErrorZ_get_ok(LDKCResult_OfferDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferDecodeErrorZ_get_ok")] public static extern long CResult_OfferDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_OfferDecodeErrorZ_get_err(LDKCResult_OfferDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferDecodeErrorZ_get_err")] public static extern long CResult_OfferDecodeErrorZ_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); @@ -616,7 +615,6 @@ internal class bindings { // 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); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKNetworkUpdate_ChannelFailure_get_is_permanent")] public static extern bool LDKNetworkUpdate_ChannelFailure_get_is_permanent(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKNetworkUpdate_NodeFailure_get_node_id")] public static extern long LDKNetworkUpdate_NodeFailure_get_node_id(long ptr); @@ -696,8 +694,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendFundingSigned_get_msg")] public static extern long LDKMessageSendEvent_SendFundingSigned_get_msg(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendStfu_get_node_id")] public static extern long LDKMessageSendEvent_SendStfu_get_node_id(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendStfu_get_msg")] public static extern long LDKMessageSendEvent_SendStfu_get_msg(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendSplice_get_node_id")] public static extern long LDKMessageSendEvent_SendSplice_get_node_id(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendSplice_get_msg")] public static extern long LDKMessageSendEvent_SendSplice_get_msg(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendSpliceInit_get_node_id")] public static extern long LDKMessageSendEvent_SendSpliceInit_get_node_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendSpliceInit_get_msg")] public static extern long LDKMessageSendEvent_SendSpliceInit_get_msg(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendSpliceAck_get_node_id")] public static extern long LDKMessageSendEvent_SendSpliceAck_get_node_id(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendSpliceAck_get_msg")] public static extern long LDKMessageSendEvent_SendSpliceAck_get_msg(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendSpliceLocked_get_node_id")] public static extern long LDKMessageSendEvent_SendSpliceLocked_get_node_id(long ptr); @@ -777,6 +775,9 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKSocketAddress_OnionV3_get_port")] public static extern short LDKSocketAddress_OnionV3_get_port(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKSocketAddress_Hostname_get_hostname")] public static extern long LDKSocketAddress_Hostname_get_hostname(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKSocketAddress_Hostname_get_port")] public static extern short LDKSocketAddress_Hostname_get_port(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKNodeAnnouncementInfo_ty_from_ptr")] public static extern long LDKNodeAnnouncementInfo_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKNodeAnnouncementInfo_Relayed_get_relayed")] public static extern long LDKNodeAnnouncementInfo_Relayed_get_relayed(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKNodeAnnouncementInfo_Local_get_local")] public static extern long LDKNodeAnnouncementInfo_Local_get_local(long ptr); // struct LDKNodeAnnouncementInfo CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok")] public static extern long CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner); @@ -785,6 +786,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAliasDecodeErrorZ_get_ok")] public static extern long CResult_NodeAliasDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_NodeAliasDecodeErrorZ_get_err(LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAliasDecodeErrorZ_get_err")] public static extern long CResult_NodeAliasDecodeErrorZ_get_err(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_NodeAnnouncementInfoZ_ty_from_ptr")] public static extern long LDKCOption_NodeAnnouncementInfoZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_NodeAnnouncementInfoZ_Some_get_some")] public static extern long LDKCOption_NodeAnnouncementInfoZ_Some_get_some(long ptr); // struct LDKNodeInfo CResult_NodeInfoDecodeErrorZ_get_ok(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeInfoDecodeErrorZ_get_ok")] public static extern long CResult_NodeInfoDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_NodeInfoDecodeErrorZ_get_err(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner); @@ -893,21 +896,54 @@ internal class bindings { [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_LDKOffersContext_ty_from_ptr")] public static extern long LDKOffersContext_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKOffersContext_InvoiceRequest_get_nonce")] public static extern long LDKOffersContext_InvoiceRequest_get_nonce(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKOffersContext_OutboundPayment_get_payment_id")] public static extern long LDKOffersContext_OutboundPayment_get_payment_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKOffersContext_OutboundPayment_get_nonce")] public static extern long LDKOffersContext_OutboundPayment_get_nonce(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKOffersContext_OutboundPayment_get_hmac")] public static extern long LDKOffersContext_OutboundPayment_get_hmac(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKOffersContext_InboundPayment_get_payment_hash")] public static extern long LDKOffersContext_InboundPayment_get_payment_hash(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_OffersContextZ_ty_from_ptr")] public static extern long LDKCOption_OffersContextZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_OffersContextZ_Some_get_some")] public static extern long LDKCOption_OffersContextZ_Some_get_some(long ptr); [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); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKOffersMessage_InvoiceError_get_invoice_error")] public static extern long LDKOffersMessage_InvoiceError_get_invoice_error(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_OffersMessageZ_ty_from_ptr")] public static extern long LDKCOption_OffersMessageZ_ty_from_ptr(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_OffersMessageZ_Some_get_some")] public static extern long LDKCOption_OffersMessageZ_Some_get_some(long ptr); + // struct LDKOffersMessage C2Tuple_OffersMessageResponseInstructionZ_get_a(LDKC2Tuple_OffersMessageResponseInstructionZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OffersMessageResponseInstructionZ_get_a")] public static extern long C2Tuple_OffersMessageResponseInstructionZ_get_a(long _owner); + // struct LDKResponseInstruction C2Tuple_OffersMessageResponseInstructionZ_get_b(LDKC2Tuple_OffersMessageResponseInstructionZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OffersMessageResponseInstructionZ_get_b")] public static extern long C2Tuple_OffersMessageResponseInstructionZ_get_b(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_ty_from_ptr")] public static extern long LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_Some_get_some")] public static extern long LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_Some_get_some(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKDestination_ty_from_ptr")] public static extern long LDKDestination_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKDestination_Node_get_node")] public static extern long LDKDestination_Node_get_node(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKDestination_BlindedPath_get_blinded_path")] public static extern long LDKDestination_BlindedPath_get_blinded_path(long ptr); - // struct LDKOffersMessage C3Tuple_OffersMessageDestinationBlindedPathZ_get_a(LDKC3Tuple_OffersMessageDestinationBlindedPathZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_OffersMessageDestinationBlindedPathZ_get_a")] public static extern long C3Tuple_OffersMessageDestinationBlindedPathZ_get_a(long _owner); - // struct LDKDestination C3Tuple_OffersMessageDestinationBlindedPathZ_get_b(LDKC3Tuple_OffersMessageDestinationBlindedPathZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_OffersMessageDestinationBlindedPathZ_get_b")] public static extern long C3Tuple_OffersMessageDestinationBlindedPathZ_get_b(long _owner); - // struct LDKBlindedPath C3Tuple_OffersMessageDestinationBlindedPathZ_get_c(LDKC3Tuple_OffersMessageDestinationBlindedPathZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_OffersMessageDestinationBlindedPathZ_get_c")] public static extern long C3Tuple_OffersMessageDestinationBlindedPathZ_get_c(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageContext_ty_from_ptr")] public static extern long LDKMessageContext_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageContext_Offers_get_offers")] public static extern long LDKMessageContext_Offers_get_offers(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageContext_Custom_get_custom")] public static extern long LDKMessageContext_Custom_get_custom(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendInstructions_ty_from_ptr")] public static extern long LDKMessageSendInstructions_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendInstructions_WithSpecifiedReplyPath_get_destination")] public static extern long LDKMessageSendInstructions_WithSpecifiedReplyPath_get_destination(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendInstructions_WithSpecifiedReplyPath_get_reply_path")] public static extern long LDKMessageSendInstructions_WithSpecifiedReplyPath_get_reply_path(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendInstructions_WithReplyPath_get_destination")] public static extern long LDKMessageSendInstructions_WithReplyPath_get_destination(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendInstructions_WithReplyPath_get_context")] public static extern long LDKMessageSendInstructions_WithReplyPath_get_context(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendInstructions_WithoutReplyPath_get_destination")] public static extern long LDKMessageSendInstructions_WithoutReplyPath_get_destination(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendInstructions_ForReply_get_instructions")] public static extern long LDKMessageSendInstructions_ForReply_get_instructions(long ptr); + // struct LDKOffersMessage C2Tuple_OffersMessageMessageSendInstructionsZ_get_a(LDKC2Tuple_OffersMessageMessageSendInstructionsZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OffersMessageMessageSendInstructionsZ_get_a")] public static extern long C2Tuple_OffersMessageMessageSendInstructionsZ_get_a(long _owner); + // struct LDKMessageSendInstructions C2Tuple_OffersMessageMessageSendInstructionsZ_get_b(LDKC2Tuple_OffersMessageMessageSendInstructionsZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OffersMessageMessageSendInstructionsZ_get_b")] public static extern long C2Tuple_OffersMessageMessageSendInstructionsZ_get_b(long _owner); + // struct LDKReleaseHeldHtlc C2Tuple_ReleaseHeldHtlcResponseInstructionZ_get_a(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_ReleaseHeldHtlcResponseInstructionZ_get_a")] public static extern long C2Tuple_ReleaseHeldHtlcResponseInstructionZ_get_a(long _owner); + // struct LDKResponseInstruction C2Tuple_ReleaseHeldHtlcResponseInstructionZ_get_b(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_ReleaseHeldHtlcResponseInstructionZ_get_b")] public static extern long C2Tuple_ReleaseHeldHtlcResponseInstructionZ_get_b(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_ty_from_ptr")] public static extern long LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_Some_get_some")] public static extern long LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_Some_get_some(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKAsyncPaymentsMessage_ty_from_ptr")] public static extern long LDKAsyncPaymentsMessage_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKAsyncPaymentsMessage_HeldHtlcAvailable_get_held_htlc_available")] public static extern long LDKAsyncPaymentsMessage_HeldHtlcAvailable_get_held_htlc_available(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKAsyncPaymentsMessage_ReleaseHeldHtlc_get_release_held_htlc")] public static extern long LDKAsyncPaymentsMessage_ReleaseHeldHtlc_get_release_held_htlc(long ptr); + // struct LDKAsyncPaymentsMessage C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_get_a(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_get_a")] public static extern long C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_get_a(long _owner); + // struct LDKMessageSendInstructions C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_get_b(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_get_b")] public static extern long C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_get_b(long _owner); // struct LDKPhantomRouteHints CResult_PhantomRouteHintsDecodeErrorZ_get_ok(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PhantomRouteHintsDecodeErrorZ_get_ok")] public static extern long CResult_PhantomRouteHintsDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_PhantomRouteHintsDecodeErrorZ_get_err(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR owner); @@ -1025,7 +1061,7 @@ internal class bindings { long get_inbound_payment_key_material(); long get_node_id(Recipient recipient); long ecdh(Recipient recipient, long other_key, long tweak); - long sign_invoice(long hrp_bytes, long invoice_data, Recipient recipient); + long sign_invoice(long invoice, Recipient recipient); long sign_bolt12_invoice_request(long invoice_request); long sign_bolt12_invoice(long invoice); long sign_gossip_message(long msg); @@ -1053,8 +1089,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeSigner_get_node_id")] public static extern long NodeSigner_get_node_id(long _this_arg, Recipient _recipient); // LDKCResult_ThirtyTwoBytesNoneZ NodeSigner_ecdh LDKNodeSigner *NONNULL_PTR this_arg, enum LDKRecipient recipient, struct LDKPublicKey other_key, struct LDKCOption_BigEndianScalarZ tweak [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeSigner_ecdh")] public static extern long NodeSigner_ecdh(long _this_arg, Recipient _recipient, long _other_key, long _tweak); - // LDKCResult_RecoverableSignatureNoneZ NodeSigner_sign_invoice LDKNodeSigner *NONNULL_PTR this_arg, struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z invoice_data, enum LDKRecipient recipient - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeSigner_sign_invoice")] public static extern long NodeSigner_sign_invoice(long _this_arg, long _hrp_bytes, long _invoice_data, Recipient _recipient); + // LDKCResult_RecoverableSignatureNoneZ NodeSigner_sign_invoice LDKNodeSigner *NONNULL_PTR this_arg, const struct LDKRawBolt11Invoice *NONNULL_PTR invoice, enum LDKRecipient recipient + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeSigner_sign_invoice")] public static extern long NodeSigner_sign_invoice(long _this_arg, long _invoice, Recipient _recipient); // LDKCResult_SchnorrSignatureNoneZ NodeSigner_sign_bolt12_invoice_request LDKNodeSigner *NONNULL_PTR this_arg, const struct LDKUnsignedInvoiceRequest *NONNULL_PTR invoice_request [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeSigner_sign_bolt12_invoice_request")] public static extern long NodeSigner_sign_bolt12_invoice_request(long _this_arg, long _invoice_request); // LDKCResult_SchnorrSignatureNoneZ NodeSigner_sign_bolt12_invoice LDKNodeSigner *NONNULL_PTR this_arg, const struct LDKUnsignedBolt12Invoice *NONNULL_PTR invoice @@ -1087,9 +1123,9 @@ internal class bindings { } // LDKThirtyTwoBytes SignerProvider_generate_channel_keys_id LDKSignerProvider *NONNULL_PTR this_arg, bool inbound, uint64_t channel_value_satoshis, struct LDKU128 user_channel_id [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignerProvider_generate_channel_keys_id")] public static extern long SignerProvider_generate_channel_keys_id(long _this_arg, bool _inbound, long _channel_value_satoshis, long _user_channel_id); - // LDKWriteableEcdsaChannelSigner SignerProvider_derive_channel_signer LDKSignerProvider *NONNULL_PTR this_arg, uint64_t channel_value_satoshis, struct LDKThirtyTwoBytes channel_keys_id + // LDKEcdsaChannelSigner SignerProvider_derive_channel_signer LDKSignerProvider *NONNULL_PTR this_arg, uint64_t channel_value_satoshis, struct LDKThirtyTwoBytes channel_keys_id [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignerProvider_derive_channel_signer")] public static extern long SignerProvider_derive_channel_signer(long _this_arg, long _channel_value_satoshis, long _channel_keys_id); - // LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ SignerProvider_read_chan_signer LDKSignerProvider *NONNULL_PTR this_arg, struct LDKu8slice reader + // LDKCResult_EcdsaChannelSignerDecodeErrorZ SignerProvider_read_chan_signer LDKSignerProvider *NONNULL_PTR this_arg, struct LDKu8slice reader [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignerProvider_read_chan_signer")] public static extern long SignerProvider_read_chan_signer(long _this_arg, long _reader); // LDKCResult_CVec_u8ZNoneZ SignerProvider_get_destination_script LDKSignerProvider *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes channel_keys_id [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignerProvider_get_destination_script")] public static extern long SignerProvider_get_destination_script(long _this_arg, long _channel_keys_id); @@ -1119,7 +1155,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FeeEstimator_get_est_sat_per_1000_weight")] public static extern int FeeEstimator_get_est_sat_per_1000_weight(long _this_arg, ConfirmationTarget _confirmation_target); public interface LDKMessageRouter { long find_path(long sender, long peers, long destination); - long create_blinded_paths(long recipient, long peers); + long create_blinded_paths(long recipient, long context, long peers); + long create_compact_blinded_paths(long recipient, long context, long peers); } [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageRouter_new")] public static extern long LDKMessageRouter_new_native(long impl_idx); public static long[] LDKMessageRouter_new(LDKMessageRouter impl) { @@ -1140,8 +1177,10 @@ internal class bindings { } // LDKCResult_OnionMessagePathNoneZ MessageRouter_find_path LDKMessageRouter *NONNULL_PTR this_arg, struct LDKPublicKey sender, struct LDKCVec_PublicKeyZ peers, struct LDKDestination destination [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageRouter_find_path")] public static extern long MessageRouter_find_path(long _this_arg, long _sender, long _peers, long _destination); - // LDKCResult_CVec_BlindedPathZNoneZ MessageRouter_create_blinded_paths LDKMessageRouter *NONNULL_PTR this_arg, struct LDKPublicKey recipient, struct LDKCVec_PublicKeyZ peers - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageRouter_create_blinded_paths")] public static extern long MessageRouter_create_blinded_paths(long _this_arg, long _recipient, long _peers); + // LDKCResult_CVec_BlindedMessagePathZNoneZ MessageRouter_create_blinded_paths LDKMessageRouter *NONNULL_PTR this_arg, struct LDKPublicKey recipient, struct LDKMessageContext context, struct LDKCVec_PublicKeyZ peers + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageRouter_create_blinded_paths")] public static extern long MessageRouter_create_blinded_paths(long _this_arg, long _recipient, long _context, long _peers); + // LDKCResult_CVec_BlindedMessagePathZNoneZ MessageRouter_create_compact_blinded_paths LDKMessageRouter *NONNULL_PTR this_arg, struct LDKPublicKey recipient, struct LDKMessageContext context, struct LDKCVec_MessageForwardNodeZ peers + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageRouter_create_compact_blinded_paths")] public static extern long MessageRouter_create_compact_blinded_paths(long _this_arg, long _recipient, long _context, long _peers); public interface LDKRouter { long find_route(long payer, long route_params, long first_hops, long inflight_htlcs); long find_route_with_id(long payer, long route_params, long first_hops, long inflight_htlcs, long _payment_hash, long _payment_id); @@ -1168,7 +1207,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Router_find_route")] public static extern long Router_find_route(long _this_arg, long _payer, long _route_params, long _first_hops, long _inflight_htlcs); // LDKCResult_RouteLightningErrorZ Router_find_route_with_id LDKRouter *NONNULL_PTR this_arg, struct LDKPublicKey payer, const struct LDKRouteParameters *NONNULL_PTR route_params, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKInFlightHtlcs inflight_htlcs, struct LDKThirtyTwoBytes _payment_hash, struct LDKThirtyTwoBytes _payment_id [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Router_find_route_with_id")] public static extern long Router_find_route_with_id(long _this_arg, long _payer, long _route_params, long _first_hops, long _inflight_htlcs, long __payment_hash, long __payment_id); - // LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ Router_create_blinded_payment_paths LDKRouter *NONNULL_PTR this_arg, struct LDKPublicKey recipient, struct LDKCVec_ChannelDetailsZ first_hops, struct LDKReceiveTlvs tlvs, uint64_t amount_msats + // LDKCResult_CVec_BlindedPaymentPathZNoneZ Router_create_blinded_payment_paths LDKRouter *NONNULL_PTR this_arg, struct LDKPublicKey recipient, struct LDKCVec_ChannelDetailsZ first_hops, struct LDKReceiveTlvs tlvs, uint64_t amount_msats [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Router_create_blinded_payment_paths")] public static extern long Router_create_blinded_payment_paths(long _this_arg, long _recipient, long _first_hops, long _tlvs, long _amount_msats); // struct LDKThirtyTwoBytes C2Tuple_ThirtyTwoBytesChannelManagerZ_get_a(LDKC2Tuple_ThirtyTwoBytesChannelManagerZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_ThirtyTwoBytesChannelManagerZ_get_a")] public static extern long C2Tuple_ThirtyTwoBytesChannelManagerZ_get_a(long _owner); @@ -1223,6 +1262,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_get_a")] public static extern long C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_get_a(long _owner); // struct LDKCVec_C2Tuple_u32CVec_u8ZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_get_b(LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_get_b")] public static extern long C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_get_b(long _owner); + // void CResult_NoneReplayEventZ_get_ok(LDKCResult_NoneReplayEventZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneReplayEventZ_get_ok")] public static extern void CResult_NoneReplayEventZ_get_ok(long _owner); + // struct LDKReplayEvent CResult_NoneReplayEventZ_get_err(LDKCResult_NoneReplayEventZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneReplayEventZ_get_err")] public static extern long CResult_NoneReplayEventZ_get_err(long _owner); // uint32_t C2Tuple_u32TxOutZ_get_a(LDKC2Tuple_u32TxOutZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_u32TxOutZ_get_a")] public static extern int C2Tuple_u32TxOutZ_get_a(long _owner); // struct LDKTxOut C2Tuple_u32TxOutZ_get_b(LDKC2Tuple_u32TxOutZ *NONNULL_PTR owner); @@ -1233,8 +1276,14 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_get_b")] public static extern long C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_get_b(long _owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_ty_from_ptr")] public static extern long LDKBalance_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_ClaimableOnChannelClose_get_amount_satoshis")] public static extern long LDKBalance_ClaimableOnChannelClose_get_amount_satoshis(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_ClaimableOnChannelClose_get_transaction_fee_satoshis")] public static extern long LDKBalance_ClaimableOnChannelClose_get_transaction_fee_satoshis(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_ClaimableOnChannelClose_get_outbound_payment_htlc_rounded_msat")] public static extern long LDKBalance_ClaimableOnChannelClose_get_outbound_payment_htlc_rounded_msat(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_ClaimableOnChannelClose_get_outbound_forwarded_htlc_rounded_msat")] public static extern long LDKBalance_ClaimableOnChannelClose_get_outbound_forwarded_htlc_rounded_msat(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_ClaimableOnChannelClose_get_inbound_claiming_htlc_rounded_msat")] public static extern long LDKBalance_ClaimableOnChannelClose_get_inbound_claiming_htlc_rounded_msat(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_ClaimableOnChannelClose_get_inbound_htlc_rounded_msat")] public static extern long LDKBalance_ClaimableOnChannelClose_get_inbound_htlc_rounded_msat(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_ClaimableAwaitingConfirmations_get_amount_satoshis")] public static extern long LDKBalance_ClaimableAwaitingConfirmations_get_amount_satoshis(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_ClaimableAwaitingConfirmations_get_confirmation_height")] public static extern int LDKBalance_ClaimableAwaitingConfirmations_get_confirmation_height(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_ClaimableAwaitingConfirmations_get_source")] public static extern BalanceSource LDKBalance_ClaimableAwaitingConfirmations_get_source(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_ContentiousClaimable_get_amount_satoshis")] public static extern long LDKBalance_ContentiousClaimable_get_amount_satoshis(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_ContentiousClaimable_get_timeout_height")] public static extern int LDKBalance_ContentiousClaimable_get_timeout_height(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_ContentiousClaimable_get_payment_hash")] public static extern long LDKBalance_ContentiousClaimable_get_payment_hash(long ptr); @@ -1242,6 +1291,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_MaybeTimeoutClaimableHTLC_get_amount_satoshis")] public static extern long LDKBalance_MaybeTimeoutClaimableHTLC_get_amount_satoshis(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_MaybeTimeoutClaimableHTLC_get_claimable_height")] public static extern int LDKBalance_MaybeTimeoutClaimableHTLC_get_claimable_height(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_MaybeTimeoutClaimableHTLC_get_payment_hash")] public static extern long LDKBalance_MaybeTimeoutClaimableHTLC_get_payment_hash(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_MaybeTimeoutClaimableHTLC_get_outbound_payment")] public static extern bool LDKBalance_MaybeTimeoutClaimableHTLC_get_outbound_payment(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_MaybePreimageClaimableHTLC_get_amount_satoshis")] public static extern long LDKBalance_MaybePreimageClaimableHTLC_get_amount_satoshis(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_MaybePreimageClaimableHTLC_get_expiry_height")] public static extern int LDKBalance_MaybePreimageClaimableHTLC_get_expiry_height(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_MaybePreimageClaimableHTLC_get_payment_hash")] public static extern long LDKBalance_MaybePreimageClaimableHTLC_get_payment_hash(long ptr); @@ -1286,12 +1336,9 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PublicKeyTypeZ_get_a")] public static extern long C2Tuple_PublicKeyTypeZ_get_a(long _owner); // struct LDKType C2Tuple_PublicKeyTypeZ_get_b(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PublicKeyTypeZ_get_b")] public static extern long C2Tuple_PublicKeyTypeZ_get_b(long _owner); - // struct LDKPublicKey C2Tuple_PublicKeyCVec_SocketAddressZZ_get_a(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PublicKeyCVec_SocketAddressZZ_get_a")] public static extern long C2Tuple_PublicKeyCVec_SocketAddressZZ_get_a(long _owner); - // struct LDKCVec_SocketAddressZ C2Tuple_PublicKeyCVec_SocketAddressZZ_get_b(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PublicKeyCVec_SocketAddressZZ_get_b")] public static extern long C2Tuple_PublicKeyCVec_SocketAddressZZ_get_b(long _owner); public interface LDKOnionMessageContents { long tlv_type(); + long msg_type(); long write(); long debug_str(); } @@ -1314,22 +1361,28 @@ internal class bindings { } // uint64_t OnionMessageContents_tlv_type LDKOnionMessageContents *NONNULL_PTR this_arg [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessageContents_tlv_type")] public static extern long OnionMessageContents_tlv_type(long _this_arg); + // LDKStr OnionMessageContents_msg_type LDKOnionMessageContents *NONNULL_PTR this_arg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessageContents_msg_type")] public static extern long OnionMessageContents_msg_type(long _this_arg); // LDKCVec_u8Z OnionMessageContents_write LDKOnionMessageContents *NONNULL_PTR this_arg [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessageContents_write")] public static extern long OnionMessageContents_write(long _this_arg); // LDKStr OnionMessageContents_debug_str LDKOnionMessageContents *NONNULL_PTR this_arg [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessageContents_debug_str")] public static extern long OnionMessageContents_debug_str(long _this_arg); + // struct LDKOnionMessageContents C2Tuple_OnionMessageContentsResponseInstructionZ_get_a(LDKC2Tuple_OnionMessageContentsResponseInstructionZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OnionMessageContentsResponseInstructionZ_get_a")] public static extern long C2Tuple_OnionMessageContentsResponseInstructionZ_get_a(long _owner); + // struct LDKResponseInstruction C2Tuple_OnionMessageContentsResponseInstructionZ_get_b(LDKC2Tuple_OnionMessageContentsResponseInstructionZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OnionMessageContentsResponseInstructionZ_get_b")] public static extern long C2Tuple_OnionMessageContentsResponseInstructionZ_get_b(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_ty_from_ptr")] public static extern long LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Some_get_some")] public static extern long LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Some_get_some(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_OnionMessageContentsZ_ty_from_ptr")] public static extern long LDKCOption_OnionMessageContentsZ_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_OnionMessageContentsZ_Some_get_some")] public static extern long LDKCOption_OnionMessageContentsZ_Some_get_some(long ptr); // struct LDKCOption_OnionMessageContentsZ CResult_COption_OnionMessageContentsZDecodeErrorZ_get_ok(LDKCResult_COption_OnionMessageContentsZDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_OnionMessageContentsZDecodeErrorZ_get_ok")] public static extern long CResult_COption_OnionMessageContentsZDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_COption_OnionMessageContentsZDecodeErrorZ_get_err(LDKCResult_COption_OnionMessageContentsZDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_OnionMessageContentsZDecodeErrorZ_get_err")] public static extern long CResult_COption_OnionMessageContentsZDecodeErrorZ_get_err(long _owner); - // struct LDKOnionMessageContents C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_a(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_a")] public static extern long C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_a(long _owner); - // struct LDKDestination C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_b(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_b")] public static extern long C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_b(long _owner); - // struct LDKBlindedPath C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_c(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_c")] public static extern long C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_c(long _owner); + // struct LDKOnionMessageContents C2Tuple_OnionMessageContentsMessageSendInstructionsZ_get_a(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OnionMessageContentsMessageSendInstructionsZ_get_a")] public static extern long C2Tuple_OnionMessageContentsMessageSendInstructionsZ_get_a(long _owner); + // struct LDKMessageSendInstructions C2Tuple_OnionMessageContentsMessageSendInstructionsZ_get_b(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OnionMessageContentsMessageSendInstructionsZ_get_b")] public static extern long C2Tuple_OnionMessageContentsMessageSendInstructionsZ_get_b(long _owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_TypeZ_ty_from_ptr")] public static extern long LDKCOption_TypeZ_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_TypeZ_Some_get_some")] public static extern long LDKCOption_TypeZ_Some_get_some(long ptr); // struct LDKCOption_TypeZ CResult_COption_TypeZDecodeErrorZ_get_ok(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR owner); @@ -1381,8 +1434,6 @@ internal class bindings { [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); @@ -1423,10 +1474,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StfuDecodeErrorZ_get_ok")] public static extern long CResult_StfuDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_StfuDecodeErrorZ_get_err(LDKCResult_StfuDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StfuDecodeErrorZ_get_err")] public static extern long CResult_StfuDecodeErrorZ_get_err(long _owner); - // struct LDKSplice CResult_SpliceDecodeErrorZ_get_ok(LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SpliceDecodeErrorZ_get_ok")] public static extern long CResult_SpliceDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_SpliceDecodeErrorZ_get_err(LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SpliceDecodeErrorZ_get_err")] public static extern long CResult_SpliceDecodeErrorZ_get_err(long _owner); + // struct LDKSpliceInit CResult_SpliceInitDecodeErrorZ_get_ok(LDKCResult_SpliceInitDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SpliceInitDecodeErrorZ_get_ok")] public static extern long CResult_SpliceInitDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_SpliceInitDecodeErrorZ_get_err(LDKCResult_SpliceInitDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SpliceInitDecodeErrorZ_get_err")] public static extern long CResult_SpliceInitDecodeErrorZ_get_err(long _owner); // struct LDKSpliceAck CResult_SpliceAckDecodeErrorZ_get_ok(LDKCResult_SpliceAckDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SpliceAckDecodeErrorZ_get_ok")] public static extern long CResult_SpliceAckDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_SpliceAckDecodeErrorZ_get_err(LDKCResult_SpliceAckDecodeErrorZ *NONNULL_PTR owner); @@ -1487,6 +1538,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok")] public static extern long CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err")] public static extern long CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(long _owner); + // struct LDKCommitmentSignedBatch CResult_CommitmentSignedBatchDecodeErrorZ_get_ok(LDKCResult_CommitmentSignedBatchDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CommitmentSignedBatchDecodeErrorZ_get_ok")] public static extern long CResult_CommitmentSignedBatchDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_CommitmentSignedBatchDecodeErrorZ_get_err(LDKCResult_CommitmentSignedBatchDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CommitmentSignedBatchDecodeErrorZ_get_err")] public static extern long CResult_CommitmentSignedBatchDecodeErrorZ_get_err(long _owner); // struct LDKCommitmentSigned CResult_CommitmentSignedDecodeErrorZ_get_ok(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CommitmentSignedDecodeErrorZ_get_ok")] public static extern long CResult_CommitmentSignedDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_CommitmentSignedDecodeErrorZ_get_err(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR owner); @@ -1615,12 +1670,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_GossipTimestampFilterDecodeErrorZ_get_ok")] public static extern long CResult_GossipTimestampFilterDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_GossipTimestampFilterDecodeErrorZ_get_err(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_GossipTimestampFilterDecodeErrorZ_get_err")] public static extern long CResult_GossipTimestampFilterDecodeErrorZ_get_err(long _owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKSignOrCreationError_ty_from_ptr")] public static extern long LDKSignOrCreationError_ty_from_ptr(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKSignOrCreationError_CreationError_get_creation_error")] public static extern CreationError LDKSignOrCreationError_CreationError_get_creation_error(long ptr); - // struct LDKBolt11Invoice CResult_Bolt11InvoiceSignOrCreationErrorZ_get_ok(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_get_ok")] public static extern long CResult_Bolt11InvoiceSignOrCreationErrorZ_get_ok(long _owner); - // struct LDKSignOrCreationError CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err")] public static extern long CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err(long _owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_InboundHTLCStateDetailsZ_ty_from_ptr")] public static extern long LDKCOption_InboundHTLCStateDetailsZ_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_InboundHTLCStateDetailsZ_Some_get_some")] public static extern InboundHTLCStateDetails LDKCOption_InboundHTLCStateDetailsZ_Some_get_some(long ptr); // struct LDKCOption_InboundHTLCStateDetailsZ CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_get_ok(LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR owner); @@ -1659,6 +1708,18 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_get_ok")] public static extern ChannelShutdownState CResult_ChannelShutdownStateDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_ChannelShutdownStateDecodeErrorZ_get_err(LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_get_err")] public static extern long CResult_ChannelShutdownStateDecodeErrorZ_get_err(long _owner); + // struct LDKHeldHtlcAvailable CResult_HeldHtlcAvailableDecodeErrorZ_get_ok(LDKCResult_HeldHtlcAvailableDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HeldHtlcAvailableDecodeErrorZ_get_ok")] public static extern long CResult_HeldHtlcAvailableDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_HeldHtlcAvailableDecodeErrorZ_get_err(LDKCResult_HeldHtlcAvailableDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HeldHtlcAvailableDecodeErrorZ_get_err")] public static extern long CResult_HeldHtlcAvailableDecodeErrorZ_get_err(long _owner); + // struct LDKReleaseHeldHtlc CResult_ReleaseHeldHtlcDecodeErrorZ_get_ok(LDKCResult_ReleaseHeldHtlcDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ReleaseHeldHtlcDecodeErrorZ_get_ok")] public static extern long CResult_ReleaseHeldHtlcDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_ReleaseHeldHtlcDecodeErrorZ_get_err(LDKCResult_ReleaseHeldHtlcDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ReleaseHeldHtlcDecodeErrorZ_get_err")] public static extern long CResult_ReleaseHeldHtlcDecodeErrorZ_get_err(long _owner); + // struct LDKAsyncPaymentsMessage CResult_AsyncPaymentsMessageDecodeErrorZ_get_ok(LDKCResult_AsyncPaymentsMessageDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_AsyncPaymentsMessageDecodeErrorZ_get_ok")] public static extern long CResult_AsyncPaymentsMessageDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_AsyncPaymentsMessageDecodeErrorZ_get_err(LDKCResult_AsyncPaymentsMessageDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_AsyncPaymentsMessageDecodeErrorZ_get_err")] public static extern long CResult_AsyncPaymentsMessageDecodeErrorZ_get_err(long _owner); // struct LDKOffersMessage CResult_OffersMessageDecodeErrorZ_get_ok(LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OffersMessageDecodeErrorZ_get_ok")] public static extern long CResult_OffersMessageDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_OffersMessageDecodeErrorZ_get_err(LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR owner); @@ -1723,6 +1784,13 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok")] public static extern long CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(long _owner); // 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_LDKFundingInfo_ty_from_ptr")] public static extern long LDKFundingInfo_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKFundingInfo_Tx_get_transaction")] public static extern long LDKFundingInfo_Tx_get_transaction(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKFundingInfo_OutPoint_get_outpoint")] public static extern long LDKFundingInfo_OutPoint_get_outpoint(long ptr); + // struct LDKFundingInfo CResult_FundingInfoDecodeErrorZ_get_ok(LDKCResult_FundingInfoDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_FundingInfoDecodeErrorZ_get_ok")] public static extern long CResult_FundingInfoDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_FundingInfoDecodeErrorZ_get_err(LDKCResult_FundingInfoDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_FundingInfoDecodeErrorZ_get_err")] public static extern long CResult_FundingInfoDecodeErrorZ_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_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); @@ -1768,14 +1836,14 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok")] public static extern long CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_get_err")] public static extern long CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(long _owner); - // enum LDKPaymentFailureReason CResult_PaymentFailureReasonDecodeErrorZ_get_ok(LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_get_ok")] public static extern PaymentFailureReason CResult_PaymentFailureReasonDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_PaymentFailureReasonDecodeErrorZ_get_err(LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_get_err")] public static extern long CResult_PaymentFailureReasonDecodeErrorZ_get_err(long _owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_U128Z_ty_from_ptr")] public static extern long LDKCOption_U128Z_ty_from_ptr(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_U128Z_Some_get_some")] public static extern long LDKCOption_U128Z_Some_get_some(long ptr); [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); + // struct LDKCOption_PaymentFailureReasonZ CResult_COption_PaymentFailureReasonZDecodeErrorZ_get_ok(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_PaymentFailureReasonZDecodeErrorZ_get_ok")] public static extern long CResult_COption_PaymentFailureReasonZDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_COption_PaymentFailureReasonZDecodeErrorZ_get_err(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_PaymentFailureReasonZDecodeErrorZ_get_err")] public static extern long CResult_COption_PaymentFailureReasonZDecodeErrorZ_get_err(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_U128Z_ty_from_ptr")] public static extern long LDKCOption_U128Z_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_U128Z_Some_get_some")] public static extern long LDKCOption_U128Z_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); @@ -1797,6 +1865,11 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_FundingGenerationReady_get_channel_value_satoshis")] public static extern long LDKEvent_FundingGenerationReady_get_channel_value_satoshis(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_FundingGenerationReady_get_output_script")] public static extern long LDKEvent_FundingGenerationReady_get_output_script(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_FundingGenerationReady_get_user_channel_id")] public static extern long LDKEvent_FundingGenerationReady_get_user_channel_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_FundingTxBroadcastSafe_get_channel_id")] public static extern long LDKEvent_FundingTxBroadcastSafe_get_channel_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_FundingTxBroadcastSafe_get_user_channel_id")] public static extern long LDKEvent_FundingTxBroadcastSafe_get_user_channel_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_FundingTxBroadcastSafe_get_funding_txo")] public static extern long LDKEvent_FundingTxBroadcastSafe_get_funding_txo(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_FundingTxBroadcastSafe_get_counterparty_node_id")] public static extern long LDKEvent_FundingTxBroadcastSafe_get_counterparty_node_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_FundingTxBroadcastSafe_get_former_temporary_channel_id")] public static extern long LDKEvent_FundingTxBroadcastSafe_get_former_temporary_channel_id(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentClaimable_get_receiver_node_id")] public static extern long LDKEvent_PaymentClaimable_get_receiver_node_id(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentClaimable_get_payment_hash")] public static extern long LDKEvent_PaymentClaimable_get_payment_hash(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentClaimable_get_onion_fields")] public static extern long LDKEvent_PaymentClaimable_get_onion_fields(long ptr); @@ -1812,9 +1885,13 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentClaimed_get_purpose")] public static extern long LDKEvent_PaymentClaimed_get_purpose(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentClaimed_get_htlcs")] public static extern long LDKEvent_PaymentClaimed_get_htlcs(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentClaimed_get_sender_intended_total_msat")] public static extern long LDKEvent_PaymentClaimed_get_sender_intended_total_msat(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentClaimed_get_onion_fields")] public static extern long LDKEvent_PaymentClaimed_get_onion_fields(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ConnectionNeeded_get_node_id")] public static extern long LDKEvent_ConnectionNeeded_get_node_id(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ConnectionNeeded_get_addresses")] public static extern long LDKEvent_ConnectionNeeded_get_addresses(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_InvoiceRequestFailed_get_payment_id")] public static extern long LDKEvent_InvoiceRequestFailed_get_payment_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_InvoiceReceived_get_payment_id")] public static extern long LDKEvent_InvoiceReceived_get_payment_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_InvoiceReceived_get_invoice")] public static extern long LDKEvent_InvoiceReceived_get_invoice(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_InvoiceReceived_get_context")] public static extern long LDKEvent_InvoiceReceived_get_context(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_InvoiceReceived_get_responder")] public static extern long LDKEvent_InvoiceReceived_get_responder(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentSent_get_payment_id")] public static extern long LDKEvent_PaymentSent_get_payment_id(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentSent_get_payment_preimage")] public static extern long LDKEvent_PaymentSent_get_payment_preimage(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentSent_get_payment_hash")] public static extern long LDKEvent_PaymentSent_get_payment_hash(long ptr); @@ -1871,21 +1948,30 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ChannelClosed_get_channel_capacity_sats")] public static extern long LDKEvent_ChannelClosed_get_channel_capacity_sats(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ChannelClosed_get_channel_funding_txo")] public static extern long LDKEvent_ChannelClosed_get_channel_funding_txo(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_DiscardFunding_get_channel_id")] public static extern long LDKEvent_DiscardFunding_get_channel_id(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_DiscardFunding_get_transaction")] public static extern long LDKEvent_DiscardFunding_get_transaction(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_DiscardFunding_get_funding_info")] public static extern long LDKEvent_DiscardFunding_get_funding_info(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_OpenChannelRequest_get_temporary_channel_id")] public static extern long LDKEvent_OpenChannelRequest_get_temporary_channel_id(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_OpenChannelRequest_get_counterparty_node_id")] public static extern long LDKEvent_OpenChannelRequest_get_counterparty_node_id(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_OpenChannelRequest_get_funding_satoshis")] public static extern long LDKEvent_OpenChannelRequest_get_funding_satoshis(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_OpenChannelRequest_get_push_msat")] public static extern long LDKEvent_OpenChannelRequest_get_push_msat(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_OpenChannelRequest_get_channel_type")] public static extern long LDKEvent_OpenChannelRequest_get_channel_type(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_OpenChannelRequest_get_is_announced")] public static extern bool LDKEvent_OpenChannelRequest_get_is_announced(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_OpenChannelRequest_get_params")] public static extern long LDKEvent_OpenChannelRequest_get_params(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_HTLCHandlingFailed_get_prev_channel_id")] public static extern long LDKEvent_HTLCHandlingFailed_get_prev_channel_id(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_HTLCHandlingFailed_get_failed_next_destination")] public static extern long LDKEvent_HTLCHandlingFailed_get_failed_next_destination(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_BumpTransaction_get_bump_transaction")] public static extern long LDKEvent_BumpTransaction_get_bump_transaction(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_OnionMessageIntercepted_get_peer_node_id")] public static extern long LDKEvent_OnionMessageIntercepted_get_peer_node_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_OnionMessageIntercepted_get_message")] public static extern long LDKEvent_OnionMessageIntercepted_get_message(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_OnionMessagePeerConnected_get_peer_node_id")] public static extern long LDKEvent_OnionMessagePeerConnected_get_peer_node_id(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_EventZ_ty_from_ptr")] public static extern long LDKCOption_EventZ_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_EventZ_Some_get_some")] public static extern long LDKCOption_EventZ_Some_get_some(long ptr); // struct LDKCOption_EventZ CResult_COption_EventZDecodeErrorZ_get_ok(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_EventZDecodeErrorZ_get_ok")] public static extern long CResult_COption_EventZDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_COption_EventZDecodeErrorZ_get_err(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_EventZDecodeErrorZ_get_err")] public static extern long CResult_COption_EventZDecodeErrorZ_get_err(long _owner); + // struct LDKNonce CResult_NonceDecodeErrorZ_get_ok(LDKCResult_NonceDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NonceDecodeErrorZ_get_ok")] public static extern long CResult_NonceDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_NonceDecodeErrorZ_get_err(LDKCResult_NonceDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NonceDecodeErrorZ_get_err")] public static extern long CResult_NonceDecodeErrorZ_get_err(long _owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBolt11ParseError_ty_from_ptr")] public static extern long LDKBolt11ParseError_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBolt11ParseError_Bech32Error_get_bech32_error")] public static extern long LDKBolt11ParseError_Bech32Error_get_bech32_error(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBolt11ParseError_ParseAmountError_get_parse_amount_error")] public static extern int LDKBolt11ParseError_ParseAmountError_get_parse_amount_error(long ptr); @@ -1945,6 +2031,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BigSizeDecodeErrorZ_get_ok")] public static extern long CResult_BigSizeDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_BigSizeDecodeErrorZ_get_err(LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BigSizeDecodeErrorZ_get_err")] public static extern long CResult_BigSizeDecodeErrorZ_get_err(long _owner); + // struct LDKUntrustedString CResult_UntrustedStringDecodeErrorZ_get_ok(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR owner); + [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 LDKHostname CResult_HostnameDecodeErrorZ_get_ok(LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HostnameDecodeErrorZ_get_ok")] public static extern long CResult_HostnameDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_HostnameDecodeErrorZ_get_err(LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR owner); @@ -1957,10 +2047,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_get_ok")] public static extern long CResult_TransactionU16LenLimitedDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_TransactionU16LenLimitedDecodeErrorZ_get_err(LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_get_err")] public static extern long CResult_TransactionU16LenLimitedDecodeErrorZ_get_err(long _owner); - // struct LDKUntrustedString CResult_UntrustedStringDecodeErrorZ_get_ok(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR owner); - [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); @@ -1969,6 +2055,14 @@ internal class bindings { [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); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple__u832u16Z_get_b")] public static extern short C2Tuple__u832u16Z_get_b(long _owner); + // struct LDKBlindedPayInfo CResult_BlindedPayInfoDecodeErrorZ_get_ok(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_get_ok")] public static extern long CResult_BlindedPayInfoDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_BlindedPayInfoDecodeErrorZ_get_err(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_get_err")] public static extern long CResult_BlindedPayInfoDecodeErrorZ_get_err(long _owner); + // struct LDKBlindedPaymentPath CResult_BlindedPaymentPathNoneZ_get_ok(LDKCResult_BlindedPaymentPathNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPaymentPathNoneZ_get_ok")] public static extern long CResult_BlindedPaymentPathNoneZ_get_ok(long _owner); + // void CResult_BlindedPaymentPathNoneZ_get_err(LDKCResult_BlindedPaymentPathNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPaymentPathNoneZ_get_err")] public static extern void CResult_BlindedPaymentPathNoneZ_get_err(long _owner); // struct LDKPaymentRelay CResult_PaymentRelayDecodeErrorZ_get_ok(LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentRelayDecodeErrorZ_get_ok")] public static extern long CResult_PaymentRelayDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_PaymentRelayDecodeErrorZ_get_err(LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR owner); @@ -1993,20 +2087,12 @@ internal class bindings { [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); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_b")] public static extern long C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_b(long _owner); - // struct LDKRouteParameters C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_c(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_c")] public static extern long C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_c(long _owner); - // struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_ok(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR owner); - [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 LDKResponder CResult_ResponderDecodeErrorZ_get_ok(LDKCResult_ResponderDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ResponderDecodeErrorZ_get_ok")] public static extern long CResult_ResponderDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_ResponderDecodeErrorZ_get_err(LDKCResult_ResponderDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ResponderDecodeErrorZ_get_err")] public static extern long CResult_ResponderDecodeErrorZ_get_err(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_MessageContextZ_ty_from_ptr")] public static extern long LDKCOption_MessageContextZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_MessageContextZ_Some_get_some")] public static extern long LDKCOption_MessageContextZ_Some_get_some(long ptr); // 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); @@ -2042,22 +2128,20 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SendSuccessSendErrorZ_get_ok")] public static extern long CResult_SendSuccessSendErrorZ_get_ok(long _owner); // struct LDKSendError CResult_SendSuccessSendErrorZ_get_err(LDKCResult_SendSuccessSendErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SendSuccessSendErrorZ_get_err")] public static extern long CResult_SendSuccessSendErrorZ_get_err(long _owner); - // struct LDKBlindedPath CResult_BlindedPathNoneZ_get_ok(LDKCResult_BlindedPathNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathNoneZ_get_ok")] public static extern long CResult_BlindedPathNoneZ_get_ok(long _owner); - // void CResult_BlindedPathNoneZ_get_err(LDKCResult_BlindedPathNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathNoneZ_get_err")] public static extern void CResult_BlindedPathNoneZ_get_err(long _owner); - // struct LDKC2Tuple_BlindedPayInfoBlindedPathZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_get_ok(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_get_ok")] public static extern long CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_get_ok(long _owner); - // void CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_get_err(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_get_err")] public static extern void CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_get_err(long _owner); - // struct LDKBlindedPath CResult_BlindedPathDecodeErrorZ_get_ok(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathDecodeErrorZ_get_ok")] public static extern long CResult_BlindedPathDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_BlindedPathDecodeErrorZ_get_err(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathDecodeErrorZ_get_err")] public static extern long CResult_BlindedPathDecodeErrorZ_get_err(long _owner); + // void CResult_NoneSendErrorZ_get_ok(LDKCResult_NoneSendErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneSendErrorZ_get_ok")] public static extern void CResult_NoneSendErrorZ_get_ok(long _owner); + // struct LDKSendError CResult_NoneSendErrorZ_get_err(LDKCResult_NoneSendErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneSendErrorZ_get_err")] public static extern long CResult_NoneSendErrorZ_get_err(long _owner); // struct LDKBlindedHop CResult_BlindedHopDecodeErrorZ_get_ok(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedHopDecodeErrorZ_get_ok")] public static extern long CResult_BlindedHopDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_BlindedHopDecodeErrorZ_get_err(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedHopDecodeErrorZ_get_err")] public static extern long CResult_BlindedHopDecodeErrorZ_get_err(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKSignOrCreationError_ty_from_ptr")] public static extern long LDKSignOrCreationError_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKSignOrCreationError_CreationError_get_creation_error")] public static extern CreationError LDKSignOrCreationError_CreationError_get_creation_error(long ptr); + // struct LDKBolt11Invoice CResult_Bolt11InvoiceSignOrCreationErrorZ_get_ok(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_get_ok")] public static extern long CResult_Bolt11InvoiceSignOrCreationErrorZ_get_ok(long _owner); + // struct LDKSignOrCreationError CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err")] public static extern long CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err(long _owner); // struct LDKInvoiceError CResult_InvoiceErrorDecodeErrorZ_get_ok(LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR owner); [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); @@ -2226,10 +2310,26 @@ internal class bindings { [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); + // struct LDKOutPoint C2Tuple_OutPointCVec_u64ZZ_get_a(LDKC2Tuple_OutPointCVec_u64ZZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OutPointCVec_u64ZZ_get_a")] public static extern long C2Tuple_OutPointCVec_u64ZZ_get_a(long _owner); + // struct LDKCVec_u64Z C2Tuple_OutPointCVec_u64ZZ_get_b(LDKC2Tuple_OutPointCVec_u64ZZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OutPointCVec_u64ZZ_get_b")] public static extern long C2Tuple_OutPointCVec_u64ZZ_get_b(long _owner); + // struct LDKBlindedMessagePath CResult_BlindedMessagePathDecodeErrorZ_get_ok(LDKCResult_BlindedMessagePathDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedMessagePathDecodeErrorZ_get_ok")] public static extern long CResult_BlindedMessagePathDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_BlindedMessagePathDecodeErrorZ_get_err(LDKCResult_BlindedMessagePathDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedMessagePathDecodeErrorZ_get_err")] public static extern long CResult_BlindedMessagePathDecodeErrorZ_get_err(long _owner); + // struct LDKBlindedMessagePath CResult_BlindedMessagePathNoneZ_get_ok(LDKCResult_BlindedMessagePathNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedMessagePathNoneZ_get_ok")] public static extern long CResult_BlindedMessagePathNoneZ_get_ok(long _owner); + // void CResult_BlindedMessagePathNoneZ_get_err(LDKCResult_BlindedMessagePathNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedMessagePathNoneZ_get_err")] public static extern void CResult_BlindedMessagePathNoneZ_get_err(long _owner); + // struct LDKMessageContext CResult_MessageContextDecodeErrorZ_get_ok(LDKCResult_MessageContextDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_MessageContextDecodeErrorZ_get_ok")] public static extern long CResult_MessageContextDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_MessageContextDecodeErrorZ_get_err(LDKCResult_MessageContextDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_MessageContextDecodeErrorZ_get_err")] public static extern long CResult_MessageContextDecodeErrorZ_get_err(long _owner); + // struct LDKOffersContext CResult_OffersContextDecodeErrorZ_get_ok(LDKCResult_OffersContextDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OffersContextDecodeErrorZ_get_ok")] public static extern long CResult_OffersContextDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_OffersContextDecodeErrorZ_get_err(LDKCResult_OffersContextDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OffersContextDecodeErrorZ_get_err")] public static extern long CResult_OffersContextDecodeErrorZ_get_err(long _owner); public interface LDKPersister { long persist_manager(long channel_manager); long persist_graph(long network_graph); @@ -2259,8 +2359,8 @@ 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_funding_outpoint, long data, long update_id); - ChannelMonitorUpdateStatus update_persisted_channel(long channel_funding_outpoint, long update, long data, long update_id); + ChannelMonitorUpdateStatus persist_new_channel(long channel_funding_outpoint, long monitor); + ChannelMonitorUpdateStatus update_persisted_channel(long channel_funding_outpoint, long monitor_update, long monitor); 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); @@ -2280,10 +2380,10 @@ internal class bindings { ret[1] = i; return ret; } - // 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); + // LDKChannelMonitorUpdateStatus Persist_persist_new_channel LDKPersist *NONNULL_PTR this_arg, struct LDKOutPoint channel_funding_outpoint, const struct LDKChannelMonitor *NONNULL_PTR monitor + [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 _monitor); + // LDKChannelMonitorUpdateStatus Persist_update_persisted_channel LDKPersist *NONNULL_PTR this_arg, struct LDKOutPoint channel_funding_outpoint, struct LDKChannelMonitorUpdate monitor_update, const struct LDKChannelMonitor *NONNULL_PTR monitor + [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 _monitor_update, long _monitor); // 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 { @@ -2371,7 +2471,7 @@ internal class bindings { // 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); + long handle_event(long _event); } [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEventHandler_new")] public static extern long LDKEventHandler_new_native(long impl_idx); public static long[] LDKEventHandler_new(LDKEventHandler impl) { @@ -2390,8 +2490,8 @@ internal class bindings { ret[1] = i; return ret; } - // void EventHandler_handle_event LDKEventHandler *NONNULL_PTR this_arg, struct LDKEvent event - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EventHandler_handle_event")] public static extern void EventHandler_handle_event(long _this_arg, long _event); + // LDKCResult_NoneReplayEventZ EventHandler_handle_event LDKEventHandler *NONNULL_PTR this_arg, struct LDKEvent event + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EventHandler_handle_event")] public static extern long EventHandler_handle_event(long _this_arg, long _event); public interface LDKEventsProvider { void process_pending_events(long handler); } @@ -2563,7 +2663,7 @@ internal class bindings { // LDKCOption_CVec_ThirtyTwoBytesZZ ChannelMessageHandler_get_chain_hashes LDKChannelMessageHandler *NONNULL_PTR this_arg [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_get_chain_hashes")] public static extern long ChannelMessageHandler_get_chain_hashes(long _this_arg); public interface LDKOffersMessageHandler { - long handle_message(long message); + long handle_message(long message, long context, long responder); long release_pending_messages(); } [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKOffersMessageHandler_new")] public static extern long LDKOffersMessageHandler_new_native(long impl_idx); @@ -2583,10 +2683,38 @@ internal class bindings { ret[1] = i; return ret; } - // LDKCOption_OffersMessageZ OffersMessageHandler_handle_message LDKOffersMessageHandler *NONNULL_PTR this_arg, struct LDKOffersMessage message - [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 + // LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ OffersMessageHandler_handle_message LDKOffersMessageHandler *NONNULL_PTR this_arg, struct LDKOffersMessage message, struct LDKCOption_OffersContextZ context, struct LDKResponder responder + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OffersMessageHandler_handle_message")] public static extern long OffersMessageHandler_handle_message(long _this_arg, long _message, long _context, long _responder); + // LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ 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 LDKAsyncPaymentsMessageHandler { + long held_htlc_available(long message, long responder); + void release_held_htlc(long message); + long release_pending_messages(); + } + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKAsyncPaymentsMessageHandler_new")] public static extern long LDKAsyncPaymentsMessageHandler_new_native(long impl_idx); + public static long[] LDKAsyncPaymentsMessageHandler_new(LDKAsyncPaymentsMessageHandler 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] = LDKAsyncPaymentsMessageHandler_new_native(i); + ret[1] = i; + return ret; + } + // LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ AsyncPaymentsMessageHandler_held_htlc_available LDKAsyncPaymentsMessageHandler *NONNULL_PTR this_arg, struct LDKHeldHtlcAvailable message, struct LDKResponder responder + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AsyncPaymentsMessageHandler_held_htlc_available")] public static extern long AsyncPaymentsMessageHandler_held_htlc_available(long _this_arg, long _message, long _responder); + // void AsyncPaymentsMessageHandler_release_held_htlc LDKAsyncPaymentsMessageHandler *NONNULL_PTR this_arg, struct LDKReleaseHeldHtlc message + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AsyncPaymentsMessageHandler_release_held_htlc")] public static extern void AsyncPaymentsMessageHandler_release_held_htlc(long _this_arg, long _message); + // LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ AsyncPaymentsMessageHandler_release_pending_messages LDKAsyncPaymentsMessageHandler *NONNULL_PTR this_arg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AsyncPaymentsMessageHandler_release_pending_messages")] public static extern long AsyncPaymentsMessageHandler_release_pending_messages(long _this_arg); public interface LDKNodeIdLookUp { long next_node_id(long short_channel_id); } @@ -2668,7 +2796,6 @@ internal class bindings { // LDKInitFeatures RoutingMessageHandler_provided_init_features LDKRoutingMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingMessageHandler_provided_init_features")] public static extern long RoutingMessageHandler_provided_init_features(long _this_arg, long _their_node_id); public interface LDKOnionMessageHandler { - long get_and_clear_connections_needed(); void handle_onion_message(long peer_node_id, long msg); long next_onion_message_for_peer(long peer_node_id); long peer_connected(long their_node_id, long init, bool inbound); @@ -2694,8 +2821,6 @@ internal class bindings { ret[1] = i; return ret; } - // LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ OnionMessageHandler_get_and_clear_connections_needed LDKOnionMessageHandler *NONNULL_PTR this_arg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessageHandler_get_and_clear_connections_needed")] public static extern long OnionMessageHandler_get_and_clear_connections_needed(long _this_arg); // void OnionMessageHandler_handle_onion_message LDKOnionMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey peer_node_id, const struct LDKOnionMessage *NONNULL_PTR msg [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessageHandler_handle_onion_message")] public static extern void OnionMessageHandler_handle_onion_message(long _this_arg, long _peer_node_id, long _msg); // LDKOnionMessage OnionMessageHandler_next_onion_message_for_peer LDKOnionMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey peer_node_id @@ -2735,6 +2860,8 @@ internal class bindings { public interface LDKCustomMessageHandler { long handle_custom_message(long msg, long sender_node_id); long get_and_clear_pending_msg(); + void peer_disconnected(long their_node_id); + long peer_connected(long their_node_id, long msg, bool inbound); long provided_node_features(); long provided_init_features(long their_node_id); } @@ -2759,12 +2886,16 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CustomMessageHandler_handle_custom_message")] public static extern long CustomMessageHandler_handle_custom_message(long _this_arg, long _msg, long _sender_node_id); // LDKCVec_C2Tuple_PublicKeyTypeZZ CustomMessageHandler_get_and_clear_pending_msg LDKCustomMessageHandler *NONNULL_PTR this_arg [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CustomMessageHandler_get_and_clear_pending_msg")] public static extern long CustomMessageHandler_get_and_clear_pending_msg(long _this_arg); + // void CustomMessageHandler_peer_disconnected LDKCustomMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CustomMessageHandler_peer_disconnected")] public static extern void CustomMessageHandler_peer_disconnected(long _this_arg, long _their_node_id); + // LDKCResult_NoneNoneZ CustomMessageHandler_peer_connected LDKCustomMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg, bool inbound + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CustomMessageHandler_peer_connected")] public static extern long CustomMessageHandler_peer_connected(long _this_arg, long _their_node_id, long _msg, bool _inbound); // LDKNodeFeatures CustomMessageHandler_provided_node_features LDKCustomMessageHandler *NONNULL_PTR this_arg [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CustomMessageHandler_provided_node_features")] public static extern long CustomMessageHandler_provided_node_features(long _this_arg); // LDKInitFeatures CustomMessageHandler_provided_init_features LDKCustomMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CustomMessageHandler_provided_init_features")] public static extern long CustomMessageHandler_provided_init_features(long _this_arg, long _their_node_id); public interface LDKCustomOnionMessageHandler { - long handle_custom_message(long msg); + long handle_custom_message(long message, long context, long responder); long read_custom_message(long message_type, long buffer); long release_pending_custom_messages(); } @@ -2785,11 +2916,11 @@ internal class bindings { ret[1] = i; return ret; } - // LDKCOption_OnionMessageContentsZ CustomOnionMessageHandler_handle_custom_message LDKCustomOnionMessageHandler *NONNULL_PTR this_arg, struct LDKOnionMessageContents msg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CustomOnionMessageHandler_handle_custom_message")] public static extern long CustomOnionMessageHandler_handle_custom_message(long _this_arg, long _msg); + // LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ CustomOnionMessageHandler_handle_custom_message LDKCustomOnionMessageHandler *NONNULL_PTR this_arg, struct LDKOnionMessageContents message, struct LDKCOption_CVec_u8ZZ context, struct LDKResponder responder + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CustomOnionMessageHandler_handle_custom_message")] public static extern long CustomOnionMessageHandler_handle_custom_message(long _this_arg, long _message, long _context, long _responder); // LDKCResult_COption_OnionMessageContentsZDecodeErrorZ CustomOnionMessageHandler_read_custom_message LDKCustomOnionMessageHandler *NONNULL_PTR this_arg, uint64_t message_type, struct LDKu8slice buffer [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CustomOnionMessageHandler_read_custom_message")] public static extern long CustomOnionMessageHandler_read_custom_message(long _this_arg, long _message_type, long _buffer); - // LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ CustomOnionMessageHandler_release_pending_custom_messages LDKCustomOnionMessageHandler *NONNULL_PTR this_arg + // LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ CustomOnionMessageHandler_release_pending_custom_messages LDKCustomOnionMessageHandler *NONNULL_PTR this_arg [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CustomOnionMessageHandler_release_pending_custom_messages")] public static extern long CustomOnionMessageHandler_release_pending_custom_messages(long _this_arg); public interface LDKSocketDescriptor { long send_data(long data, bool resume_read); @@ -2820,6 +2951,8 @@ 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); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBolt12PaymentError_ty_from_ptr")] public static extern long LDKBolt12PaymentError_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBolt12PaymentError_SendingFailed_get_sending_failed")] public static extern RetryableSendFailure LDKBolt12PaymentError_SendingFailed_get_sending_failed(long ptr); public interface LDKSignBolt12InvoiceFn { long sign_invoice(long message); } @@ -3066,8 +3199,20 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_u64Z_clone_ptr")] public static extern long COption_u64Z_clone_ptr(long _arg); // struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_u64Z_clone")] public static extern long COption_u64Z_clone(long _orig); - // void CVec_BlindedPathZ_free(struct LDKCVec_BlindedPathZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_BlindedPathZ_free")] public static extern void CVec_BlindedPathZ_free(long __res); + // void CVec_BlindedMessagePathZ_free(struct LDKCVec_BlindedMessagePathZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_BlindedMessagePathZ_free")] public static extern void CVec_BlindedMessagePathZ_free(long __res); + // struct LDKCResult_RefundDecodeErrorZ CResult_RefundDecodeErrorZ_ok(struct LDKRefund o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RefundDecodeErrorZ_ok")] public static extern long CResult_RefundDecodeErrorZ_ok(long _o); + // struct LDKCResult_RefundDecodeErrorZ CResult_RefundDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RefundDecodeErrorZ_err")] public static extern long CResult_RefundDecodeErrorZ_err(long _e); + // bool CResult_RefundDecodeErrorZ_is_ok(const struct LDKCResult_RefundDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RefundDecodeErrorZ_is_ok")] public static extern bool CResult_RefundDecodeErrorZ_is_ok(long _o); + // void CResult_RefundDecodeErrorZ_free(struct LDKCResult_RefundDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RefundDecodeErrorZ_free")] public static extern void CResult_RefundDecodeErrorZ_free(long __res); + // uint64_t CResult_RefundDecodeErrorZ_clone_ptr(LDKCResult_RefundDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RefundDecodeErrorZ_clone_ptr")] public static extern long CResult_RefundDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_RefundDecodeErrorZ CResult_RefundDecodeErrorZ_clone(const struct LDKCResult_RefundDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RefundDecodeErrorZ_clone")] public static extern long CResult_RefundDecodeErrorZ_clone(long _orig); // struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_ok(struct LDKRefund o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RefundBolt12ParseErrorZ_ok")] public static extern long CResult_RefundBolt12ParseErrorZ_ok(long _o); // struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_err(struct LDKBolt12ParseError e); @@ -3198,6 +3343,8 @@ internal class bindings { [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_StrZ_free(struct LDKCVec_StrZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_StrZ_free")] public static extern void CVec_StrZ_free(long __res); // 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); @@ -3242,18 +3389,18 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ThirtyTwoBytesNoneZ_clone_ptr")] public static extern long CResult_ThirtyTwoBytesNoneZ_clone_ptr(long _arg); // struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_clone(const struct LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ThirtyTwoBytesNoneZ_clone")] public static extern long CResult_ThirtyTwoBytesNoneZ_clone(long _orig); - // struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_ok(struct LDKBlindedPayInfo o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_ok")] public static extern long CResult_BlindedPayInfoDecodeErrorZ_ok(long _o); - // struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_err")] public static extern long CResult_BlindedPayInfoDecodeErrorZ_err(long _e); - // bool CResult_BlindedPayInfoDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_is_ok")] public static extern bool CResult_BlindedPayInfoDecodeErrorZ_is_ok(long _o); - // void CResult_BlindedPayInfoDecodeErrorZ_free(struct LDKCResult_BlindedPayInfoDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_free")] public static extern void CResult_BlindedPayInfoDecodeErrorZ_free(long __res); - // uint64_t CResult_BlindedPayInfoDecodeErrorZ_clone_ptr(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_clone_ptr")] public static extern long CResult_BlindedPayInfoDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_clone(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_clone")] public static extern long CResult_BlindedPayInfoDecodeErrorZ_clone(long _orig); + // struct LDKCResult_Bolt12InvoiceDecodeErrorZ CResult_Bolt12InvoiceDecodeErrorZ_ok(struct LDKBolt12Invoice o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12InvoiceDecodeErrorZ_ok")] public static extern long CResult_Bolt12InvoiceDecodeErrorZ_ok(long _o); + // struct LDKCResult_Bolt12InvoiceDecodeErrorZ CResult_Bolt12InvoiceDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12InvoiceDecodeErrorZ_err")] public static extern long CResult_Bolt12InvoiceDecodeErrorZ_err(long _e); + // bool CResult_Bolt12InvoiceDecodeErrorZ_is_ok(const struct LDKCResult_Bolt12InvoiceDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12InvoiceDecodeErrorZ_is_ok")] public static extern bool CResult_Bolt12InvoiceDecodeErrorZ_is_ok(long _o); + // void CResult_Bolt12InvoiceDecodeErrorZ_free(struct LDKCResult_Bolt12InvoiceDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12InvoiceDecodeErrorZ_free")] public static extern void CResult_Bolt12InvoiceDecodeErrorZ_free(long __res); + // uint64_t CResult_Bolt12InvoiceDecodeErrorZ_clone_ptr(LDKCResult_Bolt12InvoiceDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12InvoiceDecodeErrorZ_clone_ptr")] public static extern long CResult_Bolt12InvoiceDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_Bolt12InvoiceDecodeErrorZ CResult_Bolt12InvoiceDecodeErrorZ_clone(const struct LDKCResult_Bolt12InvoiceDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12InvoiceDecodeErrorZ_clone")] public static extern long CResult_Bolt12InvoiceDecodeErrorZ_clone(long _orig); // struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok")] public static extern long CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(long _o); // struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e); @@ -3348,18 +3495,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HTLCDescriptorDecodeErrorZ_clone_ptr")] public static extern long CResult_HTLCDescriptorDecodeErrorZ_clone_ptr(long _arg); // struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_clone(const struct LDKCResult_HTLCDescriptorDecodeErrorZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HTLCDescriptorDecodeErrorZ_clone")] public static extern long CResult_HTLCDescriptorDecodeErrorZ_clone(long _orig); - // struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneNoneZ_ok")] public static extern long CResult_NoneNoneZ_ok(); - // struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneNoneZ_err")] public static extern long CResult_NoneNoneZ_err(); - // bool CResult_NoneNoneZ_is_ok(const struct LDKCResult_NoneNoneZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneNoneZ_is_ok")] public static extern bool CResult_NoneNoneZ_is_ok(long _o); - // void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneNoneZ_free")] public static extern void CResult_NoneNoneZ_free(long __res); - // uint64_t CResult_NoneNoneZ_clone_ptr(LDKCResult_NoneNoneZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneNoneZ_clone_ptr")] public static extern long CResult_NoneNoneZ_clone_ptr(long _arg); - // struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_clone(const struct LDKCResult_NoneNoneZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneNoneZ_clone")] public static extern long CResult_NoneNoneZ_clone(long _orig); // struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_ok(struct LDKPublicKey o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeyNoneZ_ok")] public static extern long CResult_PublicKeyNoneZ_ok(long _o); // struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_err(void); @@ -3372,6 +3507,30 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeyNoneZ_clone_ptr")] public static extern long CResult_PublicKeyNoneZ_clone_ptr(long _arg); // struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_clone(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeyNoneZ_clone")] public static extern long CResult_PublicKeyNoneZ_clone(long _orig); + // struct LDKCResult__u832NoneZ CResult__u832NoneZ_ok(struct LDKThirtyTwoBytes o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult__u832NoneZ_ok")] public static extern long CResult__u832NoneZ_ok(long _o); + // struct LDKCResult__u832NoneZ CResult__u832NoneZ_err(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult__u832NoneZ_err")] public static extern long CResult__u832NoneZ_err(); + // bool CResult__u832NoneZ_is_ok(const struct LDKCResult__u832NoneZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult__u832NoneZ_is_ok")] public static extern bool CResult__u832NoneZ_is_ok(long _o); + // void CResult__u832NoneZ_free(struct LDKCResult__u832NoneZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult__u832NoneZ_free")] public static extern void CResult__u832NoneZ_free(long __res); + // uint64_t CResult__u832NoneZ_clone_ptr(LDKCResult__u832NoneZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult__u832NoneZ_clone_ptr")] public static extern long CResult__u832NoneZ_clone_ptr(long _arg); + // struct LDKCResult__u832NoneZ CResult__u832NoneZ_clone(const struct LDKCResult__u832NoneZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult__u832NoneZ_clone")] public static extern long CResult__u832NoneZ_clone(long _orig); + // struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneNoneZ_ok")] public static extern long CResult_NoneNoneZ_ok(); + // struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneNoneZ_err")] public static extern long CResult_NoneNoneZ_err(); + // bool CResult_NoneNoneZ_is_ok(const struct LDKCResult_NoneNoneZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneNoneZ_is_ok")] public static extern bool CResult_NoneNoneZ_is_ok(long _o); + // void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneNoneZ_free")] public static extern void CResult_NoneNoneZ_free(long __res); + // uint64_t CResult_NoneNoneZ_clone_ptr(LDKCResult_NoneNoneZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneNoneZ_clone_ptr")] public static extern long CResult_NoneNoneZ_clone_ptr(long _arg); + // struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_clone(const struct LDKCResult_NoneNoneZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneNoneZ_clone")] public static extern long CResult_NoneNoneZ_clone(long _orig); // struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_some(struct LDKBigEndianScalar o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_BigEndianScalarZ_some")] public static extern long COption_BigEndianScalarZ_some(long _o); // struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_none(void); @@ -3382,8 +3541,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_BigEndianScalarZ_clone_ptr")] public static extern long COption_BigEndianScalarZ_clone_ptr(long _arg); // struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_clone(const struct LDKCOption_BigEndianScalarZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_BigEndianScalarZ_clone")] public static extern long COption_BigEndianScalarZ_clone(long _orig); - // void CVec_U5Z_free(struct LDKCVec_U5Z _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_U5Z_free")] public static extern void CVec_U5Z_free(long __res); // struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RecoverableSignatureNoneZ_ok")] public static extern long CResult_RecoverableSignatureNoneZ_ok(long _o); // struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void); @@ -3420,18 +3577,18 @@ internal class bindings { [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); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err")] public static extern long CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err(long _e); - // bool CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok(const struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok")] public static extern bool CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok(long _o); - // void CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free(struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free")] public static extern void CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free(long __res); - // uint64_t CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone_ptr(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone_ptr")] public static extern long CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(const struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone")] public static extern long CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(long _orig); + // struct LDKCResult_EcdsaChannelSignerDecodeErrorZ CResult_EcdsaChannelSignerDecodeErrorZ_ok(struct LDKEcdsaChannelSigner o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_EcdsaChannelSignerDecodeErrorZ_ok")] public static extern long CResult_EcdsaChannelSignerDecodeErrorZ_ok(long _o); + // struct LDKCResult_EcdsaChannelSignerDecodeErrorZ CResult_EcdsaChannelSignerDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_EcdsaChannelSignerDecodeErrorZ_err")] public static extern long CResult_EcdsaChannelSignerDecodeErrorZ_err(long _e); + // bool CResult_EcdsaChannelSignerDecodeErrorZ_is_ok(const struct LDKCResult_EcdsaChannelSignerDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_EcdsaChannelSignerDecodeErrorZ_is_ok")] public static extern bool CResult_EcdsaChannelSignerDecodeErrorZ_is_ok(long _o); + // void CResult_EcdsaChannelSignerDecodeErrorZ_free(struct LDKCResult_EcdsaChannelSignerDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_EcdsaChannelSignerDecodeErrorZ_free")] public static extern void CResult_EcdsaChannelSignerDecodeErrorZ_free(long __res); + // uint64_t CResult_EcdsaChannelSignerDecodeErrorZ_clone_ptr(LDKCResult_EcdsaChannelSignerDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_EcdsaChannelSignerDecodeErrorZ_clone_ptr")] public static extern long CResult_EcdsaChannelSignerDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_EcdsaChannelSignerDecodeErrorZ CResult_EcdsaChannelSignerDecodeErrorZ_clone(const struct LDKCResult_EcdsaChannelSignerDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_EcdsaChannelSignerDecodeErrorZ_clone")] public static extern long CResult_EcdsaChannelSignerDecodeErrorZ_clone(long _orig); // struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_ok(struct LDKCVec_u8Z o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_u8ZNoneZ_ok")] public static extern long CResult_CVec_u8ZNoneZ_ok(long _o); // struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_err(void); @@ -3540,6 +3697,26 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneIOErrorZ_clone_ptr")] public static extern long CResult_NoneIOErrorZ_clone_ptr(long _arg); // struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_clone(const struct LDKCResult_NoneIOErrorZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneIOErrorZ_clone")] public static extern long CResult_NoneIOErrorZ_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); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone")] public static extern long C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(long _orig); + // struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new(struct LDKThirtyTwoBytes a, struct LDKRecipientOnionFields b, struct LDKRouteParameters c); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new")] public static extern long C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new(long _a, long _b, long _c); + // void C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free")] public static extern void C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(long __res); + // struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok(struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok")] public static extern long CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok(long _o); + // struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err")] public static extern long CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err(); + // bool CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok(const struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok")] public static extern bool CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok(long _o); + // void CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free")] public static extern void CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(long __res); + // uint64_t CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone_ptr(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR arg); + [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); // void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_ChannelDetailsZ_free")] public static extern void CVec_ChannelDetailsZ_free(long __res); // struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o); @@ -3554,28 +3731,20 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteLightningErrorZ_clone_ptr")] public static extern long CResult_RouteLightningErrorZ_clone_ptr(long _arg); // struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteLightningErrorZ_clone")] public static extern long CResult_RouteLightningErrorZ_clone(long _orig); - // uint64_t C2Tuple_BlindedPayInfoBlindedPathZ_clone_ptr(LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_BlindedPayInfoBlindedPathZ_clone_ptr")] public static extern long C2Tuple_BlindedPayInfoBlindedPathZ_clone_ptr(long _arg); - // struct LDKC2Tuple_BlindedPayInfoBlindedPathZ C2Tuple_BlindedPayInfoBlindedPathZ_clone(const struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_BlindedPayInfoBlindedPathZ_clone")] public static extern long C2Tuple_BlindedPayInfoBlindedPathZ_clone(long _orig); - // struct LDKC2Tuple_BlindedPayInfoBlindedPathZ C2Tuple_BlindedPayInfoBlindedPathZ_new(struct LDKBlindedPayInfo a, struct LDKBlindedPath b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_BlindedPayInfoBlindedPathZ_new")] public static extern long C2Tuple_BlindedPayInfoBlindedPathZ_new(long _a, long _b); - // void C2Tuple_BlindedPayInfoBlindedPathZ_free(struct LDKC2Tuple_BlindedPayInfoBlindedPathZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_BlindedPayInfoBlindedPathZ_free")] public static extern void C2Tuple_BlindedPayInfoBlindedPathZ_free(long __res); - // void CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_free(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_free")] public static extern void CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_free(long __res); - // struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_ok(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_ok")] public static extern long CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_ok(long _o); - // struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_err(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_err")] public static extern long CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_err(); - // bool CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_is_ok(const struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_is_ok")] public static extern bool CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_is_ok(long _o); - // void CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_free(struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_free")] public static extern void CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_free(long __res); - // uint64_t CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone_ptr(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone_ptr")] public static extern long CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone_ptr(long _arg); - // struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone(const struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone")] public static extern long CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone(long _orig); + // void CVec_BlindedPaymentPathZ_free(struct LDKCVec_BlindedPaymentPathZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_BlindedPaymentPathZ_free")] public static extern void CVec_BlindedPaymentPathZ_free(long __res); + // struct LDKCResult_CVec_BlindedPaymentPathZNoneZ CResult_CVec_BlindedPaymentPathZNoneZ_ok(struct LDKCVec_BlindedPaymentPathZ o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_BlindedPaymentPathZNoneZ_ok")] public static extern long CResult_CVec_BlindedPaymentPathZNoneZ_ok(long _o); + // struct LDKCResult_CVec_BlindedPaymentPathZNoneZ CResult_CVec_BlindedPaymentPathZNoneZ_err(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_BlindedPaymentPathZNoneZ_err")] public static extern long CResult_CVec_BlindedPaymentPathZNoneZ_err(); + // bool CResult_CVec_BlindedPaymentPathZNoneZ_is_ok(const struct LDKCResult_CVec_BlindedPaymentPathZNoneZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_BlindedPaymentPathZNoneZ_is_ok")] public static extern bool CResult_CVec_BlindedPaymentPathZNoneZ_is_ok(long _o); + // void CResult_CVec_BlindedPaymentPathZNoneZ_free(struct LDKCResult_CVec_BlindedPaymentPathZNoneZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_BlindedPaymentPathZNoneZ_free")] public static extern void CResult_CVec_BlindedPaymentPathZNoneZ_free(long __res); + // uint64_t CResult_CVec_BlindedPaymentPathZNoneZ_clone_ptr(LDKCResult_CVec_BlindedPaymentPathZNoneZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_BlindedPaymentPathZNoneZ_clone_ptr")] public static extern long CResult_CVec_BlindedPaymentPathZNoneZ_clone_ptr(long _arg); + // struct LDKCResult_CVec_BlindedPaymentPathZNoneZ CResult_CVec_BlindedPaymentPathZNoneZ_clone(const struct LDKCResult_CVec_BlindedPaymentPathZNoneZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_BlindedPaymentPathZNoneZ_clone")] public static extern long CResult_CVec_BlindedPaymentPathZNoneZ_clone(long _orig); // void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_PublicKeyZ_free")] public static extern void CVec_PublicKeyZ_free(long __res); // struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_ok(struct LDKOnionMessagePath o); @@ -3590,18 +3759,20 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OnionMessagePathNoneZ_clone_ptr")] public static extern long CResult_OnionMessagePathNoneZ_clone_ptr(long _arg); // struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_clone(const struct LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OnionMessagePathNoneZ_clone")] public static extern long CResult_OnionMessagePathNoneZ_clone(long _orig); - // struct LDKCResult_CVec_BlindedPathZNoneZ CResult_CVec_BlindedPathZNoneZ_ok(struct LDKCVec_BlindedPathZ o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_BlindedPathZNoneZ_ok")] public static extern long CResult_CVec_BlindedPathZNoneZ_ok(long _o); - // struct LDKCResult_CVec_BlindedPathZNoneZ CResult_CVec_BlindedPathZNoneZ_err(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_BlindedPathZNoneZ_err")] public static extern long CResult_CVec_BlindedPathZNoneZ_err(); - // bool CResult_CVec_BlindedPathZNoneZ_is_ok(const struct LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_BlindedPathZNoneZ_is_ok")] public static extern bool CResult_CVec_BlindedPathZNoneZ_is_ok(long _o); - // void CResult_CVec_BlindedPathZNoneZ_free(struct LDKCResult_CVec_BlindedPathZNoneZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_BlindedPathZNoneZ_free")] public static extern void CResult_CVec_BlindedPathZNoneZ_free(long __res); - // uint64_t CResult_CVec_BlindedPathZNoneZ_clone_ptr(LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_BlindedPathZNoneZ_clone_ptr")] public static extern long CResult_CVec_BlindedPathZNoneZ_clone_ptr(long _arg); - // struct LDKCResult_CVec_BlindedPathZNoneZ CResult_CVec_BlindedPathZNoneZ_clone(const struct LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_BlindedPathZNoneZ_clone")] public static extern long CResult_CVec_BlindedPathZNoneZ_clone(long _orig); + // struct LDKCResult_CVec_BlindedMessagePathZNoneZ CResult_CVec_BlindedMessagePathZNoneZ_ok(struct LDKCVec_BlindedMessagePathZ o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_BlindedMessagePathZNoneZ_ok")] public static extern long CResult_CVec_BlindedMessagePathZNoneZ_ok(long _o); + // struct LDKCResult_CVec_BlindedMessagePathZNoneZ CResult_CVec_BlindedMessagePathZNoneZ_err(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_BlindedMessagePathZNoneZ_err")] public static extern long CResult_CVec_BlindedMessagePathZNoneZ_err(); + // bool CResult_CVec_BlindedMessagePathZNoneZ_is_ok(const struct LDKCResult_CVec_BlindedMessagePathZNoneZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_BlindedMessagePathZNoneZ_is_ok")] public static extern bool CResult_CVec_BlindedMessagePathZNoneZ_is_ok(long _o); + // void CResult_CVec_BlindedMessagePathZNoneZ_free(struct LDKCResult_CVec_BlindedMessagePathZNoneZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_BlindedMessagePathZNoneZ_free")] public static extern void CResult_CVec_BlindedMessagePathZNoneZ_free(long __res); + // uint64_t CResult_CVec_BlindedMessagePathZNoneZ_clone_ptr(LDKCResult_CVec_BlindedMessagePathZNoneZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_BlindedMessagePathZNoneZ_clone_ptr")] public static extern long CResult_CVec_BlindedMessagePathZNoneZ_clone_ptr(long _arg); + // struct LDKCResult_CVec_BlindedMessagePathZNoneZ CResult_CVec_BlindedMessagePathZNoneZ_clone(const struct LDKCResult_CVec_BlindedMessagePathZNoneZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_BlindedMessagePathZNoneZ_clone")] public static extern long CResult_CVec_BlindedMessagePathZNoneZ_clone(long _orig); + // void CVec_MessageForwardNodeZ_free(struct LDKCVec_MessageForwardNodeZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_MessageForwardNodeZ_free")] public static extern void CVec_MessageForwardNodeZ_free(long __res); // struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_ok(struct LDKInFlightHtlcs o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InFlightHtlcsDecodeErrorZ_ok")] public static extern long CResult_InFlightHtlcsDecodeErrorZ_ok(long _o); // struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_err(struct LDKDecodeError e); @@ -3684,8 +3855,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentParametersDecodeErrorZ_clone")] public static extern long CResult_PaymentParametersDecodeErrorZ_clone(long _orig); // void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_RouteHintZ_free")] public static extern void CVec_RouteHintZ_free(long __res); - // void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_RouteHintHopZ_free")] public static extern void CVec_RouteHintHopZ_free(long __res); // struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_ok(struct LDKRouteHint o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHintDecodeErrorZ_ok")] public static extern long CResult_RouteHintDecodeErrorZ_ok(long _o); // struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_err(struct LDKDecodeError e); @@ -3966,6 +4135,18 @@ internal class bindings { [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_OfferDecodeErrorZ CResult_OfferDecodeErrorZ_ok(struct LDKOffer o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferDecodeErrorZ_ok")] public static extern long CResult_OfferDecodeErrorZ_ok(long _o); + // struct LDKCResult_OfferDecodeErrorZ CResult_OfferDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferDecodeErrorZ_err")] public static extern long CResult_OfferDecodeErrorZ_err(long _e); + // bool CResult_OfferDecodeErrorZ_is_ok(const struct LDKCResult_OfferDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferDecodeErrorZ_is_ok")] public static extern bool CResult_OfferDecodeErrorZ_is_ok(long _o); + // void CResult_OfferDecodeErrorZ_free(struct LDKCResult_OfferDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferDecodeErrorZ_free")] public static extern void CResult_OfferDecodeErrorZ_free(long __res); + // uint64_t CResult_OfferDecodeErrorZ_clone_ptr(LDKCResult_OfferDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferDecodeErrorZ_clone_ptr")] public static extern long CResult_OfferDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_OfferDecodeErrorZ CResult_OfferDecodeErrorZ_clone(const struct LDKCResult_OfferDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferDecodeErrorZ_clone")] public static extern long CResult_OfferDecodeErrorZ_clone(long _orig); // 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); @@ -4136,6 +4317,16 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAliasDecodeErrorZ_clone_ptr")] public static extern long CResult_NodeAliasDecodeErrorZ_clone_ptr(long _arg); // struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_clone(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAliasDecodeErrorZ_clone")] public static extern long CResult_NodeAliasDecodeErrorZ_clone(long _orig); + // struct LDKCOption_NodeAnnouncementInfoZ COption_NodeAnnouncementInfoZ_some(struct LDKNodeAnnouncementInfo o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_NodeAnnouncementInfoZ_some")] public static extern long COption_NodeAnnouncementInfoZ_some(long _o); + // struct LDKCOption_NodeAnnouncementInfoZ COption_NodeAnnouncementInfoZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_NodeAnnouncementInfoZ_none")] public static extern long COption_NodeAnnouncementInfoZ_none(); + // void COption_NodeAnnouncementInfoZ_free(struct LDKCOption_NodeAnnouncementInfoZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_NodeAnnouncementInfoZ_free")] public static extern void COption_NodeAnnouncementInfoZ_free(long __res); + // uint64_t COption_NodeAnnouncementInfoZ_clone_ptr(LDKCOption_NodeAnnouncementInfoZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_NodeAnnouncementInfoZ_clone_ptr")] public static extern long COption_NodeAnnouncementInfoZ_clone_ptr(long _arg); + // struct LDKCOption_NodeAnnouncementInfoZ COption_NodeAnnouncementInfoZ_clone(const struct LDKCOption_NodeAnnouncementInfoZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_NodeAnnouncementInfoZ_clone")] public static extern long COption_NodeAnnouncementInfoZ_clone(long _orig); // struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeInfoDecodeErrorZ_ok")] public static extern long CResult_NodeInfoDecodeErrorZ_ok(long _o); // struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e); @@ -4410,26 +4601,72 @@ internal class bindings { [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); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_OffersMessageZ_none")] public static extern long COption_OffersMessageZ_none(); - // void COption_OffersMessageZ_free(struct LDKCOption_OffersMessageZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_OffersMessageZ_free")] public static extern void COption_OffersMessageZ_free(long __res); - // uint64_t COption_OffersMessageZ_clone_ptr(LDKCOption_OffersMessageZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_OffersMessageZ_clone_ptr")] public static extern long COption_OffersMessageZ_clone_ptr(long _arg); - // struct LDKCOption_OffersMessageZ COption_OffersMessageZ_clone(const struct LDKCOption_OffersMessageZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_OffersMessageZ_clone")] public static extern long COption_OffersMessageZ_clone(long _orig); - // uint64_t C3Tuple_OffersMessageDestinationBlindedPathZ_clone_ptr(LDKC3Tuple_OffersMessageDestinationBlindedPathZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_OffersMessageDestinationBlindedPathZ_clone_ptr")] public static extern long C3Tuple_OffersMessageDestinationBlindedPathZ_clone_ptr(long _arg); - // struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ C3Tuple_OffersMessageDestinationBlindedPathZ_clone(const struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_OffersMessageDestinationBlindedPathZ_clone")] public static extern long C3Tuple_OffersMessageDestinationBlindedPathZ_clone(long _orig); - // struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ C3Tuple_OffersMessageDestinationBlindedPathZ_new(struct LDKOffersMessage a, struct LDKDestination b, struct LDKBlindedPath c); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_OffersMessageDestinationBlindedPathZ_new")] public static extern long C3Tuple_OffersMessageDestinationBlindedPathZ_new(long _a, long _b, long _c); - // void C3Tuple_OffersMessageDestinationBlindedPathZ_free(struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_OffersMessageDestinationBlindedPathZ_free")] public static extern void C3Tuple_OffersMessageDestinationBlindedPathZ_free(long __res); - // void CVec_C3Tuple_OffersMessageDestinationBlindedPathZZ_free(struct LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C3Tuple_OffersMessageDestinationBlindedPathZZ_free")] public static extern void CVec_C3Tuple_OffersMessageDestinationBlindedPathZZ_free(long __res); + // struct LDKCOption_OffersContextZ COption_OffersContextZ_some(struct LDKOffersContext o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_OffersContextZ_some")] public static extern long COption_OffersContextZ_some(long _o); + // struct LDKCOption_OffersContextZ COption_OffersContextZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_OffersContextZ_none")] public static extern long COption_OffersContextZ_none(); + // void COption_OffersContextZ_free(struct LDKCOption_OffersContextZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_OffersContextZ_free")] public static extern void COption_OffersContextZ_free(long __res); + // uint64_t COption_OffersContextZ_clone_ptr(LDKCOption_OffersContextZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_OffersContextZ_clone_ptr")] public static extern long COption_OffersContextZ_clone_ptr(long _arg); + // struct LDKCOption_OffersContextZ COption_OffersContextZ_clone(const struct LDKCOption_OffersContextZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_OffersContextZ_clone")] public static extern long COption_OffersContextZ_clone(long _orig); + // uint64_t C2Tuple_OffersMessageResponseInstructionZ_clone_ptr(LDKC2Tuple_OffersMessageResponseInstructionZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OffersMessageResponseInstructionZ_clone_ptr")] public static extern long C2Tuple_OffersMessageResponseInstructionZ_clone_ptr(long _arg); + // struct LDKC2Tuple_OffersMessageResponseInstructionZ C2Tuple_OffersMessageResponseInstructionZ_clone(const struct LDKC2Tuple_OffersMessageResponseInstructionZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OffersMessageResponseInstructionZ_clone")] public static extern long C2Tuple_OffersMessageResponseInstructionZ_clone(long _orig); + // struct LDKC2Tuple_OffersMessageResponseInstructionZ C2Tuple_OffersMessageResponseInstructionZ_new(struct LDKOffersMessage a, struct LDKResponseInstruction b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OffersMessageResponseInstructionZ_new")] public static extern long C2Tuple_OffersMessageResponseInstructionZ_new(long _a, long _b); + // void C2Tuple_OffersMessageResponseInstructionZ_free(struct LDKC2Tuple_OffersMessageResponseInstructionZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OffersMessageResponseInstructionZ_free")] public static extern void C2Tuple_OffersMessageResponseInstructionZ_free(long __res); + // struct LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ COption_C2Tuple_OffersMessageResponseInstructionZZ_some(struct LDKC2Tuple_OffersMessageResponseInstructionZ o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C2Tuple_OffersMessageResponseInstructionZZ_some")] public static extern long COption_C2Tuple_OffersMessageResponseInstructionZZ_some(long _o); + // struct LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ COption_C2Tuple_OffersMessageResponseInstructionZZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C2Tuple_OffersMessageResponseInstructionZZ_none")] public static extern long COption_C2Tuple_OffersMessageResponseInstructionZZ_none(); + // void COption_C2Tuple_OffersMessageResponseInstructionZZ_free(struct LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C2Tuple_OffersMessageResponseInstructionZZ_free")] public static extern void COption_C2Tuple_OffersMessageResponseInstructionZZ_free(long __res); + // uint64_t COption_C2Tuple_OffersMessageResponseInstructionZZ_clone_ptr(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C2Tuple_OffersMessageResponseInstructionZZ_clone_ptr")] public static extern long COption_C2Tuple_OffersMessageResponseInstructionZZ_clone_ptr(long _arg); + // struct LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ COption_C2Tuple_OffersMessageResponseInstructionZZ_clone(const struct LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C2Tuple_OffersMessageResponseInstructionZZ_clone")] public static extern long COption_C2Tuple_OffersMessageResponseInstructionZZ_clone(long _orig); + // uint64_t C2Tuple_OffersMessageMessageSendInstructionsZ_clone_ptr(LDKC2Tuple_OffersMessageMessageSendInstructionsZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OffersMessageMessageSendInstructionsZ_clone_ptr")] public static extern long C2Tuple_OffersMessageMessageSendInstructionsZ_clone_ptr(long _arg); + // struct LDKC2Tuple_OffersMessageMessageSendInstructionsZ C2Tuple_OffersMessageMessageSendInstructionsZ_clone(const struct LDKC2Tuple_OffersMessageMessageSendInstructionsZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OffersMessageMessageSendInstructionsZ_clone")] public static extern long C2Tuple_OffersMessageMessageSendInstructionsZ_clone(long _orig); + // struct LDKC2Tuple_OffersMessageMessageSendInstructionsZ C2Tuple_OffersMessageMessageSendInstructionsZ_new(struct LDKOffersMessage a, struct LDKMessageSendInstructions b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OffersMessageMessageSendInstructionsZ_new")] public static extern long C2Tuple_OffersMessageMessageSendInstructionsZ_new(long _a, long _b); + // void C2Tuple_OffersMessageMessageSendInstructionsZ_free(struct LDKC2Tuple_OffersMessageMessageSendInstructionsZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OffersMessageMessageSendInstructionsZ_free")] public static extern void C2Tuple_OffersMessageMessageSendInstructionsZ_free(long __res); + // void CVec_C2Tuple_OffersMessageMessageSendInstructionsZZ_free(struct LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C2Tuple_OffersMessageMessageSendInstructionsZZ_free")] public static extern void CVec_C2Tuple_OffersMessageMessageSendInstructionsZZ_free(long __res); + // uint64_t C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone_ptr(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone_ptr")] public static extern long C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone_ptr(long _arg); + // struct LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone(const struct LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone")] public static extern long C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone(long _orig); + // struct LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ C2Tuple_ReleaseHeldHtlcResponseInstructionZ_new(struct LDKReleaseHeldHtlc a, struct LDKResponseInstruction b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_ReleaseHeldHtlcResponseInstructionZ_new")] public static extern long C2Tuple_ReleaseHeldHtlcResponseInstructionZ_new(long _a, long _b); + // void C2Tuple_ReleaseHeldHtlcResponseInstructionZ_free(struct LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_ReleaseHeldHtlcResponseInstructionZ_free")] public static extern void C2Tuple_ReleaseHeldHtlcResponseInstructionZ_free(long __res); + // struct LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_some(struct LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_some")] public static extern long COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_some(long _o); + // struct LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_none")] public static extern long COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_none(); + // void COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_free(struct LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_free")] public static extern void COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_free(long __res); + // uint64_t COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone_ptr(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone_ptr")] public static extern long COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone_ptr(long _arg); + // struct LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone(const struct LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone")] public static extern long COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone(long _orig); + // uint64_t C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone_ptr(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone_ptr")] public static extern long C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone_ptr(long _arg); + // struct LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone(const struct LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone")] public static extern long C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone(long _orig); + // struct LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_new(struct LDKAsyncPaymentsMessage a, struct LDKMessageSendInstructions b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_new")] public static extern long C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_new(long _a, long _b); + // void C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_free(struct LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_free")] public static extern void C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_free(long __res); + // void CVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ_free(struct LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ_free")] public static extern void CVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ_free(long __res); // struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_ok(struct LDKPhantomRouteHints o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PhantomRouteHintsDecodeErrorZ_ok")] public static extern long CResult_PhantomRouteHintsDecodeErrorZ_ok(long _o); // struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_err(struct LDKDecodeError e); @@ -4634,6 +4871,18 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_free")] public static extern void C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_free(long __res); // void CVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ _res); [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); + // struct LDKCResult_NoneReplayEventZ CResult_NoneReplayEventZ_ok(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneReplayEventZ_ok")] public static extern long CResult_NoneReplayEventZ_ok(); + // struct LDKCResult_NoneReplayEventZ CResult_NoneReplayEventZ_err(struct LDKReplayEvent e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneReplayEventZ_err")] public static extern long CResult_NoneReplayEventZ_err(long _e); + // bool CResult_NoneReplayEventZ_is_ok(const struct LDKCResult_NoneReplayEventZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneReplayEventZ_is_ok")] public static extern bool CResult_NoneReplayEventZ_is_ok(long _o); + // void CResult_NoneReplayEventZ_free(struct LDKCResult_NoneReplayEventZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneReplayEventZ_free")] public static extern void CResult_NoneReplayEventZ_free(long __res); + // uint64_t CResult_NoneReplayEventZ_clone_ptr(LDKCResult_NoneReplayEventZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneReplayEventZ_clone_ptr")] public static extern long CResult_NoneReplayEventZ_clone_ptr(long _arg); + // struct LDKCResult_NoneReplayEventZ CResult_NoneReplayEventZ_clone(const struct LDKCResult_NoneReplayEventZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneReplayEventZ_clone")] public static extern long CResult_NoneReplayEventZ_clone(long _orig); // 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); // uint64_t C2Tuple_u32TxOutZ_clone_ptr(LDKC2Tuple_u32TxOutZ *NONNULL_PTR arg); @@ -4688,16 +4937,24 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PublicKeyTypeZ_free")] public static extern void C2Tuple_PublicKeyTypeZ_free(long __res); // void CVec_C2Tuple_PublicKeyTypeZZ_free(struct LDKCVec_C2Tuple_PublicKeyTypeZZ _res); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C2Tuple_PublicKeyTypeZZ_free")] public static extern void CVec_C2Tuple_PublicKeyTypeZZ_free(long __res); - // uint64_t C2Tuple_PublicKeyCVec_SocketAddressZZ_clone_ptr(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PublicKeyCVec_SocketAddressZZ_clone_ptr")] public static extern long C2Tuple_PublicKeyCVec_SocketAddressZZ_clone_ptr(long _arg); - // struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ C2Tuple_PublicKeyCVec_SocketAddressZZ_clone(const struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PublicKeyCVec_SocketAddressZZ_clone")] public static extern long C2Tuple_PublicKeyCVec_SocketAddressZZ_clone(long _orig); - // struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ C2Tuple_PublicKeyCVec_SocketAddressZZ_new(struct LDKPublicKey a, struct LDKCVec_SocketAddressZ b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PublicKeyCVec_SocketAddressZZ_new")] public static extern long C2Tuple_PublicKeyCVec_SocketAddressZZ_new(long _a, long _b); - // void C2Tuple_PublicKeyCVec_SocketAddressZZ_free(struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PublicKeyCVec_SocketAddressZZ_free")] public static extern void C2Tuple_PublicKeyCVec_SocketAddressZZ_free(long __res); - // void CVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ_free(struct LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ_free")] public static extern void CVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ_free(long __res); + // uint64_t C2Tuple_OnionMessageContentsResponseInstructionZ_clone_ptr(LDKC2Tuple_OnionMessageContentsResponseInstructionZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OnionMessageContentsResponseInstructionZ_clone_ptr")] public static extern long C2Tuple_OnionMessageContentsResponseInstructionZ_clone_ptr(long _arg); + // struct LDKC2Tuple_OnionMessageContentsResponseInstructionZ C2Tuple_OnionMessageContentsResponseInstructionZ_clone(const struct LDKC2Tuple_OnionMessageContentsResponseInstructionZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OnionMessageContentsResponseInstructionZ_clone")] public static extern long C2Tuple_OnionMessageContentsResponseInstructionZ_clone(long _orig); + // struct LDKC2Tuple_OnionMessageContentsResponseInstructionZ C2Tuple_OnionMessageContentsResponseInstructionZ_new(struct LDKOnionMessageContents a, struct LDKResponseInstruction b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OnionMessageContentsResponseInstructionZ_new")] public static extern long C2Tuple_OnionMessageContentsResponseInstructionZ_new(long _a, long _b); + // void C2Tuple_OnionMessageContentsResponseInstructionZ_free(struct LDKC2Tuple_OnionMessageContentsResponseInstructionZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OnionMessageContentsResponseInstructionZ_free")] public static extern void C2Tuple_OnionMessageContentsResponseInstructionZ_free(long __res); + // struct LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_some(struct LDKC2Tuple_OnionMessageContentsResponseInstructionZ o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_some")] public static extern long COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_some(long _o); + // struct LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_none")] public static extern long COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_none(); + // void COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_free(struct LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_free")] public static extern void COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_free(long __res); + // uint64_t COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone_ptr(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone_ptr")] public static extern long COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone_ptr(long _arg); + // struct LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone(const struct LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone")] public static extern long COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone(long _orig); // struct LDKCOption_OnionMessageContentsZ COption_OnionMessageContentsZ_some(struct LDKOnionMessageContents o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_OnionMessageContentsZ_some")] public static extern long COption_OnionMessageContentsZ_some(long _o); // struct LDKCOption_OnionMessageContentsZ COption_OnionMessageContentsZ_none(void); @@ -4720,16 +4977,16 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_OnionMessageContentsZDecodeErrorZ_clone_ptr")] public static extern long CResult_COption_OnionMessageContentsZDecodeErrorZ_clone_ptr(long _arg); // struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ CResult_COption_OnionMessageContentsZDecodeErrorZ_clone(const struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_OnionMessageContentsZDecodeErrorZ_clone")] public static extern long CResult_COption_OnionMessageContentsZDecodeErrorZ_clone(long _orig); - // uint64_t C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone_ptr(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone_ptr")] public static extern long C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone_ptr(long _arg); - // struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone(const struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone")] public static extern long C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone(long _orig); - // struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ C3Tuple_OnionMessageContentsDestinationBlindedPathZ_new(struct LDKOnionMessageContents a, struct LDKDestination b, struct LDKBlindedPath c); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_OnionMessageContentsDestinationBlindedPathZ_new")] public static extern long C3Tuple_OnionMessageContentsDestinationBlindedPathZ_new(long _a, long _b, long _c); - // void C3Tuple_OnionMessageContentsDestinationBlindedPathZ_free(struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_OnionMessageContentsDestinationBlindedPathZ_free")] public static extern void C3Tuple_OnionMessageContentsDestinationBlindedPathZ_free(long __res); - // void CVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ_free(struct LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ_free")] public static extern void CVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ_free(long __res); + // uint64_t C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone_ptr(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone_ptr")] public static extern long C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone_ptr(long _arg); + // struct LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone(const struct LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone")] public static extern long C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone(long _orig); + // struct LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ C2Tuple_OnionMessageContentsMessageSendInstructionsZ_new(struct LDKOnionMessageContents a, struct LDKMessageSendInstructions b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OnionMessageContentsMessageSendInstructionsZ_new")] public static extern long C2Tuple_OnionMessageContentsMessageSendInstructionsZ_new(long _a, long _b); + // void C2Tuple_OnionMessageContentsMessageSendInstructionsZ_free(struct LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OnionMessageContentsMessageSendInstructionsZ_free")] public static extern void C2Tuple_OnionMessageContentsMessageSendInstructionsZ_free(long __res); + // void CVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ_free(struct LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ_free")] public static extern void CVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ_free(long __res); // struct LDKCOption_TypeZ COption_TypeZ_some(struct LDKType o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_TypeZ_some")] public static extern long COption_TypeZ_some(long _o); // struct LDKCOption_TypeZ COption_TypeZ_none(void); @@ -4820,8 +5077,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_u8ZIOErrorZ_clone_ptr")] public static extern long CResult_CVec_u8ZIOErrorZ_clone_ptr(long _arg); // struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_clone(const struct LDKCResult_CVec_u8ZIOErrorZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_u8ZIOErrorZ_clone")] public static extern long CResult_CVec_u8ZIOErrorZ_clone(long _orig); - // void CVec_StrZ_free(struct LDKCVec_StrZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_StrZ_free")] public static extern void CVec_StrZ_free(long __res); // struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_ok(struct LDKCVec_StrZ o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_StrZIOErrorZ_ok")] public static extern long CResult_CVec_StrZIOErrorZ_ok(long _o); // struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_err(enum LDKIOError e); @@ -4884,16 +5139,6 @@ internal class bindings { [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); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_SecretKeyZ_none")] public static extern long COption_SecretKeyZ_none(); - // void COption_SecretKeyZ_free(struct LDKCOption_SecretKeyZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_SecretKeyZ_free")] public static extern void COption_SecretKeyZ_free(long __res); - // uint64_t COption_SecretKeyZ_clone_ptr(LDKCOption_SecretKeyZ *NONNULL_PTR arg); - [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); @@ -5030,18 +5275,18 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StfuDecodeErrorZ_clone_ptr")] public static extern long CResult_StfuDecodeErrorZ_clone_ptr(long _arg); // struct LDKCResult_StfuDecodeErrorZ CResult_StfuDecodeErrorZ_clone(const struct LDKCResult_StfuDecodeErrorZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StfuDecodeErrorZ_clone")] public static extern long CResult_StfuDecodeErrorZ_clone(long _orig); - // struct LDKCResult_SpliceDecodeErrorZ CResult_SpliceDecodeErrorZ_ok(struct LDKSplice o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SpliceDecodeErrorZ_ok")] public static extern long CResult_SpliceDecodeErrorZ_ok(long _o); - // struct LDKCResult_SpliceDecodeErrorZ CResult_SpliceDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SpliceDecodeErrorZ_err")] public static extern long CResult_SpliceDecodeErrorZ_err(long _e); - // bool CResult_SpliceDecodeErrorZ_is_ok(const struct LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SpliceDecodeErrorZ_is_ok")] public static extern bool CResult_SpliceDecodeErrorZ_is_ok(long _o); - // void CResult_SpliceDecodeErrorZ_free(struct LDKCResult_SpliceDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SpliceDecodeErrorZ_free")] public static extern void CResult_SpliceDecodeErrorZ_free(long __res); - // uint64_t CResult_SpliceDecodeErrorZ_clone_ptr(LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SpliceDecodeErrorZ_clone_ptr")] public static extern long CResult_SpliceDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_SpliceDecodeErrorZ CResult_SpliceDecodeErrorZ_clone(const struct LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SpliceDecodeErrorZ_clone")] public static extern long CResult_SpliceDecodeErrorZ_clone(long _orig); + // struct LDKCResult_SpliceInitDecodeErrorZ CResult_SpliceInitDecodeErrorZ_ok(struct LDKSpliceInit o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SpliceInitDecodeErrorZ_ok")] public static extern long CResult_SpliceInitDecodeErrorZ_ok(long _o); + // struct LDKCResult_SpliceInitDecodeErrorZ CResult_SpliceInitDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SpliceInitDecodeErrorZ_err")] public static extern long CResult_SpliceInitDecodeErrorZ_err(long _e); + // bool CResult_SpliceInitDecodeErrorZ_is_ok(const struct LDKCResult_SpliceInitDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SpliceInitDecodeErrorZ_is_ok")] public static extern bool CResult_SpliceInitDecodeErrorZ_is_ok(long _o); + // void CResult_SpliceInitDecodeErrorZ_free(struct LDKCResult_SpliceInitDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SpliceInitDecodeErrorZ_free")] public static extern void CResult_SpliceInitDecodeErrorZ_free(long __res); + // uint64_t CResult_SpliceInitDecodeErrorZ_clone_ptr(LDKCResult_SpliceInitDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SpliceInitDecodeErrorZ_clone_ptr")] public static extern long CResult_SpliceInitDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_SpliceInitDecodeErrorZ CResult_SpliceInitDecodeErrorZ_clone(const struct LDKCResult_SpliceInitDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SpliceInitDecodeErrorZ_clone")] public static extern long CResult_SpliceInitDecodeErrorZ_clone(long _orig); // struct LDKCResult_SpliceAckDecodeErrorZ CResult_SpliceAckDecodeErrorZ_ok(struct LDKSpliceAck o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SpliceAckDecodeErrorZ_ok")] public static extern long CResult_SpliceAckDecodeErrorZ_ok(long _o); // struct LDKCResult_SpliceAckDecodeErrorZ CResult_SpliceAckDecodeErrorZ_err(struct LDKDecodeError e); @@ -5222,6 +5467,18 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr")] public static extern long CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(long _arg); // struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone")] public static extern long CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(long _orig); + // struct LDKCResult_CommitmentSignedBatchDecodeErrorZ CResult_CommitmentSignedBatchDecodeErrorZ_ok(struct LDKCommitmentSignedBatch o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CommitmentSignedBatchDecodeErrorZ_ok")] public static extern long CResult_CommitmentSignedBatchDecodeErrorZ_ok(long _o); + // struct LDKCResult_CommitmentSignedBatchDecodeErrorZ CResult_CommitmentSignedBatchDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CommitmentSignedBatchDecodeErrorZ_err")] public static extern long CResult_CommitmentSignedBatchDecodeErrorZ_err(long _e); + // bool CResult_CommitmentSignedBatchDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentSignedBatchDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CommitmentSignedBatchDecodeErrorZ_is_ok")] public static extern bool CResult_CommitmentSignedBatchDecodeErrorZ_is_ok(long _o); + // void CResult_CommitmentSignedBatchDecodeErrorZ_free(struct LDKCResult_CommitmentSignedBatchDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CommitmentSignedBatchDecodeErrorZ_free")] public static extern void CResult_CommitmentSignedBatchDecodeErrorZ_free(long __res); + // uint64_t CResult_CommitmentSignedBatchDecodeErrorZ_clone_ptr(LDKCResult_CommitmentSignedBatchDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CommitmentSignedBatchDecodeErrorZ_clone_ptr")] public static extern long CResult_CommitmentSignedBatchDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_CommitmentSignedBatchDecodeErrorZ CResult_CommitmentSignedBatchDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedBatchDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CommitmentSignedBatchDecodeErrorZ_clone")] public static extern long CResult_CommitmentSignedBatchDecodeErrorZ_clone(long _orig); // struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CommitmentSignedDecodeErrorZ_ok")] public static extern long CResult_CommitmentSignedDecodeErrorZ_ok(long _o); // struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e); @@ -5606,20 +5863,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr")] public static extern long CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(long _arg); // struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_GossipTimestampFilterDecodeErrorZ_clone")] public static extern long CResult_GossipTimestampFilterDecodeErrorZ_clone(long _orig); - // void CVec_PhantomRouteHintsZ_free(struct LDKCVec_PhantomRouteHintsZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_PhantomRouteHintsZ_free")] public static extern void CVec_PhantomRouteHintsZ_free(long __res); - // struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(struct LDKBolt11Invoice o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_ok")] public static extern long CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(long _o); - // struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_err")] public static extern long CResult_Bolt11InvoiceSignOrCreationErrorZ_err(long _e); - // bool CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok")] public static extern bool CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(long _o); - // void CResult_Bolt11InvoiceSignOrCreationErrorZ_free(struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_free")] public static extern void CResult_Bolt11InvoiceSignOrCreationErrorZ_free(long __res); - // uint64_t CResult_Bolt11InvoiceSignOrCreationErrorZ_clone_ptr(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_clone_ptr")] public static extern long CResult_Bolt11InvoiceSignOrCreationErrorZ_clone_ptr(long _arg); - // struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_clone")] public static extern long CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(long _orig); // struct LDKCOption_InboundHTLCStateDetailsZ COption_InboundHTLCStateDetailsZ_some(enum LDKInboundHTLCStateDetails o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_InboundHTLCStateDetailsZ_some")] public static extern long COption_InboundHTLCStateDetailsZ_some(InboundHTLCStateDetails _o); // struct LDKCOption_InboundHTLCStateDetailsZ COption_InboundHTLCStateDetailsZ_none(void); @@ -5752,6 +5995,42 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_clone")] public static extern long CResult_ChannelShutdownStateDecodeErrorZ_clone(long _orig); // void CVec_FutureZ_free(struct LDKCVec_FutureZ _res); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_FutureZ_free")] public static extern void CVec_FutureZ_free(long __res); + // struct LDKCResult_HeldHtlcAvailableDecodeErrorZ CResult_HeldHtlcAvailableDecodeErrorZ_ok(struct LDKHeldHtlcAvailable o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HeldHtlcAvailableDecodeErrorZ_ok")] public static extern long CResult_HeldHtlcAvailableDecodeErrorZ_ok(long _o); + // struct LDKCResult_HeldHtlcAvailableDecodeErrorZ CResult_HeldHtlcAvailableDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HeldHtlcAvailableDecodeErrorZ_err")] public static extern long CResult_HeldHtlcAvailableDecodeErrorZ_err(long _e); + // bool CResult_HeldHtlcAvailableDecodeErrorZ_is_ok(const struct LDKCResult_HeldHtlcAvailableDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HeldHtlcAvailableDecodeErrorZ_is_ok")] public static extern bool CResult_HeldHtlcAvailableDecodeErrorZ_is_ok(long _o); + // void CResult_HeldHtlcAvailableDecodeErrorZ_free(struct LDKCResult_HeldHtlcAvailableDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HeldHtlcAvailableDecodeErrorZ_free")] public static extern void CResult_HeldHtlcAvailableDecodeErrorZ_free(long __res); + // uint64_t CResult_HeldHtlcAvailableDecodeErrorZ_clone_ptr(LDKCResult_HeldHtlcAvailableDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HeldHtlcAvailableDecodeErrorZ_clone_ptr")] public static extern long CResult_HeldHtlcAvailableDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_HeldHtlcAvailableDecodeErrorZ CResult_HeldHtlcAvailableDecodeErrorZ_clone(const struct LDKCResult_HeldHtlcAvailableDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HeldHtlcAvailableDecodeErrorZ_clone")] public static extern long CResult_HeldHtlcAvailableDecodeErrorZ_clone(long _orig); + // struct LDKCResult_ReleaseHeldHtlcDecodeErrorZ CResult_ReleaseHeldHtlcDecodeErrorZ_ok(struct LDKReleaseHeldHtlc o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ReleaseHeldHtlcDecodeErrorZ_ok")] public static extern long CResult_ReleaseHeldHtlcDecodeErrorZ_ok(long _o); + // struct LDKCResult_ReleaseHeldHtlcDecodeErrorZ CResult_ReleaseHeldHtlcDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ReleaseHeldHtlcDecodeErrorZ_err")] public static extern long CResult_ReleaseHeldHtlcDecodeErrorZ_err(long _e); + // bool CResult_ReleaseHeldHtlcDecodeErrorZ_is_ok(const struct LDKCResult_ReleaseHeldHtlcDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ReleaseHeldHtlcDecodeErrorZ_is_ok")] public static extern bool CResult_ReleaseHeldHtlcDecodeErrorZ_is_ok(long _o); + // void CResult_ReleaseHeldHtlcDecodeErrorZ_free(struct LDKCResult_ReleaseHeldHtlcDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ReleaseHeldHtlcDecodeErrorZ_free")] public static extern void CResult_ReleaseHeldHtlcDecodeErrorZ_free(long __res); + // uint64_t CResult_ReleaseHeldHtlcDecodeErrorZ_clone_ptr(LDKCResult_ReleaseHeldHtlcDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ReleaseHeldHtlcDecodeErrorZ_clone_ptr")] public static extern long CResult_ReleaseHeldHtlcDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_ReleaseHeldHtlcDecodeErrorZ CResult_ReleaseHeldHtlcDecodeErrorZ_clone(const struct LDKCResult_ReleaseHeldHtlcDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ReleaseHeldHtlcDecodeErrorZ_clone")] public static extern long CResult_ReleaseHeldHtlcDecodeErrorZ_clone(long _orig); + // struct LDKCResult_AsyncPaymentsMessageDecodeErrorZ CResult_AsyncPaymentsMessageDecodeErrorZ_ok(struct LDKAsyncPaymentsMessage o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_AsyncPaymentsMessageDecodeErrorZ_ok")] public static extern long CResult_AsyncPaymentsMessageDecodeErrorZ_ok(long _o); + // struct LDKCResult_AsyncPaymentsMessageDecodeErrorZ CResult_AsyncPaymentsMessageDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_AsyncPaymentsMessageDecodeErrorZ_err")] public static extern long CResult_AsyncPaymentsMessageDecodeErrorZ_err(long _e); + // bool CResult_AsyncPaymentsMessageDecodeErrorZ_is_ok(const struct LDKCResult_AsyncPaymentsMessageDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_AsyncPaymentsMessageDecodeErrorZ_is_ok")] public static extern bool CResult_AsyncPaymentsMessageDecodeErrorZ_is_ok(long _o); + // void CResult_AsyncPaymentsMessageDecodeErrorZ_free(struct LDKCResult_AsyncPaymentsMessageDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_AsyncPaymentsMessageDecodeErrorZ_free")] public static extern void CResult_AsyncPaymentsMessageDecodeErrorZ_free(long __res); + // uint64_t CResult_AsyncPaymentsMessageDecodeErrorZ_clone_ptr(LDKCResult_AsyncPaymentsMessageDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_AsyncPaymentsMessageDecodeErrorZ_clone_ptr")] public static extern long CResult_AsyncPaymentsMessageDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_AsyncPaymentsMessageDecodeErrorZ CResult_AsyncPaymentsMessageDecodeErrorZ_clone(const struct LDKCResult_AsyncPaymentsMessageDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_AsyncPaymentsMessageDecodeErrorZ_clone")] public static extern long CResult_AsyncPaymentsMessageDecodeErrorZ_clone(long _orig); // struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_ok(struct LDKOffersMessage o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OffersMessageDecodeErrorZ_ok")] public static extern long CResult_OffersMessageDecodeErrorZ_ok(long _o); // struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_err(struct LDKDecodeError e); @@ -5942,6 +6221,18 @@ internal class bindings { [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_FundingInfoDecodeErrorZ CResult_FundingInfoDecodeErrorZ_ok(struct LDKFundingInfo o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_FundingInfoDecodeErrorZ_ok")] public static extern long CResult_FundingInfoDecodeErrorZ_ok(long _o); + // struct LDKCResult_FundingInfoDecodeErrorZ CResult_FundingInfoDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_FundingInfoDecodeErrorZ_err")] public static extern long CResult_FundingInfoDecodeErrorZ_err(long _e); + // bool CResult_FundingInfoDecodeErrorZ_is_ok(const struct LDKCResult_FundingInfoDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_FundingInfoDecodeErrorZ_is_ok")] public static extern bool CResult_FundingInfoDecodeErrorZ_is_ok(long _o); + // void CResult_FundingInfoDecodeErrorZ_free(struct LDKCResult_FundingInfoDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_FundingInfoDecodeErrorZ_free")] public static extern void CResult_FundingInfoDecodeErrorZ_free(long __res); + // uint64_t CResult_FundingInfoDecodeErrorZ_clone_ptr(LDKCResult_FundingInfoDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_FundingInfoDecodeErrorZ_clone_ptr")] public static extern long CResult_FundingInfoDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_FundingInfoDecodeErrorZ CResult_FundingInfoDecodeErrorZ_clone(const struct LDKCResult_FundingInfoDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_FundingInfoDecodeErrorZ_clone")] public static extern long CResult_FundingInfoDecodeErrorZ_clone(long _orig); // 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); @@ -6032,18 +6323,28 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr")] public static extern long CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(long _arg); // struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_clone(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_clone")] public static extern long CResult_COption_HTLCDestinationZDecodeErrorZ_clone(long _orig); - // struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_ok(enum LDKPaymentFailureReason o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_ok")] public static extern long CResult_PaymentFailureReasonDecodeErrorZ_ok(PaymentFailureReason _o); - // struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_err")] public static extern long CResult_PaymentFailureReasonDecodeErrorZ_err(long _e); - // bool CResult_PaymentFailureReasonDecodeErrorZ_is_ok(const struct LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_is_ok")] public static extern bool CResult_PaymentFailureReasonDecodeErrorZ_is_ok(long _o); - // void CResult_PaymentFailureReasonDecodeErrorZ_free(struct LDKCResult_PaymentFailureReasonDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_free")] public static extern void CResult_PaymentFailureReasonDecodeErrorZ_free(long __res); - // uint64_t CResult_PaymentFailureReasonDecodeErrorZ_clone_ptr(LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_clone_ptr")] public static extern long CResult_PaymentFailureReasonDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_clone(const struct LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_clone")] public static extern long CResult_PaymentFailureReasonDecodeErrorZ_clone(long _orig); + // struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_some(enum LDKPaymentFailureReason o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentFailureReasonZ_some")] public static extern long COption_PaymentFailureReasonZ_some(PaymentFailureReason _o); + // struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentFailureReasonZ_none")] public static extern long COption_PaymentFailureReasonZ_none(); + // void COption_PaymentFailureReasonZ_free(struct LDKCOption_PaymentFailureReasonZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentFailureReasonZ_free")] public static extern void COption_PaymentFailureReasonZ_free(long __res); + // uint64_t COption_PaymentFailureReasonZ_clone_ptr(LDKCOption_PaymentFailureReasonZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentFailureReasonZ_clone_ptr")] public static extern long COption_PaymentFailureReasonZ_clone_ptr(long _arg); + // struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_clone(const struct LDKCOption_PaymentFailureReasonZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentFailureReasonZ_clone")] public static extern long COption_PaymentFailureReasonZ_clone(long _orig); + // struct LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ CResult_COption_PaymentFailureReasonZDecodeErrorZ_ok(struct LDKCOption_PaymentFailureReasonZ o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_PaymentFailureReasonZDecodeErrorZ_ok")] public static extern long CResult_COption_PaymentFailureReasonZDecodeErrorZ_ok(long _o); + // struct LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ CResult_COption_PaymentFailureReasonZDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_PaymentFailureReasonZDecodeErrorZ_err")] public static extern long CResult_COption_PaymentFailureReasonZDecodeErrorZ_err(long _e); + // bool CResult_COption_PaymentFailureReasonZDecodeErrorZ_is_ok(const struct LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_PaymentFailureReasonZDecodeErrorZ_is_ok")] public static extern bool CResult_COption_PaymentFailureReasonZDecodeErrorZ_is_ok(long _o); + // void CResult_COption_PaymentFailureReasonZDecodeErrorZ_free(struct LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_PaymentFailureReasonZDecodeErrorZ_free")] public static extern void CResult_COption_PaymentFailureReasonZDecodeErrorZ_free(long __res); + // uint64_t CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone_ptr(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone_ptr")] public static extern long CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone(const struct LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone")] public static extern long CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone(long _orig); // struct LDKCOption_U128Z COption_U128Z_some(struct LDKU128 o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_U128Z_some")] public static extern long COption_U128Z_some(long _o); // struct LDKCOption_U128Z COption_U128Z_none(void); @@ -6056,16 +6357,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_U128Z_clone")] public static extern long COption_U128Z_clone(long _orig); // void CVec_ClaimedHTLCZ_free(struct LDKCVec_ClaimedHTLCZ _res); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_ClaimedHTLCZ_free")] public static extern void CVec_ClaimedHTLCZ_free(long __res); - // struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_some(enum LDKPaymentFailureReason o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentFailureReasonZ_some")] public static extern long COption_PaymentFailureReasonZ_some(PaymentFailureReason _o); - // struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_none(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentFailureReasonZ_none")] public static extern long COption_PaymentFailureReasonZ_none(); - // void COption_PaymentFailureReasonZ_free(struct LDKCOption_PaymentFailureReasonZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentFailureReasonZ_free")] public static extern void COption_PaymentFailureReasonZ_free(long __res); - // uint64_t COption_PaymentFailureReasonZ_clone_ptr(LDKCOption_PaymentFailureReasonZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentFailureReasonZ_clone_ptr")] public static extern long COption_PaymentFailureReasonZ_clone_ptr(long _arg); - // struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_clone(const struct LDKCOption_PaymentFailureReasonZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentFailureReasonZ_clone")] public static extern long COption_PaymentFailureReasonZ_clone(long _orig); // struct LDKCOption_EventZ COption_EventZ_some(struct LDKEvent o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_EventZ_some")] public static extern long COption_EventZ_some(long _o); // struct LDKCOption_EventZ COption_EventZ_none(void); @@ -6088,6 +6379,20 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_EventZDecodeErrorZ_clone_ptr")] public static extern long CResult_COption_EventZDecodeErrorZ_clone_ptr(long _arg); // struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_clone(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_EventZDecodeErrorZ_clone")] public static extern long CResult_COption_EventZDecodeErrorZ_clone(long _orig); + // struct LDKCResult_NonceDecodeErrorZ CResult_NonceDecodeErrorZ_ok(struct LDKNonce o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NonceDecodeErrorZ_ok")] public static extern long CResult_NonceDecodeErrorZ_ok(long _o); + // struct LDKCResult_NonceDecodeErrorZ CResult_NonceDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NonceDecodeErrorZ_err")] public static extern long CResult_NonceDecodeErrorZ_err(long _e); + // bool CResult_NonceDecodeErrorZ_is_ok(const struct LDKCResult_NonceDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NonceDecodeErrorZ_is_ok")] public static extern bool CResult_NonceDecodeErrorZ_is_ok(long _o); + // void CResult_NonceDecodeErrorZ_free(struct LDKCResult_NonceDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NonceDecodeErrorZ_free")] public static extern void CResult_NonceDecodeErrorZ_free(long __res); + // uint64_t CResult_NonceDecodeErrorZ_clone_ptr(LDKCResult_NonceDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NonceDecodeErrorZ_clone_ptr")] public static extern long CResult_NonceDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_NonceDecodeErrorZ CResult_NonceDecodeErrorZ_clone(const struct LDKCResult_NonceDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NonceDecodeErrorZ_clone")] public static extern long CResult_NonceDecodeErrorZ_clone(long _orig); + // void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_RouteHintHopZ_free")] public static extern void CVec_RouteHintHopZ_free(long __res); // struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_ok(enum LDKSiPrefix o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SiPrefixBolt11ParseErrorZ_ok")] public static extern long CResult_SiPrefixBolt11ParseErrorZ_ok(SiPrefix _o); // struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_err(struct LDKBolt11ParseError e); @@ -6230,6 +6535,18 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BigSizeDecodeErrorZ_clone_ptr")] public static extern long CResult_BigSizeDecodeErrorZ_clone_ptr(long _arg); // struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_clone(const struct LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BigSizeDecodeErrorZ_clone")] public static extern long CResult_BigSizeDecodeErrorZ_clone(long _orig); + // struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_ok(struct LDKUntrustedString o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UntrustedStringDecodeErrorZ_ok")] public static extern long CResult_UntrustedStringDecodeErrorZ_ok(long _o); + // struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UntrustedStringDecodeErrorZ_err")] public static extern long CResult_UntrustedStringDecodeErrorZ_err(long _e); + // bool CResult_UntrustedStringDecodeErrorZ_is_ok(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UntrustedStringDecodeErrorZ_is_ok")] public static extern bool CResult_UntrustedStringDecodeErrorZ_is_ok(long _o); + // void CResult_UntrustedStringDecodeErrorZ_free(struct LDKCResult_UntrustedStringDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UntrustedStringDecodeErrorZ_free")] public static extern void CResult_UntrustedStringDecodeErrorZ_free(long __res); + // uint64_t CResult_UntrustedStringDecodeErrorZ_clone_ptr(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR arg); + [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_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_ok(struct LDKHostname o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HostnameDecodeErrorZ_ok")] public static extern long CResult_HostnameDecodeErrorZ_ok(long _o); // struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_err(struct LDKDecodeError e); @@ -6266,18 +6583,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_clone_ptr")] public static extern long CResult_TransactionU16LenLimitedDecodeErrorZ_clone_ptr(long _arg); // struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_clone(const struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_clone")] public static extern long CResult_TransactionU16LenLimitedDecodeErrorZ_clone(long _orig); - // struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_ok(struct LDKUntrustedString o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UntrustedStringDecodeErrorZ_ok")] public static extern long CResult_UntrustedStringDecodeErrorZ_ok(long _o); - // struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UntrustedStringDecodeErrorZ_err")] public static extern long CResult_UntrustedStringDecodeErrorZ_err(long _e); - // bool CResult_UntrustedStringDecodeErrorZ_is_ok(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UntrustedStringDecodeErrorZ_is_ok")] public static extern bool CResult_UntrustedStringDecodeErrorZ_is_ok(long _o); - // void CResult_UntrustedStringDecodeErrorZ_free(struct LDKCResult_UntrustedStringDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UntrustedStringDecodeErrorZ_free")] public static extern void CResult_UntrustedStringDecodeErrorZ_free(long __res); - // uint64_t CResult_UntrustedStringDecodeErrorZ_clone_ptr(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR arg); - [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); @@ -6298,6 +6603,32 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple__u832u16Z_new")] public static extern long C2Tuple__u832u16Z_new(long _a, short _b); // void C2Tuple__u832u16Z_free(struct LDKC2Tuple__u832u16Z _res); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple__u832u16Z_free")] public static extern void C2Tuple__u832u16Z_free(long __res); + // struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_ok(struct LDKBlindedPayInfo o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_ok")] public static extern long CResult_BlindedPayInfoDecodeErrorZ_ok(long _o); + // struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_err")] public static extern long CResult_BlindedPayInfoDecodeErrorZ_err(long _e); + // bool CResult_BlindedPayInfoDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_is_ok")] public static extern bool CResult_BlindedPayInfoDecodeErrorZ_is_ok(long _o); + // void CResult_BlindedPayInfoDecodeErrorZ_free(struct LDKCResult_BlindedPayInfoDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_free")] public static extern void CResult_BlindedPayInfoDecodeErrorZ_free(long __res); + // uint64_t CResult_BlindedPayInfoDecodeErrorZ_clone_ptr(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_clone_ptr")] public static extern long CResult_BlindedPayInfoDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_clone(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_clone")] public static extern long CResult_BlindedPayInfoDecodeErrorZ_clone(long _orig); + // struct LDKCResult_BlindedPaymentPathNoneZ CResult_BlindedPaymentPathNoneZ_ok(struct LDKBlindedPaymentPath o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPaymentPathNoneZ_ok")] public static extern long CResult_BlindedPaymentPathNoneZ_ok(long _o); + // struct LDKCResult_BlindedPaymentPathNoneZ CResult_BlindedPaymentPathNoneZ_err(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPaymentPathNoneZ_err")] public static extern long CResult_BlindedPaymentPathNoneZ_err(); + // bool CResult_BlindedPaymentPathNoneZ_is_ok(const struct LDKCResult_BlindedPaymentPathNoneZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPaymentPathNoneZ_is_ok")] public static extern bool CResult_BlindedPaymentPathNoneZ_is_ok(long _o); + // void CResult_BlindedPaymentPathNoneZ_free(struct LDKCResult_BlindedPaymentPathNoneZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPaymentPathNoneZ_free")] public static extern void CResult_BlindedPaymentPathNoneZ_free(long __res); + // uint64_t CResult_BlindedPaymentPathNoneZ_clone_ptr(LDKCResult_BlindedPaymentPathNoneZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPaymentPathNoneZ_clone_ptr")] public static extern long CResult_BlindedPaymentPathNoneZ_clone_ptr(long _arg); + // struct LDKCResult_BlindedPaymentPathNoneZ CResult_BlindedPaymentPathNoneZ_clone(const struct LDKCResult_BlindedPaymentPathNoneZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPaymentPathNoneZ_clone")] public static extern long CResult_BlindedPaymentPathNoneZ_clone(long _orig); + // void CVec_PaymentForwardNodeZ_free(struct LDKCVec_PaymentForwardNodeZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_PaymentForwardNodeZ_free")] public static extern void CVec_PaymentForwardNodeZ_free(long __res); // struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_ok(struct LDKPaymentRelay o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentRelayDecodeErrorZ_ok")] public static extern long CResult_PaymentRelayDecodeErrorZ_ok(long _o); // struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_err(struct LDKDecodeError e); @@ -6370,38 +6701,6 @@ internal class bindings { [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); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone")] public static extern long C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(long _orig); - // struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new(struct LDKThirtyTwoBytes a, struct LDKRecipientOnionFields b, struct LDKRouteParameters c); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new")] public static extern long C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new(long _a, long _b, long _c); - // void C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free")] public static extern void C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(long __res); - // struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok(struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok")] public static extern long CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok(long _o); - // struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err")] public static extern long CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err(); - // bool CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok(const struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok")] public static extern bool CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok(long _o); - // void CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free")] public static extern void CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(long __res); - // uint64_t CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone_ptr(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR arg); - [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_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); @@ -6414,6 +6713,28 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxOutUtxoLookupErrorZ_clone_ptr")] public static extern long CResult_TxOutUtxoLookupErrorZ_clone_ptr(long _arg); // struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_clone(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxOutUtxoLookupErrorZ_clone")] public static extern long CResult_TxOutUtxoLookupErrorZ_clone(long _orig); + // struct LDKCResult_ResponderDecodeErrorZ CResult_ResponderDecodeErrorZ_ok(struct LDKResponder o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ResponderDecodeErrorZ_ok")] public static extern long CResult_ResponderDecodeErrorZ_ok(long _o); + // struct LDKCResult_ResponderDecodeErrorZ CResult_ResponderDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ResponderDecodeErrorZ_err")] public static extern long CResult_ResponderDecodeErrorZ_err(long _e); + // bool CResult_ResponderDecodeErrorZ_is_ok(const struct LDKCResult_ResponderDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ResponderDecodeErrorZ_is_ok")] public static extern bool CResult_ResponderDecodeErrorZ_is_ok(long _o); + // void CResult_ResponderDecodeErrorZ_free(struct LDKCResult_ResponderDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ResponderDecodeErrorZ_free")] public static extern void CResult_ResponderDecodeErrorZ_free(long __res); + // uint64_t CResult_ResponderDecodeErrorZ_clone_ptr(LDKCResult_ResponderDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ResponderDecodeErrorZ_clone_ptr")] public static extern long CResult_ResponderDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_ResponderDecodeErrorZ CResult_ResponderDecodeErrorZ_clone(const struct LDKCResult_ResponderDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ResponderDecodeErrorZ_clone")] public static extern long CResult_ResponderDecodeErrorZ_clone(long _orig); + // struct LDKCOption_MessageContextZ COption_MessageContextZ_some(struct LDKMessageContext o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_MessageContextZ_some")] public static extern long COption_MessageContextZ_some(long _o); + // struct LDKCOption_MessageContextZ COption_MessageContextZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_MessageContextZ_none")] public static extern long COption_MessageContextZ_none(); + // void COption_MessageContextZ_free(struct LDKCOption_MessageContextZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_MessageContextZ_free")] public static extern void COption_MessageContextZ_free(long __res); + // uint64_t COption_MessageContextZ_clone_ptr(LDKCOption_MessageContextZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_MessageContextZ_clone_ptr")] public static extern long COption_MessageContextZ_clone_ptr(long _arg); + // struct LDKCOption_MessageContextZ COption_MessageContextZ_clone(const struct LDKCOption_MessageContextZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_MessageContextZ_clone")] public static extern long COption_MessageContextZ_clone(long _orig); // uint64_t C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone_ptr(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone_ptr")] public static extern long C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone_ptr(long _arg); // struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone(const struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *NONNULL_PTR orig); @@ -6458,44 +6779,18 @@ internal class bindings { [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); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathNoneZ_err")] public static extern long CResult_BlindedPathNoneZ_err(); - // bool CResult_BlindedPathNoneZ_is_ok(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathNoneZ_is_ok")] public static extern bool CResult_BlindedPathNoneZ_is_ok(long _o); - // void CResult_BlindedPathNoneZ_free(struct LDKCResult_BlindedPathNoneZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathNoneZ_free")] public static extern void CResult_BlindedPathNoneZ_free(long __res); - // uint64_t CResult_BlindedPathNoneZ_clone_ptr(LDKCResult_BlindedPathNoneZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathNoneZ_clone_ptr")] public static extern long CResult_BlindedPathNoneZ_clone_ptr(long _arg); - // struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_clone(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathNoneZ_clone")] public static extern long CResult_BlindedPathNoneZ_clone(long _orig); - // struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_ok(struct LDKC2Tuple_BlindedPayInfoBlindedPathZ o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_ok")] public static extern long CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_ok(long _o); - // struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_err(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_err")] public static extern long CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_err(); - // bool CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_is_ok(const struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_is_ok")] public static extern bool CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_is_ok(long _o); - // void CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free(struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free")] public static extern void CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free(long __res); - // uint64_t CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone_ptr(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone_ptr")] public static extern long CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone_ptr(long _arg); - // struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(const struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone")] public static extern long CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(long _orig); - // void CVec_ForwardNodeZ_free(struct LDKCVec_ForwardNodeZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_ForwardNodeZ_free")] public static extern void CVec_ForwardNodeZ_free(long __res); - // struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_ok(struct LDKBlindedPath o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathDecodeErrorZ_ok")] public static extern long CResult_BlindedPathDecodeErrorZ_ok(long _o); - // struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathDecodeErrorZ_err")] public static extern long CResult_BlindedPathDecodeErrorZ_err(long _e); - // bool CResult_BlindedPathDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathDecodeErrorZ_is_ok")] public static extern bool CResult_BlindedPathDecodeErrorZ_is_ok(long _o); - // void CResult_BlindedPathDecodeErrorZ_free(struct LDKCResult_BlindedPathDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathDecodeErrorZ_free")] public static extern void CResult_BlindedPathDecodeErrorZ_free(long __res); - // uint64_t CResult_BlindedPathDecodeErrorZ_clone_ptr(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathDecodeErrorZ_clone_ptr")] public static extern long CResult_BlindedPathDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_clone(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathDecodeErrorZ_clone")] public static extern long CResult_BlindedPathDecodeErrorZ_clone(long _orig); + // struct LDKCResult_NoneSendErrorZ CResult_NoneSendErrorZ_ok(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneSendErrorZ_ok")] public static extern long CResult_NoneSendErrorZ_ok(); + // struct LDKCResult_NoneSendErrorZ CResult_NoneSendErrorZ_err(struct LDKSendError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneSendErrorZ_err")] public static extern long CResult_NoneSendErrorZ_err(long _e); + // bool CResult_NoneSendErrorZ_is_ok(const struct LDKCResult_NoneSendErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneSendErrorZ_is_ok")] public static extern bool CResult_NoneSendErrorZ_is_ok(long _o); + // void CResult_NoneSendErrorZ_free(struct LDKCResult_NoneSendErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneSendErrorZ_free")] public static extern void CResult_NoneSendErrorZ_free(long __res); + // uint64_t CResult_NoneSendErrorZ_clone_ptr(LDKCResult_NoneSendErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneSendErrorZ_clone_ptr")] public static extern long CResult_NoneSendErrorZ_clone_ptr(long _arg); + // struct LDKCResult_NoneSendErrorZ CResult_NoneSendErrorZ_clone(const struct LDKCResult_NoneSendErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneSendErrorZ_clone")] public static extern long CResult_NoneSendErrorZ_clone(long _orig); // struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_ok(struct LDKBlindedHop o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedHopDecodeErrorZ_ok")] public static extern long CResult_BlindedHopDecodeErrorZ_ok(long _o); // struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_err(struct LDKDecodeError e); @@ -6508,10 +6803,24 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedHopDecodeErrorZ_clone_ptr")] public static extern long CResult_BlindedHopDecodeErrorZ_clone_ptr(long _arg); // struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_clone(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedHopDecodeErrorZ_clone")] public static extern long CResult_BlindedHopDecodeErrorZ_clone(long _orig); - // struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_ok(struct LDKInvoiceError o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceErrorDecodeErrorZ_ok")] public static extern long CResult_InvoiceErrorDecodeErrorZ_ok(long _o); - // struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceErrorDecodeErrorZ_err")] public static extern long CResult_InvoiceErrorDecodeErrorZ_err(long _e); + // void CVec_PhantomRouteHintsZ_free(struct LDKCVec_PhantomRouteHintsZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_PhantomRouteHintsZ_free")] public static extern void CVec_PhantomRouteHintsZ_free(long __res); + // struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(struct LDKBolt11Invoice o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_ok")] public static extern long CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(long _o); + // struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_err")] public static extern long CResult_Bolt11InvoiceSignOrCreationErrorZ_err(long _e); + // bool CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok")] public static extern bool CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(long _o); + // void CResult_Bolt11InvoiceSignOrCreationErrorZ_free(struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_free")] public static extern void CResult_Bolt11InvoiceSignOrCreationErrorZ_free(long __res); + // uint64_t CResult_Bolt11InvoiceSignOrCreationErrorZ_clone_ptr(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_clone_ptr")] public static extern long CResult_Bolt11InvoiceSignOrCreationErrorZ_clone_ptr(long _arg); + // struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_clone")] public static extern long CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(long _orig); + // struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_ok(struct LDKInvoiceError o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceErrorDecodeErrorZ_ok")] public static extern long CResult_InvoiceErrorDecodeErrorZ_ok(long _o); + // struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceErrorDecodeErrorZ_err")] public static extern long CResult_InvoiceErrorDecodeErrorZ_err(long _e); // bool CResult_InvoiceErrorDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceErrorDecodeErrorZ_is_ok")] public static extern bool CResult_InvoiceErrorDecodeErrorZ_is_ok(long _o); // void CResult_InvoiceErrorDecodeErrorZ_free(struct LDKCResult_InvoiceErrorDecodeErrorZ _res); @@ -6662,18 +6971,64 @@ internal class bindings { [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); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr")] public static extern long C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(long _arg); - // struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(const struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone")] public static extern long C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(long _orig); - // struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorUpdateIdZ b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new")] public static extern long C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(long _a, long _b); - // void C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free")] public static extern void C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(long __res); - // void CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free")] public static extern void CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(long __res); + // uint64_t C2Tuple_OutPointCVec_u64ZZ_clone_ptr(LDKC2Tuple_OutPointCVec_u64ZZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OutPointCVec_u64ZZ_clone_ptr")] public static extern long C2Tuple_OutPointCVec_u64ZZ_clone_ptr(long _arg); + // struct LDKC2Tuple_OutPointCVec_u64ZZ C2Tuple_OutPointCVec_u64ZZ_clone(const struct LDKC2Tuple_OutPointCVec_u64ZZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OutPointCVec_u64ZZ_clone")] public static extern long C2Tuple_OutPointCVec_u64ZZ_clone(long _orig); + // struct LDKC2Tuple_OutPointCVec_u64ZZ C2Tuple_OutPointCVec_u64ZZ_new(struct LDKOutPoint a, struct LDKCVec_u64Z b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OutPointCVec_u64ZZ_new")] public static extern long C2Tuple_OutPointCVec_u64ZZ_new(long _a, long _b); + // void C2Tuple_OutPointCVec_u64ZZ_free(struct LDKC2Tuple_OutPointCVec_u64ZZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OutPointCVec_u64ZZ_free")] public static extern void C2Tuple_OutPointCVec_u64ZZ_free(long __res); + // void CVec_C2Tuple_OutPointCVec_u64ZZZ_free(struct LDKCVec_C2Tuple_OutPointCVec_u64ZZZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C2Tuple_OutPointCVec_u64ZZZ_free")] public static extern void CVec_C2Tuple_OutPointCVec_u64ZZZ_free(long __res); + // struct LDKCResult_BlindedMessagePathDecodeErrorZ CResult_BlindedMessagePathDecodeErrorZ_ok(struct LDKBlindedMessagePath o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedMessagePathDecodeErrorZ_ok")] public static extern long CResult_BlindedMessagePathDecodeErrorZ_ok(long _o); + // struct LDKCResult_BlindedMessagePathDecodeErrorZ CResult_BlindedMessagePathDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedMessagePathDecodeErrorZ_err")] public static extern long CResult_BlindedMessagePathDecodeErrorZ_err(long _e); + // bool CResult_BlindedMessagePathDecodeErrorZ_is_ok(const struct LDKCResult_BlindedMessagePathDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedMessagePathDecodeErrorZ_is_ok")] public static extern bool CResult_BlindedMessagePathDecodeErrorZ_is_ok(long _o); + // void CResult_BlindedMessagePathDecodeErrorZ_free(struct LDKCResult_BlindedMessagePathDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedMessagePathDecodeErrorZ_free")] public static extern void CResult_BlindedMessagePathDecodeErrorZ_free(long __res); + // uint64_t CResult_BlindedMessagePathDecodeErrorZ_clone_ptr(LDKCResult_BlindedMessagePathDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedMessagePathDecodeErrorZ_clone_ptr")] public static extern long CResult_BlindedMessagePathDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_BlindedMessagePathDecodeErrorZ CResult_BlindedMessagePathDecodeErrorZ_clone(const struct LDKCResult_BlindedMessagePathDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedMessagePathDecodeErrorZ_clone")] public static extern long CResult_BlindedMessagePathDecodeErrorZ_clone(long _orig); + // struct LDKCResult_BlindedMessagePathNoneZ CResult_BlindedMessagePathNoneZ_ok(struct LDKBlindedMessagePath o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedMessagePathNoneZ_ok")] public static extern long CResult_BlindedMessagePathNoneZ_ok(long _o); + // struct LDKCResult_BlindedMessagePathNoneZ CResult_BlindedMessagePathNoneZ_err(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedMessagePathNoneZ_err")] public static extern long CResult_BlindedMessagePathNoneZ_err(); + // bool CResult_BlindedMessagePathNoneZ_is_ok(const struct LDKCResult_BlindedMessagePathNoneZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedMessagePathNoneZ_is_ok")] public static extern bool CResult_BlindedMessagePathNoneZ_is_ok(long _o); + // void CResult_BlindedMessagePathNoneZ_free(struct LDKCResult_BlindedMessagePathNoneZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedMessagePathNoneZ_free")] public static extern void CResult_BlindedMessagePathNoneZ_free(long __res); + // uint64_t CResult_BlindedMessagePathNoneZ_clone_ptr(LDKCResult_BlindedMessagePathNoneZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedMessagePathNoneZ_clone_ptr")] public static extern long CResult_BlindedMessagePathNoneZ_clone_ptr(long _arg); + // struct LDKCResult_BlindedMessagePathNoneZ CResult_BlindedMessagePathNoneZ_clone(const struct LDKCResult_BlindedMessagePathNoneZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedMessagePathNoneZ_clone")] public static extern long CResult_BlindedMessagePathNoneZ_clone(long _orig); + // struct LDKCResult_MessageContextDecodeErrorZ CResult_MessageContextDecodeErrorZ_ok(struct LDKMessageContext o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_MessageContextDecodeErrorZ_ok")] public static extern long CResult_MessageContextDecodeErrorZ_ok(long _o); + // struct LDKCResult_MessageContextDecodeErrorZ CResult_MessageContextDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_MessageContextDecodeErrorZ_err")] public static extern long CResult_MessageContextDecodeErrorZ_err(long _e); + // bool CResult_MessageContextDecodeErrorZ_is_ok(const struct LDKCResult_MessageContextDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_MessageContextDecodeErrorZ_is_ok")] public static extern bool CResult_MessageContextDecodeErrorZ_is_ok(long _o); + // void CResult_MessageContextDecodeErrorZ_free(struct LDKCResult_MessageContextDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_MessageContextDecodeErrorZ_free")] public static extern void CResult_MessageContextDecodeErrorZ_free(long __res); + // uint64_t CResult_MessageContextDecodeErrorZ_clone_ptr(LDKCResult_MessageContextDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_MessageContextDecodeErrorZ_clone_ptr")] public static extern long CResult_MessageContextDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_MessageContextDecodeErrorZ CResult_MessageContextDecodeErrorZ_clone(const struct LDKCResult_MessageContextDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_MessageContextDecodeErrorZ_clone")] public static extern long CResult_MessageContextDecodeErrorZ_clone(long _orig); + // struct LDKCResult_OffersContextDecodeErrorZ CResult_OffersContextDecodeErrorZ_ok(struct LDKOffersContext o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OffersContextDecodeErrorZ_ok")] public static extern long CResult_OffersContextDecodeErrorZ_ok(long _o); + // struct LDKCResult_OffersContextDecodeErrorZ CResult_OffersContextDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OffersContextDecodeErrorZ_err")] public static extern long CResult_OffersContextDecodeErrorZ_err(long _e); + // bool CResult_OffersContextDecodeErrorZ_is_ok(const struct LDKCResult_OffersContextDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OffersContextDecodeErrorZ_is_ok")] public static extern bool CResult_OffersContextDecodeErrorZ_is_ok(long _o); + // void CResult_OffersContextDecodeErrorZ_free(struct LDKCResult_OffersContextDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OffersContextDecodeErrorZ_free")] public static extern void CResult_OffersContextDecodeErrorZ_free(long __res); + // uint64_t CResult_OffersContextDecodeErrorZ_clone_ptr(LDKCResult_OffersContextDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OffersContextDecodeErrorZ_clone_ptr")] public static extern long CResult_OffersContextDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_OffersContextDecodeErrorZ CResult_OffersContextDecodeErrorZ_clone(const struct LDKCResult_OffersContextDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OffersContextDecodeErrorZ_clone")] public static extern long CResult_OffersContextDecodeErrorZ_clone(long _orig); // void APIError_free(struct LDKAPIError this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_APIError_free")] public static extern void APIError_free(long _this_ptr); // uint64_t APIError_clone_ptr(LDKAPIError *NONNULL_PTR arg); @@ -6718,6 +7073,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BigSize_write")] public static extern long BigSize_write(long _obj); // struct LDKCResult_BigSizeDecodeErrorZ BigSize_read(struct LDKu8slice ser); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BigSize_read")] public static extern long BigSize_read(long _ser); + // struct LDKCVec_u8Z UntrustedString_write(const struct LDKUntrustedString *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UntrustedString_write")] public static extern long UntrustedString_write(long _obj); + // struct LDKCResult_UntrustedStringDecodeErrorZ UntrustedString_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UntrustedString_read")] public static extern long UntrustedString_read(long _ser); // void Hostname_free(struct LDKHostname this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Hostname_free")] public static extern void Hostname_free(long _this_obj); // uint64_t Hostname_clone_ptr(LDKHostname *NONNULL_PTR arg); @@ -6756,14 +7115,12 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TransactionU16LenLimited_write")] public static extern long TransactionU16LenLimited_write(long _obj); // struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ TransactionU16LenLimited_read(struct LDKu8slice ser); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TransactionU16LenLimited_read")] public static extern long TransactionU16LenLimited_read(long _ser); - // struct LDKCResult_StrSecp256k1ErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]); + // struct LDKStr sign(struct LDKu8slice msg, const uint8_t (*sk)[32]); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_sign")] public static extern long sign(long _msg, long _sk); // struct LDKCResult_PublicKeySecp256k1ErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_recover_pk")] public static extern long recover_pk(long _msg, long _sig); // bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_verify")] public static extern bool verify(long _msg, long _sig, long _pk); - // struct LDKCVec_u8Z construct_invoice_preimage(struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z data_without_signature); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_construct_invoice_preimage")] public static extern long construct_invoice_preimage(long _hrp_bytes, long _data_without_signature); // void KVStore_free(struct LDKKVStore this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_KVStore_free")] public static extern void KVStore_free(long _this_ptr); // void Persister_free(struct LDKPersister this_ptr); @@ -6772,12 +7129,12 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_read_channel_monitors")] public static extern long read_channel_monitors(long _kv_store, long _entropy_source, long _signer_provider); // void MonitorUpdatingPersister_free(struct LDKMonitorUpdatingPersister this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MonitorUpdatingPersister_free")] public static extern void MonitorUpdatingPersister_free(long _this_obj); - // MUST_USE_RES struct LDKMonitorUpdatingPersister MonitorUpdatingPersister_new(struct LDKKVStore kv_store, struct LDKLogger logger, uint64_t maximum_pending_updates, struct LDKEntropySource entropy_source, struct LDKSignerProvider signer_provider); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MonitorUpdatingPersister_new")] public static extern long MonitorUpdatingPersister_new(long _kv_store, long _logger, long _maximum_pending_updates, long _entropy_source, long _signer_provider); - // MUST_USE_RES struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ MonitorUpdatingPersister_read_all_channel_monitors_with_updates(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg, const struct LDKBroadcasterInterface *NONNULL_PTR broadcaster, const struct LDKFeeEstimator *NONNULL_PTR fee_estimator); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MonitorUpdatingPersister_read_all_channel_monitors_with_updates")] public static extern long MonitorUpdatingPersister_read_all_channel_monitors_with_updates(long _this_arg, long _broadcaster, long _fee_estimator); - // MUST_USE_RES struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ MonitorUpdatingPersister_read_channel_monitor_with_updates(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg, const struct LDKBroadcasterInterface *NONNULL_PTR broadcaster, const struct LDKFeeEstimator *NONNULL_PTR fee_estimator, struct LDKStr monitor_key); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MonitorUpdatingPersister_read_channel_monitor_with_updates")] public static extern long MonitorUpdatingPersister_read_channel_monitor_with_updates(long _this_arg, long _broadcaster, long _fee_estimator, long _monitor_key); + // MUST_USE_RES struct LDKMonitorUpdatingPersister MonitorUpdatingPersister_new(struct LDKKVStore kv_store, struct LDKLogger logger, uint64_t maximum_pending_updates, struct LDKEntropySource entropy_source, struct LDKSignerProvider signer_provider, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MonitorUpdatingPersister_new")] public static extern long MonitorUpdatingPersister_new(long _kv_store, long _logger, long _maximum_pending_updates, long _entropy_source, long _signer_provider, long _broadcaster, long _fee_estimator); + // MUST_USE_RES struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ MonitorUpdatingPersister_read_all_channel_monitors_with_updates(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MonitorUpdatingPersister_read_all_channel_monitors_with_updates")] public static extern long MonitorUpdatingPersister_read_all_channel_monitors_with_updates(long _this_arg); + // MUST_USE_RES struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ MonitorUpdatingPersister_read_channel_monitor_with_updates(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg, struct LDKStr monitor_key); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MonitorUpdatingPersister_read_channel_monitor_with_updates")] public static extern long MonitorUpdatingPersister_read_channel_monitor_with_updates(long _this_arg, long _monitor_key); // MUST_USE_RES struct LDKCResult_NoneIOErrorZ MonitorUpdatingPersister_cleanup_stale_updates(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg, bool lazy); [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); @@ -6800,38 +7157,6 @@ internal class bindings { [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); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UntrustedString_get_a")] public static extern long UntrustedString_get_a(long _this_ptr); - // void UntrustedString_set_a(struct LDKUntrustedString *NONNULL_PTR this_ptr, struct LDKStr val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UntrustedString_set_a")] public static extern void UntrustedString_set_a(long _this_ptr, long _val); - // MUST_USE_RES struct LDKUntrustedString UntrustedString_new(struct LDKStr a_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UntrustedString_new")] public static extern long UntrustedString_new(long _a_arg); - // uint64_t UntrustedString_clone_ptr(LDKUntrustedString *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UntrustedString_clone_ptr")] public static extern long UntrustedString_clone_ptr(long _arg); - // struct LDKUntrustedString UntrustedString_clone(const struct LDKUntrustedString *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UntrustedString_clone")] public static extern long UntrustedString_clone(long _orig); - // bool UntrustedString_eq(const struct LDKUntrustedString *NONNULL_PTR a, const struct LDKUntrustedString *NONNULL_PTR b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UntrustedString_eq")] public static extern bool UntrustedString_eq(long _a, long _b); - // uint64_t UntrustedString_hash(const struct LDKUntrustedString *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UntrustedString_hash")] public static extern long UntrustedString_hash(long _o); - // struct LDKCVec_u8Z UntrustedString_write(const struct LDKUntrustedString *NONNULL_PTR obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UntrustedString_write")] public static extern long UntrustedString_write(long _obj); - // struct LDKCResult_UntrustedStringDecodeErrorZ UntrustedString_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UntrustedString_read")] public static extern long UntrustedString_read(long _ser); - // struct LDKStr UntrustedString_to_str(const struct LDKUntrustedString *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UntrustedString_to_str")] public static extern long UntrustedString_to_str(long _o); - // void PrintableString_free(struct LDKPrintableString this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PrintableString_free")] public static extern void PrintableString_free(long _this_obj); - // struct LDKStr PrintableString_get_a(const struct LDKPrintableString *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PrintableString_get_a")] public static extern long PrintableString_get_a(long _this_ptr); - // void PrintableString_set_a(struct LDKPrintableString *NONNULL_PTR this_ptr, struct LDKStr val); - [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); - // struct LDKStr PrintableString_to_str(const struct LDKPrintableString *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PrintableString_to_str")] public static extern long PrintableString_to_str(long _o); // 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); @@ -6922,6 +7247,8 @@ internal class bindings { [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(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_from_three_futures(const struct LDKFuture *NONNULL_PTR fut_a, const struct LDKFuture *NONNULL_PTR fut_b, const struct LDKFuture *NONNULL_PTR fut_c); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Sleeper_from_three_futures")] public static extern long Sleeper_from_three_futures(long _fut_a, long _fut_b, long _fut_c); // 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); // void Sleeper_wait(const struct LDKSleeper *NONNULL_PTR this_arg); @@ -6980,8 +7307,12 @@ 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 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); + // struct LDKCOption_ThirtyTwoBytesZ Record_get_payment_hash(const struct LDKRecord *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Record_get_payment_hash")] public static extern long Record_get_payment_hash(long _this_ptr); + // void Record_set_payment_hash(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Record_set_payment_hash")] public static extern void Record_set_payment_hash(long _this_ptr, long _val); + // 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, struct LDKCOption_ThirtyTwoBytesZ payment_hash_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, long _payment_hash_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); // struct LDKRecord Record_clone(const struct LDKRecord *NONNULL_PTR orig); @@ -7010,10 +7341,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelHandshakeConfig_get_negotiate_scid_privacy")] public static extern bool ChannelHandshakeConfig_get_negotiate_scid_privacy(long _this_ptr); // void ChannelHandshakeConfig_set_negotiate_scid_privacy(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelHandshakeConfig_set_negotiate_scid_privacy")] public static extern void ChannelHandshakeConfig_set_negotiate_scid_privacy(long _this_ptr, bool _val); - // bool ChannelHandshakeConfig_get_announced_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelHandshakeConfig_get_announced_channel")] public static extern bool ChannelHandshakeConfig_get_announced_channel(long _this_ptr); - // void ChannelHandshakeConfig_set_announced_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelHandshakeConfig_set_announced_channel")] public static extern void ChannelHandshakeConfig_set_announced_channel(long _this_ptr, bool _val); + // bool ChannelHandshakeConfig_get_announce_for_forwarding(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelHandshakeConfig_get_announce_for_forwarding")] public static extern bool ChannelHandshakeConfig_get_announce_for_forwarding(long _this_ptr); + // void ChannelHandshakeConfig_set_announce_for_forwarding(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelHandshakeConfig_set_announce_for_forwarding")] public static extern void ChannelHandshakeConfig_set_announce_for_forwarding(long _this_ptr, bool _val); // bool ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey")] public static extern bool ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(long _this_ptr); // void ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val); @@ -7030,8 +7361,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelHandshakeConfig_get_our_max_accepted_htlcs")] public static extern short ChannelHandshakeConfig_get_our_max_accepted_htlcs(long _this_ptr); // void ChannelHandshakeConfig_set_our_max_accepted_htlcs(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelHandshakeConfig_set_our_max_accepted_htlcs")] public static extern void ChannelHandshakeConfig_set_our_max_accepted_htlcs(long _this_ptr, short _val); - // MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_new(uint32_t minimum_depth_arg, uint16_t our_to_self_delay_arg, uint64_t our_htlc_minimum_msat_arg, uint8_t max_inbound_htlc_value_in_flight_percent_of_channel_arg, bool negotiate_scid_privacy_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg, uint32_t their_channel_reserve_proportional_millionths_arg, bool negotiate_anchors_zero_fee_htlc_tx_arg, uint16_t our_max_accepted_htlcs_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelHandshakeConfig_new")] public static extern long ChannelHandshakeConfig_new(int _minimum_depth_arg, short _our_to_self_delay_arg, long _our_htlc_minimum_msat_arg, byte _max_inbound_htlc_value_in_flight_percent_of_channel_arg, bool _negotiate_scid_privacy_arg, bool _announced_channel_arg, bool _commit_upfront_shutdown_pubkey_arg, int _their_channel_reserve_proportional_millionths_arg, bool _negotiate_anchors_zero_fee_htlc_tx_arg, short _our_max_accepted_htlcs_arg); + // MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_new(uint32_t minimum_depth_arg, uint16_t our_to_self_delay_arg, uint64_t our_htlc_minimum_msat_arg, uint8_t max_inbound_htlc_value_in_flight_percent_of_channel_arg, bool negotiate_scid_privacy_arg, bool announce_for_forwarding_arg, bool commit_upfront_shutdown_pubkey_arg, uint32_t their_channel_reserve_proportional_millionths_arg, bool negotiate_anchors_zero_fee_htlc_tx_arg, uint16_t our_max_accepted_htlcs_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelHandshakeConfig_new")] public static extern long ChannelHandshakeConfig_new(int _minimum_depth_arg, short _our_to_self_delay_arg, long _our_htlc_minimum_msat_arg, byte _max_inbound_htlc_value_in_flight_percent_of_channel_arg, bool _negotiate_scid_privacy_arg, bool _announce_for_forwarding_arg, bool _commit_upfront_shutdown_pubkey_arg, int _their_channel_reserve_proportional_millionths_arg, bool _negotiate_anchors_zero_fee_htlc_tx_arg, short _our_max_accepted_htlcs_arg); // uint64_t ChannelHandshakeConfig_clone_ptr(LDKChannelHandshakeConfig *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelHandshakeConfig_clone_ptr")] public static extern long ChannelHandshakeConfig_clone_ptr(long _arg); // struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig); @@ -7170,8 +7501,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis")] public static extern void ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis(long _this_ptr, long _val); // MUST_USE_RES struct LDKChannelConfigUpdate ChannelConfigUpdate_new(struct LDKCOption_u32Z forwarding_fee_proportional_millionths_arg, struct LDKCOption_u32Z forwarding_fee_base_msat_arg, struct LDKCOption_u16Z cltv_expiry_delta_arg, struct LDKCOption_MaxDustHTLCExposureZ max_dust_htlc_exposure_msat_arg, struct LDKCOption_u64Z force_close_avoidance_max_fee_satoshis_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelConfigUpdate_new")] public static extern long ChannelConfigUpdate_new(long _forwarding_fee_proportional_millionths_arg, long _forwarding_fee_base_msat_arg, long _cltv_expiry_delta_arg, long _max_dust_htlc_exposure_msat_arg, long _force_close_avoidance_max_fee_satoshis_arg); - // MUST_USE_RES struct LDKChannelConfigUpdate ChannelConfigUpdate_default(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelConfigUpdate_default")] public static extern long ChannelConfigUpdate_default(); // void UserConfig_free(struct LDKUserConfig this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UserConfig_free")] public static extern void UserConfig_free(long _this_obj); // struct LDKChannelHandshakeConfig UserConfig_get_channel_handshake_config(const struct LDKUserConfig *NONNULL_PTR this_ptr); @@ -7206,8 +7535,12 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UserConfig_get_accept_mpp_keysend")] public static extern bool UserConfig_get_accept_mpp_keysend(long _this_ptr); // void UserConfig_set_accept_mpp_keysend(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UserConfig_set_accept_mpp_keysend")] public static extern void UserConfig_set_accept_mpp_keysend(long _this_ptr, bool _val); - // MUST_USE_RES struct LDKUserConfig UserConfig_new(struct LDKChannelHandshakeConfig channel_handshake_config_arg, struct LDKChannelHandshakeLimits channel_handshake_limits_arg, struct LDKChannelConfig 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); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UserConfig_new")] public static extern long UserConfig_new(long _channel_handshake_config_arg, long _channel_handshake_limits_arg, long _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); + // bool UserConfig_get_manually_handle_bolt12_invoices(const struct LDKUserConfig *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UserConfig_get_manually_handle_bolt12_invoices")] public static extern bool UserConfig_get_manually_handle_bolt12_invoices(long _this_ptr); + // void UserConfig_set_manually_handle_bolt12_invoices(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UserConfig_set_manually_handle_bolt12_invoices")] public static extern void UserConfig_set_manually_handle_bolt12_invoices(long _this_ptr, bool _val); + // MUST_USE_RES struct LDKUserConfig UserConfig_new(struct LDKChannelHandshakeConfig channel_handshake_config_arg, struct LDKChannelHandshakeLimits channel_handshake_limits_arg, struct LDKChannelConfig 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, bool manually_handle_bolt12_invoices_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UserConfig_new")] public static extern long UserConfig_new(long _channel_handshake_config_arg, long _channel_handshake_limits_arg, long _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, bool _manually_handle_bolt12_invoices_arg); // uint64_t UserConfig_clone_ptr(LDKUserConfig *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UserConfig_clone_ptr")] public static extern long UserConfig_clone_ptr(long _arg); // struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig); @@ -7286,8 +7619,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BroadcasterInterface_free")] public static extern void BroadcasterInterface_free(long _this_ptr); // enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ConfirmationTarget_clone")] public static extern ConfirmationTarget ConfirmationTarget_clone(long _orig); - // enum LDKConfirmationTarget ConfirmationTarget_on_chain_sweep(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ConfirmationTarget_on_chain_sweep")] public static extern ConfirmationTarget ConfirmationTarget_on_chain_sweep(); + // enum LDKConfirmationTarget ConfirmationTarget_maximum_fee_estimate(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ConfirmationTarget_maximum_fee_estimate")] public static extern ConfirmationTarget ConfirmationTarget_maximum_fee_estimate(); + // enum LDKConfirmationTarget ConfirmationTarget_urgent_on_chain_sweep(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ConfirmationTarget_urgent_on_chain_sweep")] public static extern ConfirmationTarget ConfirmationTarget_urgent_on_chain_sweep(); // enum LDKConfirmationTarget ConfirmationTarget_min_allowed_anchor_channel_remote_fee(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ConfirmationTarget_min_allowed_anchor_channel_remote_fee")] public static extern ConfirmationTarget ConfirmationTarget_min_allowed_anchor_channel_remote_fee(); // enum LDKConfirmationTarget ConfirmationTarget_min_allowed_non_anchor_channel_remote_fee(void); @@ -7306,16 +7641,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ConfirmationTarget_eq")] public static extern bool ConfirmationTarget_eq(long _a, long _b); // void FeeEstimator_free(struct LDKFeeEstimator this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FeeEstimator_free")] public static extern void FeeEstimator_free(long _this_ptr); - // void MonitorUpdateId_free(struct LDKMonitorUpdateId this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MonitorUpdateId_free")] public static extern void MonitorUpdateId_free(long _this_obj); - // uint64_t MonitorUpdateId_clone_ptr(LDKMonitorUpdateId *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MonitorUpdateId_clone_ptr")] public static extern long MonitorUpdateId_clone_ptr(long _arg); - // struct LDKMonitorUpdateId MonitorUpdateId_clone(const struct LDKMonitorUpdateId *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MonitorUpdateId_clone")] public static extern long MonitorUpdateId_clone(long _orig); - // uint64_t MonitorUpdateId_hash(const struct LDKMonitorUpdateId *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MonitorUpdateId_hash")] public static extern long MonitorUpdateId_hash(long _o); - // bool MonitorUpdateId_eq(const struct LDKMonitorUpdateId *NONNULL_PTR a, const struct LDKMonitorUpdateId *NONNULL_PTR b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MonitorUpdateId_eq")] public static extern bool MonitorUpdateId_eq(long _a, long _b); // void Persist_free(struct LDKPersist this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Persist_free")] public static extern void Persist_free(long _this_ptr); // void LockedChannelMonitor_free(struct LDKLockedChannelMonitor this_obj); @@ -7330,9 +7655,9 @@ internal class bindings { [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_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); + // MUST_USE_RES struct LDKCVec_C2Tuple_OutPointCVec_u64ZZZ 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); - // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChainMonitor_channel_monitor_updated(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo, struct LDKMonitorUpdateId completed_update_id); + // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChainMonitor_channel_monitor_updated(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo, uint64_t completed_update_id); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChainMonitor_channel_monitor_updated")] public static extern long ChainMonitor_channel_monitor_updated(long _this_arg, long _funding_txo, long _completed_update_id); // MUST_USE_RES struct LDKFuture ChainMonitor_get_update_future(const struct LDKChainMonitor *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChainMonitor_get_update_future")] public static extern long ChainMonitor_get_update_future(long _this_arg); @@ -7402,20 +7727,32 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCUpdate_write")] public static extern long HTLCUpdate_write(long _obj); // struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCUpdate_read")] public static extern long HTLCUpdate_read(long _ser); + // enum LDKBalanceSource BalanceSource_clone(const enum LDKBalanceSource *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BalanceSource_clone")] public static extern BalanceSource BalanceSource_clone(long _orig); + // enum LDKBalanceSource BalanceSource_holder_force_closed(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BalanceSource_holder_force_closed")] public static extern BalanceSource BalanceSource_holder_force_closed(); + // enum LDKBalanceSource BalanceSource_counterparty_force_closed(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BalanceSource_counterparty_force_closed")] public static extern BalanceSource BalanceSource_counterparty_force_closed(); + // enum LDKBalanceSource BalanceSource_coop_close(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BalanceSource_coop_close")] public static extern BalanceSource BalanceSource_coop_close(); + // enum LDKBalanceSource BalanceSource_htlc(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BalanceSource_htlc")] public static extern BalanceSource BalanceSource_htlc(); + // bool BalanceSource_eq(const enum LDKBalanceSource *NONNULL_PTR a, const enum LDKBalanceSource *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BalanceSource_eq")] public static extern bool BalanceSource_eq(long _a, long _b); // void Balance_free(struct LDKBalance this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Balance_free")] public static extern void Balance_free(long _this_ptr); // uint64_t Balance_clone_ptr(LDKBalance *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Balance_clone_ptr")] public static extern long Balance_clone_ptr(long _arg); // struct LDKBalance Balance_clone(const struct LDKBalance *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Balance_clone")] public static extern long Balance_clone(long _orig); - // struct LDKBalance Balance_claimable_on_channel_close(uint64_t amount_satoshis); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Balance_claimable_on_channel_close")] public static extern long Balance_claimable_on_channel_close(long _amount_satoshis); - // struct LDKBalance Balance_claimable_awaiting_confirmations(uint64_t amount_satoshis, uint32_t confirmation_height); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Balance_claimable_awaiting_confirmations")] public static extern long Balance_claimable_awaiting_confirmations(long _amount_satoshis, int _confirmation_height); + // struct LDKBalance Balance_claimable_on_channel_close(uint64_t amount_satoshis, uint64_t transaction_fee_satoshis, uint64_t outbound_payment_htlc_rounded_msat, uint64_t outbound_forwarded_htlc_rounded_msat, uint64_t inbound_claiming_htlc_rounded_msat, uint64_t inbound_htlc_rounded_msat); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Balance_claimable_on_channel_close")] public static extern long Balance_claimable_on_channel_close(long _amount_satoshis, long _transaction_fee_satoshis, long _outbound_payment_htlc_rounded_msat, long _outbound_forwarded_htlc_rounded_msat, long _inbound_claiming_htlc_rounded_msat, long _inbound_htlc_rounded_msat); + // struct LDKBalance Balance_claimable_awaiting_confirmations(uint64_t amount_satoshis, uint32_t confirmation_height, enum LDKBalanceSource source); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Balance_claimable_awaiting_confirmations")] public static extern long Balance_claimable_awaiting_confirmations(long _amount_satoshis, int _confirmation_height, BalanceSource _source); // struct LDKBalance Balance_contentious_claimable(uint64_t amount_satoshis, uint32_t timeout_height, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_preimage); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Balance_contentious_claimable")] public static extern long Balance_contentious_claimable(long _amount_satoshis, int _timeout_height, long _payment_hash, long _payment_preimage); - // struct LDKBalance Balance_maybe_timeout_claimable_htlc(uint64_t amount_satoshis, uint32_t claimable_height, struct LDKThirtyTwoBytes payment_hash); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Balance_maybe_timeout_claimable_htlc")] public static extern long Balance_maybe_timeout_claimable_htlc(long _amount_satoshis, int _claimable_height, long _payment_hash); + // struct LDKBalance Balance_maybe_timeout_claimable_htlc(uint64_t amount_satoshis, uint32_t claimable_height, struct LDKThirtyTwoBytes payment_hash, bool outbound_payment); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Balance_maybe_timeout_claimable_htlc")] public static extern long Balance_maybe_timeout_claimable_htlc(long _amount_satoshis, int _claimable_height, long _payment_hash, bool _outbound_payment); // struct LDKBalance Balance_maybe_preimage_claimable_htlc(uint64_t amount_satoshis, uint32_t expiry_height, struct LDKThirtyTwoBytes payment_hash); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Balance_maybe_preimage_claimable_htlc")] public static extern long Balance_maybe_preimage_claimable_htlc(long _amount_satoshis, int _expiry_height, long _payment_hash); // struct LDKBalance Balance_counterparty_revoked_output_claimable(uint64_t amount_satoshis); @@ -7446,8 +7783,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_load_outputs_to_watch")] public static extern void ChannelMonitor_load_outputs_to_watch(long _this_arg, long _filter, long _logger); // MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_get_and_clear_pending_monitor_events")] public static extern long ChannelMonitor_get_and_clear_pending_monitor_events(long _this_arg); - // void ChannelMonitor_process_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKEventHandler *NONNULL_PTR handler); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_process_pending_events")] public static extern void ChannelMonitor_process_pending_events(long _this_arg, long _handler); + // MUST_USE_RES struct LDKCResult_NoneReplayEventZ ChannelMonitor_process_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKEventHandler *NONNULL_PTR handler); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_process_pending_events")] public static extern long ChannelMonitor_process_pending_events(long _this_arg, long _handler); // MUST_USE_RES struct LDKCommitmentTransaction ChannelMonitor_initial_counterparty_commitment_tx(const struct LDKChannelMonitor *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_initial_counterparty_commitment_tx")] public static extern long ChannelMonitor_initial_counterparty_commitment_tx(long _this_arg); // MUST_USE_RES struct LDKCVec_CommitmentTransactionZ ChannelMonitor_counterparty_commitment_txs_from_update(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKChannelMonitorUpdate *NONNULL_PTR update); @@ -7474,6 +7811,8 @@ 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); + // MUST_USE_RES bool ChannelMonitor_has_pending_claims(const struct LDKChannelMonitor *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_has_pending_claims")] public static extern bool ChannelMonitor_has_pending_claims(long _this_arg); // 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); @@ -7534,7 +7873,7 @@ internal class bindings { [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); + // struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ peel_payment_onion(const struct LDKUpdateAddHTLC *NONNULL_PTR msg, struct LDKNodeSigner node_signer, struct LDKLogger 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); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PendingHTLCRouting_free")] public static extern void PendingHTLCRouting_free(long _this_ptr); @@ -7558,8 +7897,12 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedForward_get_failure")] public static extern BlindedFailure BlindedForward_get_failure(long _this_ptr); // void BlindedForward_set_failure(struct LDKBlindedForward *NONNULL_PTR this_ptr, enum LDKBlindedFailure val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedForward_set_failure")] public static extern void BlindedForward_set_failure(long _this_ptr, BlindedFailure _val); - // MUST_USE_RES struct LDKBlindedForward BlindedForward_new(struct LDKPublicKey inbound_blinding_point_arg, enum LDKBlindedFailure failure_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedForward_new")] public static extern long BlindedForward_new(long _inbound_blinding_point_arg, BlindedFailure _failure_arg); + // struct LDKPublicKey BlindedForward_get_next_blinding_override(const struct LDKBlindedForward *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedForward_get_next_blinding_override")] public static extern long BlindedForward_get_next_blinding_override(long _this_ptr); + // void BlindedForward_set_next_blinding_override(struct LDKBlindedForward *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedForward_set_next_blinding_override")] public static extern void BlindedForward_set_next_blinding_override(long _this_ptr, long _val); + // MUST_USE_RES struct LDKBlindedForward BlindedForward_new(struct LDKPublicKey inbound_blinding_point_arg, enum LDKBlindedFailure failure_arg, struct LDKPublicKey next_blinding_override_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedForward_new")] public static extern long BlindedForward_new(long _inbound_blinding_point_arg, BlindedFailure _failure_arg, long _next_blinding_override_arg); // uint64_t BlindedForward_clone_ptr(LDKBlindedForward *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedForward_clone_ptr")] public static extern long BlindedForward_clone_ptr(long _arg); // struct LDKBlindedForward BlindedForward_clone(const struct LDKBlindedForward *NONNULL_PTR orig); @@ -7698,15 +8041,15 @@ internal class bindings { [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 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 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 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); - // void ChannelManager_force_close_all_channels_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_force_close_all_channels_without_broadcasting_txn")] public static extern void ChannelManager_force_close_all_channels_without_broadcasting_txn(long _this_arg); - // MUST_USE_RES struct LDKCResult_NonePaymentSendFailureZ ChannelManager_send_payment_with_route(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_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, struct LDKStr error_message); + [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, long _error_message); + // 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, struct LDKStr error_message); + [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, long _error_message); + // void ChannelManager_force_close_all_channels_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKStr error_message); + [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, long _error_message); + // void ChannelManager_force_close_all_channels_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKStr error_message); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_force_close_all_channels_without_broadcasting_txn")] public static extern void ChannelManager_force_close_all_channels_without_broadcasting_txn(long _this_arg, long _error_message); + // MUST_USE_RES struct LDKCResult_NonePaymentSendFailureZ ChannelManager_send_payment_with_route(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKRoute route, struct LDKThirtyTwoBytes payment_hash, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_send_payment_with_route")] public static extern long ChannelManager_send_payment_with_route(long _this_arg, long _route, long _payment_hash, long _recipient_onion, long _payment_id); // MUST_USE_RES struct LDKCResult_NoneRetryableSendFailureZ ChannelManager_send_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id, struct LDKRouteParameters route_params, struct LDKRetry retry_strategy); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_send_payment")] public static extern long ChannelManager_send_payment(long _this_arg, long _payment_hash, long _recipient_onion, long _payment_id, long _route_params, long _retry_strategy); @@ -7722,8 +8065,10 @@ 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 struct LDKChannelId *NONNULL_PTR temporary_channel_id, 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, struct LDKChannelId 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_unsafe_manual_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKChannelId temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKOutPoint funding); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_unsafe_manual_funding_transaction_generated")] public static extern long ChannelManager_unsafe_manual_funding_transaction_generated(long _this_arg, long _temporary_channel_id, long _counterparty_node_id, long _funding); // 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_ChannelIdZ channel_ids, const struct LDKChannelConfigUpdate *NONNULL_PTR config_update); @@ -7752,8 +8097,8 @@ internal class bindings { [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 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_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ ChannelManager_create_offer_builder(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_u64Z absolute_expiry); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_create_offer_builder")] public static extern long ChannelManager_create_offer_builder(long _this_arg, long _absolute_expiry); // 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); @@ -7800,6 +8145,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 LDKAsyncPaymentsMessageHandler ChannelManager_as_AsyncPaymentsMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_as_AsyncPaymentsMessageHandler")] public static extern long ChannelManager_as_AsyncPaymentsMessageHandler(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); @@ -8270,10 +8617,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_is_usable")] public static extern bool ChannelDetails_get_is_usable(long _this_ptr); // void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_is_usable")] public static extern void ChannelDetails_set_is_usable(long _this_ptr, bool _val); - // bool ChannelDetails_get_is_public(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_is_public")] public static extern bool ChannelDetails_get_is_public(long _this_ptr); - // void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_is_public")] public static extern void ChannelDetails_set_is_public(long _this_ptr, bool _val); + // bool ChannelDetails_get_is_announced(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_is_announced")] public static extern bool ChannelDetails_get_is_announced(long _this_ptr); + // void ChannelDetails_set_is_announced(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_is_announced")] public static extern void ChannelDetails_set_is_announced(long _this_ptr, bool _val); // struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_inbound_htlc_minimum_msat")] public static extern long ChannelDetails_get_inbound_htlc_minimum_msat(long _this_ptr); // void ChannelDetails_set_inbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); @@ -8294,8 +8641,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_pending_outbound_htlcs")] public static extern long ChannelDetails_get_pending_outbound_htlcs(long _this_ptr); // void ChannelDetails_set_pending_outbound_htlcs(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCVec_OutboundHTLCDetailsZ val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_pending_outbound_htlcs")] public static extern void ChannelDetails_set_pending_outbound_htlcs(long _this_ptr, long _val); - // MUST_USE_RES struct LDKChannelDetails ChannelDetails_new(struct LDKChannelId 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, struct LDKCVec_InboundHTLCDetailsZ pending_inbound_htlcs_arg, struct LDKCVec_OutboundHTLCDetailsZ pending_outbound_htlcs_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, long _pending_inbound_htlcs_arg, long _pending_outbound_htlcs_arg); + // MUST_USE_RES struct LDKChannelDetails ChannelDetails_new(struct LDKChannelId 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_announced_arg, struct LDKCOption_u64Z inbound_htlc_minimum_msat_arg, struct LDKCOption_u64Z inbound_htlc_maximum_msat_arg, struct LDKChannelConfig config_arg, struct LDKCVec_InboundHTLCDetailsZ pending_inbound_htlcs_arg, struct LDKCVec_OutboundHTLCDetailsZ pending_outbound_htlcs_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_announced_arg, long _inbound_htlc_minimum_msat_arg, long _inbound_htlc_maximum_msat_arg, long _config_arg, long _pending_inbound_htlcs_arg, long _pending_outbound_htlcs_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); @@ -8544,6 +8891,44 @@ internal class bindings { [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); + // MUST_USE_RES struct LDKChannelParameters CommonOpenChannelFields_channel_parameters(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_channel_parameters")] public static extern long CommonOpenChannelFields_channel_parameters(long _this_arg); + // void ChannelParameters_free(struct LDKChannelParameters this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelParameters_free")] public static extern void ChannelParameters_free(long _this_obj); + // uint64_t ChannelParameters_get_dust_limit_satoshis(const struct LDKChannelParameters *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelParameters_get_dust_limit_satoshis")] public static extern long ChannelParameters_get_dust_limit_satoshis(long _this_ptr); + // void ChannelParameters_set_dust_limit_satoshis(struct LDKChannelParameters *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelParameters_set_dust_limit_satoshis")] public static extern void ChannelParameters_set_dust_limit_satoshis(long _this_ptr, long _val); + // uint64_t ChannelParameters_get_max_htlc_value_in_flight_msat(const struct LDKChannelParameters *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelParameters_get_max_htlc_value_in_flight_msat")] public static extern long ChannelParameters_get_max_htlc_value_in_flight_msat(long _this_ptr); + // void ChannelParameters_set_max_htlc_value_in_flight_msat(struct LDKChannelParameters *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelParameters_set_max_htlc_value_in_flight_msat")] public static extern void ChannelParameters_set_max_htlc_value_in_flight_msat(long _this_ptr, long _val); + // uint64_t ChannelParameters_get_htlc_minimum_msat(const struct LDKChannelParameters *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelParameters_get_htlc_minimum_msat")] public static extern long ChannelParameters_get_htlc_minimum_msat(long _this_ptr); + // void ChannelParameters_set_htlc_minimum_msat(struct LDKChannelParameters *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelParameters_set_htlc_minimum_msat")] public static extern void ChannelParameters_set_htlc_minimum_msat(long _this_ptr, long _val); + // uint32_t ChannelParameters_get_commitment_feerate_sat_per_1000_weight(const struct LDKChannelParameters *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelParameters_get_commitment_feerate_sat_per_1000_weight")] public static extern int ChannelParameters_get_commitment_feerate_sat_per_1000_weight(long _this_ptr); + // void ChannelParameters_set_commitment_feerate_sat_per_1000_weight(struct LDKChannelParameters *NONNULL_PTR this_ptr, uint32_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelParameters_set_commitment_feerate_sat_per_1000_weight")] public static extern void ChannelParameters_set_commitment_feerate_sat_per_1000_weight(long _this_ptr, int _val); + // uint16_t ChannelParameters_get_to_self_delay(const struct LDKChannelParameters *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelParameters_get_to_self_delay")] public static extern short ChannelParameters_get_to_self_delay(long _this_ptr); + // void ChannelParameters_set_to_self_delay(struct LDKChannelParameters *NONNULL_PTR this_ptr, uint16_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelParameters_set_to_self_delay")] public static extern void ChannelParameters_set_to_self_delay(long _this_ptr, short _val); + // uint16_t ChannelParameters_get_max_accepted_htlcs(const struct LDKChannelParameters *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelParameters_get_max_accepted_htlcs")] public static extern short ChannelParameters_get_max_accepted_htlcs(long _this_ptr); + // void ChannelParameters_set_max_accepted_htlcs(struct LDKChannelParameters *NONNULL_PTR this_ptr, uint16_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelParameters_set_max_accepted_htlcs")] public static extern void ChannelParameters_set_max_accepted_htlcs(long _this_ptr, short _val); + // MUST_USE_RES struct LDKChannelParameters ChannelParameters_new(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); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelParameters_new")] public static extern long ChannelParameters_new(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); + // uint64_t ChannelParameters_clone_ptr(LDKChannelParameters *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelParameters_clone_ptr")] public static extern long ChannelParameters_clone_ptr(long _arg); + // struct LDKChannelParameters ChannelParameters_clone(const struct LDKChannelParameters *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelParameters_clone")] public static extern long ChannelParameters_clone(long _orig); + // uint64_t ChannelParameters_hash(const struct LDKChannelParameters *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelParameters_hash")] public static extern long ChannelParameters_hash(long _o); + // bool ChannelParameters_eq(const struct LDKChannelParameters *NONNULL_PTR a, const struct LDKChannelParameters *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelParameters_eq")] public static extern bool ChannelParameters_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); // struct LDKCommonOpenChannelFields OpenChannel_get_common_fields(const struct LDKOpenChannel *NONNULL_PTR this_ptr); @@ -8810,60 +9195,60 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Stfu_clone")] public static extern long Stfu_clone(long _orig); // bool Stfu_eq(const struct LDKStfu *NONNULL_PTR a, const struct LDKStfu *NONNULL_PTR b); [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); - // 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 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); - // void Splice_set_chain_hash(struct LDKSplice *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Splice_set_chain_hash")] public static extern void Splice_set_chain_hash(long _this_ptr, long _val); - // int64_t Splice_get_relative_satoshis(const struct LDKSplice *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Splice_get_relative_satoshis")] public static extern long Splice_get_relative_satoshis(long _this_ptr); - // void Splice_set_relative_satoshis(struct LDKSplice *NONNULL_PTR this_ptr, int64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Splice_set_relative_satoshis")] public static extern void Splice_set_relative_satoshis(long _this_ptr, long _val); - // uint32_t Splice_get_funding_feerate_perkw(const struct LDKSplice *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Splice_get_funding_feerate_perkw")] public static extern int Splice_get_funding_feerate_perkw(long _this_ptr); - // void Splice_set_funding_feerate_perkw(struct LDKSplice *NONNULL_PTR this_ptr, uint32_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Splice_set_funding_feerate_perkw")] public static extern void Splice_set_funding_feerate_perkw(long _this_ptr, int _val); - // uint32_t Splice_get_locktime(const struct LDKSplice *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Splice_get_locktime")] public static extern int Splice_get_locktime(long _this_ptr); - // void Splice_set_locktime(struct LDKSplice *NONNULL_PTR this_ptr, uint32_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Splice_set_locktime")] public static extern void Splice_set_locktime(long _this_ptr, int _val); - // struct LDKPublicKey Splice_get_funding_pubkey(const struct LDKSplice *NONNULL_PTR this_ptr); - [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 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); - // struct LDKSplice Splice_clone(const struct LDKSplice *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Splice_clone")] public static extern long Splice_clone(long _orig); - // bool Splice_eq(const struct LDKSplice *NONNULL_PTR a, const struct LDKSplice *NONNULL_PTR b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Splice_eq")] public static extern bool Splice_eq(long _a, long _b); + // void SpliceInit_free(struct LDKSpliceInit this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceInit_free")] public static extern void SpliceInit_free(long _this_obj); + // struct LDKChannelId SpliceInit_get_channel_id(const struct LDKSpliceInit *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceInit_get_channel_id")] public static extern long SpliceInit_get_channel_id(long _this_ptr); + // void SpliceInit_set_channel_id(struct LDKSpliceInit *NONNULL_PTR this_ptr, struct LDKChannelId val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceInit_set_channel_id")] public static extern void SpliceInit_set_channel_id(long _this_ptr, long _val); + // int64_t SpliceInit_get_funding_contribution_satoshis(const struct LDKSpliceInit *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceInit_get_funding_contribution_satoshis")] public static extern long SpliceInit_get_funding_contribution_satoshis(long _this_ptr); + // void SpliceInit_set_funding_contribution_satoshis(struct LDKSpliceInit *NONNULL_PTR this_ptr, int64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceInit_set_funding_contribution_satoshis")] public static extern void SpliceInit_set_funding_contribution_satoshis(long _this_ptr, long _val); + // uint32_t SpliceInit_get_funding_feerate_perkw(const struct LDKSpliceInit *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceInit_get_funding_feerate_perkw")] public static extern int SpliceInit_get_funding_feerate_perkw(long _this_ptr); + // void SpliceInit_set_funding_feerate_perkw(struct LDKSpliceInit *NONNULL_PTR this_ptr, uint32_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceInit_set_funding_feerate_perkw")] public static extern void SpliceInit_set_funding_feerate_perkw(long _this_ptr, int _val); + // uint32_t SpliceInit_get_locktime(const struct LDKSpliceInit *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceInit_get_locktime")] public static extern int SpliceInit_get_locktime(long _this_ptr); + // void SpliceInit_set_locktime(struct LDKSpliceInit *NONNULL_PTR this_ptr, uint32_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceInit_set_locktime")] public static extern void SpliceInit_set_locktime(long _this_ptr, int _val); + // struct LDKPublicKey SpliceInit_get_funding_pubkey(const struct LDKSpliceInit *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceInit_get_funding_pubkey")] public static extern long SpliceInit_get_funding_pubkey(long _this_ptr); + // void SpliceInit_set_funding_pubkey(struct LDKSpliceInit *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceInit_set_funding_pubkey")] public static extern void SpliceInit_set_funding_pubkey(long _this_ptr, long _val); + // enum LDKCOption_NoneZ SpliceInit_get_require_confirmed_inputs(const struct LDKSpliceInit *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceInit_get_require_confirmed_inputs")] public static extern COption_NoneZ SpliceInit_get_require_confirmed_inputs(long _this_ptr); + // void SpliceInit_set_require_confirmed_inputs(struct LDKSpliceInit *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceInit_set_require_confirmed_inputs")] public static extern void SpliceInit_set_require_confirmed_inputs(long _this_ptr, COption_NoneZ _val); + // MUST_USE_RES struct LDKSpliceInit SpliceInit_new(struct LDKChannelId channel_id_arg, int64_t funding_contribution_satoshis_arg, uint32_t funding_feerate_perkw_arg, uint32_t locktime_arg, struct LDKPublicKey funding_pubkey_arg, enum LDKCOption_NoneZ require_confirmed_inputs_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceInit_new")] public static extern long SpliceInit_new(long _channel_id_arg, long _funding_contribution_satoshis_arg, int _funding_feerate_perkw_arg, int _locktime_arg, long _funding_pubkey_arg, COption_NoneZ _require_confirmed_inputs_arg); + // uint64_t SpliceInit_clone_ptr(LDKSpliceInit *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceInit_clone_ptr")] public static extern long SpliceInit_clone_ptr(long _arg); + // struct LDKSpliceInit SpliceInit_clone(const struct LDKSpliceInit *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceInit_clone")] public static extern long SpliceInit_clone(long _orig); + // bool SpliceInit_eq(const struct LDKSpliceInit *NONNULL_PTR a, const struct LDKSpliceInit *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceInit_eq")] public static extern bool SpliceInit_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); // 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 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); - // void SpliceAck_set_chain_hash(struct LDKSpliceAck *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceAck_set_chain_hash")] public static extern void SpliceAck_set_chain_hash(long _this_ptr, long _val); - // int64_t SpliceAck_get_relative_satoshis(const struct LDKSpliceAck *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceAck_get_relative_satoshis")] public static extern long SpliceAck_get_relative_satoshis(long _this_ptr); - // void SpliceAck_set_relative_satoshis(struct LDKSpliceAck *NONNULL_PTR this_ptr, int64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceAck_set_relative_satoshis")] public static extern void SpliceAck_set_relative_satoshis(long _this_ptr, long _val); + // int64_t SpliceAck_get_funding_contribution_satoshis(const struct LDKSpliceAck *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceAck_get_funding_contribution_satoshis")] public static extern long SpliceAck_get_funding_contribution_satoshis(long _this_ptr); + // void SpliceAck_set_funding_contribution_satoshis(struct LDKSpliceAck *NONNULL_PTR this_ptr, int64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceAck_set_funding_contribution_satoshis")] public static extern void SpliceAck_set_funding_contribution_satoshis(long _this_ptr, long _val); // struct LDKPublicKey SpliceAck_get_funding_pubkey(const struct LDKSpliceAck *NONNULL_PTR this_ptr); [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 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); + // enum LDKCOption_NoneZ SpliceAck_get_require_confirmed_inputs(const struct LDKSpliceAck *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceAck_get_require_confirmed_inputs")] public static extern COption_NoneZ SpliceAck_get_require_confirmed_inputs(long _this_ptr); + // void SpliceAck_set_require_confirmed_inputs(struct LDKSpliceAck *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceAck_set_require_confirmed_inputs")] public static extern void SpliceAck_set_require_confirmed_inputs(long _this_ptr, COption_NoneZ _val); + // MUST_USE_RES struct LDKSpliceAck SpliceAck_new(struct LDKChannelId channel_id_arg, int64_t funding_contribution_satoshis_arg, struct LDKPublicKey funding_pubkey_arg, enum LDKCOption_NoneZ require_confirmed_inputs_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceAck_new")] public static extern long SpliceAck_new(long _channel_id_arg, long _funding_contribution_satoshis_arg, long _funding_pubkey_arg, COption_NoneZ _require_confirmed_inputs_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); // struct LDKSpliceAck SpliceAck_clone(const struct LDKSpliceAck *NONNULL_PTR orig); @@ -8876,8 +9261,12 @@ internal class bindings { [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 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 LDKChannelId channel_id_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceLocked_new")] public static extern long SpliceLocked_new(long _channel_id_arg); + // const uint8_t (*SpliceLocked_get_splice_txid(const struct LDKSpliceLocked *NONNULL_PTR this_ptr))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceLocked_get_splice_txid")] public static extern long SpliceLocked_get_splice_txid(long _this_ptr); + // void SpliceLocked_set_splice_txid(struct LDKSpliceLocked *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceLocked_set_splice_txid")] public static extern void SpliceLocked_set_splice_txid(long _this_ptr, long _val); + // MUST_USE_RES struct LDKSpliceLocked SpliceLocked_new(struct LDKChannelId channel_id_arg, struct LDKThirtyTwoBytes splice_txid_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceLocked_new")] public static extern long SpliceLocked_new(long _channel_id_arg, long _splice_txid_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); // struct LDKSpliceLocked SpliceLocked_clone(const struct LDKSpliceLocked *NONNULL_PTR orig); @@ -8906,8 +9295,12 @@ 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 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); + // struct LDKCOption_ThirtyTwoBytesZ TxAddInput_get_shared_input_txid(const struct LDKTxAddInput *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddInput_get_shared_input_txid")] public static extern long TxAddInput_get_shared_input_txid(long _this_ptr); + // void TxAddInput_set_shared_input_txid(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddInput_set_shared_input_txid")] public static extern void TxAddInput_set_shared_input_txid(long _this_ptr, long _val); + // 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, struct LDKCOption_ThirtyTwoBytesZ shared_input_txid_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, long _shared_input_txid_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); // struct LDKTxAddInput TxAddInput_clone(const struct LDKTxAddInput *NONNULL_PTR orig); @@ -9014,12 +9407,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); - // 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); + // struct LDKCOption_ECDSASignatureZ TxSignatures_get_shared_input_signature(const struct LDKTxSignatures *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxSignatures_get_shared_input_signature")] public static extern long TxSignatures_get_shared_input_signature(long _this_ptr); + // void TxSignatures_set_shared_input_signature(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKCOption_ECDSASignatureZ val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxSignatures_set_shared_input_signature")] public static extern void TxSignatures_set_shared_input_signature(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 shared_input_signature_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 _shared_input_signature_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); @@ -9292,6 +9685,26 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFailMalformedHTLC_hash")] public static extern long UpdateFailMalformedHTLC_hash(long _o); // bool UpdateFailMalformedHTLC_eq(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR a, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFailMalformedHTLC_eq")] public static extern bool UpdateFailMalformedHTLC_eq(long _a, long _b); + // void CommitmentSignedBatch_free(struct LDKCommitmentSignedBatch this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSignedBatch_free")] public static extern void CommitmentSignedBatch_free(long _this_obj); + // uint16_t CommitmentSignedBatch_get_batch_size(const struct LDKCommitmentSignedBatch *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSignedBatch_get_batch_size")] public static extern short CommitmentSignedBatch_get_batch_size(long _this_ptr); + // void CommitmentSignedBatch_set_batch_size(struct LDKCommitmentSignedBatch *NONNULL_PTR this_ptr, uint16_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSignedBatch_set_batch_size")] public static extern void CommitmentSignedBatch_set_batch_size(long _this_ptr, short _val); + // const uint8_t (*CommitmentSignedBatch_get_funding_txid(const struct LDKCommitmentSignedBatch *NONNULL_PTR this_ptr))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSignedBatch_get_funding_txid")] public static extern long CommitmentSignedBatch_get_funding_txid(long _this_ptr); + // void CommitmentSignedBatch_set_funding_txid(struct LDKCommitmentSignedBatch *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSignedBatch_set_funding_txid")] public static extern void CommitmentSignedBatch_set_funding_txid(long _this_ptr, long _val); + // MUST_USE_RES struct LDKCommitmentSignedBatch CommitmentSignedBatch_new(uint16_t batch_size_arg, struct LDKThirtyTwoBytes funding_txid_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSignedBatch_new")] public static extern long CommitmentSignedBatch_new(short _batch_size_arg, long _funding_txid_arg); + // uint64_t CommitmentSignedBatch_clone_ptr(LDKCommitmentSignedBatch *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSignedBatch_clone_ptr")] public static extern long CommitmentSignedBatch_clone_ptr(long _arg); + // struct LDKCommitmentSignedBatch CommitmentSignedBatch_clone(const struct LDKCommitmentSignedBatch *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSignedBatch_clone")] public static extern long CommitmentSignedBatch_clone(long _orig); + // uint64_t CommitmentSignedBatch_hash(const struct LDKCommitmentSignedBatch *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSignedBatch_hash")] public static extern long CommitmentSignedBatch_hash(long _o); + // bool CommitmentSignedBatch_eq(const struct LDKCommitmentSignedBatch *NONNULL_PTR a, const struct LDKCommitmentSignedBatch *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSignedBatch_eq")] public static extern bool CommitmentSignedBatch_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); // struct LDKChannelId CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr); @@ -9306,8 +9719,12 @@ 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 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); + // struct LDKCommitmentSignedBatch CommitmentSigned_get_batch(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSigned_get_batch")] public static extern long CommitmentSigned_get_batch(long _this_ptr); + // void CommitmentSigned_set_batch(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCommitmentSignedBatch val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSigned_set_batch")] public static extern void CommitmentSigned_set_batch(long _this_ptr, long _val); + // MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKChannelId channel_id_arg, struct LDKECDSASignature signature_arg, struct LDKCVec_ECDSASignatureZ htlc_signatures_arg, struct LDKCommitmentSignedBatch batch_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, long _batch_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); // struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig); @@ -9638,10 +10055,14 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelUpdate_get_timestamp")] public static extern int UnsignedChannelUpdate_get_timestamp(long _this_ptr); // void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelUpdate_set_timestamp")] public static extern void UnsignedChannelUpdate_set_timestamp(long _this_ptr, int _val); - // uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelUpdate_get_flags")] public static extern byte UnsignedChannelUpdate_get_flags(long _this_ptr); - // void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelUpdate_set_flags")] public static extern void UnsignedChannelUpdate_set_flags(long _this_ptr, byte _val); + // uint8_t UnsignedChannelUpdate_get_message_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelUpdate_get_message_flags")] public static extern byte UnsignedChannelUpdate_get_message_flags(long _this_ptr); + // void UnsignedChannelUpdate_set_message_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelUpdate_set_message_flags")] public static extern void UnsignedChannelUpdate_set_message_flags(long _this_ptr, byte _val); + // uint8_t UnsignedChannelUpdate_get_channel_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelUpdate_get_channel_flags")] public static extern byte UnsignedChannelUpdate_get_channel_flags(long _this_ptr); + // void UnsignedChannelUpdate_set_channel_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelUpdate_set_channel_flags")] public static extern void UnsignedChannelUpdate_set_channel_flags(long _this_ptr, byte _val); // uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelUpdate_get_cltv_expiry_delta")] public static extern short UnsignedChannelUpdate_get_cltv_expiry_delta(long _this_ptr); // void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val); @@ -9666,8 +10087,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelUpdate_get_excess_data")] public static extern long UnsignedChannelUpdate_get_excess_data(long _this_ptr); // void UnsignedChannelUpdate_set_excess_data(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelUpdate_set_excess_data")] public static extern void UnsignedChannelUpdate_set_excess_data(long _this_ptr, long _val); - // MUST_USE_RES struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_new(struct LDKThirtyTwoBytes chain_hash_arg, uint64_t short_channel_id_arg, uint32_t timestamp_arg, uint8_t flags_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg, uint64_t htlc_maximum_msat_arg, uint32_t fee_base_msat_arg, uint32_t fee_proportional_millionths_arg, struct LDKCVec_u8Z excess_data_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelUpdate_new")] public static extern long UnsignedChannelUpdate_new(long _chain_hash_arg, long _short_channel_id_arg, int _timestamp_arg, byte _flags_arg, short _cltv_expiry_delta_arg, long _htlc_minimum_msat_arg, long _htlc_maximum_msat_arg, int _fee_base_msat_arg, int _fee_proportional_millionths_arg, long _excess_data_arg); + // MUST_USE_RES struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_new(struct LDKThirtyTwoBytes chain_hash_arg, uint64_t short_channel_id_arg, uint32_t timestamp_arg, uint8_t message_flags_arg, uint8_t channel_flags_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg, uint64_t htlc_maximum_msat_arg, uint32_t fee_base_msat_arg, uint32_t fee_proportional_millionths_arg, struct LDKCVec_u8Z excess_data_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelUpdate_new")] public static extern long UnsignedChannelUpdate_new(long _chain_hash_arg, long _short_channel_id_arg, int _timestamp_arg, byte _message_flags_arg, byte _channel_flags_arg, short _cltv_expiry_delta_arg, long _htlc_minimum_msat_arg, long _htlc_maximum_msat_arg, int _fee_base_msat_arg, int _fee_proportional_millionths_arg, long _excess_data_arg); // uint64_t UnsignedChannelUpdate_clone_ptr(LDKUnsignedChannelUpdate *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelUpdate_clone_ptr")] public static extern long UnsignedChannelUpdate_clone_ptr(long _arg); // struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig); @@ -9978,10 +10399,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Stfu_write")] public static extern long Stfu_write(long _obj); // struct LDKCResult_StfuDecodeErrorZ Stfu_read(struct LDKu8slice ser); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Stfu_read")] public static extern long Stfu_read(long _ser); - // struct LDKCVec_u8Z Splice_write(const struct LDKSplice *NONNULL_PTR obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Splice_write")] public static extern long Splice_write(long _obj); - // struct LDKCResult_SpliceDecodeErrorZ Splice_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Splice_read")] public static extern long Splice_read(long _ser); + // struct LDKCVec_u8Z SpliceInit_write(const struct LDKSpliceInit *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceInit_write")] public static extern long SpliceInit_write(long _obj); + // struct LDKCResult_SpliceInitDecodeErrorZ SpliceInit_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceInit_read")] public static extern long SpliceInit_read(long _ser); // struct LDKCVec_u8Z SpliceAck_write(const struct LDKSpliceAck *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceAck_write")] public static extern long SpliceAck_write(long _obj); // struct LDKCResult_SpliceAckDecodeErrorZ SpliceAck_read(struct LDKu8slice ser); @@ -10042,6 +10463,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosingSignedFeeRange_write")] public static extern long ClosingSignedFeeRange_write(long _obj); // struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ ClosingSignedFeeRange_read(struct LDKu8slice ser); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosingSignedFeeRange_read")] public static extern long ClosingSignedFeeRange_read(long _ser); + // struct LDKCVec_u8Z CommitmentSignedBatch_write(const struct LDKCommitmentSignedBatch *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSignedBatch_write")] public static extern long CommitmentSignedBatch_write(long _obj); + // struct LDKCResult_CommitmentSignedBatchDecodeErrorZ CommitmentSignedBatch_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSignedBatch_read")] public static extern long CommitmentSignedBatch_read(long _ser); // struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSigned_write")] public static extern long CommitmentSigned_write(long _obj); // struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser); @@ -10178,8 +10603,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_IgnoringMessageHandler_free")] public static extern void IgnoringMessageHandler_free(long _this_obj); // MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_IgnoringMessageHandler_new")] public static extern long IgnoringMessageHandler_new(); - // struct LDKEventsProvider IgnoringMessageHandler_as_EventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_IgnoringMessageHandler_as_EventsProvider")] public static extern long IgnoringMessageHandler_as_EventsProvider(long _this_arg); // struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_IgnoringMessageHandler_as_MessageSendEventsProvider")] public static extern long IgnoringMessageHandler_as_MessageSendEventsProvider(long _this_arg); // struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg); @@ -10188,6 +10611,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_IgnoringMessageHandler_as_OnionMessageHandler")] public static extern long IgnoringMessageHandler_as_OnionMessageHandler(long _this_arg); // struct LDKOffersMessageHandler IgnoringMessageHandler_as_OffersMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_IgnoringMessageHandler_as_OffersMessageHandler")] public static extern long IgnoringMessageHandler_as_OffersMessageHandler(long _this_arg); + // struct LDKAsyncPaymentsMessageHandler IgnoringMessageHandler_as_AsyncPaymentsMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_IgnoringMessageHandler_as_AsyncPaymentsMessageHandler")] public static extern long IgnoringMessageHandler_as_AsyncPaymentsMessageHandler(long _this_arg); // struct LDKCustomOnionMessageHandler IgnoringMessageHandler_as_CustomOnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_IgnoringMessageHandler_as_CustomOnionMessageHandler")] public static extern long IgnoringMessageHandler_as_CustomOnionMessageHandler(long _this_arg); // struct LDKCustomMessageReader IgnoringMessageHandler_as_CustomMessageReader(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg); @@ -10440,6 +10865,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCOutputInCommitment_clone")] public static extern long HTLCOutputInCommitment_clone(long _orig); // bool HTLCOutputInCommitment_eq(const struct LDKHTLCOutputInCommitment *NONNULL_PTR a, const struct LDKHTLCOutputInCommitment *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCOutputInCommitment_eq")] public static extern bool HTLCOutputInCommitment_eq(long _a, long _b); + // MUST_USE_RES uint64_t HTLCOutputInCommitment_to_bitcoin_amount(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCOutputInCommitment_to_bitcoin_amount")] public static extern long HTLCOutputInCommitment_to_bitcoin_amount(long _this_arg); // struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCOutputInCommitment_write")] public static extern long HTLCOutputInCommitment_write(long _obj); // struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser); @@ -10662,222 +11089,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrustedCommitmentTransaction_build_to_local_justice_tx")] public static extern long TrustedCommitmentTransaction_build_to_local_justice_tx(long _this_arg, long _feerate_per_kw, long _destination_script); // uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_get_commitment_transaction_number_obscure_factor")] public static extern long get_commitment_transaction_number_obscure_factor(long _broadcaster_payment_basepoint, long _countersignatory_payment_basepoint, bool _outbound_from_broadcaster); - // bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_eq")] public static extern bool InitFeatures_eq(long _a, long _b); - // bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_eq")] public static extern bool NodeFeatures_eq(long _a, long _b); - // bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_eq")] public static extern bool ChannelFeatures_eq(long _a, long _b); - // bool Bolt11InvoiceFeatures_eq(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_eq")] public static extern bool Bolt11InvoiceFeatures_eq(long _a, long _b); - // bool OfferFeatures_eq(const struct LDKOfferFeatures *NONNULL_PTR a, const struct LDKOfferFeatures *NONNULL_PTR b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_eq")] public static extern bool OfferFeatures_eq(long _a, long _b); - // bool InvoiceRequestFeatures_eq(const struct LDKInvoiceRequestFeatures *NONNULL_PTR a, const struct LDKInvoiceRequestFeatures *NONNULL_PTR b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_eq")] public static extern bool InvoiceRequestFeatures_eq(long _a, long _b); - // bool Bolt12InvoiceFeatures_eq(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_eq")] public static extern bool Bolt12InvoiceFeatures_eq(long _a, long _b); - // bool BlindedHopFeatures_eq(const struct LDKBlindedHopFeatures *NONNULL_PTR a, const struct LDKBlindedHopFeatures *NONNULL_PTR b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_eq")] public static extern bool BlindedHopFeatures_eq(long _a, long _b); - // bool ChannelTypeFeatures_eq(const struct LDKChannelTypeFeatures *NONNULL_PTR a, const struct LDKChannelTypeFeatures *NONNULL_PTR b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_eq")] public static extern bool ChannelTypeFeatures_eq(long _a, long _b); - // uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_clone_ptr")] public static extern long InitFeatures_clone_ptr(long _arg); - // struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_clone")] public static extern long InitFeatures_clone(long _orig); - // uint64_t NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_clone_ptr")] public static extern long NodeFeatures_clone_ptr(long _arg); - // struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_clone")] public static extern long NodeFeatures_clone(long _orig); - // uint64_t ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_clone_ptr")] public static extern long ChannelFeatures_clone_ptr(long _arg); - // struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_clone")] public static extern long ChannelFeatures_clone(long _orig); - // uint64_t Bolt11InvoiceFeatures_clone_ptr(LDKBolt11InvoiceFeatures *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_clone_ptr")] public static extern long Bolt11InvoiceFeatures_clone_ptr(long _arg); - // struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_clone(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_clone")] public static extern long Bolt11InvoiceFeatures_clone(long _orig); - // uint64_t OfferFeatures_clone_ptr(LDKOfferFeatures *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_clone_ptr")] public static extern long OfferFeatures_clone_ptr(long _arg); - // struct LDKOfferFeatures OfferFeatures_clone(const struct LDKOfferFeatures *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_clone")] public static extern long OfferFeatures_clone(long _orig); - // uint64_t InvoiceRequestFeatures_clone_ptr(LDKInvoiceRequestFeatures *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_clone_ptr")] public static extern long InvoiceRequestFeatures_clone_ptr(long _arg); - // struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_clone(const struct LDKInvoiceRequestFeatures *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_clone")] public static extern long InvoiceRequestFeatures_clone(long _orig); - // uint64_t Bolt12InvoiceFeatures_clone_ptr(LDKBolt12InvoiceFeatures *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_clone_ptr")] public static extern long Bolt12InvoiceFeatures_clone_ptr(long _arg); - // struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_clone(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_clone")] public static extern long Bolt12InvoiceFeatures_clone(long _orig); - // uint64_t BlindedHopFeatures_clone_ptr(LDKBlindedHopFeatures *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_clone_ptr")] public static extern long BlindedHopFeatures_clone_ptr(long _arg); - // struct LDKBlindedHopFeatures BlindedHopFeatures_clone(const struct LDKBlindedHopFeatures *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_clone")] public static extern long BlindedHopFeatures_clone(long _orig); - // uint64_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_clone_ptr")] public static extern long ChannelTypeFeatures_clone_ptr(long _arg); - // struct LDKChannelTypeFeatures ChannelTypeFeatures_clone(const struct LDKChannelTypeFeatures *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_clone")] public static extern long ChannelTypeFeatures_clone(long _orig); - // uint64_t InitFeatures_hash(const struct LDKInitFeatures *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_hash")] public static extern long InitFeatures_hash(long _o); - // uint64_t NodeFeatures_hash(const struct LDKNodeFeatures *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_hash")] public static extern long NodeFeatures_hash(long _o); - // uint64_t ChannelFeatures_hash(const struct LDKChannelFeatures *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_hash")] public static extern long ChannelFeatures_hash(long _o); - // uint64_t Bolt11InvoiceFeatures_hash(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_hash")] public static extern long Bolt11InvoiceFeatures_hash(long _o); - // uint64_t OfferFeatures_hash(const struct LDKOfferFeatures *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_hash")] public static extern long OfferFeatures_hash(long _o); - // uint64_t InvoiceRequestFeatures_hash(const struct LDKInvoiceRequestFeatures *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_hash")] public static extern long InvoiceRequestFeatures_hash(long _o); - // uint64_t Bolt12InvoiceFeatures_hash(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_hash")] public static extern long Bolt12InvoiceFeatures_hash(long _o); - // uint64_t BlindedHopFeatures_hash(const struct LDKBlindedHopFeatures *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_hash")] public static extern long BlindedHopFeatures_hash(long _o); - // uint64_t ChannelTypeFeatures_hash(const struct LDKChannelTypeFeatures *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_hash")] public static extern long ChannelTypeFeatures_hash(long _o); - // void InitFeatures_free(struct LDKInitFeatures this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_free")] public static extern void InitFeatures_free(long _this_obj); - // void NodeFeatures_free(struct LDKNodeFeatures this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_free")] public static extern void NodeFeatures_free(long _this_obj); - // void ChannelFeatures_free(struct LDKChannelFeatures this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_free")] public static extern void ChannelFeatures_free(long _this_obj); - // void Bolt11InvoiceFeatures_free(struct LDKBolt11InvoiceFeatures this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_free")] public static extern void Bolt11InvoiceFeatures_free(long _this_obj); - // void OfferFeatures_free(struct LDKOfferFeatures this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_free")] public static extern void OfferFeatures_free(long _this_obj); - // void InvoiceRequestFeatures_free(struct LDKInvoiceRequestFeatures this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_free")] public static extern void InvoiceRequestFeatures_free(long _this_obj); - // void Bolt12InvoiceFeatures_free(struct LDKBolt12InvoiceFeatures this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_free")] public static extern void Bolt12InvoiceFeatures_free(long _this_obj); - // void BlindedHopFeatures_free(struct LDKBlindedHopFeatures this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_free")] public static extern void BlindedHopFeatures_free(long _this_obj); - // void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_free")] public static extern void ChannelTypeFeatures_free(long _this_obj); - // MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_empty")] public static extern long InitFeatures_empty(); - // MUST_USE_RES bool InitFeatures_requires_unknown_bits_from(const struct LDKInitFeatures *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR other); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_unknown_bits_from")] public static extern bool InitFeatures_requires_unknown_bits_from(long _this_arg, long _other); - // MUST_USE_RES bool InitFeatures_requires_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_unknown_bits")] public static extern bool InitFeatures_requires_unknown_bits(long _this_arg); - // MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_required_feature_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_required_feature_bit")] public static extern long InitFeatures_set_required_feature_bit(long _this_arg, long _bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_optional_feature_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_optional_feature_bit")] public static extern long InitFeatures_set_optional_feature_bit(long _this_arg, long _bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_required_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_required_custom_bit")] public static extern long InitFeatures_set_required_custom_bit(long _this_arg, long _bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_optional_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_optional_custom_bit")] public static extern long InitFeatures_set_optional_custom_bit(long _this_arg, long _bit); - // MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_empty")] public static extern long NodeFeatures_empty(); - // MUST_USE_RES bool NodeFeatures_requires_unknown_bits_from(const struct LDKNodeFeatures *NONNULL_PTR this_arg, const struct LDKNodeFeatures *NONNULL_PTR other); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_unknown_bits_from")] public static extern bool NodeFeatures_requires_unknown_bits_from(long _this_arg, long _other); - // MUST_USE_RES bool NodeFeatures_requires_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_unknown_bits")] public static extern bool NodeFeatures_requires_unknown_bits(long _this_arg); - // MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_required_feature_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_required_feature_bit")] public static extern long NodeFeatures_set_required_feature_bit(long _this_arg, long _bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_optional_feature_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_optional_feature_bit")] public static extern long NodeFeatures_set_optional_feature_bit(long _this_arg, long _bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_required_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_required_custom_bit")] public static extern long NodeFeatures_set_required_custom_bit(long _this_arg, long _bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_optional_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_optional_custom_bit")] public static extern long NodeFeatures_set_optional_custom_bit(long _this_arg, long _bit); - // MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_empty")] public static extern long ChannelFeatures_empty(); - // MUST_USE_RES bool ChannelFeatures_requires_unknown_bits_from(const struct LDKChannelFeatures *NONNULL_PTR this_arg, const struct LDKChannelFeatures *NONNULL_PTR other); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_requires_unknown_bits_from")] public static extern bool ChannelFeatures_requires_unknown_bits_from(long _this_arg, long _other); - // MUST_USE_RES bool ChannelFeatures_requires_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_requires_unknown_bits")] public static extern bool ChannelFeatures_requires_unknown_bits(long _this_arg); - // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_required_feature_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_set_required_feature_bit")] public static extern long ChannelFeatures_set_required_feature_bit(long _this_arg, long _bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_optional_feature_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_set_optional_feature_bit")] public static extern long ChannelFeatures_set_optional_feature_bit(long _this_arg, long _bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_required_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_set_required_custom_bit")] public static extern long ChannelFeatures_set_required_custom_bit(long _this_arg, long _bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_optional_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_set_optional_custom_bit")] public static extern long ChannelFeatures_set_optional_custom_bit(long _this_arg, long _bit); - // MUST_USE_RES struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_empty(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_empty")] public static extern long Bolt11InvoiceFeatures_empty(); - // MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR other); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_requires_unknown_bits_from")] public static extern bool Bolt11InvoiceFeatures_requires_unknown_bits_from(long _this_arg, long _other); - // MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_requires_unknown_bits")] public static extern bool Bolt11InvoiceFeatures_requires_unknown_bits(long _this_arg); - // MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_required_feature_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_set_required_feature_bit")] public static extern long Bolt11InvoiceFeatures_set_required_feature_bit(long _this_arg, long _bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_optional_feature_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_set_optional_feature_bit")] public static extern long Bolt11InvoiceFeatures_set_optional_feature_bit(long _this_arg, long _bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_required_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_set_required_custom_bit")] public static extern long Bolt11InvoiceFeatures_set_required_custom_bit(long _this_arg, long _bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_optional_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_set_optional_custom_bit")] public static extern long Bolt11InvoiceFeatures_set_optional_custom_bit(long _this_arg, long _bit); - // MUST_USE_RES struct LDKOfferFeatures OfferFeatures_empty(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_empty")] public static extern long OfferFeatures_empty(); - // MUST_USE_RES bool OfferFeatures_requires_unknown_bits_from(const struct LDKOfferFeatures *NONNULL_PTR this_arg, const struct LDKOfferFeatures *NONNULL_PTR other); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_requires_unknown_bits_from")] public static extern bool OfferFeatures_requires_unknown_bits_from(long _this_arg, long _other); - // MUST_USE_RES bool OfferFeatures_requires_unknown_bits(const struct LDKOfferFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_requires_unknown_bits")] public static extern bool OfferFeatures_requires_unknown_bits(long _this_arg); - // MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_required_feature_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_set_required_feature_bit")] public static extern long OfferFeatures_set_required_feature_bit(long _this_arg, long _bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_optional_feature_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_set_optional_feature_bit")] public static extern long OfferFeatures_set_optional_feature_bit(long _this_arg, long _bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_required_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_set_required_custom_bit")] public static extern long OfferFeatures_set_required_custom_bit(long _this_arg, long _bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_optional_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_set_optional_custom_bit")] public static extern long OfferFeatures_set_optional_custom_bit(long _this_arg, long _bit); - // MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_empty(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_empty")] public static extern long InvoiceRequestFeatures_empty(); - // MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits_from(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, const struct LDKInvoiceRequestFeatures *NONNULL_PTR other); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_requires_unknown_bits_from")] public static extern bool InvoiceRequestFeatures_requires_unknown_bits_from(long _this_arg, long _other); - // MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_requires_unknown_bits")] public static extern bool InvoiceRequestFeatures_requires_unknown_bits(long _this_arg); - // MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_required_feature_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_set_required_feature_bit")] public static extern long InvoiceRequestFeatures_set_required_feature_bit(long _this_arg, long _bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_optional_feature_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_set_optional_feature_bit")] public static extern long InvoiceRequestFeatures_set_optional_feature_bit(long _this_arg, long _bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_required_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_set_required_custom_bit")] public static extern long InvoiceRequestFeatures_set_required_custom_bit(long _this_arg, long _bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_optional_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_set_optional_custom_bit")] public static extern long InvoiceRequestFeatures_set_optional_custom_bit(long _this_arg, long _bit); - // MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_empty(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_empty")] public static extern long Bolt12InvoiceFeatures_empty(); - // MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR other); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_requires_unknown_bits_from")] public static extern bool Bolt12InvoiceFeatures_requires_unknown_bits_from(long _this_arg, long _other); - // MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_requires_unknown_bits")] public static extern bool Bolt12InvoiceFeatures_requires_unknown_bits(long _this_arg); - // MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_required_feature_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_set_required_feature_bit")] public static extern long Bolt12InvoiceFeatures_set_required_feature_bit(long _this_arg, long _bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_optional_feature_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_set_optional_feature_bit")] public static extern long Bolt12InvoiceFeatures_set_optional_feature_bit(long _this_arg, long _bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_required_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_set_required_custom_bit")] public static extern long Bolt12InvoiceFeatures_set_required_custom_bit(long _this_arg, long _bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_optional_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_set_optional_custom_bit")] public static extern long Bolt12InvoiceFeatures_set_optional_custom_bit(long _this_arg, long _bit); - // MUST_USE_RES struct LDKBlindedHopFeatures BlindedHopFeatures_empty(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_empty")] public static extern long BlindedHopFeatures_empty(); - // MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits_from(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, const struct LDKBlindedHopFeatures *NONNULL_PTR other); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_requires_unknown_bits_from")] public static extern bool BlindedHopFeatures_requires_unknown_bits_from(long _this_arg, long _other); - // MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_requires_unknown_bits")] public static extern bool BlindedHopFeatures_requires_unknown_bits(long _this_arg); - // MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_required_feature_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_set_required_feature_bit")] public static extern long BlindedHopFeatures_set_required_feature_bit(long _this_arg, long _bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_optional_feature_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_set_optional_feature_bit")] public static extern long BlindedHopFeatures_set_optional_feature_bit(long _this_arg, long _bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_required_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_set_required_custom_bit")] public static extern long BlindedHopFeatures_set_required_custom_bit(long _this_arg, long _bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_optional_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_set_optional_custom_bit")] public static extern long BlindedHopFeatures_set_optional_custom_bit(long _this_arg, long _bit); - // MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_empty")] public static extern long ChannelTypeFeatures_empty(); - // MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits_from(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, const struct LDKChannelTypeFeatures *NONNULL_PTR other); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_requires_unknown_bits_from")] public static extern bool ChannelTypeFeatures_requires_unknown_bits_from(long _this_arg, long _other); - // MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_requires_unknown_bits")] public static extern bool ChannelTypeFeatures_requires_unknown_bits(long _this_arg); - // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_required_feature_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_required_feature_bit")] public static extern long ChannelTypeFeatures_set_required_feature_bit(long _this_arg, long _bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_optional_feature_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_optional_feature_bit")] public static extern long ChannelTypeFeatures_set_optional_feature_bit(long _this_arg, long _bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_required_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_required_custom_bit")] public static extern long ChannelTypeFeatures_set_required_custom_bit(long _this_arg, long _bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_optional_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_optional_custom_bit")] public static extern long ChannelTypeFeatures_set_optional_custom_bit(long _this_arg, long _bit); // struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_write")] public static extern long InitFeatures_write(long _obj); // struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser); @@ -10906,404 +11117,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_write")] public static extern long ChannelTypeFeatures_write(long _obj); // struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ ChannelTypeFeatures_read(struct LDKu8slice ser); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_read")] public static extern long ChannelTypeFeatures_read(long _ser); - // void InitFeatures_set_data_loss_protect_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_data_loss_protect_optional")] public static extern void InitFeatures_set_data_loss_protect_optional(long _this_arg); - // void InitFeatures_set_data_loss_protect_required(struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_data_loss_protect_required")] public static extern void InitFeatures_set_data_loss_protect_required(long _this_arg); - // MUST_USE_RES bool InitFeatures_supports_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_data_loss_protect")] public static extern bool InitFeatures_supports_data_loss_protect(long _this_arg); - // void NodeFeatures_set_data_loss_protect_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_data_loss_protect_optional")] public static extern void NodeFeatures_set_data_loss_protect_optional(long _this_arg); - // void NodeFeatures_set_data_loss_protect_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_data_loss_protect_required")] public static extern void NodeFeatures_set_data_loss_protect_required(long _this_arg); - // MUST_USE_RES bool NodeFeatures_supports_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_data_loss_protect")] public static extern bool NodeFeatures_supports_data_loss_protect(long _this_arg); - // MUST_USE_RES bool InitFeatures_requires_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_data_loss_protect")] public static extern bool InitFeatures_requires_data_loss_protect(long _this_arg); - // MUST_USE_RES bool NodeFeatures_requires_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_data_loss_protect")] public static extern bool NodeFeatures_requires_data_loss_protect(long _this_arg); - // void InitFeatures_set_initial_routing_sync_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_initial_routing_sync_optional")] public static extern void InitFeatures_set_initial_routing_sync_optional(long _this_arg); - // void InitFeatures_set_initial_routing_sync_required(struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_initial_routing_sync_required")] public static extern void InitFeatures_set_initial_routing_sync_required(long _this_arg); - // MUST_USE_RES bool InitFeatures_initial_routing_sync(const struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_initial_routing_sync")] public static extern bool InitFeatures_initial_routing_sync(long _this_arg); - // void InitFeatures_set_upfront_shutdown_script_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_upfront_shutdown_script_optional")] public static extern void InitFeatures_set_upfront_shutdown_script_optional(long _this_arg); - // void InitFeatures_set_upfront_shutdown_script_required(struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_upfront_shutdown_script_required")] public static extern void InitFeatures_set_upfront_shutdown_script_required(long _this_arg); - // MUST_USE_RES bool InitFeatures_supports_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_upfront_shutdown_script")] public static extern bool InitFeatures_supports_upfront_shutdown_script(long _this_arg); - // void NodeFeatures_set_upfront_shutdown_script_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_upfront_shutdown_script_optional")] public static extern void NodeFeatures_set_upfront_shutdown_script_optional(long _this_arg); - // void NodeFeatures_set_upfront_shutdown_script_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_upfront_shutdown_script_required")] public static extern void NodeFeatures_set_upfront_shutdown_script_required(long _this_arg); - // MUST_USE_RES bool NodeFeatures_supports_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_upfront_shutdown_script")] public static extern bool NodeFeatures_supports_upfront_shutdown_script(long _this_arg); - // MUST_USE_RES bool InitFeatures_requires_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_upfront_shutdown_script")] public static extern bool InitFeatures_requires_upfront_shutdown_script(long _this_arg); - // MUST_USE_RES bool NodeFeatures_requires_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_upfront_shutdown_script")] public static extern bool NodeFeatures_requires_upfront_shutdown_script(long _this_arg); - // void InitFeatures_set_gossip_queries_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_gossip_queries_optional")] public static extern void InitFeatures_set_gossip_queries_optional(long _this_arg); - // void InitFeatures_set_gossip_queries_required(struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_gossip_queries_required")] public static extern void InitFeatures_set_gossip_queries_required(long _this_arg); - // MUST_USE_RES bool InitFeatures_supports_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_gossip_queries")] public static extern bool InitFeatures_supports_gossip_queries(long _this_arg); - // void NodeFeatures_set_gossip_queries_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_gossip_queries_optional")] public static extern void NodeFeatures_set_gossip_queries_optional(long _this_arg); - // void NodeFeatures_set_gossip_queries_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_gossip_queries_required")] public static extern void NodeFeatures_set_gossip_queries_required(long _this_arg); - // MUST_USE_RES bool NodeFeatures_supports_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_gossip_queries")] public static extern bool NodeFeatures_supports_gossip_queries(long _this_arg); - // MUST_USE_RES bool InitFeatures_requires_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_gossip_queries")] public static extern bool InitFeatures_requires_gossip_queries(long _this_arg); - // MUST_USE_RES bool NodeFeatures_requires_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_gossip_queries")] public static extern bool NodeFeatures_requires_gossip_queries(long _this_arg); - // void InitFeatures_set_variable_length_onion_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_variable_length_onion_optional")] public static extern void InitFeatures_set_variable_length_onion_optional(long _this_arg); - // void InitFeatures_set_variable_length_onion_required(struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_variable_length_onion_required")] public static extern void InitFeatures_set_variable_length_onion_required(long _this_arg); - // MUST_USE_RES bool InitFeatures_supports_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_variable_length_onion")] public static extern bool InitFeatures_supports_variable_length_onion(long _this_arg); - // void NodeFeatures_set_variable_length_onion_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_variable_length_onion_optional")] public static extern void NodeFeatures_set_variable_length_onion_optional(long _this_arg); - // void NodeFeatures_set_variable_length_onion_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_variable_length_onion_required")] public static extern void NodeFeatures_set_variable_length_onion_required(long _this_arg); - // MUST_USE_RES bool NodeFeatures_supports_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_variable_length_onion")] public static extern bool NodeFeatures_supports_variable_length_onion(long _this_arg); - // void Bolt11InvoiceFeatures_set_variable_length_onion_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_set_variable_length_onion_optional")] public static extern void Bolt11InvoiceFeatures_set_variable_length_onion_optional(long _this_arg); - // void Bolt11InvoiceFeatures_set_variable_length_onion_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_set_variable_length_onion_required")] public static extern void Bolt11InvoiceFeatures_set_variable_length_onion_required(long _this_arg); - // MUST_USE_RES bool Bolt11InvoiceFeatures_supports_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_supports_variable_length_onion")] public static extern bool Bolt11InvoiceFeatures_supports_variable_length_onion(long _this_arg); - // MUST_USE_RES bool InitFeatures_requires_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_variable_length_onion")] public static extern bool InitFeatures_requires_variable_length_onion(long _this_arg); - // MUST_USE_RES bool NodeFeatures_requires_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_variable_length_onion")] public static extern bool NodeFeatures_requires_variable_length_onion(long _this_arg); - // MUST_USE_RES bool Bolt11InvoiceFeatures_requires_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_requires_variable_length_onion")] public static extern bool Bolt11InvoiceFeatures_requires_variable_length_onion(long _this_arg); - // void InitFeatures_set_static_remote_key_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_static_remote_key_optional")] public static extern void InitFeatures_set_static_remote_key_optional(long _this_arg); - // void InitFeatures_set_static_remote_key_required(struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_static_remote_key_required")] public static extern void InitFeatures_set_static_remote_key_required(long _this_arg); - // MUST_USE_RES bool InitFeatures_supports_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_static_remote_key")] public static extern bool InitFeatures_supports_static_remote_key(long _this_arg); - // void NodeFeatures_set_static_remote_key_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_static_remote_key_optional")] public static extern void NodeFeatures_set_static_remote_key_optional(long _this_arg); - // void NodeFeatures_set_static_remote_key_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_static_remote_key_required")] public static extern void NodeFeatures_set_static_remote_key_required(long _this_arg); - // MUST_USE_RES bool NodeFeatures_supports_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_static_remote_key")] public static extern bool NodeFeatures_supports_static_remote_key(long _this_arg); - // void ChannelTypeFeatures_set_static_remote_key_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_static_remote_key_optional")] public static extern void ChannelTypeFeatures_set_static_remote_key_optional(long _this_arg); - // void ChannelTypeFeatures_set_static_remote_key_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_static_remote_key_required")] public static extern void ChannelTypeFeatures_set_static_remote_key_required(long _this_arg); - // MUST_USE_RES bool ChannelTypeFeatures_supports_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_supports_static_remote_key")] public static extern bool ChannelTypeFeatures_supports_static_remote_key(long _this_arg); - // MUST_USE_RES bool InitFeatures_requires_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_static_remote_key")] public static extern bool InitFeatures_requires_static_remote_key(long _this_arg); - // MUST_USE_RES bool NodeFeatures_requires_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_static_remote_key")] public static extern bool NodeFeatures_requires_static_remote_key(long _this_arg); - // MUST_USE_RES bool ChannelTypeFeatures_requires_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_requires_static_remote_key")] public static extern bool ChannelTypeFeatures_requires_static_remote_key(long _this_arg); - // void InitFeatures_set_payment_secret_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_payment_secret_optional")] public static extern void InitFeatures_set_payment_secret_optional(long _this_arg); - // void InitFeatures_set_payment_secret_required(struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_payment_secret_required")] public static extern void InitFeatures_set_payment_secret_required(long _this_arg); - // MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_payment_secret")] public static extern bool InitFeatures_supports_payment_secret(long _this_arg); - // void NodeFeatures_set_payment_secret_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_payment_secret_optional")] public static extern void NodeFeatures_set_payment_secret_optional(long _this_arg); - // void NodeFeatures_set_payment_secret_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_payment_secret_required")] public static extern void NodeFeatures_set_payment_secret_required(long _this_arg); - // MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_payment_secret")] public static extern bool NodeFeatures_supports_payment_secret(long _this_arg); - // void Bolt11InvoiceFeatures_set_payment_secret_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_set_payment_secret_optional")] public static extern void Bolt11InvoiceFeatures_set_payment_secret_optional(long _this_arg); - // void Bolt11InvoiceFeatures_set_payment_secret_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_set_payment_secret_required")] public static extern void Bolt11InvoiceFeatures_set_payment_secret_required(long _this_arg); - // MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_supports_payment_secret")] public static extern bool Bolt11InvoiceFeatures_supports_payment_secret(long _this_arg); - // MUST_USE_RES bool InitFeatures_requires_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_payment_secret")] public static extern bool InitFeatures_requires_payment_secret(long _this_arg); - // MUST_USE_RES bool NodeFeatures_requires_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_payment_secret")] public static extern bool NodeFeatures_requires_payment_secret(long _this_arg); - // MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_requires_payment_secret")] public static extern bool Bolt11InvoiceFeatures_requires_payment_secret(long _this_arg); - // void InitFeatures_set_basic_mpp_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_basic_mpp_optional")] public static extern void InitFeatures_set_basic_mpp_optional(long _this_arg); - // void InitFeatures_set_basic_mpp_required(struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_basic_mpp_required")] public static extern void InitFeatures_set_basic_mpp_required(long _this_arg); - // MUST_USE_RES bool InitFeatures_supports_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_basic_mpp")] public static extern bool InitFeatures_supports_basic_mpp(long _this_arg); - // void NodeFeatures_set_basic_mpp_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_basic_mpp_optional")] public static extern void NodeFeatures_set_basic_mpp_optional(long _this_arg); - // void NodeFeatures_set_basic_mpp_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_basic_mpp_required")] public static extern void NodeFeatures_set_basic_mpp_required(long _this_arg); - // MUST_USE_RES bool NodeFeatures_supports_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_basic_mpp")] public static extern bool NodeFeatures_supports_basic_mpp(long _this_arg); - // void Bolt11InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_set_basic_mpp_optional")] public static extern void Bolt11InvoiceFeatures_set_basic_mpp_optional(long _this_arg); - // void Bolt11InvoiceFeatures_set_basic_mpp_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_set_basic_mpp_required")] public static extern void Bolt11InvoiceFeatures_set_basic_mpp_required(long _this_arg); - // MUST_USE_RES bool Bolt11InvoiceFeatures_supports_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_supports_basic_mpp")] public static extern bool Bolt11InvoiceFeatures_supports_basic_mpp(long _this_arg); - // void Bolt12InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_set_basic_mpp_optional")] public static extern void Bolt12InvoiceFeatures_set_basic_mpp_optional(long _this_arg); - // void Bolt12InvoiceFeatures_set_basic_mpp_required(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_set_basic_mpp_required")] public static extern void Bolt12InvoiceFeatures_set_basic_mpp_required(long _this_arg); - // MUST_USE_RES bool Bolt12InvoiceFeatures_supports_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_supports_basic_mpp")] public static extern bool Bolt12InvoiceFeatures_supports_basic_mpp(long _this_arg); - // MUST_USE_RES bool InitFeatures_requires_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_basic_mpp")] public static extern bool InitFeatures_requires_basic_mpp(long _this_arg); - // MUST_USE_RES bool NodeFeatures_requires_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_basic_mpp")] public static extern bool NodeFeatures_requires_basic_mpp(long _this_arg); - // MUST_USE_RES bool Bolt11InvoiceFeatures_requires_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_requires_basic_mpp")] public static extern bool Bolt11InvoiceFeatures_requires_basic_mpp(long _this_arg); - // MUST_USE_RES bool Bolt12InvoiceFeatures_requires_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_requires_basic_mpp")] public static extern bool Bolt12InvoiceFeatures_requires_basic_mpp(long _this_arg); - // void InitFeatures_set_wumbo_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_wumbo_optional")] public static extern void InitFeatures_set_wumbo_optional(long _this_arg); - // void InitFeatures_set_wumbo_required(struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_wumbo_required")] public static extern void InitFeatures_set_wumbo_required(long _this_arg); - // MUST_USE_RES bool InitFeatures_supports_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_wumbo")] public static extern bool InitFeatures_supports_wumbo(long _this_arg); - // void NodeFeatures_set_wumbo_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_wumbo_optional")] public static extern void NodeFeatures_set_wumbo_optional(long _this_arg); - // void NodeFeatures_set_wumbo_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_wumbo_required")] public static extern void NodeFeatures_set_wumbo_required(long _this_arg); - // MUST_USE_RES bool NodeFeatures_supports_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_wumbo")] public static extern bool NodeFeatures_supports_wumbo(long _this_arg); - // MUST_USE_RES bool InitFeatures_requires_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_wumbo")] public static extern bool InitFeatures_requires_wumbo(long _this_arg); - // MUST_USE_RES bool NodeFeatures_requires_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_wumbo")] public static extern bool NodeFeatures_requires_wumbo(long _this_arg); - // void InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional")] public static extern void InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(long _this_arg); - // void InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_anchors_nonzero_fee_htlc_tx_required")] public static extern void InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(long _this_arg); - // MUST_USE_RES bool InitFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_anchors_nonzero_fee_htlc_tx")] public static extern bool InitFeatures_supports_anchors_nonzero_fee_htlc_tx(long _this_arg); - // void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional")] public static extern void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(long _this_arg); - // void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required")] public static extern void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(long _this_arg); - // MUST_USE_RES bool NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_anchors_nonzero_fee_htlc_tx")] public static extern bool NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(long _this_arg); - // void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional")] public static extern void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(long _this_arg); - // void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required")] public static extern void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(long _this_arg); - // MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx")] public static extern bool ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(long _this_arg); - // MUST_USE_RES bool InitFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_anchors_nonzero_fee_htlc_tx")] public static extern bool InitFeatures_requires_anchors_nonzero_fee_htlc_tx(long _this_arg); - // MUST_USE_RES bool NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_anchors_nonzero_fee_htlc_tx")] public static extern bool NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(long _this_arg); - // MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx")] public static extern bool ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(long _this_arg); - // void InitFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_anchors_zero_fee_htlc_tx_optional")] public static extern void InitFeatures_set_anchors_zero_fee_htlc_tx_optional(long _this_arg); - // void InitFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_anchors_zero_fee_htlc_tx_required")] public static extern void InitFeatures_set_anchors_zero_fee_htlc_tx_required(long _this_arg); - // MUST_USE_RES bool InitFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_anchors_zero_fee_htlc_tx")] public static extern bool InitFeatures_supports_anchors_zero_fee_htlc_tx(long _this_arg); - // void NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_anchors_zero_fee_htlc_tx_optional")] public static extern void NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(long _this_arg); - // void NodeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_anchors_zero_fee_htlc_tx_required")] public static extern void NodeFeatures_set_anchors_zero_fee_htlc_tx_required(long _this_arg); - // MUST_USE_RES bool NodeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_anchors_zero_fee_htlc_tx")] public static extern bool NodeFeatures_supports_anchors_zero_fee_htlc_tx(long _this_arg); - // void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional")] public static extern void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(long _this_arg); - // void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required")] public static extern void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(long _this_arg); - // MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx")] public static extern bool ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(long _this_arg); - // MUST_USE_RES bool InitFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_anchors_zero_fee_htlc_tx")] public static extern bool InitFeatures_requires_anchors_zero_fee_htlc_tx(long _this_arg); - // MUST_USE_RES bool NodeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_anchors_zero_fee_htlc_tx")] public static extern bool NodeFeatures_requires_anchors_zero_fee_htlc_tx(long _this_arg); - // MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx")] public static extern bool ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(long _this_arg); - // void InitFeatures_set_route_blinding_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_route_blinding_optional")] public static extern void InitFeatures_set_route_blinding_optional(long _this_arg); - // void InitFeatures_set_route_blinding_required(struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_route_blinding_required")] public static extern void InitFeatures_set_route_blinding_required(long _this_arg); - // MUST_USE_RES bool InitFeatures_supports_route_blinding(const struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_route_blinding")] public static extern bool InitFeatures_supports_route_blinding(long _this_arg); - // void NodeFeatures_set_route_blinding_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_route_blinding_optional")] public static extern void NodeFeatures_set_route_blinding_optional(long _this_arg); - // void NodeFeatures_set_route_blinding_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_route_blinding_required")] public static extern void NodeFeatures_set_route_blinding_required(long _this_arg); - // MUST_USE_RES bool NodeFeatures_supports_route_blinding(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_route_blinding")] public static extern bool NodeFeatures_supports_route_blinding(long _this_arg); - // MUST_USE_RES bool InitFeatures_requires_route_blinding(const struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_route_blinding")] public static extern bool InitFeatures_requires_route_blinding(long _this_arg); - // MUST_USE_RES bool NodeFeatures_requires_route_blinding(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_route_blinding")] public static extern bool NodeFeatures_requires_route_blinding(long _this_arg); - // void InitFeatures_set_shutdown_any_segwit_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_shutdown_any_segwit_optional")] public static extern void InitFeatures_set_shutdown_any_segwit_optional(long _this_arg); - // void InitFeatures_set_shutdown_any_segwit_required(struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_shutdown_any_segwit_required")] public static extern void InitFeatures_set_shutdown_any_segwit_required(long _this_arg); - // MUST_USE_RES bool InitFeatures_supports_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_shutdown_anysegwit")] public static extern bool InitFeatures_supports_shutdown_anysegwit(long _this_arg); - // void NodeFeatures_set_shutdown_any_segwit_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_shutdown_any_segwit_optional")] public static extern void NodeFeatures_set_shutdown_any_segwit_optional(long _this_arg); - // void NodeFeatures_set_shutdown_any_segwit_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_shutdown_any_segwit_required")] public static extern void NodeFeatures_set_shutdown_any_segwit_required(long _this_arg); - // MUST_USE_RES bool NodeFeatures_supports_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_shutdown_anysegwit")] public static extern bool NodeFeatures_supports_shutdown_anysegwit(long _this_arg); - // MUST_USE_RES bool InitFeatures_requires_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_shutdown_anysegwit")] public static extern bool InitFeatures_requires_shutdown_anysegwit(long _this_arg); - // MUST_USE_RES bool NodeFeatures_requires_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_shutdown_anysegwit")] public static extern bool NodeFeatures_requires_shutdown_anysegwit(long _this_arg); - // void InitFeatures_set_taproot_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_taproot_optional")] public static extern void InitFeatures_set_taproot_optional(long _this_arg); - // void InitFeatures_set_taproot_required(struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_taproot_required")] public static extern void InitFeatures_set_taproot_required(long _this_arg); - // MUST_USE_RES bool InitFeatures_supports_taproot(const struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_taproot")] public static extern bool InitFeatures_supports_taproot(long _this_arg); - // void NodeFeatures_set_taproot_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_taproot_optional")] public static extern void NodeFeatures_set_taproot_optional(long _this_arg); - // void NodeFeatures_set_taproot_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_taproot_required")] public static extern void NodeFeatures_set_taproot_required(long _this_arg); - // MUST_USE_RES bool NodeFeatures_supports_taproot(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_taproot")] public static extern bool NodeFeatures_supports_taproot(long _this_arg); - // void ChannelTypeFeatures_set_taproot_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_taproot_optional")] public static extern void ChannelTypeFeatures_set_taproot_optional(long _this_arg); - // void ChannelTypeFeatures_set_taproot_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_taproot_required")] public static extern void ChannelTypeFeatures_set_taproot_required(long _this_arg); - // MUST_USE_RES bool ChannelTypeFeatures_supports_taproot(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_supports_taproot")] public static extern bool ChannelTypeFeatures_supports_taproot(long _this_arg); - // MUST_USE_RES bool InitFeatures_requires_taproot(const struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_taproot")] public static extern bool InitFeatures_requires_taproot(long _this_arg); - // MUST_USE_RES bool NodeFeatures_requires_taproot(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_taproot")] public static extern bool NodeFeatures_requires_taproot(long _this_arg); - // MUST_USE_RES bool ChannelTypeFeatures_requires_taproot(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_requires_taproot")] public static extern bool ChannelTypeFeatures_requires_taproot(long _this_arg); - // void InitFeatures_set_onion_messages_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_onion_messages_optional")] public static extern void InitFeatures_set_onion_messages_optional(long _this_arg); - // void InitFeatures_set_onion_messages_required(struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_onion_messages_required")] public static extern void InitFeatures_set_onion_messages_required(long _this_arg); - // MUST_USE_RES bool InitFeatures_supports_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_onion_messages")] public static extern bool InitFeatures_supports_onion_messages(long _this_arg); - // void NodeFeatures_set_onion_messages_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_onion_messages_optional")] public static extern void NodeFeatures_set_onion_messages_optional(long _this_arg); - // void NodeFeatures_set_onion_messages_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_onion_messages_required")] public static extern void NodeFeatures_set_onion_messages_required(long _this_arg); - // MUST_USE_RES bool NodeFeatures_supports_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_onion_messages")] public static extern bool NodeFeatures_supports_onion_messages(long _this_arg); - // MUST_USE_RES bool InitFeatures_requires_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_onion_messages")] public static extern bool InitFeatures_requires_onion_messages(long _this_arg); - // MUST_USE_RES bool NodeFeatures_requires_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_onion_messages")] public static extern bool NodeFeatures_requires_onion_messages(long _this_arg); - // void InitFeatures_set_channel_type_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_channel_type_optional")] public static extern void InitFeatures_set_channel_type_optional(long _this_arg); - // void InitFeatures_set_channel_type_required(struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_channel_type_required")] public static extern void InitFeatures_set_channel_type_required(long _this_arg); - // MUST_USE_RES bool InitFeatures_supports_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_channel_type")] public static extern bool InitFeatures_supports_channel_type(long _this_arg); - // void NodeFeatures_set_channel_type_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_channel_type_optional")] public static extern void NodeFeatures_set_channel_type_optional(long _this_arg); - // void NodeFeatures_set_channel_type_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_channel_type_required")] public static extern void NodeFeatures_set_channel_type_required(long _this_arg); - // MUST_USE_RES bool NodeFeatures_supports_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_channel_type")] public static extern bool NodeFeatures_supports_channel_type(long _this_arg); - // MUST_USE_RES bool InitFeatures_requires_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_channel_type")] public static extern bool InitFeatures_requires_channel_type(long _this_arg); - // MUST_USE_RES bool NodeFeatures_requires_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_channel_type")] public static extern bool NodeFeatures_requires_channel_type(long _this_arg); - // void InitFeatures_set_scid_privacy_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_scid_privacy_optional")] public static extern void InitFeatures_set_scid_privacy_optional(long _this_arg); - // void InitFeatures_set_scid_privacy_required(struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_scid_privacy_required")] public static extern void InitFeatures_set_scid_privacy_required(long _this_arg); - // MUST_USE_RES bool InitFeatures_supports_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_scid_privacy")] public static extern bool InitFeatures_supports_scid_privacy(long _this_arg); - // void NodeFeatures_set_scid_privacy_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_scid_privacy_optional")] public static extern void NodeFeatures_set_scid_privacy_optional(long _this_arg); - // void NodeFeatures_set_scid_privacy_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_scid_privacy_required")] public static extern void NodeFeatures_set_scid_privacy_required(long _this_arg); - // MUST_USE_RES bool NodeFeatures_supports_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_scid_privacy")] public static extern bool NodeFeatures_supports_scid_privacy(long _this_arg); - // void ChannelTypeFeatures_set_scid_privacy_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_scid_privacy_optional")] public static extern void ChannelTypeFeatures_set_scid_privacy_optional(long _this_arg); - // void ChannelTypeFeatures_set_scid_privacy_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_scid_privacy_required")] public static extern void ChannelTypeFeatures_set_scid_privacy_required(long _this_arg); - // MUST_USE_RES bool ChannelTypeFeatures_supports_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_supports_scid_privacy")] public static extern bool ChannelTypeFeatures_supports_scid_privacy(long _this_arg); - // MUST_USE_RES bool InitFeatures_requires_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_scid_privacy")] public static extern bool InitFeatures_requires_scid_privacy(long _this_arg); - // MUST_USE_RES bool NodeFeatures_requires_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_scid_privacy")] public static extern bool NodeFeatures_requires_scid_privacy(long _this_arg); - // MUST_USE_RES bool ChannelTypeFeatures_requires_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_requires_scid_privacy")] public static extern bool ChannelTypeFeatures_requires_scid_privacy(long _this_arg); - // void Bolt11InvoiceFeatures_set_payment_metadata_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_set_payment_metadata_optional")] public static extern void Bolt11InvoiceFeatures_set_payment_metadata_optional(long _this_arg); - // void Bolt11InvoiceFeatures_set_payment_metadata_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_set_payment_metadata_required")] public static extern void Bolt11InvoiceFeatures_set_payment_metadata_required(long _this_arg); - // MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_supports_payment_metadata")] public static extern bool Bolt11InvoiceFeatures_supports_payment_metadata(long _this_arg); - // MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_requires_payment_metadata")] public static extern bool Bolt11InvoiceFeatures_requires_payment_metadata(long _this_arg); - // void InitFeatures_set_zero_conf_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_zero_conf_optional")] public static extern void InitFeatures_set_zero_conf_optional(long _this_arg); - // void InitFeatures_set_zero_conf_required(struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_zero_conf_required")] public static extern void InitFeatures_set_zero_conf_required(long _this_arg); - // MUST_USE_RES bool InitFeatures_supports_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_zero_conf")] public static extern bool InitFeatures_supports_zero_conf(long _this_arg); - // void NodeFeatures_set_zero_conf_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_zero_conf_optional")] public static extern void NodeFeatures_set_zero_conf_optional(long _this_arg); - // void NodeFeatures_set_zero_conf_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_zero_conf_required")] public static extern void NodeFeatures_set_zero_conf_required(long _this_arg); - // MUST_USE_RES bool NodeFeatures_supports_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_zero_conf")] public static extern bool NodeFeatures_supports_zero_conf(long _this_arg); - // void ChannelTypeFeatures_set_zero_conf_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_zero_conf_optional")] public static extern void ChannelTypeFeatures_set_zero_conf_optional(long _this_arg); - // void ChannelTypeFeatures_set_zero_conf_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_zero_conf_required")] public static extern void ChannelTypeFeatures_set_zero_conf_required(long _this_arg); - // MUST_USE_RES bool ChannelTypeFeatures_supports_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_supports_zero_conf")] public static extern bool ChannelTypeFeatures_supports_zero_conf(long _this_arg); - // MUST_USE_RES bool InitFeatures_requires_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_zero_conf")] public static extern bool InitFeatures_requires_zero_conf(long _this_arg); - // MUST_USE_RES bool NodeFeatures_requires_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_zero_conf")] public static extern bool NodeFeatures_requires_zero_conf(long _this_arg); - // MUST_USE_RES bool ChannelTypeFeatures_requires_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_requires_zero_conf")] public static extern bool ChannelTypeFeatures_requires_zero_conf(long _this_arg); - // void NodeFeatures_set_keysend_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_keysend_optional")] public static extern void NodeFeatures_set_keysend_optional(long _this_arg); - // void NodeFeatures_set_keysend_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_keysend_required")] public static extern void NodeFeatures_set_keysend_required(long _this_arg); - // MUST_USE_RES bool NodeFeatures_supports_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - [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); @@ -11380,6 +11193,24 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelId_read")] public static extern long ChannelId_read(long _ser); // struct LDKStr ChannelId_to_str(const struct LDKChannelId *NONNULL_PTR o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelId_to_str")] public static extern long ChannelId_to_str(long _o); + // struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_phantom_invoice(struct LDKCOption_u64Z amt_msat, struct LDKCOption_ThirtyTwoBytesZ payment_hash, struct LDKStr description, uint32_t invoice_expiry_delta_secs, struct LDKCVec_PhantomRouteHintsZ phantom_route_hints, struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u16Z min_final_cltv_expiry_delta, uint64_t duration_since_epoch); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_create_phantom_invoice")] public static extern long create_phantom_invoice(long _amt_msat, long _payment_hash, long _description, int _invoice_expiry_delta_secs, long _phantom_route_hints, long _entropy_source, long _node_signer, long _logger, Currency _network, long _min_final_cltv_expiry_delta, long _duration_since_epoch); + // struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_phantom_invoice_with_description_hash(struct LDKCOption_u64Z amt_msat, struct LDKCOption_ThirtyTwoBytesZ payment_hash, uint32_t invoice_expiry_delta_secs, struct LDKSha256 description_hash, struct LDKCVec_PhantomRouteHintsZ phantom_route_hints, struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u16Z min_final_cltv_expiry_delta, uint64_t duration_since_epoch); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_create_phantom_invoice_with_description_hash")] public static extern long create_phantom_invoice_with_description_hash(long _amt_msat, long _payment_hash, int _invoice_expiry_delta_secs, long _description_hash, long _phantom_route_hints, long _entropy_source, long _node_signer, long _logger, Currency _network, long _min_final_cltv_expiry_delta, long _duration_since_epoch); + // struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_create_invoice_from_channelmanager")] public static extern long create_invoice_from_channelmanager(long _channelmanager, long _node_signer, long _logger, Currency _network, long _amt_msat, long _description, int _invoice_expiry_delta_secs, long _min_final_cltv_expiry_delta); + // struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKSha256 description_hash, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_create_invoice_from_channelmanager_with_description_hash")] public static extern long create_invoice_from_channelmanager_with_description_hash(long _channelmanager, long _node_signer, long _logger, Currency _network, long _amt_msat, long _description_hash, int _invoice_expiry_delta_secs, long _min_final_cltv_expiry_delta); + // struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKSha256 description_hash, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch")] public static extern long create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(long _channelmanager, long _node_signer, long _logger, Currency _network, long _amt_msat, long _description_hash, long _duration_since_epoch, int _invoice_expiry_delta_secs, long _min_final_cltv_expiry_delta); + // struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_create_invoice_from_channelmanager_and_duration_since_epoch")] public static extern long create_invoice_from_channelmanager_and_duration_since_epoch(long _channelmanager, long _node_signer, long _logger, Currency _network, long _amt_msat, long _description, long _duration_since_epoch, int _invoice_expiry_delta_secs, long _min_final_cltv_expiry_delta); + // struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u16Z min_final_cltv_expiry_delta); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash")] public static extern long create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(long _channelmanager, long _node_signer, long _logger, Currency _network, long _amt_msat, long _description, long _duration_since_epoch, int _invoice_expiry_delta_secs, long _payment_hash, long _min_final_cltv_expiry_delta); + // struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ payment_parameters_from_zero_amount_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice, uint64_t amount_msat); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_payment_parameters_from_zero_amount_invoice")] public static extern long payment_parameters_from_zero_amount_invoice(long _invoice, long _amount_msat); + // struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ payment_parameters_from_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_payment_parameters_from_invoice")] public static extern long payment_parameters_from_invoice(long _invoice); // 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); @@ -11406,6 +11237,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RetryableSendFailure_route_not_found")] public static extern RetryableSendFailure RetryableSendFailure_route_not_found(); // enum LDKRetryableSendFailure RetryableSendFailure_duplicate_payment(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RetryableSendFailure_duplicate_payment")] public static extern RetryableSendFailure RetryableSendFailure_duplicate_payment(); + // enum LDKRetryableSendFailure RetryableSendFailure_onion_packet_size_exceeded(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RetryableSendFailure_onion_packet_size_exceeded")] public static extern RetryableSendFailure RetryableSendFailure_onion_packet_size_exceeded(); // bool RetryableSendFailure_eq(const enum LDKRetryableSendFailure *NONNULL_PTR a, const enum LDKRetryableSendFailure *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RetryableSendFailure_eq")] public static extern bool RetryableSendFailure_eq(long _a, long _b); // void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr); @@ -11426,6 +11259,22 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentSendFailure_partial_failure")] public static extern long PaymentSendFailure_partial_failure(long _results, long _failed_paths_retry, long _payment_id); // bool PaymentSendFailure_eq(const struct LDKPaymentSendFailure *NONNULL_PTR a, const struct LDKPaymentSendFailure *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentSendFailure_eq")] public static extern bool PaymentSendFailure_eq(long _a, long _b); + // void Bolt12PaymentError_free(struct LDKBolt12PaymentError this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12PaymentError_free")] public static extern void Bolt12PaymentError_free(long _this_ptr); + // uint64_t Bolt12PaymentError_clone_ptr(LDKBolt12PaymentError *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12PaymentError_clone_ptr")] public static extern long Bolt12PaymentError_clone_ptr(long _arg); + // struct LDKBolt12PaymentError Bolt12PaymentError_clone(const struct LDKBolt12PaymentError *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12PaymentError_clone")] public static extern long Bolt12PaymentError_clone(long _orig); + // struct LDKBolt12PaymentError Bolt12PaymentError_unexpected_invoice(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12PaymentError_unexpected_invoice")] public static extern long Bolt12PaymentError_unexpected_invoice(); + // struct LDKBolt12PaymentError Bolt12PaymentError_duplicate_invoice(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12PaymentError_duplicate_invoice")] public static extern long Bolt12PaymentError_duplicate_invoice(); + // struct LDKBolt12PaymentError Bolt12PaymentError_unknown_required_features(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12PaymentError_unknown_required_features")] public static extern long Bolt12PaymentError_unknown_required_features(); + // struct LDKBolt12PaymentError Bolt12PaymentError_sending_failed(enum LDKRetryableSendFailure a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12PaymentError_sending_failed")] public static extern long Bolt12PaymentError_sending_failed(RetryableSendFailure _a); + // bool Bolt12PaymentError_eq(const struct LDKBolt12PaymentError *NONNULL_PTR a, const struct LDKBolt12PaymentError *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12PaymentError_eq")] public static extern bool Bolt12PaymentError_eq(long _a, long _b); // void ProbeSendFailure_free(struct LDKProbeSendFailure this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbeSendFailure_free")] public static extern void ProbeSendFailure_free(long _this_ptr); // uint64_t ProbeSendFailure_clone_ptr(LDKProbeSendFailure *NONNULL_PTR arg); @@ -11518,14 +11367,14 @@ internal class bindings { [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); + // MUST_USE_RES void OfferWithExplicitMetadataBuilder_path(struct LDKOfferWithExplicitMetadataBuilder this_arg, struct LDKBlindedMessagePath 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 struct LDKOfferWithDerivedMetadataBuilder OfferWithDerivedMetadataBuilder_deriving_signing_pubkey(struct LDKPublicKey node_id, const struct LDKExpandedKey *NONNULL_PTR expanded_key, struct LDKNonce nonce); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferWithDerivedMetadataBuilder_deriving_signing_pubkey")] public static extern long OfferWithDerivedMetadataBuilder_deriving_signing_pubkey(long _node_id, long _expanded_key, long _nonce); // 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); @@ -11536,7 +11385,7 @@ internal class bindings { [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); + // MUST_USE_RES void OfferWithDerivedMetadataBuilder_path(struct LDKOfferWithDerivedMetadataBuilder this_arg, struct LDKBlindedMessagePath 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); @@ -11562,7 +11411,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_absolute_expiry")] public static extern long Offer_absolute_expiry(long _this_arg); // MUST_USE_RES struct LDKPrintableString Offer_issuer(const struct LDKOffer *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_issuer")] public static extern long Offer_issuer(long _this_arg); - // MUST_USE_RES struct LDKCVec_BlindedPathZ Offer_paths(const struct LDKOffer *NONNULL_PTR this_arg); + // MUST_USE_RES struct LDKCVec_BlindedMessagePathZ Offer_paths(const struct LDKOffer *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_paths")] public static extern long Offer_paths(long _this_arg); // MUST_USE_RES struct LDKQuantity Offer_supported_quantity(const struct LDKOffer *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_supported_quantity")] public static extern long Offer_supported_quantity(long _this_arg); @@ -11580,14 +11429,16 @@ 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_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ Offer_request_invoice_deriving_payer_id(const struct LDKOffer *NONNULL_PTR this_arg, const struct LDKExpandedKey *NONNULL_PTR expanded_key, struct LDKNonce nonce, 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 _nonce, 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 LDKNonce nonce, 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 _nonce, 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 LDKCResult_OfferDecodeErrorZ Offer_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_read")] public static extern long Offer_read(long _ser); // 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_ptr); @@ -11660,6 +11511,18 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_clone_ptr")] public static extern long Bolt12Invoice_clone_ptr(long _arg); // struct LDKBolt12Invoice Bolt12Invoice_clone(const struct LDKBolt12Invoice *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_clone")] public static extern long Bolt12Invoice_clone(long _orig); + // MUST_USE_RES uint64_t UnsignedBolt12Invoice_created_at(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedBolt12Invoice_created_at")] public static extern long UnsignedBolt12Invoice_created_at(long _this_arg); + // MUST_USE_RES uint64_t UnsignedBolt12Invoice_relative_expiry(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedBolt12Invoice_relative_expiry")] public static extern long UnsignedBolt12Invoice_relative_expiry(long _this_arg); + // MUST_USE_RES bool UnsignedBolt12Invoice_is_expired(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedBolt12Invoice_is_expired")] public static extern bool UnsignedBolt12Invoice_is_expired(long _this_arg); + // MUST_USE_RES struct LDKCVec_StrZ UnsignedBolt12Invoice_fallbacks(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedBolt12Invoice_fallbacks")] public static extern long UnsignedBolt12Invoice_fallbacks(long _this_arg); + // MUST_USE_RES struct LDKBolt12InvoiceFeatures UnsignedBolt12Invoice_invoice_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedBolt12Invoice_invoice_features")] public static extern long UnsignedBolt12Invoice_invoice_features(long _this_arg); + // MUST_USE_RES struct LDKPublicKey UnsignedBolt12Invoice_signing_pubkey(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedBolt12Invoice_signing_pubkey")] public static extern long UnsignedBolt12Invoice_signing_pubkey(long _this_arg); // MUST_USE_RES struct LDKCOption_CVec_ThirtyTwoBytesZZ UnsignedBolt12Invoice_offer_chains(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedBolt12Invoice_offer_chains")] public static extern long UnsignedBolt12Invoice_offer_chains(long _this_arg); // MUST_USE_RES struct LDKThirtyTwoBytes UnsignedBolt12Invoice_chain(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); @@ -11676,7 +11539,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedBolt12Invoice_absolute_expiry")] public static extern long UnsignedBolt12Invoice_absolute_expiry(long _this_arg); // MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_issuer(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); [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); + // MUST_USE_RES struct LDKCVec_BlindedMessagePathZ 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 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); @@ -11690,20 +11553,22 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedBolt12Invoice_payer_id")] public static extern long UnsignedBolt12Invoice_payer_id(long _this_arg); // MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_payer_note(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedBolt12Invoice_payer_note")] public static extern long UnsignedBolt12Invoice_payer_note(long _this_arg); - // MUST_USE_RES uint64_t UnsignedBolt12Invoice_created_at(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedBolt12Invoice_created_at")] public static extern long UnsignedBolt12Invoice_created_at(long _this_arg); - // MUST_USE_RES uint64_t UnsignedBolt12Invoice_relative_expiry(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedBolt12Invoice_relative_expiry")] public static extern long UnsignedBolt12Invoice_relative_expiry(long _this_arg); - // MUST_USE_RES bool UnsignedBolt12Invoice_is_expired(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedBolt12Invoice_is_expired")] public static extern bool UnsignedBolt12Invoice_is_expired(long _this_arg); // MUST_USE_RES struct LDKThirtyTwoBytes UnsignedBolt12Invoice_payment_hash(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedBolt12Invoice_payment_hash")] public static extern long UnsignedBolt12Invoice_payment_hash(long _this_arg); // MUST_USE_RES uint64_t UnsignedBolt12Invoice_amount_msats(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedBolt12Invoice_amount_msats")] public static extern long UnsignedBolt12Invoice_amount_msats(long _this_arg); - // MUST_USE_RES struct LDKBolt12InvoiceFeatures UnsignedBolt12Invoice_invoice_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedBolt12Invoice_invoice_features")] public static extern long UnsignedBolt12Invoice_invoice_features(long _this_arg); - // MUST_USE_RES struct LDKPublicKey UnsignedBolt12Invoice_signing_pubkey(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedBolt12Invoice_signing_pubkey")] public static extern long UnsignedBolt12Invoice_signing_pubkey(long _this_arg); + // MUST_USE_RES uint64_t Bolt12Invoice_created_at(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_created_at")] public static extern long Bolt12Invoice_created_at(long _this_arg); + // MUST_USE_RES uint64_t Bolt12Invoice_relative_expiry(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_relative_expiry")] public static extern long Bolt12Invoice_relative_expiry(long _this_arg); + // MUST_USE_RES bool Bolt12Invoice_is_expired(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_is_expired")] public static extern bool Bolt12Invoice_is_expired(long _this_arg); + // MUST_USE_RES struct LDKCVec_StrZ Bolt12Invoice_fallbacks(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_fallbacks")] public static extern long Bolt12Invoice_fallbacks(long _this_arg); + // MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12Invoice_invoice_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_invoice_features")] public static extern long Bolt12Invoice_invoice_features(long _this_arg); + // MUST_USE_RES struct LDKPublicKey Bolt12Invoice_signing_pubkey(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_signing_pubkey")] public static extern long Bolt12Invoice_signing_pubkey(long _this_arg); // MUST_USE_RES struct LDKCOption_CVec_ThirtyTwoBytesZZ Bolt12Invoice_offer_chains(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_offer_chains")] public static extern long Bolt12Invoice_offer_chains(long _this_arg); // MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_chain(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); @@ -11720,7 +11585,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_absolute_expiry")] public static extern long Bolt12Invoice_absolute_expiry(long _this_arg); // MUST_USE_RES struct LDKPrintableString Bolt12Invoice_issuer(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); [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); + // MUST_USE_RES struct LDKCVec_BlindedMessagePathZ 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 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); @@ -11734,72 +11599,26 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_payer_id")] public static extern long Bolt12Invoice_payer_id(long _this_arg); // MUST_USE_RES struct LDKPrintableString Bolt12Invoice_payer_note(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_payer_note")] public static extern long Bolt12Invoice_payer_note(long _this_arg); - // MUST_USE_RES uint64_t Bolt12Invoice_created_at(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_created_at")] public static extern long Bolt12Invoice_created_at(long _this_arg); - // MUST_USE_RES uint64_t Bolt12Invoice_relative_expiry(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_relative_expiry")] public static extern long Bolt12Invoice_relative_expiry(long _this_arg); - // MUST_USE_RES bool Bolt12Invoice_is_expired(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_is_expired")] public static extern bool Bolt12Invoice_is_expired(long _this_arg); // MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_payment_hash(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_payment_hash")] public static extern long Bolt12Invoice_payment_hash(long _this_arg); // MUST_USE_RES uint64_t Bolt12Invoice_amount_msats(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_amount_msats")] public static extern long Bolt12Invoice_amount_msats(long _this_arg); - // MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12Invoice_invoice_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_invoice_features")] public static extern long Bolt12Invoice_invoice_features(long _this_arg); - // MUST_USE_RES struct LDKPublicKey Bolt12Invoice_signing_pubkey(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_signing_pubkey")] public static extern long Bolt12Invoice_signing_pubkey(long _this_arg); // MUST_USE_RES struct LDKSchnorrSignature Bolt12Invoice_signature(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_signature")] public static extern long Bolt12Invoice_signature(long _this_arg); // MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_signable_hash(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); [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); + // MUST_USE_RES struct LDKCResult_ThirtyTwoBytesNoneZ Bolt12Invoice_verify_using_metadata(const struct LDKBolt12Invoice *NONNULL_PTR this_arg, const struct LDKExpandedKey *NONNULL_PTR key); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_verify_using_metadata")] public static extern long Bolt12Invoice_verify_using_metadata(long _this_arg, long _key); + // MUST_USE_RES struct LDKCResult_ThirtyTwoBytesNoneZ Bolt12Invoice_verify_using_payer_data(const struct LDKBolt12Invoice *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id, struct LDKNonce nonce, const struct LDKExpandedKey *NONNULL_PTR key); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_verify_using_payer_data")] public static extern long Bolt12Invoice_verify_using_payer_data(long _this_arg, long _payment_id, long _nonce, 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); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_write")] public static extern long Bolt12Invoice_write(long _obj); - // void BlindedPayInfo_free(struct LDKBlindedPayInfo this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_free")] public static extern void BlindedPayInfo_free(long _this_obj); - // uint32_t BlindedPayInfo_get_fee_base_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_get_fee_base_msat")] public static extern int BlindedPayInfo_get_fee_base_msat(long _this_ptr); - // void BlindedPayInfo_set_fee_base_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_set_fee_base_msat")] public static extern void BlindedPayInfo_set_fee_base_msat(long _this_ptr, int _val); - // uint32_t BlindedPayInfo_get_fee_proportional_millionths(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_get_fee_proportional_millionths")] public static extern int BlindedPayInfo_get_fee_proportional_millionths(long _this_ptr); - // void BlindedPayInfo_set_fee_proportional_millionths(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_set_fee_proportional_millionths")] public static extern void BlindedPayInfo_set_fee_proportional_millionths(long _this_ptr, int _val); - // uint16_t BlindedPayInfo_get_cltv_expiry_delta(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_get_cltv_expiry_delta")] public static extern short BlindedPayInfo_get_cltv_expiry_delta(long _this_ptr); - // void BlindedPayInfo_set_cltv_expiry_delta(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint16_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_set_cltv_expiry_delta")] public static extern void BlindedPayInfo_set_cltv_expiry_delta(long _this_ptr, short _val); - // uint64_t BlindedPayInfo_get_htlc_minimum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_get_htlc_minimum_msat")] public static extern long BlindedPayInfo_get_htlc_minimum_msat(long _this_ptr); - // void BlindedPayInfo_set_htlc_minimum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_set_htlc_minimum_msat")] public static extern void BlindedPayInfo_set_htlc_minimum_msat(long _this_ptr, long _val); - // uint64_t BlindedPayInfo_get_htlc_maximum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_get_htlc_maximum_msat")] public static extern long BlindedPayInfo_get_htlc_maximum_msat(long _this_ptr); - // void BlindedPayInfo_set_htlc_maximum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_set_htlc_maximum_msat")] public static extern void BlindedPayInfo_set_htlc_maximum_msat(long _this_ptr, long _val); - // struct LDKBlindedHopFeatures BlindedPayInfo_get_features(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_get_features")] public static extern long BlindedPayInfo_get_features(long _this_ptr); - // void BlindedPayInfo_set_features(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, struct LDKBlindedHopFeatures val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_set_features")] public static extern void BlindedPayInfo_set_features(long _this_ptr, long _val); - // MUST_USE_RES struct LDKBlindedPayInfo BlindedPayInfo_new(uint32_t fee_base_msat_arg, uint32_t fee_proportional_millionths_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg, uint64_t htlc_maximum_msat_arg, struct LDKBlindedHopFeatures features_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_new")] public static extern long BlindedPayInfo_new(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, long _features_arg); - // uint64_t BlindedPayInfo_clone_ptr(LDKBlindedPayInfo *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_clone_ptr")] public static extern long BlindedPayInfo_clone_ptr(long _arg); - // struct LDKBlindedPayInfo BlindedPayInfo_clone(const struct LDKBlindedPayInfo *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_clone")] public static extern long BlindedPayInfo_clone(long _orig); - // uint64_t BlindedPayInfo_hash(const struct LDKBlindedPayInfo *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_hash")] public static extern long BlindedPayInfo_hash(long _o); - // bool BlindedPayInfo_eq(const struct LDKBlindedPayInfo *NONNULL_PTR a, const struct LDKBlindedPayInfo *NONNULL_PTR b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_eq")] public static extern bool BlindedPayInfo_eq(long _a, long _b); - // struct LDKCVec_u8Z BlindedPayInfo_write(const struct LDKBlindedPayInfo *NONNULL_PTR obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_write")] public static extern long BlindedPayInfo_write(long _obj); - // struct LDKCResult_BlindedPayInfoDecodeErrorZ BlindedPayInfo_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_read")] public static extern long BlindedPayInfo_read(long _ser); + // struct LDKCResult_Bolt12InvoiceDecodeErrorZ Bolt12Invoice_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_read")] public static extern long Bolt12Invoice_read(long _ser); // void InvoiceError_free(struct LDKInvoiceError this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceError_free")] public static extern void InvoiceError_free(long _this_obj); // struct LDKErroneousField InvoiceError_get_erroneous_field(const struct LDKInvoiceError *NONNULL_PTR this_ptr); @@ -11886,10 +11705,6 @@ internal class bindings { [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); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_VerifiedInvoiceRequest_set_keys")] public static extern void VerifiedInvoiceRequest_set_keys(long _this_ptr, long _val); // uint64_t VerifiedInvoiceRequest_clone_ptr(LDKVerifiedInvoiceRequest *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_VerifiedInvoiceRequest_clone_ptr")] public static extern long VerifiedInvoiceRequest_clone_ptr(long _arg); // struct LDKVerifiedInvoiceRequest VerifiedInvoiceRequest_clone(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR orig); @@ -11908,7 +11723,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedInvoiceRequest_absolute_expiry")] public static extern long UnsignedInvoiceRequest_absolute_expiry(long _this_arg); // MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_issuer(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedInvoiceRequest_issuer")] public static extern long UnsignedInvoiceRequest_issuer(long _this_arg); - // MUST_USE_RES struct LDKCVec_BlindedPathZ UnsignedInvoiceRequest_paths(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg); + // MUST_USE_RES struct LDKCVec_BlindedMessagePathZ UnsignedInvoiceRequest_paths(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedInvoiceRequest_paths")] public static extern long UnsignedInvoiceRequest_paths(long _this_arg); // MUST_USE_RES struct LDKQuantity UnsignedInvoiceRequest_supported_quantity(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedInvoiceRequest_supported_quantity")] public static extern long UnsignedInvoiceRequest_supported_quantity(long _this_arg); @@ -11942,7 +11757,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequest_absolute_expiry")] public static extern long InvoiceRequest_absolute_expiry(long _this_arg); // MUST_USE_RES struct LDKPrintableString InvoiceRequest_issuer(const struct LDKInvoiceRequest *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequest_issuer")] public static extern long InvoiceRequest_issuer(long _this_arg); - // MUST_USE_RES struct LDKCVec_BlindedPathZ InvoiceRequest_paths(const struct LDKInvoiceRequest *NONNULL_PTR this_arg); + // MUST_USE_RES struct LDKCVec_BlindedMessagePathZ InvoiceRequest_paths(const struct LDKInvoiceRequest *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequest_paths")] public static extern long InvoiceRequest_paths(long _this_arg); // MUST_USE_RES struct LDKQuantity InvoiceRequest_supported_quantity(const struct LDKInvoiceRequest *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequest_supported_quantity")] public static extern long InvoiceRequest_supported_quantity(long _this_arg); @@ -11962,12 +11777,14 @@ 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 LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ InvoiceRequest_respond_with(const struct LDKInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths, struct LDKThirtyTwoBytes payment_hash); + // MUST_USE_RES struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ InvoiceRequest_respond_with(const struct LDKInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_BlindedPaymentPathZ 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); + // MUST_USE_RES struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ InvoiceRequest_respond_with_no_std(const struct LDKInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_BlindedPaymentPathZ 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 LDKCResult_VerifiedInvoiceRequestNoneZ InvoiceRequest_verify_using_metadata(struct LDKInvoiceRequest this_arg, const struct LDKExpandedKey *NONNULL_PTR key); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequest_verify_using_metadata")] public static extern long InvoiceRequest_verify_using_metadata(long _this_arg, long _key); + // MUST_USE_RES struct LDKCResult_VerifiedInvoiceRequestNoneZ InvoiceRequest_verify_using_recipient_data(struct LDKInvoiceRequest this_arg, struct LDKNonce nonce, const struct LDKExpandedKey *NONNULL_PTR key); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequest_verify_using_recipient_data")] public static extern long InvoiceRequest_verify_using_recipient_data(long _this_arg, long _nonce, 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); @@ -11984,7 +11801,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_VerifiedInvoiceRequest_absolute_expiry")] public static extern long VerifiedInvoiceRequest_absolute_expiry(long _this_arg); // MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_issuer(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_VerifiedInvoiceRequest_issuer")] public static extern long VerifiedInvoiceRequest_issuer(long _this_arg); - // MUST_USE_RES struct LDKCVec_BlindedPathZ VerifiedInvoiceRequest_paths(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg); + // MUST_USE_RES struct LDKCVec_BlindedMessagePathZ VerifiedInvoiceRequest_paths(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_VerifiedInvoiceRequest_paths")] public static extern long VerifiedInvoiceRequest_paths(long _this_arg); // MUST_USE_RES struct LDKQuantity VerifiedInvoiceRequest_supported_quantity(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_VerifiedInvoiceRequest_supported_quantity")] public static extern long VerifiedInvoiceRequest_supported_quantity(long _this_arg); @@ -12004,13 +11821,13 @@ 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); + // MUST_USE_RES struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ VerifiedInvoiceRequest_respond_with(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_BlindedPaymentPathZ 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); + // MUST_USE_RES struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ VerifiedInvoiceRequest_respond_with_no_std(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_BlindedPaymentPathZ 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); + // MUST_USE_RES struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ VerifiedInvoiceRequest_respond_using_derived_keys(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_BlindedPaymentPathZ 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); + // MUST_USE_RES struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ VerifiedInvoiceRequest_respond_using_derived_keys_no_std(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_BlindedPaymentPathZ 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); @@ -12064,6 +11881,22 @@ internal class bindings { [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 Nonce_free(struct LDKNonce this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Nonce_free")] public static extern void Nonce_free(long _this_obj); + // uint64_t Nonce_clone_ptr(LDKNonce *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Nonce_clone_ptr")] public static extern long Nonce_clone_ptr(long _arg); + // struct LDKNonce Nonce_clone(const struct LDKNonce *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Nonce_clone")] public static extern long Nonce_clone(long _orig); + // bool Nonce_eq(const struct LDKNonce *NONNULL_PTR a, const struct LDKNonce *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Nonce_eq")] public static extern bool Nonce_eq(long _a, long _b); + // MUST_USE_RES struct LDKNonce Nonce_from_entropy_source(struct LDKEntropySource entropy_source); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Nonce_from_entropy_source")] public static extern long Nonce_from_entropy_source(long _entropy_source); + // MUST_USE_RES struct LDKu8slice Nonce_as_slice(const struct LDKNonce *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Nonce_as_slice")] public static extern long Nonce_as_slice(long _this_arg); + // struct LDKCVec_u8Z Nonce_write(const struct LDKNonce *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Nonce_write")] public static extern long Nonce_write(long _obj); + // struct LDKCResult_NonceDecodeErrorZ Nonce_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Nonce_read")] public static extern long Nonce_read(long _ser); // 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); @@ -12126,6 +11959,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12SemanticError_missing_creation_time")] public static extern Bolt12SemanticError Bolt12SemanticError_missing_creation_time(); // enum LDKBolt12SemanticError Bolt12SemanticError_missing_payment_hash(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12SemanticError_missing_payment_hash")] public static extern Bolt12SemanticError Bolt12SemanticError_missing_payment_hash(); + // enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_payment_hash(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12SemanticError_unexpected_payment_hash")] public static extern Bolt12SemanticError Bolt12SemanticError_unexpected_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); @@ -12136,15 +11971,15 @@ internal class bindings { [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 struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ RefundMaybeWithDerivedMetadataBuilder_deriving_payer_id(struct LDKPublicKey node_id, const struct LDKExpandedKey *NONNULL_PTR expanded_key, struct LDKNonce nonce, 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 _nonce, 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); + // MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_path(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, struct LDKBlindedMessagePath 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); @@ -12170,7 +12005,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Refund_is_expired_no_std")] public static extern bool Refund_is_expired_no_std(long _this_arg, long _duration_since_epoch); // MUST_USE_RES struct LDKPrintableString Refund_issuer(const struct LDKRefund *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Refund_issuer")] public static extern long Refund_issuer(long _this_arg); - // MUST_USE_RES struct LDKCVec_BlindedPathZ Refund_paths(const struct LDKRefund *NONNULL_PTR this_arg); + // MUST_USE_RES struct LDKCVec_BlindedMessagePathZ Refund_paths(const struct LDKRefund *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Refund_paths")] public static extern long Refund_paths(long _this_arg); // MUST_USE_RES struct LDKu8slice Refund_payer_metadata(const struct LDKRefund *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Refund_payer_metadata")] public static extern long Refund_payer_metadata(long _this_arg); @@ -12188,6 +12023,8 @@ internal class bindings { [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 LDKCResult_RefundDecodeErrorZ Refund_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Refund_read")] public static extern long Refund_read(long _ser); // 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); @@ -12230,6 +12067,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeId_clone_ptr")] public static extern long NodeId_clone_ptr(long _arg); // struct LDKNodeId NodeId_clone(const struct LDKNodeId *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeId_clone")] public static extern long NodeId_clone(long _orig); + // bool NodeId_eq(const struct LDKNodeId *NONNULL_PTR a, const struct LDKNodeId *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeId_eq")] public static extern bool NodeId_eq(long _a, long _b); // 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); @@ -12258,8 +12097,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkUpdate_clone_ptr")] public static extern long NetworkUpdate_clone_ptr(long _arg); // struct LDKNetworkUpdate NetworkUpdate_clone(const struct LDKNetworkUpdate *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkUpdate_clone")] public static extern long NetworkUpdate_clone(long _orig); - // struct LDKNetworkUpdate NetworkUpdate_channel_update_message(struct LDKChannelUpdate msg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkUpdate_channel_update_message")] public static extern long NetworkUpdate_channel_update_message(long _msg); // struct LDKNetworkUpdate NetworkUpdate_channel_failure(uint64_t short_channel_id, bool is_permanent); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkUpdate_channel_failure")] public static extern long NetworkUpdate_channel_failure(long _short_channel_id, bool _is_permanent); // struct LDKNetworkUpdate NetworkUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent); @@ -12290,18 +12127,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_P2PGossipSync_as_MessageSendEventsProvider")] public static extern long P2PGossipSync_as_MessageSendEventsProvider(long _this_arg); // void ChannelUpdateInfo_free(struct LDKChannelUpdateInfo this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdateInfo_free")] public static extern void ChannelUpdateInfo_free(long _this_obj); - // uint32_t ChannelUpdateInfo_get_last_update(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdateInfo_get_last_update")] public static extern int ChannelUpdateInfo_get_last_update(long _this_ptr); - // void ChannelUpdateInfo_set_last_update(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint32_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdateInfo_set_last_update")] public static extern void ChannelUpdateInfo_set_last_update(long _this_ptr, int _val); - // bool ChannelUpdateInfo_get_enabled(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdateInfo_get_enabled")] public static extern bool ChannelUpdateInfo_get_enabled(long _this_ptr); - // void ChannelUpdateInfo_set_enabled(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, bool val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdateInfo_set_enabled")] public static extern void ChannelUpdateInfo_set_enabled(long _this_ptr, bool _val); - // uint16_t ChannelUpdateInfo_get_cltv_expiry_delta(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdateInfo_get_cltv_expiry_delta")] public static extern short ChannelUpdateInfo_get_cltv_expiry_delta(long _this_ptr); - // void ChannelUpdateInfo_set_cltv_expiry_delta(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint16_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdateInfo_set_cltv_expiry_delta")] public static extern void ChannelUpdateInfo_set_cltv_expiry_delta(long _this_ptr, short _val); // uint64_t ChannelUpdateInfo_get_htlc_minimum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdateInfo_get_htlc_minimum_msat")] public static extern long ChannelUpdateInfo_get_htlc_minimum_msat(long _this_ptr); // void ChannelUpdateInfo_set_htlc_minimum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val); @@ -12314,12 +12139,24 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdateInfo_get_fees")] public static extern long ChannelUpdateInfo_get_fees(long _this_ptr); // void ChannelUpdateInfo_set_fees(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdateInfo_set_fees")] public static extern void ChannelUpdateInfo_set_fees(long _this_ptr, long _val); + // uint32_t ChannelUpdateInfo_get_last_update(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdateInfo_get_last_update")] public static extern int ChannelUpdateInfo_get_last_update(long _this_ptr); + // void ChannelUpdateInfo_set_last_update(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint32_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdateInfo_set_last_update")] public static extern void ChannelUpdateInfo_set_last_update(long _this_ptr, int _val); + // uint16_t ChannelUpdateInfo_get_cltv_expiry_delta(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdateInfo_get_cltv_expiry_delta")] public static extern short ChannelUpdateInfo_get_cltv_expiry_delta(long _this_ptr); + // void ChannelUpdateInfo_set_cltv_expiry_delta(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint16_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdateInfo_set_cltv_expiry_delta")] public static extern void ChannelUpdateInfo_set_cltv_expiry_delta(long _this_ptr, short _val); + // bool ChannelUpdateInfo_get_enabled(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdateInfo_get_enabled")] public static extern bool ChannelUpdateInfo_get_enabled(long _this_ptr); + // void ChannelUpdateInfo_set_enabled(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, bool val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdateInfo_set_enabled")] public static extern void ChannelUpdateInfo_set_enabled(long _this_ptr, bool _val); // struct LDKChannelUpdate ChannelUpdateInfo_get_last_update_message(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdateInfo_get_last_update_message")] public static extern long ChannelUpdateInfo_get_last_update_message(long _this_ptr); // void ChannelUpdateInfo_set_last_update_message(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdateInfo_set_last_update_message")] public static extern void ChannelUpdateInfo_set_last_update_message(long _this_ptr, long _val); - // MUST_USE_RES struct LDKChannelUpdateInfo ChannelUpdateInfo_new(uint32_t last_update_arg, bool enabled_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg, uint64_t htlc_maximum_msat_arg, struct LDKRoutingFees fees_arg, struct LDKChannelUpdate last_update_message_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdateInfo_new")] public static extern long ChannelUpdateInfo_new(int _last_update_arg, bool _enabled_arg, short _cltv_expiry_delta_arg, long _htlc_minimum_msat_arg, long _htlc_maximum_msat_arg, long _fees_arg, long _last_update_message_arg); + // MUST_USE_RES struct LDKChannelUpdateInfo ChannelUpdateInfo_new(uint64_t htlc_minimum_msat_arg, uint64_t htlc_maximum_msat_arg, struct LDKRoutingFees fees_arg, uint32_t last_update_arg, uint16_t cltv_expiry_delta_arg, bool enabled_arg, struct LDKChannelUpdate last_update_message_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdateInfo_new")] public static extern long ChannelUpdateInfo_new(long _htlc_minimum_msat_arg, long _htlc_maximum_msat_arg, long _fees_arg, int _last_update_arg, short _cltv_expiry_delta_arg, bool _enabled_arg, long _last_update_message_arg); // uint64_t ChannelUpdateInfo_clone_ptr(LDKChannelUpdateInfo *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdateInfo_clone_ptr")] public static extern long ChannelUpdateInfo_clone_ptr(long _arg); // struct LDKChannelUpdateInfo ChannelUpdateInfo_clone(const struct LDKChannelUpdateInfo *NONNULL_PTR orig); @@ -12342,22 +12179,22 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelInfo_get_node_one")] public static extern long ChannelInfo_get_node_one(long _this_ptr); // void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelInfo_set_node_one")] public static extern void ChannelInfo_set_node_one(long _this_ptr, long _val); - // struct LDKChannelUpdateInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelInfo_get_one_to_two")] public static extern long ChannelInfo_get_one_to_two(long _this_ptr); - // void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelInfo_set_one_to_two")] public static extern void ChannelInfo_set_one_to_two(long _this_ptr, long _val); // struct LDKNodeId ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelInfo_get_node_two")] public static extern long ChannelInfo_get_node_two(long _this_ptr); // void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelInfo_set_node_two")] public static extern void ChannelInfo_set_node_two(long _this_ptr, long _val); - // struct LDKChannelUpdateInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelInfo_get_two_to_one")] public static extern long ChannelInfo_get_two_to_one(long _this_ptr); - // void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelInfo_set_two_to_one")] public static extern void ChannelInfo_set_two_to_one(long _this_ptr, long _val); // struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelInfo_get_capacity_sats")] public static extern long ChannelInfo_get_capacity_sats(long _this_ptr); // void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelInfo_set_capacity_sats")] public static extern void ChannelInfo_set_capacity_sats(long _this_ptr, long _val); + // struct LDKChannelUpdateInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelInfo_get_one_to_two")] public static extern long ChannelInfo_get_one_to_two(long _this_ptr); + // void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelInfo_set_one_to_two")] public static extern void ChannelInfo_set_one_to_two(long _this_ptr, long _val); + // struct LDKChannelUpdateInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelInfo_get_two_to_one")] public static extern long ChannelInfo_get_two_to_one(long _this_ptr); + // void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelInfo_set_two_to_one")] public static extern void ChannelInfo_set_two_to_one(long _this_ptr, long _val); // struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelInfo_get_announcement_message")] public static extern long ChannelInfo_get_announcement_message(long _this_ptr); // void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val); @@ -12410,62 +12247,64 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EffectiveCapacity_unknown")] public static extern long EffectiveCapacity_unknown(); // MUST_USE_RES uint64_t EffectiveCapacity_as_msat(const struct LDKEffectiveCapacity *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EffectiveCapacity_as_msat")] public static extern long EffectiveCapacity_as_msat(long _this_arg); - // void RoutingFees_free(struct LDKRoutingFees this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingFees_free")] public static extern void RoutingFees_free(long _this_obj); - // uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingFees_get_base_msat")] public static extern int RoutingFees_get_base_msat(long _this_ptr); - // void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingFees_set_base_msat")] public static extern void RoutingFees_set_base_msat(long _this_ptr, int _val); - // uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingFees_get_proportional_millionths")] public static extern int RoutingFees_get_proportional_millionths(long _this_ptr); - // void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingFees_set_proportional_millionths")] public static extern void RoutingFees_set_proportional_millionths(long _this_ptr, int _val); - // MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingFees_new")] public static extern long RoutingFees_new(int _base_msat_arg, int _proportional_millionths_arg); - // bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingFees_eq")] public static extern bool RoutingFees_eq(long _a, long _b); - // uint64_t RoutingFees_clone_ptr(LDKRoutingFees *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingFees_clone_ptr")] public static extern long RoutingFees_clone_ptr(long _arg); - // struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingFees_clone")] public static extern long RoutingFees_clone(long _orig); - // uint64_t RoutingFees_hash(const struct LDKRoutingFees *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingFees_hash")] public static extern long RoutingFees_hash(long _o); // struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingFees_write")] public static extern long RoutingFees_write(long _obj); // struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingFees_read")] public static extern long RoutingFees_read(long _ser); - // void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_free")] public static extern void NodeAnnouncementInfo_free(long _this_obj); - // struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_get_features")] public static extern long NodeAnnouncementInfo_get_features(long _this_ptr); - // void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_set_features")] public static extern void NodeAnnouncementInfo_set_features(long _this_ptr, long _val); - // uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_get_last_update")] public static extern int NodeAnnouncementInfo_get_last_update(long _this_ptr); - // void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_set_last_update")] public static extern void NodeAnnouncementInfo_set_last_update(long _this_ptr, int _val); - // const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3]; - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_get_rgb")] public static extern long NodeAnnouncementInfo_get_rgb(long _this_ptr); - // void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_set_rgb")] public static extern void NodeAnnouncementInfo_set_rgb(long _this_ptr, long _val); - // struct LDKNodeAlias NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_get_alias")] public static extern long NodeAnnouncementInfo_get_alias(long _this_ptr); - // void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAlias val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_set_alias")] public static extern void NodeAnnouncementInfo_set_alias(long _this_ptr, long _val); - // struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_get_announcement_message")] public static extern long NodeAnnouncementInfo_get_announcement_message(long _this_ptr); - // void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_set_announcement_message")] public static extern void NodeAnnouncementInfo_set_announcement_message(long _this_ptr, long _val); - // MUST_USE_RES struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_new(struct LDKNodeFeatures features_arg, uint32_t last_update_arg, struct LDKThreeBytes rgb_arg, struct LDKNodeAlias alias_arg, struct LDKNodeAnnouncement announcement_message_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_new")] public static extern long NodeAnnouncementInfo_new(long _features_arg, int _last_update_arg, long _rgb_arg, long _alias_arg, long _announcement_message_arg); + // void NodeAnnouncementDetails_free(struct LDKNodeAnnouncementDetails this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementDetails_free")] public static extern void NodeAnnouncementDetails_free(long _this_obj); + // struct LDKNodeFeatures NodeAnnouncementDetails_get_features(const struct LDKNodeAnnouncementDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementDetails_get_features")] public static extern long NodeAnnouncementDetails_get_features(long _this_ptr); + // void NodeAnnouncementDetails_set_features(struct LDKNodeAnnouncementDetails *NONNULL_PTR this_ptr, struct LDKNodeFeatures val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementDetails_set_features")] public static extern void NodeAnnouncementDetails_set_features(long _this_ptr, long _val); + // uint32_t NodeAnnouncementDetails_get_last_update(const struct LDKNodeAnnouncementDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementDetails_get_last_update")] public static extern int NodeAnnouncementDetails_get_last_update(long _this_ptr); + // void NodeAnnouncementDetails_set_last_update(struct LDKNodeAnnouncementDetails *NONNULL_PTR this_ptr, uint32_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementDetails_set_last_update")] public static extern void NodeAnnouncementDetails_set_last_update(long _this_ptr, int _val); + // const uint8_t (*NodeAnnouncementDetails_get_rgb(const struct LDKNodeAnnouncementDetails *NONNULL_PTR this_ptr))[3]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementDetails_get_rgb")] public static extern long NodeAnnouncementDetails_get_rgb(long _this_ptr); + // void NodeAnnouncementDetails_set_rgb(struct LDKNodeAnnouncementDetails *NONNULL_PTR this_ptr, struct LDKThreeBytes val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementDetails_set_rgb")] public static extern void NodeAnnouncementDetails_set_rgb(long _this_ptr, long _val); + // struct LDKNodeAlias NodeAnnouncementDetails_get_alias(const struct LDKNodeAnnouncementDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementDetails_get_alias")] public static extern long NodeAnnouncementDetails_get_alias(long _this_ptr); + // void NodeAnnouncementDetails_set_alias(struct LDKNodeAnnouncementDetails *NONNULL_PTR this_ptr, struct LDKNodeAlias val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementDetails_set_alias")] public static extern void NodeAnnouncementDetails_set_alias(long _this_ptr, long _val); + // struct LDKCVec_SocketAddressZ NodeAnnouncementDetails_get_addresses(const struct LDKNodeAnnouncementDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementDetails_get_addresses")] public static extern long NodeAnnouncementDetails_get_addresses(long _this_ptr); + // void NodeAnnouncementDetails_set_addresses(struct LDKNodeAnnouncementDetails *NONNULL_PTR this_ptr, struct LDKCVec_SocketAddressZ val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementDetails_set_addresses")] public static extern void NodeAnnouncementDetails_set_addresses(long _this_ptr, long _val); + // MUST_USE_RES struct LDKNodeAnnouncementDetails NodeAnnouncementDetails_new(struct LDKNodeFeatures features_arg, uint32_t last_update_arg, struct LDKThreeBytes rgb_arg, struct LDKNodeAlias alias_arg, struct LDKCVec_SocketAddressZ addresses_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementDetails_new")] public static extern long NodeAnnouncementDetails_new(long _features_arg, int _last_update_arg, long _rgb_arg, long _alias_arg, long _addresses_arg); + // uint64_t NodeAnnouncementDetails_clone_ptr(LDKNodeAnnouncementDetails *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementDetails_clone_ptr")] public static extern long NodeAnnouncementDetails_clone_ptr(long _arg); + // struct LDKNodeAnnouncementDetails NodeAnnouncementDetails_clone(const struct LDKNodeAnnouncementDetails *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementDetails_clone")] public static extern long NodeAnnouncementDetails_clone(long _orig); + // bool NodeAnnouncementDetails_eq(const struct LDKNodeAnnouncementDetails *NONNULL_PTR a, const struct LDKNodeAnnouncementDetails *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementDetails_eq")] public static extern bool NodeAnnouncementDetails_eq(long _a, long _b); + // void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_free")] public static extern void NodeAnnouncementInfo_free(long _this_ptr); // uint64_t NodeAnnouncementInfo_clone_ptr(LDKNodeAnnouncementInfo *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_clone_ptr")] public static extern long NodeAnnouncementInfo_clone_ptr(long _arg); // struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_clone")] public static extern long NodeAnnouncementInfo_clone(long _orig); + // struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_relayed(struct LDKNodeAnnouncement a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_relayed")] public static extern long NodeAnnouncementInfo_relayed(long _a); + // struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_local(struct LDKNodeAnnouncementDetails a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_local")] public static extern long NodeAnnouncementInfo_local(long _a); // bool NodeAnnouncementInfo_eq(const struct LDKNodeAnnouncementInfo *NONNULL_PTR a, const struct LDKNodeAnnouncementInfo *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_eq")] public static extern bool NodeAnnouncementInfo_eq(long _a, long _b); + // MUST_USE_RES struct LDKNodeFeatures NodeAnnouncementInfo_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_features")] public static extern long NodeAnnouncementInfo_features(long _this_arg); + // MUST_USE_RES uint32_t NodeAnnouncementInfo_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_last_update")] public static extern int NodeAnnouncementInfo_last_update(long _this_arg); + // MUST_USE_RES struct LDKThreeBytes NodeAnnouncementInfo_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_rgb")] public static extern long NodeAnnouncementInfo_rgb(long _this_arg); + // MUST_USE_RES struct LDKNodeAlias NodeAnnouncementInfo_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_alias")] public static extern long NodeAnnouncementInfo_alias(long _this_arg); // MUST_USE_RES struct LDKCVec_SocketAddressZ NodeAnnouncementInfo_addresses(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_addresses")] public static extern long NodeAnnouncementInfo_addresses(long _this_arg); + // MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncementInfo_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_announcement_message")] public static extern long NodeAnnouncementInfo_announcement_message(long _this_arg); // struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_write")] public static extern long NodeAnnouncementInfo_write(long _obj); // struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser); @@ -12498,12 +12337,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeInfo_get_channels")] public static extern long NodeInfo_get_channels(long _this_ptr); // void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeInfo_set_channels")] public static extern void NodeInfo_set_channels(long _this_ptr, long _val); - // struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr); + // struct LDKCOption_NodeAnnouncementInfoZ NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeInfo_get_announcement_info")] public static extern long NodeInfo_get_announcement_info(long _this_ptr); - // void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val); + // void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCOption_NodeAnnouncementInfoZ val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeInfo_set_announcement_info")] public static extern void NodeInfo_set_announcement_info(long _this_ptr, long _val); - // MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKNodeAnnouncementInfo announcement_info_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeInfo_new")] public static extern long NodeInfo_new(long _channels_arg, long _announcement_info_arg); // uint64_t NodeInfo_clone_ptr(LDKNodeInfo *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeInfo_clone_ptr")] public static extern long NodeInfo_clone_ptr(long _arg); // struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig); @@ -12760,6 +12597,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteParameters_eq")] public static extern bool RouteParameters_eq(long _a, long _b); // MUST_USE_RES struct LDKRouteParameters RouteParameters_from_payment_params_and_value(struct LDKPaymentParameters payment_params, uint64_t final_value_msat); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteParameters_from_payment_params_and_value")] public static extern long RouteParameters_from_payment_params_and_value(long _payment_params, long _final_value_msat); + // MUST_USE_RES struct LDKCResult_NoneNoneZ RouteParameters_set_max_path_length(struct LDKRouteParameters *NONNULL_PTR this_arg, const struct LDKRecipientOnionFields *NONNULL_PTR recipient_onion, bool is_keysend, uint32_t best_block_height); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteParameters_set_max_path_length")] public static extern long RouteParameters_set_max_path_length(long _this_arg, long _recipient_onion, bool _is_keysend, int _best_block_height); // struct LDKCVec_u8Z RouteParameters_write(const struct LDKRouteParameters *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteParameters_write")] public static extern long RouteParameters_write(long _obj); // struct LDKCResult_RouteParametersDecodeErrorZ RouteParameters_read(struct LDKu8slice ser); @@ -12782,6 +12621,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_get_max_path_count")] public static extern byte PaymentParameters_get_max_path_count(long _this_ptr); // void PaymentParameters_set_max_path_count(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_set_max_path_count")] public static extern void PaymentParameters_set_max_path_count(long _this_ptr, byte _val); + // uint8_t PaymentParameters_get_max_path_length(const struct LDKPaymentParameters *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_get_max_path_length")] public static extern byte PaymentParameters_get_max_path_length(long _this_ptr); + // void PaymentParameters_set_max_path_length(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_set_max_path_length")] public static extern void PaymentParameters_set_max_path_length(long _this_ptr, byte _val); // uint8_t PaymentParameters_get_max_channel_saturation_power_of_half(const struct LDKPaymentParameters *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_get_max_channel_saturation_power_of_half")] public static extern byte PaymentParameters_get_max_channel_saturation_power_of_half(long _this_ptr); // void PaymentParameters_set_max_channel_saturation_power_of_half(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val); @@ -12794,8 +12637,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_get_previously_failed_blinded_path_idxs")] public static extern long PaymentParameters_get_previously_failed_blinded_path_idxs(long _this_ptr); // void PaymentParameters_set_previously_failed_blinded_path_idxs(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_set_previously_failed_blinded_path_idxs")] public static extern void PaymentParameters_set_previously_failed_blinded_path_idxs(long _this_ptr, long _val); - // MUST_USE_RES struct LDKPaymentParameters PaymentParameters_new(struct LDKPayee payee_arg, struct LDKCOption_u64Z expiry_time_arg, uint32_t max_total_cltv_expiry_delta_arg, uint8_t max_path_count_arg, uint8_t max_channel_saturation_power_of_half_arg, struct LDKCVec_u64Z previously_failed_channels_arg, struct LDKCVec_u64Z previously_failed_blinded_path_idxs_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_new")] public static extern long PaymentParameters_new(long _payee_arg, long _expiry_time_arg, int _max_total_cltv_expiry_delta_arg, byte _max_path_count_arg, byte _max_channel_saturation_power_of_half_arg, long _previously_failed_channels_arg, long _previously_failed_blinded_path_idxs_arg); + // MUST_USE_RES struct LDKPaymentParameters PaymentParameters_new(struct LDKPayee payee_arg, struct LDKCOption_u64Z expiry_time_arg, uint32_t max_total_cltv_expiry_delta_arg, uint8_t max_path_count_arg, uint8_t max_path_length_arg, uint8_t max_channel_saturation_power_of_half_arg, struct LDKCVec_u64Z previously_failed_channels_arg, struct LDKCVec_u64Z previously_failed_blinded_path_idxs_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_new")] public static extern long PaymentParameters_new(long _payee_arg, long _expiry_time_arg, int _max_total_cltv_expiry_delta_arg, byte _max_path_count_arg, byte _max_path_length_arg, byte _max_channel_saturation_power_of_half_arg, long _previously_failed_channels_arg, long _previously_failed_blinded_path_idxs_arg); // uint64_t PaymentParameters_clone_ptr(LDKPaymentParameters *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_clone_ptr")] public static extern long PaymentParameters_clone_ptr(long _arg); // struct LDKPaymentParameters PaymentParameters_clone(const struct LDKPaymentParameters *NONNULL_PTR orig); @@ -12814,7 +12657,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_for_keysend")] public static extern long PaymentParameters_for_keysend(long _payee_pubkey, int _final_cltv_expiry_delta, bool _allow_mpp); // MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_bolt12_invoice(const struct LDKBolt12Invoice *NONNULL_PTR invoice); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_from_bolt12_invoice")] public static extern long PaymentParameters_from_bolt12_invoice(long _invoice); - // MUST_USE_RES struct LDKPaymentParameters PaymentParameters_blinded(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ blinded_route_hints); + // MUST_USE_RES struct LDKPaymentParameters PaymentParameters_blinded(struct LDKCVec_BlindedPaymentPathZ blinded_route_hints); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_blinded")] public static extern long PaymentParameters_blinded(long _blinded_route_hints); // void Payee_free(struct LDKPayee this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Payee_free")] public static extern void Payee_free(long _this_ptr); @@ -12822,7 +12665,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Payee_clone_ptr")] public static extern long Payee_clone_ptr(long _arg); // struct LDKPayee Payee_clone(const struct LDKPayee *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Payee_clone")] public static extern long Payee_clone(long _orig); - // struct LDKPayee Payee_blinded(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ route_hints, struct LDKBolt12InvoiceFeatures features); + // struct LDKPayee Payee_blinded(struct LDKCVec_BlindedPaymentPathZ route_hints, struct LDKBolt12InvoiceFeatures features); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Payee_blinded")] public static extern long Payee_blinded(long _route_hints, long _features); // struct LDKPayee Payee_clear(struct LDKPublicKey node_id, struct LDKCVec_RouteHintZ route_hints, struct LDKBolt11InvoiceFeatures features, uint32_t final_cltv_expiry_delta); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Payee_clear")] public static extern long Payee_clear(long _node_id, long _route_hints, long _features, int _final_cltv_expiry_delta); @@ -12830,62 +12673,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Payee_hash")] public static extern long Payee_hash(long _o); // bool Payee_eq(const struct LDKPayee *NONNULL_PTR a, const struct LDKPayee *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Payee_eq")] public static extern bool Payee_eq(long _a, long _b); - // void RouteHint_free(struct LDKRouteHint this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHint_free")] public static extern void RouteHint_free(long _this_obj); - // struct LDKCVec_RouteHintHopZ RouteHint_get_a(const struct LDKRouteHint *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHint_get_a")] public static extern long RouteHint_get_a(long _this_ptr); - // void RouteHint_set_a(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintHopZ val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHint_set_a")] public static extern void RouteHint_set_a(long _this_ptr, long _val); - // MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHint_new")] public static extern long RouteHint_new(long _a_arg); - // uint64_t RouteHint_clone_ptr(LDKRouteHint *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHint_clone_ptr")] public static extern long RouteHint_clone_ptr(long _arg); - // struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHint_clone")] public static extern long RouteHint_clone(long _orig); - // uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHint_hash")] public static extern long RouteHint_hash(long _o); - // bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHint_eq")] public static extern bool RouteHint_eq(long _a, long _b); // struct LDKCVec_u8Z RouteHint_write(const struct LDKRouteHint *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHint_write")] public static extern long RouteHint_write(long _obj); // struct LDKCResult_RouteHintDecodeErrorZ RouteHint_read(struct LDKu8slice ser); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHint_read")] public static extern long RouteHint_read(long _ser); - // void RouteHintHop_free(struct LDKRouteHintHop this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_free")] public static extern void RouteHintHop_free(long _this_obj); - // struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_get_src_node_id")] public static extern long RouteHintHop_get_src_node_id(long _this_ptr); - // void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_set_src_node_id")] public static extern void RouteHintHop_set_src_node_id(long _this_ptr, long _val); - // uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_get_short_channel_id")] public static extern long RouteHintHop_get_short_channel_id(long _this_ptr); - // void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_set_short_channel_id")] public static extern void RouteHintHop_set_short_channel_id(long _this_ptr, long _val); - // struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_get_fees")] public static extern long RouteHintHop_get_fees(long _this_ptr); - // void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_set_fees")] public static extern void RouteHintHop_set_fees(long _this_ptr, long _val); - // uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_get_cltv_expiry_delta")] public static extern short RouteHintHop_get_cltv_expiry_delta(long _this_ptr); - // void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_set_cltv_expiry_delta")] public static extern void RouteHintHop_set_cltv_expiry_delta(long _this_ptr, short _val); - // struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_get_htlc_minimum_msat")] public static extern long RouteHintHop_get_htlc_minimum_msat(long _this_ptr); - // void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_set_htlc_minimum_msat")] public static extern void RouteHintHop_set_htlc_minimum_msat(long _this_ptr, long _val); - // struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_get_htlc_maximum_msat")] public static extern long RouteHintHop_get_htlc_maximum_msat(long _this_ptr); - // void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_set_htlc_maximum_msat")] public static extern void RouteHintHop_set_htlc_maximum_msat(long _this_ptr, long _val); - // MUST_USE_RES struct LDKRouteHintHop RouteHintHop_new(struct LDKPublicKey src_node_id_arg, uint64_t short_channel_id_arg, struct LDKRoutingFees fees_arg, uint16_t cltv_expiry_delta_arg, struct LDKCOption_u64Z htlc_minimum_msat_arg, struct LDKCOption_u64Z htlc_maximum_msat_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_new")] public static extern long RouteHintHop_new(long _src_node_id_arg, long _short_channel_id_arg, long _fees_arg, short _cltv_expiry_delta_arg, long _htlc_minimum_msat_arg, long _htlc_maximum_msat_arg); - // uint64_t RouteHintHop_clone_ptr(LDKRouteHintHop *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_clone_ptr")] public static extern long RouteHintHop_clone_ptr(long _arg); - // struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_clone")] public static extern long RouteHintHop_clone(long _orig); - // uint64_t RouteHintHop_hash(const struct LDKRouteHintHop *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_hash")] public static extern long RouteHintHop_hash(long _o); - // bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_eq")] public static extern bool RouteHintHop_eq(long _a, long _b); // struct LDKCVec_u8Z RouteHintHop_write(const struct LDKRouteHintHop *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_write")] public static extern long RouteHintHop_write(long _obj); // struct LDKCResult_RouteHintHopDecodeErrorZ RouteHintHop_read(struct LDKu8slice ser); @@ -13312,7 +13103,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDescriptor_witness_script")] public static extern long HTLCDescriptor_witness_script(long _this_arg); // MUST_USE_RES struct LDKWitness HTLCDescriptor_tx_input_witness(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg, struct LDKECDSASignature signature, struct LDKu8slice witness_script); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDescriptor_tx_input_witness")] public static extern long HTLCDescriptor_tx_input_witness(long _this_arg, long _signature, long _witness_script); - // MUST_USE_RES struct LDKWriteableEcdsaChannelSigner HTLCDescriptor_derive_channel_signer(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider); + // MUST_USE_RES struct LDKEcdsaChannelSigner HTLCDescriptor_derive_channel_signer(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDescriptor_derive_channel_signer")] public static extern long HTLCDescriptor_derive_channel_signer(long _this_arg, long _signer_provider); // void ChannelSigner_free(struct LDKChannelSigner this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelSigner_free")] public static extern void ChannelSigner_free(long _this_ptr); @@ -13388,8 +13179,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_as_ChannelSigner")] public static extern long InMemorySigner_as_ChannelSigner(long _this_arg); // struct LDKEcdsaChannelSigner InMemorySigner_as_EcdsaChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_as_EcdsaChannelSigner")] public static extern long InMemorySigner_as_EcdsaChannelSigner(long _this_arg); - // struct LDKWriteableEcdsaChannelSigner InMemorySigner_as_WriteableEcdsaChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_as_WriteableEcdsaChannelSigner")] public static extern long InMemorySigner_as_WriteableEcdsaChannelSigner(long _this_arg); // struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_write")] public static extern long InMemorySigner_write(long _obj); // struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser, struct LDKEntropySource arg); @@ -13436,16 +13225,104 @@ internal class bindings { [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); + // uint64_t EcdsaChannelSigner_clone_ptr(LDKEcdsaChannelSigner *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EcdsaChannelSigner_clone_ptr")] public static extern long EcdsaChannelSigner_clone_ptr(long _arg); + // struct LDKEcdsaChannelSigner EcdsaChannelSigner_clone(const struct LDKEcdsaChannelSigner *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EcdsaChannelSigner_clone")] public static extern long EcdsaChannelSigner_clone(long _orig); // 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); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WriteableEcdsaChannelSigner_clone_ptr")] public static extern long WriteableEcdsaChannelSigner_clone_ptr(long _arg); - // struct LDKWriteableEcdsaChannelSigner WriteableEcdsaChannelSigner_clone(const struct LDKWriteableEcdsaChannelSigner *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WriteableEcdsaChannelSigner_clone")] public static extern long WriteableEcdsaChannelSigner_clone(long _orig); - // void WriteableEcdsaChannelSigner_free(struct LDKWriteableEcdsaChannelSigner this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WriteableEcdsaChannelSigner_free")] public static extern void WriteableEcdsaChannelSigner_free(long _this_ptr); + // void AsyncPaymentsMessageHandler_free(struct LDKAsyncPaymentsMessageHandler this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AsyncPaymentsMessageHandler_free")] public static extern void AsyncPaymentsMessageHandler_free(long _this_ptr); + // void AsyncPaymentsMessage_free(struct LDKAsyncPaymentsMessage this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AsyncPaymentsMessage_free")] public static extern void AsyncPaymentsMessage_free(long _this_ptr); + // uint64_t AsyncPaymentsMessage_clone_ptr(LDKAsyncPaymentsMessage *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AsyncPaymentsMessage_clone_ptr")] public static extern long AsyncPaymentsMessage_clone_ptr(long _arg); + // struct LDKAsyncPaymentsMessage AsyncPaymentsMessage_clone(const struct LDKAsyncPaymentsMessage *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AsyncPaymentsMessage_clone")] public static extern long AsyncPaymentsMessage_clone(long _orig); + // struct LDKAsyncPaymentsMessage AsyncPaymentsMessage_held_htlc_available(struct LDKHeldHtlcAvailable a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AsyncPaymentsMessage_held_htlc_available")] public static extern long AsyncPaymentsMessage_held_htlc_available(long _a); + // struct LDKAsyncPaymentsMessage AsyncPaymentsMessage_release_held_htlc(struct LDKReleaseHeldHtlc a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AsyncPaymentsMessage_release_held_htlc")] public static extern long AsyncPaymentsMessage_release_held_htlc(long _a); + // void HeldHtlcAvailable_free(struct LDKHeldHtlcAvailable this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HeldHtlcAvailable_free")] public static extern void HeldHtlcAvailable_free(long _this_obj); + // const uint8_t (*HeldHtlcAvailable_get_payment_release_secret(const struct LDKHeldHtlcAvailable *NONNULL_PTR this_ptr))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HeldHtlcAvailable_get_payment_release_secret")] public static extern long HeldHtlcAvailable_get_payment_release_secret(long _this_ptr); + // void HeldHtlcAvailable_set_payment_release_secret(struct LDKHeldHtlcAvailable *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HeldHtlcAvailable_set_payment_release_secret")] public static extern void HeldHtlcAvailable_set_payment_release_secret(long _this_ptr, long _val); + // MUST_USE_RES struct LDKHeldHtlcAvailable HeldHtlcAvailable_new(struct LDKThirtyTwoBytes payment_release_secret_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HeldHtlcAvailable_new")] public static extern long HeldHtlcAvailable_new(long _payment_release_secret_arg); + // uint64_t HeldHtlcAvailable_clone_ptr(LDKHeldHtlcAvailable *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HeldHtlcAvailable_clone_ptr")] public static extern long HeldHtlcAvailable_clone_ptr(long _arg); + // struct LDKHeldHtlcAvailable HeldHtlcAvailable_clone(const struct LDKHeldHtlcAvailable *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HeldHtlcAvailable_clone")] public static extern long HeldHtlcAvailable_clone(long _orig); + // void ReleaseHeldHtlc_free(struct LDKReleaseHeldHtlc this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReleaseHeldHtlc_free")] public static extern void ReleaseHeldHtlc_free(long _this_obj); + // const uint8_t (*ReleaseHeldHtlc_get_payment_release_secret(const struct LDKReleaseHeldHtlc *NONNULL_PTR this_ptr))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReleaseHeldHtlc_get_payment_release_secret")] public static extern long ReleaseHeldHtlc_get_payment_release_secret(long _this_ptr); + // void ReleaseHeldHtlc_set_payment_release_secret(struct LDKReleaseHeldHtlc *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReleaseHeldHtlc_set_payment_release_secret")] public static extern void ReleaseHeldHtlc_set_payment_release_secret(long _this_ptr, long _val); + // MUST_USE_RES struct LDKReleaseHeldHtlc ReleaseHeldHtlc_new(struct LDKThirtyTwoBytes payment_release_secret_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReleaseHeldHtlc_new")] public static extern long ReleaseHeldHtlc_new(long _payment_release_secret_arg); + // uint64_t ReleaseHeldHtlc_clone_ptr(LDKReleaseHeldHtlc *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReleaseHeldHtlc_clone_ptr")] public static extern long ReleaseHeldHtlc_clone_ptr(long _arg); + // struct LDKReleaseHeldHtlc ReleaseHeldHtlc_clone(const struct LDKReleaseHeldHtlc *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReleaseHeldHtlc_clone")] public static extern long ReleaseHeldHtlc_clone(long _orig); + // struct LDKOnionMessageContents ReleaseHeldHtlc_as_OnionMessageContents(const struct LDKReleaseHeldHtlc *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReleaseHeldHtlc_as_OnionMessageContents")] public static extern long ReleaseHeldHtlc_as_OnionMessageContents(long _this_arg); + // struct LDKCVec_u8Z HeldHtlcAvailable_write(const struct LDKHeldHtlcAvailable *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HeldHtlcAvailable_write")] public static extern long HeldHtlcAvailable_write(long _obj); + // struct LDKCResult_HeldHtlcAvailableDecodeErrorZ HeldHtlcAvailable_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HeldHtlcAvailable_read")] public static extern long HeldHtlcAvailable_read(long _ser); + // struct LDKCVec_u8Z ReleaseHeldHtlc_write(const struct LDKReleaseHeldHtlc *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReleaseHeldHtlc_write")] public static extern long ReleaseHeldHtlc_write(long _obj); + // struct LDKCResult_ReleaseHeldHtlcDecodeErrorZ ReleaseHeldHtlc_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReleaseHeldHtlc_read")] public static extern long ReleaseHeldHtlc_read(long _ser); + // MUST_USE_RES bool AsyncPaymentsMessage_is_known_type(uint64_t tlv_type); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AsyncPaymentsMessage_is_known_type")] public static extern bool AsyncPaymentsMessage_is_known_type(long _tlv_type); + // struct LDKOnionMessageContents AsyncPaymentsMessage_as_OnionMessageContents(const struct LDKAsyncPaymentsMessage *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AsyncPaymentsMessage_as_OnionMessageContents")] public static extern long AsyncPaymentsMessage_as_OnionMessageContents(long _this_arg); + // struct LDKCVec_u8Z AsyncPaymentsMessage_write(const struct LDKAsyncPaymentsMessage *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AsyncPaymentsMessage_write")] public static extern long AsyncPaymentsMessage_write(long _obj); + // struct LDKCResult_AsyncPaymentsMessageDecodeErrorZ AsyncPaymentsMessage_read(struct LDKu8slice ser, uint64_t arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AsyncPaymentsMessage_read")] public static extern long AsyncPaymentsMessage_read(long _ser, long _arg); // void OnionMessenger_free(struct LDKOnionMessenger this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessenger_free")] public static extern void OnionMessenger_free(long _this_obj); + // void Responder_free(struct LDKResponder this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Responder_free")] public static extern void Responder_free(long _this_obj); + // uint64_t Responder_clone_ptr(LDKResponder *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Responder_clone_ptr")] public static extern long Responder_clone_ptr(long _arg); + // struct LDKResponder Responder_clone(const struct LDKResponder *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Responder_clone")] public static extern long Responder_clone(long _orig); + // bool Responder_eq(const struct LDKResponder *NONNULL_PTR a, const struct LDKResponder *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Responder_eq")] public static extern bool Responder_eq(long _a, long _b); + // struct LDKCVec_u8Z Responder_write(const struct LDKResponder *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Responder_write")] public static extern long Responder_write(long _obj); + // struct LDKCResult_ResponderDecodeErrorZ Responder_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Responder_read")] public static extern long Responder_read(long _ser); + // MUST_USE_RES struct LDKResponseInstruction Responder_respond(struct LDKResponder this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Responder_respond")] public static extern long Responder_respond(long _this_arg); + // MUST_USE_RES struct LDKResponseInstruction Responder_respond_with_reply_path(struct LDKResponder this_arg, struct LDKMessageContext context); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Responder_respond_with_reply_path")] public static extern long Responder_respond_with_reply_path(long _this_arg, long _context); + // void ResponseInstruction_free(struct LDKResponseInstruction this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ResponseInstruction_free")] public static extern void ResponseInstruction_free(long _this_obj); + // uint64_t ResponseInstruction_clone_ptr(LDKResponseInstruction *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ResponseInstruction_clone_ptr")] public static extern long ResponseInstruction_clone_ptr(long _arg); + // struct LDKResponseInstruction ResponseInstruction_clone(const struct LDKResponseInstruction *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ResponseInstruction_clone")] public static extern long ResponseInstruction_clone(long _orig); + // void MessageSendInstructions_free(struct LDKMessageSendInstructions this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendInstructions_free")] public static extern void MessageSendInstructions_free(long _this_ptr); + // uint64_t MessageSendInstructions_clone_ptr(LDKMessageSendInstructions *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendInstructions_clone_ptr")] public static extern long MessageSendInstructions_clone_ptr(long _arg); + // struct LDKMessageSendInstructions MessageSendInstructions_clone(const struct LDKMessageSendInstructions *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendInstructions_clone")] public static extern long MessageSendInstructions_clone(long _orig); + // struct LDKMessageSendInstructions MessageSendInstructions_with_specified_reply_path(struct LDKDestination destination, struct LDKBlindedMessagePath reply_path); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendInstructions_with_specified_reply_path")] public static extern long MessageSendInstructions_with_specified_reply_path(long _destination, long _reply_path); + // struct LDKMessageSendInstructions MessageSendInstructions_with_reply_path(struct LDKDestination destination, struct LDKMessageContext context); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendInstructions_with_reply_path")] public static extern long MessageSendInstructions_with_reply_path(long _destination, long _context); + // struct LDKMessageSendInstructions MessageSendInstructions_without_reply_path(struct LDKDestination destination); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendInstructions_without_reply_path")] public static extern long MessageSendInstructions_without_reply_path(long _destination); + // struct LDKMessageSendInstructions MessageSendInstructions_for_reply(struct LDKResponseInstruction instructions); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendInstructions_for_reply")] public static extern long MessageSendInstructions_for_reply(long _instructions); // void MessageRouter_free(struct LDKMessageRouter this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageRouter_free")] public static extern void MessageRouter_free(long _this_ptr); // void DefaultMessageRouter_free(struct LDKDefaultMessageRouter this_obj); @@ -13484,7 +13361,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Destination_clone")] public static extern long Destination_clone(long _orig); // struct LDKDestination Destination_node(struct LDKPublicKey a); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Destination_node")] public static extern long Destination_node(long _a); - // struct LDKDestination Destination_blinded_path(struct LDKBlindedPath a); + // struct LDKDestination Destination_blinded_path(struct LDKBlindedMessagePath 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); @@ -13546,18 +13423,28 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeeledOnion_clone")] public static extern long PeeledOnion_clone(long _orig); // 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); + // struct LDKPeeledOnion PeeledOnion_receive(struct LDKParsedOnionMessageContents a, struct LDKCOption_MessageContextZ b, struct LDKBlindedMessagePath 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_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); + // 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 LDKBlindedMessagePath 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); + // 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 LDKBlindedMessagePath 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 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); + // 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 LDKAsyncPaymentsMessageHandler async_payments_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 _async_payments_handler, long _custom_handler); + // MUST_USE_RES struct LDKOnionMessenger OnionMessenger_new_with_offline_peer_interception(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 LDKAsyncPaymentsMessageHandler async_payments_handler, struct LDKCustomOnionMessageHandler custom_handler); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessenger_new_with_offline_peer_interception")] public static extern long OnionMessenger_new_with_offline_peer_interception(long _entropy_source, long _node_signer, long _logger, long _node_id_lookup, long _message_router, long _offers_handler, long _async_payments_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 LDKMessageSendInstructions instructions); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessenger_send_onion_message")] public static extern long OnionMessenger_send_onion_message(long _this_arg, long _contents, long _instructions); + // MUST_USE_RES struct LDKCResult_NoneSendErrorZ OnionMessenger_forward_onion_message(const struct LDKOnionMessenger *NONNULL_PTR this_arg, struct LDKOnionMessage message, struct LDKPublicKey peer_node_id); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessenger_forward_onion_message")] public static extern long OnionMessenger_forward_onion_message(long _this_arg, long _message, long _peer_node_id); + // MUST_USE_RES struct LDKCResult_SendSuccessSendErrorZ OnionMessenger_handle_onion_message_response(const struct LDKOnionMessenger *NONNULL_PTR this_arg, struct LDKOnionMessageContents response, struct LDKResponseInstruction instructions); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessenger_handle_onion_message_response")] public static extern long OnionMessenger_handle_onion_message_response(long _this_arg, long _response, long _instructions); + // MUST_USE_RES struct LDKFuture OnionMessenger_get_update_future(const struct LDKOnionMessenger *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessenger_get_update_future")] public static extern long OnionMessenger_get_update_future(long _this_arg); + // struct LDKEventsProvider OnionMessenger_as_EventsProvider(const struct LDKOnionMessenger *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessenger_as_EventsProvider")] public static extern long OnionMessenger_as_EventsProvider(long _this_arg); // struct LDKOnionMessageHandler OnionMessenger_as_OnionMessageHandler(const struct LDKOnionMessenger *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessenger_as_OnionMessageHandler")] public static extern long OnionMessenger_as_OnionMessageHandler(long _this_arg); // void OffersMessageHandler_free(struct LDKOffersMessageHandler this_ptr); @@ -13632,44 +13519,6 @@ 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 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); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_set_blinding_point")] public static extern void BlindedPath_set_blinding_point(long _this_ptr, long _val); - // struct LDKCVec_BlindedHopZ BlindedPath_get_blinded_hops(const struct LDKBlindedPath *NONNULL_PTR this_ptr); - [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 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); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_clone")] public static extern long BlindedPath_clone(long _orig); - // uint64_t BlindedPath_hash(const struct LDKBlindedPath *NONNULL_PTR o); - [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); @@ -13722,44 +13571,98 @@ 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, 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, 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, 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); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_read")] public static extern long BlindedPath_read(long _ser); // struct LDKCVec_u8Z BlindedHop_write(const struct LDKBlindedHop *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHop_write")] public static extern long BlindedHop_write(long _obj); // struct LDKCResult_BlindedHopDecodeErrorZ BlindedHop_read(struct LDKu8slice ser); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHop_read")] public static extern long BlindedHop_read(long _ser); - // void ForwardNode_free(struct LDKForwardNode this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ForwardNode_free")] public static extern void ForwardNode_free(long _this_obj); - // struct LDKForwardTlvs ForwardNode_get_tlvs(const struct LDKForwardNode *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ForwardNode_get_tlvs")] public static extern long ForwardNode_get_tlvs(long _this_ptr); - // void ForwardNode_set_tlvs(struct LDKForwardNode *NONNULL_PTR this_ptr, struct LDKForwardTlvs val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ForwardNode_set_tlvs")] public static extern void ForwardNode_set_tlvs(long _this_ptr, long _val); - // struct LDKPublicKey ForwardNode_get_node_id(const struct LDKForwardNode *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ForwardNode_get_node_id")] public static extern long ForwardNode_get_node_id(long _this_ptr); - // void ForwardNode_set_node_id(struct LDKForwardNode *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ForwardNode_set_node_id")] public static extern void ForwardNode_set_node_id(long _this_ptr, long _val); - // uint64_t ForwardNode_get_htlc_maximum_msat(const struct LDKForwardNode *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ForwardNode_get_htlc_maximum_msat")] public static extern long ForwardNode_get_htlc_maximum_msat(long _this_ptr); - // void ForwardNode_set_htlc_maximum_msat(struct LDKForwardNode *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ForwardNode_set_htlc_maximum_msat")] public static extern void ForwardNode_set_htlc_maximum_msat(long _this_ptr, long _val); - // MUST_USE_RES struct LDKForwardNode ForwardNode_new(struct LDKForwardTlvs tlvs_arg, struct LDKPublicKey node_id_arg, uint64_t htlc_maximum_msat_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ForwardNode_new")] public static extern long ForwardNode_new(long _tlvs_arg, long _node_id_arg, long _htlc_maximum_msat_arg); - // uint64_t ForwardNode_clone_ptr(LDKForwardNode *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ForwardNode_clone_ptr")] public static extern long ForwardNode_clone_ptr(long _arg); - // struct LDKForwardNode ForwardNode_clone(const struct LDKForwardNode *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ForwardNode_clone")] public static extern long ForwardNode_clone(long _orig); + // void BlindedPayInfo_free(struct LDKBlindedPayInfo this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_free")] public static extern void BlindedPayInfo_free(long _this_obj); + // uint32_t BlindedPayInfo_get_fee_base_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_get_fee_base_msat")] public static extern int BlindedPayInfo_get_fee_base_msat(long _this_ptr); + // void BlindedPayInfo_set_fee_base_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_set_fee_base_msat")] public static extern void BlindedPayInfo_set_fee_base_msat(long _this_ptr, int _val); + // uint32_t BlindedPayInfo_get_fee_proportional_millionths(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_get_fee_proportional_millionths")] public static extern int BlindedPayInfo_get_fee_proportional_millionths(long _this_ptr); + // void BlindedPayInfo_set_fee_proportional_millionths(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_set_fee_proportional_millionths")] public static extern void BlindedPayInfo_set_fee_proportional_millionths(long _this_ptr, int _val); + // uint16_t BlindedPayInfo_get_cltv_expiry_delta(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_get_cltv_expiry_delta")] public static extern short BlindedPayInfo_get_cltv_expiry_delta(long _this_ptr); + // void BlindedPayInfo_set_cltv_expiry_delta(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint16_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_set_cltv_expiry_delta")] public static extern void BlindedPayInfo_set_cltv_expiry_delta(long _this_ptr, short _val); + // uint64_t BlindedPayInfo_get_htlc_minimum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_get_htlc_minimum_msat")] public static extern long BlindedPayInfo_get_htlc_minimum_msat(long _this_ptr); + // void BlindedPayInfo_set_htlc_minimum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_set_htlc_minimum_msat")] public static extern void BlindedPayInfo_set_htlc_minimum_msat(long _this_ptr, long _val); + // uint64_t BlindedPayInfo_get_htlc_maximum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_get_htlc_maximum_msat")] public static extern long BlindedPayInfo_get_htlc_maximum_msat(long _this_ptr); + // void BlindedPayInfo_set_htlc_maximum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_set_htlc_maximum_msat")] public static extern void BlindedPayInfo_set_htlc_maximum_msat(long _this_ptr, long _val); + // struct LDKBlindedHopFeatures BlindedPayInfo_get_features(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_get_features")] public static extern long BlindedPayInfo_get_features(long _this_ptr); + // void BlindedPayInfo_set_features(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, struct LDKBlindedHopFeatures val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_set_features")] public static extern void BlindedPayInfo_set_features(long _this_ptr, long _val); + // MUST_USE_RES struct LDKBlindedPayInfo BlindedPayInfo_new(uint32_t fee_base_msat_arg, uint32_t fee_proportional_millionths_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg, uint64_t htlc_maximum_msat_arg, struct LDKBlindedHopFeatures features_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_new")] public static extern long BlindedPayInfo_new(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, long _features_arg); + // uint64_t BlindedPayInfo_clone_ptr(LDKBlindedPayInfo *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_clone_ptr")] public static extern long BlindedPayInfo_clone_ptr(long _arg); + // struct LDKBlindedPayInfo BlindedPayInfo_clone(const struct LDKBlindedPayInfo *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_clone")] public static extern long BlindedPayInfo_clone(long _orig); + // uint64_t BlindedPayInfo_hash(const struct LDKBlindedPayInfo *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_hash")] public static extern long BlindedPayInfo_hash(long _o); + // bool BlindedPayInfo_eq(const struct LDKBlindedPayInfo *NONNULL_PTR a, const struct LDKBlindedPayInfo *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_eq")] public static extern bool BlindedPayInfo_eq(long _a, long _b); + // struct LDKCVec_u8Z BlindedPayInfo_write(const struct LDKBlindedPayInfo *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_write")] public static extern long BlindedPayInfo_write(long _obj); + // struct LDKCResult_BlindedPayInfoDecodeErrorZ BlindedPayInfo_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_read")] public static extern long BlindedPayInfo_read(long _ser); + // void BlindedPaymentPath_free(struct LDKBlindedPaymentPath this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPaymentPath_free")] public static extern void BlindedPaymentPath_free(long _this_obj); + // struct LDKBlindedPayInfo BlindedPaymentPath_get_payinfo(const struct LDKBlindedPaymentPath *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPaymentPath_get_payinfo")] public static extern long BlindedPaymentPath_get_payinfo(long _this_ptr); + // void BlindedPaymentPath_set_payinfo(struct LDKBlindedPaymentPath *NONNULL_PTR this_ptr, struct LDKBlindedPayInfo val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPaymentPath_set_payinfo")] public static extern void BlindedPaymentPath_set_payinfo(long _this_ptr, long _val); + // uint64_t BlindedPaymentPath_clone_ptr(LDKBlindedPaymentPath *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPaymentPath_clone_ptr")] public static extern long BlindedPaymentPath_clone_ptr(long _arg); + // struct LDKBlindedPaymentPath BlindedPaymentPath_clone(const struct LDKBlindedPaymentPath *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPaymentPath_clone")] public static extern long BlindedPaymentPath_clone(long _orig); + // uint64_t BlindedPaymentPath_hash(const struct LDKBlindedPaymentPath *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPaymentPath_hash")] public static extern long BlindedPaymentPath_hash(long _o); + // bool BlindedPaymentPath_eq(const struct LDKBlindedPaymentPath *NONNULL_PTR a, const struct LDKBlindedPaymentPath *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPaymentPath_eq")] public static extern bool BlindedPaymentPath_eq(long _a, long _b); + // MUST_USE_RES struct LDKCResult_BlindedPaymentPathNoneZ BlindedPaymentPath_one_hop(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_BlindedPaymentPath_one_hop")] public static extern long BlindedPaymentPath_one_hop(long _payee_node_id, long _payee_tlvs, short _min_final_cltv_expiry_delta, long _entropy_source); + // MUST_USE_RES struct LDKCResult_BlindedPaymentPathNoneZ BlindedPaymentPath_new(struct LDKCVec_PaymentForwardNodeZ 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_BlindedPaymentPath_new")] public static extern long BlindedPaymentPath_new(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 BlindedPaymentPath_public_introduction_node_id(const struct LDKBlindedPaymentPath *NONNULL_PTR this_arg, const struct LDKReadOnlyNetworkGraph *NONNULL_PTR network_graph); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPaymentPath_public_introduction_node_id")] public static extern long BlindedPaymentPath_public_introduction_node_id(long _this_arg, long _network_graph); + // MUST_USE_RES struct LDKIntroductionNode BlindedPaymentPath_introduction_node(const struct LDKBlindedPaymentPath *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPaymentPath_introduction_node")] public static extern long BlindedPaymentPath_introduction_node(long _this_arg); + // MUST_USE_RES struct LDKPublicKey BlindedPaymentPath_blinding_point(const struct LDKBlindedPaymentPath *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPaymentPath_blinding_point")] public static extern long BlindedPaymentPath_blinding_point(long _this_arg); + // MUST_USE_RES struct LDKCVec_BlindedHopZ BlindedPaymentPath_blinded_hops(const struct LDKBlindedPaymentPath *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPaymentPath_blinded_hops")] public static extern long BlindedPaymentPath_blinded_hops(long _this_arg); + // MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedPaymentPath_advance_path_by_one(struct LDKBlindedPaymentPath *NONNULL_PTR this_arg, const struct LDKNodeSigner *NONNULL_PTR node_signer, const struct LDKNodeIdLookUp *NONNULL_PTR node_id_lookup); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPaymentPath_advance_path_by_one")] public static extern long BlindedPaymentPath_advance_path_by_one(long _this_arg, long _node_signer, long _node_id_lookup); + // void PaymentForwardNode_free(struct LDKPaymentForwardNode this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentForwardNode_free")] public static extern void PaymentForwardNode_free(long _this_obj); + // struct LDKForwardTlvs PaymentForwardNode_get_tlvs(const struct LDKPaymentForwardNode *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentForwardNode_get_tlvs")] public static extern long PaymentForwardNode_get_tlvs(long _this_ptr); + // void PaymentForwardNode_set_tlvs(struct LDKPaymentForwardNode *NONNULL_PTR this_ptr, struct LDKForwardTlvs val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentForwardNode_set_tlvs")] public static extern void PaymentForwardNode_set_tlvs(long _this_ptr, long _val); + // struct LDKPublicKey PaymentForwardNode_get_node_id(const struct LDKPaymentForwardNode *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentForwardNode_get_node_id")] public static extern long PaymentForwardNode_get_node_id(long _this_ptr); + // void PaymentForwardNode_set_node_id(struct LDKPaymentForwardNode *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentForwardNode_set_node_id")] public static extern void PaymentForwardNode_set_node_id(long _this_ptr, long _val); + // uint64_t PaymentForwardNode_get_htlc_maximum_msat(const struct LDKPaymentForwardNode *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentForwardNode_get_htlc_maximum_msat")] public static extern long PaymentForwardNode_get_htlc_maximum_msat(long _this_ptr); + // void PaymentForwardNode_set_htlc_maximum_msat(struct LDKPaymentForwardNode *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentForwardNode_set_htlc_maximum_msat")] public static extern void PaymentForwardNode_set_htlc_maximum_msat(long _this_ptr, long _val); + // MUST_USE_RES struct LDKPaymentForwardNode PaymentForwardNode_new(struct LDKForwardTlvs tlvs_arg, struct LDKPublicKey node_id_arg, uint64_t htlc_maximum_msat_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentForwardNode_new")] public static extern long PaymentForwardNode_new(long _tlvs_arg, long _node_id_arg, long _htlc_maximum_msat_arg); + // uint64_t PaymentForwardNode_clone_ptr(LDKPaymentForwardNode *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentForwardNode_clone_ptr")] public static extern long PaymentForwardNode_clone_ptr(long _arg); + // struct LDKPaymentForwardNode PaymentForwardNode_clone(const struct LDKPaymentForwardNode *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentForwardNode_clone")] public static extern long PaymentForwardNode_clone(long _orig); // void ForwardTlvs_free(struct LDKForwardTlvs this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ForwardTlvs_free")] public static extern void ForwardTlvs_free(long _this_obj); // uint64_t ForwardTlvs_get_short_channel_id(const struct LDKForwardTlvs *NONNULL_PTR this_ptr); @@ -13778,8 +13681,12 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ForwardTlvs_get_features")] public static extern long ForwardTlvs_get_features(long _this_ptr); // void ForwardTlvs_set_features(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKBlindedHopFeatures val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ForwardTlvs_set_features")] public static extern void ForwardTlvs_set_features(long _this_ptr, long _val); - // MUST_USE_RES struct LDKForwardTlvs ForwardTlvs_new(uint64_t short_channel_id_arg, struct LDKPaymentRelay payment_relay_arg, struct LDKPaymentConstraints payment_constraints_arg, struct LDKBlindedHopFeatures features_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ForwardTlvs_new")] public static extern long ForwardTlvs_new(long _short_channel_id_arg, long _payment_relay_arg, long _payment_constraints_arg, long _features_arg); + // struct LDKPublicKey ForwardTlvs_get_next_blinding_override(const struct LDKForwardTlvs *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ForwardTlvs_get_next_blinding_override")] public static extern long ForwardTlvs_get_next_blinding_override(long _this_ptr); + // void ForwardTlvs_set_next_blinding_override(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ForwardTlvs_set_next_blinding_override")] public static extern void ForwardTlvs_set_next_blinding_override(long _this_ptr, long _val); + // MUST_USE_RES struct LDKForwardTlvs ForwardTlvs_new(uint64_t short_channel_id_arg, struct LDKPaymentRelay payment_relay_arg, struct LDKPaymentConstraints payment_constraints_arg, struct LDKBlindedHopFeatures features_arg, struct LDKPublicKey next_blinding_override_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ForwardTlvs_new")] public static extern long ForwardTlvs_new(long _short_channel_id_arg, long _payment_relay_arg, long _payment_constraints_arg, long _features_arg, long _next_blinding_override_arg); // uint64_t ForwardTlvs_clone_ptr(LDKForwardTlvs *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ForwardTlvs_clone_ptr")] public static extern long ForwardTlvs_clone_ptr(long _arg); // struct LDKForwardTlvs ForwardTlvs_clone(const struct LDKForwardTlvs *NONNULL_PTR orig); @@ -13918,6 +13825,118 @@ internal class bindings { [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 BlindedMessagePath_free(struct LDKBlindedMessagePath this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedMessagePath_free")] public static extern void BlindedMessagePath_free(long _this_obj); + // uint64_t BlindedMessagePath_clone_ptr(LDKBlindedMessagePath *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedMessagePath_clone_ptr")] public static extern long BlindedMessagePath_clone_ptr(long _arg); + // struct LDKBlindedMessagePath BlindedMessagePath_clone(const struct LDKBlindedMessagePath *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedMessagePath_clone")] public static extern long BlindedMessagePath_clone(long _orig); + // uint64_t BlindedMessagePath_hash(const struct LDKBlindedMessagePath *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedMessagePath_hash")] public static extern long BlindedMessagePath_hash(long _o); + // bool BlindedMessagePath_eq(const struct LDKBlindedMessagePath *NONNULL_PTR a, const struct LDKBlindedMessagePath *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedMessagePath_eq")] public static extern bool BlindedMessagePath_eq(long _a, long _b); + // struct LDKCVec_u8Z BlindedMessagePath_write(const struct LDKBlindedMessagePath *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedMessagePath_write")] public static extern long BlindedMessagePath_write(long _obj); + // struct LDKCResult_BlindedMessagePathDecodeErrorZ BlindedMessagePath_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedMessagePath_read")] public static extern long BlindedMessagePath_read(long _ser); + // MUST_USE_RES struct LDKCResult_BlindedMessagePathNoneZ BlindedMessagePath_one_hop(struct LDKPublicKey recipient_node_id, struct LDKMessageContext context, struct LDKEntropySource entropy_source); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedMessagePath_one_hop")] public static extern long BlindedMessagePath_one_hop(long _recipient_node_id, long _context, long _entropy_source); + // MUST_USE_RES struct LDKCResult_BlindedMessagePathNoneZ BlindedMessagePath_new(struct LDKCVec_MessageForwardNodeZ intermediate_nodes, struct LDKPublicKey recipient_node_id, struct LDKMessageContext context, struct LDKEntropySource entropy_source); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedMessagePath_new")] public static extern long BlindedMessagePath_new(long _intermediate_nodes, long _recipient_node_id, long _context, long _entropy_source); + // void BlindedMessagePath_use_compact_introduction_node(struct LDKBlindedMessagePath *NONNULL_PTR this_arg, const struct LDKReadOnlyNetworkGraph *NONNULL_PTR network_graph); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedMessagePath_use_compact_introduction_node")] public static extern void BlindedMessagePath_use_compact_introduction_node(long _this_arg, long _network_graph); + // MUST_USE_RES struct LDKNodeId BlindedMessagePath_public_introduction_node_id(const struct LDKBlindedMessagePath *NONNULL_PTR this_arg, const struct LDKReadOnlyNetworkGraph *NONNULL_PTR network_graph); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedMessagePath_public_introduction_node_id")] public static extern long BlindedMessagePath_public_introduction_node_id(long _this_arg, long _network_graph); + // MUST_USE_RES struct LDKIntroductionNode BlindedMessagePath_introduction_node(const struct LDKBlindedMessagePath *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedMessagePath_introduction_node")] public static extern long BlindedMessagePath_introduction_node(long _this_arg); + // MUST_USE_RES struct LDKPublicKey BlindedMessagePath_blinding_point(const struct LDKBlindedMessagePath *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedMessagePath_blinding_point")] public static extern long BlindedMessagePath_blinding_point(long _this_arg); + // MUST_USE_RES struct LDKCVec_BlindedHopZ BlindedMessagePath_blinded_hops(const struct LDKBlindedMessagePath *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedMessagePath_blinded_hops")] public static extern long BlindedMessagePath_blinded_hops(long _this_arg); + // MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedMessagePath_advance_path_by_one(struct LDKBlindedMessagePath *NONNULL_PTR this_arg, const struct LDKNodeSigner *NONNULL_PTR node_signer, const struct LDKNodeIdLookUp *NONNULL_PTR node_id_lookup); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedMessagePath_advance_path_by_one")] public static extern long BlindedMessagePath_advance_path_by_one(long _this_arg, long _node_signer, long _node_id_lookup); + // 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 MessageForwardNode_free(struct LDKMessageForwardNode this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageForwardNode_free")] public static extern void MessageForwardNode_free(long _this_obj); + // struct LDKPublicKey MessageForwardNode_get_node_id(const struct LDKMessageForwardNode *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageForwardNode_get_node_id")] public static extern long MessageForwardNode_get_node_id(long _this_ptr); + // void MessageForwardNode_set_node_id(struct LDKMessageForwardNode *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageForwardNode_set_node_id")] public static extern void MessageForwardNode_set_node_id(long _this_ptr, long _val); + // struct LDKCOption_u64Z MessageForwardNode_get_short_channel_id(const struct LDKMessageForwardNode *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageForwardNode_get_short_channel_id")] public static extern long MessageForwardNode_get_short_channel_id(long _this_ptr); + // void MessageForwardNode_set_short_channel_id(struct LDKMessageForwardNode *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageForwardNode_set_short_channel_id")] public static extern void MessageForwardNode_set_short_channel_id(long _this_ptr, long _val); + // MUST_USE_RES struct LDKMessageForwardNode MessageForwardNode_new(struct LDKPublicKey node_id_arg, struct LDKCOption_u64Z short_channel_id_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageForwardNode_new")] public static extern long MessageForwardNode_new(long _node_id_arg, long _short_channel_id_arg); + // uint64_t MessageForwardNode_clone_ptr(LDKMessageForwardNode *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageForwardNode_clone_ptr")] public static extern long MessageForwardNode_clone_ptr(long _arg); + // struct LDKMessageForwardNode MessageForwardNode_clone(const struct LDKMessageForwardNode *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageForwardNode_clone")] public static extern long MessageForwardNode_clone(long _orig); + // uint64_t MessageForwardNode_hash(const struct LDKMessageForwardNode *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageForwardNode_hash")] public static extern long MessageForwardNode_hash(long _o); + // bool MessageForwardNode_eq(const struct LDKMessageForwardNode *NONNULL_PTR a, const struct LDKMessageForwardNode *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageForwardNode_eq")] public static extern bool MessageForwardNode_eq(long _a, long _b); + // void MessageContext_free(struct LDKMessageContext this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageContext_free")] public static extern void MessageContext_free(long _this_ptr); + // uint64_t MessageContext_clone_ptr(LDKMessageContext *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageContext_clone_ptr")] public static extern long MessageContext_clone_ptr(long _arg); + // struct LDKMessageContext MessageContext_clone(const struct LDKMessageContext *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageContext_clone")] public static extern long MessageContext_clone(long _orig); + // struct LDKMessageContext MessageContext_offers(struct LDKOffersContext a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageContext_offers")] public static extern long MessageContext_offers(long _a); + // struct LDKMessageContext MessageContext_custom(struct LDKCVec_u8Z a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageContext_custom")] public static extern long MessageContext_custom(long _a); + // void OffersContext_free(struct LDKOffersContext this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OffersContext_free")] public static extern void OffersContext_free(long _this_ptr); + // uint64_t OffersContext_clone_ptr(LDKOffersContext *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OffersContext_clone_ptr")] public static extern long OffersContext_clone_ptr(long _arg); + // struct LDKOffersContext OffersContext_clone(const struct LDKOffersContext *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OffersContext_clone")] public static extern long OffersContext_clone(long _orig); + // struct LDKOffersContext OffersContext_invoice_request(struct LDKNonce nonce); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OffersContext_invoice_request")] public static extern long OffersContext_invoice_request(long _nonce); + // struct LDKOffersContext OffersContext_outbound_payment(struct LDKThirtyTwoBytes payment_id, struct LDKNonce nonce, struct LDKThirtyTwoBytes hmac); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OffersContext_outbound_payment")] public static extern long OffersContext_outbound_payment(long _payment_id, long _nonce, long _hmac); + // struct LDKOffersContext OffersContext_inbound_payment(struct LDKThirtyTwoBytes payment_hash); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OffersContext_inbound_payment")] public static extern long OffersContext_inbound_payment(long _payment_hash); + // bool OffersContext_eq(const struct LDKOffersContext *NONNULL_PTR a, const struct LDKOffersContext *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OffersContext_eq")] public static extern bool OffersContext_eq(long _a, long _b); + // struct LDKCVec_u8Z MessageContext_write(const struct LDKMessageContext *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageContext_write")] public static extern long MessageContext_write(long _obj); + // struct LDKCResult_MessageContextDecodeErrorZ MessageContext_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageContext_read")] public static extern long MessageContext_read(long _ser); + // struct LDKCVec_u8Z OffersContext_write(const struct LDKOffersContext *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OffersContext_write")] public static extern long OffersContext_write(long _obj); + // struct LDKCResult_OffersContextDecodeErrorZ OffersContext_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OffersContext_read")] public static extern long OffersContext_read(long _ser); + // void FundingInfo_free(struct LDKFundingInfo this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingInfo_free")] public static extern void FundingInfo_free(long _this_ptr); + // uint64_t FundingInfo_clone_ptr(LDKFundingInfo *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingInfo_clone_ptr")] public static extern long FundingInfo_clone_ptr(long _arg); + // struct LDKFundingInfo FundingInfo_clone(const struct LDKFundingInfo *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingInfo_clone")] public static extern long FundingInfo_clone(long _orig); + // struct LDKFundingInfo FundingInfo_tx(struct LDKTransaction transaction); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingInfo_tx")] public static extern long FundingInfo_tx(long _transaction); + // struct LDKFundingInfo FundingInfo_out_point(struct LDKOutPoint outpoint); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingInfo_out_point")] public static extern long FundingInfo_out_point(long _outpoint); + // bool FundingInfo_eq(const struct LDKFundingInfo *NONNULL_PTR a, const struct LDKFundingInfo *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingInfo_eq")] public static extern bool FundingInfo_eq(long _a, long _b); + // struct LDKCVec_u8Z FundingInfo_write(const struct LDKFundingInfo *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingInfo_write")] public static extern long FundingInfo_write(long _obj); + // struct LDKCResult_FundingInfoDecodeErrorZ FundingInfo_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingInfo_read")] public static extern long FundingInfo_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); @@ -13998,8 +14017,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_clone")] public static extern long ClosureReason_clone(long _orig); // struct LDKClosureReason ClosureReason_counterparty_force_closed(struct LDKUntrustedString peer_msg); [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_holder_force_closed(struct LDKCOption_boolZ broadcasted_latest_txn); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_holder_force_closed")] public static extern long ClosureReason_holder_force_closed(long _broadcasted_latest_txn); // 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); @@ -14022,6 +14041,8 @@ internal class bindings { [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(); + // struct LDKClosureReason ClosureReason_peer_feerate_too_low(uint32_t peer_feerate_sat_per_kw, uint32_t required_feerate_sat_per_kw); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_peer_feerate_too_low")] public static extern long ClosureReason_peer_feerate_too_low(int _peer_feerate_sat_per_kw, int _required_feerate_sat_per_kw); // 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 LDKStr ClosureReason_to_str(const struct LDKClosureReason *NONNULL_PTR o); @@ -14066,11 +14087,17 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentFailureReason_route_not_found")] public static extern PaymentFailureReason PaymentFailureReason_route_not_found(); // enum LDKPaymentFailureReason PaymentFailureReason_unexpected_error(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentFailureReason_unexpected_error")] public static extern PaymentFailureReason PaymentFailureReason_unexpected_error(); + // enum LDKPaymentFailureReason PaymentFailureReason_unknown_required_features(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentFailureReason_unknown_required_features")] public static extern PaymentFailureReason PaymentFailureReason_unknown_required_features(); + // enum LDKPaymentFailureReason PaymentFailureReason_invoice_request_expired(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentFailureReason_invoice_request_expired")] public static extern PaymentFailureReason PaymentFailureReason_invoice_request_expired(); + // enum LDKPaymentFailureReason PaymentFailureReason_invoice_request_rejected(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentFailureReason_invoice_request_rejected")] public static extern PaymentFailureReason PaymentFailureReason_invoice_request_rejected(); // bool PaymentFailureReason_eq(const enum LDKPaymentFailureReason *NONNULL_PTR a, const enum LDKPaymentFailureReason *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentFailureReason_eq")] public static extern bool PaymentFailureReason_eq(long _a, long _b); // struct LDKCVec_u8Z PaymentFailureReason_write(const enum LDKPaymentFailureReason *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentFailureReason_write")] public static extern long PaymentFailureReason_write(long _obj); - // struct LDKCResult_PaymentFailureReasonDecodeErrorZ PaymentFailureReason_read(struct LDKu8slice ser); + // struct LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ PaymentFailureReason_read(struct LDKu8slice ser); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentFailureReason_read")] public static extern long PaymentFailureReason_read(long _ser); // void Event_free(struct LDKEvent this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_free")] public static extern void Event_free(long _this_ptr); @@ -14080,17 +14107,19 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_clone")] public static extern long Event_clone(long _orig); // 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_funding_tx_broadcast_safe(struct LDKChannelId channel_id, struct LDKU128 user_channel_id, struct LDKOutPoint funding_txo, struct LDKPublicKey counterparty_node_id, struct LDKChannelId former_temporary_channel_id); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_funding_tx_broadcast_safe")] public static extern long Event_funding_tx_broadcast_safe(long _channel_id, long _user_channel_id, long _funding_txo, long _counterparty_node_id, long _former_temporary_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 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); + // 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, struct LDKRecipientOnionFields onion_fields); + [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, long _onion_fields); // struct LDKEvent Event_connection_needed(struct LDKPublicKey node_id, struct LDKCVec_SocketAddressZ addresses); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_connection_needed")] public static extern long Event_connection_needed(long _node_id, long _addresses); - // struct LDKEvent Event_invoice_request_failed(struct LDKThirtyTwoBytes payment_id); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_invoice_request_failed")] public static extern long Event_invoice_request_failed(long _payment_id); + // struct LDKEvent Event_invoice_received(struct LDKThirtyTwoBytes payment_id, struct LDKBolt12Invoice invoice, struct LDKCOption_OffersContextZ context, struct LDKResponder responder); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_invoice_received")] public static extern long Event_invoice_received(long _payment_id, long _invoice, long _context, long _responder); // struct LDKEvent Event_payment_sent(struct LDKCOption_ThirtyTwoBytesZ payment_id, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z fee_paid_msat); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_payment_sent")] public static extern long Event_payment_sent(long _payment_id, long _payment_preimage, long _payment_hash, long _fee_paid_msat); - // struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_PaymentFailureReasonZ reason); + // struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKCOption_ThirtyTwoBytesZ payment_hash, struct LDKCOption_PaymentFailureReasonZ reason); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_payment_failed")] public static extern long Event_payment_failed(long _payment_id, long _payment_hash, long _reason); // struct LDKEvent Event_payment_path_successful(struct LDKThirtyTwoBytes payment_id, struct LDKCOption_ThirtyTwoBytesZ payment_hash, struct LDKPath path); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_payment_path_successful")] public static extern long Event_payment_path_successful(long _payment_id, long _payment_hash, long _path); @@ -14114,14 +14143,18 @@ internal class bindings { [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 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 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 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_discard_funding(struct LDKChannelId channel_id, struct LDKFundingInfo funding_info); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_discard_funding")] public static extern long Event_discard_funding(long _channel_id, long _funding_info); + // 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, bool is_announced, struct LDKChannelParameters params); + [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, bool _is_announced, long _params); // 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); + // struct LDKEvent Event_onion_message_intercepted(struct LDKPublicKey peer_node_id, struct LDKOnionMessage message); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_onion_message_intercepted")] public static extern long Event_onion_message_intercepted(long _peer_node_id, long _message); + // struct LDKEvent Event_onion_message_peer_connected(struct LDKPublicKey peer_node_id); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_onion_message_peer_connected")] public static extern long Event_onion_message_peer_connected(long _peer_node_id); // bool Event_eq(const struct LDKEvent *NONNULL_PTR a, const struct LDKEvent *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_eq")] public static extern bool Event_eq(long _a, long _b); // struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj); @@ -14148,8 +14181,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_funding_signed")] public static extern long MessageSendEvent_send_funding_signed(long _node_id, long _msg); // struct LDKMessageSendEvent MessageSendEvent_send_stfu(struct LDKPublicKey node_id, struct LDKStfu msg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_stfu")] public static extern long MessageSendEvent_send_stfu(long _node_id, long _msg); - // struct LDKMessageSendEvent MessageSendEvent_send_splice(struct LDKPublicKey node_id, struct LDKSplice msg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_splice")] public static extern long MessageSendEvent_send_splice(long _node_id, long _msg); + // struct LDKMessageSendEvent MessageSendEvent_send_splice_init(struct LDKPublicKey node_id, struct LDKSpliceInit msg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_splice_init")] public static extern long MessageSendEvent_send_splice_init(long _node_id, long _msg); // struct LDKMessageSendEvent MessageSendEvent_send_splice_ack(struct LDKPublicKey node_id, struct LDKSpliceAck msg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_splice_ack")] public static extern long MessageSendEvent_send_splice_ack(long _node_id, long _msg); // struct LDKMessageSendEvent MessageSendEvent_send_splice_locked(struct LDKPublicKey node_id, struct LDKSpliceLocked msg); @@ -14210,6 +14243,14 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEventsProvider_free")] public static extern void MessageSendEventsProvider_free(long _this_ptr); // void EventsProvider_free(struct LDKEventsProvider this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EventsProvider_free")] public static extern void EventsProvider_free(long _this_ptr); + // void ReplayEvent_free(struct LDKReplayEvent this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReplayEvent_free")] public static extern void ReplayEvent_free(long _this_obj); + // MUST_USE_RES struct LDKReplayEvent ReplayEvent_new(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReplayEvent_new")] public static extern long ReplayEvent_new(); + // uint64_t ReplayEvent_clone_ptr(LDKReplayEvent *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReplayEvent_clone_ptr")] public static extern long ReplayEvent_clone_ptr(long _arg); + // struct LDKReplayEvent ReplayEvent_clone(const struct LDKReplayEvent *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReplayEvent_clone")] public static extern long ReplayEvent_clone(long _orig); // void EventHandler_free(struct LDKEventHandler this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EventHandler_free")] public static extern void EventHandler_free(long _this_ptr); // void AnchorDescriptor_free(struct LDKAnchorDescriptor this_obj); @@ -14238,7 +14279,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnchorDescriptor_witness_script")] public static extern long AnchorDescriptor_witness_script(long _this_arg); // MUST_USE_RES struct LDKWitness AnchorDescriptor_tx_input_witness(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg, struct LDKECDSASignature signature); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnchorDescriptor_tx_input_witness")] public static extern long AnchorDescriptor_tx_input_witness(long _this_arg, long _signature); - // MUST_USE_RES struct LDKWriteableEcdsaChannelSigner AnchorDescriptor_derive_channel_signer(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider); + // MUST_USE_RES struct LDKEcdsaChannelSigner AnchorDescriptor_derive_channel_signer(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnchorDescriptor_derive_channel_signer")] public static extern long AnchorDescriptor_derive_channel_signer(long _this_arg, long _signer_provider); // void BumpTransactionEvent_free(struct LDKBumpTransactionEvent this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BumpTransactionEvent_free")] public static extern void BumpTransactionEvent_free(long _this_ptr); @@ -14334,6 +14375,826 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BumpTransactionEventHandler_new")] public static extern long BumpTransactionEventHandler_new(long _broadcaster, long _utxo_source, long _signer_provider, long _logger); // void BumpTransactionEventHandler_handle_event(const struct LDKBumpTransactionEventHandler *NONNULL_PTR this_arg, const struct LDKBumpTransactionEvent *NONNULL_PTR event); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BumpTransactionEventHandler_handle_event")] public static extern void BumpTransactionEventHandler_handle_event(long _this_arg, long _event); + // bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_eq")] public static extern bool InitFeatures_eq(long _a, long _b); + // bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_eq")] public static extern bool NodeFeatures_eq(long _a, long _b); + // bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_eq")] public static extern bool ChannelFeatures_eq(long _a, long _b); + // bool Bolt11InvoiceFeatures_eq(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_eq")] public static extern bool Bolt11InvoiceFeatures_eq(long _a, long _b); + // bool OfferFeatures_eq(const struct LDKOfferFeatures *NONNULL_PTR a, const struct LDKOfferFeatures *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_eq")] public static extern bool OfferFeatures_eq(long _a, long _b); + // bool InvoiceRequestFeatures_eq(const struct LDKInvoiceRequestFeatures *NONNULL_PTR a, const struct LDKInvoiceRequestFeatures *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_eq")] public static extern bool InvoiceRequestFeatures_eq(long _a, long _b); + // bool Bolt12InvoiceFeatures_eq(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_eq")] public static extern bool Bolt12InvoiceFeatures_eq(long _a, long _b); + // bool BlindedHopFeatures_eq(const struct LDKBlindedHopFeatures *NONNULL_PTR a, const struct LDKBlindedHopFeatures *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_eq")] public static extern bool BlindedHopFeatures_eq(long _a, long _b); + // bool ChannelTypeFeatures_eq(const struct LDKChannelTypeFeatures *NONNULL_PTR a, const struct LDKChannelTypeFeatures *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_eq")] public static extern bool ChannelTypeFeatures_eq(long _a, long _b); + // uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_clone_ptr")] public static extern long InitFeatures_clone_ptr(long _arg); + // struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_clone")] public static extern long InitFeatures_clone(long _orig); + // uint64_t NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_clone_ptr")] public static extern long NodeFeatures_clone_ptr(long _arg); + // struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_clone")] public static extern long NodeFeatures_clone(long _orig); + // uint64_t ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_clone_ptr")] public static extern long ChannelFeatures_clone_ptr(long _arg); + // struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_clone")] public static extern long ChannelFeatures_clone(long _orig); + // uint64_t Bolt11InvoiceFeatures_clone_ptr(LDKBolt11InvoiceFeatures *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_clone_ptr")] public static extern long Bolt11InvoiceFeatures_clone_ptr(long _arg); + // struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_clone(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_clone")] public static extern long Bolt11InvoiceFeatures_clone(long _orig); + // uint64_t OfferFeatures_clone_ptr(LDKOfferFeatures *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_clone_ptr")] public static extern long OfferFeatures_clone_ptr(long _arg); + // struct LDKOfferFeatures OfferFeatures_clone(const struct LDKOfferFeatures *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_clone")] public static extern long OfferFeatures_clone(long _orig); + // uint64_t InvoiceRequestFeatures_clone_ptr(LDKInvoiceRequestFeatures *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_clone_ptr")] public static extern long InvoiceRequestFeatures_clone_ptr(long _arg); + // struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_clone(const struct LDKInvoiceRequestFeatures *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_clone")] public static extern long InvoiceRequestFeatures_clone(long _orig); + // uint64_t Bolt12InvoiceFeatures_clone_ptr(LDKBolt12InvoiceFeatures *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_clone_ptr")] public static extern long Bolt12InvoiceFeatures_clone_ptr(long _arg); + // struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_clone(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_clone")] public static extern long Bolt12InvoiceFeatures_clone(long _orig); + // uint64_t BlindedHopFeatures_clone_ptr(LDKBlindedHopFeatures *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_clone_ptr")] public static extern long BlindedHopFeatures_clone_ptr(long _arg); + // struct LDKBlindedHopFeatures BlindedHopFeatures_clone(const struct LDKBlindedHopFeatures *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_clone")] public static extern long BlindedHopFeatures_clone(long _orig); + // uint64_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_clone_ptr")] public static extern long ChannelTypeFeatures_clone_ptr(long _arg); + // struct LDKChannelTypeFeatures ChannelTypeFeatures_clone(const struct LDKChannelTypeFeatures *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_clone")] public static extern long ChannelTypeFeatures_clone(long _orig); + // uint64_t InitFeatures_hash(const struct LDKInitFeatures *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_hash")] public static extern long InitFeatures_hash(long _o); + // uint64_t NodeFeatures_hash(const struct LDKNodeFeatures *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_hash")] public static extern long NodeFeatures_hash(long _o); + // uint64_t ChannelFeatures_hash(const struct LDKChannelFeatures *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_hash")] public static extern long ChannelFeatures_hash(long _o); + // uint64_t Bolt11InvoiceFeatures_hash(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_hash")] public static extern long Bolt11InvoiceFeatures_hash(long _o); + // uint64_t OfferFeatures_hash(const struct LDKOfferFeatures *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_hash")] public static extern long OfferFeatures_hash(long _o); + // uint64_t InvoiceRequestFeatures_hash(const struct LDKInvoiceRequestFeatures *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_hash")] public static extern long InvoiceRequestFeatures_hash(long _o); + // uint64_t Bolt12InvoiceFeatures_hash(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_hash")] public static extern long Bolt12InvoiceFeatures_hash(long _o); + // uint64_t BlindedHopFeatures_hash(const struct LDKBlindedHopFeatures *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_hash")] public static extern long BlindedHopFeatures_hash(long _o); + // uint64_t ChannelTypeFeatures_hash(const struct LDKChannelTypeFeatures *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_hash")] public static extern long ChannelTypeFeatures_hash(long _o); + // void InitFeatures_free(struct LDKInitFeatures this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_free")] public static extern void InitFeatures_free(long _this_obj); + // void NodeFeatures_free(struct LDKNodeFeatures this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_free")] public static extern void NodeFeatures_free(long _this_obj); + // void ChannelFeatures_free(struct LDKChannelFeatures this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_free")] public static extern void ChannelFeatures_free(long _this_obj); + // void Bolt11InvoiceFeatures_free(struct LDKBolt11InvoiceFeatures this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_free")] public static extern void Bolt11InvoiceFeatures_free(long _this_obj); + // void OfferFeatures_free(struct LDKOfferFeatures this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_free")] public static extern void OfferFeatures_free(long _this_obj); + // void InvoiceRequestFeatures_free(struct LDKInvoiceRequestFeatures this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_free")] public static extern void InvoiceRequestFeatures_free(long _this_obj); + // void Bolt12InvoiceFeatures_free(struct LDKBolt12InvoiceFeatures this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_free")] public static extern void Bolt12InvoiceFeatures_free(long _this_obj); + // void BlindedHopFeatures_free(struct LDKBlindedHopFeatures this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_free")] public static extern void BlindedHopFeatures_free(long _this_obj); + // void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_free")] public static extern void ChannelTypeFeatures_free(long _this_obj); + // MUST_USE_RES struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_for_keysend(bool allow_mpp); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_for_keysend")] public static extern long Bolt11InvoiceFeatures_for_keysend(bool _allow_mpp); + // MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_only_static_remote_key(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_only_static_remote_key")] public static extern long ChannelTypeFeatures_only_static_remote_key(); + // MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_anchors_zero_htlc_fee_and_dependencies(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_anchors_zero_htlc_fee_and_dependencies")] public static extern long ChannelTypeFeatures_anchors_zero_htlc_fee_and_dependencies(); + // MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_empty")] public static extern long InitFeatures_empty(); + // MUST_USE_RES struct LDKu8slice InitFeatures_le_flags(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_le_flags")] public static extern long InitFeatures_le_flags(long _this_arg); + // MUST_USE_RES bool InitFeatures_supports_any_optional_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_any_optional_bits")] public static extern bool InitFeatures_supports_any_optional_bits(long _this_arg); + // MUST_USE_RES bool InitFeatures_requires_unknown_bits_from(const struct LDKInitFeatures *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR other); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_unknown_bits_from")] public static extern bool InitFeatures_requires_unknown_bits_from(long _this_arg, long _other); + // MUST_USE_RES struct LDKCVec_u64Z InitFeatures_required_unknown_bits_from(const struct LDKInitFeatures *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR other); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_required_unknown_bits_from")] public static extern long InitFeatures_required_unknown_bits_from(long _this_arg, long _other); + // MUST_USE_RES bool InitFeatures_requires_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_unknown_bits")] public static extern bool InitFeatures_requires_unknown_bits(long _this_arg); + // MUST_USE_RES bool InitFeatures_supports_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_unknown_bits")] public static extern bool InitFeatures_supports_unknown_bits(long _this_arg); + // MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_required_feature_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_required_feature_bit")] public static extern long InitFeatures_set_required_feature_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_optional_feature_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_optional_feature_bit")] public static extern long InitFeatures_set_optional_feature_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_required_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_required_custom_bit")] public static extern long InitFeatures_set_required_custom_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_optional_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_optional_custom_bit")] public static extern long InitFeatures_set_optional_custom_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_empty")] public static extern long NodeFeatures_empty(); + // MUST_USE_RES struct LDKu8slice NodeFeatures_le_flags(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_le_flags")] public static extern long NodeFeatures_le_flags(long _this_arg); + // MUST_USE_RES bool NodeFeatures_supports_any_optional_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_any_optional_bits")] public static extern bool NodeFeatures_supports_any_optional_bits(long _this_arg); + // MUST_USE_RES bool NodeFeatures_requires_unknown_bits_from(const struct LDKNodeFeatures *NONNULL_PTR this_arg, const struct LDKNodeFeatures *NONNULL_PTR other); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_unknown_bits_from")] public static extern bool NodeFeatures_requires_unknown_bits_from(long _this_arg, long _other); + // MUST_USE_RES struct LDKCVec_u64Z NodeFeatures_required_unknown_bits_from(const struct LDKNodeFeatures *NONNULL_PTR this_arg, const struct LDKNodeFeatures *NONNULL_PTR other); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_required_unknown_bits_from")] public static extern long NodeFeatures_required_unknown_bits_from(long _this_arg, long _other); + // MUST_USE_RES bool NodeFeatures_requires_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_unknown_bits")] public static extern bool NodeFeatures_requires_unknown_bits(long _this_arg); + // MUST_USE_RES bool NodeFeatures_supports_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_unknown_bits")] public static extern bool NodeFeatures_supports_unknown_bits(long _this_arg); + // MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_required_feature_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_required_feature_bit")] public static extern long NodeFeatures_set_required_feature_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_optional_feature_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_optional_feature_bit")] public static extern long NodeFeatures_set_optional_feature_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_required_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_required_custom_bit")] public static extern long NodeFeatures_set_required_custom_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_optional_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_optional_custom_bit")] public static extern long NodeFeatures_set_optional_custom_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_empty")] public static extern long ChannelFeatures_empty(); + // MUST_USE_RES struct LDKu8slice ChannelFeatures_le_flags(const struct LDKChannelFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_le_flags")] public static extern long ChannelFeatures_le_flags(long _this_arg); + // MUST_USE_RES bool ChannelFeatures_supports_any_optional_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_supports_any_optional_bits")] public static extern bool ChannelFeatures_supports_any_optional_bits(long _this_arg); + // MUST_USE_RES bool ChannelFeatures_requires_unknown_bits_from(const struct LDKChannelFeatures *NONNULL_PTR this_arg, const struct LDKChannelFeatures *NONNULL_PTR other); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_requires_unknown_bits_from")] public static extern bool ChannelFeatures_requires_unknown_bits_from(long _this_arg, long _other); + // MUST_USE_RES struct LDKCVec_u64Z ChannelFeatures_required_unknown_bits_from(const struct LDKChannelFeatures *NONNULL_PTR this_arg, const struct LDKChannelFeatures *NONNULL_PTR other); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_required_unknown_bits_from")] public static extern long ChannelFeatures_required_unknown_bits_from(long _this_arg, long _other); + // MUST_USE_RES bool ChannelFeatures_requires_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_requires_unknown_bits")] public static extern bool ChannelFeatures_requires_unknown_bits(long _this_arg); + // MUST_USE_RES bool ChannelFeatures_supports_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_supports_unknown_bits")] public static extern bool ChannelFeatures_supports_unknown_bits(long _this_arg); + // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_required_feature_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_set_required_feature_bit")] public static extern long ChannelFeatures_set_required_feature_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_optional_feature_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_set_optional_feature_bit")] public static extern long ChannelFeatures_set_optional_feature_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_required_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_set_required_custom_bit")] public static extern long ChannelFeatures_set_required_custom_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_optional_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_set_optional_custom_bit")] public static extern long ChannelFeatures_set_optional_custom_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_empty(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_empty")] public static extern long Bolt11InvoiceFeatures_empty(); + // MUST_USE_RES struct LDKu8slice Bolt11InvoiceFeatures_le_flags(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_le_flags")] public static extern long Bolt11InvoiceFeatures_le_flags(long _this_arg); + // MUST_USE_RES bool Bolt11InvoiceFeatures_supports_any_optional_bits(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_supports_any_optional_bits")] public static extern bool Bolt11InvoiceFeatures_supports_any_optional_bits(long _this_arg); + // MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR other); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_requires_unknown_bits_from")] public static extern bool Bolt11InvoiceFeatures_requires_unknown_bits_from(long _this_arg, long _other); + // MUST_USE_RES struct LDKCVec_u64Z Bolt11InvoiceFeatures_required_unknown_bits_from(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR other); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_required_unknown_bits_from")] public static extern long Bolt11InvoiceFeatures_required_unknown_bits_from(long _this_arg, long _other); + // MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_requires_unknown_bits")] public static extern bool Bolt11InvoiceFeatures_requires_unknown_bits(long _this_arg); + // MUST_USE_RES bool Bolt11InvoiceFeatures_supports_unknown_bits(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_supports_unknown_bits")] public static extern bool Bolt11InvoiceFeatures_supports_unknown_bits(long _this_arg); + // MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_required_feature_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_set_required_feature_bit")] public static extern long Bolt11InvoiceFeatures_set_required_feature_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_optional_feature_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_set_optional_feature_bit")] public static extern long Bolt11InvoiceFeatures_set_optional_feature_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_required_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_set_required_custom_bit")] public static extern long Bolt11InvoiceFeatures_set_required_custom_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_optional_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_set_optional_custom_bit")] public static extern long Bolt11InvoiceFeatures_set_optional_custom_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKOfferFeatures OfferFeatures_empty(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_empty")] public static extern long OfferFeatures_empty(); + // MUST_USE_RES struct LDKu8slice OfferFeatures_le_flags(const struct LDKOfferFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_le_flags")] public static extern long OfferFeatures_le_flags(long _this_arg); + // MUST_USE_RES bool OfferFeatures_supports_any_optional_bits(const struct LDKOfferFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_supports_any_optional_bits")] public static extern bool OfferFeatures_supports_any_optional_bits(long _this_arg); + // MUST_USE_RES bool OfferFeatures_requires_unknown_bits_from(const struct LDKOfferFeatures *NONNULL_PTR this_arg, const struct LDKOfferFeatures *NONNULL_PTR other); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_requires_unknown_bits_from")] public static extern bool OfferFeatures_requires_unknown_bits_from(long _this_arg, long _other); + // MUST_USE_RES struct LDKCVec_u64Z OfferFeatures_required_unknown_bits_from(const struct LDKOfferFeatures *NONNULL_PTR this_arg, const struct LDKOfferFeatures *NONNULL_PTR other); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_required_unknown_bits_from")] public static extern long OfferFeatures_required_unknown_bits_from(long _this_arg, long _other); + // MUST_USE_RES bool OfferFeatures_requires_unknown_bits(const struct LDKOfferFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_requires_unknown_bits")] public static extern bool OfferFeatures_requires_unknown_bits(long _this_arg); + // MUST_USE_RES bool OfferFeatures_supports_unknown_bits(const struct LDKOfferFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_supports_unknown_bits")] public static extern bool OfferFeatures_supports_unknown_bits(long _this_arg); + // MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_required_feature_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_set_required_feature_bit")] public static extern long OfferFeatures_set_required_feature_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_optional_feature_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_set_optional_feature_bit")] public static extern long OfferFeatures_set_optional_feature_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_required_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_set_required_custom_bit")] public static extern long OfferFeatures_set_required_custom_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_optional_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_set_optional_custom_bit")] public static extern long OfferFeatures_set_optional_custom_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_empty(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_empty")] public static extern long InvoiceRequestFeatures_empty(); + // MUST_USE_RES struct LDKu8slice InvoiceRequestFeatures_le_flags(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_le_flags")] public static extern long InvoiceRequestFeatures_le_flags(long _this_arg); + // MUST_USE_RES bool InvoiceRequestFeatures_supports_any_optional_bits(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_supports_any_optional_bits")] public static extern bool InvoiceRequestFeatures_supports_any_optional_bits(long _this_arg); + // MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits_from(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, const struct LDKInvoiceRequestFeatures *NONNULL_PTR other); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_requires_unknown_bits_from")] public static extern bool InvoiceRequestFeatures_requires_unknown_bits_from(long _this_arg, long _other); + // MUST_USE_RES struct LDKCVec_u64Z InvoiceRequestFeatures_required_unknown_bits_from(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, const struct LDKInvoiceRequestFeatures *NONNULL_PTR other); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_required_unknown_bits_from")] public static extern long InvoiceRequestFeatures_required_unknown_bits_from(long _this_arg, long _other); + // MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_requires_unknown_bits")] public static extern bool InvoiceRequestFeatures_requires_unknown_bits(long _this_arg); + // MUST_USE_RES bool InvoiceRequestFeatures_supports_unknown_bits(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_supports_unknown_bits")] public static extern bool InvoiceRequestFeatures_supports_unknown_bits(long _this_arg); + // MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_required_feature_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_set_required_feature_bit")] public static extern long InvoiceRequestFeatures_set_required_feature_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_optional_feature_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_set_optional_feature_bit")] public static extern long InvoiceRequestFeatures_set_optional_feature_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_required_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_set_required_custom_bit")] public static extern long InvoiceRequestFeatures_set_required_custom_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_optional_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_set_optional_custom_bit")] public static extern long InvoiceRequestFeatures_set_optional_custom_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_empty(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_empty")] public static extern long Bolt12InvoiceFeatures_empty(); + // MUST_USE_RES struct LDKu8slice Bolt12InvoiceFeatures_le_flags(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_le_flags")] public static extern long Bolt12InvoiceFeatures_le_flags(long _this_arg); + // MUST_USE_RES bool Bolt12InvoiceFeatures_supports_any_optional_bits(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_supports_any_optional_bits")] public static extern bool Bolt12InvoiceFeatures_supports_any_optional_bits(long _this_arg); + // MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR other); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_requires_unknown_bits_from")] public static extern bool Bolt12InvoiceFeatures_requires_unknown_bits_from(long _this_arg, long _other); + // MUST_USE_RES struct LDKCVec_u64Z Bolt12InvoiceFeatures_required_unknown_bits_from(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR other); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_required_unknown_bits_from")] public static extern long Bolt12InvoiceFeatures_required_unknown_bits_from(long _this_arg, long _other); + // MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_requires_unknown_bits")] public static extern bool Bolt12InvoiceFeatures_requires_unknown_bits(long _this_arg); + // MUST_USE_RES bool Bolt12InvoiceFeatures_supports_unknown_bits(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_supports_unknown_bits")] public static extern bool Bolt12InvoiceFeatures_supports_unknown_bits(long _this_arg); + // MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_required_feature_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_set_required_feature_bit")] public static extern long Bolt12InvoiceFeatures_set_required_feature_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_optional_feature_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_set_optional_feature_bit")] public static extern long Bolt12InvoiceFeatures_set_optional_feature_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_required_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_set_required_custom_bit")] public static extern long Bolt12InvoiceFeatures_set_required_custom_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_optional_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_set_optional_custom_bit")] public static extern long Bolt12InvoiceFeatures_set_optional_custom_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKBlindedHopFeatures BlindedHopFeatures_empty(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_empty")] public static extern long BlindedHopFeatures_empty(); + // MUST_USE_RES struct LDKu8slice BlindedHopFeatures_le_flags(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_le_flags")] public static extern long BlindedHopFeatures_le_flags(long _this_arg); + // MUST_USE_RES bool BlindedHopFeatures_supports_any_optional_bits(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_supports_any_optional_bits")] public static extern bool BlindedHopFeatures_supports_any_optional_bits(long _this_arg); + // MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits_from(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, const struct LDKBlindedHopFeatures *NONNULL_PTR other); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_requires_unknown_bits_from")] public static extern bool BlindedHopFeatures_requires_unknown_bits_from(long _this_arg, long _other); + // MUST_USE_RES struct LDKCVec_u64Z BlindedHopFeatures_required_unknown_bits_from(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, const struct LDKBlindedHopFeatures *NONNULL_PTR other); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_required_unknown_bits_from")] public static extern long BlindedHopFeatures_required_unknown_bits_from(long _this_arg, long _other); + // MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_requires_unknown_bits")] public static extern bool BlindedHopFeatures_requires_unknown_bits(long _this_arg); + // MUST_USE_RES bool BlindedHopFeatures_supports_unknown_bits(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_supports_unknown_bits")] public static extern bool BlindedHopFeatures_supports_unknown_bits(long _this_arg); + // MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_required_feature_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_set_required_feature_bit")] public static extern long BlindedHopFeatures_set_required_feature_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_optional_feature_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_set_optional_feature_bit")] public static extern long BlindedHopFeatures_set_optional_feature_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_required_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_set_required_custom_bit")] public static extern long BlindedHopFeatures_set_required_custom_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_optional_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_set_optional_custom_bit")] public static extern long BlindedHopFeatures_set_optional_custom_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_empty")] public static extern long ChannelTypeFeatures_empty(); + // MUST_USE_RES struct LDKu8slice ChannelTypeFeatures_le_flags(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_le_flags")] public static extern long ChannelTypeFeatures_le_flags(long _this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_supports_any_optional_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_supports_any_optional_bits")] public static extern bool ChannelTypeFeatures_supports_any_optional_bits(long _this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits_from(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, const struct LDKChannelTypeFeatures *NONNULL_PTR other); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_requires_unknown_bits_from")] public static extern bool ChannelTypeFeatures_requires_unknown_bits_from(long _this_arg, long _other); + // MUST_USE_RES struct LDKCVec_u64Z ChannelTypeFeatures_required_unknown_bits_from(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, const struct LDKChannelTypeFeatures *NONNULL_PTR other); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_required_unknown_bits_from")] public static extern long ChannelTypeFeatures_required_unknown_bits_from(long _this_arg, long _other); + // MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_requires_unknown_bits")] public static extern bool ChannelTypeFeatures_requires_unknown_bits(long _this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_supports_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_supports_unknown_bits")] public static extern bool ChannelTypeFeatures_supports_unknown_bits(long _this_arg); + // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_required_feature_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_required_feature_bit")] public static extern long ChannelTypeFeatures_set_required_feature_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_optional_feature_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_optional_feature_bit")] public static extern long ChannelTypeFeatures_set_optional_feature_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_required_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_required_custom_bit")] public static extern long ChannelTypeFeatures_set_required_custom_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_optional_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_optional_custom_bit")] public static extern long ChannelTypeFeatures_set_optional_custom_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKInitFeatures InitFeatures_clear_upfront_shutdown_script(struct LDKInitFeatures this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_clear_upfront_shutdown_script")] public static extern long InitFeatures_clear_upfront_shutdown_script(long _this_arg); + // MUST_USE_RES struct LDKNodeFeatures NodeFeatures_clear_upfront_shutdown_script(struct LDKNodeFeatures this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_clear_upfront_shutdown_script")] public static extern long NodeFeatures_clear_upfront_shutdown_script(long _this_arg); + // MUST_USE_RES struct LDKInitFeatures InitFeatures_clear_shutdown_anysegwit(struct LDKInitFeatures this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_clear_shutdown_anysegwit")] public static extern long InitFeatures_clear_shutdown_anysegwit(long _this_arg); + // MUST_USE_RES struct LDKNodeFeatures NodeFeatures_clear_shutdown_anysegwit(struct LDKNodeFeatures this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_clear_shutdown_anysegwit")] public static extern long NodeFeatures_clear_shutdown_anysegwit(long _this_arg); + // MUST_USE_RES struct LDKInitFeatures InitFeatures_clear_wumbo(struct LDKInitFeatures this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_clear_wumbo")] public static extern long InitFeatures_clear_wumbo(long _this_arg); + // MUST_USE_RES struct LDKNodeFeatures NodeFeatures_clear_wumbo(struct LDKNodeFeatures this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_clear_wumbo")] public static extern long NodeFeatures_clear_wumbo(long _this_arg); + // void InitFeatures_clear_scid_privacy(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_clear_scid_privacy")] public static extern void InitFeatures_clear_scid_privacy(long _this_arg); + // void NodeFeatures_clear_scid_privacy(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_clear_scid_privacy")] public static extern void NodeFeatures_clear_scid_privacy(long _this_arg); + // void ChannelTypeFeatures_clear_scid_privacy(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_clear_scid_privacy")] public static extern void ChannelTypeFeatures_clear_scid_privacy(long _this_arg); + // void InitFeatures_clear_anchors_zero_fee_htlc_tx(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_clear_anchors_zero_fee_htlc_tx")] public static extern void InitFeatures_clear_anchors_zero_fee_htlc_tx(long _this_arg); + // void NodeFeatures_clear_anchors_zero_fee_htlc_tx(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_clear_anchors_zero_fee_htlc_tx")] public static extern void NodeFeatures_clear_anchors_zero_fee_htlc_tx(long _this_arg); + // void ChannelTypeFeatures_clear_anchors_zero_fee_htlc_tx(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_clear_anchors_zero_fee_htlc_tx")] public static extern void ChannelTypeFeatures_clear_anchors_zero_fee_htlc_tx(long _this_arg); + // void InitFeatures_clear_route_blinding(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_clear_route_blinding")] public static extern void InitFeatures_clear_route_blinding(long _this_arg); + // void NodeFeatures_clear_route_blinding(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_clear_route_blinding")] public static extern void NodeFeatures_clear_route_blinding(long _this_arg); + // void InitFeatures_set_data_loss_protect_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_data_loss_protect_optional")] public static extern void InitFeatures_set_data_loss_protect_optional(long _this_arg); + // void InitFeatures_set_data_loss_protect_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_data_loss_protect_required")] public static extern void InitFeatures_set_data_loss_protect_required(long _this_arg); + // MUST_USE_RES bool InitFeatures_supports_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_data_loss_protect")] public static extern bool InitFeatures_supports_data_loss_protect(long _this_arg); + // void NodeFeatures_set_data_loss_protect_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_data_loss_protect_optional")] public static extern void NodeFeatures_set_data_loss_protect_optional(long _this_arg); + // void NodeFeatures_set_data_loss_protect_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_data_loss_protect_required")] public static extern void NodeFeatures_set_data_loss_protect_required(long _this_arg); + // MUST_USE_RES bool NodeFeatures_supports_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_data_loss_protect")] public static extern bool NodeFeatures_supports_data_loss_protect(long _this_arg); + // MUST_USE_RES bool InitFeatures_requires_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_data_loss_protect")] public static extern bool InitFeatures_requires_data_loss_protect(long _this_arg); + // MUST_USE_RES bool NodeFeatures_requires_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_data_loss_protect")] public static extern bool NodeFeatures_requires_data_loss_protect(long _this_arg); + // void InitFeatures_set_initial_routing_sync_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_initial_routing_sync_optional")] public static extern void InitFeatures_set_initial_routing_sync_optional(long _this_arg); + // void InitFeatures_set_initial_routing_sync_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_initial_routing_sync_required")] public static extern void InitFeatures_set_initial_routing_sync_required(long _this_arg); + // MUST_USE_RES bool InitFeatures_initial_routing_sync(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_initial_routing_sync")] public static extern bool InitFeatures_initial_routing_sync(long _this_arg); + // void InitFeatures_set_upfront_shutdown_script_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_upfront_shutdown_script_optional")] public static extern void InitFeatures_set_upfront_shutdown_script_optional(long _this_arg); + // void InitFeatures_set_upfront_shutdown_script_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_upfront_shutdown_script_required")] public static extern void InitFeatures_set_upfront_shutdown_script_required(long _this_arg); + // MUST_USE_RES bool InitFeatures_supports_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_upfront_shutdown_script")] public static extern bool InitFeatures_supports_upfront_shutdown_script(long _this_arg); + // void NodeFeatures_set_upfront_shutdown_script_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_upfront_shutdown_script_optional")] public static extern void NodeFeatures_set_upfront_shutdown_script_optional(long _this_arg); + // void NodeFeatures_set_upfront_shutdown_script_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_upfront_shutdown_script_required")] public static extern void NodeFeatures_set_upfront_shutdown_script_required(long _this_arg); + // MUST_USE_RES bool NodeFeatures_supports_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_upfront_shutdown_script")] public static extern bool NodeFeatures_supports_upfront_shutdown_script(long _this_arg); + // MUST_USE_RES bool InitFeatures_requires_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_upfront_shutdown_script")] public static extern bool InitFeatures_requires_upfront_shutdown_script(long _this_arg); + // MUST_USE_RES bool NodeFeatures_requires_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_upfront_shutdown_script")] public static extern bool NodeFeatures_requires_upfront_shutdown_script(long _this_arg); + // void InitFeatures_set_gossip_queries_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_gossip_queries_optional")] public static extern void InitFeatures_set_gossip_queries_optional(long _this_arg); + // void InitFeatures_set_gossip_queries_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_gossip_queries_required")] public static extern void InitFeatures_set_gossip_queries_required(long _this_arg); + // MUST_USE_RES bool InitFeatures_supports_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_gossip_queries")] public static extern bool InitFeatures_supports_gossip_queries(long _this_arg); + // void NodeFeatures_set_gossip_queries_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_gossip_queries_optional")] public static extern void NodeFeatures_set_gossip_queries_optional(long _this_arg); + // void NodeFeatures_set_gossip_queries_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_gossip_queries_required")] public static extern void NodeFeatures_set_gossip_queries_required(long _this_arg); + // MUST_USE_RES bool NodeFeatures_supports_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_gossip_queries")] public static extern bool NodeFeatures_supports_gossip_queries(long _this_arg); + // MUST_USE_RES bool InitFeatures_requires_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_gossip_queries")] public static extern bool InitFeatures_requires_gossip_queries(long _this_arg); + // MUST_USE_RES bool NodeFeatures_requires_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_gossip_queries")] public static extern bool NodeFeatures_requires_gossip_queries(long _this_arg); + // void InitFeatures_set_variable_length_onion_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_variable_length_onion_optional")] public static extern void InitFeatures_set_variable_length_onion_optional(long _this_arg); + // void InitFeatures_set_variable_length_onion_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_variable_length_onion_required")] public static extern void InitFeatures_set_variable_length_onion_required(long _this_arg); + // MUST_USE_RES bool InitFeatures_supports_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_variable_length_onion")] public static extern bool InitFeatures_supports_variable_length_onion(long _this_arg); + // void NodeFeatures_set_variable_length_onion_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_variable_length_onion_optional")] public static extern void NodeFeatures_set_variable_length_onion_optional(long _this_arg); + // void NodeFeatures_set_variable_length_onion_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_variable_length_onion_required")] public static extern void NodeFeatures_set_variable_length_onion_required(long _this_arg); + // MUST_USE_RES bool NodeFeatures_supports_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_variable_length_onion")] public static extern bool NodeFeatures_supports_variable_length_onion(long _this_arg); + // void Bolt11InvoiceFeatures_set_variable_length_onion_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_set_variable_length_onion_optional")] public static extern void Bolt11InvoiceFeatures_set_variable_length_onion_optional(long _this_arg); + // void Bolt11InvoiceFeatures_set_variable_length_onion_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_set_variable_length_onion_required")] public static extern void Bolt11InvoiceFeatures_set_variable_length_onion_required(long _this_arg); + // MUST_USE_RES bool Bolt11InvoiceFeatures_supports_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_supports_variable_length_onion")] public static extern bool Bolt11InvoiceFeatures_supports_variable_length_onion(long _this_arg); + // MUST_USE_RES bool InitFeatures_requires_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_variable_length_onion")] public static extern bool InitFeatures_requires_variable_length_onion(long _this_arg); + // MUST_USE_RES bool NodeFeatures_requires_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_variable_length_onion")] public static extern bool NodeFeatures_requires_variable_length_onion(long _this_arg); + // MUST_USE_RES bool Bolt11InvoiceFeatures_requires_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_requires_variable_length_onion")] public static extern bool Bolt11InvoiceFeatures_requires_variable_length_onion(long _this_arg); + // void InitFeatures_set_static_remote_key_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_static_remote_key_optional")] public static extern void InitFeatures_set_static_remote_key_optional(long _this_arg); + // void InitFeatures_set_static_remote_key_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_static_remote_key_required")] public static extern void InitFeatures_set_static_remote_key_required(long _this_arg); + // MUST_USE_RES bool InitFeatures_supports_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_static_remote_key")] public static extern bool InitFeatures_supports_static_remote_key(long _this_arg); + // void NodeFeatures_set_static_remote_key_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_static_remote_key_optional")] public static extern void NodeFeatures_set_static_remote_key_optional(long _this_arg); + // void NodeFeatures_set_static_remote_key_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_static_remote_key_required")] public static extern void NodeFeatures_set_static_remote_key_required(long _this_arg); + // MUST_USE_RES bool NodeFeatures_supports_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_static_remote_key")] public static extern bool NodeFeatures_supports_static_remote_key(long _this_arg); + // void ChannelTypeFeatures_set_static_remote_key_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_static_remote_key_optional")] public static extern void ChannelTypeFeatures_set_static_remote_key_optional(long _this_arg); + // void ChannelTypeFeatures_set_static_remote_key_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_static_remote_key_required")] public static extern void ChannelTypeFeatures_set_static_remote_key_required(long _this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_supports_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_supports_static_remote_key")] public static extern bool ChannelTypeFeatures_supports_static_remote_key(long _this_arg); + // MUST_USE_RES bool InitFeatures_requires_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_static_remote_key")] public static extern bool InitFeatures_requires_static_remote_key(long _this_arg); + // MUST_USE_RES bool NodeFeatures_requires_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_static_remote_key")] public static extern bool NodeFeatures_requires_static_remote_key(long _this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_requires_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_requires_static_remote_key")] public static extern bool ChannelTypeFeatures_requires_static_remote_key(long _this_arg); + // void InitFeatures_set_payment_secret_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_payment_secret_optional")] public static extern void InitFeatures_set_payment_secret_optional(long _this_arg); + // void InitFeatures_set_payment_secret_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_payment_secret_required")] public static extern void InitFeatures_set_payment_secret_required(long _this_arg); + // MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_payment_secret")] public static extern bool InitFeatures_supports_payment_secret(long _this_arg); + // void NodeFeatures_set_payment_secret_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_payment_secret_optional")] public static extern void NodeFeatures_set_payment_secret_optional(long _this_arg); + // void NodeFeatures_set_payment_secret_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_payment_secret_required")] public static extern void NodeFeatures_set_payment_secret_required(long _this_arg); + // MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_payment_secret")] public static extern bool NodeFeatures_supports_payment_secret(long _this_arg); + // void Bolt11InvoiceFeatures_set_payment_secret_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_set_payment_secret_optional")] public static extern void Bolt11InvoiceFeatures_set_payment_secret_optional(long _this_arg); + // void Bolt11InvoiceFeatures_set_payment_secret_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_set_payment_secret_required")] public static extern void Bolt11InvoiceFeatures_set_payment_secret_required(long _this_arg); + // MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_supports_payment_secret")] public static extern bool Bolt11InvoiceFeatures_supports_payment_secret(long _this_arg); + // MUST_USE_RES bool InitFeatures_requires_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_payment_secret")] public static extern bool InitFeatures_requires_payment_secret(long _this_arg); + // MUST_USE_RES bool NodeFeatures_requires_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_payment_secret")] public static extern bool NodeFeatures_requires_payment_secret(long _this_arg); + // MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_requires_payment_secret")] public static extern bool Bolt11InvoiceFeatures_requires_payment_secret(long _this_arg); + // void InitFeatures_set_basic_mpp_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_basic_mpp_optional")] public static extern void InitFeatures_set_basic_mpp_optional(long _this_arg); + // void InitFeatures_set_basic_mpp_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_basic_mpp_required")] public static extern void InitFeatures_set_basic_mpp_required(long _this_arg); + // MUST_USE_RES bool InitFeatures_supports_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_basic_mpp")] public static extern bool InitFeatures_supports_basic_mpp(long _this_arg); + // void NodeFeatures_set_basic_mpp_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_basic_mpp_optional")] public static extern void NodeFeatures_set_basic_mpp_optional(long _this_arg); + // void NodeFeatures_set_basic_mpp_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_basic_mpp_required")] public static extern void NodeFeatures_set_basic_mpp_required(long _this_arg); + // MUST_USE_RES bool NodeFeatures_supports_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_basic_mpp")] public static extern bool NodeFeatures_supports_basic_mpp(long _this_arg); + // void Bolt11InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_set_basic_mpp_optional")] public static extern void Bolt11InvoiceFeatures_set_basic_mpp_optional(long _this_arg); + // void Bolt11InvoiceFeatures_set_basic_mpp_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_set_basic_mpp_required")] public static extern void Bolt11InvoiceFeatures_set_basic_mpp_required(long _this_arg); + // MUST_USE_RES bool Bolt11InvoiceFeatures_supports_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_supports_basic_mpp")] public static extern bool Bolt11InvoiceFeatures_supports_basic_mpp(long _this_arg); + // void Bolt12InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_set_basic_mpp_optional")] public static extern void Bolt12InvoiceFeatures_set_basic_mpp_optional(long _this_arg); + // void Bolt12InvoiceFeatures_set_basic_mpp_required(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_set_basic_mpp_required")] public static extern void Bolt12InvoiceFeatures_set_basic_mpp_required(long _this_arg); + // MUST_USE_RES bool Bolt12InvoiceFeatures_supports_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_supports_basic_mpp")] public static extern bool Bolt12InvoiceFeatures_supports_basic_mpp(long _this_arg); + // MUST_USE_RES bool InitFeatures_requires_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_basic_mpp")] public static extern bool InitFeatures_requires_basic_mpp(long _this_arg); + // MUST_USE_RES bool NodeFeatures_requires_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_basic_mpp")] public static extern bool NodeFeatures_requires_basic_mpp(long _this_arg); + // MUST_USE_RES bool Bolt11InvoiceFeatures_requires_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_requires_basic_mpp")] public static extern bool Bolt11InvoiceFeatures_requires_basic_mpp(long _this_arg); + // MUST_USE_RES bool Bolt12InvoiceFeatures_requires_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_requires_basic_mpp")] public static extern bool Bolt12InvoiceFeatures_requires_basic_mpp(long _this_arg); + // void InitFeatures_set_wumbo_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_wumbo_optional")] public static extern void InitFeatures_set_wumbo_optional(long _this_arg); + // void InitFeatures_set_wumbo_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_wumbo_required")] public static extern void InitFeatures_set_wumbo_required(long _this_arg); + // MUST_USE_RES bool InitFeatures_supports_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_wumbo")] public static extern bool InitFeatures_supports_wumbo(long _this_arg); + // void NodeFeatures_set_wumbo_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_wumbo_optional")] public static extern void NodeFeatures_set_wumbo_optional(long _this_arg); + // void NodeFeatures_set_wumbo_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_wumbo_required")] public static extern void NodeFeatures_set_wumbo_required(long _this_arg); + // MUST_USE_RES bool NodeFeatures_supports_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_wumbo")] public static extern bool NodeFeatures_supports_wumbo(long _this_arg); + // MUST_USE_RES bool InitFeatures_requires_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_wumbo")] public static extern bool InitFeatures_requires_wumbo(long _this_arg); + // MUST_USE_RES bool NodeFeatures_requires_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_wumbo")] public static extern bool NodeFeatures_requires_wumbo(long _this_arg); + // void InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional")] public static extern void InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(long _this_arg); + // void InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_anchors_nonzero_fee_htlc_tx_required")] public static extern void InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(long _this_arg); + // MUST_USE_RES bool InitFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_anchors_nonzero_fee_htlc_tx")] public static extern bool InitFeatures_supports_anchors_nonzero_fee_htlc_tx(long _this_arg); + // void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional")] public static extern void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(long _this_arg); + // void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required")] public static extern void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(long _this_arg); + // MUST_USE_RES bool NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_anchors_nonzero_fee_htlc_tx")] public static extern bool NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(long _this_arg); + // void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional")] public static extern void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(long _this_arg); + // void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required")] public static extern void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(long _this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx")] public static extern bool ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(long _this_arg); + // MUST_USE_RES bool InitFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_anchors_nonzero_fee_htlc_tx")] public static extern bool InitFeatures_requires_anchors_nonzero_fee_htlc_tx(long _this_arg); + // MUST_USE_RES bool NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_anchors_nonzero_fee_htlc_tx")] public static extern bool NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(long _this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx")] public static extern bool ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(long _this_arg); + // void InitFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_anchors_zero_fee_htlc_tx_optional")] public static extern void InitFeatures_set_anchors_zero_fee_htlc_tx_optional(long _this_arg); + // void InitFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_anchors_zero_fee_htlc_tx_required")] public static extern void InitFeatures_set_anchors_zero_fee_htlc_tx_required(long _this_arg); + // MUST_USE_RES bool InitFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_anchors_zero_fee_htlc_tx")] public static extern bool InitFeatures_supports_anchors_zero_fee_htlc_tx(long _this_arg); + // void NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_anchors_zero_fee_htlc_tx_optional")] public static extern void NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(long _this_arg); + // void NodeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_anchors_zero_fee_htlc_tx_required")] public static extern void NodeFeatures_set_anchors_zero_fee_htlc_tx_required(long _this_arg); + // MUST_USE_RES bool NodeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_anchors_zero_fee_htlc_tx")] public static extern bool NodeFeatures_supports_anchors_zero_fee_htlc_tx(long _this_arg); + // void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional")] public static extern void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(long _this_arg); + // void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required")] public static extern void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(long _this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx")] public static extern bool ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(long _this_arg); + // MUST_USE_RES bool InitFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_anchors_zero_fee_htlc_tx")] public static extern bool InitFeatures_requires_anchors_zero_fee_htlc_tx(long _this_arg); + // MUST_USE_RES bool NodeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_anchors_zero_fee_htlc_tx")] public static extern bool NodeFeatures_requires_anchors_zero_fee_htlc_tx(long _this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx")] public static extern bool ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(long _this_arg); + // void InitFeatures_set_route_blinding_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_route_blinding_optional")] public static extern void InitFeatures_set_route_blinding_optional(long _this_arg); + // void InitFeatures_set_route_blinding_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_route_blinding_required")] public static extern void InitFeatures_set_route_blinding_required(long _this_arg); + // MUST_USE_RES bool InitFeatures_supports_route_blinding(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_route_blinding")] public static extern bool InitFeatures_supports_route_blinding(long _this_arg); + // void NodeFeatures_set_route_blinding_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_route_blinding_optional")] public static extern void NodeFeatures_set_route_blinding_optional(long _this_arg); + // void NodeFeatures_set_route_blinding_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_route_blinding_required")] public static extern void NodeFeatures_set_route_blinding_required(long _this_arg); + // MUST_USE_RES bool NodeFeatures_supports_route_blinding(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_route_blinding")] public static extern bool NodeFeatures_supports_route_blinding(long _this_arg); + // MUST_USE_RES bool InitFeatures_requires_route_blinding(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_route_blinding")] public static extern bool InitFeatures_requires_route_blinding(long _this_arg); + // MUST_USE_RES bool NodeFeatures_requires_route_blinding(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_route_blinding")] public static extern bool NodeFeatures_requires_route_blinding(long _this_arg); + // void InitFeatures_set_shutdown_any_segwit_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_shutdown_any_segwit_optional")] public static extern void InitFeatures_set_shutdown_any_segwit_optional(long _this_arg); + // void InitFeatures_set_shutdown_any_segwit_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_shutdown_any_segwit_required")] public static extern void InitFeatures_set_shutdown_any_segwit_required(long _this_arg); + // MUST_USE_RES bool InitFeatures_supports_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_shutdown_anysegwit")] public static extern bool InitFeatures_supports_shutdown_anysegwit(long _this_arg); + // void NodeFeatures_set_shutdown_any_segwit_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_shutdown_any_segwit_optional")] public static extern void NodeFeatures_set_shutdown_any_segwit_optional(long _this_arg); + // void NodeFeatures_set_shutdown_any_segwit_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_shutdown_any_segwit_required")] public static extern void NodeFeatures_set_shutdown_any_segwit_required(long _this_arg); + // MUST_USE_RES bool NodeFeatures_supports_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_shutdown_anysegwit")] public static extern bool NodeFeatures_supports_shutdown_anysegwit(long _this_arg); + // MUST_USE_RES bool InitFeatures_requires_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_shutdown_anysegwit")] public static extern bool InitFeatures_requires_shutdown_anysegwit(long _this_arg); + // MUST_USE_RES bool NodeFeatures_requires_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_shutdown_anysegwit")] public static extern bool NodeFeatures_requires_shutdown_anysegwit(long _this_arg); + // void InitFeatures_set_taproot_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_taproot_optional")] public static extern void InitFeatures_set_taproot_optional(long _this_arg); + // void InitFeatures_set_taproot_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_taproot_required")] public static extern void InitFeatures_set_taproot_required(long _this_arg); + // MUST_USE_RES bool InitFeatures_supports_taproot(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_taproot")] public static extern bool InitFeatures_supports_taproot(long _this_arg); + // void NodeFeatures_set_taproot_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_taproot_optional")] public static extern void NodeFeatures_set_taproot_optional(long _this_arg); + // void NodeFeatures_set_taproot_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_taproot_required")] public static extern void NodeFeatures_set_taproot_required(long _this_arg); + // MUST_USE_RES bool NodeFeatures_supports_taproot(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_taproot")] public static extern bool NodeFeatures_supports_taproot(long _this_arg); + // void ChannelTypeFeatures_set_taproot_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_taproot_optional")] public static extern void ChannelTypeFeatures_set_taproot_optional(long _this_arg); + // void ChannelTypeFeatures_set_taproot_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_taproot_required")] public static extern void ChannelTypeFeatures_set_taproot_required(long _this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_supports_taproot(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_supports_taproot")] public static extern bool ChannelTypeFeatures_supports_taproot(long _this_arg); + // MUST_USE_RES bool InitFeatures_requires_taproot(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_taproot")] public static extern bool InitFeatures_requires_taproot(long _this_arg); + // MUST_USE_RES bool NodeFeatures_requires_taproot(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_taproot")] public static extern bool NodeFeatures_requires_taproot(long _this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_requires_taproot(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_requires_taproot")] public static extern bool ChannelTypeFeatures_requires_taproot(long _this_arg); + // void InitFeatures_set_onion_messages_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_onion_messages_optional")] public static extern void InitFeatures_set_onion_messages_optional(long _this_arg); + // void InitFeatures_set_onion_messages_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_onion_messages_required")] public static extern void InitFeatures_set_onion_messages_required(long _this_arg); + // MUST_USE_RES bool InitFeatures_supports_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_onion_messages")] public static extern bool InitFeatures_supports_onion_messages(long _this_arg); + // void NodeFeatures_set_onion_messages_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_onion_messages_optional")] public static extern void NodeFeatures_set_onion_messages_optional(long _this_arg); + // void NodeFeatures_set_onion_messages_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_onion_messages_required")] public static extern void NodeFeatures_set_onion_messages_required(long _this_arg); + // MUST_USE_RES bool NodeFeatures_supports_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_onion_messages")] public static extern bool NodeFeatures_supports_onion_messages(long _this_arg); + // MUST_USE_RES bool InitFeatures_requires_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_onion_messages")] public static extern bool InitFeatures_requires_onion_messages(long _this_arg); + // MUST_USE_RES bool NodeFeatures_requires_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_onion_messages")] public static extern bool NodeFeatures_requires_onion_messages(long _this_arg); + // void InitFeatures_set_channel_type_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_channel_type_optional")] public static extern void InitFeatures_set_channel_type_optional(long _this_arg); + // void InitFeatures_set_channel_type_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_channel_type_required")] public static extern void InitFeatures_set_channel_type_required(long _this_arg); + // MUST_USE_RES bool InitFeatures_supports_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_channel_type")] public static extern bool InitFeatures_supports_channel_type(long _this_arg); + // void NodeFeatures_set_channel_type_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_channel_type_optional")] public static extern void NodeFeatures_set_channel_type_optional(long _this_arg); + // void NodeFeatures_set_channel_type_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_channel_type_required")] public static extern void NodeFeatures_set_channel_type_required(long _this_arg); + // MUST_USE_RES bool NodeFeatures_supports_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_channel_type")] public static extern bool NodeFeatures_supports_channel_type(long _this_arg); + // MUST_USE_RES bool InitFeatures_requires_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_channel_type")] public static extern bool InitFeatures_requires_channel_type(long _this_arg); + // MUST_USE_RES bool NodeFeatures_requires_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_channel_type")] public static extern bool NodeFeatures_requires_channel_type(long _this_arg); + // void InitFeatures_set_scid_privacy_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_scid_privacy_optional")] public static extern void InitFeatures_set_scid_privacy_optional(long _this_arg); + // void InitFeatures_set_scid_privacy_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_scid_privacy_required")] public static extern void InitFeatures_set_scid_privacy_required(long _this_arg); + // MUST_USE_RES bool InitFeatures_supports_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_scid_privacy")] public static extern bool InitFeatures_supports_scid_privacy(long _this_arg); + // void NodeFeatures_set_scid_privacy_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_scid_privacy_optional")] public static extern void NodeFeatures_set_scid_privacy_optional(long _this_arg); + // void NodeFeatures_set_scid_privacy_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_scid_privacy_required")] public static extern void NodeFeatures_set_scid_privacy_required(long _this_arg); + // MUST_USE_RES bool NodeFeatures_supports_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_scid_privacy")] public static extern bool NodeFeatures_supports_scid_privacy(long _this_arg); + // void ChannelTypeFeatures_set_scid_privacy_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_scid_privacy_optional")] public static extern void ChannelTypeFeatures_set_scid_privacy_optional(long _this_arg); + // void ChannelTypeFeatures_set_scid_privacy_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_scid_privacy_required")] public static extern void ChannelTypeFeatures_set_scid_privacy_required(long _this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_supports_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_supports_scid_privacy")] public static extern bool ChannelTypeFeatures_supports_scid_privacy(long _this_arg); + // MUST_USE_RES bool InitFeatures_requires_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_scid_privacy")] public static extern bool InitFeatures_requires_scid_privacy(long _this_arg); + // MUST_USE_RES bool NodeFeatures_requires_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_scid_privacy")] public static extern bool NodeFeatures_requires_scid_privacy(long _this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_requires_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_requires_scid_privacy")] public static extern bool ChannelTypeFeatures_requires_scid_privacy(long _this_arg); + // void Bolt11InvoiceFeatures_set_payment_metadata_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_set_payment_metadata_optional")] public static extern void Bolt11InvoiceFeatures_set_payment_metadata_optional(long _this_arg); + // void Bolt11InvoiceFeatures_set_payment_metadata_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_set_payment_metadata_required")] public static extern void Bolt11InvoiceFeatures_set_payment_metadata_required(long _this_arg); + // MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_supports_payment_metadata")] public static extern bool Bolt11InvoiceFeatures_supports_payment_metadata(long _this_arg); + // MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_requires_payment_metadata")] public static extern bool Bolt11InvoiceFeatures_requires_payment_metadata(long _this_arg); + // void InitFeatures_set_zero_conf_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_zero_conf_optional")] public static extern void InitFeatures_set_zero_conf_optional(long _this_arg); + // void InitFeatures_set_zero_conf_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_zero_conf_required")] public static extern void InitFeatures_set_zero_conf_required(long _this_arg); + // MUST_USE_RES bool InitFeatures_supports_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_zero_conf")] public static extern bool InitFeatures_supports_zero_conf(long _this_arg); + // void NodeFeatures_set_zero_conf_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_zero_conf_optional")] public static extern void NodeFeatures_set_zero_conf_optional(long _this_arg); + // void NodeFeatures_set_zero_conf_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_zero_conf_required")] public static extern void NodeFeatures_set_zero_conf_required(long _this_arg); + // MUST_USE_RES bool NodeFeatures_supports_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_zero_conf")] public static extern bool NodeFeatures_supports_zero_conf(long _this_arg); + // void ChannelTypeFeatures_set_zero_conf_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_zero_conf_optional")] public static extern void ChannelTypeFeatures_set_zero_conf_optional(long _this_arg); + // void ChannelTypeFeatures_set_zero_conf_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_zero_conf_required")] public static extern void ChannelTypeFeatures_set_zero_conf_required(long _this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_supports_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_supports_zero_conf")] public static extern bool ChannelTypeFeatures_supports_zero_conf(long _this_arg); + // MUST_USE_RES bool InitFeatures_requires_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_zero_conf")] public static extern bool InitFeatures_requires_zero_conf(long _this_arg); + // MUST_USE_RES bool NodeFeatures_requires_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_zero_conf")] public static extern bool NodeFeatures_requires_zero_conf(long _this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_requires_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_requires_zero_conf")] public static extern bool ChannelTypeFeatures_requires_zero_conf(long _this_arg); + // void NodeFeatures_set_keysend_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_keysend_optional")] public static extern void NodeFeatures_set_keysend_optional(long _this_arg); + // void NodeFeatures_set_keysend_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_keysend_required")] public static extern void NodeFeatures_set_keysend_required(long _this_arg); + // MUST_USE_RES bool NodeFeatures_supports_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [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 RoutingFees_free(struct LDKRoutingFees this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingFees_free")] public static extern void RoutingFees_free(long _this_obj); + // uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingFees_get_base_msat")] public static extern int RoutingFees_get_base_msat(long _this_ptr); + // void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingFees_set_base_msat")] public static extern void RoutingFees_set_base_msat(long _this_ptr, int _val); + // uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingFees_get_proportional_millionths")] public static extern int RoutingFees_get_proportional_millionths(long _this_ptr); + // void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingFees_set_proportional_millionths")] public static extern void RoutingFees_set_proportional_millionths(long _this_ptr, int _val); + // MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingFees_new")] public static extern long RoutingFees_new(int _base_msat_arg, int _proportional_millionths_arg); + // bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingFees_eq")] public static extern bool RoutingFees_eq(long _a, long _b); + // uint64_t RoutingFees_clone_ptr(LDKRoutingFees *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingFees_clone_ptr")] public static extern long RoutingFees_clone_ptr(long _arg); + // struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingFees_clone")] public static extern long RoutingFees_clone(long _orig); + // uint64_t RoutingFees_hash(const struct LDKRoutingFees *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingFees_hash")] public static extern long RoutingFees_hash(long _o); + // void RouteHint_free(struct LDKRouteHint this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHint_free")] public static extern void RouteHint_free(long _this_obj); + // struct LDKCVec_RouteHintHopZ RouteHint_get_a(const struct LDKRouteHint *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHint_get_a")] public static extern long RouteHint_get_a(long _this_ptr); + // void RouteHint_set_a(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintHopZ val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHint_set_a")] public static extern void RouteHint_set_a(long _this_ptr, long _val); + // MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHint_new")] public static extern long RouteHint_new(long _a_arg); + // uint64_t RouteHint_clone_ptr(LDKRouteHint *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHint_clone_ptr")] public static extern long RouteHint_clone_ptr(long _arg); + // struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHint_clone")] public static extern long RouteHint_clone(long _orig); + // uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHint_hash")] public static extern long RouteHint_hash(long _o); + // bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHint_eq")] public static extern bool RouteHint_eq(long _a, long _b); + // void RouteHintHop_free(struct LDKRouteHintHop this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_free")] public static extern void RouteHintHop_free(long _this_obj); + // struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_get_src_node_id")] public static extern long RouteHintHop_get_src_node_id(long _this_ptr); + // void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_set_src_node_id")] public static extern void RouteHintHop_set_src_node_id(long _this_ptr, long _val); + // uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_get_short_channel_id")] public static extern long RouteHintHop_get_short_channel_id(long _this_ptr); + // void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_set_short_channel_id")] public static extern void RouteHintHop_set_short_channel_id(long _this_ptr, long _val); + // struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_get_fees")] public static extern long RouteHintHop_get_fees(long _this_ptr); + // void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_set_fees")] public static extern void RouteHintHop_set_fees(long _this_ptr, long _val); + // uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_get_cltv_expiry_delta")] public static extern short RouteHintHop_get_cltv_expiry_delta(long _this_ptr); + // void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_set_cltv_expiry_delta")] public static extern void RouteHintHop_set_cltv_expiry_delta(long _this_ptr, short _val); + // struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_get_htlc_minimum_msat")] public static extern long RouteHintHop_get_htlc_minimum_msat(long _this_ptr); + // void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_set_htlc_minimum_msat")] public static extern void RouteHintHop_set_htlc_minimum_msat(long _this_ptr, long _val); + // struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_get_htlc_maximum_msat")] public static extern long RouteHintHop_get_htlc_maximum_msat(long _this_ptr); + // void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_set_htlc_maximum_msat")] public static extern void RouteHintHop_set_htlc_maximum_msat(long _this_ptr, long _val); + // MUST_USE_RES struct LDKRouteHintHop RouteHintHop_new(struct LDKPublicKey src_node_id_arg, uint64_t short_channel_id_arg, struct LDKRoutingFees fees_arg, uint16_t cltv_expiry_delta_arg, struct LDKCOption_u64Z htlc_minimum_msat_arg, struct LDKCOption_u64Z htlc_maximum_msat_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_new")] public static extern long RouteHintHop_new(long _src_node_id_arg, long _short_channel_id_arg, long _fees_arg, short _cltv_expiry_delta_arg, long _htlc_minimum_msat_arg, long _htlc_maximum_msat_arg); + // uint64_t RouteHintHop_clone_ptr(LDKRouteHintHop *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_clone_ptr")] public static extern long RouteHintHop_clone_ptr(long _arg); + // struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_clone")] public static extern long RouteHintHop_clone(long _orig); + // uint64_t RouteHintHop_hash(const struct LDKRouteHintHop *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_hash")] public static extern long RouteHintHop_hash(long _o); + // bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_eq")] public static extern bool RouteHintHop_eq(long _a, long _b); + // 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); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UntrustedString_get_a")] public static extern long UntrustedString_get_a(long _this_ptr); + // void UntrustedString_set_a(struct LDKUntrustedString *NONNULL_PTR this_ptr, struct LDKStr val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UntrustedString_set_a")] public static extern void UntrustedString_set_a(long _this_ptr, long _val); + // MUST_USE_RES struct LDKUntrustedString UntrustedString_new(struct LDKStr a_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UntrustedString_new")] public static extern long UntrustedString_new(long _a_arg); + // uint64_t UntrustedString_clone_ptr(LDKUntrustedString *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UntrustedString_clone_ptr")] public static extern long UntrustedString_clone_ptr(long _arg); + // struct LDKUntrustedString UntrustedString_clone(const struct LDKUntrustedString *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UntrustedString_clone")] public static extern long UntrustedString_clone(long _orig); + // bool UntrustedString_eq(const struct LDKUntrustedString *NONNULL_PTR a, const struct LDKUntrustedString *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UntrustedString_eq")] public static extern bool UntrustedString_eq(long _a, long _b); + // uint64_t UntrustedString_hash(const struct LDKUntrustedString *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UntrustedString_hash")] public static extern long UntrustedString_hash(long _o); + // struct LDKStr UntrustedString_to_str(const struct LDKUntrustedString *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UntrustedString_to_str")] public static extern long UntrustedString_to_str(long _o); + // void PrintableString_free(struct LDKPrintableString this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PrintableString_free")] public static extern void PrintableString_free(long _this_obj); + // struct LDKStr PrintableString_get_a(const struct LDKPrintableString *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PrintableString_get_a")] public static extern long PrintableString_get_a(long _this_ptr); + // void PrintableString_set_a(struct LDKPrintableString *NONNULL_PTR this_ptr, struct LDKStr val); + [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); + // struct LDKStr PrintableString_to_str(const struct LDKPrintableString *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PrintableString_to_str")] public static extern long PrintableString_to_str(long _o); // void FilesystemStore_free(struct LDKFilesystemStore this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FilesystemStore_free")] public static extern void FilesystemStore_free(long _this_obj); // MUST_USE_RES struct LDKFilesystemStore FilesystemStore_new(struct LDKStr data_dir); @@ -14352,8 +15213,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_GossipSync_rapid")] public static extern long GossipSync_rapid(long _a); // struct LDKGossipSync GossipSync_none(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_GossipSync_none")] public static extern long GossipSync_none(); - // MUST_USE_RES struct LDKBackgroundProcessor BackgroundProcessor_start(struct LDKPersister persister, struct LDKEventHandler event_handler, const struct LDKChainMonitor *NONNULL_PTR chain_monitor, const struct LDKChannelManager *NONNULL_PTR channel_manager, struct LDKGossipSync gossip_sync, const struct LDKPeerManager *NONNULL_PTR peer_manager, struct LDKLogger logger, struct LDKCOption_WriteableScoreZ scorer); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BackgroundProcessor_start")] public static extern long BackgroundProcessor_start(long _persister, long _event_handler, long _chain_monitor, long _channel_manager, long _gossip_sync, long _peer_manager, long _logger, long _scorer); + // MUST_USE_RES struct LDKBackgroundProcessor BackgroundProcessor_start(struct LDKPersister persister, struct LDKEventHandler event_handler, const struct LDKChainMonitor *NONNULL_PTR chain_monitor, const struct LDKChannelManager *NONNULL_PTR channel_manager, const struct LDKOnionMessenger *NONNULL_PTR onion_messenger, struct LDKGossipSync gossip_sync, const struct LDKPeerManager *NONNULL_PTR peer_manager, struct LDKLogger logger, struct LDKCOption_WriteableScoreZ scorer); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BackgroundProcessor_start")] public static extern long BackgroundProcessor_start(long _persister, long _event_handler, long _chain_monitor, long _channel_manager, long _onion_messenger, long _gossip_sync, long _peer_manager, long _logger, long _scorer); // MUST_USE_RES struct LDKCResult_NoneIOErrorZ BackgroundProcessor_join(struct LDKBackgroundProcessor this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BackgroundProcessor_join")] public static extern long BackgroundProcessor_join(long _this_arg); // MUST_USE_RES struct LDKCResult_NoneIOErrorZ BackgroundProcessor_stop(struct LDKBackgroundProcessor this_arg); @@ -14586,6 +15447,12 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Fallback_eq")] public static extern bool Fallback_eq(long _a, long _b); // void Bolt11InvoiceSignature_free(struct LDKBolt11InvoiceSignature this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceSignature_free")] public static extern void Bolt11InvoiceSignature_free(long _this_obj); + // struct LDKRecoverableSignature Bolt11InvoiceSignature_get_a(const struct LDKBolt11InvoiceSignature *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceSignature_get_a")] public static extern long Bolt11InvoiceSignature_get_a(long _this_ptr); + // void Bolt11InvoiceSignature_set_a(struct LDKBolt11InvoiceSignature *NONNULL_PTR this_ptr, struct LDKRecoverableSignature val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceSignature_set_a")] public static extern void Bolt11InvoiceSignature_set_a(long _this_ptr, long _val); + // MUST_USE_RES struct LDKBolt11InvoiceSignature Bolt11InvoiceSignature_new(struct LDKRecoverableSignature a_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceSignature_new")] public static extern long Bolt11InvoiceSignature_new(long _a_arg); // uint64_t Bolt11InvoiceSignature_clone_ptr(LDKBolt11InvoiceSignature *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceSignature_clone_ptr")] public static extern long Bolt11InvoiceSignature_clone_ptr(long _arg); // struct LDKBolt11InvoiceSignature Bolt11InvoiceSignature_clone(const struct LDKBolt11InvoiceSignature *NONNULL_PTR orig); @@ -14708,6 +15575,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Description_new")] public static extern long Description_new(long _description); // MUST_USE_RES struct LDKUntrustedString Description_into_inner(struct LDKDescription this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Description_into_inner")] public static extern long Description_into_inner(long _this_arg); + // MUST_USE_RES struct LDKUntrustedString Description_as_inner(const struct LDKDescription *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Description_as_inner")] public static extern long Description_as_inner(long _this_arg); // struct LDKStr Description_to_str(const struct LDKDescription *NONNULL_PTR o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Description_to_str")] public static extern long Description_to_str(long _o); // MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_seconds(uint64_t seconds); @@ -14780,24 +15649,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignOrCreationError_eq")] public static extern bool SignOrCreationError_eq(long _a, long _b); // struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignOrCreationError_to_str")] public static extern long SignOrCreationError_to_str(long _o); - // struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ payment_parameters_from_zero_amount_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice, uint64_t amount_msat); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_payment_parameters_from_zero_amount_invoice")] public static extern long payment_parameters_from_zero_amount_invoice(long _invoice, long _amount_msat); - // struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ payment_parameters_from_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_payment_parameters_from_invoice")] public static extern long payment_parameters_from_invoice(long _invoice); - // struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_phantom_invoice(struct LDKCOption_u64Z amt_msat, struct LDKCOption_ThirtyTwoBytesZ payment_hash, struct LDKStr description, uint32_t invoice_expiry_delta_secs, struct LDKCVec_PhantomRouteHintsZ phantom_route_hints, struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u16Z min_final_cltv_expiry_delta, uint64_t duration_since_epoch); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_create_phantom_invoice")] public static extern long create_phantom_invoice(long _amt_msat, long _payment_hash, long _description, int _invoice_expiry_delta_secs, long _phantom_route_hints, long _entropy_source, long _node_signer, long _logger, Currency _network, long _min_final_cltv_expiry_delta, long _duration_since_epoch); - // struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_phantom_invoice_with_description_hash(struct LDKCOption_u64Z amt_msat, struct LDKCOption_ThirtyTwoBytesZ payment_hash, uint32_t invoice_expiry_delta_secs, struct LDKSha256 description_hash, struct LDKCVec_PhantomRouteHintsZ phantom_route_hints, struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u16Z min_final_cltv_expiry_delta, uint64_t duration_since_epoch); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_create_phantom_invoice_with_description_hash")] public static extern long create_phantom_invoice_with_description_hash(long _amt_msat, long _payment_hash, int _invoice_expiry_delta_secs, long _description_hash, long _phantom_route_hints, long _entropy_source, long _node_signer, long _logger, Currency _network, long _min_final_cltv_expiry_delta, long _duration_since_epoch); - // struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_create_invoice_from_channelmanager")] public static extern long create_invoice_from_channelmanager(long _channelmanager, long _node_signer, long _logger, Currency _network, long _amt_msat, long _description, int _invoice_expiry_delta_secs, long _min_final_cltv_expiry_delta); - // struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKSha256 description_hash, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_create_invoice_from_channelmanager_with_description_hash")] public static extern long create_invoice_from_channelmanager_with_description_hash(long _channelmanager, long _node_signer, long _logger, Currency _network, long _amt_msat, long _description_hash, int _invoice_expiry_delta_secs, long _min_final_cltv_expiry_delta); - // struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKSha256 description_hash, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch")] public static extern long create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(long _channelmanager, long _node_signer, long _logger, Currency _network, long _amt_msat, long _description_hash, long _duration_since_epoch, int _invoice_expiry_delta_secs, long _min_final_cltv_expiry_delta); - // struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_create_invoice_from_channelmanager_and_duration_since_epoch")] public static extern long create_invoice_from_channelmanager_and_duration_since_epoch(long _channelmanager, long _node_signer, long _logger, Currency _network, long _amt_msat, long _description, long _duration_since_epoch, int _invoice_expiry_delta_secs, long _min_final_cltv_expiry_delta); - // struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u16Z min_final_cltv_expiry_delta); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash")] public static extern long create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(long _channelmanager, long _node_signer, long _logger, Currency _network, long _amt_msat, long _description, long _duration_since_epoch, int _invoice_expiry_delta_secs, long _payment_hash, long _min_final_cltv_expiry_delta); // struct LDKCResult_SiPrefixBolt11ParseErrorZ SiPrefix_from_str(struct LDKStr s); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SiPrefix_from_str")] public static extern long SiPrefix_from_str(long _s); // struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ Bolt11Invoice_from_str(struct LDKStr s); @@ -14887,175 +15738,168 @@ internal class bindings { Environment.Exit(44); } return ((LDKEcdsaChannelSigner)obj).sign_channel_announcement_with_funding_key(a); - case 36: + case 35: if (!(obj is LDKNodeSigner)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKNodeSigner in l_l"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKNodeSigner)obj).sign_bolt12_invoice_request(a); - case 37: + case 36: if (!(obj is LDKNodeSigner)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKNodeSigner in l_l"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKNodeSigner)obj).sign_bolt12_invoice(a); - case 38: + case 37: if (!(obj is LDKNodeSigner)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKNodeSigner in l_l"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKNodeSigner)obj).sign_gossip_message(a); - case 41: + case 40: if (!(obj is LDKSignerProvider)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKSignerProvider in l_l"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKSignerProvider)obj).read_chan_signer(a); - case 42: + case 41: if (!(obj is LDKSignerProvider)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKSignerProvider in l_l"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKSignerProvider)obj).get_destination_script(a); - case 64: + 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_manager(a); - case 65: + 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(); Environment.Exit(44); } return ((LDKPersister)obj).persist_graph(a); - case 66: + case 67: 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_scorer(a); - case 114: - if (!(obj is LDKChannelMessageHandler)) { - Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in l_l"); + case 79: + if (!(obj is LDKEventHandler)) { + Console.Error.WriteLine("Got function call to object that wasn't a LDKEventHandler in l_l"); Console.Error.Flush(); Environment.Exit(44); } - return ((LDKChannelMessageHandler)obj).provided_init_features(a); - case 116: - if (!(obj is LDKOffersMessageHandler)) { - Console.Error.WriteLine("Got function call to object that wasn't a LDKOffersMessageHandler in l_l"); + return ((LDKEventHandler)obj).handle_event(a); + case 115: + if (!(obj is LDKChannelMessageHandler)) { + Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in l_l"); Console.Error.Flush(); Environment.Exit(44); } - return ((LDKOffersMessageHandler)obj).handle_message(a); - case 118: + return ((LDKChannelMessageHandler)obj).provided_init_features(a); + case 122: 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: + 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).handle_node_announcement(a); - case 120: + case 124: 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 121: + case 125: 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 122: + case 126: 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 123: + case 127: 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 131: + case 135: 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 134: + case 137: 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 139: + case 142: 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 144: + case 149: 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 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: + case 157: 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: + case 158: 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: + case 161: 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 159: + case 164: if (!(obj is LDKWalletSource)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKWalletSource in l_l"); Console.Error.Flush(); @@ -15107,77 +15951,77 @@ internal class bindings { Environment.Exit(44); } return ((LDKEcdsaChannelSigner)obj).sign_holder_anchor_input(a, b); - case 26: + case 25: if (!(obj is LDKUtxoLookup)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKUtxoLookup in l_ll"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKUtxoLookup)obj).get_utxo(a, b); - case 27: + case 26: if (!(obj is LDKWatch)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKWatch in l_ll"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKWatch)obj).watch_channel(a, b); - case 40: + case 39: if (!(obj is LDKSignerProvider)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKSignerProvider in l_ll"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKSignerProvider)obj).derive_channel_signer(a, b); - case 46: - if (!(obj is LDKMessageRouter)) { - Console.Error.WriteLine("Got function call to object that wasn't a LDKMessageRouter in l_ll"); - Console.Error.Flush(); - Environment.Exit(44); - } - return ((LDKMessageRouter)obj).create_blinded_paths(a, b); - case 62: + case 63: 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 125: + case 119: + if (!(obj is LDKAsyncPaymentsMessageHandler)) { + Console.Error.WriteLine("Got function call to object that wasn't a LDKAsyncPaymentsMessageHandler in l_ll"); + Console.Error.Flush(); + Environment.Exit(44); + } + return ((LDKAsyncPaymentsMessageHandler)obj).held_htlc_available(a, b); + case 129: 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 126: + case 130: 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 127: + case 131: 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 128: + case 132: 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 141: + case 144: 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 146: + case 151: if (!(obj is LDKCustomOnionMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKCustomOnionMessageHandler in l_ll"); Console.Error.Flush(); @@ -15215,56 +16059,49 @@ internal class bindings { Environment.Exit(44); } return ((LDKChannelSigner)obj).channel_keys_id(); - case 15: - if (!(obj is LDKWriteableEcdsaChannelSigner)) { - Console.Error.WriteLine("Got function call to object that wasn't a LDKWriteableEcdsaChannelSigner in l_"); - Console.Error.Flush(); - Environment.Exit(44); - } - return ((LDKWriteableEcdsaChannelSigner)obj).write(); - case 22: + case 21: if (!(obj is LDKLockableScore)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKLockableScore in l_"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKLockableScore)obj).read_lock(); - case 23: + case 22: if (!(obj is LDKLockableScore)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKLockableScore in l_"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKLockableScore)obj).write_lock(); - case 24: + case 23: if (!(obj is LDKWriteableScore)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKWriteableScore in l_"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKWriteableScore)obj).write(); - case 29: + case 28: if (!(obj is LDKWatch)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKWatch in l_"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKWatch)obj).release_pending_monitor_events(); - case 31: + case 30: if (!(obj is LDKEntropySource)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKEntropySource in l_"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKEntropySource)obj).get_secure_random_bytes(); - case 32: + case 31: if (!(obj is LDKNodeSigner)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKNodeSigner in l_"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKNodeSigner)obj).get_inbound_payment_key_material(); - case 43: + case 42: if (!(obj is LDKSignerProvider)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKSignerProvider in l_"); Console.Error.Flush(); @@ -15298,120 +16135,127 @@ internal class bindings { Console.Error.Flush(); Environment.Exit(44); } - return ((LDKOnionMessageContents)obj).write(); + return ((LDKOnionMessageContents)obj).msg_type(); case 55: + if (!(obj is LDKOnionMessageContents)) { + Console.Error.WriteLine("Got function call to object that wasn't a LDKOnionMessageContents in l_"); + Console.Error.Flush(); + Environment.Exit(44); + } + return ((LDKOnionMessageContents)obj).write(); + case 56: if (!(obj is LDKOnionMessageContents)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKOnionMessageContents in l_"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKOnionMessageContents)obj).debug_str(); - case 58: + case 59: 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: + case 77: 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 80: + case 81: if (!(obj is LDKMessageSendEventsProvider)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKMessageSendEventsProvider in l_"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKMessageSendEventsProvider)obj).get_and_clear_pending_msg_events(); - case 113: + case 114: if (!(obj is LDKChannelMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in l_"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKChannelMessageHandler)obj).provided_node_features(); - case 115: + case 116: if (!(obj is LDKChannelMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in l_"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKChannelMessageHandler)obj).get_chain_hashes(); - case 117: + case 118: if (!(obj is LDKOffersMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKOffersMessageHandler in l_"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKOffersMessageHandler)obj).release_pending_messages(); - case 130: - if (!(obj is LDKRoutingMessageHandler)) { - Console.Error.WriteLine("Got function call to object that wasn't a LDKRoutingMessageHandler in l_"); + case 121: + if (!(obj is LDKAsyncPaymentsMessageHandler)) { + Console.Error.WriteLine("Got function call to object that wasn't a LDKAsyncPaymentsMessageHandler in l_"); Console.Error.Flush(); Environment.Exit(44); } - return ((LDKRoutingMessageHandler)obj).provided_node_features(); - case 132: - if (!(obj is LDKOnionMessageHandler)) { - Console.Error.WriteLine("Got function call to object that wasn't a LDKOnionMessageHandler in l_"); + return ((LDKAsyncPaymentsMessageHandler)obj).release_pending_messages(); + case 134: + 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 ((LDKOnionMessageHandler)obj).get_and_clear_connections_needed(); - case 138: + return ((LDKRoutingMessageHandler)obj).provided_node_features(); + case 141: 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 142: + case 145: 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 143: + case 148: 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 147: + case 152: 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 151: + case 156: 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 154: + case 159: 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 157: + case 162: 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 158: + case 163: if (!(obj is LDKWalletSource)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKWalletSource in l_"); Console.Error.Flush(); @@ -15450,7 +16294,7 @@ internal class bindings { } ((LDKChannelSigner)obj).provide_channel_parameters(a); return; - case 21: + case 20: if (!(obj is LDKScoreUpdate)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKScoreUpdate in void_l"); Console.Error.Flush(); @@ -15458,7 +16302,7 @@ internal class bindings { } ((LDKScoreUpdate)obj).time_passed(a); return; - case 25: + case 24: if (!(obj is LDKLogger)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKLogger in void_l"); Console.Error.Flush(); @@ -15466,7 +16310,7 @@ internal class bindings { } ((LDKLogger)obj).log(a); return; - case 30: + case 29: if (!(obj is LDKBroadcasterInterface)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKBroadcasterInterface in void_l"); Console.Error.Flush(); @@ -15474,7 +16318,7 @@ internal class bindings { } ((LDKBroadcasterInterface)obj).broadcast_transactions(a); return; - case 57: + case 58: if (!(obj is LDKFilter)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKFilter in void_l"); Console.Error.Flush(); @@ -15482,7 +16326,7 @@ internal class bindings { } ((LDKFilter)obj).register_output(a); return; - case 69: + case 70: if (!(obj is LDKPersist)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKPersist in void_l"); Console.Error.Flush(); @@ -15490,7 +16334,7 @@ internal class bindings { } ((LDKPersist)obj).archive_persisted_channel(a); return; - case 74: + case 75: if (!(obj is LDKConfirm)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKConfirm in void_l"); Console.Error.Flush(); @@ -15498,15 +16342,7 @@ internal class bindings { } ((LDKConfirm)obj).transaction_unconfirmed(a); return; - 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(); - Environment.Exit(44); - } - ((LDKEventHandler)obj).handle_event(a); - return; - case 79: + case 80: if (!(obj is LDKEventsProvider)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKEventsProvider in void_l"); Console.Error.Flush(); @@ -15514,7 +16350,7 @@ internal class bindings { } ((LDKEventsProvider)obj).process_pending_events(a); return; - case 108: + case 109: if (!(obj is LDKChannelMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in void_l"); Console.Error.Flush(); @@ -15522,7 +16358,15 @@ internal class bindings { } ((LDKChannelMessageHandler)obj).peer_disconnected(a); return; - case 136: + case 120: + if (!(obj is LDKAsyncPaymentsMessageHandler)) { + Console.Error.WriteLine("Got function call to object that wasn't a LDKAsyncPaymentsMessageHandler in void_l"); + Console.Error.Flush(); + Environment.Exit(44); + } + ((LDKAsyncPaymentsMessageHandler)obj).release_held_htlc(a); + return; + case 139: if (!(obj is LDKOnionMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKOnionMessageHandler in void_l"); Console.Error.Flush(); @@ -15530,6 +16374,14 @@ internal class bindings { } ((LDKOnionMessageHandler)obj).peer_disconnected(a); return; + case 146: + if (!(obj is LDKCustomMessageHandler)) { + Console.Error.WriteLine("Got function call to object that wasn't a LDKCustomMessageHandler in void_l"); + Console.Error.Flush(); + Environment.Exit(44); + } + ((LDKCustomMessageHandler)obj).peer_disconnected(a); + return; default: Console.Error.WriteLine("Got unknown function call with id " + fn_id + " from C in void_l"); Console.Error.Flush(); @@ -15568,27 +16420,55 @@ internal class bindings { Environment.Exit(44); } return ((LDKEcdsaChannelSigner)obj).sign_holder_htlc_transaction(a, b, c); - case 16: + case 15: if (!(obj is LDKScoreLookUp)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKScoreLookUp in l_lll"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKScoreLookUp)obj).channel_penalty_msat(a, b, c); - case 45: + case 44: if (!(obj is LDKMessageRouter)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKMessageRouter in l_lll"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKMessageRouter)obj).find_path(a, b, c); - case 59: + case 45: + if (!(obj is LDKMessageRouter)) { + Console.Error.WriteLine("Got function call to object that wasn't a LDKMessageRouter in l_lll"); + Console.Error.Flush(); + Environment.Exit(44); + } + return ((LDKMessageRouter)obj).create_blinded_paths(a, b, c); + case 46: + if (!(obj is LDKMessageRouter)) { + Console.Error.WriteLine("Got function call to object that wasn't a LDKMessageRouter in l_lll"); + Console.Error.Flush(); + Environment.Exit(44); + } + return ((LDKMessageRouter)obj).create_compact_blinded_paths(a, b, c); + case 60: if (!(obj is LDKKVStore)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKKVStore in l_lll"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKKVStore)obj).read(a, b, c); + case 117: + if (!(obj is LDKOffersMessageHandler)) { + Console.Error.WriteLine("Got function call to object that wasn't a LDKOffersMessageHandler in l_lll"); + Console.Error.Flush(); + Environment.Exit(44); + } + return ((LDKOffersMessageHandler)obj).handle_message(a, b, c); + case 150: + if (!(obj is LDKCustomOnionMessageHandler)) { + Console.Error.WriteLine("Got function call to object that wasn't a LDKCustomOnionMessageHandler in l_lll"); + Console.Error.Flush(); + Environment.Exit(44); + } + return ((LDKCustomOnionMessageHandler)obj).handle_custom_message(a, b, c); default: Console.Error.WriteLine("Got unknown function call with id " + fn_id + " from C in l_lll"); Console.Error.Flush(); @@ -15634,7 +16514,7 @@ internal class bindings { Environment.Exit(44); } return ((LDKRouter)obj).create_blinded_payment_paths(a, b, c, d); - case 60: + case 61: if (!(obj is LDKKVStore)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKKVStore in l_llll"); Console.Error.Flush(); @@ -15703,7 +16583,7 @@ internal class bindings { Environment.Exit(43); } switch (fn_id) { - case 17: + case 16: if (!(obj is LDKScoreUpdate)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKScoreUpdate in void_lll"); Console.Error.Flush(); @@ -15711,7 +16591,7 @@ internal class bindings { } ((LDKScoreUpdate)obj).payment_path_failed(a, b, c); return; - case 19: + case 18: if (!(obj is LDKScoreUpdate)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKScoreUpdate in void_lll"); Console.Error.Flush(); @@ -15743,7 +16623,7 @@ internal class bindings { Environment.Exit(43); } switch (fn_id) { - case 18: + case 17: if (!(obj is LDKScoreUpdate)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKScoreUpdate in void_ll"); Console.Error.Flush(); @@ -15751,7 +16631,7 @@ internal class bindings { } ((LDKScoreUpdate)obj).payment_path_successful(a, b); return; - case 20: + case 19: if (!(obj is LDKScoreUpdate)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKScoreUpdate in void_ll"); Console.Error.Flush(); @@ -15759,7 +16639,7 @@ internal class bindings { } ((LDKScoreUpdate)obj).probe_successful(a, b); return; - case 56: + case 57: if (!(obj is LDKFilter)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKFilter in void_ll"); Console.Error.Flush(); @@ -15767,7 +16647,7 @@ internal class bindings { } ((LDKFilter)obj).register_tx(a, b); return; - case 81: + case 82: if (!(obj is LDKChannelMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in void_ll"); Console.Error.Flush(); @@ -15775,7 +16655,7 @@ internal class bindings { } ((LDKChannelMessageHandler)obj).handle_open_channel(a, b); return; - case 82: + case 83: if (!(obj is LDKChannelMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in void_ll"); Console.Error.Flush(); @@ -15783,7 +16663,7 @@ internal class bindings { } ((LDKChannelMessageHandler)obj).handle_open_channel_v2(a, b); return; - case 83: + case 84: if (!(obj is LDKChannelMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in void_ll"); Console.Error.Flush(); @@ -15791,7 +16671,7 @@ internal class bindings { } ((LDKChannelMessageHandler)obj).handle_accept_channel(a, b); return; - case 84: + case 85: if (!(obj is LDKChannelMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in void_ll"); Console.Error.Flush(); @@ -15799,7 +16679,7 @@ internal class bindings { } ((LDKChannelMessageHandler)obj).handle_accept_channel_v2(a, b); return; - case 85: + case 86: if (!(obj is LDKChannelMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in void_ll"); Console.Error.Flush(); @@ -15807,7 +16687,7 @@ internal class bindings { } ((LDKChannelMessageHandler)obj).handle_funding_created(a, b); return; - case 86: + case 87: if (!(obj is LDKChannelMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in void_ll"); Console.Error.Flush(); @@ -15815,7 +16695,7 @@ internal class bindings { } ((LDKChannelMessageHandler)obj).handle_funding_signed(a, b); return; - case 87: + case 88: if (!(obj is LDKChannelMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in void_ll"); Console.Error.Flush(); @@ -15823,7 +16703,7 @@ internal class bindings { } ((LDKChannelMessageHandler)obj).handle_channel_ready(a, b); return; - case 88: + case 89: if (!(obj is LDKChannelMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in void_ll"); Console.Error.Flush(); @@ -15831,7 +16711,7 @@ internal class bindings { } ((LDKChannelMessageHandler)obj).handle_shutdown(a, b); return; - case 89: + case 90: if (!(obj is LDKChannelMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in void_ll"); Console.Error.Flush(); @@ -15839,7 +16719,7 @@ internal class bindings { } ((LDKChannelMessageHandler)obj).handle_closing_signed(a, b); return; - case 90: + case 91: if (!(obj is LDKChannelMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in void_ll"); Console.Error.Flush(); @@ -15847,7 +16727,7 @@ internal class bindings { } ((LDKChannelMessageHandler)obj).handle_stfu(a, b); return; - case 91: + case 92: if (!(obj is LDKChannelMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in void_ll"); Console.Error.Flush(); @@ -15855,7 +16735,7 @@ internal class bindings { } ((LDKChannelMessageHandler)obj).handle_tx_add_input(a, b); return; - case 92: + case 93: if (!(obj is LDKChannelMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in void_ll"); Console.Error.Flush(); @@ -15863,7 +16743,7 @@ internal class bindings { } ((LDKChannelMessageHandler)obj).handle_tx_add_output(a, b); return; - case 93: + case 94: if (!(obj is LDKChannelMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in void_ll"); Console.Error.Flush(); @@ -15871,7 +16751,7 @@ internal class bindings { } ((LDKChannelMessageHandler)obj).handle_tx_remove_input(a, b); return; - case 94: + case 95: if (!(obj is LDKChannelMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in void_ll"); Console.Error.Flush(); @@ -15879,7 +16759,7 @@ internal class bindings { } ((LDKChannelMessageHandler)obj).handle_tx_remove_output(a, b); return; - case 95: + case 96: if (!(obj is LDKChannelMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in void_ll"); Console.Error.Flush(); @@ -15887,7 +16767,7 @@ internal class bindings { } ((LDKChannelMessageHandler)obj).handle_tx_complete(a, b); return; - case 96: + case 97: if (!(obj is LDKChannelMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in void_ll"); Console.Error.Flush(); @@ -15895,7 +16775,7 @@ internal class bindings { } ((LDKChannelMessageHandler)obj).handle_tx_signatures(a, b); return; - case 97: + case 98: if (!(obj is LDKChannelMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in void_ll"); Console.Error.Flush(); @@ -15903,7 +16783,7 @@ internal class bindings { } ((LDKChannelMessageHandler)obj).handle_tx_init_rbf(a, b); return; - case 98: + case 99: if (!(obj is LDKChannelMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in void_ll"); Console.Error.Flush(); @@ -15911,7 +16791,7 @@ internal class bindings { } ((LDKChannelMessageHandler)obj).handle_tx_ack_rbf(a, b); return; - case 99: + case 100: if (!(obj is LDKChannelMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in void_ll"); Console.Error.Flush(); @@ -15919,7 +16799,7 @@ internal class bindings { } ((LDKChannelMessageHandler)obj).handle_tx_abort(a, b); return; - case 100: + case 101: if (!(obj is LDKChannelMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in void_ll"); Console.Error.Flush(); @@ -15927,7 +16807,7 @@ internal class bindings { } ((LDKChannelMessageHandler)obj).handle_update_add_htlc(a, b); return; - case 101: + case 102: if (!(obj is LDKChannelMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in void_ll"); Console.Error.Flush(); @@ -15935,7 +16815,7 @@ internal class bindings { } ((LDKChannelMessageHandler)obj).handle_update_fulfill_htlc(a, b); return; - case 102: + case 103: if (!(obj is LDKChannelMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in void_ll"); Console.Error.Flush(); @@ -15943,7 +16823,7 @@ internal class bindings { } ((LDKChannelMessageHandler)obj).handle_update_fail_htlc(a, b); return; - case 103: + case 104: if (!(obj is LDKChannelMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in void_ll"); Console.Error.Flush(); @@ -15951,7 +16831,7 @@ internal class bindings { } ((LDKChannelMessageHandler)obj).handle_update_fail_malformed_htlc(a, b); return; - case 104: + case 105: if (!(obj is LDKChannelMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in void_ll"); Console.Error.Flush(); @@ -15959,7 +16839,7 @@ internal class bindings { } ((LDKChannelMessageHandler)obj).handle_commitment_signed(a, b); return; - case 105: + case 106: if (!(obj is LDKChannelMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in void_ll"); Console.Error.Flush(); @@ -15967,7 +16847,7 @@ internal class bindings { } ((LDKChannelMessageHandler)obj).handle_revoke_and_ack(a, b); return; - case 106: + case 107: if (!(obj is LDKChannelMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in void_ll"); Console.Error.Flush(); @@ -15975,7 +16855,7 @@ internal class bindings { } ((LDKChannelMessageHandler)obj).handle_update_fee(a, b); return; - case 107: + case 108: if (!(obj is LDKChannelMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in void_ll"); Console.Error.Flush(); @@ -15983,7 +16863,7 @@ internal class bindings { } ((LDKChannelMessageHandler)obj).handle_announcement_signatures(a, b); return; - case 110: + case 111: if (!(obj is LDKChannelMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in void_ll"); Console.Error.Flush(); @@ -15991,7 +16871,7 @@ internal class bindings { } ((LDKChannelMessageHandler)obj).handle_channel_reestablish(a, b); return; - case 111: + case 112: if (!(obj is LDKChannelMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in void_ll"); Console.Error.Flush(); @@ -15999,7 +16879,7 @@ internal class bindings { } ((LDKChannelMessageHandler)obj).handle_channel_update(a, b); return; - case 112: + case 113: if (!(obj is LDKChannelMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in void_ll"); Console.Error.Flush(); @@ -16007,7 +16887,7 @@ internal class bindings { } ((LDKChannelMessageHandler)obj).handle_error(a, b); return; - case 133: + case 136: if (!(obj is LDKOnionMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKOnionMessageHandler in void_ll"); Console.Error.Flush(); @@ -16039,13 +16919,20 @@ internal class bindings { Environment.Exit(43); } switch (fn_id) { - case 28: + case 27: if (!(obj is LDKWatch)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKWatch in ChannelMonitorUpdateStatus_ll"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKWatch)obj).update_channel(a, b); + case 68: + if (!(obj is LDKPersist)) { + Console.Error.WriteLine("Got function call to object that wasn't a LDKPersist in ChannelMonitorUpdateStatus_ll"); + Console.Error.Flush(); + Environment.Exit(44); + } + return ((LDKPersist)obj).persist_new_channel(a, b); default: Console.Error.WriteLine("Got unknown function call with id " + fn_id + " from C in ChannelMonitorUpdateStatus_ll"); Console.Error.Flush(); @@ -16070,7 +16957,7 @@ internal class bindings { Environment.Exit(43); } switch (fn_id) { - case 33: + case 32: if (!(obj is LDKNodeSigner)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKNodeSigner in l_Recipient"); Console.Error.Flush(); @@ -16101,7 +16988,7 @@ internal class bindings { Environment.Exit(43); } switch (fn_id) { - case 34: + case 33: if (!(obj is LDKNodeSigner)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKNodeSigner in l_Recipientll"); Console.Error.Flush(); @@ -16119,37 +17006,37 @@ internal class bindings { static l_Recipientll_callback l_Recipientll_callback_inst = c_callback_l_Recipientll; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_register_l_Recipientll_invoker")] public static extern int register_l_Recipientll_invoker(l_Recipientll_callback callee); static int _run_l_Recipientll_registration = register_l_Recipientll_invoker(l_Recipientll_callback_inst); - static long c_callback_l_llRecipient(int obj_ptr, int fn_id, long a, long b, Recipient c) { + static long c_callback_l_lRecipient(int obj_ptr, int fn_id, long a, Recipient b) { if (obj_ptr >= js_objs.Count) { - Console.Error.WriteLine("Got function call on unknown/free'd JS object in l_llRecipient"); + Console.Error.WriteLine("Got function call on unknown/free'd JS object in l_lRecipient"); 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_llRecipient"); + Console.Error.WriteLine("Got function call on GC'd JS object in l_lRecipient"); Console.Error.Flush(); Environment.Exit(43); } switch (fn_id) { - case 35: + case 34: if (!(obj is LDKNodeSigner)) { - Console.Error.WriteLine("Got function call to object that wasn't a LDKNodeSigner in l_llRecipient"); + Console.Error.WriteLine("Got function call to object that wasn't a LDKNodeSigner in l_lRecipient"); Console.Error.Flush(); Environment.Exit(44); } - return ((LDKNodeSigner)obj).sign_invoice(a, b, c); + return ((LDKNodeSigner)obj).sign_invoice(a, b); default: - Console.Error.WriteLine("Got unknown function call with id " + fn_id + " from C in l_llRecipient"); + Console.Error.WriteLine("Got unknown function call with id " + fn_id + " from C in l_lRecipient"); Console.Error.Flush(); Environment.Exit(45); return 0; } } - public delegate long l_llRecipient_callback(int obj_ptr, int fn_id, long a, long b, Recipient c); - static l_llRecipient_callback l_llRecipient_callback_inst = c_callback_l_llRecipient; - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_register_l_llRecipient_invoker")] public static extern int register_l_llRecipient_invoker(l_llRecipient_callback callee); - static int _run_l_llRecipient_registration = register_l_llRecipient_invoker(l_llRecipient_callback_inst); + public delegate long l_lRecipient_callback(int obj_ptr, int fn_id, long a, Recipient b); + static l_lRecipient_callback l_lRecipient_callback_inst = c_callback_l_lRecipient; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_register_l_lRecipient_invoker")] public static extern int register_l_lRecipient_invoker(l_lRecipient_callback callee); + static int _run_l_lRecipient_registration = register_l_lRecipient_invoker(l_lRecipient_callback_inst); static long c_callback_l_bll(int obj_ptr, int fn_id, bool a, long b, long c) { if (obj_ptr >= js_objs.Count) { Console.Error.WriteLine("Got function call on unknown/free'd JS object in l_bll"); @@ -16163,7 +17050,7 @@ internal class bindings { Environment.Exit(43); } switch (fn_id) { - case 39: + case 38: if (!(obj is LDKSignerProvider)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKSignerProvider in l_bll"); Console.Error.Flush(); @@ -16194,7 +17081,7 @@ internal class bindings { Environment.Exit(43); } switch (fn_id) { - case 44: + case 43: if (!(obj is LDKFeeEstimator)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKFeeEstimator in i_ConfirmationTarget"); Console.Error.Flush(); @@ -16287,7 +17174,7 @@ internal class bindings { Environment.Exit(43); } switch (fn_id) { - case 61: + case 62: if (!(obj is LDKKVStore)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKKVStore in l_lllb"); Console.Error.Flush(); @@ -16318,7 +17205,7 @@ internal class bindings { Environment.Exit(43); } switch (fn_id) { - case 63: + case 64: if (!(obj is LDKOutputSpender)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKOutputSpender in l_lllil"); Console.Error.Flush(); @@ -16349,13 +17236,13 @@ internal class bindings { Environment.Exit(43); } switch (fn_id) { - case 67: + case 69: if (!(obj is LDKPersist)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKPersist in ChannelMonitorUpdateStatus_lll"); Console.Error.Flush(); Environment.Exit(44); } - return ((LDKPersist)obj).persist_new_channel(a, b, c); + return ((LDKPersist)obj).update_persisted_channel(a, b, c); default: Console.Error.WriteLine("Got unknown function call with id " + fn_id + " from C in ChannelMonitorUpdateStatus_lll"); Console.Error.Flush(); @@ -16367,37 +17254,6 @@ internal class bindings { static ChannelMonitorUpdateStatus_lll_callback ChannelMonitorUpdateStatus_lll_callback_inst = c_callback_ChannelMonitorUpdateStatus_lll; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_register_ChannelMonitorUpdateStatus_lll_invoker")] public static extern int register_ChannelMonitorUpdateStatus_lll_invoker(ChannelMonitorUpdateStatus_lll_callback callee); static int _run_ChannelMonitorUpdateStatus_lll_registration = register_ChannelMonitorUpdateStatus_lll_invoker(ChannelMonitorUpdateStatus_lll_callback_inst); - static ChannelMonitorUpdateStatus c_callback_ChannelMonitorUpdateStatus_llll(int obj_ptr, int fn_id, long a, long b, long c, long d) { - if (obj_ptr >= js_objs.Count) { - Console.Error.WriteLine("Got function call on unknown/free'd JS object in ChannelMonitorUpdateStatus_llll"); - 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 ChannelMonitorUpdateStatus_llll"); - Console.Error.Flush(); - Environment.Exit(43); - } - switch (fn_id) { - 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(); - Environment.Exit(44); - } - return ((LDKPersist)obj).update_persisted_channel(a, b, c, d); - default: - Console.Error.WriteLine("Got unknown function call with id " + fn_id + " from C in ChannelMonitorUpdateStatus_llll"); - Console.Error.Flush(); - Environment.Exit(45); - return 0; - } - } - public delegate ChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_llll_callback(int obj_ptr, int fn_id, long a, long b, long c, long d); - 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_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"); @@ -16411,7 +17267,7 @@ internal class bindings { Environment.Exit(43); } switch (fn_id) { - case 70: + case 71: if (!(obj is LDKListen)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKListen in void_lli"); Console.Error.Flush(); @@ -16419,7 +17275,7 @@ internal class bindings { } ((LDKListen)obj).filtered_block_connected(a, b, c); return; - case 73: + case 74: if (!(obj is LDKConfirm)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKConfirm in void_lli"); Console.Error.Flush(); @@ -16451,7 +17307,7 @@ internal class bindings { Environment.Exit(43); } switch (fn_id) { - case 71: + 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(); @@ -16459,7 +17315,7 @@ internal class bindings { } ((LDKListen)obj).block_connected(a, b); return; - case 72: + case 73: if (!(obj is LDKListen)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKListen in void_li"); Console.Error.Flush(); @@ -16467,7 +17323,7 @@ internal class bindings { } ((LDKListen)obj).block_disconnected(a, b); return; - case 75: + case 76: if (!(obj is LDKConfirm)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKConfirm in void_li"); Console.Error.Flush(); @@ -16499,7 +17355,7 @@ internal class bindings { Environment.Exit(43); } switch (fn_id) { - case 77: + case 78: if (!(obj is LDKFutureCallback)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKFutureCallback in void_"); Console.Error.Flush(); @@ -16507,7 +17363,7 @@ internal class bindings { } ((LDKFutureCallback)obj).call(); return; - case 137: + case 140: if (!(obj is LDKOnionMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKOnionMessageHandler in void_"); Console.Error.Flush(); @@ -16515,7 +17371,7 @@ internal class bindings { } ((LDKOnionMessageHandler)obj).timer_tick_occurred(); return; - case 149: + case 154: if (!(obj is LDKSocketDescriptor)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKSocketDescriptor in void_"); Console.Error.Flush(); @@ -16547,27 +17403,34 @@ internal class bindings { Environment.Exit(43); } switch (fn_id) { - case 109: + case 110: if (!(obj is LDKChannelMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in l_llb"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKChannelMessageHandler)obj).peer_connected(a, b, c); - case 124: + case 128: 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 135: + case 138: if (!(obj is LDKOnionMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKOnionMessageHandler in l_llb"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKOnionMessageHandler)obj).peer_connected(a, b, c); + case 147: + if (!(obj is LDKCustomMessageHandler)) { + Console.Error.WriteLine("Got function call to object that wasn't a LDKCustomMessageHandler in l_llb"); + Console.Error.Flush(); + Environment.Exit(44); + } + return ((LDKCustomMessageHandler)obj).peer_connected(a, b, c); default: Console.Error.WriteLine("Got unknown function call with id " + fn_id + " from C in l_llb"); Console.Error.Flush(); @@ -16592,7 +17455,7 @@ internal class bindings { Environment.Exit(43); } switch (fn_id) { - case 129: + case 133: if (!(obj is LDKRoutingMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKRoutingMessageHandler in b_"); Console.Error.Flush(); @@ -16623,7 +17486,7 @@ internal class bindings { Environment.Exit(43); } switch (fn_id) { - case 140: + case 143: if (!(obj is LDKCustomMessageReader)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKCustomMessageReader in l_sl"); Console.Error.Flush(); @@ -16654,7 +17517,7 @@ internal class bindings { Environment.Exit(43); } switch (fn_id) { - case 148: + case 153: if (!(obj is LDKSocketDescriptor)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKSocketDescriptor in l_lb"); Console.Error.Flush(); @@ -16685,7 +17548,7 @@ internal class bindings { Environment.Exit(43); } switch (fn_id) { - case 150: + case 155: if (!(obj is LDKSocketDescriptor)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKSocketDescriptor in b_l"); Console.Error.Flush(); @@ -16716,7 +17579,7 @@ internal class bindings { Environment.Exit(43); } switch (fn_id) { - case 155: + case 160: 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 8284b363..afb3357d 100644 --- a/c_sharp/src/org/ldk/structs/APIError.cs +++ b/c_sharp/src/org/ldk/structs/APIError.cs @@ -187,7 +187,6 @@ public class APIError : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.APIError ret_hu_conv = org.ldk.structs.APIError.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(script); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/AcceptChannel.cs b/c_sharp/src/org/ldk/structs/AcceptChannel.cs index 5a19a661..28b817ea 100644 --- a/c_sharp/src/org/ldk/structs/AcceptChannel.cs +++ b/c_sharp/src/org/ldk/structs/AcceptChannel.cs @@ -38,7 +38,6 @@ public class AcceptChannel : CommonBase { bindings.AcceptChannel_set_common_fields(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -69,7 +68,6 @@ public class AcceptChannel : CommonBase { 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(common_fields_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/AcceptChannelV2.cs b/c_sharp/src/org/ldk/structs/AcceptChannelV2.cs index 65be5633..f831422a 100644 --- a/c_sharp/src/org/ldk/structs/AcceptChannelV2.cs +++ b/c_sharp/src/org/ldk/structs/AcceptChannelV2.cs @@ -36,7 +36,6 @@ public class AcceptChannelV2 : CommonBase { bindings.AcceptChannelV2_set_common_fields(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -107,7 +106,6 @@ public class AcceptChannelV2 : CommonBase { 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(common_fields_arg); }; 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 b452326b..b7c016cf 100644 --- a/c_sharp/src/org/ldk/structs/AnchorDescriptor.cs +++ b/c_sharp/src/org/ldk/structs/AnchorDescriptor.cs @@ -34,7 +34,6 @@ public class AnchorDescriptor : CommonBase { bindings.AnchorDescriptor_set_channel_derivation_parameters(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -58,7 +57,6 @@ public class AnchorDescriptor : CommonBase { bindings.AnchorDescriptor_set_outpoint(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -71,8 +69,6 @@ public class AnchorDescriptor : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.AnchorDescriptor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.AnchorDescriptor(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(outpoint_arg); }; return ret_hu_conv; } @@ -162,12 +158,12 @@ public class AnchorDescriptor : CommonBase { /** * Derives the channel signer required to sign the anchor input. */ - public WriteableEcdsaChannelSigner derive_channel_signer(org.ldk.structs.SignerProvider signer_provider) { + public EcdsaChannelSigner derive_channel_signer(org.ldk.structs.SignerProvider signer_provider) { long ret = bindings.AnchorDescriptor_derive_channel_signer(this.ptr, signer_provider.ptr); GC.KeepAlive(this); GC.KeepAlive(signer_provider); if (ret >= 0 && ret <= 4096) { return null; } - WriteableEcdsaChannelSigner ret_hu_conv = new WriteableEcdsaChannelSigner(null, ret); + EcdsaChannelSigner ret_hu_conv = new EcdsaChannelSigner(null, ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; if (this != null) { this.ptrs_to.AddLast(signer_provider); }; return ret_hu_conv; diff --git a/c_sharp/src/org/ldk/structs/AnnouncementSignatures.cs b/c_sharp/src/org/ldk/structs/AnnouncementSignatures.cs index 064273e4..2ebe183b 100644 --- a/c_sharp/src/org/ldk/structs/AnnouncementSignatures.cs +++ b/c_sharp/src/org/ldk/structs/AnnouncementSignatures.cs @@ -36,7 +36,6 @@ public class AnnouncementSignatures : CommonBase { bindings.AnnouncementSignatures_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -109,7 +108,6 @@ 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; } diff --git a/c_sharp/src/org/ldk/structs/AsyncPaymentsMessage.cs b/c_sharp/src/org/ldk/structs/AsyncPaymentsMessage.cs new file mode 100644 index 00000000..3b46ae49 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/AsyncPaymentsMessage.cs @@ -0,0 +1,128 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * Possible async payment messages sent and received via an [`OnionMessage`]. + * + * [`OnionMessage`]: crate::ln::msgs::OnionMessage + */ +public class AsyncPaymentsMessage : CommonBase { + protected AsyncPaymentsMessage(object _dummy, long ptr) : base(ptr) { } + ~AsyncPaymentsMessage() { + if (ptr != 0) { bindings.AsyncPaymentsMessage_free(ptr); } + } + + internal static AsyncPaymentsMessage constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKAsyncPaymentsMessage_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new AsyncPaymentsMessage_HeldHtlcAvailable(ptr); + case 1: return new AsyncPaymentsMessage_ReleaseHeldHtlc(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A AsyncPaymentsMessage of type HeldHtlcAvailable */ + public class AsyncPaymentsMessage_HeldHtlcAvailable : AsyncPaymentsMessage { + public HeldHtlcAvailable held_htlc_available; + internal AsyncPaymentsMessage_HeldHtlcAvailable(long ptr) : base(null, ptr) { + long held_htlc_available = bindings.LDKAsyncPaymentsMessage_HeldHtlcAvailable_get_held_htlc_available(ptr); + org.ldk.structs.HeldHtlcAvailable held_htlc_available_hu_conv = null; if (held_htlc_available < 0 || held_htlc_available > 4096) { held_htlc_available_hu_conv = new org.ldk.structs.HeldHtlcAvailable(null, held_htlc_available); } + if (held_htlc_available_hu_conv != null) { held_htlc_available_hu_conv.ptrs_to.AddLast(this); }; + this.held_htlc_available = held_htlc_available_hu_conv; + } + } + /** A AsyncPaymentsMessage of type ReleaseHeldHtlc */ + public class AsyncPaymentsMessage_ReleaseHeldHtlc : AsyncPaymentsMessage { + public ReleaseHeldHtlc release_held_htlc; + internal AsyncPaymentsMessage_ReleaseHeldHtlc(long ptr) : base(null, ptr) { + long release_held_htlc = bindings.LDKAsyncPaymentsMessage_ReleaseHeldHtlc_get_release_held_htlc(ptr); + org.ldk.structs.ReleaseHeldHtlc release_held_htlc_hu_conv = null; if (release_held_htlc < 0 || release_held_htlc > 4096) { release_held_htlc_hu_conv = new org.ldk.structs.ReleaseHeldHtlc(null, release_held_htlc); } + if (release_held_htlc_hu_conv != null) { release_held_htlc_hu_conv.ptrs_to.AddLast(this); }; + this.release_held_htlc = release_held_htlc_hu_conv; + } + } + internal long clone_ptr() { + long ret = bindings.AsyncPaymentsMessage_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the AsyncPaymentsMessage + */ + public AsyncPaymentsMessage clone() { + long ret = bindings.AsyncPaymentsMessage_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.AsyncPaymentsMessage ret_hu_conv = org.ldk.structs.AsyncPaymentsMessage.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 HeldHtlcAvailable-variant AsyncPaymentsMessage + */ + public static AsyncPaymentsMessage held_htlc_available(org.ldk.structs.HeldHtlcAvailable a) { + long ret = bindings.AsyncPaymentsMessage_held_htlc_available(a.ptr); + GC.KeepAlive(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.AsyncPaymentsMessage ret_hu_conv = org.ldk.structs.AsyncPaymentsMessage.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 ReleaseHeldHtlc-variant AsyncPaymentsMessage + */ + public static AsyncPaymentsMessage release_held_htlc(org.ldk.structs.ReleaseHeldHtlc a) { + long ret = bindings.AsyncPaymentsMessage_release_held_htlc(a.ptr); + GC.KeepAlive(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.AsyncPaymentsMessage ret_hu_conv = org.ldk.structs.AsyncPaymentsMessage.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 OnionMessageContents which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned OnionMessageContents must be freed before this_arg is + */ + public OnionMessageContents as_OnionMessageContents() { + long ret = bindings.AsyncPaymentsMessage_as_OnionMessageContents(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + OnionMessageContents ret_hu_conv = new OnionMessageContents(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Serialize the AsyncPaymentsMessage object into a byte array which can be read by AsyncPaymentsMessage_read + */ + public byte[] write() { + long ret = bindings.AsyncPaymentsMessage_write(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Read a AsyncPaymentsMessage from a byte array, created by AsyncPaymentsMessage_write + */ + public static Result_AsyncPaymentsMessageDecodeErrorZ read(byte[] ser, long arg) { + long ret = bindings.AsyncPaymentsMessage_read(InternalUtils.encodeUint8Array(ser), arg); + GC.KeepAlive(ser); + GC.KeepAlive(arg); + if (ret >= 0 && ret <= 4096) { return null; } + Result_AsyncPaymentsMessageDecodeErrorZ ret_hu_conv = Result_AsyncPaymentsMessageDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/AsyncPaymentsMessageHandler.cs b/c_sharp/src/org/ldk/structs/AsyncPaymentsMessageHandler.cs new file mode 100644 index 00000000..7d22da81 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/AsyncPaymentsMessageHandler.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 { + + + +/** An implementation of AsyncPaymentsMessageHandler */ +public interface AsyncPaymentsMessageHandlerInterface { + /**Handle a [`HeldHtlcAvailable`] message. A [`ReleaseHeldHtlc`] should be returned to release + * the held funds. + * + * Note that responder (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ held_htlc_available(HeldHtlcAvailable message, Responder responder); + /**Handle a [`ReleaseHeldHtlc`] message. If authentication of the message succeeds, an HTLC + * should be released to the corresponding payee. + */ + void release_held_htlc(ReleaseHeldHtlc message); + /**Release any [`AsyncPaymentsMessage`]s that need to be sent. + * + * Typically, this is used for messages initiating an async payment flow rather than in response + * to another message. + */ + TwoTuple_AsyncPaymentsMessageMessageSendInstructionsZ[] release_pending_messages(); +} + +/** + * A handler for an [`OnionMessage`] containing an async payments message as its payload. + * + * [`OnionMessage`]: crate::ln::msgs::OnionMessage + */ +public class AsyncPaymentsMessageHandler : CommonBase { + internal bindings.LDKAsyncPaymentsMessageHandler bindings_instance; + internal long instance_idx; + + internal AsyncPaymentsMessageHandler(object _dummy, long ptr) : base(ptr) { bindings_instance = null; } + ~AsyncPaymentsMessageHandler() { + if (ptr != 0) { bindings.AsyncPaymentsMessageHandler_free(ptr); } + } + + private class LDKAsyncPaymentsMessageHandlerHolder { internal AsyncPaymentsMessageHandler held; } + private class LDKAsyncPaymentsMessageHandlerImpl : bindings.LDKAsyncPaymentsMessageHandler { + internal LDKAsyncPaymentsMessageHandlerImpl(AsyncPaymentsMessageHandlerInterface arg, LDKAsyncPaymentsMessageHandlerHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; } + private AsyncPaymentsMessageHandlerInterface arg; + private LDKAsyncPaymentsMessageHandlerHolder impl_holder; + public long held_htlc_available(long _message, long _responder) { + org.ldk.structs.HeldHtlcAvailable _message_hu_conv = null; if (_message < 0 || _message > 4096) { _message_hu_conv = new org.ldk.structs.HeldHtlcAvailable(null, _message); } + if (_message_hu_conv != null) { _message_hu_conv.ptrs_to.AddLast(this); }; + org.ldk.structs.Responder _responder_hu_conv = null; if (_responder < 0 || _responder > 4096) { _responder_hu_conv = new org.ldk.structs.Responder(null, _responder); } + if (_responder_hu_conv != null) { _responder_hu_conv.ptrs_to.AddLast(this); }; + Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ ret = arg.held_htlc_available(_message_hu_conv, _responder_hu_conv); + GC.KeepAlive(arg); + long result = ret.clone_ptr(); + return result; + } + public void release_held_htlc(long _message) { + org.ldk.structs.ReleaseHeldHtlc _message_hu_conv = null; if (_message < 0 || _message > 4096) { _message_hu_conv = new org.ldk.structs.ReleaseHeldHtlc(null, _message); } + if (_message_hu_conv != null) { _message_hu_conv.ptrs_to.AddLast(this); }; + arg.release_held_htlc(_message_hu_conv); + GC.KeepAlive(arg); + } + public long release_pending_messages() { + TwoTuple_AsyncPaymentsMessageMessageSendInstructionsZ[] ret = arg.release_pending_messages(); + GC.KeepAlive(arg); + long result = InternalUtils.encodeUint64Array(InternalUtils.mapArray(ret, ret_conv_55 => ret_conv_55.clone_ptr())); + return result; + } + } + + /** Creates a new instance of AsyncPaymentsMessageHandler from a given implementation */ + public static AsyncPaymentsMessageHandler new_impl(AsyncPaymentsMessageHandlerInterface arg) { + LDKAsyncPaymentsMessageHandlerHolder impl_holder = new LDKAsyncPaymentsMessageHandlerHolder(); + LDKAsyncPaymentsMessageHandlerImpl impl = new LDKAsyncPaymentsMessageHandlerImpl(arg, impl_holder); + long[] ptr_idx = bindings.LDKAsyncPaymentsMessageHandler_new(impl); + + impl_holder.held = new AsyncPaymentsMessageHandler(null, ptr_idx[0]); + impl_holder.held.instance_idx = ptr_idx[1]; + impl_holder.held.bindings_instance = impl; + return impl_holder.held; + } + + /** + * Handle a [`HeldHtlcAvailable`] message. A [`ReleaseHeldHtlc`] should be returned to release + * the held funds. + * + * Note that responder (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ held_htlc_available(org.ldk.structs.HeldHtlcAvailable message, org.ldk.structs.Responder responder) { + long ret = bindings.AsyncPaymentsMessageHandler_held_htlc_available(this.ptr, message.ptr, responder == null ? 0 : responder.ptr); + GC.KeepAlive(this); + GC.KeepAlive(message); + GC.KeepAlive(responder); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Handle a [`ReleaseHeldHtlc`] message. If authentication of the message succeeds, an HTLC + * should be released to the corresponding payee. + */ + public void release_held_htlc(org.ldk.structs.ReleaseHeldHtlc message) { + bindings.AsyncPaymentsMessageHandler_release_held_htlc(this.ptr, message.ptr); + GC.KeepAlive(this); + GC.KeepAlive(message); + } + + /** + * Release any [`AsyncPaymentsMessage`]s that need to be sent. + * + * Typically, this is used for messages initiating an async payment flow rather than in response + * to another message. + */ + public TwoTuple_AsyncPaymentsMessageMessageSendInstructionsZ[] release_pending_messages() { + long ret = bindings.AsyncPaymentsMessageHandler_release_pending_messages(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + int ret_conv_55_len = InternalUtils.getArrayLength(ret); + TwoTuple_AsyncPaymentsMessageMessageSendInstructionsZ[] ret_conv_55_arr = new TwoTuple_AsyncPaymentsMessageMessageSendInstructionsZ[ret_conv_55_len]; + for (int d = 0; d < ret_conv_55_len; d++) { + long ret_conv_55 = InternalUtils.getU64ArrayElem(ret, d); + TwoTuple_AsyncPaymentsMessageMessageSendInstructionsZ ret_conv_55_hu_conv = new TwoTuple_AsyncPaymentsMessageMessageSendInstructionsZ(null, ret_conv_55); + if (ret_conv_55_hu_conv != null) { ret_conv_55_hu_conv.ptrs_to.AddLast(this); }; + ret_conv_55_arr[d] = ret_conv_55_hu_conv; + } + bindings.free_buffer(ret); + return ret_conv_55_arr; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/BackgroundProcessor.cs b/c_sharp/src/org/ldk/structs/BackgroundProcessor.cs index 24843df0..168b5f46 100644 --- a/c_sharp/src/org/ldk/structs/BackgroundProcessor.cs +++ b/c_sharp/src/org/ldk/structs/BackgroundProcessor.cs @@ -89,12 +89,13 @@ public class BackgroundProcessor : CommonBase { * [`NetworkGraph`]: lightning::routing::gossip::NetworkGraph * [`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.ptr, channel_manager.ptr, gossip_sync.ptr, peer_manager.ptr, logger.ptr, scorer.ptr); + 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.OnionMessenger onion_messenger, 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.ptr, channel_manager.ptr, onion_messenger.ptr, gossip_sync.ptr, peer_manager.ptr, logger.ptr, scorer.ptr); GC.KeepAlive(persister); GC.KeepAlive(event_handler); GC.KeepAlive(chain_monitor); GC.KeepAlive(channel_manager); + GC.KeepAlive(onion_messenger); GC.KeepAlive(gossip_sync); GC.KeepAlive(peer_manager); GC.KeepAlive(logger); @@ -106,6 +107,7 @@ public class BackgroundProcessor : CommonBase { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(event_handler); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(chain_monitor); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_manager); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(onion_messenger); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(gossip_sync); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(peer_manager); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(logger); }; diff --git a/c_sharp/src/org/ldk/structs/Balance.cs b/c_sharp/src/org/ldk/structs/Balance.cs index 18313917..d1320c78 100644 --- a/c_sharp/src/org/ldk/structs/Balance.cs +++ b/c_sharp/src/org/ldk/structs/Balance.cs @@ -38,8 +38,66 @@ public class Balance : CommonBase { * required to do so. */ public long amount_satoshis; + /** + * The transaction fee we pay for the closing commitment transaction. This amount is not + * included in the [`Balance::ClaimableOnChannelClose::amount_satoshis`] value. + * + * Note that if this channel is inbound (and thus our counterparty pays the commitment + * transaction fee) this value will be zero. For [`ChannelMonitor`]s created prior to LDK + * 0.0.124, the channel is always treated as outbound (and thus this value is never zero). + */ + public long transaction_fee_satoshis; + /** + * The amount of millisatoshis which has been burned to fees from HTLCs which are outbound + * from us and are related to a payment which was sent by us. This is the sum of the + * millisatoshis part of all HTLCs which are otherwise represented by + * [`Balance::MaybeTimeoutClaimableHTLC`] with their + * [`Balance::MaybeTimeoutClaimableHTLC::outbound_payment`] flag set, as well as any dust + * HTLCs which would otherwise be represented the same. + * + * This amount (rounded up to a whole satoshi value) will not be included in `amount_satoshis`. + */ + public long outbound_payment_htlc_rounded_msat; + /** + * The amount of millisatoshis which has been burned to fees from HTLCs which are outbound + * from us and are related to a forwarded HTLC. This is the sum of the millisatoshis part + * of all HTLCs which are otherwise represented by [`Balance::MaybeTimeoutClaimableHTLC`] + * with their [`Balance::MaybeTimeoutClaimableHTLC::outbound_payment`] flag *not* set, as + * well as any dust HTLCs which would otherwise be represented the same. + * + * This amount (rounded up to a whole satoshi value) will not be included in `amount_satoshis`. + */ + public long outbound_forwarded_htlc_rounded_msat; + /** + * The amount of millisatoshis which has been burned to fees from HTLCs which are inbound + * to us and for which we know the preimage. This is the sum of the millisatoshis part of + * all HTLCs which would be represented by [`Balance::ContentiousClaimable`] on channel + * close, but whose current value is included in + * [`Balance::ClaimableOnChannelClose::amount_satoshis`], as well as any dust HTLCs which + * would otherwise be represented the same. + * + * This amount (rounded up to a whole satoshi value) will not be included in the counterparty's + * `amount_satoshis`. + */ + public long inbound_claiming_htlc_rounded_msat; + /** + * The amount of millisatoshis which has been burned to fees from HTLCs which are inbound + * to us and for which we do not know the preimage. This is the sum of the millisatoshis + * part of all HTLCs which would be represented by [`Balance::MaybePreimageClaimableHTLC`] + * on channel close, as well as any dust HTLCs which would otherwise be represented the + * same. + * + * This amount (rounded up to a whole satoshi value) will not be included in the counterparty's + * `amount_satoshis`. + */ + public long inbound_htlc_rounded_msat; internal Balance_ClaimableOnChannelClose(long ptr) : base(null, ptr) { this.amount_satoshis = bindings.LDKBalance_ClaimableOnChannelClose_get_amount_satoshis(ptr); + this.transaction_fee_satoshis = bindings.LDKBalance_ClaimableOnChannelClose_get_transaction_fee_satoshis(ptr); + this.outbound_payment_htlc_rounded_msat = bindings.LDKBalance_ClaimableOnChannelClose_get_outbound_payment_htlc_rounded_msat(ptr); + this.outbound_forwarded_htlc_rounded_msat = bindings.LDKBalance_ClaimableOnChannelClose_get_outbound_forwarded_htlc_rounded_msat(ptr); + this.inbound_claiming_htlc_rounded_msat = bindings.LDKBalance_ClaimableOnChannelClose_get_inbound_claiming_htlc_rounded_msat(ptr); + this.inbound_htlc_rounded_msat = bindings.LDKBalance_ClaimableOnChannelClose_get_inbound_htlc_rounded_msat(ptr); } } /** A Balance of type ClaimableAwaitingConfirmations */ @@ -54,9 +112,14 @@ public class Balance : CommonBase { * amount. */ public int confirmation_height; + /** + * Whether this balance is a result of cooperative close, a force-close, or an HTLC. + */ + public BalanceSource source; internal Balance_ClaimableAwaitingConfirmations(long ptr) : base(null, ptr) { this.amount_satoshis = bindings.LDKBalance_ClaimableAwaitingConfirmations_get_amount_satoshis(ptr); this.confirmation_height = bindings.LDKBalance_ClaimableAwaitingConfirmations_get_confirmation_height(ptr); + this.source = bindings.LDKBalance_ClaimableAwaitingConfirmations_get_source(ptr); } } /** A Balance of type ContentiousClaimable */ @@ -106,12 +169,19 @@ public class Balance : CommonBase { * The payment hash whose preimage our counterparty needs to claim this HTLC. */ public byte[] payment_hash; + /** + * Whether this HTLC represents a payment which was sent outbound from us. Otherwise it + * represents an HTLC which was forwarded (and should, thus, have a corresponding inbound + * edge on another channel). + */ + public bool outbound_payment; internal Balance_MaybeTimeoutClaimableHTLC(long ptr) : base(null, ptr) { this.amount_satoshis = bindings.LDKBalance_MaybeTimeoutClaimableHTLC_get_amount_satoshis(ptr); this.claimable_height = bindings.LDKBalance_MaybeTimeoutClaimableHTLC_get_claimable_height(ptr); long payment_hash = bindings.LDKBalance_MaybeTimeoutClaimableHTLC_get_payment_hash(ptr); byte[] payment_hash_conv = InternalUtils.decodeUint8Array(payment_hash); this.payment_hash = payment_hash_conv; + this.outbound_payment = bindings.LDKBalance_MaybeTimeoutClaimableHTLC_get_outbound_payment(ptr); } } /** A Balance of type MaybePreimageClaimableHTLC */ @@ -172,9 +242,14 @@ public class Balance : CommonBase { /** * Utility method to constructs a new ClaimableOnChannelClose-variant Balance */ - public static Balance claimable_on_channel_close(long amount_satoshis) { - long ret = bindings.Balance_claimable_on_channel_close(amount_satoshis); + public static Balance claimable_on_channel_close(long amount_satoshis, long transaction_fee_satoshis, long outbound_payment_htlc_rounded_msat, long outbound_forwarded_htlc_rounded_msat, long inbound_claiming_htlc_rounded_msat, long inbound_htlc_rounded_msat) { + long ret = bindings.Balance_claimable_on_channel_close(amount_satoshis, transaction_fee_satoshis, outbound_payment_htlc_rounded_msat, outbound_forwarded_htlc_rounded_msat, inbound_claiming_htlc_rounded_msat, inbound_htlc_rounded_msat); GC.KeepAlive(amount_satoshis); + GC.KeepAlive(transaction_fee_satoshis); + GC.KeepAlive(outbound_payment_htlc_rounded_msat); + GC.KeepAlive(outbound_forwarded_htlc_rounded_msat); + GC.KeepAlive(inbound_claiming_htlc_rounded_msat); + GC.KeepAlive(inbound_htlc_rounded_msat); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Balance ret_hu_conv = org.ldk.structs.Balance.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; @@ -184,10 +259,11 @@ public class Balance : CommonBase { /** * Utility method to constructs a new ClaimableAwaitingConfirmations-variant Balance */ - public static Balance claimable_awaiting_confirmations(long amount_satoshis, int confirmation_height) { - long ret = bindings.Balance_claimable_awaiting_confirmations(amount_satoshis, confirmation_height); + public static Balance claimable_awaiting_confirmations(long amount_satoshis, int confirmation_height, BalanceSource source) { + long ret = bindings.Balance_claimable_awaiting_confirmations(amount_satoshis, confirmation_height, source); GC.KeepAlive(amount_satoshis); GC.KeepAlive(confirmation_height); + GC.KeepAlive(source); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Balance ret_hu_conv = org.ldk.structs.Balance.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; @@ -212,11 +288,12 @@ public class Balance : CommonBase { /** * Utility method to constructs a new MaybeTimeoutClaimableHTLC-variant Balance */ - public static Balance maybe_timeout_claimable_htlc(long amount_satoshis, int claimable_height, byte[] payment_hash) { - long ret = bindings.Balance_maybe_timeout_claimable_htlc(amount_satoshis, claimable_height, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32))); + public static Balance maybe_timeout_claimable_htlc(long amount_satoshis, int claimable_height, byte[] payment_hash, bool outbound_payment) { + long ret = bindings.Balance_maybe_timeout_claimable_htlc(amount_satoshis, claimable_height, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32)), outbound_payment); GC.KeepAlive(amount_satoshis); GC.KeepAlive(claimable_height); GC.KeepAlive(payment_hash); + GC.KeepAlive(outbound_payment); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Balance ret_hu_conv = org.ldk.structs.Balance.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; @@ -265,9 +342,15 @@ public class Balance : CommonBase { return this.eq((Balance)o); } /** - * The amount claimable, in satoshis. This excludes balances that we are unsure if we are able - * to claim, this is because we are waiting for a preimage or for a timeout to expire. For more - * information on these balances see [`Balance::MaybeTimeoutClaimableHTLC`] and + * The amount claimable, in satoshis. + * + * For outbound payments, this excludes the balance from the possible HTLC timeout. + * + * For forwarded payments, this includes the balance from the possible HTLC timeout as + * (to be conservative) that balance does not include routing fees we'd earn if we'd claim + * the balance from a preimage in a successful forward. + * + * For more information on these balances see [`Balance::MaybeTimeoutClaimableHTLC`] and * [`Balance::MaybePreimageClaimableHTLC`]. * * On-chain fees required to claim the balance are not included in this amount. diff --git a/c_sharp/src/org/ldk/structs/BlindedForward.cs b/c_sharp/src/org/ldk/structs/BlindedForward.cs index da99ae4d..dd42ec2f 100644 --- a/c_sharp/src/org/ldk/structs/BlindedForward.cs +++ b/c_sharp/src/org/ldk/structs/BlindedForward.cs @@ -59,13 +59,44 @@ public class BlindedForward : CommonBase { GC.KeepAlive(val); } + /** + * Overrides the next hop's [`msgs::UpdateAddHTLC::blinding_point`]. Set if this HTLC is being + * forwarded within a [`BlindedPaymentPath`] that was concatenated to another blinded path that + * starts at the next hop. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public byte[] get_next_blinding_override() { + long ret = bindings.BlindedForward_get_next_blinding_override(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Overrides the next hop's [`msgs::UpdateAddHTLC::blinding_point`]. Set if this HTLC is being + * forwarded within a [`BlindedPaymentPath`] that was concatenated to another blinded path that + * starts at the next hop. + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public void set_next_blinding_override(byte[] val) { + bindings.BlindedForward_set_next_blinding_override(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + /** * Constructs a new BlindedForward given each field + * + * Note that next_blinding_override_arg (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public static BlindedForward of(byte[] inbound_blinding_point_arg, BlindedFailure failure_arg) { - long ret = bindings.BlindedForward_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(inbound_blinding_point_arg, 33)), failure_arg); + public static BlindedForward of(byte[] inbound_blinding_point_arg, BlindedFailure failure_arg, byte[] next_blinding_override_arg) { + long ret = bindings.BlindedForward_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(inbound_blinding_point_arg, 33)), failure_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(next_blinding_override_arg, 33))); GC.KeepAlive(inbound_blinding_point_arg); GC.KeepAlive(failure_arg); + GC.KeepAlive(next_blinding_override_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.BlindedForward ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedForward(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; diff --git a/c_sharp/src/org/ldk/structs/BlindedHop.cs b/c_sharp/src/org/ldk/structs/BlindedHop.cs index 5829ee0f..fd9cafa9 100644 --- a/c_sharp/src/org/ldk/structs/BlindedHop.cs +++ b/c_sharp/src/org/ldk/structs/BlindedHop.cs @@ -18,7 +18,7 @@ public class BlindedHop : CommonBase { } /** - * The blinded node id of this hop in a [`BlindedPath`]. + * The blinded node id of this hop in a blinded path. */ public byte[] get_blinded_node_id() { long ret = bindings.BlindedHop_get_blinded_node_id(this.ptr); @@ -29,7 +29,7 @@ public class BlindedHop : CommonBase { } /** - * The blinded node id of this hop in a [`BlindedPath`]. + * The blinded node id of this hop in a blinded path. */ public void set_blinded_node_id(byte[] val) { bindings.BlindedHop_set_blinded_node_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); @@ -38,7 +38,7 @@ public class BlindedHop : CommonBase { } /** - * The encrypted payload intended for this hop in a [`BlindedPath`]. + * The encrypted payload intended for this hop in a blinded path. * * Returns a copy of the field. */ @@ -51,7 +51,7 @@ public class BlindedHop : CommonBase { } /** - * The encrypted payload intended for this hop in a [`BlindedPath`]. + * The encrypted payload intended for this hop in a blinded path. */ public void set_encrypted_payload(byte[] val) { bindings.BlindedHop_set_encrypted_payload(this.ptr, InternalUtils.encodeUint8Array(val)); diff --git a/c_sharp/src/org/ldk/structs/BlindedHopFeatures.cs b/c_sharp/src/org/ldk/structs/BlindedHopFeatures.cs index c1cf013f..3a29b3ab 100644 --- a/c_sharp/src/org/ldk/structs/BlindedHopFeatures.cs +++ b/c_sharp/src/org/ldk/structs/BlindedHopFeatures.cs @@ -15,6 +15,28 @@ public class BlindedHopFeatures : CommonBase { if (ptr != 0) { bindings.BlindedHopFeatures_free(ptr); } } + /** + * Serialize the BlindedHopFeatures object into a byte array which can be read by BlindedHopFeatures_read + */ + public byte[] write() { + long ret = bindings.BlindedHopFeatures_write(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Read a BlindedHopFeatures from a byte array, created by BlindedHopFeatures_write + */ + public static Result_BlindedHopFeaturesDecodeErrorZ read(byte[] ser) { + long ret = bindings.BlindedHopFeatures_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedHopFeaturesDecodeErrorZ ret_hu_conv = Result_BlindedHopFeaturesDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + /** * Checks if two BlindedHopFeaturess contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. @@ -73,6 +95,27 @@ public class BlindedHopFeatures : CommonBase { return ret_hu_conv; } + /** + * Returns the feature set as a list of bytes, in little-endian. This is in reverse byte order + * from most on-the-wire encodings. + */ + public byte[] le_flags() { + long ret = bindings.BlindedHopFeatures_le_flags(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Returns true if this `Features` has any optional flags set + */ + public bool supports_any_optional_bits() { + bool ret = bindings.BlindedHopFeatures_supports_any_optional_bits(this.ptr); + GC.KeepAlive(this); + return ret; + } + /** * Returns true if this `Features` object contains required features unknown by `other`. */ @@ -84,6 +127,19 @@ public class BlindedHopFeatures : CommonBase { return ret; } + /** + * Returns the set of required features unknown by `other`, as their bit position. + */ + public long[] required_unknown_bits_from(org.ldk.structs.BlindedHopFeatures other) { + long ret = bindings.BlindedHopFeatures_required_unknown_bits_from(this.ptr, other.ptr); + GC.KeepAlive(this); + GC.KeepAlive(other); + if (ret >= 0 && ret <= 4096) { return null; } + long[] ret_conv = InternalUtils.decodeUint64Array(ret); + if (this != null) { this.ptrs_to.AddLast(other); }; + return ret_conv; + } + /** * Returns true if this `Features` object contains unknown feature flags which are set as * \"required\". @@ -94,6 +150,15 @@ public class BlindedHopFeatures : CommonBase { return ret; } + /** + * Returns true if this `Features` supports any bits which we do not know of + */ + public bool supports_unknown_bits() { + bool ret = bindings.BlindedHopFeatures_supports_unknown_bits(this.ptr); + GC.KeepAlive(this); + return ret; + } + /** * Sets a required feature bit. Errors if `bit` is outside the feature range as defined * by [BOLT 9]. @@ -166,27 +231,5 @@ public class BlindedHopFeatures : CommonBase { return ret_hu_conv; } - /** - * Serialize the BlindedHopFeatures object into a byte array which can be read by BlindedHopFeatures_read - */ - public byte[] write() { - long ret = bindings.BlindedHopFeatures_write(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * Read a BlindedHopFeatures from a byte array, created by BlindedHopFeatures_write - */ - public static Result_BlindedHopFeaturesDecodeErrorZ read(byte[] ser) { - long ret = bindings.BlindedHopFeatures_read(InternalUtils.encodeUint8Array(ser)); - GC.KeepAlive(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_BlindedHopFeaturesDecodeErrorZ ret_hu_conv = Result_BlindedHopFeaturesDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - } } } } diff --git a/c_sharp/src/org/ldk/structs/BlindedMessagePath.cs b/c_sharp/src/org/ldk/structs/BlindedMessagePath.cs new file mode 100644 index 00000000..eb9b8528 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/BlindedMessagePath.cs @@ -0,0 +1,215 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A blinded path to be used for sending or receiving a message, hiding the identity of the + * recipient. + */ +public class BlindedMessagePath : CommonBase { + internal BlindedMessagePath(object _dummy, long ptr) : base(ptr) { } + ~BlindedMessagePath() { + if (ptr != 0) { bindings.BlindedMessagePath_free(ptr); } + } + + internal long clone_ptr() { + long ret = bindings.BlindedMessagePath_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the BlindedMessagePath + */ + public BlindedMessagePath clone() { + long ret = bindings.BlindedMessagePath_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.BlindedMessagePath ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedMessagePath(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 BlindedMessagePath. + */ + public long hash() { + long ret = bindings.BlindedMessagePath_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + public override int GetHashCode() { + return (int)this.hash(); + } + /** + * Checks if two BlindedMessagePaths 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.BlindedMessagePath b) { + bool ret = bindings.BlindedMessagePath_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 BlindedMessagePath)) return false; + return this.eq((BlindedMessagePath)o); + } + /** + * Serialize the BlindedMessagePath object into a byte array which can be read by BlindedMessagePath_read + */ + public byte[] write() { + long ret = bindings.BlindedMessagePath_write(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Read a BlindedMessagePath from a byte array, created by BlindedMessagePath_write + */ + public static Result_BlindedMessagePathDecodeErrorZ read(byte[] ser) { + long ret = bindings.BlindedMessagePath_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedMessagePathDecodeErrorZ ret_hu_conv = Result_BlindedMessagePathDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Create a one-hop blinded path for a message. + */ + public static Result_BlindedMessagePathNoneZ one_hop(byte[] recipient_node_id, org.ldk.structs.MessageContext context, org.ldk.structs.EntropySource entropy_source) { + long ret = bindings.BlindedMessagePath_one_hop(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(recipient_node_id, 33)), context.ptr, entropy_source.ptr); + GC.KeepAlive(recipient_node_id); + GC.KeepAlive(context); + GC.KeepAlive(entropy_source); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedMessagePathNoneZ ret_hu_conv = Result_BlindedMessagePathNoneZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(entropy_source); }; + return ret_hu_conv; + } + + /** + * Create a path for an onion message, to be forwarded along `node_pks`. The last node + * pubkey in `node_pks` will be the destination node. + * + * Errors if no hops are provided or if `node_pk`(s) are invalid. + */ + public static Result_BlindedMessagePathNoneZ of(MessageForwardNode[] intermediate_nodes, byte[] recipient_node_id, org.ldk.structs.MessageContext context, org.ldk.structs.EntropySource entropy_source) { + long ret = bindings.BlindedMessagePath_new(InternalUtils.encodeUint64Array(InternalUtils.mapArray(intermediate_nodes, intermediate_nodes_conv_20 => intermediate_nodes_conv_20.ptr)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(recipient_node_id, 33)), context.ptr, entropy_source.ptr); + GC.KeepAlive(intermediate_nodes); + GC.KeepAlive(recipient_node_id); + GC.KeepAlive(context); + GC.KeepAlive(entropy_source); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedMessagePathNoneZ ret_hu_conv = Result_BlindedMessagePathNoneZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(entropy_source); }; + return ret_hu_conv; + } + + /** + * Attempts to a use a compact representation for the [`IntroductionNode`] by using a directed + * short channel id from a channel in `network_graph` leading to the introduction node. + * + * While this may result in a smaller encoding, there is a trade off in that the path may + * become invalid if the channel is closed or hasn't been propagated via gossip. Therefore, + * calling this may not be suitable for long-lived blinded paths. + */ + public void use_compact_introduction_node(org.ldk.structs.ReadOnlyNetworkGraph network_graph) { + bindings.BlindedMessagePath_use_compact_introduction_node(this.ptr, network_graph.ptr); + GC.KeepAlive(this); + GC.KeepAlive(network_graph); + if (this != null) { this.ptrs_to.AddLast(network_graph); }; + } + + /** + * 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.BlindedMessagePath_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; + } + + /** + * The [`IntroductionNode`] of the blinded path. + */ + public IntroductionNode introduction_node() { + long ret = bindings.BlindedMessagePath_introduction_node(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; + } + + /** + * Used by the [`IntroductionNode`] to decrypt its [`encrypted_payload`] to forward the message. + * + * [`encrypted_payload`]: BlindedHop::encrypted_payload + */ + public byte[] blinding_point() { + long ret = bindings.BlindedMessagePath_blinding_point(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * The [`BlindedHop`]s within the blinded path. + */ + public BlindedHop[] blinded_hops() { + long ret = bindings.BlindedMessagePath_blinded_hops(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + int ret_conv_12_len = InternalUtils.getArrayLength(ret); + BlindedHop[] ret_conv_12_arr = new BlindedHop[ret_conv_12_len]; + for (int m = 0; m < ret_conv_12_len; m++) { + long ret_conv_12 = InternalUtils.getU64ArrayElem(ret, m); + org.ldk.structs.BlindedHop ret_conv_12_hu_conv = null; if (ret_conv_12 < 0 || ret_conv_12 > 4096) { ret_conv_12_hu_conv = new org.ldk.structs.BlindedHop(null, ret_conv_12); } + if (ret_conv_12_hu_conv != null) { ret_conv_12_hu_conv.ptrs_to.AddLast(this); }; + ret_conv_12_arr[m] = ret_conv_12_hu_conv; + } + bindings.free_buffer(ret); + return ret_conv_12_arr; + } + + /** + * Advance the blinded onion message path by one hop, making the second hop into the new + * introduction node. + * + * Will only modify `self` when returning `Ok`. + */ + public Result_NoneNoneZ advance_path_by_one(org.ldk.structs.NodeSigner node_signer, org.ldk.structs.NodeIdLookUp node_id_lookup) { + long ret = bindings.BlindedMessagePath_advance_path_by_one(this.ptr, node_signer.ptr, node_id_lookup.ptr); + GC.KeepAlive(this); + GC.KeepAlive(node_signer); + GC.KeepAlive(node_id_lookup); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(node_signer); }; + if (this != null) { this.ptrs_to.AddLast(node_id_lookup); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/BlindedPath.cs b/c_sharp/src/org/ldk/structs/BlindedPath.cs deleted file mode 100644 index ee027ffb..00000000 --- a/c_sharp/src/org/ldk/structs/BlindedPath.cs +++ /dev/null @@ -1,236 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - - -/** - * Onion messages and payments can be sent and received to blinded paths, which serve to hide the - * identity of the recipient. - */ -public class BlindedPath : CommonBase { - internal BlindedPath(object _dummy, long ptr) : base(ptr) { } - ~BlindedPath() { - if (ptr != 0) { bindings.BlindedPath_free(ptr); } - } - - /** - * To send to a blinded path, the sender first finds a route to the unblinded - * `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 IntroductionNode get_introduction_node() { - long ret = bindings.BlindedPath_get_introduction_node(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; - } - - /** - * To send to a blinded path, the sender first finds a route to the unblinded - * `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(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); }; - } - - /** - * Used by the introduction node to decrypt its [`encrypted_payload`] to forward the onion - * message or payment. - * - * [`encrypted_payload`]: BlindedHop::encrypted_payload - */ - public byte[] get_blinding_point() { - long ret = bindings.BlindedPath_get_blinding_point(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * Used by the introduction node to decrypt its [`encrypted_payload`] to forward the onion - * message or payment. - * - * [`encrypted_payload`]: BlindedHop::encrypted_payload - */ - public void set_blinding_point(byte[] val) { - bindings.BlindedPath_set_blinding_point(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * The hops composing the blinded path. - */ - public BlindedHop[] get_blinded_hops() { - long ret = bindings.BlindedPath_get_blinded_hops(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - int ret_conv_12_len = InternalUtils.getArrayLength(ret); - BlindedHop[] ret_conv_12_arr = new BlindedHop[ret_conv_12_len]; - for (int m = 0; m < ret_conv_12_len; m++) { - long ret_conv_12 = InternalUtils.getU64ArrayElem(ret, m); - org.ldk.structs.BlindedHop ret_conv_12_hu_conv = null; if (ret_conv_12 < 0 || ret_conv_12 > 4096) { ret_conv_12_hu_conv = new org.ldk.structs.BlindedHop(null, ret_conv_12); } - if (ret_conv_12_hu_conv != null) { ret_conv_12_hu_conv.ptrs_to.AddLast(this); }; - ret_conv_12_arr[m] = ret_conv_12_hu_conv; - } - bindings.free_buffer(ret); - return ret_conv_12_arr; - } - - /** - * 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.ptr))); - GC.KeepAlive(this); - GC.KeepAlive(val); - foreach (BlindedHop val_conv_12 in val) { if (this != null) { this.ptrs_to.AddLast(val_conv_12); }; }; - } - - /** - * Constructs a new BlindedPath given each field - */ - 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; - } - - internal long clone_ptr() { - long ret = bindings.BlindedPath_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a copy of the BlindedPath - */ - public BlindedPath clone() { - long ret = bindings.BlindedPath_clone(this.ptr); - GC.KeepAlive(this); - 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(this); }; - return ret_hu_conv; - } - - /** - * Generates a non-cryptographic 64-bit hash of the BlindedPath. - */ - public long hash() { - long ret = bindings.BlindedPath_hash(this.ptr); - GC.KeepAlive(this); - return ret; - } - - public override int GetHashCode() { - return (int)this.hash(); - } - /** - * Checks if two BlindedPaths 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.BlindedPath b) { - bool ret = bindings.BlindedPath_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 BlindedPath)) return false; - return this.eq((BlindedPath)o); - } - /** - * Create a one-hop blinded path for a message. - */ - public static Result_BlindedPathNoneZ one_hop_for_message(byte[] recipient_node_id, org.ldk.structs.EntropySource entropy_source) { - long ret = bindings.BlindedPath_one_hop_for_message(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(recipient_node_id, 33)), entropy_source.ptr); - GC.KeepAlive(recipient_node_id); - GC.KeepAlive(entropy_source); - if (ret >= 0 && ret <= 4096) { return null; } - Result_BlindedPathNoneZ ret_hu_conv = Result_BlindedPathNoneZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(entropy_source); }; - return ret_hu_conv; - } - - /** - * Create a blinded path for an onion message, to be forwarded along `node_pks`. The last node - * pubkey in `node_pks` will be the destination node. - * - * Errors if no hops are provided or if `node_pk`(s) are invalid. - */ - public static Result_BlindedPathNoneZ new_for_message(byte[][] node_pks, org.ldk.structs.EntropySource entropy_source) { - long ret = bindings.BlindedPath_new_for_message(InternalUtils.encodeUint64Array(InternalUtils.mapArray(node_pks, node_pks_conv_8 => InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_pks_conv_8, 33)))), entropy_source.ptr); - GC.KeepAlive(node_pks); - GC.KeepAlive(entropy_source); - if (ret >= 0 && ret <= 4096) { return null; } - Result_BlindedPathNoneZ ret_hu_conv = Result_BlindedPathNoneZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(entropy_source); }; - 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 - */ - public byte[] write() { - long ret = bindings.BlindedPath_write(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * Read a BlindedPath from a byte array, created by BlindedPath_write - */ - public static Result_BlindedPathDecodeErrorZ read(byte[] ser) { - long ret = bindings.BlindedPath_read(InternalUtils.encodeUint8Array(ser)); - GC.KeepAlive(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_BlindedPathDecodeErrorZ ret_hu_conv = Result_BlindedPathDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/BlindedPayInfo.cs b/c_sharp/src/org/ldk/structs/BlindedPayInfo.cs index c68aaa7a..1018b193 100644 --- a/c_sharp/src/org/ldk/structs/BlindedPayInfo.cs +++ b/c_sharp/src/org/ldk/structs/BlindedPayInfo.cs @@ -7,7 +7,7 @@ namespace org { namespace ldk { namespace structs { /** - * Information needed to route a payment across a [`BlindedPath`]. + * Information needed to route a payment across a [`BlindedPaymentPath`]. */ public class BlindedPayInfo : CommonBase { internal BlindedPayInfo(object _dummy, long ptr) : base(ptr) { } @@ -138,7 +138,6 @@ public class BlindedPayInfo : CommonBase { bindings.BlindedPayInfo_set_features(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -155,7 +154,6 @@ public class BlindedPayInfo : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.BlindedPayInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedPayInfo(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); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/BlindedPaymentPath.cs b/c_sharp/src/org/ldk/structs/BlindedPaymentPath.cs new file mode 100644 index 00000000..2769117a --- /dev/null +++ b/c_sharp/src/org/ldk/structs/BlindedPaymentPath.cs @@ -0,0 +1,204 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A blinded path to be used for sending or receiving a payment, hiding the identity of the + * recipient. + */ +public class BlindedPaymentPath : CommonBase { + internal BlindedPaymentPath(object _dummy, long ptr) : base(ptr) { } + ~BlindedPaymentPath() { + if (ptr != 0) { bindings.BlindedPaymentPath_free(ptr); } + } + + /** + * The [`BlindedPayInfo`] used to pay this blinded path. + */ + public BlindedPayInfo get_payinfo() { + long ret = bindings.BlindedPaymentPath_get_payinfo(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.BlindedPayInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedPayInfo(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The [`BlindedPayInfo`] used to pay this blinded path. + */ + public void set_payinfo(org.ldk.structs.BlindedPayInfo val) { + bindings.BlindedPaymentPath_set_payinfo(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + internal long clone_ptr() { + long ret = bindings.BlindedPaymentPath_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the BlindedPaymentPath + */ + public BlindedPaymentPath clone() { + long ret = bindings.BlindedPaymentPath_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.BlindedPaymentPath ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedPaymentPath(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 BlindedPaymentPath. + */ + public long hash() { + long ret = bindings.BlindedPaymentPath_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + public override int GetHashCode() { + return (int)this.hash(); + } + /** + * Checks if two BlindedPaymentPaths 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.BlindedPaymentPath b) { + bool ret = bindings.BlindedPaymentPath_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 BlindedPaymentPath)) return false; + return this.eq((BlindedPaymentPath)o); + } + /** + * Create a one-hop blinded path for a payment. + */ + public static Result_BlindedPaymentPathNoneZ one_hop(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.BlindedPaymentPath_one_hop(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_BlindedPaymentPathNoneZ ret_hu_conv = Result_BlindedPaymentPathNoneZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(entropy_source); }; + return ret_hu_conv; + } + + /** + * Create a blinded path for a payment, to be forwarded along `intermediate_nodes`. + * + * Errors if: + * a provided node id is invalid + * [`BlindedPayInfo`] calculation results in an integer overflow + * any unknown features are required in the provided [`ForwardTlvs`] + */ + public static Result_BlindedPaymentPathNoneZ of(PaymentForwardNode[] 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.BlindedPaymentPath_new(InternalUtils.encodeUint64Array(InternalUtils.mapArray(intermediate_nodes, intermediate_nodes_conv_20 => intermediate_nodes_conv_20.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_BlindedPaymentPathNoneZ ret_hu_conv = Result_BlindedPaymentPathNoneZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(entropy_source); }; + 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.BlindedPaymentPath_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; + } + + /** + * The [`IntroductionNode`] of the blinded path. + */ + public IntroductionNode introduction_node() { + long ret = bindings.BlindedPaymentPath_introduction_node(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; + } + + /** + * Used by the [`IntroductionNode`] to decrypt its [`encrypted_payload`] to forward the payment. + * + * [`encrypted_payload`]: BlindedHop::encrypted_payload + */ + public byte[] blinding_point() { + long ret = bindings.BlindedPaymentPath_blinding_point(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * The [`BlindedHop`]s within the blinded path. + */ + public BlindedHop[] blinded_hops() { + long ret = bindings.BlindedPaymentPath_blinded_hops(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + int ret_conv_12_len = InternalUtils.getArrayLength(ret); + BlindedHop[] ret_conv_12_arr = new BlindedHop[ret_conv_12_len]; + for (int m = 0; m < ret_conv_12_len; m++) { + long ret_conv_12 = InternalUtils.getU64ArrayElem(ret, m); + org.ldk.structs.BlindedHop ret_conv_12_hu_conv = null; if (ret_conv_12 < 0 || ret_conv_12 > 4096) { ret_conv_12_hu_conv = new org.ldk.structs.BlindedHop(null, ret_conv_12); } + if (ret_conv_12_hu_conv != null) { ret_conv_12_hu_conv.ptrs_to.AddLast(this); }; + ret_conv_12_arr[m] = ret_conv_12_hu_conv; + } + bindings.free_buffer(ret); + return ret_conv_12_arr; + } + + /** + * Advance the blinded onion payment path by one hop, making the second hop into the new + * introduction node. + * + * Will only modify `self` when returning `Ok`. + */ + public Result_NoneNoneZ advance_path_by_one(org.ldk.structs.NodeSigner node_signer, org.ldk.structs.NodeIdLookUp node_id_lookup) { + long ret = bindings.BlindedPaymentPath_advance_path_by_one(this.ptr, node_signer.ptr, node_id_lookup.ptr); + GC.KeepAlive(this); + GC.KeepAlive(node_signer); + GC.KeepAlive(node_id_lookup); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(node_signer); }; + if (this != null) { this.ptrs_to.AddLast(node_id_lookup); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/BlindedTail.cs b/c_sharp/src/org/ldk/structs/BlindedTail.cs index b27ce406..e575928d 100644 --- a/c_sharp/src/org/ldk/structs/BlindedTail.cs +++ b/c_sharp/src/org/ldk/structs/BlindedTail.cs @@ -19,9 +19,7 @@ public class BlindedTail : CommonBase { } /** - * The hops of the [`BlindedPath`] provided by the recipient. - * - * [`BlindedPath`]: crate::blinded_path::BlindedPath + * The hops of the [`BlindedPaymentPath`] provided by the recipient. */ public BlindedHop[] get_hops() { long ret = bindings.BlindedTail_get_hops(this.ptr); @@ -40,21 +38,16 @@ public class BlindedTail : CommonBase { } /** - * The hops of the [`BlindedPath`] provided by the recipient. - * - * [`BlindedPath`]: crate::blinded_path::BlindedPath + * The hops of the [`BlindedPaymentPath`] provided by the recipient. */ public void set_hops(BlindedHop[] val) { 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); }; }; } /** - * The blinding point of the [`BlindedPath`] provided by the recipient. - * - * [`BlindedPath`]: crate::blinded_path::BlindedPath + * The blinding point of the [`BlindedPaymentPath`] provided by the recipient. */ public byte[] get_blinding_point() { long ret = bindings.BlindedTail_get_blinding_point(this.ptr); @@ -65,9 +58,7 @@ public class BlindedTail : CommonBase { } /** - * The blinding point of the [`BlindedPath`] provided by the recipient. - * - * [`BlindedPath`]: crate::blinded_path::BlindedPath + * The blinding point of the [`BlindedPaymentPath`] provided by the recipient. */ public void set_blinding_point(byte[] val) { bindings.BlindedTail_set_blinding_point(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); @@ -125,7 +116,6 @@ public class BlindedTail : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.BlindedTail ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedTail(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - foreach (BlindedHop hops_arg_conv_12 in hops_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(hops_arg_conv_12); }; }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Bolt11Invoice.cs b/c_sharp/src/org/ldk/structs/Bolt11Invoice.cs index a44f6c86..57114c76 100644 --- a/c_sharp/src/org/ldk/structs/Bolt11Invoice.cs +++ b/c_sharp/src/org/ldk/structs/Bolt11Invoice.cs @@ -89,7 +89,7 @@ public class Bolt11Invoice : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.SignedRawBolt11Invoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.SignedRawBolt11Invoice(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - if (this != null) { this.ptrs_to.AddLast(this); }; + ; return ret_hu_conv; } @@ -131,7 +131,6 @@ public class Bolt11Invoice : CommonBase { GC.KeepAlive(signed_invoice); if (ret >= 0 && ret <= 4096) { return null; } Result_Bolt11InvoiceBolt11SemanticErrorZ ret_hu_conv = Result_Bolt11InvoiceBolt11SemanticErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(signed_invoice); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Bolt11InvoiceFeatures.cs b/c_sharp/src/org/ldk/structs/Bolt11InvoiceFeatures.cs index 317cc0da..0368e29f 100644 --- a/c_sharp/src/org/ldk/structs/Bolt11InvoiceFeatures.cs +++ b/c_sharp/src/org/ldk/structs/Bolt11InvoiceFeatures.cs @@ -15,6 +15,28 @@ public class Bolt11InvoiceFeatures : CommonBase { if (ptr != 0) { bindings.Bolt11InvoiceFeatures_free(ptr); } } + /** + * Serialize the Bolt11InvoiceFeatures object into a byte array which can be read by Bolt11InvoiceFeatures_read + */ + public byte[] write() { + long ret = bindings.Bolt11InvoiceFeatures_write(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Read a Bolt11InvoiceFeatures from a byte array, created by Bolt11InvoiceFeatures_write + */ + public static Result_Bolt11InvoiceFeaturesDecodeErrorZ read(byte[] ser) { + long ret = bindings.Bolt11InvoiceFeatures_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt11InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_Bolt11InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + /** * Checks if two Bolt11InvoiceFeaturess contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. @@ -62,6 +84,24 @@ public class Bolt11InvoiceFeatures : CommonBase { public override int GetHashCode() { return (int)this.hash(); } + /** + * Getting a route for a keysend payment to a private node requires providing the payee's + * features (since they were not announced in a node announcement). However, keysend payments + * don't have an invoice to pull the payee's features from, so this method is provided for use + * when a [`Bolt11InvoiceFeatures`] is required in a route. + * + * MPP keysend is not widely supported yet, so we parameterize support to allow the user to + * choose whether their router should find multi-part routes. + */ + public static Bolt11InvoiceFeatures for_keysend(bool allow_mpp) { + long ret = bindings.Bolt11InvoiceFeatures_for_keysend(allow_mpp); + GC.KeepAlive(allow_mpp); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt11InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Bolt11InvoiceFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + /** * Create a blank Features with no features set */ @@ -73,6 +113,27 @@ public class Bolt11InvoiceFeatures : CommonBase { return ret_hu_conv; } + /** + * Returns the feature set as a list of bytes, in little-endian. This is in reverse byte order + * from most on-the-wire encodings. + */ + public byte[] le_flags() { + long ret = bindings.Bolt11InvoiceFeatures_le_flags(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Returns true if this `Features` has any optional flags set + */ + public bool supports_any_optional_bits() { + bool ret = bindings.Bolt11InvoiceFeatures_supports_any_optional_bits(this.ptr); + GC.KeepAlive(this); + return ret; + } + /** * Returns true if this `Features` object contains required features unknown by `other`. */ @@ -84,6 +145,19 @@ public class Bolt11InvoiceFeatures : CommonBase { return ret; } + /** + * Returns the set of required features unknown by `other`, as their bit position. + */ + public long[] required_unknown_bits_from(org.ldk.structs.Bolt11InvoiceFeatures other) { + long ret = bindings.Bolt11InvoiceFeatures_required_unknown_bits_from(this.ptr, other.ptr); + GC.KeepAlive(this); + GC.KeepAlive(other); + if (ret >= 0 && ret <= 4096) { return null; } + long[] ret_conv = InternalUtils.decodeUint64Array(ret); + if (this != null) { this.ptrs_to.AddLast(other); }; + return ret_conv; + } + /** * Returns true if this `Features` object contains unknown feature flags which are set as * \"required\". @@ -94,6 +168,15 @@ public class Bolt11InvoiceFeatures : CommonBase { return ret; } + /** + * Returns true if this `Features` supports any bits which we do not know of + */ + public bool supports_unknown_bits() { + bool ret = bindings.Bolt11InvoiceFeatures_supports_unknown_bits(this.ptr); + GC.KeepAlive(this); + return ret; + } + /** * Sets a required feature bit. Errors if `bit` is outside the feature range as defined * by [BOLT 9]. @@ -166,28 +249,6 @@ public class Bolt11InvoiceFeatures : CommonBase { return ret_hu_conv; } - /** - * Serialize the Bolt11InvoiceFeatures object into a byte array which can be read by Bolt11InvoiceFeatures_read - */ - public byte[] write() { - long ret = bindings.Bolt11InvoiceFeatures_write(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * Read a Bolt11InvoiceFeatures from a byte array, created by Bolt11InvoiceFeatures_write - */ - public static Result_Bolt11InvoiceFeaturesDecodeErrorZ read(byte[] ser) { - long ret = bindings.Bolt11InvoiceFeatures_read(InternalUtils.encodeUint8Array(ser)); - GC.KeepAlive(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_Bolt11InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_Bolt11InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - /** * Set this feature as optional. */ diff --git a/c_sharp/src/org/ldk/structs/Bolt11InvoiceSignature.cs b/c_sharp/src/org/ldk/structs/Bolt11InvoiceSignature.cs index e6c65abc..ec485327 100644 --- a/c_sharp/src/org/ldk/structs/Bolt11InvoiceSignature.cs +++ b/c_sharp/src/org/ldk/structs/Bolt11InvoiceSignature.cs @@ -15,6 +15,32 @@ public class Bolt11InvoiceSignature : CommonBase { if (ptr != 0) { bindings.Bolt11InvoiceSignature_free(ptr); } } + public byte[] get_a() { + long ret = bindings.Bolt11InvoiceSignature_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.Bolt11InvoiceSignature_set_a(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 68))); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Constructs a new Bolt11InvoiceSignature given each field + */ + public static Bolt11InvoiceSignature of(byte[] a_arg) { + long ret = bindings.Bolt11InvoiceSignature_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(a_arg, 68))); + GC.KeepAlive(a_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt11InvoiceSignature ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Bolt11InvoiceSignature(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.Bolt11InvoiceSignature_clone_ptr(this.ptr); GC.KeepAlive(this); diff --git a/c_sharp/src/org/ldk/structs/Bolt11ParseError.cs b/c_sharp/src/org/ldk/structs/Bolt11ParseError.cs index 27cdaea3..6d16cd60 100644 --- a/c_sharp/src/org/ldk/structs/Bolt11ParseError.cs +++ b/c_sharp/src/org/ldk/structs/Bolt11ParseError.cs @@ -177,7 +177,6 @@ public class Bolt11ParseError : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Bolt11ParseError ret_hu_conv = org.ldk.structs.Bolt11ParseError.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; } diff --git a/c_sharp/src/org/ldk/structs/Bolt12Invoice.cs b/c_sharp/src/org/ldk/structs/Bolt12Invoice.cs index e498a962..97b1d00d 100644 --- a/c_sharp/src/org/ldk/structs/Bolt12Invoice.cs +++ b/c_sharp/src/org/ldk/structs/Bolt12Invoice.cs @@ -40,6 +40,77 @@ public class Bolt12Invoice : CommonBase { return ret_hu_conv; } + /** + * Duration since the Unix epoch when the invoice was created. + */ + public long created_at() { + long ret = bindings.Bolt12Invoice_created_at(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Duration since + * [`Bolt12Invoice::created_at`] + * when the invoice has expired and therefore should no longer be paid. + */ + public long relative_expiry() { + long ret = bindings.Bolt12Invoice_relative_expiry(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Whether the invoice has expired. + */ + public bool is_expired() { + bool ret = bindings.Bolt12Invoice_is_expired(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Fallback addresses for paying the invoice on-chain, in order of most-preferred to + * least-preferred. + */ + public string[] fallbacks() { + long ret = bindings.Bolt12Invoice_fallbacks(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + int ret_conv_8_len = InternalUtils.getArrayLength(ret); + string[] ret_conv_8_arr = new string[ret_conv_8_len]; + for (int i = 0; i < ret_conv_8_len; i++) { + long ret_conv_8 = InternalUtils.getU64ArrayElem(ret, i); + string ret_conv_8_conv = InternalUtils.decodeString(ret_conv_8); + ret_conv_8_arr[i] = ret_conv_8_conv; + } + bindings.free_buffer(ret); + return ret_conv_8_arr; + } + + /** + * Features pertaining to paying an invoice. + */ + public Bolt12InvoiceFeatures invoice_features() { + long ret = bindings.Bolt12Invoice_invoice_features(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt12InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Bolt12InvoiceFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The public key corresponding to the key used to sign the invoice. + */ + public byte[] signing_pubkey() { + long ret = bindings.Bolt12Invoice_signing_pubkey(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + /** * The chains that may be used when paying a requested invoice. * @@ -188,20 +259,20 @@ public class Bolt12Invoice : CommonBase { * * [`Offer::paths`]: crate::offers::offer::Offer::paths */ - public BlindedPath[] message_paths() { + public BlindedMessagePath[] message_paths() { long ret = bindings.Bolt12Invoice_message_paths(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - int ret_conv_13_len = InternalUtils.getArrayLength(ret); - BlindedPath[] ret_conv_13_arr = new BlindedPath[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.BlindedPath ret_conv_13_hu_conv = null; if (ret_conv_13 < 0 || ret_conv_13 > 4096) { ret_conv_13_hu_conv = new org.ldk.structs.BlindedPath(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; + int ret_conv_20_len = InternalUtils.getArrayLength(ret); + BlindedMessagePath[] ret_conv_20_arr = new BlindedMessagePath[ret_conv_20_len]; + for (int u = 0; u < ret_conv_20_len; u++) { + long ret_conv_20 = InternalUtils.getU64ArrayElem(ret, u); + org.ldk.structs.BlindedMessagePath ret_conv_20_hu_conv = null; if (ret_conv_20 < 0 || ret_conv_20 > 4096) { ret_conv_20_hu_conv = new org.ldk.structs.BlindedMessagePath(null, ret_conv_20); } + if (ret_conv_20_hu_conv != null) { ret_conv_20_hu_conv.ptrs_to.AddLast(this); }; + ret_conv_20_arr[u] = ret_conv_20_hu_conv; } bindings.free_buffer(ret); - return ret_conv_13_arr; + return ret_conv_20_arr; } /** @@ -292,34 +363,6 @@ public class Bolt12Invoice : CommonBase { return ret_hu_conv; } - /** - * Duration since the Unix epoch when the invoice was created. - */ - public long created_at() { - long ret = bindings.Bolt12Invoice_created_at(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Duration since [`Bolt12Invoice::created_at`] when the invoice has expired and therefore - * should no longer be paid. - */ - public long relative_expiry() { - long ret = bindings.Bolt12Invoice_relative_expiry(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Whether the invoice has expired. - */ - public bool is_expired() { - bool ret = bindings.Bolt12Invoice_is_expired(this.ptr); - GC.KeepAlive(this); - return ret; - } - /** * SHA256 hash of the payment preimage that will be given in return for paying the invoice. */ @@ -340,29 +383,6 @@ public class Bolt12Invoice : CommonBase { return ret; } - /** - * Features pertaining to paying an invoice. - */ - public Bolt12InvoiceFeatures invoice_features() { - long ret = bindings.Bolt12Invoice_invoice_features(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Bolt12InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Bolt12InvoiceFeatures(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * The public key corresponding to the key used to sign the invoice. - */ - public byte[] signing_pubkey() { - long ret = bindings.Bolt12Invoice_signing_pubkey(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - /** * Signature of the invoice verified using [`Bolt12Invoice::signing_pubkey`]. */ @@ -386,12 +406,31 @@ public class Bolt12Invoice : CommonBase { } /** - * Verifies that the invoice was for a request or refund created using the given key. Returns - * the associated [`PaymentId`] to use when sending the payment. + * Verifies that the invoice was for a request or refund created using the given key by + * checking the payer metadata from the invoice request. + * + * Returns the associated [`PaymentId`] to use when sending the payment. + */ + public Result_ThirtyTwoBytesNoneZ verify_using_metadata(org.ldk.structs.ExpandedKey key) { + long ret = bindings.Bolt12Invoice_verify_using_metadata(this.ptr, key.ptr); + GC.KeepAlive(this); + GC.KeepAlive(key); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ThirtyTwoBytesNoneZ ret_hu_conv = Result_ThirtyTwoBytesNoneZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(key); }; + return ret_hu_conv; + } + + /** + * Verifies that the invoice was for a request or refund created using the given key by + * checking a payment id and nonce included with the [`BlindedMessagePath`] for which the invoice was + * sent through. */ - public Result_ThirtyTwoBytesNoneZ verify(org.ldk.structs.ExpandedKey key) { - long ret = bindings.Bolt12Invoice_verify(this.ptr, key.ptr); + public Result_ThirtyTwoBytesNoneZ verify_using_payer_data(byte[] payment_id, org.ldk.structs.Nonce nonce, org.ldk.structs.ExpandedKey key) { + long ret = bindings.Bolt12Invoice_verify_using_payer_data(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_id, 32)), nonce.ptr, key.ptr); GC.KeepAlive(this); + GC.KeepAlive(payment_id); + GC.KeepAlive(nonce); GC.KeepAlive(key); if (ret >= 0 && ret <= 4096) { return null; } Result_ThirtyTwoBytesNoneZ ret_hu_conv = Result_ThirtyTwoBytesNoneZ.constr_from_ptr(ret); @@ -422,5 +461,16 @@ public class Bolt12Invoice : CommonBase { return ret_conv; } + /** + * Read a Bolt12Invoice from a byte array, created by Bolt12Invoice_write + */ + public static Result_Bolt12InvoiceDecodeErrorZ read(byte[] ser) { + long ret = bindings.Bolt12Invoice_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt12InvoiceDecodeErrorZ ret_hu_conv = Result_Bolt12InvoiceDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } } } } diff --git a/c_sharp/src/org/ldk/structs/Bolt12InvoiceFeatures.cs b/c_sharp/src/org/ldk/structs/Bolt12InvoiceFeatures.cs index ac0f264b..44bf0ff9 100644 --- a/c_sharp/src/org/ldk/structs/Bolt12InvoiceFeatures.cs +++ b/c_sharp/src/org/ldk/structs/Bolt12InvoiceFeatures.cs @@ -15,6 +15,28 @@ public class Bolt12InvoiceFeatures : CommonBase { if (ptr != 0) { bindings.Bolt12InvoiceFeatures_free(ptr); } } + /** + * Serialize the Bolt12InvoiceFeatures object into a byte array which can be read by Bolt12InvoiceFeatures_read + */ + public byte[] write() { + long ret = bindings.Bolt12InvoiceFeatures_write(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Read a Bolt12InvoiceFeatures from a byte array, created by Bolt12InvoiceFeatures_write + */ + public static Result_Bolt12InvoiceFeaturesDecodeErrorZ read(byte[] ser) { + long ret = bindings.Bolt12InvoiceFeatures_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt12InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_Bolt12InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + /** * Checks if two Bolt12InvoiceFeaturess contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. @@ -73,6 +95,27 @@ public class Bolt12InvoiceFeatures : CommonBase { return ret_hu_conv; } + /** + * Returns the feature set as a list of bytes, in little-endian. This is in reverse byte order + * from most on-the-wire encodings. + */ + public byte[] le_flags() { + long ret = bindings.Bolt12InvoiceFeatures_le_flags(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Returns true if this `Features` has any optional flags set + */ + public bool supports_any_optional_bits() { + bool ret = bindings.Bolt12InvoiceFeatures_supports_any_optional_bits(this.ptr); + GC.KeepAlive(this); + return ret; + } + /** * Returns true if this `Features` object contains required features unknown by `other`. */ @@ -84,6 +127,19 @@ public class Bolt12InvoiceFeatures : CommonBase { return ret; } + /** + * Returns the set of required features unknown by `other`, as their bit position. + */ + public long[] required_unknown_bits_from(org.ldk.structs.Bolt12InvoiceFeatures other) { + long ret = bindings.Bolt12InvoiceFeatures_required_unknown_bits_from(this.ptr, other.ptr); + GC.KeepAlive(this); + GC.KeepAlive(other); + if (ret >= 0 && ret <= 4096) { return null; } + long[] ret_conv = InternalUtils.decodeUint64Array(ret); + if (this != null) { this.ptrs_to.AddLast(other); }; + return ret_conv; + } + /** * Returns true if this `Features` object contains unknown feature flags which are set as * \"required\". @@ -94,6 +150,15 @@ public class Bolt12InvoiceFeatures : CommonBase { return ret; } + /** + * Returns true if this `Features` supports any bits which we do not know of + */ + public bool supports_unknown_bits() { + bool ret = bindings.Bolt12InvoiceFeatures_supports_unknown_bits(this.ptr); + GC.KeepAlive(this); + return ret; + } + /** * Sets a required feature bit. Errors if `bit` is outside the feature range as defined * by [BOLT 9]. @@ -166,28 +231,6 @@ public class Bolt12InvoiceFeatures : CommonBase { return ret_hu_conv; } - /** - * Serialize the Bolt12InvoiceFeatures object into a byte array which can be read by Bolt12InvoiceFeatures_read - */ - public byte[] write() { - long ret = bindings.Bolt12InvoiceFeatures_write(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * Read a Bolt12InvoiceFeatures from a byte array, created by Bolt12InvoiceFeatures_write - */ - public static Result_Bolt12InvoiceFeaturesDecodeErrorZ read(byte[] ser) { - long ret = bindings.Bolt12InvoiceFeatures_read(InternalUtils.encodeUint8Array(ser)); - GC.KeepAlive(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_Bolt12InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_Bolt12InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - /** * Set this feature as optional. */ diff --git a/c_sharp/src/org/ldk/structs/Bolt12OfferContext.cs b/c_sharp/src/org/ldk/structs/Bolt12OfferContext.cs index c75a4349..2d868384 100644 --- a/c_sharp/src/org/ldk/structs/Bolt12OfferContext.cs +++ b/c_sharp/src/org/ldk/structs/Bolt12OfferContext.cs @@ -40,7 +40,6 @@ public class Bolt12OfferContext : CommonBase { bindings.Bolt12OfferContext_set_offer_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -68,7 +67,6 @@ public class Bolt12OfferContext : CommonBase { bindings.Bolt12OfferContext_set_invoice_request(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -81,8 +79,6 @@ public class Bolt12OfferContext : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/Bolt12PaymentError.cs b/c_sharp/src/org/ldk/structs/Bolt12PaymentError.cs new file mode 100644 index 00000000..a15ea712 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Bolt12PaymentError.cs @@ -0,0 +1,130 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * An error when attempting to pay a [`Bolt12Invoice`]. + */ +public class Bolt12PaymentError : CommonBase { + protected Bolt12PaymentError(object _dummy, long ptr) : base(ptr) { } + ~Bolt12PaymentError() { + if (ptr != 0) { bindings.Bolt12PaymentError_free(ptr); } + } + + internal static Bolt12PaymentError constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKBolt12PaymentError_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Bolt12PaymentError_UnexpectedInvoice(ptr); + case 1: return new Bolt12PaymentError_DuplicateInvoice(ptr); + case 2: return new Bolt12PaymentError_UnknownRequiredFeatures(ptr); + case 3: return new Bolt12PaymentError_SendingFailed(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Bolt12PaymentError of type UnexpectedInvoice */ + public class Bolt12PaymentError_UnexpectedInvoice : Bolt12PaymentError { + internal Bolt12PaymentError_UnexpectedInvoice(long ptr) : base(null, ptr) { + } + } + /** A Bolt12PaymentError of type DuplicateInvoice */ + public class Bolt12PaymentError_DuplicateInvoice : Bolt12PaymentError { + internal Bolt12PaymentError_DuplicateInvoice(long ptr) : base(null, ptr) { + } + } + /** A Bolt12PaymentError of type UnknownRequiredFeatures */ + public class Bolt12PaymentError_UnknownRequiredFeatures : Bolt12PaymentError { + internal Bolt12PaymentError_UnknownRequiredFeatures(long ptr) : base(null, ptr) { + } + } + /** A Bolt12PaymentError of type SendingFailed */ + public class Bolt12PaymentError_SendingFailed : Bolt12PaymentError { + public RetryableSendFailure sending_failed; + internal Bolt12PaymentError_SendingFailed(long ptr) : base(null, ptr) { + this.sending_failed = bindings.LDKBolt12PaymentError_SendingFailed_get_sending_failed(ptr); + } + } + internal long clone_ptr() { + long ret = bindings.Bolt12PaymentError_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the Bolt12PaymentError + */ + public Bolt12PaymentError clone() { + long ret = bindings.Bolt12PaymentError_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt12PaymentError ret_hu_conv = org.ldk.structs.Bolt12PaymentError.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 UnexpectedInvoice-variant Bolt12PaymentError + */ + public static Bolt12PaymentError unexpected_invoice() { + long ret = bindings.Bolt12PaymentError_unexpected_invoice(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt12PaymentError ret_hu_conv = org.ldk.structs.Bolt12PaymentError.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 DuplicateInvoice-variant Bolt12PaymentError + */ + public static Bolt12PaymentError duplicate_invoice() { + long ret = bindings.Bolt12PaymentError_duplicate_invoice(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt12PaymentError ret_hu_conv = org.ldk.structs.Bolt12PaymentError.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 UnknownRequiredFeatures-variant Bolt12PaymentError + */ + public static Bolt12PaymentError unknown_required_features() { + long ret = bindings.Bolt12PaymentError_unknown_required_features(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt12PaymentError ret_hu_conv = org.ldk.structs.Bolt12PaymentError.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 SendingFailed-variant Bolt12PaymentError + */ + public static Bolt12PaymentError sending_failed(RetryableSendFailure a) { + long ret = bindings.Bolt12PaymentError_sending_failed(a); + GC.KeepAlive(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt12PaymentError ret_hu_conv = org.ldk.structs.Bolt12PaymentError.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 Bolt12PaymentErrors contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + */ + public bool eq(org.ldk.structs.Bolt12PaymentError b) { + bool ret = bindings.Bolt12PaymentError_eq(this.ptr, b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + return ret; + } + + public override bool Equals(object o) { + if (!(o is Bolt12PaymentError)) return false; + return this.eq((Bolt12PaymentError)o); + } +} +} } } diff --git a/c_sharp/src/org/ldk/structs/BumpTransactionEvent.cs b/c_sharp/src/org/ldk/structs/BumpTransactionEvent.cs index e5d55621..e073fe53 100644 --- a/c_sharp/src/org/ldk/structs/BumpTransactionEvent.cs +++ b/c_sharp/src/org/ldk/structs/BumpTransactionEvent.cs @@ -193,9 +193,6 @@ 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; } @@ -213,8 +210,6 @@ 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; } diff --git a/c_sharp/src/org/ldk/structs/CandidateRouteHop.cs b/c_sharp/src/org/ldk/structs/CandidateRouteHop.cs index 766d93b4..04e903a4 100644 --- a/c_sharp/src/org/ldk/structs/CandidateRouteHop.cs +++ b/c_sharp/src/org/ldk/structs/CandidateRouteHop.cs @@ -107,7 +107,6 @@ public class CandidateRouteHop : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.CandidateRouteHop ret_hu_conv = org.ldk.structs.CandidateRouteHop.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; } @@ -120,7 +119,6 @@ public class CandidateRouteHop : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.CandidateRouteHop ret_hu_conv = org.ldk.structs.CandidateRouteHop.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; } @@ -133,7 +131,6 @@ public class CandidateRouteHop : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.CandidateRouteHop ret_hu_conv = org.ldk.structs.CandidateRouteHop.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; } @@ -146,7 +143,6 @@ public class CandidateRouteHop : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.CandidateRouteHop ret_hu_conv = org.ldk.structs.CandidateRouteHop.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; } @@ -159,7 +155,6 @@ public class CandidateRouteHop : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.CandidateRouteHop ret_hu_conv = org.ldk.structs.CandidateRouteHop.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; } diff --git a/c_sharp/src/org/ldk/structs/ChainMonitor.cs b/c_sharp/src/org/ldk/structs/ChainMonitor.cs index f52ce0f3..828109d9 100644 --- a/c_sharp/src/org/ldk/structs/ChainMonitor.cs +++ b/c_sharp/src/org/ldk/structs/ChainMonitor.cs @@ -62,8 +62,7 @@ public class ChainMonitor : CommonBase { * claims which are awaiting confirmation. * * Includes the balances from each [`ChannelMonitor`] *except* those included in - * `ignored_channels`, allowing you to filter out balances from channels which are still open - * (and whose balance should likely be pulled from the [`ChannelDetails`]). + * `ignored_channels`. * * See [`ChannelMonitor::get_claimable_balances`] for more details on the exact criteria for * inclusion in the return value. @@ -82,7 +81,6 @@ public class ChainMonitor : CommonBase { ret_conv_9_arr[j] = ret_conv_9_hu_conv; } bindings.free_buffer(ret); - foreach (ChannelDetails ignored_channels_conv_16 in ignored_channels) { if (this != null) { this.ptrs_to.AddLast(ignored_channels_conv_16); }; }; return ret_conv_9_arr; } @@ -99,7 +97,6 @@ public class ChainMonitor : CommonBase { GC.KeepAlive(funding_txo); if (ret >= 0 && ret <= 4096) { return null; } Result_LockedChannelMonitorNoneZ ret_hu_conv = Result_LockedChannelMonitorNoneZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(funding_txo); }; return ret_hu_conv; } @@ -127,21 +124,24 @@ public class ChainMonitor : CommonBase { /** * Lists the pending updates for each [`ChannelMonitor`] (by `OutPoint` being monitored). + * Each `Vec` contains `update_id`s from [`ChannelMonitor::get_latest_update_id`] for updates + * that have not yet been fully persisted. Note that if a full monitor is persisted all the pending + * monitor updates must be individually marked completed by calling [`ChainMonitor::channel_monitor_updated`]. */ - public TwoTuple_OutPointCVec_MonitorUpdateIdZZ[] list_pending_monitor_updates() { + public TwoTuple_OutPointCVec_u64ZZ[] list_pending_monitor_updates() { long ret = bindings.ChainMonitor_list_pending_monitor_updates(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - int ret_conv_41_len = InternalUtils.getArrayLength(ret); - TwoTuple_OutPointCVec_MonitorUpdateIdZZ[] ret_conv_41_arr = new TwoTuple_OutPointCVec_MonitorUpdateIdZZ[ret_conv_41_len]; - for (int p = 0; p < ret_conv_41_len; p++) { - long ret_conv_41 = InternalUtils.getU64ArrayElem(ret, p); - TwoTuple_OutPointCVec_MonitorUpdateIdZZ ret_conv_41_hu_conv = new TwoTuple_OutPointCVec_MonitorUpdateIdZZ(null, ret_conv_41); - if (ret_conv_41_hu_conv != null) { ret_conv_41_hu_conv.ptrs_to.AddLast(this); }; - ret_conv_41_arr[p] = ret_conv_41_hu_conv; + int ret_conv_29_len = InternalUtils.getArrayLength(ret); + TwoTuple_OutPointCVec_u64ZZ[] ret_conv_29_arr = new TwoTuple_OutPointCVec_u64ZZ[ret_conv_29_len]; + for (int d = 0; d < ret_conv_29_len; d++) { + long ret_conv_29 = InternalUtils.getU64ArrayElem(ret, d); + TwoTuple_OutPointCVec_u64ZZ ret_conv_29_hu_conv = new TwoTuple_OutPointCVec_u64ZZ(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_41_arr; + return ret_conv_29_arr; } /** @@ -152,22 +152,27 @@ public class ChainMonitor : CommonBase { * 1) This [`ChainMonitor`] calls [`Persist::update_persisted_channel`] which stores the * update to disk and begins updating any remote (e.g. watchtower/backup) copies, * returning [`ChannelMonitorUpdateStatus::InProgress`], - * 2) once all remote copies are updated, you call this function with the - * `completed_update_id` that completed, and once all pending updates have completed the - * channel will be re-enabled. + * 2) once all remote copies are updated, you call this function with [`ChannelMonitor::get_latest_update_id`] + * or [`ChannelMonitorUpdate::update_id`] as the `completed_update_id`, and once all pending + * updates have completed the channel will be re-enabled. + * + * It is only necessary to call [`ChainMonitor::channel_monitor_updated`] when you return [`ChannelMonitorUpdateStatus::InProgress`] + * from [`Persist`] and either: + * 1. A new [`ChannelMonitor`] was added in [`Persist::persist_new_channel`], or + * 2. A [`ChannelMonitorUpdate`] was provided as part of [`Persist::update_persisted_channel`]. + * Note that we don't care about calls to [`Persist::update_persisted_channel`] where no + * [`ChannelMonitorUpdate`] was provided. * * Returns an [`APIError::APIMisuseError`] if `funding_txo` does not match any currently * 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.ptr, completed_update_id.ptr); + public Result_NoneAPIErrorZ channel_monitor_updated(org.ldk.structs.OutPoint funding_txo, long completed_update_id) { + long ret = bindings.ChainMonitor_channel_monitor_updated(this.ptr, funding_txo.ptr, completed_update_id); GC.KeepAlive(this); GC.KeepAlive(funding_txo); GC.KeepAlive(completed_update_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(funding_txo); }; - if (this != null) { this.ptrs_to.AddLast(completed_update_id); }; return ret_hu_conv; } @@ -214,7 +219,6 @@ public class ChainMonitor : CommonBase { 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); }; } /** diff --git a/c_sharp/src/org/ldk/structs/ChainParameters.cs b/c_sharp/src/org/ldk/structs/ChainParameters.cs index 59e2af07..119a78eb 100644 --- a/c_sharp/src/org/ldk/structs/ChainParameters.cs +++ b/c_sharp/src/org/ldk/structs/ChainParameters.cs @@ -60,7 +60,6 @@ public class ChainParameters : CommonBase { bindings.ChainParameters_set_best_block(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -73,7 +72,6 @@ public class ChainParameters : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChainParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChainParameters(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_arg); }; 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 af7d0859..3f896a03 100644 --- a/c_sharp/src/org/ldk/structs/ChannelAnnouncement.cs +++ b/c_sharp/src/org/ldk/structs/ChannelAnnouncement.cs @@ -116,7 +116,6 @@ public class ChannelAnnouncement : CommonBase { bindings.ChannelAnnouncement_set_contents(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -132,7 +131,6 @@ public class ChannelAnnouncement : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelAnnouncement(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(contents_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/ChannelConfig.cs b/c_sharp/src/org/ldk/structs/ChannelConfig.cs index a541b2e4..13f8e6a6 100644 --- a/c_sharp/src/org/ldk/structs/ChannelConfig.cs +++ b/c_sharp/src/org/ldk/structs/ChannelConfig.cs @@ -22,7 +22,7 @@ public class ChannelConfig : CommonBase { * This may be allowed to change at runtime in a later update, however doing so must result in * update messages sent to notify all nodes of our updated relay fee. * - * Default value: 0. + * Default value: `0` */ public int get_forwarding_fee_proportional_millionths() { int ret = bindings.ChannelConfig_get_forwarding_fee_proportional_millionths(this.ptr); @@ -36,7 +36,7 @@ public class ChannelConfig : CommonBase { * This may be allowed to change at runtime in a later update, however doing so must result in * update messages sent to notify all nodes of our updated relay fee. * - * Default value: 0. + * Default value: `0` */ public void set_forwarding_fee_proportional_millionths(int val) { bindings.ChannelConfig_set_forwarding_fee_proportional_millionths(this.ptr, val); @@ -54,7 +54,7 @@ public class ChannelConfig : CommonBase { * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through * this node. * - * Default value: 1000. + * Default value: `1000` * * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths */ @@ -74,7 +74,7 @@ public class ChannelConfig : CommonBase { * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through * this node. * - * Default value: 1000. + * Default value: `1000` * * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths */ @@ -99,9 +99,10 @@ public class ChannelConfig : CommonBase { * enough time to broadcast and confirm a transaction, possibly with time in between to RBF * the spending transaction). * - * Default value: 72 (12 hours at an average of 6 blocks/hour). - * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as - * [`MIN_CLTV_EXPIRY_DELTA`] instead. + * Default value: `72` (12 hours at an average of 6 blocks/hour) + * + * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`] (Any values less than this will be treated as + * [`MIN_CLTV_EXPIRY_DELTA`] instead.) * * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA */ @@ -126,9 +127,10 @@ public class ChannelConfig : CommonBase { * enough time to broadcast and confirm a transaction, possibly with time in between to RBF * the spending transaction). * - * Default value: 72 (12 hours at an average of 6 blocks/hour). - * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as - * [`MIN_CLTV_EXPIRY_DELTA`] instead. + * Default value: `72` (12 hours at an average of 6 blocks/hour) + * + * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`] (Any values less than this will be treated as + * [`MIN_CLTV_EXPIRY_DELTA`] instead.) * * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA */ @@ -187,12 +189,12 @@ public class ChannelConfig : CommonBase { * 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. + * while we use [`ConfirmationTarget::MaximumFeeEstimate`] (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. + * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of `10_000` * - * [`ConfirmationTarget::OnChainSweep`]: crate::chain::chaininterface::ConfirmationTarget::OnChainSweep + * [`ConfirmationTarget::MaximumFeeEstimate`]: crate::chain::chaininterface::ConfirmationTarget::MaximumFeeEstimate */ public MaxDustHTLCExposure get_max_dust_htlc_exposure() { long ret = bindings.ChannelConfig_get_max_dust_htlc_exposure(this.ptr); @@ -252,18 +254,17 @@ public class ChannelConfig : CommonBase { * 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. + * while we use [`ConfirmationTarget::MaximumFeeEstimate`] (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. + * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of `10_000` * - * [`ConfirmationTarget::OnChainSweep`]: crate::chain::chaininterface::ConfirmationTarget::OnChainSweep + * [`ConfirmationTarget::MaximumFeeEstimate`]: crate::chain::chaininterface::ConfirmationTarget::MaximumFeeEstimate */ public void set_max_dust_htlc_exposure(org.ldk.structs.MaxDustHTLCExposure val) { bindings.ChannelConfig_set_max_dust_htlc_exposure(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -285,7 +286,7 @@ public class ChannelConfig : CommonBase { * [`ChannelCloseMinimum`] fee estimate, but allow our counterparty to pay as much fee as they like. * Thus, this value is ignored when we are not the funder. * - * Default value: 1000 satoshis. + * Default value: `1000` * * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum @@ -315,7 +316,7 @@ public class ChannelConfig : CommonBase { * [`ChannelCloseMinimum`] fee estimate, but allow our counterparty to pay as much fee as they like. * Thus, this value is ignored when we are not the funder. * - * Default value: 1000 satoshis. + * Default value: `1000` * * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum @@ -350,7 +351,7 @@ public class ChannelConfig : CommonBase { * Switching this config flag on may break compatibility with versions of LDK prior to 0.0.116. * Unsetting this flag between restarts may lead to payment receive failures. * - * Default value: false. + * Default value: `false` * * [intercept scids]: crate::ln::channelmanager::ChannelManager::get_intercept_scid * [`forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc @@ -389,7 +390,7 @@ public class ChannelConfig : CommonBase { * Switching this config flag on may break compatibility with versions of LDK prior to 0.0.116. * Unsetting this flag between restarts may lead to payment receive failures. * - * Default value: false. + * Default value: `false` * * [intercept scids]: crate::ln::channelmanager::ChannelManager::get_intercept_scid * [`forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc @@ -418,7 +419,6 @@ public class ChannelConfig : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelConfig(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(max_dust_htlc_exposure_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/ChannelConfigUpdate.cs b/c_sharp/src/org/ldk/structs/ChannelConfigUpdate.cs index 03dcff3f..88eb7548 100644 --- a/c_sharp/src/org/ldk/structs/ChannelConfigUpdate.cs +++ b/c_sharp/src/org/ldk/structs/ChannelConfigUpdate.cs @@ -28,7 +28,6 @@ public class ChannelConfigUpdate : CommonBase { bindings.ChannelConfigUpdate_set_forwarding_fee_proportional_millionths(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } public Option_u32Z get_forwarding_fee_base_msat() { @@ -44,7 +43,6 @@ public class ChannelConfigUpdate : CommonBase { bindings.ChannelConfigUpdate_set_forwarding_fee_base_msat(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } public Option_u16Z get_cltv_expiry_delta() { @@ -60,7 +58,6 @@ public class ChannelConfigUpdate : CommonBase { bindings.ChannelConfigUpdate_set_cltv_expiry_delta(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -79,7 +76,6 @@ public class ChannelConfigUpdate : CommonBase { bindings.ChannelConfigUpdate_set_max_dust_htlc_exposure_msat(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } public Option_u64Z get_force_close_avoidance_max_fee_satoshis() { @@ -95,7 +91,6 @@ public class ChannelConfigUpdate : CommonBase { bindings.ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -111,22 +106,6 @@ public class ChannelConfigUpdate : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelConfigUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelConfigUpdate(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(forwarding_fee_proportional_millionths_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(forwarding_fee_base_msat_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(cltv_expiry_delta_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(max_dust_htlc_exposure_msat_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(force_close_avoidance_max_fee_satoshis_arg); }; - return ret_hu_conv; - } - - /** - * Creates a "default" ChannelConfigUpdate. See struct and individual field documentaiton for details on which values are used. - */ - public static ChannelConfigUpdate with_default() { - long ret = bindings.ChannelConfigUpdate_default(); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ChannelConfigUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelConfigUpdate(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/ChannelCounterparty.cs b/c_sharp/src/org/ldk/structs/ChannelCounterparty.cs index 7768ddf9..4bcad0d7 100644 --- a/c_sharp/src/org/ldk/structs/ChannelCounterparty.cs +++ b/c_sharp/src/org/ldk/structs/ChannelCounterparty.cs @@ -59,7 +59,6 @@ public class ChannelCounterparty : CommonBase { bindings.ChannelCounterparty_set_features(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -117,7 +116,6 @@ public class ChannelCounterparty : CommonBase { bindings.ChannelCounterparty_set_forwarding_info(this.ptr, val == null ? 0 : val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -143,7 +141,6 @@ public class ChannelCounterparty : CommonBase { bindings.ChannelCounterparty_set_outbound_htlc_minimum_msat(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -165,7 +162,6 @@ public class ChannelCounterparty : CommonBase { bindings.ChannelCounterparty_set_outbound_htlc_maximum_msat(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -184,10 +180,6 @@ public class ChannelCounterparty : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelCounterparty ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelCounterparty(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(forwarding_info_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(outbound_htlc_minimum_msat_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(outbound_htlc_maximum_msat_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/ChannelDerivationParameters.cs b/c_sharp/src/org/ldk/structs/ChannelDerivationParameters.cs index 79775c84..deb9aaf2 100644 --- a/c_sharp/src/org/ldk/structs/ChannelDerivationParameters.cs +++ b/c_sharp/src/org/ldk/structs/ChannelDerivationParameters.cs @@ -74,7 +74,6 @@ public class ChannelDerivationParameters : CommonBase { bindings.ChannelDerivationParameters_set_transaction_parameters(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -88,7 +87,6 @@ public class ChannelDerivationParameters : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelDerivationParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelDerivationParameters(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(transaction_parameters_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/ChannelDetails.cs b/c_sharp/src/org/ldk/structs/ChannelDetails.cs index 4fdf88de..e5019e39 100644 --- a/c_sharp/src/org/ldk/structs/ChannelDetails.cs +++ b/c_sharp/src/org/ldk/structs/ChannelDetails.cs @@ -9,8 +9,14 @@ namespace org { namespace ldk { namespace structs { /** * Details of a channel, as returned by [`ChannelManager::list_channels`] and [`ChannelManager::list_usable_channels`] * + * Balances of a channel are available through [`ChainMonitor::get_claimable_balances`] and + * [`ChannelMonitor::get_claimable_balances`], calculated with respect to the corresponding on-chain + * transactions. + * * [`ChannelManager::list_channels`]: crate::ln::channelmanager::ChannelManager::list_channels * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels + * [`ChainMonitor::get_claimable_balances`]: crate::chain::chainmonitor::ChainMonitor::get_claimable_balances + * [`ChannelMonitor::get_claimable_balances`]: crate::chain::channelmonitor::ChannelMonitor::get_claimable_balances */ public class ChannelDetails : CommonBase { internal ChannelDetails(object _dummy, long ptr) : base(ptr) { } @@ -43,7 +49,6 @@ public class ChannelDetails : CommonBase { bindings.ChannelDetails_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -65,7 +70,6 @@ public class ChannelDetails : CommonBase { bindings.ChannelDetails_set_counterparty(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -93,7 +97,6 @@ public class ChannelDetails : CommonBase { bindings.ChannelDetails_set_funding_txo(this.ptr, val == null ? 0 : val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -123,7 +126,6 @@ public class ChannelDetails : CommonBase { bindings.ChannelDetails_set_channel_type(this.ptr, val == null ? 0 : val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -171,7 +173,6 @@ public class ChannelDetails : CommonBase { bindings.ChannelDetails_set_short_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -209,7 +210,6 @@ public class ChannelDetails : CommonBase { bindings.ChannelDetails_set_outbound_scid_alias(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -247,7 +247,6 @@ public class ChannelDetails : CommonBase { bindings.ChannelDetails_set_inbound_scid_alias(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -303,7 +302,6 @@ public class ChannelDetails : CommonBase { bindings.ChannelDetails_set_unspendable_punishment_reserve(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -367,7 +365,6 @@ public class ChannelDetails : CommonBase { bindings.ChannelDetails_set_feerate_sat_per_1000_weight(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -569,7 +566,6 @@ public class ChannelDetails : CommonBase { bindings.ChannelDetails_set_confirmations_required(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -595,7 +591,6 @@ public class ChannelDetails : CommonBase { bindings.ChannelDetails_set_confirmations(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -629,7 +624,6 @@ public class ChannelDetails : CommonBase { bindings.ChannelDetails_set_force_close_spend_delay(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -703,7 +697,6 @@ public class ChannelDetails : CommonBase { bindings.ChannelDetails_set_channel_shutdown_state(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -733,8 +726,8 @@ public class ChannelDetails : CommonBase { /** * True if this channel is (or will be) publicly-announced. */ - public bool get_is_public() { - bool ret = bindings.ChannelDetails_get_is_public(this.ptr); + public bool get_is_announced() { + bool ret = bindings.ChannelDetails_get_is_announced(this.ptr); GC.KeepAlive(this); return ret; } @@ -742,8 +735,8 @@ public class ChannelDetails : CommonBase { /** * True if this channel is (or will be) publicly-announced. */ - public void set_is_public(bool val) { - bindings.ChannelDetails_set_is_public(this.ptr, val); + public void set_is_announced(bool val) { + bindings.ChannelDetails_set_is_announced(this.ptr, val); GC.KeepAlive(this); GC.KeepAlive(val); } @@ -769,7 +762,6 @@ public class ChannelDetails : CommonBase { bindings.ChannelDetails_set_inbound_htlc_minimum_msat(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -791,7 +783,6 @@ public class ChannelDetails : CommonBase { bindings.ChannelDetails_set_inbound_htlc_maximum_msat(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -821,7 +812,6 @@ public class ChannelDetails : CommonBase { bindings.ChannelDetails_set_config(this.ptr, val == null ? 0 : val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -854,7 +844,6 @@ public class ChannelDetails : CommonBase { bindings.ChannelDetails_set_pending_inbound_htlcs(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(val, val_conv_20 => val_conv_20.ptr))); GC.KeepAlive(this); GC.KeepAlive(val); - foreach (InboundHTLCDetails val_conv_20 in val) { if (this != null) { this.ptrs_to.AddLast(val_conv_20); }; }; } /** @@ -887,7 +876,6 @@ public class ChannelDetails : CommonBase { bindings.ChannelDetails_set_pending_outbound_htlcs(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(val, val_conv_21 => val_conv_21.ptr))); GC.KeepAlive(this); GC.KeepAlive(val); - foreach (OutboundHTLCDetails val_conv_21 in val) { if (this != null) { this.ptrs_to.AddLast(val_conv_21); }; }; } /** @@ -897,8 +885,8 @@ public class ChannelDetails : CommonBase { * 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(org.ldk.structs.ChannelId 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, InboundHTLCDetails[] pending_inbound_htlcs_arg, OutboundHTLCDetails[] pending_outbound_htlcs_arg) { - long ret = bindings.ChannelDetails_new(channel_id_arg.ptr, 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, InternalUtils.encodeUint64Array(InternalUtils.mapArray(pending_inbound_htlcs_arg, pending_inbound_htlcs_arg_conv_20 => pending_inbound_htlcs_arg_conv_20.ptr)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(pending_outbound_htlcs_arg, pending_outbound_htlcs_arg_conv_21 => pending_outbound_htlcs_arg_conv_21.ptr))); + public static ChannelDetails of(org.ldk.structs.ChannelId 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_announced_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, InboundHTLCDetails[] pending_inbound_htlcs_arg, OutboundHTLCDetails[] pending_outbound_htlcs_arg) { + long ret = bindings.ChannelDetails_new(channel_id_arg.ptr, 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_announced_arg, inbound_htlc_minimum_msat_arg.ptr, inbound_htlc_maximum_msat_arg.ptr, config_arg == null ? 0 : config_arg.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(pending_inbound_htlcs_arg, pending_inbound_htlcs_arg_conv_20 => pending_inbound_htlcs_arg_conv_20.ptr)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(pending_outbound_htlcs_arg, pending_outbound_htlcs_arg_conv_21 => pending_outbound_htlcs_arg_conv_21.ptr))); GC.KeepAlive(channel_id_arg); GC.KeepAlive(counterparty_arg); GC.KeepAlive(funding_txo_arg); @@ -922,7 +910,7 @@ public class ChannelDetails : CommonBase { GC.KeepAlive(is_channel_ready_arg); GC.KeepAlive(channel_shutdown_state_arg); GC.KeepAlive(is_usable_arg); - GC.KeepAlive(is_public_arg); + GC.KeepAlive(is_announced_arg); GC.KeepAlive(inbound_htlc_minimum_msat_arg); GC.KeepAlive(inbound_htlc_maximum_msat_arg); GC.KeepAlive(config_arg); @@ -931,24 +919,6 @@ public class ChannelDetails : CommonBase { 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(channel_id_arg); }; - 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); }; - foreach (InboundHTLCDetails pending_inbound_htlcs_arg_conv_20 in pending_inbound_htlcs_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(pending_inbound_htlcs_arg_conv_20); }; }; - foreach (OutboundHTLCDetails pending_outbound_htlcs_arg_conv_21 in pending_outbound_htlcs_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(pending_outbound_htlcs_arg_conv_21); }; }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/ChannelFeatures.cs b/c_sharp/src/org/ldk/structs/ChannelFeatures.cs index 29956b15..5d730777 100644 --- a/c_sharp/src/org/ldk/structs/ChannelFeatures.cs +++ b/c_sharp/src/org/ldk/structs/ChannelFeatures.cs @@ -15,6 +15,28 @@ public class ChannelFeatures : CommonBase { if (ptr != 0) { bindings.ChannelFeatures_free(ptr); } } + /** + * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read + */ + public byte[] write() { + long ret = bindings.ChannelFeatures_write(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write + */ + public static Result_ChannelFeaturesDecodeErrorZ read(byte[] ser) { + long ret = bindings.ChannelFeatures_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ChannelFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelFeaturesDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + /** * Checks if two ChannelFeaturess contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. @@ -73,6 +95,27 @@ public class ChannelFeatures : CommonBase { return ret_hu_conv; } + /** + * Returns the feature set as a list of bytes, in little-endian. This is in reverse byte order + * from most on-the-wire encodings. + */ + public byte[] le_flags() { + long ret = bindings.ChannelFeatures_le_flags(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Returns true if this `Features` has any optional flags set + */ + public bool supports_any_optional_bits() { + bool ret = bindings.ChannelFeatures_supports_any_optional_bits(this.ptr); + GC.KeepAlive(this); + return ret; + } + /** * Returns true if this `Features` object contains required features unknown by `other`. */ @@ -84,6 +127,19 @@ public class ChannelFeatures : CommonBase { return ret; } + /** + * Returns the set of required features unknown by `other`, as their bit position. + */ + public long[] required_unknown_bits_from(org.ldk.structs.ChannelFeatures other) { + long ret = bindings.ChannelFeatures_required_unknown_bits_from(this.ptr, other.ptr); + GC.KeepAlive(this); + GC.KeepAlive(other); + if (ret >= 0 && ret <= 4096) { return null; } + long[] ret_conv = InternalUtils.decodeUint64Array(ret); + if (this != null) { this.ptrs_to.AddLast(other); }; + return ret_conv; + } + /** * Returns true if this `Features` object contains unknown feature flags which are set as * \"required\". @@ -94,6 +150,15 @@ public class ChannelFeatures : CommonBase { return ret; } + /** + * Returns true if this `Features` supports any bits which we do not know of + */ + public bool supports_unknown_bits() { + bool ret = bindings.ChannelFeatures_supports_unknown_bits(this.ptr); + GC.KeepAlive(this); + return ret; + } + /** * Sets a required feature bit. Errors if `bit` is outside the feature range as defined * by [BOLT 9]. @@ -166,27 +231,5 @@ public class ChannelFeatures : CommonBase { return ret_hu_conv; } - /** - * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read - */ - public byte[] write() { - long ret = bindings.ChannelFeatures_write(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write - */ - public static Result_ChannelFeaturesDecodeErrorZ read(byte[] ser) { - long ret = bindings.ChannelFeatures_read(InternalUtils.encodeUint8Array(ser)); - GC.KeepAlive(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_ChannelFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelFeaturesDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - } } } } diff --git a/c_sharp/src/org/ldk/structs/ChannelHandshakeConfig.cs b/c_sharp/src/org/ldk/structs/ChannelHandshakeConfig.cs index dc7f352f..a5c6f9a6 100644 --- a/c_sharp/src/org/ldk/structs/ChannelHandshakeConfig.cs +++ b/c_sharp/src/org/ldk/structs/ChannelHandshakeConfig.cs @@ -9,7 +9,7 @@ namespace org { namespace ldk { namespace structs { /** * Configuration we set when applicable. * - * Default::default() provides sane defaults. + * `Default::default()` provides sane defaults. */ public class ChannelHandshakeConfig : CommonBase { internal ChannelHandshakeConfig(object _dummy, long ptr) : base(ptr) { } @@ -19,15 +19,15 @@ public class ChannelHandshakeConfig : CommonBase { /** * Confirmations we will wait for before considering the channel locked in. - * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the + * Applied only for inbound channels (see [`ChannelHandshakeLimits::max_minimum_depth`] for the * equivalent limit applied to outbound channels). * - * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment + * A lower-bound of `1` is applied, requiring all channels to have a confirmed commitment * transaction before operation. If you wish to accept channels with zero confirmations, see * [`UserConfig::manually_accept_inbound_channels`] and * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]. * - * Default value: 6. + * Default value: `6` * * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf @@ -40,15 +40,15 @@ public class ChannelHandshakeConfig : CommonBase { /** * Confirmations we will wait for before considering the channel locked in. - * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the + * Applied only for inbound channels (see [`ChannelHandshakeLimits::max_minimum_depth`] for the * equivalent limit applied to outbound channels). * - * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment + * A lower-bound of `1` is applied, requiring all channels to have a confirmed commitment * transaction before operation. If you wish to accept channels with zero confirmations, see * [`UserConfig::manually_accept_inbound_channels`] and * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]. * - * Default value: 6. + * Default value: `6` * * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf @@ -73,8 +73,8 @@ public class ChannelHandshakeConfig : CommonBase { * case of an honest unilateral channel close, which implicitly decrease the economic value of * our channel. * - * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you - * can tweak config to ask for more security, not less. + * Default value: [`BREAKDOWN_TIMEOUT`] (We enforce it as a minimum at channel opening so you + * can tweak config to ask for more security, not less.) */ public short get_our_to_self_delay() { short ret = bindings.ChannelHandshakeConfig_get_our_to_self_delay(this.ptr); @@ -96,8 +96,8 @@ public class ChannelHandshakeConfig : CommonBase { * case of an honest unilateral channel close, which implicitly decrease the economic value of * our channel. * - * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you - * can tweak config to ask for more security, not less. + * Default value: [`BREAKDOWN_TIMEOUT`] (We enforce it as a minimum at channel opening so you + * can tweak config to ask for more security, not less.) */ public void set_our_to_self_delay(short val) { bindings.ChannelHandshakeConfig_set_our_to_self_delay(this.ptr, val); @@ -111,8 +111,8 @@ public class ChannelHandshakeConfig : CommonBase { * This value is sent to our counterparty on channel-open and we close the channel any time * our counterparty misbehaves by sending us an HTLC with a value smaller than this. * - * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required - * by the protocol. + * Default value: `1` (If the value is less than `1`, it is ignored and set to `1`, as is + * required by the protocol. */ public long get_our_htlc_minimum_msat() { long ret = bindings.ChannelHandshakeConfig_get_our_htlc_minimum_msat(this.ptr); @@ -126,8 +126,8 @@ public class ChannelHandshakeConfig : CommonBase { * This value is sent to our counterparty on channel-open and we close the channel any time * our counterparty misbehaves by sending us an HTLC with a value smaller than this. * - * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required - * by the protocol. + * Default value: `1` (If the value is less than `1`, it is ignored and set to `1`, as is + * required by the protocol. */ public void set_our_htlc_minimum_msat(long val) { bindings.ChannelHandshakeConfig_set_our_htlc_minimum_msat(this.ptr, val); @@ -143,7 +143,7 @@ public class ChannelHandshakeConfig : CommonBase { * channel value in whole percentages. * * Note that: - * If configured to another value than the default value 10, any new channels created with + * If configured to another value than the default value `10`, any new channels created with * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the * `ChannelManager`. * @@ -156,9 +156,11 @@ public class ChannelHandshakeConfig : CommonBase { * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`] * for more information. * - * Default value: 10. - * Minimum value: 1, any values less than 1 will be treated as 1 instead. - * Maximum value: 100, any values larger than 100 will be treated as 100 instead. + * Default value: `10` + * + * Minimum value: `1` (Any values less will be treated as `1` instead.) + * + * Maximum value: `100` (Any values larger will be treated as `100` instead.) */ public byte get_max_inbound_htlc_value_in_flight_percent_of_channel() { byte ret = bindings.ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(this.ptr); @@ -174,7 +176,7 @@ public class ChannelHandshakeConfig : CommonBase { * channel value in whole percentages. * * Note that: - * If configured to another value than the default value 10, any new channels created with + * If configured to another value than the default value `10`, any new channels created with * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the * `ChannelManager`. * @@ -187,9 +189,11 @@ public class ChannelHandshakeConfig : CommonBase { * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`] * for more information. * - * Default value: 10. - * Minimum value: 1, any values less than 1 will be treated as 1 instead. - * Maximum value: 100, any values larger than 100 will be treated as 100 instead. + * Default value: `10` + * + * Minimum value: `1` (Any values less will be treated as `1` instead.) + * + * Maximum value: `100` (Any values larger will be treated as `100` instead.) */ public void set_max_inbound_htlc_value_in_flight_percent_of_channel(byte val) { bindings.ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(this.ptr, val); @@ -212,10 +216,10 @@ public class ChannelHandshakeConfig : CommonBase { * private channel without that option. * * Ignored if the channel is negotiated to be announced, see - * [`ChannelHandshakeConfig::announced_channel`] and + * [`ChannelHandshakeConfig::announce_for_forwarding`] and * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more. * - * Default value: false. This value is likely to change to true in the future. + * Default value: `false` (This value is likely to change to `true` in the future.) * * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue @@ -241,10 +245,10 @@ public class ChannelHandshakeConfig : CommonBase { * private channel without that option. * * Ignored if the channel is negotiated to be announced, see - * [`ChannelHandshakeConfig::announced_channel`] and + * [`ChannelHandshakeConfig::announce_for_forwarding`] and * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more. * - * Default value: false. This value is likely to change to true in the future. + * Default value: `false` (This value is likely to change to `true` in the future.) * * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue @@ -264,10 +268,10 @@ public class ChannelHandshakeConfig : CommonBase { * As the node which funds a channel picks this value this will only apply for new outbound * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set. * - * Default value: false. + * Default value: `false` */ - public bool get_announced_channel() { - bool ret = bindings.ChannelHandshakeConfig_get_announced_channel(this.ptr); + public bool get_announce_for_forwarding() { + bool ret = bindings.ChannelHandshakeConfig_get_announce_for_forwarding(this.ptr); GC.KeepAlive(this); return ret; } @@ -281,10 +285,10 @@ public class ChannelHandshakeConfig : CommonBase { * As the node which funds a channel picks this value this will only apply for new outbound * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set. * - * Default value: false. + * Default value: `false` */ - public void set_announced_channel(bool val) { - bindings.ChannelHandshakeConfig_set_announced_channel(this.ptr, val); + public void set_announce_for_forwarding(bool val) { + bindings.ChannelHandshakeConfig_set_announce_for_forwarding(this.ptr, val); GC.KeepAlive(this); GC.KeepAlive(val); } @@ -300,7 +304,7 @@ public class ChannelHandshakeConfig : CommonBase { * * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`]. * - * Default value: true. + * Default value: `true` * * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey */ @@ -321,7 +325,7 @@ public class ChannelHandshakeConfig : CommonBase { * * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`]. * - * Default value: true. + * Default value: `true` * * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey */ @@ -349,11 +353,15 @@ public class ChannelHandshakeConfig : CommonBase { * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve * other than the default value. * - * Default value: 1% of channel value, i.e., configured as 10,000 millionths. - * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated - * as 1000 sats instead, which is a safe implementation-specific lower bound. - * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%) - * instead, although channel negotiations will fail in that case. + * Default value: `10_000` millionths (i.e., 1% of channel value) + * + * Minimum value: If the calculated proportional value is less than `1000` sats, it will be + * treated as `1000` sats instead, which is a safe implementation-specific lower + * bound. + * + * Maximum value: `1_000_000` (i.e., 100% of channel value. Any values larger than one million + * will be treated as one million instead, although channel negotiations will + * fail in that case.) */ public int get_their_channel_reserve_proportional_millionths() { int ret = bindings.ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(this.ptr); @@ -379,11 +387,15 @@ public class ChannelHandshakeConfig : CommonBase { * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve * other than the default value. * - * Default value: 1% of channel value, i.e., configured as 10,000 millionths. - * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated - * as 1000 sats instead, which is a safe implementation-specific lower bound. - * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%) - * instead, although channel negotiations will fail in that case. + * Default value: `10_000` millionths (i.e., 1% of channel value) + * + * Minimum value: If the calculated proportional value is less than `1000` sats, it will be + * treated as `1000` sats instead, which is a safe implementation-specific lower + * bound. + * + * Maximum value: `1_000_000` (i.e., 100% of channel value. Any values larger than one million + * will be treated as one million instead, although channel negotiations will + * fail in that case.) */ public void set_their_channel_reserve_proportional_millionths(int val) { bindings.ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(this.ptr, val); @@ -414,7 +426,7 @@ public class ChannelHandshakeConfig : CommonBase { * vulnerability after its deployment. For more context, see the [`SIGHASH_SINGLE + update_fee * Considered Harmful`] mailing list post. * - * Default value: false. This value is likely to change to true in the future. + * Default value: `false` (This value is likely to change to `true` in the future.) * * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel @@ -450,7 +462,7 @@ public class ChannelHandshakeConfig : CommonBase { * vulnerability after its deployment. For more context, see the [`SIGHASH_SINGLE + update_fee * Considered Harmful`] mailing list post. * - * Default value: false. This value is likely to change to true in the future. + * Default value: `false` (This value is likely to change to `true` in the future.) * * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel @@ -472,9 +484,10 @@ public class ChannelHandshakeConfig : CommonBase { * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration * other than the default value. * - * Default value: 50 - * Maximum value: 483, any values larger will be treated as 483. - * This is the BOLT #2 spec limit on `max_accepted_htlcs`. + * Default value: `50` + * + * Maximum value: `483` (Any values larger will be treated as `483`. This is the BOLT #2 spec + * limit on `max_accepted_htlcs`.) */ public short get_our_max_accepted_htlcs() { short ret = bindings.ChannelHandshakeConfig_get_our_max_accepted_htlcs(this.ptr); @@ -491,9 +504,10 @@ public class ChannelHandshakeConfig : CommonBase { * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration * other than the default value. * - * Default value: 50 - * Maximum value: 483, any values larger will be treated as 483. - * This is the BOLT #2 spec limit on `max_accepted_htlcs`. + * Default value: `50` + * + * Maximum value: `483` (Any values larger will be treated as `483`. This is the BOLT #2 spec + * limit on `max_accepted_htlcs`.) */ public void set_our_max_accepted_htlcs(short val) { bindings.ChannelHandshakeConfig_set_our_max_accepted_htlcs(this.ptr, val); @@ -504,14 +518,14 @@ public class ChannelHandshakeConfig : CommonBase { /** * Constructs a new ChannelHandshakeConfig given each field */ - public static ChannelHandshakeConfig of(int minimum_depth_arg, short our_to_self_delay_arg, long our_htlc_minimum_msat_arg, byte max_inbound_htlc_value_in_flight_percent_of_channel_arg, bool negotiate_scid_privacy_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg, int their_channel_reserve_proportional_millionths_arg, bool negotiate_anchors_zero_fee_htlc_tx_arg, short our_max_accepted_htlcs_arg) { - long ret = bindings.ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg, max_inbound_htlc_value_in_flight_percent_of_channel_arg, negotiate_scid_privacy_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg, their_channel_reserve_proportional_millionths_arg, negotiate_anchors_zero_fee_htlc_tx_arg, our_max_accepted_htlcs_arg); + public static ChannelHandshakeConfig of(int minimum_depth_arg, short our_to_self_delay_arg, long our_htlc_minimum_msat_arg, byte max_inbound_htlc_value_in_flight_percent_of_channel_arg, bool negotiate_scid_privacy_arg, bool announce_for_forwarding_arg, bool commit_upfront_shutdown_pubkey_arg, int their_channel_reserve_proportional_millionths_arg, bool negotiate_anchors_zero_fee_htlc_tx_arg, short our_max_accepted_htlcs_arg) { + long ret = bindings.ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg, max_inbound_htlc_value_in_flight_percent_of_channel_arg, negotiate_scid_privacy_arg, announce_for_forwarding_arg, commit_upfront_shutdown_pubkey_arg, their_channel_reserve_proportional_millionths_arg, negotiate_anchors_zero_fee_htlc_tx_arg, our_max_accepted_htlcs_arg); GC.KeepAlive(minimum_depth_arg); GC.KeepAlive(our_to_self_delay_arg); GC.KeepAlive(our_htlc_minimum_msat_arg); GC.KeepAlive(max_inbound_htlc_value_in_flight_percent_of_channel_arg); GC.KeepAlive(negotiate_scid_privacy_arg); - GC.KeepAlive(announced_channel_arg); + GC.KeepAlive(announce_for_forwarding_arg); GC.KeepAlive(commit_upfront_shutdown_pubkey_arg); GC.KeepAlive(their_channel_reserve_proportional_millionths_arg); GC.KeepAlive(negotiate_anchors_zero_fee_htlc_tx_arg); diff --git a/c_sharp/src/org/ldk/structs/ChannelHandshakeLimits.cs b/c_sharp/src/org/ldk/structs/ChannelHandshakeLimits.cs index 89360fba..1e472dcc 100644 --- a/c_sharp/src/org/ldk/structs/ChannelHandshakeLimits.cs +++ b/c_sharp/src/org/ldk/structs/ChannelHandshakeLimits.cs @@ -11,7 +11,7 @@ namespace org { namespace ldk { namespace structs { * * These limits are only applied to our counterparty's limits, not our own. * - * Use 0/`::max_value()` as appropriate to skip checking. + * Use `0` or `::max_value()` as appropriate to skip checking. * * Provides sane defaults for most configurations. * @@ -29,7 +29,8 @@ public class ChannelHandshakeLimits : CommonBase { * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so * only applies to inbound channels. * - * Default value: 0. + * Default value: `1000` + * (Minimum of [`ChannelHandshakeConfig::their_channel_reserve_proportional_millionths`]) */ public long get_min_funding_satoshis() { long ret = bindings.ChannelHandshakeLimits_get_min_funding_satoshis(this.ptr); @@ -41,7 +42,8 @@ public class ChannelHandshakeLimits : CommonBase { * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so * only applies to inbound channels. * - * Default value: 0. + * Default value: `1000` + * (Minimum of [`ChannelHandshakeConfig::their_channel_reserve_proportional_millionths`]) */ public void set_min_funding_satoshis(long val) { bindings.ChannelHandshakeLimits_set_min_funding_satoshis(this.ptr, val); @@ -53,7 +55,7 @@ public class ChannelHandshakeLimits : CommonBase { * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so * only applies to inbound channels. * - * Default value: 2^24 - 1. + * Default value: `2^24 - 1` */ public long get_max_funding_satoshis() { long ret = bindings.ChannelHandshakeLimits_get_max_funding_satoshis(this.ptr); @@ -65,7 +67,7 @@ public class ChannelHandshakeLimits : CommonBase { * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so * only applies to inbound channels. * - * Default value: 2^24 - 1. + * Default value: `2^24 - 1` */ public void set_max_funding_satoshis(long val) { bindings.ChannelHandshakeLimits_set_max_funding_satoshis(this.ptr, val); @@ -77,7 +79,7 @@ public class ChannelHandshakeLimits : CommonBase { * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows * you to limit the maximum minimum-size they can require. * - * Default value: u64::max_value. + * Default value: `u64::max_value` */ public long get_max_htlc_minimum_msat() { long ret = bindings.ChannelHandshakeLimits_get_max_htlc_minimum_msat(this.ptr); @@ -89,7 +91,7 @@ public class ChannelHandshakeLimits : CommonBase { * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows * you to limit the maximum minimum-size they can require. * - * Default value: u64::max_value. + * Default value: `u64::max_value` */ public void set_max_htlc_minimum_msat(long val) { bindings.ChannelHandshakeLimits_set_max_htlc_minimum_msat(this.ptr, val); @@ -101,7 +103,7 @@ public class ChannelHandshakeLimits : CommonBase { * The remote node sets a limit on the maximum value of pending HTLCs to them at any given * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value. * - * Default value: 0. + * Default value: `0` */ public long get_min_max_htlc_value_in_flight_msat() { long ret = bindings.ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(this.ptr); @@ -113,7 +115,7 @@ public class ChannelHandshakeLimits : CommonBase { * The remote node sets a limit on the maximum value of pending HTLCs to them at any given * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value. * - * Default value: 0. + * Default value: `0` */ public void set_min_max_htlc_value_in_flight_msat(long val) { bindings.ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(this.ptr, val); @@ -126,7 +128,7 @@ public class ChannelHandshakeLimits : CommonBase { * time, ensuring that we are able to be punished if we broadcast an old state. This allows to * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs). * - * Default value: u64::max_value. + * Default value: `u64::max_value`. */ public long get_max_channel_reserve_satoshis() { long ret = bindings.ChannelHandshakeLimits_get_max_channel_reserve_satoshis(this.ptr); @@ -139,7 +141,7 @@ public class ChannelHandshakeLimits : CommonBase { * time, ensuring that we are able to be punished if we broadcast an old state. This allows to * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs). * - * Default value: u64::max_value. + * Default value: `u64::max_value`. */ public void set_max_channel_reserve_satoshis(long val) { bindings.ChannelHandshakeLimits_set_max_channel_reserve_satoshis(this.ptr, val); @@ -151,7 +153,7 @@ public class ChannelHandshakeLimits : CommonBase { * The remote node sets a limit on the maximum number of pending HTLCs to them at any given * time. This allows you to set a minimum such value. * - * Default value: 0. + * Default value: `0` */ public short get_min_max_accepted_htlcs() { short ret = bindings.ChannelHandshakeLimits_get_min_max_accepted_htlcs(this.ptr); @@ -163,7 +165,7 @@ public class ChannelHandshakeLimits : CommonBase { * The remote node sets a limit on the maximum number of pending HTLCs to them at any given * time. This allows you to set a minimum such value. * - * Default value: 0. + * Default value: `0` */ public void set_min_max_accepted_htlcs(short val) { bindings.ChannelHandshakeLimits_set_min_max_accepted_htlcs(this.ptr, val); @@ -177,7 +179,7 @@ public class ChannelHandshakeLimits : CommonBase { * assume they aren't going to double-spend themselves). * This config allows you to set a limit on the maximum amount of time to wait. * - * Default value: 144, or roughly one day and only applies to outbound channels. + * Default value: `144`, or roughly one day and only applies to outbound channels */ public int get_max_minimum_depth() { int ret = bindings.ChannelHandshakeLimits_get_max_minimum_depth(this.ptr); @@ -191,7 +193,7 @@ public class ChannelHandshakeLimits : CommonBase { * assume they aren't going to double-spend themselves). * This config allows you to set a limit on the maximum amount of time to wait. * - * Default value: 144, or roughly one day and only applies to outbound channels. + * Default value: `144`, or roughly one day and only applies to outbound channels */ public void set_max_minimum_depth(int val) { bindings.ChannelHandshakeLimits_set_max_minimum_depth(this.ptr, val); @@ -211,12 +213,12 @@ public class ChannelHandshakeLimits : CommonBase { * You may wish to un-set this if you allow the user to (or do in an automated fashion) * double-spend the funding transaction to RBF with an alternative channel open. * - * This only applies if our counterparty set their confirmations-required value to 0, and we - * always trust our own funding transaction at 1 confirmation irrespective of this value. + * This only applies if our counterparty set their confirmations-required value to `0`, and we + * always trust our own funding transaction at `1` confirmation irrespective of this value. * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being - * `true` (0) and `false` (1). + * `true` (`0`) and `false` (`1`). * - * Default value: true + * Default value: `true` */ public bool get_trust_own_funding_0conf() { bool ret = bindings.ChannelHandshakeLimits_get_trust_own_funding_0conf(this.ptr); @@ -236,12 +238,12 @@ public class ChannelHandshakeLimits : CommonBase { * You may wish to un-set this if you allow the user to (or do in an automated fashion) * double-spend the funding transaction to RBF with an alternative channel open. * - * This only applies if our counterparty set their confirmations-required value to 0, and we - * always trust our own funding transaction at 1 confirmation irrespective of this value. + * This only applies if our counterparty set their confirmations-required value to `0`, and we + * always trust our own funding transaction at `1` confirmation irrespective of this value. * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being - * `true` (0) and `false` (1). + * `true` (`0`) and `false` (`1`). * - * Default value: true + * Default value: `true` */ public void set_trust_own_funding_0conf(bool val) { bindings.ChannelHandshakeLimits_set_trust_own_funding_0conf(this.ptr, val); @@ -251,13 +253,13 @@ public class ChannelHandshakeLimits : CommonBase { /** * Set to force an incoming channel to match our announced channel preference in - * [`ChannelHandshakeConfig::announced_channel`]. + * [`ChannelHandshakeConfig::announce_for_forwarding`]. * * For a node which is not online reliably, this should be set to true and - * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public) + * [`ChannelHandshakeConfig::announce_for_forwarding`] set to false, ensuring that no announced (aka public) * channels will ever be opened. * - * Default value: true. + * Default value: `true` */ public bool get_force_announced_channel_preference() { bool ret = bindings.ChannelHandshakeLimits_get_force_announced_channel_preference(this.ptr); @@ -267,13 +269,13 @@ public class ChannelHandshakeLimits : CommonBase { /** * Set to force an incoming channel to match our announced channel preference in - * [`ChannelHandshakeConfig::announced_channel`]. + * [`ChannelHandshakeConfig::announce_for_forwarding`]. * * For a node which is not online reliably, this should be set to true and - * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public) + * [`ChannelHandshakeConfig::announce_for_forwarding`] set to false, ensuring that no announced (aka public) * channels will ever be opened. * - * Default value: true. + * Default value: `true` */ public void set_force_announced_channel_preference(bool val) { bindings.ChannelHandshakeLimits_set_force_announced_channel_preference(this.ptr, val); @@ -287,7 +289,7 @@ public class ChannelHandshakeLimits : CommonBase { * Not checking this value would be a security issue, as our peer would be able to set it to * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time. * - * Default value: 2016, which we also enforce as a maximum value so you can tweak config to + * Default value: `2016`, which we also enforce as a maximum value so you can tweak config to * reduce the loss of having useless locked funds (if your peer accepts) */ public short get_their_to_self_delay() { @@ -302,7 +304,7 @@ public class ChannelHandshakeLimits : CommonBase { * Not checking this value would be a security issue, as our peer would be able to set it to * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time. * - * Default value: 2016, which we also enforce as a maximum value so you can tweak config to + * Default value: `2016`, which we also enforce as a maximum value so you can tweak config to * reduce the loss of having useless locked funds (if your peer accepts) */ public void set_their_to_self_delay(short val) { diff --git a/c_sharp/src/org/ldk/structs/ChannelId.cs b/c_sharp/src/org/ldk/structs/ChannelId.cs index b3615fe6..d1f676fb 100644 --- a/c_sharp/src/org/ldk/structs/ChannelId.cs +++ b/c_sharp/src/org/ldk/structs/ChannelId.cs @@ -117,7 +117,6 @@ public class ChannelId : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/ChannelInfo.cs b/c_sharp/src/org/ldk/structs/ChannelInfo.cs index e1a30b94..ec0efe9c 100644 --- a/c_sharp/src/org/ldk/structs/ChannelInfo.cs +++ b/c_sharp/src/org/ldk/structs/ChannelInfo.cs @@ -35,7 +35,6 @@ public class ChannelInfo : CommonBase { bindings.ChannelInfo_set_features(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -57,64 +56,57 @@ public class ChannelInfo : CommonBase { bindings.ChannelInfo_set_node_one(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** - * Details about the first direction of a channel - * - * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + * Source node of the second direction of a channel */ - public ChannelUpdateInfo get_one_to_two() { - long ret = bindings.ChannelInfo_get_one_to_two(this.ptr); + public NodeId get_node_two() { + long ret = bindings.ChannelInfo_get_node_two(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ChannelUpdateInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUpdateInfo(null, ret); } + 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; } /** - * Details about the first direction of a channel - * - * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + * Source node of the second direction of a channel */ - public void set_one_to_two(org.ldk.structs.ChannelUpdateInfo val) { - bindings.ChannelInfo_set_one_to_two(this.ptr, val == null ? 0 : val.ptr); + public void set_node_two(org.ldk.structs.NodeId val) { + bindings.ChannelInfo_set_node_two(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** - * Source node of the second direction of a channel + * The channel capacity as seen on-chain, if chain lookup is available. */ - public NodeId get_node_two() { - long ret = bindings.ChannelInfo_get_node_two(this.ptr); + public Option_u64Z get_capacity_sats() { + long ret = bindings.ChannelInfo_get_capacity_sats(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); } + 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; } /** - * Source node of the second direction of a channel + * The channel capacity as seen on-chain, if chain lookup is available. */ - public void set_node_two(org.ldk.structs.NodeId val) { - bindings.ChannelInfo_set_node_two(this.ptr, val.ptr); + public void set_capacity_sats(org.ldk.structs.Option_u64Z val) { + bindings.ChannelInfo_set_capacity_sats(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** - * Details about the second direction of a channel + * Details about the first direction of a channel * * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public ChannelUpdateInfo get_two_to_one() { - long ret = bindings.ChannelInfo_get_two_to_one(this.ptr); + public ChannelUpdateInfo get_one_to_two() { + long ret = bindings.ChannelInfo_get_one_to_two(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelUpdateInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUpdateInfo(null, ret); } @@ -123,37 +115,39 @@ public class ChannelInfo : CommonBase { } /** - * Details about the second direction of a channel + * Details about the first direction of a channel * * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public void set_two_to_one(org.ldk.structs.ChannelUpdateInfo val) { - bindings.ChannelInfo_set_two_to_one(this.ptr, val == null ? 0 : val.ptr); + public void set_one_to_two(org.ldk.structs.ChannelUpdateInfo val) { + bindings.ChannelInfo_set_one_to_two(this.ptr, val == null ? 0 : val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** - * The channel capacity as seen on-chain, if chain lookup is available. + * Details about the second direction of a channel + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public Option_u64Z get_capacity_sats() { - long ret = bindings.ChannelInfo_get_capacity_sats(this.ptr); + public ChannelUpdateInfo get_two_to_one() { + long ret = bindings.ChannelInfo_get_two_to_one(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); + org.ldk.structs.ChannelUpdateInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUpdateInfo(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; return ret_hu_conv; } /** - * The channel capacity as seen on-chain, if chain lookup is available. + * Details about the second direction of a channel + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public void set_capacity_sats(org.ldk.structs.Option_u64Z val) { - bindings.ChannelInfo_set_capacity_sats(this.ptr, val.ptr); + public void set_two_to_one(org.ldk.structs.ChannelUpdateInfo val) { + bindings.ChannelInfo_set_two_to_one(this.ptr, val == null ? 0 : val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -185,7 +179,6 @@ public class ChannelInfo : CommonBase { bindings.ChannelInfo_set_announcement_message(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() { diff --git a/c_sharp/src/org/ldk/structs/ChannelManager.cs b/c_sharp/src/org/ldk/structs/ChannelManager.cs index 0382bd75..c43bc59c 100644 --- a/c_sharp/src/org/ldk/structs/ChannelManager.cs +++ b/c_sharp/src/org/ldk/structs/ChannelManager.cs @@ -59,7 +59,7 @@ namespace org { namespace ldk { namespace structs { * * ``` * use bitcoin::BlockHash; - * use bitcoin::network::constants::Network; + * use bitcoin::network::Network; * use lightning::chain::BestBlock; * # use lightning::chain::channelmonitor::ChannelMonitor; * use lightning::ln::channelmanager::{ChainParameters, ChannelManager, ChannelManagerReadArgs}; @@ -194,7 +194,8 @@ namespace org { namespace ldk { namespace structs { * } * * On the event processing thread once the peer has responded - * channel_manager.process_pending_events(&|event| match event { + * channel_manager.process_pending_events(&|event| { + * match event { * Event::FundingGenerationReady { * temporary_channel_id, counterparty_node_id, channel_value_satoshis, output_script, * user_channel_id, .. @@ -204,7 +205,7 @@ namespace org { namespace ldk { namespace structs { * channel_value_satoshis, output_script * ); * match channel_manager.funding_transaction_generated( - * &temporary_channel_id, &counterparty_node_id, funding_transaction + * 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), @@ -223,6 +224,8 @@ namespace org { namespace ldk { namespace structs { * }, * ... * # _ => {}, + * } + * Ok(()) * }); * # } * ``` @@ -245,16 +248,18 @@ namespace org { namespace ldk { namespace structs { * # * # fn example(channel_manager: T) { * # let channel_manager = channel_manager.get_cm(); - * channel_manager.process_pending_events(&|event| match event { + * # let error_message = \"Channel force-closed\"; + * 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 + * &temporary_channel_id, &counterparty_node_id, error_message.to_string() * ) { * Ok(()) => println!(\"Rejecting channel {}\", temporary_channel_id), * Err(e) => println!(\"Error rejecting channel {}: {:?}\", temporary_channel_id, e), * } - * return; + * return Ok(()); * } * * let user_channel_id = 43; @@ -267,6 +272,8 @@ namespace org { namespace ldk { namespace structs { * }, * ... * # _ => {}, + * } + * Ok(()) * }); * # } * ``` @@ -295,13 +302,16 @@ namespace org { namespace ldk { namespace structs { * } * * On the event processing thread - * channel_manager.process_pending_events(&|event| match event { + * 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); * }, * ... * # _ => {}, + * } + * Ok(()) * }); * # } * ``` @@ -351,7 +361,8 @@ namespace org { namespace ldk { namespace structs { * }; * * On the event processing thread - * channel_manager.process_pending_events(&|event| match event { + * 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); @@ -367,14 +378,16 @@ namespace org { namespace ldk { namespace structs { * channel_manager.claim_funds(payment_preimage); * }, * ... - * # _ => {}, + * # _ => {}, * }, * Event::PaymentClaimed { payment_hash, amount_msat, .. } => { * assert_eq!(payment_hash, known_payment_hash); * println!(\"Claimed {} msats\", amount_msat); * }, * ... - * # _ => {}, + * # _ => {}, + * } + * Ok(()) * }); * # } * ``` @@ -417,11 +430,15 @@ namespace org { namespace ldk { namespace structs { * ); * * On the event processing thread - * channel_manager.process_pending_events(&|event| match event { + * 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), + * Event::PaymentFailed { payment_hash: Some(payment_hash), .. } => + * println!(\"Failed paying {}\", payment_hash), * ... * # _ => {}, + * } + * Ok(()) * }); * # } * ``` @@ -442,8 +459,9 @@ namespace org { namespace ldk { namespace structs { * # * # fn example(channel_manager: T) -> Result<(), Bolt12SemanticError> { * # let channel_manager = channel_manager.get_cm(); + * # let absolute_expiry = None; * let offer = channel_manager - * .create_offer_builder()? + * .create_offer_builder(absolute_expiry)? * # ; * # // Needed for compiling for c_bindings * # let builder: lightning::offers::offer::OfferBuilder<_, _> = offer.into(); @@ -454,7 +472,8 @@ namespace org { namespace ldk { namespace structs { * let bech32_offer = offer.to_string(); * * On the event processing thread - * channel_manager.process_pending_events(&|event| match event { + * 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); @@ -462,23 +481,23 @@ namespace org { namespace ldk { namespace structs { * }, * PaymentPurpose::Bolt12OfferPayment { payment_preimage: None, .. } => { * println!(\"Unknown payment hash: {}\", payment_hash); - * }, - * ... - * # _ => {}, + * } + * # _ => {}, * }, * Event::PaymentClaimed { payment_hash, amount_msat, .. } => { * println!(\"Claimed {} msats\", amount_msat); * }, * ... * # _ => {}, + * } + * Ok(()) * }); * # 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`]. + * and pays the [`Bolt12Invoice`] response. * * ``` * # use lightning::events::{Event, EventsProvider}; @@ -516,12 +535,14 @@ namespace org { namespace ldk { namespace structs { * ); * * On the event processing thread - * channel_manager.process_pending_events(&|event| match event { + * 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), * ... * # _ => {}, + * } + * Ok(()) * }); * # } * ``` @@ -576,11 +597,14 @@ namespace org { namespace ldk { namespace structs { * ); * * On the event processing thread - * channel_manager.process_pending_events(&|event| match event { + * 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(()) * }); * # Ok(()) * # } @@ -606,18 +630,19 @@ namespace org { namespace ldk { namespace structs { * }; * * On the event processing thread - * channel_manager.process_pending_events(&|event| match event { + * channel_manager.process_pending_events(&|event| { + * match event { * Event::PaymentClaimable { payment_hash, purpose, .. } => match purpose { - * \tPaymentPurpose::Bolt12RefundPayment { payment_preimage: Some(payment_preimage), .. } => { + * PaymentPurpose::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, .. } => { + * PaymentPurpose::Bolt12RefundPayment { payment_preimage: None, .. } => { * println!(\"Unknown payment hash: {}\", payment_hash); - * \t}, + * }, * ... - * # _ => {}, + * # _ => {}, * }, * Event::PaymentClaimed { payment_hash, amount_msat, .. } => { * assert_eq!(payment_hash, known_payment_hash); @@ -625,6 +650,8 @@ namespace org { namespace ldk { namespace structs { * }, * ... * # _ => {}, + * } + * Ok(()) * }); * # } * ``` @@ -767,8 +794,6 @@ public class ChannelManager : 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(signer_provider); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(config); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(_params); }; return ret_hu_conv; } @@ -832,8 +857,6 @@ public class ChannelManager : CommonBase { GC.KeepAlive(override_config); if (ret >= 0 && ret <= 4096) { return null; } 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; } @@ -1006,22 +1029,25 @@ public class ChannelManager : CommonBase { 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; } /** - * Force closes a channel, immediately broadcasting the latest local transaction(s) and - * rejecting new HTLCs on the given channel. Fails if `channel_id` is unknown to - * the manager, or if the `counterparty_node_id` isn't the counterparty of the corresponding - * channel. + * Force closes a channel, immediately broadcasting the latest local transaction(s), + * rejecting new HTLCs. + * + * The provided `error_message` is sent to connected peers for closing + * channels and should be a human-readable description of what went wrong. + * + * Fails if `channel_id` is unknown to the manager, or if the `counterparty_node_id` + * isn't the counterparty of the corresponding channel. */ - 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))); + public Result_NoneAPIErrorZ force_close_broadcasting_latest_txn(org.ldk.structs.ChannelId channel_id, byte[] counterparty_node_id, string error_message) { + long ret = bindings.ChannelManager_force_close_broadcasting_latest_txn(this.ptr, channel_id.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33)), InternalUtils.encodeString(error_message)); GC.KeepAlive(this); GC.KeepAlive(channel_id); GC.KeepAlive(counterparty_node_id); + GC.KeepAlive(error_message); 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); }; @@ -1030,17 +1056,22 @@ public class ChannelManager : CommonBase { /** * Force closes a channel, rejecting new HTLCs on the given channel but skips broadcasting - * 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. + * the latest local transaction(s). * + * The provided `error_message` is sent to connected peers for closing channels and should + * be a human-readable description of what went wrong. + * + * 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 broadcast the latest local transaction(s) via * [`ChannelMonitor::broadcast_latest_holder_commitment_txn`]. */ - 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))); + public Result_NoneAPIErrorZ force_close_without_broadcasting_txn(org.ldk.structs.ChannelId channel_id, byte[] counterparty_node_id, string error_message) { + long ret = bindings.ChannelManager_force_close_without_broadcasting_txn(this.ptr, channel_id.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33)), InternalUtils.encodeString(error_message)); GC.KeepAlive(this); GC.KeepAlive(channel_id); GC.KeepAlive(counterparty_node_id); + GC.KeepAlive(error_message); 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); }; @@ -1050,24 +1081,36 @@ public class ChannelManager : CommonBase { /** * Force close all channels, immediately broadcasting the latest local commitment transaction * for each to the chain and rejecting new HTLCs on each. + * + * The provided `error_message` is sent to connected peers for closing channels and should + * be a human-readable description of what went wrong. */ - public void force_close_all_channels_broadcasting_latest_txn() { - bindings.ChannelManager_force_close_all_channels_broadcasting_latest_txn(this.ptr); + public void force_close_all_channels_broadcasting_latest_txn(string error_message) { + bindings.ChannelManager_force_close_all_channels_broadcasting_latest_txn(this.ptr, InternalUtils.encodeString(error_message)); GC.KeepAlive(this); + GC.KeepAlive(error_message); } /** * Force close all channels rejecting new HTLCs on each but without broadcasting the latest * local transaction(s). + * + * The provided `error_message` is sent to connected peers for closing channels and + * should be a human-readable description of what went wrong. */ - public void force_close_all_channels_without_broadcasting_txn() { - bindings.ChannelManager_force_close_all_channels_without_broadcasting_txn(this.ptr); + public void force_close_all_channels_without_broadcasting_txn(string error_message) { + bindings.ChannelManager_force_close_all_channels_without_broadcasting_txn(this.ptr, InternalUtils.encodeString(error_message)); GC.KeepAlive(this); + GC.KeepAlive(error_message); } /** * Sends a payment along a given route. * + * This method is *DEPRECATED*, use [`Self::send_payment`] instead. If you wish to fix the + * route for a payment, do so by matching the [`PaymentId`] passed to + * [`Router::find_route_with_id`]. + * * Value parameters are provided via the last hop in route, see documentation for [`RouteHop`] * fields for more info. * @@ -1127,8 +1170,6 @@ public class ChannelManager : CommonBase { GC.KeepAlive(payment_id); if (ret >= 0 && ret <= 4096) { return null; } Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(route); }; - if (this != null) { this.ptrs_to.AddLast(recipient_onion); }; return ret_hu_conv; } @@ -1146,9 +1187,6 @@ public class ChannelManager : CommonBase { GC.KeepAlive(retry_strategy); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneRetryableSendFailureZ ret_hu_conv = Result_NoneRetryableSendFailureZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(recipient_onion); }; - if (this != null) { this.ptrs_to.AddLast(route_params); }; - if (this != null) { this.ptrs_to.AddLast(retry_strategy); }; return ret_hu_conv; } @@ -1169,15 +1207,13 @@ public class ChannelManager : CommonBase { * # Requested Invoices * * In the case of paying a [`Bolt12Invoice`] via [`ChannelManager::pay_for_offer`], abandoning - * the payment prior to receiving the invoice will result in an [`Event::InvoiceRequestFailed`] - * and prevent any attempts at paying it once received. The other events may only be generated - * once the invoice has been received. + * the payment prior to receiving the invoice will result in an [`Event::PaymentFailed`] and + * prevent any attempts at paying it once received. * * # Restart Behavior * * If an [`Event::PaymentFailed`] is generated and we restart without first persisting the - * [`ChannelManager`], another [`Event::PaymentFailed`] may be generated; likewise for - * [`Event::InvoiceRequestFailed`]. + * [`ChannelManager`], another [`Event::PaymentFailed`] may be generated. * * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice */ @@ -1212,8 +1248,6 @@ public class ChannelManager : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } Result_ThirtyTwoBytesPaymentSendFailureZ ret_hu_conv = Result_ThirtyTwoBytesPaymentSendFailureZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.AddLast(route); }; - if (this != null) { this.ptrs_to.AddLast(payment_preimage); }; - if (this != null) { this.ptrs_to.AddLast(recipient_onion); }; return ret_hu_conv; } @@ -1236,10 +1270,6 @@ public class ChannelManager : CommonBase { GC.KeepAlive(retry_strategy); if (ret >= 0 && ret <= 4096) { return null; } Result_ThirtyTwoBytesRetryableSendFailureZ ret_hu_conv = Result_ThirtyTwoBytesRetryableSendFailureZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(payment_preimage); }; - if (this != null) { this.ptrs_to.AddLast(recipient_onion); }; - if (this != null) { this.ptrs_to.AddLast(route_params); }; - if (this != null) { this.ptrs_to.AddLast(retry_strategy); }; return ret_hu_conv; } @@ -1254,7 +1284,6 @@ public class ChannelManager : CommonBase { GC.KeepAlive(path); if (ret >= 0 && ret <= 4096) { return null; } Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ ret_hu_conv = Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(path); }; return ret_hu_conv; } @@ -1273,7 +1302,6 @@ public class ChannelManager : CommonBase { GC.KeepAlive(liquidity_limit_multiplier); if (ret >= 0 && ret <= 4096) { return null; } Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ ret_hu_conv = Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(liquidity_limit_multiplier); }; return ret_hu_conv; } @@ -1300,8 +1328,6 @@ public class ChannelManager : CommonBase { GC.KeepAlive(liquidity_limit_multiplier); if (ret >= 0 && ret <= 4096) { return null; } Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ ret_hu_conv = Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(route_params); }; - if (this != null) { this.ptrs_to.AddLast(liquidity_limit_multiplier); }; return ret_hu_conv; } @@ -1345,7 +1371,46 @@ public class ChannelManager : CommonBase { 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; + } + + /** + * Unsafe**: This method does not validate the spent output. It is the caller's + * responsibility to ensure the spent outputs are SegWit, as well as making sure the funding + * transaction has a final absolute locktime, i.e., its locktime is lower than the next block height. + * + * For a safer method, please refer to [`ChannelManager::funding_transaction_generated`]. + * + * Call this in response to a [`Event::FundingGenerationReady`] event. + * + * Note that if this method is called successfully, the funding transaction won't be + * broadcasted and you are expected to broadcast it manually when receiving the + * [`Event::FundingTxBroadcastSafe`] event. + * + * Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided + * for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`]. + * + * May panic if the funding output is duplicative with some other channel (note that this + * should be trivially prevented by using unique funding transaction keys per-channel). + * + * Note to keep the miner incentives aligned in moving the blockchain forward, we recommend + * the wallet software generating the funding transaction to apply anti-fee sniping as + * implemented by Bitcoin Core wallet. See for + * more details. + * + * [`Event::FundingGenerationReady`]: crate::events::Event::FundingGenerationReady + * [`Event::FundingTxBroadcastSafe`]: crate::events::Event::FundingTxBroadcastSafe + * [`Event::ChannelClosed`]: crate::events::Event::ChannelClosed + * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated + */ + public Result_NoneAPIErrorZ unsafe_manual_funding_transaction_generated(org.ldk.structs.ChannelId temporary_channel_id, byte[] counterparty_node_id, org.ldk.structs.OutPoint funding) { + long ret = bindings.ChannelManager_unsafe_manual_funding_transaction_generated(this.ptr, temporary_channel_id.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33)), funding.ptr); + GC.KeepAlive(this); + GC.KeepAlive(temporary_channel_id); + GC.KeepAlive(counterparty_node_id); + GC.KeepAlive(funding); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); return ret_hu_conv; } @@ -1403,7 +1468,6 @@ public class ChannelManager : CommonBase { 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; } @@ -1440,7 +1504,6 @@ public class ChannelManager : CommonBase { 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; } @@ -1572,7 +1635,6 @@ public class ChannelManager : CommonBase { GC.KeepAlive(this); GC.KeepAlive(payment_hash); GC.KeepAlive(failure_code); - if (this != null) { this.ptrs_to.AddLast(failure_code); }; } /** @@ -1699,16 +1761,15 @@ public class ChannelManager : CommonBase { /** * 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. + * [`ChannelManager`] when handling [`InvoiceRequest`] messages for the offer. The offer's + * expiration will be `absolute_expiry` if `Some`, otherwise it will not expire. * * # 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`]. + * Uses [`MessageRouter`] to construct a [`BlindedMessagePath`] for the offer based on the given + * `absolute_expiry` according to [`MAX_SHORT_LIVED_RELATIVE_EXPIRY`]. See those docs for + * privacy implications as well as those of the parameterized [`Router`], which implements + * [`MessageRouter`]. * * Also, uses a derived signing pubkey in the offer for recipient privacy. * @@ -1724,9 +1785,10 @@ public class ChannelManager : CommonBase { * [`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); + public Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ create_offer_builder(org.ldk.structs.Option_u64Z absolute_expiry) { + long ret = bindings.ChannelManager_create_offer_builder(this.ptr, absolute_expiry.ptr); GC.KeepAlive(this); + GC.KeepAlive(absolute_expiry); if (ret >= 0 && ret <= 4096) { return null; } Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ ret_hu_conv = Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); return ret_hu_conv; @@ -1748,18 +1810,17 @@ public class ChannelManager : CommonBase { * * 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`]. + * with an [`Event::PaymentFailed`]. * * 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`]. + * Uses [`MessageRouter`] to construct a [`BlindedMessagePath`] for the refund based on the given + * `absolute_expiry` according to [`MAX_SHORT_LIVED_RELATIVE_EXPIRY`]. See those docs for + * privacy implications as well as those of the parameterized [`Router`], which implements + * [`MessageRouter`]. * * Also, uses a derived payer id in the refund for payer privacy. * @@ -1790,8 +1851,6 @@ public class ChannelManager : CommonBase { 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; } @@ -1819,14 +1878,13 @@ public class ChannelManager : CommonBase { * * To revoke the request, use [`ChannelManager::abandon_payment`] prior to receiving the * invoice. If abandoned, or an invoice isn't received in a reasonable amount of time, the - * payment will fail with an [`Event::InvoiceRequestFailed`]. + * payment will fail with an [`Event::PaymentFailed`]. * * # Privacy * - * Uses a one-hop [`BlindedPath`] for the reply path with [`ChannelManager::get_our_node_id`] - * as the introduction node and a derived payer id for payer privacy. As such, currently, the - * node must be announced. Otherwise, there is no way to find a path to the introduction node - * in order to send the [`Bolt12Invoice`]. + * For payer privacy, uses a derived payer id and uses [`MessageRouter::create_blinded_paths`] + * to construct a [`BlindedMessagePath`] for the reply path. For further privacy implications, see the + * docs of the parameterized [`Router`], which implements [`MessageRouter`]. * * # Limitations * @@ -1864,11 +1922,6 @@ public class ChannelManager : CommonBase { 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(offer); }; - if (this != null) { this.ptrs_to.AddLast(quantity); }; - if (this != null) { this.ptrs_to.AddLast(amount_msats); }; - if (this != null) { this.ptrs_to.AddLast(payer_note); }; - 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; } @@ -1877,8 +1930,8 @@ public class ChannelManager : CommonBase { * message. * * The resulting invoice uses a [`PaymentHash`] recognized by the [`ChannelManager`] and a - * [`BlindedPath`] containing the [`PaymentSecret`] needed to reconstruct the corresponding - * [`PaymentPreimage`]. It is returned purely for informational purposes. + * [`BlindedPaymentPath`] containing the [`PaymentSecret`] needed to reconstruct the + * corresponding [`PaymentPreimage`]. It is returned purely for informational purposes. * * # Limitations * @@ -1946,8 +1999,6 @@ public class ChannelManager : CommonBase { GC.KeepAlive(min_final_cltv_expiry_delta); if (ret >= 0 && ret <= 4096) { return null; } Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ ret_hu_conv = Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(min_value_msat); }; - if (this != null) { this.ptrs_to.AddLast(min_final_cltv_expiry_delta); }; return ret_hu_conv; } @@ -2008,8 +2059,6 @@ public class ChannelManager : CommonBase { GC.KeepAlive(min_final_cltv_expiry); if (ret >= 0 && ret <= 4096) { return null; } Result_ThirtyTwoBytesNoneZ ret_hu_conv = Result_ThirtyTwoBytesNoneZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(min_value_msat); }; - if (this != null) { this.ptrs_to.AddLast(min_final_cltv_expiry); }; return ret_hu_conv; } @@ -2256,6 +2305,19 @@ public class ChannelManager : CommonBase { return ret_hu_conv; } + /** + * Constructs a new AsyncPaymentsMessageHandler which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned AsyncPaymentsMessageHandler must be freed before this_arg is + */ + public AsyncPaymentsMessageHandler as_AsyncPaymentsMessageHandler() { + long ret = bindings.ChannelManager_as_AsyncPaymentsMessageHandler(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + AsyncPaymentsMessageHandler ret_hu_conv = new AsyncPaymentsMessageHandler(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + 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 diff --git a/c_sharp/src/org/ldk/structs/ChannelManagerReadArgs.cs b/c_sharp/src/org/ldk/structs/ChannelManagerReadArgs.cs index 9687cd3c..b5b6bc27 100644 --- a/c_sharp/src/org/ldk/structs/ChannelManagerReadArgs.cs +++ b/c_sharp/src/org/ldk/structs/ChannelManagerReadArgs.cs @@ -271,7 +271,6 @@ public class ChannelManagerReadArgs : CommonBase { bindings.ChannelManagerReadArgs_set_default_config(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -302,7 +301,6 @@ public class ChannelManagerReadArgs : CommonBase { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(tx_broadcaster); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(router); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(logger); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(default_config); }; foreach (ChannelMonitor channel_monitors_conv_16 in channel_monitors) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_monitors_conv_16); }; }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/ChannelMessageHandler.cs b/c_sharp/src/org/ldk/structs/ChannelMessageHandler.cs index 44ba3874..ec1728ff 100644 --- a/c_sharp/src/org/ldk/structs/ChannelMessageHandler.cs +++ b/c_sharp/src/org/ldk/structs/ChannelMessageHandler.cs @@ -360,7 +360,6 @@ public class ChannelMessageHandler : CommonBase { Option_CVec_ThirtyTwoBytesZZ ret = arg.get_chain_hashes(); GC.KeepAlive(arg); 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/ChannelMonitor.cs b/c_sharp/src/org/ldk/structs/ChannelMonitor.cs index 3476e527..df2cbe5f 100644 --- a/c_sharp/src/org/ldk/structs/ChannelMonitor.cs +++ b/c_sharp/src/org/ldk/structs/ChannelMonitor.cs @@ -176,14 +176,19 @@ public class ChannelMonitor : CommonBase { * An [`EventHandler`] may safely call back to the provider, though this shouldn't be needed in * order to handle these events. * + * Will return a [`ReplayEvent`] error if event handling failed and should eventually be retried. + * * [`SpendableOutputs`]: crate::events::Event::SpendableOutputs * [`BumpTransaction`]: crate::events::Event::BumpTransaction */ - public void process_pending_events(org.ldk.structs.EventHandler handler) { - bindings.ChannelMonitor_process_pending_events(this.ptr, handler.ptr); + public Result_NoneReplayEventZ process_pending_events(org.ldk.structs.EventHandler handler) { + long ret = bindings.ChannelMonitor_process_pending_events(this.ptr, handler.ptr); GC.KeepAlive(this); GC.KeepAlive(handler); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneReplayEventZ ret_hu_conv = Result_NoneReplayEventZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.AddLast(handler); }; + return ret_hu_conv; } /** @@ -512,6 +517,15 @@ public class ChannelMonitor : CommonBase { if (this != null) { this.ptrs_to.AddLast(logger); }; } + /** + * Returns true if the monitor has pending claim requests that are not fully confirmed yet. + */ + public bool has_pending_claims() { + bool ret = bindings.ChannelMonitor_has_pending_claims(this.ptr); + GC.KeepAlive(this); + return ret; + } + /** * Triggers rebroadcasts of pending claims from a force-closed channel after a transaction * signature generation failure. diff --git a/c_sharp/src/org/ldk/structs/ChannelMonitorUpdate.cs b/c_sharp/src/org/ldk/structs/ChannelMonitorUpdate.cs index 265a3a72..8bde5ff2 100644 --- a/c_sharp/src/org/ldk/structs/ChannelMonitorUpdate.cs +++ b/c_sharp/src/org/ldk/structs/ChannelMonitorUpdate.cs @@ -96,7 +96,6 @@ public class ChannelMonitorUpdate : CommonBase { 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() { diff --git a/c_sharp/src/org/ldk/structs/ChannelParameters.cs b/c_sharp/src/org/ldk/structs/ChannelParameters.cs new file mode 100644 index 00000000..8a788000 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/ChannelParameters.cs @@ -0,0 +1,198 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A subset of [`CommonOpenChannelFields`], containing various parameters which are set by the + * channel initiator and which are not part of the channel funding transaction. + */ +public class ChannelParameters : CommonBase { + internal ChannelParameters(object _dummy, long ptr) : base(ptr) { } + ~ChannelParameters() { + if (ptr != 0) { bindings.ChannelParameters_free(ptr); } + } + + /** + * The threshold below which outputs on transactions broadcast by the channel initiator will be + * omitted. + */ + public long get_dust_limit_satoshis() { + long ret = bindings.ChannelParameters_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.ChannelParameters_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.ChannelParameters_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.ChannelParameters_set_max_htlc_value_in_flight_msat(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The minimum HTLC size for HTLCs towards the channel initiator, in milli-satoshi + */ + public long get_htlc_minimum_msat() { + long ret = bindings.ChannelParameters_get_htlc_minimum_msat(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The minimum HTLC size for HTLCs towards the channel initiator, in milli-satoshi + */ + public void set_htlc_minimum_msat(long val) { + bindings.ChannelParameters_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.ChannelParameters_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.ChannelParameters_set_commitment_feerate_sat_per_1000_weight(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The number of blocks which the non-channel-initator will have to wait to claim on-chain + * funds if they broadcast a commitment transaction. + */ + public short get_to_self_delay() { + short ret = bindings.ChannelParameters_get_to_self_delay(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The number of blocks which the non-channel-initator will have to wait to claim on-chain + * funds if they broadcast a commitment transaction. + */ + public void set_to_self_delay(short val) { + bindings.ChannelParameters_set_to_self_delay(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The maximum number of pending HTLCs towards the channel initiator. + */ + public short get_max_accepted_htlcs() { + short ret = bindings.ChannelParameters_get_max_accepted_htlcs(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The maximum number of pending HTLCs towards the channel initiator. + */ + public void set_max_accepted_htlcs(short val) { + bindings.ChannelParameters_set_max_accepted_htlcs(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Constructs a new ChannelParameters given each field + */ + public static ChannelParameters of(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 ret = bindings.ChannelParameters_new(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); + 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); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelParameters(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.ChannelParameters_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the ChannelParameters + */ + public ChannelParameters clone() { + long ret = bindings.ChannelParameters_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelParameters(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 ChannelParameters. + */ + public long hash() { + long ret = bindings.ChannelParameters_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + public override int GetHashCode() { + return (int)this.hash(); + } + /** + * Checks if two ChannelParameterss 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.ChannelParameters b) { + bool ret = bindings.ChannelParameters_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 ChannelParameters)) return false; + return this.eq((ChannelParameters)o); + } +} +} } } diff --git a/c_sharp/src/org/ldk/structs/ChannelPublicKeys.cs b/c_sharp/src/org/ldk/structs/ChannelPublicKeys.cs index c5ca229e..6d31ef7d 100644 --- a/c_sharp/src/org/ldk/structs/ChannelPublicKeys.cs +++ b/c_sharp/src/org/ldk/structs/ChannelPublicKeys.cs @@ -38,7 +38,7 @@ public class ChannelPublicKeys : CommonBase { } /** - * The base point which is used (with derive_public_revocation_key) to derive per-commitment + * The base point which is used (with [`RevocationKey::from_basepoint`]) to derive per-commitment * revocation keys. This is combined with the per-commitment-secret generated by the * counterparty to create a secret which the counterparty can reveal to revoke previous * states. @@ -53,7 +53,7 @@ public class ChannelPublicKeys : CommonBase { } /** - * The base point which is used (with derive_public_revocation_key) to derive per-commitment + * The base point which is used (with [`RevocationKey::from_basepoint`]) to derive per-commitment * revocation keys. This is combined with the per-commitment-secret generated by the * counterparty to create a secret which the counterparty can reveal to revoke previous * states. @@ -62,7 +62,6 @@ public class ChannelPublicKeys : CommonBase { bindings.ChannelPublicKeys_set_revocation_basepoint(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -112,7 +111,6 @@ public class ChannelPublicKeys : CommonBase { bindings.ChannelPublicKeys_set_delayed_payment_basepoint(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -136,7 +134,6 @@ public class ChannelPublicKeys : CommonBase { bindings.ChannelPublicKeys_set_htlc_basepoint(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -152,9 +149,6 @@ public class ChannelPublicKeys : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelPublicKeys(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(revocation_basepoint_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(delayed_payment_basepoint_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(htlc_basepoint_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/ChannelReady.cs b/c_sharp/src/org/ldk/structs/ChannelReady.cs index 58f84613..0152e2cd 100644 --- a/c_sharp/src/org/ldk/structs/ChannelReady.cs +++ b/c_sharp/src/org/ldk/structs/ChannelReady.cs @@ -36,7 +36,6 @@ public class ChannelReady : CommonBase { bindings.ChannelReady_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -84,7 +83,6 @@ public class ChannelReady : CommonBase { bindings.ChannelReady_set_short_channel_id_alias(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -98,8 +96,6 @@ public class ChannelReady : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/ChannelReestablish.cs b/c_sharp/src/org/ldk/structs/ChannelReestablish.cs index eafbfed2..3942aba2 100644 --- a/c_sharp/src/org/ldk/structs/ChannelReestablish.cs +++ b/c_sharp/src/org/ldk/structs/ChannelReestablish.cs @@ -36,7 +36,6 @@ public class ChannelReestablish : CommonBase { bindings.ChannelReestablish_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -136,7 +135,6 @@ public class ChannelReestablish : CommonBase { bindings.ChannelReestablish_set_next_funding_txid(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -153,8 +151,6 @@ 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; } diff --git a/c_sharp/src/org/ldk/structs/ChannelSigner.cs b/c_sharp/src/org/ldk/structs/ChannelSigner.cs index 1be5e84b..dbeb6503 100644 --- a/c_sharp/src/org/ldk/structs/ChannelSigner.cs +++ b/c_sharp/src/org/ldk/structs/ChannelSigner.cs @@ -13,8 +13,12 @@ public interface ChannelSignerInterface { /**Gets the per-commitment point for a specific commitment number * * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards. + * + * If the signer returns `Err`, then the user is responsible for either force-closing the channel + * or calling `ChannelManager::signer_unblocked` (this method is only available when the + * `async_signing` cfg flag is enabled) once the signature is ready. */ - byte[] get_per_commitment_point(long idx); + Result_PublicKeyNoneZ get_per_commitment_point(long idx); /**Gets the commitment secret for a specific commitment number as part of the revocation process * * An external signer implementation should error here if the commitment was already signed @@ -24,7 +28,7 @@ public interface ChannelSignerInterface { * * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards. */ - byte[] release_commitment_secret(long idx); + Result__u832NoneZ release_commitment_secret(long idx); /**Validate the counterparty's signatures on the holder commitment transaction and HTLCs. * * This is required in order for the signer to make sure that releasing a commitment @@ -67,6 +71,10 @@ public interface ChannelSignerInterface { /** * A trait to handle Lightning channel key material without concretizing the channel type or * the signature mechanism. + * + * Several methods allow error types to be returned to support async signing. This feature + * is not yet complete, and panics may occur in certain situations when returning errors + * for these methods. */ public class ChannelSigner : CommonBase { internal bindings.LDKChannelSigner bindings_instance; @@ -83,15 +91,15 @@ public class ChannelSigner : CommonBase { private ChannelSignerInterface arg; private LDKChannelSignerHolder impl_holder; public long get_per_commitment_point(long _idx) { - byte[] ret = arg.get_per_commitment_point(_idx); + Result_PublicKeyNoneZ ret = arg.get_per_commitment_point(_idx); GC.KeepAlive(arg); - long result = InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(ret, 33)); + long result = ret.clone_ptr(); return result; } public long release_commitment_secret(long _idx) { - byte[] ret = arg.release_commitment_secret(_idx); + Result__u832NoneZ ret = arg.release_commitment_secret(_idx); GC.KeepAlive(arg); - long result = InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(ret, 32)); + long result = ret.clone_ptr(); return result; } public long validate_holder_commitment(long _holder_tx, long _outbound_htlc_preimages) { @@ -145,14 +153,18 @@ public class ChannelSigner : CommonBase { * Gets the per-commitment point for a specific commitment number * * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards. + * + * If the signer returns `Err`, then the user is responsible for either force-closing the channel + * or calling `ChannelManager::signer_unblocked` (this method is only available when the + * `async_signing` cfg flag is enabled) once the signature is ready. */ - public byte[] get_per_commitment_point(long idx) { + public Result_PublicKeyNoneZ get_per_commitment_point(long idx) { long ret = bindings.ChannelSigner_get_per_commitment_point(this.ptr, idx); GC.KeepAlive(this); GC.KeepAlive(idx); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + Result_PublicKeyNoneZ ret_hu_conv = Result_PublicKeyNoneZ.constr_from_ptr(ret); + return ret_hu_conv; } /** @@ -165,13 +177,13 @@ public class ChannelSigner : CommonBase { * * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards. */ - public byte[] release_commitment_secret(long idx) { + public Result__u832NoneZ release_commitment_secret(long idx) { long ret = bindings.ChannelSigner_release_commitment_secret(this.ptr, idx); GC.KeepAlive(this); GC.KeepAlive(idx); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + Result__u832NoneZ ret_hu_conv = Result__u832NoneZ.constr_from_ptr(ret); + return ret_hu_conv; } /** diff --git a/c_sharp/src/org/ldk/structs/ChannelTransactionParameters.cs b/c_sharp/src/org/ldk/structs/ChannelTransactionParameters.cs index a411cec1..8c61a149 100644 --- a/c_sharp/src/org/ldk/structs/ChannelTransactionParameters.cs +++ b/c_sharp/src/org/ldk/structs/ChannelTransactionParameters.cs @@ -38,7 +38,6 @@ public class ChannelTransactionParameters : CommonBase { bindings.ChannelTransactionParameters_set_holder_pubkeys(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -104,7 +103,6 @@ public class ChannelTransactionParameters : CommonBase { bindings.ChannelTransactionParameters_set_counterparty_parameters(this.ptr, val == null ? 0 : val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -130,7 +128,6 @@ public class ChannelTransactionParameters : CommonBase { bindings.ChannelTransactionParameters_set_funding_outpoint(this.ptr, val == null ? 0 : val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -154,7 +151,6 @@ public class ChannelTransactionParameters : CommonBase { bindings.ChannelTransactionParameters_set_channel_type_features(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -174,10 +170,6 @@ public class ChannelTransactionParameters : CommonBase { 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(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(holder_pubkeys_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(counterparty_parameters_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(funding_outpoint_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_type_features_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/ChannelTypeFeatures.cs b/c_sharp/src/org/ldk/structs/ChannelTypeFeatures.cs index 908c3f16..d2ac6dd3 100644 --- a/c_sharp/src/org/ldk/structs/ChannelTypeFeatures.cs +++ b/c_sharp/src/org/ldk/structs/ChannelTypeFeatures.cs @@ -24,6 +24,28 @@ public class ChannelTypeFeatures : CommonBase { if (ptr != 0) { bindings.ChannelTypeFeatures_free(ptr); } } + /** + * Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read + */ + public byte[] write() { + long ret = bindings.ChannelTypeFeatures_write(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write + */ + public static Result_ChannelTypeFeaturesDecodeErrorZ read(byte[] ser) { + long ret = bindings.ChannelTypeFeatures_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ChannelTypeFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelTypeFeaturesDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + /** * Checks if two ChannelTypeFeaturess contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. @@ -71,6 +93,28 @@ public class ChannelTypeFeatures : CommonBase { public override int GetHashCode() { return (int)this.hash(); } + /** + * Constructs a ChannelTypeFeatures with only static_remotekey set + */ + public static ChannelTypeFeatures only_static_remote_key() { + long ret = bindings.ChannelTypeFeatures_only_static_remote_key(); + 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(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Constructs a ChannelTypeFeatures with anchors support + */ + public static ChannelTypeFeatures anchors_zero_htlc_fee_and_dependencies() { + long ret = bindings.ChannelTypeFeatures_anchors_zero_htlc_fee_and_dependencies(); + 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(ret_hu_conv); }; + return ret_hu_conv; + } + /** * Create a blank Features with no features set */ @@ -82,6 +126,27 @@ public class ChannelTypeFeatures : CommonBase { return ret_hu_conv; } + /** + * Returns the feature set as a list of bytes, in little-endian. This is in reverse byte order + * from most on-the-wire encodings. + */ + public byte[] le_flags() { + long ret = bindings.ChannelTypeFeatures_le_flags(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Returns true if this `Features` has any optional flags set + */ + public bool supports_any_optional_bits() { + bool ret = bindings.ChannelTypeFeatures_supports_any_optional_bits(this.ptr); + GC.KeepAlive(this); + return ret; + } + /** * Returns true if this `Features` object contains required features unknown by `other`. */ @@ -93,6 +158,19 @@ public class ChannelTypeFeatures : CommonBase { return ret; } + /** + * Returns the set of required features unknown by `other`, as their bit position. + */ + public long[] required_unknown_bits_from(org.ldk.structs.ChannelTypeFeatures other) { + long ret = bindings.ChannelTypeFeatures_required_unknown_bits_from(this.ptr, other.ptr); + GC.KeepAlive(this); + GC.KeepAlive(other); + if (ret >= 0 && ret <= 4096) { return null; } + long[] ret_conv = InternalUtils.decodeUint64Array(ret); + if (this != null) { this.ptrs_to.AddLast(other); }; + return ret_conv; + } + /** * Returns true if this `Features` object contains unknown feature flags which are set as * \"required\". @@ -103,6 +181,15 @@ public class ChannelTypeFeatures : CommonBase { return ret; } + /** + * Returns true if this `Features` supports any bits which we do not know of + */ + public bool supports_unknown_bits() { + bool ret = bindings.ChannelTypeFeatures_supports_unknown_bits(this.ptr); + GC.KeepAlive(this); + return ret; + } + /** * Sets a required feature bit. Errors if `bit` is outside the feature range as defined * by [BOLT 9]. @@ -176,25 +263,19 @@ public class ChannelTypeFeatures : CommonBase { } /** - * Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read + * Unsets the `scid_privacy` feature */ - public byte[] write() { - long ret = bindings.ChannelTypeFeatures_write(this.ptr); + public void clear_scid_privacy() { + bindings.ChannelTypeFeatures_clear_scid_privacy(this.ptr); GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; } /** - * Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write + * Unsets the `anchors_zero_fee_htlc_tx` feature */ - public static Result_ChannelTypeFeaturesDecodeErrorZ read(byte[] ser) { - long ret = bindings.ChannelTypeFeatures_read(InternalUtils.encodeUint8Array(ser)); - GC.KeepAlive(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_ChannelTypeFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelTypeFeaturesDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; + public void clear_anchors_zero_fee_htlc_tx() { + bindings.ChannelTypeFeatures_clear_anchors_zero_fee_htlc_tx(this.ptr); + GC.KeepAlive(this); } /** diff --git a/c_sharp/src/org/ldk/structs/ChannelUpdate.cs b/c_sharp/src/org/ldk/structs/ChannelUpdate.cs index 4a47de09..7e46741d 100644 --- a/c_sharp/src/org/ldk/structs/ChannelUpdate.cs +++ b/c_sharp/src/org/ldk/structs/ChannelUpdate.cs @@ -56,7 +56,6 @@ public class ChannelUpdate : CommonBase { bindings.ChannelUpdate_set_contents(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -69,7 +68,6 @@ public class ChannelUpdate : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUpdate(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(contents_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/ChannelUpdateInfo.cs b/c_sharp/src/org/ldk/structs/ChannelUpdateInfo.cs index cbf72512..e1ba1e06 100644 --- a/c_sharp/src/org/ldk/structs/ChannelUpdateInfo.cs +++ b/c_sharp/src/org/ldk/structs/ChannelUpdateInfo.cs @@ -16,117 +16,116 @@ public class ChannelUpdateInfo : CommonBase { } /** - * When the last update to the channel direction was issued. - * Value is opaque, as set in the announcement. + * The minimum value, which must be relayed to the next hop via the channel */ - public int get_last_update() { - int ret = bindings.ChannelUpdateInfo_get_last_update(this.ptr); + public long get_htlc_minimum_msat() { + long ret = bindings.ChannelUpdateInfo_get_htlc_minimum_msat(this.ptr); GC.KeepAlive(this); return ret; } /** - * When the last update to the channel direction was issued. - * Value is opaque, as set in the announcement. + * The minimum value, which must be relayed to the next hop via the channel */ - public void set_last_update(int val) { - bindings.ChannelUpdateInfo_set_last_update(this.ptr, val); + public void set_htlc_minimum_msat(long val) { + bindings.ChannelUpdateInfo_set_htlc_minimum_msat(this.ptr, val); GC.KeepAlive(this); GC.KeepAlive(val); } /** - * Whether the channel can be currently used for payments (in this one direction). + * The maximum value which may be relayed to the next hop via the channel. */ - public bool get_enabled() { - bool ret = bindings.ChannelUpdateInfo_get_enabled(this.ptr); + public long get_htlc_maximum_msat() { + long ret = bindings.ChannelUpdateInfo_get_htlc_maximum_msat(this.ptr); GC.KeepAlive(this); return ret; } /** - * Whether the channel can be currently used for payments (in this one direction). + * The maximum value which may be relayed to the next hop via the channel. */ - public void set_enabled(bool val) { - bindings.ChannelUpdateInfo_set_enabled(this.ptr, val); + public void set_htlc_maximum_msat(long val) { + bindings.ChannelUpdateInfo_set_htlc_maximum_msat(this.ptr, val); GC.KeepAlive(this); GC.KeepAlive(val); } /** - * The difference in CLTV values that you must have when routing through this channel. + * Fees charged when the channel is used for routing */ - public short get_cltv_expiry_delta() { - short ret = bindings.ChannelUpdateInfo_get_cltv_expiry_delta(this.ptr); + public RoutingFees get_fees() { + long ret = bindings.ChannelUpdateInfo_get_fees(this.ptr); GC.KeepAlive(this); - return ret; + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.RoutingFees ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RoutingFees(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** - * The difference in CLTV values that you must have when routing through this channel. + * Fees charged when the channel is used for routing */ - public void set_cltv_expiry_delta(short val) { - bindings.ChannelUpdateInfo_set_cltv_expiry_delta(this.ptr, val); + public void set_fees(org.ldk.structs.RoutingFees val) { + bindings.ChannelUpdateInfo_set_fees(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); } /** - * The minimum value, which must be relayed to the next hop via the channel + * When the last update to the channel direction was issued. + * Value is opaque, as set in the announcement. */ - public long get_htlc_minimum_msat() { - long ret = bindings.ChannelUpdateInfo_get_htlc_minimum_msat(this.ptr); + public int get_last_update() { + int ret = bindings.ChannelUpdateInfo_get_last_update(this.ptr); GC.KeepAlive(this); return ret; } /** - * The minimum value, which must be relayed to the next hop via the channel + * When the last update to the channel direction was issued. + * Value is opaque, as set in the announcement. */ - public void set_htlc_minimum_msat(long val) { - bindings.ChannelUpdateInfo_set_htlc_minimum_msat(this.ptr, val); + public void set_last_update(int val) { + bindings.ChannelUpdateInfo_set_last_update(this.ptr, val); GC.KeepAlive(this); GC.KeepAlive(val); } /** - * The maximum value which may be relayed to the next hop via the channel. + * The difference in CLTV values that you must have when routing through this channel. */ - public long get_htlc_maximum_msat() { - long ret = bindings.ChannelUpdateInfo_get_htlc_maximum_msat(this.ptr); + public short get_cltv_expiry_delta() { + short ret = bindings.ChannelUpdateInfo_get_cltv_expiry_delta(this.ptr); GC.KeepAlive(this); return ret; } /** - * The maximum value which may be relayed to the next hop via the channel. + * The difference in CLTV values that you must have when routing through this channel. */ - public void set_htlc_maximum_msat(long val) { - bindings.ChannelUpdateInfo_set_htlc_maximum_msat(this.ptr, val); + public void set_cltv_expiry_delta(short val) { + bindings.ChannelUpdateInfo_set_cltv_expiry_delta(this.ptr, val); GC.KeepAlive(this); GC.KeepAlive(val); } /** - * Fees charged when the channel is used for routing + * Whether the channel can be currently used for payments (in this one direction). */ - public RoutingFees get_fees() { - long ret = bindings.ChannelUpdateInfo_get_fees(this.ptr); + public bool get_enabled() { + bool ret = bindings.ChannelUpdateInfo_get_enabled(this.ptr); GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.RoutingFees ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RoutingFees(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; + return ret; } /** - * Fees charged when the channel is used for routing + * Whether the channel can be currently used for payments (in this one direction). */ - public void set_fees(org.ldk.structs.RoutingFees val) { - bindings.ChannelUpdateInfo_set_fees(this.ptr, val.ptr); + public void set_enabled(bool val) { + bindings.ChannelUpdateInfo_set_enabled(this.ptr, val); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -158,7 +157,6 @@ public class ChannelUpdateInfo : CommonBase { bindings.ChannelUpdateInfo_set_last_update_message(this.ptr, val == null ? 0 : val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -166,20 +164,18 @@ 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.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); + public static ChannelUpdateInfo of(long htlc_minimum_msat_arg, long htlc_maximum_msat_arg, org.ldk.structs.RoutingFees fees_arg, int last_update_arg, short cltv_expiry_delta_arg, bool enabled_arg, org.ldk.structs.ChannelUpdate last_update_message_arg) { + long ret = bindings.ChannelUpdateInfo_new(htlc_minimum_msat_arg, htlc_maximum_msat_arg, fees_arg.ptr, last_update_arg, cltv_expiry_delta_arg, enabled_arg, last_update_message_arg == null ? 0 : last_update_message_arg.ptr); GC.KeepAlive(htlc_minimum_msat_arg); GC.KeepAlive(htlc_maximum_msat_arg); GC.KeepAlive(fees_arg); + GC.KeepAlive(last_update_arg); + GC.KeepAlive(cltv_expiry_delta_arg); + GC.KeepAlive(enabled_arg); GC.KeepAlive(last_update_message_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelUpdateInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUpdateInfo(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(fees_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(last_update_message_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/ChannelUsage.cs b/c_sharp/src/org/ldk/structs/ChannelUsage.cs index 8d20c5de..5370e8d4 100644 --- a/c_sharp/src/org/ldk/structs/ChannelUsage.cs +++ b/c_sharp/src/org/ldk/structs/ChannelUsage.cs @@ -72,7 +72,6 @@ public class ChannelUsage : CommonBase { bindings.ChannelUsage_set_effective_capacity(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -86,7 +85,6 @@ public class ChannelUsage : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelUsage ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUsage(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(effective_capacity_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/ClaimedHTLC.cs b/c_sharp/src/org/ldk/structs/ClaimedHTLC.cs index 890d3e47..f836a275 100644 --- a/c_sharp/src/org/ldk/structs/ClaimedHTLC.cs +++ b/c_sharp/src/org/ldk/structs/ClaimedHTLC.cs @@ -34,7 +34,6 @@ public class ClaimedHTLC : CommonBase { bindings.ClaimedHTLC_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -154,7 +153,6 @@ 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; } diff --git a/c_sharp/src/org/ldk/structs/ClosingSigned.cs b/c_sharp/src/org/ldk/structs/ClosingSigned.cs index 9f47f3db..8f678f4c 100644 --- a/c_sharp/src/org/ldk/structs/ClosingSigned.cs +++ b/c_sharp/src/org/ldk/structs/ClosingSigned.cs @@ -36,7 +36,6 @@ public class ClosingSigned : CommonBase { bindings.ClosingSigned_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -102,7 +101,6 @@ public class ClosingSigned : CommonBase { bindings.ClosingSigned_set_fee_range(this.ptr, val == null ? 0 : val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -119,8 +117,6 @@ 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; } diff --git a/c_sharp/src/org/ldk/structs/ClosingTransaction.cs b/c_sharp/src/org/ldk/structs/ClosingTransaction.cs index c30ec343..bc295416 100644 --- a/c_sharp/src/org/ldk/structs/ClosingTransaction.cs +++ b/c_sharp/src/org/ldk/structs/ClosingTransaction.cs @@ -79,7 +79,6 @@ public class ClosingTransaction : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ClosingTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ClosingTransaction(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(funding_outpoint); }; return ret_hu_conv; } @@ -114,7 +113,6 @@ public class ClosingTransaction : CommonBase { GC.KeepAlive(funding_outpoint); if (ret >= 0 && ret <= 4096) { return null; } Result_TrustedClosingTransactionNoneZ ret_hu_conv = Result_TrustedClosingTransactionNoneZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(funding_outpoint); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/ClosureReason.cs b/c_sharp/src/org/ldk/structs/ClosureReason.cs index e5d17977..8a8f598e 100644 --- a/c_sharp/src/org/ldk/structs/ClosureReason.cs +++ b/c_sharp/src/org/ldk/structs/ClosureReason.cs @@ -30,6 +30,7 @@ public class ClosureReason : CommonBase { case 10: return new ClosureReason_CounterpartyCoopClosedUnfundedChannel(ptr); case 11: return new ClosureReason_FundingBatchClosure(ptr); case 12: return new ClosureReason_HTLCsTimedOut(ptr); + case 13: return new ClosureReason_PeerFeerateTooLow(ptr); default: throw new ArgumentException("Impossible enum variant"); } @@ -56,7 +57,26 @@ public class ClosureReason : CommonBase { } /** A ClosureReason of type HolderForceClosed */ public class ClosureReason_HolderForceClosed : ClosureReason { + /** + * Whether or not the latest transaction was broadcasted when the channel was force + * closed. + * + * Channels closed using [`ChannelManager::force_close_broadcasting_latest_txn`] will have + * this field set to true, whereas channels closed using [`ChannelManager::force_close_without_broadcasting_txn`] + * or force-closed prior to being funded will have this field set to false. + * + * This will be `None` for objects generated or written by LDK 0.0.123 and + * earlier. + * + * [`ChannelManager::force_close_broadcasting_latest_txn`]: crate::ln::channelmanager::ChannelManager::force_close_broadcasting_latest_txn. + * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn. + */ + public Option_boolZ broadcasted_latest_txn; internal ClosureReason_HolderForceClosed(long ptr) : base(null, ptr) { + long broadcasted_latest_txn = bindings.LDKClosureReason_HolderForceClosed_get_broadcasted_latest_txn(ptr); + org.ldk.structs.Option_boolZ broadcasted_latest_txn_hu_conv = org.ldk.structs.Option_boolZ.constr_from_ptr(broadcasted_latest_txn); + if (broadcasted_latest_txn_hu_conv != null) { broadcasted_latest_txn_hu_conv.ptrs_to.AddLast(this); }; + this.broadcasted_latest_txn = broadcasted_latest_txn_hu_conv; } } /** A ClosureReason of type LegacyCooperativeClosure */ @@ -121,6 +141,23 @@ public class ClosureReason : CommonBase { internal ClosureReason_HTLCsTimedOut(long ptr) : base(null, ptr) { } } + /** A ClosureReason of type PeerFeerateTooLow */ + public class ClosureReason_PeerFeerateTooLow : ClosureReason { + /** + * The feerate on our channel set by our peer. + */ + public int peer_feerate_sat_per_kw; + /** + * The required feerate we enforce, from our [`FeeEstimator`]. + * + * [`FeeEstimator`]: crate::chain::chaininterface::FeeEstimator + */ + public int required_feerate_sat_per_kw; + internal ClosureReason_PeerFeerateTooLow(long ptr) : base(null, ptr) { + this.peer_feerate_sat_per_kw = bindings.LDKClosureReason_PeerFeerateTooLow_get_peer_feerate_sat_per_kw(ptr); + this.required_feerate_sat_per_kw = bindings.LDKClosureReason_PeerFeerateTooLow_get_required_feerate_sat_per_kw(ptr); + } + } internal long clone_ptr() { long ret = bindings.ClosureReason_clone_ptr(this.ptr); GC.KeepAlive(this); @@ -148,15 +185,15 @@ public class ClosureReason : CommonBase { 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); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(peer_msg); }; return ret_hu_conv; } /** * Utility method to constructs a new HolderForceClosed-variant ClosureReason */ - public static ClosureReason holder_force_closed() { - long ret = bindings.ClosureReason_holder_force_closed(); + public static ClosureReason holder_force_closed(org.ldk.structs.Option_boolZ broadcasted_latest_txn) { + long ret = bindings.ClosureReason_holder_force_closed(broadcasted_latest_txn.ptr); + GC.KeepAlive(broadcasted_latest_txn); 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); }; @@ -285,6 +322,19 @@ public class ClosureReason : CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new PeerFeerateTooLow-variant ClosureReason + */ + public static ClosureReason peer_feerate_too_low(int peer_feerate_sat_per_kw, int required_feerate_sat_per_kw) { + long ret = bindings.ClosureReason_peer_feerate_too_low(peer_feerate_sat_per_kw, required_feerate_sat_per_kw); + GC.KeepAlive(peer_feerate_sat_per_kw); + GC.KeepAlive(required_feerate_sat_per_kw); + 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. diff --git a/c_sharp/src/org/ldk/structs/CoinSelection.cs b/c_sharp/src/org/ldk/structs/CoinSelection.cs index d136e2e6..3df0eeb6 100644 --- a/c_sharp/src/org/ldk/structs/CoinSelection.cs +++ b/c_sharp/src/org/ldk/structs/CoinSelection.cs @@ -44,7 +44,6 @@ public class CoinSelection : CommonBase { 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); }; }; } /** @@ -72,7 +71,6 @@ public class CoinSelection : CommonBase { bindings.CoinSelection_set_change_output(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -85,8 +83,6 @@ public class CoinSelection : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.CoinSelection ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CoinSelection(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - foreach (Utxo confirmed_utxos_arg_conv_6 in confirmed_utxos_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(confirmed_utxos_arg_conv_6); }; }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(change_output_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/CoinSelectionSource.cs b/c_sharp/src/org/ldk/structs/CoinSelectionSource.cs index 4ac1715b..55e149a4 100644 --- a/c_sharp/src/org/ldk/structs/CoinSelectionSource.cs +++ b/c_sharp/src/org/ldk/structs/CoinSelectionSource.cs @@ -149,7 +149,6 @@ public class CoinSelectionSource : CommonBase { GC.KeepAlive(target_feerate_sat_per_1000_weight); if (ret >= 0 && ret <= 4096) { return null; } Result_CoinSelectionNoneZ ret_hu_conv = Result_CoinSelectionNoneZ.constr_from_ptr(ret); - foreach (Input must_spend_conv_7 in must_spend) { if (this != null) { this.ptrs_to.AddLast(must_spend_conv_7); }; }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/CommitmentSigned.cs b/c_sharp/src/org/ldk/structs/CommitmentSigned.cs index 34124aad..f38bfff2 100644 --- a/c_sharp/src/org/ldk/structs/CommitmentSigned.cs +++ b/c_sharp/src/org/ldk/structs/CommitmentSigned.cs @@ -36,7 +36,6 @@ public class CommitmentSigned : CommonBase { bindings.CommitmentSigned_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -88,18 +87,45 @@ public class CommitmentSigned : CommonBase { GC.KeepAlive(val); } + /** + * Optional batch size and other parameters + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public CommitmentSignedBatch get_batch() { + long ret = bindings.CommitmentSigned_get_batch(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.CommitmentSignedBatch ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CommitmentSignedBatch(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Optional batch size and other parameters + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public void set_batch(org.ldk.structs.CommitmentSignedBatch val) { + bindings.CommitmentSigned_set_batch(this.ptr, val == null ? 0 : val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + /** * Constructs a new CommitmentSigned given each field + * + * Note that batch_arg (or a relevant inner pointer) may be NULL or all-0s to represent None */ - 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))))); + public static CommitmentSigned of(org.ldk.structs.ChannelId channel_id_arg, byte[] signature_arg, byte[][] htlc_signatures_arg, org.ldk.structs.CommitmentSignedBatch batch_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)))), batch_arg == null ? 0 : batch_arg.ptr); GC.KeepAlive(channel_id_arg); GC.KeepAlive(signature_arg); GC.KeepAlive(htlc_signatures_arg); + GC.KeepAlive(batch_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; } diff --git a/c_sharp/src/org/ldk/structs/CommitmentSignedBatch.cs b/c_sharp/src/org/ldk/structs/CommitmentSignedBatch.cs new file mode 100644 index 00000000..58119599 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/CommitmentSignedBatch.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 { + + +/** + * Optional batch parameters for `commitment_signed` message. + */ +public class CommitmentSignedBatch : CommonBase { + internal CommitmentSignedBatch(object _dummy, long ptr) : base(ptr) { } + ~CommitmentSignedBatch() { + if (ptr != 0) { bindings.CommitmentSignedBatch_free(ptr); } + } + + /** + * Batch size N: all N `commitment_signed` messages must be received before being processed + */ + public short get_batch_size() { + short ret = bindings.CommitmentSignedBatch_get_batch_size(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Batch size N: all N `commitment_signed` messages must be received before being processed + */ + public void set_batch_size(short val) { + bindings.CommitmentSignedBatch_set_batch_size(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The funding transaction, to discriminate among multiple pending funding transactions (e.g. in case of splicing) + */ + public byte[] get_funding_txid() { + long ret = bindings.CommitmentSignedBatch_get_funding_txid(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * The funding transaction, to discriminate among multiple pending funding transactions (e.g. in case of splicing) + */ + public void set_funding_txid(byte[] val) { + bindings.CommitmentSignedBatch_set_funding_txid(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Constructs a new CommitmentSignedBatch given each field + */ + public static CommitmentSignedBatch of(short batch_size_arg, byte[] funding_txid_arg) { + long ret = bindings.CommitmentSignedBatch_new(batch_size_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(funding_txid_arg, 32))); + GC.KeepAlive(batch_size_arg); + GC.KeepAlive(funding_txid_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.CommitmentSignedBatch ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CommitmentSignedBatch(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.CommitmentSignedBatch_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the CommitmentSignedBatch + */ + public CommitmentSignedBatch clone() { + long ret = bindings.CommitmentSignedBatch_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.CommitmentSignedBatch ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CommitmentSignedBatch(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 CommitmentSignedBatch. + */ + public long hash() { + long ret = bindings.CommitmentSignedBatch_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + public override int GetHashCode() { + return (int)this.hash(); + } + /** + * Checks if two CommitmentSignedBatchs 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.CommitmentSignedBatch b) { + bool ret = bindings.CommitmentSignedBatch_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 CommitmentSignedBatch)) return false; + return this.eq((CommitmentSignedBatch)o); + } + /** + * Serialize the CommitmentSignedBatch object into a byte array which can be read by CommitmentSignedBatch_read + */ + public byte[] write() { + long ret = bindings.CommitmentSignedBatch_write(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Read a CommitmentSignedBatch from a byte array, created by CommitmentSignedBatch_write + */ + public static Result_CommitmentSignedBatchDecodeErrorZ read(byte[] ser) { + long ret = bindings.CommitmentSignedBatch_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_CommitmentSignedBatchDecodeErrorZ ret_hu_conv = Result_CommitmentSignedBatchDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/CommitmentUpdate.cs b/c_sharp/src/org/ldk/structs/CommitmentUpdate.cs index 4eed1ff6..577e58dd 100644 --- a/c_sharp/src/org/ldk/structs/CommitmentUpdate.cs +++ b/c_sharp/src/org/ldk/structs/CommitmentUpdate.cs @@ -42,7 +42,6 @@ public class CommitmentUpdate : CommonBase { 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); }; }; } /** @@ -71,7 +70,6 @@ public class CommitmentUpdate : CommonBase { 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); }; }; } /** @@ -100,7 +98,6 @@ public class CommitmentUpdate : CommonBase { 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); }; }; } /** @@ -129,7 +126,6 @@ public class CommitmentUpdate : CommonBase { 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); }; }; } /** @@ -155,7 +151,6 @@ public class CommitmentUpdate : CommonBase { bindings.CommitmentUpdate_set_update_fee(this.ptr, val == null ? 0 : val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -177,7 +172,6 @@ public class CommitmentUpdate : CommonBase { bindings.CommitmentUpdate_set_commitment_signed(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -196,12 +190,6 @@ public class CommitmentUpdate : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.CommitmentUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CommitmentUpdate(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - foreach (UpdateAddHTLC update_add_htlcs_arg_conv_15 in update_add_htlcs_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(update_add_htlcs_arg_conv_15); }; }; - foreach (UpdateFulfillHTLC update_fulfill_htlcs_arg_conv_19 in update_fulfill_htlcs_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(update_fulfill_htlcs_arg_conv_19); }; }; - foreach (UpdateFailHTLC update_fail_htlcs_arg_conv_16 in update_fail_htlcs_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(update_fail_htlcs_arg_conv_16); }; }; - foreach (UpdateFailMalformedHTLC update_fail_malformed_htlcs_arg_conv_25 in update_fail_malformed_htlcs_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(update_fail_malformed_htlcs_arg_conv_25); }; }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(update_fee_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(commitment_signed_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/CommonAcceptChannelFields.cs b/c_sharp/src/org/ldk/structs/CommonAcceptChannelFields.cs index 5c0a34d9..b4ab0483 100644 --- a/c_sharp/src/org/ldk/structs/CommonAcceptChannelFields.cs +++ b/c_sharp/src/org/ldk/structs/CommonAcceptChannelFields.cs @@ -36,7 +36,6 @@ public class CommonAcceptChannelFields : CommonBase { bindings.CommonAcceptChannelFields_set_temporary_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -294,7 +293,6 @@ public class CommonAcceptChannelFields : CommonBase { bindings.CommonAcceptChannelFields_set_shutdown_scriptpubkey(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -330,7 +328,6 @@ public class CommonAcceptChannelFields : CommonBase { 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); }; } /** @@ -358,9 +355,6 @@ public class CommonAcceptChannelFields : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/CommonOpenChannelFields.cs b/c_sharp/src/org/ldk/structs/CommonOpenChannelFields.cs index 11626a7d..14950821 100644 --- a/c_sharp/src/org/ldk/structs/CommonOpenChannelFields.cs +++ b/c_sharp/src/org/ldk/structs/CommonOpenChannelFields.cs @@ -60,7 +60,6 @@ public class CommonOpenChannelFields : CommonBase { bindings.CommonOpenChannelFields_set_temporary_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -358,7 +357,6 @@ public class CommonOpenChannelFields : CommonBase { bindings.CommonOpenChannelFields_set_shutdown_scriptpubkey(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -390,7 +388,6 @@ public class CommonOpenChannelFields : CommonBase { 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); }; } /** @@ -421,9 +418,6 @@ public class CommonOpenChannelFields : CommonBase { 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; } @@ -474,5 +468,17 @@ public class CommonOpenChannelFields : CommonBase { if (!(o is CommonOpenChannelFields)) return false; return this.eq((CommonOpenChannelFields)o); } + /** + * The [`ChannelParameters`] for this channel. + */ + public ChannelParameters channel_parameters() { + long ret = bindings.CommonOpenChannelFields_channel_parameters(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelParameters(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/CounterpartyChannelTransactionParameters.cs b/c_sharp/src/org/ldk/structs/CounterpartyChannelTransactionParameters.cs index bd949cce..47a3207e 100644 --- a/c_sharp/src/org/ldk/structs/CounterpartyChannelTransactionParameters.cs +++ b/c_sharp/src/org/ldk/structs/CounterpartyChannelTransactionParameters.cs @@ -34,7 +34,6 @@ public class CounterpartyChannelTransactionParameters : CommonBase { bindings.CounterpartyChannelTransactionParameters_set_pubkeys(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -65,7 +64,6 @@ public class CounterpartyChannelTransactionParameters : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.CounterpartyChannelTransactionParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CounterpartyChannelTransactionParameters(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(pubkeys_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/CustomMessageHandler.cs b/c_sharp/src/org/ldk/structs/CustomMessageHandler.cs index 9184b690..915b42b3 100644 --- a/c_sharp/src/org/ldk/structs/CustomMessageHandler.cs +++ b/c_sharp/src/org/ldk/structs/CustomMessageHandler.cs @@ -20,6 +20,16 @@ public interface CustomMessageHandlerInterface { * connection to the node exists, then the message is simply not sent. */ TwoTuple_PublicKeyTypeZ[] get_and_clear_pending_msg(); + /**Indicates a peer disconnected. + */ + void peer_disconnected(byte[] their_node_id); + /**Handle a peer connecting. + * + * May return an `Err(())` if the features the peer supports are not sufficient to communicate + * with us. Implementors should be somewhat conservative about doing so, however, as other + * message handlers may still wish to communicate with this peer. + */ + Result_NoneNoneZ peer_connected(byte[] their_node_id, Init msg, bool inbound); /**Gets the node feature flags which this handler itself supports. All available handlers are * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`] * which are broadcasted in our [`NodeAnnouncement`] message. @@ -75,6 +85,19 @@ public class CustomMessageHandler : CommonBase { long result = InternalUtils.encodeUint64Array(InternalUtils.mapArray(ret, ret_conv_25 => ret_conv_25.clone_ptr())); return result; } + public void peer_disconnected(long _their_node_id) { + byte[] _their_node_id_conv = InternalUtils.decodeUint8Array(_their_node_id); + arg.peer_disconnected(_their_node_id_conv); + GC.KeepAlive(arg); + } + public long peer_connected(long _their_node_id, long _msg, bool _inbound) { + byte[] _their_node_id_conv = InternalUtils.decodeUint8Array(_their_node_id); + 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.clone_ptr(); + return result; + } public long provided_node_features() { NodeFeatures ret = arg.provided_node_features(); GC.KeepAlive(arg); @@ -141,6 +164,34 @@ public class CustomMessageHandler : CommonBase { return ret_conv_25_arr; } + /** + * Indicates a peer disconnected. + */ + public void peer_disconnected(byte[] their_node_id) { + bindings.CustomMessageHandler_peer_disconnected(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33))); + GC.KeepAlive(this); + GC.KeepAlive(their_node_id); + } + + /** + * Handle a peer connecting. + * + * May return an `Err(())` if the features the peer supports are not sufficient to communicate + * with us. Implementors should be somewhat conservative about doing so, however, as other + * 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.CustomMessageHandler_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); + GC.KeepAlive(inbound); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(msg); }; + return ret_hu_conv; + } + /** * Gets the node feature flags which this handler itself supports. All available handlers are * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`] diff --git a/c_sharp/src/org/ldk/structs/CustomOnionMessageHandler.cs b/c_sharp/src/org/ldk/structs/CustomOnionMessageHandler.cs index 95565d2b..40219171 100644 --- a/c_sharp/src/org/ldk/structs/CustomOnionMessageHandler.cs +++ b/c_sharp/src/org/ldk/structs/CustomOnionMessageHandler.cs @@ -13,8 +13,10 @@ public interface CustomOnionMessageHandlerInterface { /**Called with the custom message that was received, returning a response to send, if any. * * The returned [`Self::CustomMessage`], if any, is enqueued to be sent by [`OnionMessenger`]. + * + * Note that responder (or a relevant inner pointer) may be NULL or all-0s to represent None */ - Option_OnionMessageContentsZ handle_custom_message(OnionMessageContents msg); + Option_C2Tuple_OnionMessageContentsResponseInstructionZZ handle_custom_message(OnionMessageContents message, Option_CVec_u8ZZ context, Responder responder); /**Read a custom message of type `message_type` from `buffer`, returning `Ok(None)` if the * message type is unknown. */ @@ -24,7 +26,7 @@ public interface CustomOnionMessageHandlerInterface { * Typically, this is used for messages initiating a message flow rather than in response to * another message. The latter should use the return value of [`Self::handle_custom_message`]. */ - ThreeTuple_OnionMessageContentsDestinationBlindedPathZ[] release_pending_custom_messages(); + TwoTuple_OnionMessageContentsMessageSendInstructionsZ[] release_pending_custom_messages(); } /** @@ -53,13 +55,16 @@ public class CustomOnionMessageHandler : CommonBase { internal LDKCustomOnionMessageHandlerImpl(CustomOnionMessageHandlerInterface arg, LDKCustomOnionMessageHandlerHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; } private CustomOnionMessageHandlerInterface arg; private LDKCustomOnionMessageHandlerHolder impl_holder; - public long handle_custom_message(long _msg) { - OnionMessageContents ret_hu_conv = new OnionMessageContents(null, _msg); + public long handle_custom_message(long _message, long _context, long _responder) { + OnionMessageContents ret_hu_conv = new OnionMessageContents(null, _message); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - Option_OnionMessageContentsZ ret = arg.handle_custom_message(ret_hu_conv); + org.ldk.structs.Option_CVec_u8ZZ _context_hu_conv = org.ldk.structs.Option_CVec_u8ZZ.constr_from_ptr(_context); + if (_context_hu_conv != null) { _context_hu_conv.ptrs_to.AddLast(this); }; + org.ldk.structs.Responder _responder_hu_conv = null; if (_responder < 0 || _responder > 4096) { _responder_hu_conv = new org.ldk.structs.Responder(null, _responder); } + if (_responder_hu_conv != null) { _responder_hu_conv.ptrs_to.AddLast(this); }; + Option_C2Tuple_OnionMessageContentsResponseInstructionZZ ret = arg.handle_custom_message(ret_hu_conv, _context_hu_conv, _responder_hu_conv); GC.KeepAlive(arg); long result = ret.clone_ptr(); - if (impl_holder.held != null) { impl_holder.held.ptrs_to.AddLast(ret); }; return result; } public long read_custom_message(long _message_type, long _buffer) { @@ -70,9 +75,9 @@ public class CustomOnionMessageHandler : CommonBase { return result; } public long release_pending_custom_messages() { - ThreeTuple_OnionMessageContentsDestinationBlindedPathZ[] ret = arg.release_pending_custom_messages(); + TwoTuple_OnionMessageContentsMessageSendInstructionsZ[] ret = arg.release_pending_custom_messages(); GC.KeepAlive(arg); - long result = InternalUtils.encodeUint64Array(InternalUtils.mapArray(ret, ret_conv_56 => ret_conv_56.clone_ptr())); + long result = InternalUtils.encodeUint64Array(InternalUtils.mapArray(ret, ret_conv_55 => ret_conv_55.clone_ptr())); return result; } } @@ -93,15 +98,19 @@ public class CustomOnionMessageHandler : CommonBase { * Called with the custom message that was received, returning a response to send, if any. * * The returned [`Self::CustomMessage`], if any, is enqueued to be sent by [`OnionMessenger`]. + * + * Note that responder (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public Option_OnionMessageContentsZ handle_custom_message(org.ldk.structs.OnionMessageContents msg) { - long ret = bindings.CustomOnionMessageHandler_handle_custom_message(this.ptr, msg.ptr); + public Option_C2Tuple_OnionMessageContentsResponseInstructionZZ handle_custom_message(org.ldk.structs.OnionMessageContents message, org.ldk.structs.Option_CVec_u8ZZ context, org.ldk.structs.Responder responder) { + long ret = bindings.CustomOnionMessageHandler_handle_custom_message(this.ptr, message.ptr, context.ptr, responder == null ? 0 : responder.ptr); GC.KeepAlive(this); - GC.KeepAlive(msg); + GC.KeepAlive(message); + GC.KeepAlive(context); + GC.KeepAlive(responder); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Option_OnionMessageContentsZ ret_hu_conv = org.ldk.structs.Option_OnionMessageContentsZ.constr_from_ptr(ret); + org.ldk.structs.Option_C2Tuple_OnionMessageContentsResponseInstructionZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_OnionMessageContentsResponseInstructionZZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - if (this != null) { this.ptrs_to.AddLast(msg); }; + if (this != null) { this.ptrs_to.AddLast(message); }; return ret_hu_conv; } @@ -125,20 +134,20 @@ public class CustomOnionMessageHandler : CommonBase { * Typically, this is used for messages initiating a message flow rather than in response to * another message. The latter should use the return value of [`Self::handle_custom_message`]. */ - public ThreeTuple_OnionMessageContentsDestinationBlindedPathZ[] release_pending_custom_messages() { + public TwoTuple_OnionMessageContentsMessageSendInstructionsZ[] release_pending_custom_messages() { long ret = bindings.CustomOnionMessageHandler_release_pending_custom_messages(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - int ret_conv_56_len = InternalUtils.getArrayLength(ret); - ThreeTuple_OnionMessageContentsDestinationBlindedPathZ[] ret_conv_56_arr = new ThreeTuple_OnionMessageContentsDestinationBlindedPathZ[ret_conv_56_len]; - for (int e = 0; e < ret_conv_56_len; e++) { - long ret_conv_56 = InternalUtils.getU64ArrayElem(ret, e); - ThreeTuple_OnionMessageContentsDestinationBlindedPathZ ret_conv_56_hu_conv = new ThreeTuple_OnionMessageContentsDestinationBlindedPathZ(null, ret_conv_56); - if (ret_conv_56_hu_conv != null) { ret_conv_56_hu_conv.ptrs_to.AddLast(this); }; - ret_conv_56_arr[e] = ret_conv_56_hu_conv; + int ret_conv_55_len = InternalUtils.getArrayLength(ret); + TwoTuple_OnionMessageContentsMessageSendInstructionsZ[] ret_conv_55_arr = new TwoTuple_OnionMessageContentsMessageSendInstructionsZ[ret_conv_55_len]; + for (int d = 0; d < ret_conv_55_len; d++) { + long ret_conv_55 = InternalUtils.getU64ArrayElem(ret, d); + TwoTuple_OnionMessageContentsMessageSendInstructionsZ ret_conv_55_hu_conv = new TwoTuple_OnionMessageContentsMessageSendInstructionsZ(null, ret_conv_55); + if (ret_conv_55_hu_conv != null) { ret_conv_55_hu_conv.ptrs_to.AddLast(this); }; + ret_conv_55_arr[d] = ret_conv_55_hu_conv; } bindings.free_buffer(ret); - return ret_conv_56_arr; + return ret_conv_55_arr; } } diff --git a/c_sharp/src/org/ldk/structs/DefaultMessageRouter.cs b/c_sharp/src/org/ldk/structs/DefaultMessageRouter.cs index 170bdb2e..838ba3b1 100644 --- a/c_sharp/src/org/ldk/structs/DefaultMessageRouter.cs +++ b/c_sharp/src/org/ldk/structs/DefaultMessageRouter.cs @@ -8,6 +8,13 @@ namespace org { namespace ldk { namespace structs { /** * A [`MessageRouter`] that can only route to a directly connected [`Destination`]. + * + * # Privacy + * + * Creating [`BlindedMessagePath`]s may affect privacy since, if a suitable path cannot be found, + * it will create a one-hop path using the recipient as the introduction node if it is a announced + * node. Otherwise, there is no way to find a path to the introduction node in order to send a + * message, and thus an `Err` is returned. */ public class DefaultMessageRouter : CommonBase { internal DefaultMessageRouter(object _dummy, long ptr) : base(ptr) { } diff --git a/c_sharp/src/org/ldk/structs/DefaultRouter.cs b/c_sharp/src/org/ldk/structs/DefaultRouter.cs index 8d721253..b0f535f7 100644 --- a/c_sharp/src/org/ldk/structs/DefaultRouter.cs +++ b/c_sharp/src/org/ldk/structs/DefaultRouter.cs @@ -8,6 +8,11 @@ namespace org { namespace ldk { namespace structs { /** * A [`Router`] implemented using [`find_route`]. + * + * # Privacy + * + * Implements [`MessageRouter`] by delegating to [`DefaultMessageRouter`]. See those docs for + * privacy implications. */ public class DefaultRouter : CommonBase { internal DefaultRouter(object _dummy, long ptr) : base(ptr) { } @@ -32,7 +37,6 @@ public class DefaultRouter : CommonBase { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(logger); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(entropy_source); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(scorer); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(score_params); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/DelayedPaymentKey.cs b/c_sharp/src/org/ldk/structs/DelayedPaymentKey.cs index 35cf8924..168dd1c3 100644 --- a/c_sharp/src/org/ldk/structs/DelayedPaymentKey.cs +++ b/c_sharp/src/org/ldk/structs/DelayedPaymentKey.cs @@ -14,7 +14,7 @@ namespace org { namespace ldk { namespace structs { * punish and claim all the channel funds if the state broadcasted was previously revoked. * * [See the BOLT specs] - * (https://github.com/lightning/bolts/blob/master/03-transactions.md#localpubkey-local_htlcpubkey-remote_htlcpubkey-local_delayedpubkey-and-remote_delayedpubkey-derivation) + * * for more information on key derivation details. */ public class DelayedPaymentKey : CommonBase { diff --git a/c_sharp/src/org/ldk/structs/DelayedPaymentOutputDescriptor.cs b/c_sharp/src/org/ldk/structs/DelayedPaymentOutputDescriptor.cs index 3dd136d3..330eaabd 100644 --- a/c_sharp/src/org/ldk/structs/DelayedPaymentOutputDescriptor.cs +++ b/c_sharp/src/org/ldk/structs/DelayedPaymentOutputDescriptor.cs @@ -36,7 +36,6 @@ public class DelayedPaymentOutputDescriptor : CommonBase { bindings.DelayedPaymentOutputDescriptor_set_outpoint(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -120,7 +119,6 @@ public class DelayedPaymentOutputDescriptor : CommonBase { bindings.DelayedPaymentOutputDescriptor_set_revocation_pubkey(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -192,7 +190,6 @@ public class DelayedPaymentOutputDescriptor : CommonBase { 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); }; } /** @@ -213,9 +210,6 @@ public class DelayedPaymentOutputDescriptor : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/Description.cs b/c_sharp/src/org/ldk/structs/Description.cs index 271abfc3..ecd664f3 100644 --- a/c_sharp/src/org/ldk/structs/Description.cs +++ b/c_sharp/src/org/ldk/structs/Description.cs @@ -66,8 +66,8 @@ public class Description : CommonBase { return this.eq((Description)o); } /** - * Creates a new `Description` if `description` is at most 1023 __bytes__ long, - * returns [`CreationError::DescriptionTooLong`] otherwise + * Creates a new `Description` if `description` is at most 1023 * 5 bits (i.e., 639 bytes) + * long, and returns [`CreationError::DescriptionTooLong`] otherwise. * * Please note that single characters may use more than one byte due to UTF8 encoding. */ @@ -88,7 +88,19 @@ public class Description : CommonBase { 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); }; - if (this != null) { this.ptrs_to.AddLast(this); }; + ; + return ret_hu_conv; + } + + /** + * Get a reference to the underlying description [`UntrustedString`] + */ + public UntrustedString as_inner() { + long ret = bindings.Description_as_inner(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; } diff --git a/c_sharp/src/org/ldk/structs/Destination.cs b/c_sharp/src/org/ldk/structs/Destination.cs index 74cf38c8..8209a8b0 100644 --- a/c_sharp/src/org/ldk/structs/Destination.cs +++ b/c_sharp/src/org/ldk/structs/Destination.cs @@ -35,10 +35,10 @@ public class Destination : CommonBase { } /** A Destination of type BlindedPath */ public class Destination_BlindedPath : Destination { - public BlindedPath blinded_path; + public BlindedMessagePath blinded_path; internal Destination_BlindedPath(long ptr) : base(null, ptr) { long blinded_path = bindings.LDKDestination_BlindedPath_get_blinded_path(ptr); - org.ldk.structs.BlindedPath blinded_path_hu_conv = null; if (blinded_path < 0 || blinded_path > 4096) { blinded_path_hu_conv = new org.ldk.structs.BlindedPath(null, blinded_path); } + org.ldk.structs.BlindedMessagePath blinded_path_hu_conv = null; if (blinded_path < 0 || blinded_path > 4096) { blinded_path_hu_conv = new org.ldk.structs.BlindedMessagePath(null, blinded_path); } if (blinded_path_hu_conv != null) { blinded_path_hu_conv.ptrs_to.AddLast(this); }; this.blinded_path = blinded_path_hu_conv; } @@ -76,13 +76,12 @@ public class Destination : CommonBase { /** * Utility method to constructs a new BlindedPath-variant Destination */ - public static Destination blinded_path(org.ldk.structs.BlindedPath a) { + public static Destination blinded_path(org.ldk.structs.BlindedMessagePath a) { 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); 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/EcdsaChannelSigner.cs b/c_sharp/src/org/ldk/structs/EcdsaChannelSigner.cs index 92f2a1ed..913116c8 100644 --- a/c_sharp/src/org/ldk/structs/EcdsaChannelSigner.cs +++ b/c_sharp/src/org/ldk/structs/EcdsaChannelSigner.cs @@ -556,5 +556,23 @@ public class EcdsaChannelSigner : CommonBase { return ret_hu_conv; } + internal long clone_ptr() { + long ret = bindings.EcdsaChannelSigner_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of a EcdsaChannelSigner + */ + public EcdsaChannelSigner clone() { + long ret = bindings.EcdsaChannelSigner_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + EcdsaChannelSigner ret_hu_conv = new EcdsaChannelSigner(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/ErroneousField.cs b/c_sharp/src/org/ldk/structs/ErroneousField.cs index 1d70fe1f..c3cd1f73 100644 --- a/c_sharp/src/org/ldk/structs/ErroneousField.cs +++ b/c_sharp/src/org/ldk/structs/ErroneousField.cs @@ -57,7 +57,6 @@ public class ErroneousField : CommonBase { bindings.ErroneousField_set_suggested_value(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -70,7 +69,6 @@ public class ErroneousField : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ErroneousField ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ErroneousField(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(suggested_value_arg); }; 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 c137b857..33be0e72 100644 --- a/c_sharp/src/org/ldk/structs/ErrorAction.cs +++ b/c_sharp/src/org/ldk/structs/ErrorAction.cs @@ -134,7 +134,6 @@ public class ErrorAction : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ErrorAction ret_hu_conv = org.ldk.structs.ErrorAction.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(msg); }; return ret_hu_conv; } @@ -147,7 +146,6 @@ public class ErrorAction : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ErrorAction ret_hu_conv = org.ldk.structs.ErrorAction.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(msg); }; return ret_hu_conv; } @@ -194,7 +192,6 @@ public class ErrorAction : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ErrorAction ret_hu_conv = org.ldk.structs.ErrorAction.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(msg); }; return ret_hu_conv; } @@ -208,7 +205,6 @@ public class ErrorAction : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ErrorAction ret_hu_conv = org.ldk.structs.ErrorAction.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(msg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/ErrorMessage.cs b/c_sharp/src/org/ldk/structs/ErrorMessage.cs index c2f4971f..aa86e14f 100644 --- a/c_sharp/src/org/ldk/structs/ErrorMessage.cs +++ b/c_sharp/src/org/ldk/structs/ErrorMessage.cs @@ -42,7 +42,6 @@ public class ErrorMessage : CommonBase { bindings.ErrorMessage_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -83,7 +82,6 @@ public class ErrorMessage : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/Event.cs b/c_sharp/src/org/ldk/structs/Event.cs index 342adec3..2732bd37 100644 --- a/c_sharp/src/org/ldk/structs/Event.cs +++ b/c_sharp/src/org/ldk/structs/Event.cs @@ -22,27 +22,30 @@ public class Event : CommonBase { long raw_ty = bindings.LDKEvent_ty_from_ptr(ptr); switch (raw_ty) { case 0: return new Event_FundingGenerationReady(ptr); - case 1: return new Event_PaymentClaimable(ptr); - case 2: return new Event_PaymentClaimed(ptr); - case 3: return new Event_ConnectionNeeded(ptr); - case 4: return new Event_InvoiceRequestFailed(ptr); - case 5: return new Event_PaymentSent(ptr); - case 6: return new Event_PaymentFailed(ptr); - case 7: return new Event_PaymentPathSuccessful(ptr); - case 8: return new Event_PaymentPathFailed(ptr); - case 9: return new Event_ProbeSuccessful(ptr); - case 10: return new Event_ProbeFailed(ptr); - case 11: return new Event_PendingHTLCsForwardable(ptr); - case 12: return new Event_HTLCIntercepted(ptr); - case 13: return new Event_SpendableOutputs(ptr); - case 14: return new Event_PaymentForwarded(ptr); - case 15: return new Event_ChannelPending(ptr); - case 16: return new Event_ChannelReady(ptr); - case 17: return new Event_ChannelClosed(ptr); - case 18: return new Event_DiscardFunding(ptr); - case 19: return new Event_OpenChannelRequest(ptr); - case 20: return new Event_HTLCHandlingFailed(ptr); - case 21: return new Event_BumpTransaction(ptr); + case 1: return new Event_FundingTxBroadcastSafe(ptr); + case 2: return new Event_PaymentClaimable(ptr); + case 3: return new Event_PaymentClaimed(ptr); + case 4: return new Event_ConnectionNeeded(ptr); + case 5: return new Event_InvoiceReceived(ptr); + case 6: return new Event_PaymentSent(ptr); + case 7: return new Event_PaymentFailed(ptr); + case 8: return new Event_PaymentPathSuccessful(ptr); + case 9: return new Event_PaymentPathFailed(ptr); + case 10: return new Event_ProbeSuccessful(ptr); + case 11: return new Event_ProbeFailed(ptr); + case 12: return new Event_PendingHTLCsForwardable(ptr); + case 13: return new Event_HTLCIntercepted(ptr); + case 14: return new Event_SpendableOutputs(ptr); + case 15: return new Event_PaymentForwarded(ptr); + case 16: return new Event_ChannelPending(ptr); + case 17: return new Event_ChannelReady(ptr); + case 18: return new Event_ChannelClosed(ptr); + case 19: return new Event_DiscardFunding(ptr); + case 20: return new Event_OpenChannelRequest(ptr); + case 21: return new Event_HTLCHandlingFailed(ptr); + case 22: return new Event_BumpTransaction(ptr); + case 23: return new Event_OnionMessageIntercepted(ptr); + case 24: return new Event_OnionMessagePeerConnected(ptr); default: throw new ArgumentException("Impossible enum variant"); } @@ -101,6 +104,51 @@ public class Event : CommonBase { this.user_channel_id = user_channel_id_conv; } } + /** A Event of type FundingTxBroadcastSafe */ + public class Event_FundingTxBroadcastSafe : Event { + /** + * The `channel_id` indicating which channel has reached this stage. + */ + public ChannelId channel_id; + /** + * The `user_channel_id` value passed in to [`ChannelManager::create_channel`]. + * + * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel + */ + public UInt128 user_channel_id; + /** + * The outpoint of the channel's funding transaction. + */ + public OutPoint funding_txo; + /** + * The `node_id` of the channel counterparty. + */ + public byte[] counterparty_node_id; + /** + * The `temporary_channel_id` this channel used to be known by during channel establishment. + */ + public ChannelId former_temporary_channel_id; + internal Event_FundingTxBroadcastSafe(long ptr) : base(null, ptr) { + long channel_id = bindings.LDKEvent_FundingTxBroadcastSafe_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 user_channel_id = bindings.LDKEvent_FundingTxBroadcastSafe_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 funding_txo = bindings.LDKEvent_FundingTxBroadcastSafe_get_funding_txo(ptr); + 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 counterparty_node_id = bindings.LDKEvent_FundingTxBroadcastSafe_get_counterparty_node_id(ptr); + byte[] counterparty_node_id_conv = InternalUtils.decodeUint8Array(counterparty_node_id); + this.counterparty_node_id = counterparty_node_id_conv; + long former_temporary_channel_id = bindings.LDKEvent_FundingTxBroadcastSafe_get_former_temporary_channel_id(ptr); + 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; + } + } /** A Event of type PaymentClaimable */ public class Event_PaymentClaimable : Event { /** @@ -245,6 +293,15 @@ public class Event : CommonBase { * serialized prior to LDK version 0.0.117. */ public Option_u64Z sender_intended_total_msat; + /** + * The fields in the onion which were received with each HTLC. Only fields which were + * identical in each HTLC involved in the payment will be included here. + * + * Payments received on LDK versions prior to 0.0.124 will have this field unset. + * + * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public RecipientOnionFields onion_fields; internal Event_PaymentClaimed(long ptr) : base(null, ptr) { long receiver_node_id = bindings.LDKEvent_PaymentClaimed_get_receiver_node_id(ptr); byte[] receiver_node_id_conv = InternalUtils.decodeUint8Array(receiver_node_id); @@ -272,6 +329,10 @@ public class Event : CommonBase { org.ldk.structs.Option_u64Z sender_intended_total_msat_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(sender_intended_total_msat); if (sender_intended_total_msat_hu_conv != null) { sender_intended_total_msat_hu_conv.ptrs_to.AddLast(this); }; this.sender_intended_total_msat = sender_intended_total_msat_hu_conv; + long onion_fields = bindings.LDKEvent_PaymentClaimed_get_onion_fields(ptr); + org.ldk.structs.RecipientOnionFields onion_fields_hu_conv = null; if (onion_fields < 0 || onion_fields > 4096) { onion_fields_hu_conv = new org.ldk.structs.RecipientOnionFields(null, onion_fields); } + if (onion_fields_hu_conv != null) { onion_fields_hu_conv.ptrs_to.AddLast(this); }; + this.onion_fields = onion_fields_hu_conv; } } /** A Event of type ConnectionNeeded */ @@ -301,16 +362,48 @@ public class Event : CommonBase { this.addresses = addresses_conv_15_arr; } } - /** A Event of type InvoiceRequestFailed */ - public class Event_InvoiceRequestFailed : Event { + /** A Event of type InvoiceReceived */ + public class Event_InvoiceReceived : Event { /** - * The `payment_id` to have been associated with payment for the requested invoice. + * The `payment_id` associated with payment for the invoice. */ public byte[] payment_id; - internal Event_InvoiceRequestFailed(long ptr) : base(null, ptr) { - long payment_id = bindings.LDKEvent_InvoiceRequestFailed_get_payment_id(ptr); + /** + * The invoice to pay. + */ + public Bolt12Invoice invoice; + /** + * The context of the [`BlindedMessagePath`] used to send the invoice. + * + * [`BlindedMessagePath`]: crate::blinded_path::message::BlindedMessagePath + */ + public Option_OffersContextZ context; + /** + * A responder for replying with an [`InvoiceError`] if needed. + * + * `None` if the invoice wasn't sent with a reply path. + * + * [`InvoiceError`]: crate::offers::invoice_error::InvoiceError + * + * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public Responder responder; + internal Event_InvoiceReceived(long ptr) : base(null, ptr) { + long payment_id = bindings.LDKEvent_InvoiceReceived_get_payment_id(ptr); byte[] payment_id_conv = InternalUtils.decodeUint8Array(payment_id); this.payment_id = payment_id_conv; + long invoice = bindings.LDKEvent_InvoiceReceived_get_invoice(ptr); + org.ldk.structs.Bolt12Invoice invoice_hu_conv = null; if (invoice < 0 || invoice > 4096) { invoice_hu_conv = new org.ldk.structs.Bolt12Invoice(null, invoice); } + if (invoice_hu_conv != null) { invoice_hu_conv.ptrs_to.AddLast(this); }; + this.invoice = invoice_hu_conv; + long context = bindings.LDKEvent_InvoiceReceived_get_context(ptr); + org.ldk.structs.Option_OffersContextZ context_hu_conv = org.ldk.structs.Option_OffersContextZ.constr_from_ptr(context); + if (context_hu_conv != null) { context_hu_conv.ptrs_to.AddLast(this); }; + this.context = context_hu_conv; + long responder = bindings.LDKEvent_InvoiceReceived_get_responder(ptr); + org.ldk.structs.Responder responder_hu_conv = null; if (responder < 0 || responder > 4096) { responder_hu_conv = new org.ldk.structs.Responder(null, responder); } + if (responder_hu_conv != null) { responder_hu_conv.ptrs_to.AddLast(this); }; + this.responder = responder_hu_conv; } } /** A Event of type PaymentSent */ @@ -342,6 +435,8 @@ public class Event : CommonBase { * If the recipient or an intermediate node misbehaves and gives us free money, this may * overstate the amount paid, though this is unlikely. * + * This is only `None` for payments initiated on LDK versions prior to 0.0.103. + * * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees */ public Option_u64Z fee_paid_msat; @@ -371,14 +466,17 @@ public class Event : CommonBase { */ public byte[] payment_id; /** - * The hash that was given to [`ChannelManager::send_payment`]. + * The hash that was given to [`ChannelManager::send_payment`]. `None` if the payment failed + * before receiving an invoice when paying a BOLT12 [`Offer`]. * * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment + * [`Offer`]: crate::offers::offer::Offer */ - public byte[] payment_hash; + public Option_ThirtyTwoBytesZ payment_hash; /** * The reason the payment failed. This is only `None` for events generated or serialized - * by versions prior to 0.0.115. + * by versions prior to 0.0.115, or when downgrading to a version with a reason that was + * added after. */ public Option_PaymentFailureReasonZ reason; internal Event_PaymentFailed(long ptr) : base(null, ptr) { @@ -386,8 +484,9 @@ public class Event : CommonBase { byte[] payment_id_conv = InternalUtils.decodeUint8Array(payment_id); this.payment_id = payment_id_conv; long payment_hash = bindings.LDKEvent_PaymentFailed_get_payment_hash(ptr); - byte[] payment_hash_conv = InternalUtils.decodeUint8Array(payment_hash); - this.payment_hash = payment_hash_conv; + org.ldk.structs.Option_ThirtyTwoBytesZ payment_hash_hu_conv = org.ldk.structs.Option_ThirtyTwoBytesZ.constr_from_ptr(payment_hash); + if (payment_hash_hu_conv != null) { payment_hash_hu_conv.ptrs_to.AddLast(this); }; + this.payment_hash = payment_hash_hu_conv; long reason = bindings.LDKEvent_PaymentFailed_get_reason(ptr); org.ldk.structs.Option_PaymentFailureReasonZ reason_hu_conv = org.ldk.structs.Option_PaymentFailureReasonZ.constr_from_ptr(reason); if (reason_hu_conv != null) { reason_hu_conv.ptrs_to.AddLast(this); }; @@ -955,15 +1054,16 @@ public class Event : CommonBase { /** * The full transaction received from the user */ - public byte[] transaction; + public FundingInfo funding_info; internal Event_DiscardFunding(long ptr) : base(null, ptr) { long channel_id = bindings.LDKEvent_DiscardFunding_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 transaction = bindings.LDKEvent_DiscardFunding_get_transaction(ptr); - byte[] transaction_conv = InternalUtils.decodeUint8Array(transaction); - this.transaction = transaction_conv; + long funding_info = bindings.LDKEvent_DiscardFunding_get_funding_info(ptr); + org.ldk.structs.FundingInfo funding_info_hu_conv = org.ldk.structs.FundingInfo.constr_from_ptr(funding_info); + if (funding_info_hu_conv != null) { funding_info_hu_conv.ptrs_to.AddLast(this); }; + this.funding_info = funding_info_hu_conv; } } /** A Event of type OpenChannelRequest */ @@ -1017,6 +1117,14 @@ public class Event : CommonBase { * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager */ public ChannelTypeFeatures channel_type; + /** + * True if this channel is (or will be) publicly-announced. + */ + public bool is_announced; + /** + * Channel parameters given by the counterparty. + */ + public ChannelParameters _params; internal Event_OpenChannelRequest(long ptr) : base(null, ptr) { long temporary_channel_id = bindings.LDKEvent_OpenChannelRequest_get_temporary_channel_id(ptr); 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); } @@ -1031,6 +1139,11 @@ public class Event : CommonBase { 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; + this.is_announced = bindings.LDKEvent_OpenChannelRequest_get_is_announced(ptr); + long _params = bindings.LDKEvent_OpenChannelRequest_get_params(ptr); + org.ldk.structs.ChannelParameters params_hu_conv = null; if (_params < 0 || _params > 4096) { params_hu_conv = new org.ldk.structs.ChannelParameters(null, _params); } + if (params_hu_conv != null) { params_hu_conv.ptrs_to.AddLast(this); }; + this._params = params_hu_conv; } } /** A Event of type HTLCHandlingFailed */ @@ -1064,6 +1177,39 @@ public class Event : CommonBase { this.bump_transaction = bump_transaction_hu_conv; } } + /** A Event of type OnionMessageIntercepted */ + public class Event_OnionMessageIntercepted : Event { + /** + * The node id of the offline peer. + */ + public byte[] peer_node_id; + /** + * The onion message intended to be forwarded to `peer_node_id`. + */ + public OnionMessage message; + internal Event_OnionMessageIntercepted(long ptr) : base(null, ptr) { + long peer_node_id = bindings.LDKEvent_OnionMessageIntercepted_get_peer_node_id(ptr); + byte[] peer_node_id_conv = InternalUtils.decodeUint8Array(peer_node_id); + this.peer_node_id = peer_node_id_conv; + long message = bindings.LDKEvent_OnionMessageIntercepted_get_message(ptr); + org.ldk.structs.OnionMessage message_hu_conv = null; if (message < 0 || message > 4096) { message_hu_conv = new org.ldk.structs.OnionMessage(null, message); } + if (message_hu_conv != null) { message_hu_conv.ptrs_to.AddLast(this); }; + this.message = message_hu_conv; + } + } + /** A Event of type OnionMessagePeerConnected */ + public class Event_OnionMessagePeerConnected : Event { + /** + * The node id of the peer we just connected to, who advertises support for + * onion messages. + */ + public byte[] peer_node_id; + internal Event_OnionMessagePeerConnected(long ptr) : base(null, ptr) { + long peer_node_id = bindings.LDKEvent_OnionMessagePeerConnected_get_peer_node_id(ptr); + byte[] peer_node_id_conv = InternalUtils.decodeUint8Array(peer_node_id); + this.peer_node_id = peer_node_id_conv; + } + } internal long clone_ptr() { long ret = bindings.Event_clone_ptr(this.ptr); GC.KeepAlive(this); @@ -1095,7 +1241,22 @@ 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 FundingTxBroadcastSafe-variant Event + */ + public static Event funding_tx_broadcast_safe(org.ldk.structs.ChannelId channel_id, org.ldk.util.UInt128 user_channel_id, org.ldk.structs.OutPoint funding_txo, byte[] counterparty_node_id, org.ldk.structs.ChannelId former_temporary_channel_id) { + long ret = bindings.Event_funding_tx_broadcast_safe(channel_id.ptr, InternalUtils.encodeUint8Array(user_channel_id.getLEBytes()), funding_txo.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33)), former_temporary_channel_id.ptr); + GC.KeepAlive(channel_id); + GC.KeepAlive(user_channel_id); + GC.KeepAlive(funding_txo); + GC.KeepAlive(counterparty_node_id); + GC.KeepAlive(former_temporary_channel_id); + 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); }; return ret_hu_conv; } @@ -1116,31 +1277,24 @@ 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(onion_fields); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(purpose); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(via_channel_id); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(via_user_channel_id); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(claim_deadline); }; return ret_hu_conv; } /** * 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.ptr)), sender_intended_total_msat.ptr); + 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, org.ldk.structs.RecipientOnionFields onion_fields) { + 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, onion_fields.ptr); GC.KeepAlive(receiver_node_id); GC.KeepAlive(payment_hash); GC.KeepAlive(amount_msat); GC.KeepAlive(purpose); GC.KeepAlive(htlcs); GC.KeepAlive(sender_intended_total_msat); + GC.KeepAlive(onion_fields); 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(purpose); }; - foreach (ClaimedHTLC htlcs_conv_13 in htlcs) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(htlcs_conv_13); }; }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(sender_intended_total_msat); }; return ret_hu_conv; } @@ -1154,16 +1308,18 @@ 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); }; - foreach (SocketAddress addresses_conv_15 in addresses) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(addresses_conv_15); }; }; return ret_hu_conv; } /** - * Utility method to constructs a new InvoiceRequestFailed-variant Event + * Utility method to constructs a new InvoiceReceived-variant Event */ - public static Event invoice_request_failed(byte[] payment_id) { - long ret = bindings.Event_invoice_request_failed(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_id, 32))); + public static Event invoice_received(byte[] payment_id, org.ldk.structs.Bolt12Invoice invoice, org.ldk.structs.Option_OffersContextZ context, org.ldk.structs.Responder responder) { + long ret = bindings.Event_invoice_received(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_id, 32)), invoice.ptr, context.ptr, responder.ptr); GC.KeepAlive(payment_id); + GC.KeepAlive(invoice); + GC.KeepAlive(context); + GC.KeepAlive(responder); 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); }; @@ -1182,23 +1338,20 @@ 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(payment_id); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(fee_paid_msat); }; return ret_hu_conv; } /** * Utility method to constructs a new PaymentFailed-variant Event */ - public static Event payment_failed(byte[] payment_id, byte[] payment_hash, org.ldk.structs.Option_PaymentFailureReasonZ reason) { - long ret = bindings.Event_payment_failed(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_id, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32)), reason.ptr); + public static Event payment_failed(byte[] payment_id, org.ldk.structs.Option_ThirtyTwoBytesZ payment_hash, org.ldk.structs.Option_PaymentFailureReasonZ reason) { + long ret = bindings.Event_payment_failed(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_id, 32)), payment_hash.ptr, reason.ptr); GC.KeepAlive(payment_id); GC.KeepAlive(payment_hash); GC.KeepAlive(reason); 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(reason); }; return ret_hu_conv; } @@ -1213,8 +1366,6 @@ 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(payment_hash); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(path); }; return ret_hu_conv; } @@ -1232,10 +1383,6 @@ 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(payment_id); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(failure); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(path); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(short_channel_id); }; return ret_hu_conv; } @@ -1250,7 +1397,6 @@ 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(path); }; return ret_hu_conv; } @@ -1266,8 +1412,6 @@ 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(path); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(short_channel_id); }; return ret_hu_conv; } @@ -1309,8 +1453,6 @@ 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); }; - foreach (SpendableOutputDescriptor outputs_conv_27 in outputs) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(outputs_conv_27); }; }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id); }; return ret_hu_conv; } @@ -1330,13 +1472,6 @@ 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(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(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; } @@ -1354,10 +1489,6 @@ 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(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; } @@ -1373,8 +1504,6 @@ 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; } @@ -1392,42 +1521,37 @@ 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); }; return ret_hu_conv; } /** * Utility method to constructs a new DiscardFunding-variant Event */ - 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)); + public static Event discard_funding(org.ldk.structs.ChannelId channel_id, org.ldk.structs.FundingInfo funding_info) { + long ret = bindings.Event_discard_funding(channel_id.ptr, funding_info.ptr); GC.KeepAlive(channel_id); - GC.KeepAlive(transaction); + GC.KeepAlive(funding_info); 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(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); + 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, bool is_announced, org.ldk.structs.ChannelParameters _params) { + 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, is_announced, _params.ptr); GC.KeepAlive(temporary_channel_id); GC.KeepAlive(counterparty_node_id); GC.KeepAlive(funding_satoshis); GC.KeepAlive(push_msat); GC.KeepAlive(channel_type); + GC.KeepAlive(is_announced); + GC.KeepAlive(_params); 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; } @@ -1441,8 +1565,6 @@ 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(prev_channel_id); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(failed_next_destination); }; return ret_hu_conv; } @@ -1455,7 +1577,31 @@ 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(a); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new OnionMessageIntercepted-variant Event + */ + public static Event onion_message_intercepted(byte[] peer_node_id, org.ldk.structs.OnionMessage message) { + long ret = bindings.Event_onion_message_intercepted(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(peer_node_id, 33)), message.ptr); + GC.KeepAlive(peer_node_id); + GC.KeepAlive(message); + 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); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new OnionMessagePeerConnected-variant Event + */ + public static Event onion_message_peer_connected(byte[] peer_node_id) { + long ret = bindings.Event_onion_message_peer_connected(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(peer_node_id, 33))); + GC.KeepAlive(peer_node_id); + 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); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/EventHandler.cs b/c_sharp/src/org/ldk/structs/EventHandler.cs index 718935df..569de2b4 100644 --- a/c_sharp/src/org/ldk/structs/EventHandler.cs +++ b/c_sharp/src/org/ldk/structs/EventHandler.cs @@ -14,7 +14,7 @@ public interface EventHandlerInterface { * * See [`EventsProvider`] for details that must be considered when implementing this method. */ - void handle_event(Event _event); + Result_NoneReplayEventZ handle_event(Event _event); } /** @@ -22,7 +22,7 @@ public interface EventHandlerInterface { * * An async variation also exists for implementations of [`EventsProvider`] that support async * event handling. The async event handler should satisfy the generic bounds: `F: - * core::future::Future, H: Fn(Event) -> F`. + * core::future::Future>, H: Fn(Event) -> F`. */ public class EventHandler : CommonBase { internal bindings.LDKEventHandler bindings_instance; @@ -38,11 +38,13 @@ public class EventHandler : CommonBase { internal LDKEventHandlerImpl(EventHandlerInterface arg, LDKEventHandlerHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; } private EventHandlerInterface arg; private LDKEventHandlerHolder impl_holder; - public void handle_event(long _event) { + public long handle_event(long _event) { org.ldk.structs.Event _event_hu_conv = org.ldk.structs.Event.constr_from_ptr(_event); if (_event_hu_conv != null) { _event_hu_conv.ptrs_to.AddLast(this); }; - arg.handle_event(_event_hu_conv); + Result_NoneReplayEventZ ret = arg.handle_event(_event_hu_conv); GC.KeepAlive(arg); + long result = ret.clone_ptr(); + return result; } } @@ -63,11 +65,13 @@ public class EventHandler : CommonBase { * * See [`EventsProvider`] for details that must be considered when implementing this method. */ - public void handle_event(org.ldk.structs.Event _event) { - bindings.EventHandler_handle_event(this.ptr, _event.ptr); + public Result_NoneReplayEventZ handle_event(org.ldk.structs.Event _event) { + long ret = bindings.EventHandler_handle_event(this.ptr, _event.ptr); GC.KeepAlive(this); GC.KeepAlive(_event); - if (this != null) { this.ptrs_to.AddLast(_event); }; + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneReplayEventZ ret_hu_conv = Result_NoneReplayEventZ.constr_from_ptr(ret); + return ret_hu_conv; } } diff --git a/c_sharp/src/org/ldk/structs/EventsProvider.cs b/c_sharp/src/org/ldk/structs/EventsProvider.cs index cc42c27d..42a2c0b1 100644 --- a/c_sharp/src/org/ldk/structs/EventsProvider.cs +++ b/c_sharp/src/org/ldk/structs/EventsProvider.cs @@ -33,8 +33,12 @@ public interface EventsProviderInterface { * * In order to ensure no [`Event`]s are lost, implementors of this trait will persist [`Event`]s * and replay any unhandled events on startup. An [`Event`] is considered handled when - * [`process_pending_events`] returns, thus handlers MUST fully handle [`Event`]s and persist any - * relevant changes to disk *before* returning. + * [`process_pending_events`] returns `Ok(())`, thus handlers MUST fully handle [`Event`]s and + * persist any relevant changes to disk *before* returning `Ok(())`. In case of an error (e.g., + * persistence failure) implementors should return `Err(ReplayEvent())`, signalling to the + * [`EventsProvider`] to replay unhandled events on the next invocation (generally immediately). + * Note that some events might not be replayed, please refer to the documentation for + * the individual [`Event`] variants for more detail. * * Further, because an application may crash between an [`Event`] being handled and the * implementor of this trait being re-serialized, [`Event`] handling must be idempotent - in diff --git a/c_sharp/src/org/ldk/structs/FailureCode.cs b/c_sharp/src/org/ldk/structs/FailureCode.cs index 9b5d88bb..dc168b73 100644 --- a/c_sharp/src/org/ldk/structs/FailureCode.cs +++ b/c_sharp/src/org/ldk/structs/FailureCode.cs @@ -114,7 +114,6 @@ public class FailureCode : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.FailureCode ret_hu_conv = org.ldk.structs.FailureCode.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; } diff --git a/c_sharp/src/org/ldk/structs/Filter.cs b/c_sharp/src/org/ldk/structs/Filter.cs index f27d0a52..066fd331 100644 --- a/c_sharp/src/org/ldk/structs/Filter.cs +++ b/c_sharp/src/org/ldk/structs/Filter.cs @@ -12,6 +12,11 @@ namespace org { namespace ldk { namespace structs { public interface FilterInterface { /**Registers interest in a transaction with `txid` and having an output with `script_pubkey` as * a spending condition. + * + * This may be used, for example, to monitor for when a funding transaction confirms. + * + * The `script_pubkey` is provided for informational purposes and may be useful for block + * sources which only support filtering on scripts. */ void register_tx(byte[] txid, byte[] script_pubkey); /**Registers interest in spends of a transaction output. @@ -20,6 +25,9 @@ public interface FilterInterface { * to ensure that also dependent output spents within an already connected block are correctly * handled, e.g., by re-scanning the block in question whenever new outputs have been * registered mid-processing. + * + * This may be used, for example, to monitor for when a funding output is spent (by any + * transaction). */ void register_output(WatchedOutput output); } @@ -89,6 +97,11 @@ public class Filter : CommonBase { /** * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as * a spending condition. + * + * This may be used, for example, to monitor for when a funding transaction confirms. + * + * The `script_pubkey` is provided for informational purposes and may be useful for block + * sources which only support filtering on scripts. */ public void register_tx(byte[] txid, byte[] script_pubkey) { bindings.Filter_register_tx(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(txid, 32)), InternalUtils.encodeUint8Array(script_pubkey)); @@ -104,12 +117,14 @@ public class Filter : CommonBase { * to ensure that also dependent output spents within an already connected block are correctly * handled, e.g., by re-scanning the block in question whenever new outputs have been * registered mid-processing. + * + * This may be used, for example, to monitor for when a funding output is spent (by any + * transaction). */ public void register_output(org.ldk.structs.WatchedOutput output) { 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 deleted file mode 100644 index 82c4edb2..00000000 --- a/c_sharp/src/org/ldk/structs/ForwardNode.cs +++ /dev/null @@ -1,114 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - - -/** - * An intermediate node, its outbound channel, and relay parameters. - */ -public class ForwardNode : CommonBase { - internal ForwardNode(object _dummy, long ptr) : base(ptr) { } - ~ForwardNode() { - if (ptr != 0) { bindings.ForwardNode_free(ptr); } - } - - /** - * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also - * used for [`BlindedPayInfo`] construction. - */ - public ForwardTlvs get_tlvs() { - long ret = bindings.ForwardNode_get_tlvs(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ForwardTlvs ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ForwardTlvs(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also - * used for [`BlindedPayInfo`] construction. - */ - public void set_tlvs(org.ldk.structs.ForwardTlvs val) { - bindings.ForwardNode_set_tlvs(this.ptr, val.ptr); - GC.KeepAlive(this); - GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; - } - - /** - * This node's pubkey. - */ - public byte[] get_node_id() { - long ret = bindings.ForwardNode_get_node_id(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * This node's pubkey. - */ - public void set_node_id(byte[] val) { - bindings.ForwardNode_set_node_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * The maximum value, in msat, that may be accepted by this node. - */ - public long get_htlc_maximum_msat() { - long ret = bindings.ForwardNode_get_htlc_maximum_msat(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * The maximum value, in msat, that may be accepted by this node. - */ - public void set_htlc_maximum_msat(long val) { - bindings.ForwardNode_set_htlc_maximum_msat(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * 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.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); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ForwardNode ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ForwardNode(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(tlvs_arg); }; - return ret_hu_conv; - } - - internal long clone_ptr() { - long ret = bindings.ForwardNode_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a copy of the ForwardNode - */ - public ForwardNode clone() { - long ret = bindings.ForwardNode_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ForwardNode ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ForwardNode(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/ForwardTlvs.cs b/c_sharp/src/org/ldk/structs/ForwardTlvs.cs index d703878b..ee2be8e7 100644 --- a/c_sharp/src/org/ldk/structs/ForwardTlvs.cs +++ b/c_sharp/src/org/ldk/structs/ForwardTlvs.cs @@ -52,7 +52,6 @@ public class ForwardTlvs : CommonBase { bindings.ForwardTlvs_set_payment_relay(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -74,7 +73,6 @@ public class ForwardTlvs : CommonBase { bindings.ForwardTlvs_set_payment_constraints(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -102,24 +100,49 @@ public class ForwardTlvs : CommonBase { bindings.ForwardTlvs_set_features(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * Set if this [`BlindedPaymentPath`] is concatenated to another, to indicate the + * [`BlindedPaymentPath::blinding_point`] of the appended blinded path. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public byte[] get_next_blinding_override() { + long ret = bindings.ForwardTlvs_get_next_blinding_override(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Set if this [`BlindedPaymentPath`] is concatenated to another, to indicate the + * [`BlindedPaymentPath::blinding_point`] of the appended blinded path. + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public void set_next_blinding_override(byte[] val) { + bindings.ForwardTlvs_set_next_blinding_override(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); + GC.KeepAlive(this); + GC.KeepAlive(val); } /** * Constructs a new ForwardTlvs given each field + * + * Note that next_blinding_override_arg (or a relevant inner pointer) may be NULL or all-0s to represent None */ - 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.ptr, payment_constraints_arg.ptr, features_arg.ptr); + 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, byte[] next_blinding_override_arg) { + long ret = bindings.ForwardTlvs_new(short_channel_id_arg, payment_relay_arg.ptr, payment_constraints_arg.ptr, features_arg.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(next_blinding_override_arg, 33))); GC.KeepAlive(short_channel_id_arg); GC.KeepAlive(payment_relay_arg); GC.KeepAlive(payment_constraints_arg); GC.KeepAlive(features_arg); + GC.KeepAlive(next_blinding_override_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ForwardTlvs ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ForwardTlvs(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_relay_arg); }; - 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(features_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/FourTuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ.cs b/c_sharp/src/org/ldk/structs/FourTuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ.cs index daeb4f10..031ae6ad 100644 --- a/c_sharp/src/org/ldk/structs/FourTuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ.cs +++ b/c_sharp/src/org/ldk/structs/FourTuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ.cs @@ -100,9 +100,6 @@ public class FourTuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ : CommonBas 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 0e15eaf8..83b06b18 100644 --- a/c_sharp/src/org/ldk/structs/FundingCreated.cs +++ b/c_sharp/src/org/ldk/structs/FundingCreated.cs @@ -38,7 +38,6 @@ public class FundingCreated : CommonBase { bindings.FundingCreated_set_temporary_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -111,7 +110,6 @@ 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; } diff --git a/c_sharp/src/org/ldk/structs/FundingInfo.cs b/c_sharp/src/org/ldk/structs/FundingInfo.cs new file mode 100644 index 00000000..12020400 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/FundingInfo.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 { + +/** + * `FundingInfo` holds information about a channel's funding transaction. + * + * When LDK is set to manual propagation of the funding transaction + * (via [`ChannelManager::unsafe_manual_funding_transaction_generated`), + * LDK does not have the full transaction data. Instead, the `OutPoint` + * for the funding is provided here. + * + * [`ChannelManager::unsafe_manual_funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::unsafe_manual_funding_transaction_generated + */ +public class FundingInfo : CommonBase { + protected FundingInfo(object _dummy, long ptr) : base(ptr) { } + ~FundingInfo() { + if (ptr != 0) { bindings.FundingInfo_free(ptr); } + } + + internal static FundingInfo constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKFundingInfo_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new FundingInfo_Tx(ptr); + case 1: return new FundingInfo_OutPoint(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A FundingInfo of type Tx */ + public class FundingInfo_Tx : FundingInfo { + /** + * The funding transaction + */ + public byte[] transaction; + internal FundingInfo_Tx(long ptr) : base(null, ptr) { + long transaction = bindings.LDKFundingInfo_Tx_get_transaction(ptr); + byte[] transaction_conv = InternalUtils.decodeUint8Array(transaction); + this.transaction = transaction_conv; + } + } + /** A FundingInfo of type OutPoint */ + public class FundingInfo_OutPoint : FundingInfo { + /** + * The outpoint of the funding + */ + public OutPoint outpoint; + internal FundingInfo_OutPoint(long ptr) : base(null, ptr) { + long outpoint = bindings.LDKFundingInfo_OutPoint_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; + } + } + internal long clone_ptr() { + long ret = bindings.FundingInfo_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the FundingInfo + */ + public FundingInfo clone() { + long ret = bindings.FundingInfo_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.FundingInfo ret_hu_conv = org.ldk.structs.FundingInfo.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 Tx-variant FundingInfo + */ + public static FundingInfo tx(byte[] transaction) { + long ret = bindings.FundingInfo_tx(InternalUtils.encodeUint8Array(transaction)); + GC.KeepAlive(transaction); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.FundingInfo ret_hu_conv = org.ldk.structs.FundingInfo.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 OutPoint-variant FundingInfo + */ + public static FundingInfo out_point(org.ldk.structs.OutPoint outpoint) { + long ret = bindings.FundingInfo_out_point(outpoint.ptr); + GC.KeepAlive(outpoint); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.FundingInfo ret_hu_conv = org.ldk.structs.FundingInfo.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 FundingInfos contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + */ + public bool eq(org.ldk.structs.FundingInfo b) { + bool ret = bindings.FundingInfo_eq(this.ptr, b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + return ret; + } + + public override bool Equals(object o) { + if (!(o is FundingInfo)) return false; + return this.eq((FundingInfo)o); + } + /** + * Serialize the FundingInfo object into a byte array which can be read by FundingInfo_read + */ + public byte[] write() { + long ret = bindings.FundingInfo_write(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Read a FundingInfo from a byte array, created by FundingInfo_write + */ + public static Result_FundingInfoDecodeErrorZ read(byte[] ser) { + long ret = bindings.FundingInfo_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_FundingInfoDecodeErrorZ ret_hu_conv = Result_FundingInfoDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/FundingSigned.cs b/c_sharp/src/org/ldk/structs/FundingSigned.cs index 8ca3f344..1e318e2e 100644 --- a/c_sharp/src/org/ldk/structs/FundingSigned.cs +++ b/c_sharp/src/org/ldk/structs/FundingSigned.cs @@ -38,7 +38,6 @@ public class FundingSigned : CommonBase { bindings.FundingSigned_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -71,7 +70,6 @@ public class FundingSigned : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/GraphSyncError.cs b/c_sharp/src/org/ldk/structs/GraphSyncError.cs index 2aadea96..7a5b7c0e 100644 --- a/c_sharp/src/org/ldk/structs/GraphSyncError.cs +++ b/c_sharp/src/org/ldk/structs/GraphSyncError.cs @@ -71,7 +71,6 @@ public class GraphSyncError : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.GraphSyncError ret_hu_conv = org.ldk.structs.GraphSyncError.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; } @@ -84,7 +83,6 @@ public class GraphSyncError : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.GraphSyncError ret_hu_conv = org.ldk.structs.GraphSyncError.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; } diff --git a/c_sharp/src/org/ldk/structs/HTLCDescriptor.cs b/c_sharp/src/org/ldk/structs/HTLCDescriptor.cs index 0197978e..629d11f0 100644 --- a/c_sharp/src/org/ldk/structs/HTLCDescriptor.cs +++ b/c_sharp/src/org/ldk/structs/HTLCDescriptor.cs @@ -34,7 +34,6 @@ public class HTLCDescriptor : CommonBase { bindings.HTLCDescriptor_set_channel_derivation_parameters(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -144,7 +143,6 @@ public class HTLCDescriptor : CommonBase { bindings.HTLCDescriptor_set_htlc(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -168,7 +166,6 @@ public class HTLCDescriptor : CommonBase { bindings.HTLCDescriptor_set_preimage(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -207,9 +204,6 @@ public class HTLCDescriptor : CommonBase { 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; } @@ -347,12 +341,12 @@ public class HTLCDescriptor : CommonBase { /** * Derives the channel signer required to sign the HTLC input. */ - public WriteableEcdsaChannelSigner derive_channel_signer(org.ldk.structs.SignerProvider signer_provider) { + public EcdsaChannelSigner derive_channel_signer(org.ldk.structs.SignerProvider signer_provider) { long ret = bindings.HTLCDescriptor_derive_channel_signer(this.ptr, signer_provider.ptr); GC.KeepAlive(this); GC.KeepAlive(signer_provider); if (ret >= 0 && ret <= 4096) { return null; } - WriteableEcdsaChannelSigner ret_hu_conv = new WriteableEcdsaChannelSigner(null, ret); + EcdsaChannelSigner ret_hu_conv = new EcdsaChannelSigner(null, ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; if (this != null) { this.ptrs_to.AddLast(signer_provider); }; return ret_hu_conv; diff --git a/c_sharp/src/org/ldk/structs/HTLCDestination.cs b/c_sharp/src/org/ldk/structs/HTLCDestination.cs index 256ad5c3..ffa3d95c 100644 --- a/c_sharp/src/org/ldk/structs/HTLCDestination.cs +++ b/c_sharp/src/org/ldk/structs/HTLCDestination.cs @@ -116,7 +116,6 @@ public class HTLCDestination : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/HTLCOutputInCommitment.cs b/c_sharp/src/org/ldk/structs/HTLCOutputInCommitment.cs index e2866c4e..2cade7de 100644 --- a/c_sharp/src/org/ldk/structs/HTLCOutputInCommitment.cs +++ b/c_sharp/src/org/ldk/structs/HTLCOutputInCommitment.cs @@ -120,7 +120,6 @@ public class HTLCOutputInCommitment : CommonBase { bindings.HTLCOutputInCommitment_set_transaction_output_index(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -136,7 +135,6 @@ public class HTLCOutputInCommitment : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.HTLCOutputInCommitment ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.HTLCOutputInCommitment(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(transaction_output_index_arg); }; return ret_hu_conv; } @@ -175,6 +173,17 @@ public class HTLCOutputInCommitment : CommonBase { if (!(o is HTLCOutputInCommitment)) return false; return this.eq((HTLCOutputInCommitment)o); } + /** + * Converts HTLC's value with millisatoshi precision into [bitcoin::Amount] with satoshi precision. + * Typically this conversion is needed when transitioning from LN into base-layer Bitcoin, + * e. g. in commitment transactions. + */ + public long to_bitcoin_amount() { + long ret = bindings.HTLCOutputInCommitment_to_bitcoin_amount(this.ptr); + GC.KeepAlive(this); + return ret; + } + /** * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read */ diff --git a/c_sharp/src/org/ldk/structs/HeldHtlcAvailable.cs b/c_sharp/src/org/ldk/structs/HeldHtlcAvailable.cs new file mode 100644 index 00000000..7488b81a --- /dev/null +++ b/c_sharp/src/org/ldk/structs/HeldHtlcAvailable.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 { + + +/** + * An HTLC destined for the recipient of this message is being held upstream. The reply path + * accompanying this onion message should be used to send a [`ReleaseHeldHtlc`] response, which + * will cause the upstream HTLC to be released. + */ +public class HeldHtlcAvailable : CommonBase { + internal HeldHtlcAvailable(object _dummy, long ptr) : base(ptr) { } + ~HeldHtlcAvailable() { + if (ptr != 0) { bindings.HeldHtlcAvailable_free(ptr); } + } + + /** + * The secret that will be used by the recipient of this message to release the held HTLC. + */ + public byte[] get_payment_release_secret() { + long ret = bindings.HeldHtlcAvailable_get_payment_release_secret(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * The secret that will be used by the recipient of this message to release the held HTLC. + */ + public void set_payment_release_secret(byte[] val) { + bindings.HeldHtlcAvailable_set_payment_release_secret(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Constructs a new HeldHtlcAvailable given each field + */ + public static HeldHtlcAvailable of(byte[] payment_release_secret_arg) { + long ret = bindings.HeldHtlcAvailable_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_release_secret_arg, 32))); + GC.KeepAlive(payment_release_secret_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.HeldHtlcAvailable ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.HeldHtlcAvailable(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.HeldHtlcAvailable_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the HeldHtlcAvailable + */ + public HeldHtlcAvailable clone() { + long ret = bindings.HeldHtlcAvailable_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.HeldHtlcAvailable ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.HeldHtlcAvailable(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Serialize the HeldHtlcAvailable object into a byte array which can be read by HeldHtlcAvailable_read + */ + public byte[] write() { + long ret = bindings.HeldHtlcAvailable_write(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Read a HeldHtlcAvailable from a byte array, created by HeldHtlcAvailable_write + */ + public static Result_HeldHtlcAvailableDecodeErrorZ read(byte[] ser) { + long ret = bindings.HeldHtlcAvailable_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_HeldHtlcAvailableDecodeErrorZ ret_hu_conv = Result_HeldHtlcAvailableDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/HolderCommitmentTransaction.cs b/c_sharp/src/org/ldk/structs/HolderCommitmentTransaction.cs index d7fdec8f..1a3f1ef4 100644 --- a/c_sharp/src/org/ldk/structs/HolderCommitmentTransaction.cs +++ b/c_sharp/src/org/ldk/structs/HolderCommitmentTransaction.cs @@ -120,7 +120,6 @@ public class HolderCommitmentTransaction : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.HolderCommitmentTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.HolderCommitmentTransaction(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(commitment_tx); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/HtlcKey.cs b/c_sharp/src/org/ldk/structs/HtlcKey.cs index 5e1d4545..6ed4de16 100644 --- a/c_sharp/src/org/ldk/structs/HtlcKey.cs +++ b/c_sharp/src/org/ldk/structs/HtlcKey.cs @@ -14,7 +14,7 @@ namespace org { namespace ldk { namespace structs { * Thus, both channel counterparties' HTLC keys will appears in each HTLC output's script. * * [See the BOLT specs] - * (https://github.com/lightning/bolts/blob/master/03-transactions.md#localpubkey-local_htlcpubkey-remote_htlcpubkey-local_delayedpubkey-and-remote_delayedpubkey-derivation) + * * for more information on key derivation details. */ public class HtlcKey : CommonBase { diff --git a/c_sharp/src/org/ldk/structs/IgnoringMessageHandler.cs b/c_sharp/src/org/ldk/structs/IgnoringMessageHandler.cs index 4b9d0662..99bde4a3 100644 --- a/c_sharp/src/org/ldk/structs/IgnoringMessageHandler.cs +++ b/c_sharp/src/org/ldk/structs/IgnoringMessageHandler.cs @@ -27,19 +27,6 @@ public class IgnoringMessageHandler : CommonBase { return ret_hu_conv; } - /** - * Constructs a new EventsProvider which calls the relevant methods on this_arg. - * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is - */ - public EventsProvider as_EventsProvider() { - long ret = bindings.IgnoringMessageHandler_as_EventsProvider(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - EventsProvider ret_hu_conv = new EventsProvider(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - /** * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg. * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is @@ -92,6 +79,19 @@ public class IgnoringMessageHandler : CommonBase { return ret_hu_conv; } + /** + * Constructs a new AsyncPaymentsMessageHandler which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned AsyncPaymentsMessageHandler must be freed before this_arg is + */ + public AsyncPaymentsMessageHandler as_AsyncPaymentsMessageHandler() { + long ret = bindings.IgnoringMessageHandler_as_AsyncPaymentsMessageHandler(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + AsyncPaymentsMessageHandler ret_hu_conv = new AsyncPaymentsMessageHandler(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + /** * Constructs a new CustomOnionMessageHandler which calls the relevant methods on this_arg. * This copies the `inner` pointer in this_arg and thus the returned CustomOnionMessageHandler must be freed before this_arg is diff --git a/c_sharp/src/org/ldk/structs/InMemorySigner.cs b/c_sharp/src/org/ldk/structs/InMemorySigner.cs index c6fdea4a..1e0f31a4 100644 --- a/c_sharp/src/org/ldk/structs/InMemorySigner.cs +++ b/c_sharp/src/org/ldk/structs/InMemorySigner.cs @@ -7,7 +7,7 @@ namespace org { namespace ldk { namespace structs { /** - * A simple implementation of [`WriteableEcdsaChannelSigner`] that just keeps the private keys in memory. + * A simple implementation of [`EcdsaChannelSigner`] that just keeps the private keys in memory. * * This implementation performs no policy checks and is insufficient by itself as * a secure external signer. @@ -382,19 +382,6 @@ public class InMemorySigner : CommonBase { return ret_hu_conv; } - /** - * Constructs a new WriteableEcdsaChannelSigner which calls the relevant methods on this_arg. - * This copies the `inner` pointer in this_arg and thus the returned WriteableEcdsaChannelSigner must be freed before this_arg is - */ - public WriteableEcdsaChannelSigner as_WriteableEcdsaChannelSigner() { - long ret = bindings.InMemorySigner_as_WriteableEcdsaChannelSigner(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - WriteableEcdsaChannelSigner ret_hu_conv = new WriteableEcdsaChannelSigner(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - /** * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read */ diff --git a/c_sharp/src/org/ldk/structs/InboundHTLCDetails.cs b/c_sharp/src/org/ldk/structs/InboundHTLCDetails.cs index fd089bff..371e4387 100644 --- a/c_sharp/src/org/ldk/structs/InboundHTLCDetails.cs +++ b/c_sharp/src/org/ldk/structs/InboundHTLCDetails.cs @@ -130,7 +130,6 @@ public class InboundHTLCDetails : CommonBase { bindings.InboundHTLCDetails_set_state(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -185,7 +184,6 @@ public class InboundHTLCDetails : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.InboundHTLCDetails ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InboundHTLCDetails(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(state_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Init.cs b/c_sharp/src/org/ldk/structs/Init.cs index d65f1b0e..32282996 100644 --- a/c_sharp/src/org/ldk/structs/Init.cs +++ b/c_sharp/src/org/ldk/structs/Init.cs @@ -36,7 +36,6 @@ public class Init : CommonBase { bindings.Init_set_features(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -64,7 +63,6 @@ public class Init : CommonBase { bindings.Init_set_networks(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -96,7 +94,6 @@ public class Init : CommonBase { bindings.Init_set_remote_network_address(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -110,9 +107,6 @@ public class Init : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Init ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Init(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(networks_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(remote_network_address_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/InitFeatures.cs b/c_sharp/src/org/ldk/structs/InitFeatures.cs index 2b5d514c..ea98e4ec 100644 --- a/c_sharp/src/org/ldk/structs/InitFeatures.cs +++ b/c_sharp/src/org/ldk/structs/InitFeatures.cs @@ -15,6 +15,28 @@ public class InitFeatures : CommonBase { if (ptr != 0) { bindings.InitFeatures_free(ptr); } } + /** + * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read + */ + public byte[] write() { + long ret = bindings.InitFeatures_write(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Read a InitFeatures from a byte array, created by InitFeatures_write + */ + public static Result_InitFeaturesDecodeErrorZ read(byte[] ser) { + long ret = bindings.InitFeatures_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InitFeaturesDecodeErrorZ ret_hu_conv = Result_InitFeaturesDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + /** * Checks if two InitFeaturess contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. @@ -73,6 +95,27 @@ public class InitFeatures : CommonBase { return ret_hu_conv; } + /** + * Returns the feature set as a list of bytes, in little-endian. This is in reverse byte order + * from most on-the-wire encodings. + */ + public byte[] le_flags() { + long ret = bindings.InitFeatures_le_flags(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Returns true if this `Features` has any optional flags set + */ + public bool supports_any_optional_bits() { + bool ret = bindings.InitFeatures_supports_any_optional_bits(this.ptr); + GC.KeepAlive(this); + return ret; + } + /** * Returns true if this `Features` object contains required features unknown by `other`. */ @@ -84,6 +127,19 @@ public class InitFeatures : CommonBase { return ret; } + /** + * Returns the set of required features unknown by `other`, as their bit position. + */ + public long[] required_unknown_bits_from(org.ldk.structs.InitFeatures other) { + long ret = bindings.InitFeatures_required_unknown_bits_from(this.ptr, other.ptr); + GC.KeepAlive(this); + GC.KeepAlive(other); + if (ret >= 0 && ret <= 4096) { return null; } + long[] ret_conv = InternalUtils.decodeUint64Array(ret); + if (this != null) { this.ptrs_to.AddLast(other); }; + return ret_conv; + } + /** * Returns true if this `Features` object contains unknown feature flags which are set as * \"required\". @@ -94,6 +150,15 @@ public class InitFeatures : CommonBase { return ret; } + /** + * Returns true if this `Features` supports any bits which we do not know of + */ + public bool supports_unknown_bits() { + bool ret = bindings.InitFeatures_supports_unknown_bits(this.ptr); + GC.KeepAlive(this); + return ret; + } + /** * Sets a required feature bit. Errors if `bit` is outside the feature range as defined * by [BOLT 9]. @@ -167,27 +232,68 @@ public class InitFeatures : CommonBase { } /** - * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read + * Unsets the `upfront_shutdown_script` feature */ - public byte[] write() { - long ret = bindings.InitFeatures_write(this.ptr); + public InitFeatures clear_upfront_shutdown_script() { + long ret = bindings.InitFeatures_clear_upfront_shutdown_script(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + 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; } /** - * Read a InitFeatures from a byte array, created by InitFeatures_write + * Unsets the `shutdown_anysegwit` feature */ - public static Result_InitFeaturesDecodeErrorZ read(byte[] ser) { - long ret = bindings.InitFeatures_read(InternalUtils.encodeUint8Array(ser)); - GC.KeepAlive(ser); + public InitFeatures clear_shutdown_anysegwit() { + long ret = bindings.InitFeatures_clear_shutdown_anysegwit(this.ptr); + GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - Result_InitFeaturesDecodeErrorZ ret_hu_conv = Result_InitFeaturesDecodeErrorZ.constr_from_ptr(ret); + 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; } + /** + * Unsets the `wumbo` feature + */ + public InitFeatures clear_wumbo() { + long ret = bindings.InitFeatures_clear_wumbo(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; + } + + /** + * Unsets the `scid_privacy` feature + */ + public void clear_scid_privacy() { + bindings.InitFeatures_clear_scid_privacy(this.ptr); + GC.KeepAlive(this); + } + + /** + * Unsets the `anchors_zero_fee_htlc_tx` feature + */ + public void clear_anchors_zero_fee_htlc_tx() { + bindings.InitFeatures_clear_anchors_zero_fee_htlc_tx(this.ptr); + GC.KeepAlive(this); + } + + /** + * Unsets the `route_blinding` feature + */ + public void clear_route_blinding() { + bindings.InitFeatures_clear_route_blinding(this.ptr); + GC.KeepAlive(this); + } + /** * Set this feature as optional. */ diff --git a/c_sharp/src/org/ldk/structs/Input.cs b/c_sharp/src/org/ldk/structs/Input.cs index f3436002..072075b1 100644 --- a/c_sharp/src/org/ldk/structs/Input.cs +++ b/c_sharp/src/org/ldk/structs/Input.cs @@ -36,7 +36,6 @@ public class Input : CommonBase { bindings.Input_set_outpoint(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -92,7 +91,6 @@ public class Input : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Input ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Input(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); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/IntroductionNode.cs b/c_sharp/src/org/ldk/structs/IntroductionNode.cs index 7e1dee9d..ddf28dda 100644 --- a/c_sharp/src/org/ldk/structs/IntroductionNode.cs +++ b/c_sharp/src/org/ldk/structs/IntroductionNode.cs @@ -6,7 +6,7 @@ using System; namespace org { namespace ldk { namespace structs { /** - * The unblinded node in a [`BlindedPath`]. + * The unblinded node in a blinded path. */ public class IntroductionNode : CommonBase { protected IntroductionNode(object _dummy, long ptr) : base(ptr) { } diff --git a/c_sharp/src/org/ldk/structs/InvoiceError.cs b/c_sharp/src/org/ldk/structs/InvoiceError.cs index 78194b68..05340a24 100644 --- a/c_sharp/src/org/ldk/structs/InvoiceError.cs +++ b/c_sharp/src/org/ldk/structs/InvoiceError.cs @@ -47,7 +47,6 @@ public class InvoiceError : CommonBase { bindings.InvoiceError_set_erroneous_field(this.ptr, val == null ? 0 : val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -69,7 +68,6 @@ public class InvoiceError : CommonBase { bindings.InvoiceError_set_message(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -84,8 +82,6 @@ public class InvoiceError : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.InvoiceError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceError(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(erroneous_field_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(message_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/InvoiceRequest.cs b/c_sharp/src/org/ldk/structs/InvoiceRequest.cs index f84df903..91e5b16c 100644 --- a/c_sharp/src/org/ldk/structs/InvoiceRequest.cs +++ b/c_sharp/src/org/ldk/structs/InvoiceRequest.cs @@ -144,20 +144,20 @@ public class InvoiceRequest : CommonBase { * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide * recipient privacy by obfuscating its node id. */ - public BlindedPath[] paths() { + public BlindedMessagePath[] paths() { long ret = bindings.InvoiceRequest_paths(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - int ret_conv_13_len = InternalUtils.getArrayLength(ret); - BlindedPath[] ret_conv_13_arr = new BlindedPath[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.BlindedPath ret_conv_13_hu_conv = null; if (ret_conv_13 < 0 || ret_conv_13 > 4096) { ret_conv_13_hu_conv = new org.ldk.structs.BlindedPath(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; + int ret_conv_20_len = InternalUtils.getArrayLength(ret); + BlindedMessagePath[] ret_conv_20_arr = new BlindedMessagePath[ret_conv_20_len]; + for (int u = 0; u < ret_conv_20_len; u++) { + long ret_conv_20 = InternalUtils.getU64ArrayElem(ret, u); + org.ldk.structs.BlindedMessagePath ret_conv_20_hu_conv = null; if (ret_conv_20 < 0 || ret_conv_20 > 4096) { ret_conv_20_hu_conv = new org.ldk.structs.BlindedMessagePath(null, ret_conv_20); } + if (ret_conv_20_hu_conv != null) { ret_conv_20_hu_conv.ptrs_to.AddLast(this); }; + ret_conv_20_arr[u] = ret_conv_20_hu_conv; } bindings.free_buffer(ret); - return ret_conv_13_arr; + return ret_conv_20_arr; } /** @@ -284,8 +284,8 @@ public class InvoiceRequest : CommonBase { * * [`Duration`]: core::time::Duration */ - 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))); + public Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ respond_with(BlindedPaymentPath[] payment_paths, byte[] payment_hash) { + long ret = bindings.InvoiceRequest_respond_with(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(payment_paths, payment_paths_conv_20 => payment_paths_conv_20.ptr)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32))); GC.KeepAlive(this); GC.KeepAlive(payment_paths); GC.KeepAlive(payment_hash); @@ -314,13 +314,15 @@ public class InvoiceRequest : CommonBase { * # Note * * If the originating [`Offer`] was created using [`OfferBuilder::deriving_signing_pubkey`], - * then use [`InvoiceRequest::verify`] and [`VerifiedInvoiceRequest`] methods instead. + * then first use [`InvoiceRequest::verify_using_metadata`] or + * [`InvoiceRequest::verify_using_recipient_data`] and then [`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); + public Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ respond_with_no_std(BlindedPaymentPath[] 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_20 => payment_paths_conv_20.ptr)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32)), created_at); GC.KeepAlive(this); GC.KeepAlive(payment_paths); GC.KeepAlive(payment_hash); @@ -331,20 +333,43 @@ public class InvoiceRequest : CommonBase { } /** - * Verifies that the request was for an offer created using the given key. Returns the verified - * request which contains the derived keys needed to sign a [`Bolt12Invoice`] for the request - * if they could be extracted from the metadata. + * Verifies that the request was for an offer created using the given key by checking the + * metadata from the offer. + * + * Returns the verified request which contains the derived keys needed to sign a + * [`Bolt12Invoice`] for the request if they could be extracted from the metadata. + * + * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice + */ + public Result_VerifiedInvoiceRequestNoneZ verify_using_metadata(org.ldk.structs.ExpandedKey key) { + long ret = bindings.InvoiceRequest_verify_using_metadata(this.ptr, key.ptr); + GC.KeepAlive(this); + GC.KeepAlive(key); + if (ret >= 0 && ret <= 4096) { return null; } + Result_VerifiedInvoiceRequestNoneZ ret_hu_conv = Result_VerifiedInvoiceRequestNoneZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(key); }; + ; + return ret_hu_conv; + } + + /** + * Verifies that the request was for an offer created using the given key by checking a nonce + * included with the [`BlindedMessagePath`] for which the request was sent through. + * + * Returns the verified request which contains the derived keys needed to sign a + * [`Bolt12Invoice`] for the request if they could be extracted from the metadata. * * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice */ - public Result_VerifiedInvoiceRequestNoneZ verify(org.ldk.structs.ExpandedKey key) { - long ret = bindings.InvoiceRequest_verify(this.ptr, key.ptr); + public Result_VerifiedInvoiceRequestNoneZ verify_using_recipient_data(org.ldk.structs.Nonce nonce, org.ldk.structs.ExpandedKey key) { + long ret = bindings.InvoiceRequest_verify_using_recipient_data(this.ptr, nonce.ptr, key.ptr); GC.KeepAlive(this); + GC.KeepAlive(nonce); GC.KeepAlive(key); if (ret >= 0 && ret <= 4096) { return null; } Result_VerifiedInvoiceRequestNoneZ ret_hu_conv = Result_VerifiedInvoiceRequestNoneZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.AddLast(key); }; - if (this != null) { this.ptrs_to.AddLast(this); }; + ; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/InvoiceRequestFeatures.cs b/c_sharp/src/org/ldk/structs/InvoiceRequestFeatures.cs index 6a80ee02..9a8eb2fb 100644 --- a/c_sharp/src/org/ldk/structs/InvoiceRequestFeatures.cs +++ b/c_sharp/src/org/ldk/structs/InvoiceRequestFeatures.cs @@ -73,6 +73,27 @@ public class InvoiceRequestFeatures : CommonBase { return ret_hu_conv; } + /** + * Returns the feature set as a list of bytes, in little-endian. This is in reverse byte order + * from most on-the-wire encodings. + */ + public byte[] le_flags() { + long ret = bindings.InvoiceRequestFeatures_le_flags(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Returns true if this `Features` has any optional flags set + */ + public bool supports_any_optional_bits() { + bool ret = bindings.InvoiceRequestFeatures_supports_any_optional_bits(this.ptr); + GC.KeepAlive(this); + return ret; + } + /** * Returns true if this `Features` object contains required features unknown by `other`. */ @@ -84,6 +105,19 @@ public class InvoiceRequestFeatures : CommonBase { return ret; } + /** + * Returns the set of required features unknown by `other`, as their bit position. + */ + public long[] required_unknown_bits_from(org.ldk.structs.InvoiceRequestFeatures other) { + long ret = bindings.InvoiceRequestFeatures_required_unknown_bits_from(this.ptr, other.ptr); + GC.KeepAlive(this); + GC.KeepAlive(other); + if (ret >= 0 && ret <= 4096) { return null; } + long[] ret_conv = InternalUtils.decodeUint64Array(ret); + if (this != null) { this.ptrs_to.AddLast(other); }; + return ret_conv; + } + /** * Returns true if this `Features` object contains unknown feature flags which are set as * \"required\". @@ -94,6 +128,15 @@ public class InvoiceRequestFeatures : CommonBase { return ret; } + /** + * Returns true if this `Features` supports any bits which we do not know of + */ + public bool supports_unknown_bits() { + bool ret = bindings.InvoiceRequestFeatures_supports_unknown_bits(this.ptr); + GC.KeepAlive(this); + return ret; + } + /** * Sets a required feature bit. Errors if `bit` is outside the feature range as defined * by [BOLT 9]. diff --git a/c_sharp/src/org/ldk/structs/InvoiceRequestFields.cs b/c_sharp/src/org/ldk/structs/InvoiceRequestFields.cs index 15f21c11..16cd5dfe 100644 --- a/c_sharp/src/org/ldk/structs/InvoiceRequestFields.cs +++ b/c_sharp/src/org/ldk/structs/InvoiceRequestFields.cs @@ -56,7 +56,6 @@ public class InvoiceRequestFields : CommonBase { bindings.InvoiceRequestFields_set_quantity(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -84,7 +83,6 @@ public class InvoiceRequestFields : CommonBase { 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); }; } /** @@ -100,8 +98,6 @@ public class InvoiceRequestFields : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/InvoiceWithDerivedSigningPubkeyBuilder.cs b/c_sharp/src/org/ldk/structs/InvoiceWithDerivedSigningPubkeyBuilder.cs index a5c5da4c..f114c567 100644 --- a/c_sharp/src/org/ldk/structs/InvoiceWithDerivedSigningPubkeyBuilder.cs +++ b/c_sharp/src/org/ldk/structs/InvoiceWithDerivedSigningPubkeyBuilder.cs @@ -44,7 +44,8 @@ public class InvoiceWithDerivedSigningPubkeyBuilder : CommonBase { } /** - * Sets the [`Bolt12Invoice::relative_expiry`] as seconds since [`Bolt12Invoice::created_at`]. + * 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`]. * @@ -129,8 +130,8 @@ public class InvoiceWithDerivedSigningPubkeyBuilder : CommonBase { } /** - * Sets [`Bolt12Invoice::invoice_features`] to indicate MPP may be used. Otherwise, MPP is - * disallowed. + * Sets [`Bolt12Invoice::invoice_features`] + * to indicate MPP may be used. Otherwise, MPP is disallowed. */ public void allow_mpp() { bindings.InvoiceWithDerivedSigningPubkeyBuilder_allow_mpp(this.ptr); diff --git a/c_sharp/src/org/ldk/structs/InvoiceWithExplicitSigningPubkeyBuilder.cs b/c_sharp/src/org/ldk/structs/InvoiceWithExplicitSigningPubkeyBuilder.cs index 6bfb8c74..d0044453 100644 --- a/c_sharp/src/org/ldk/structs/InvoiceWithExplicitSigningPubkeyBuilder.cs +++ b/c_sharp/src/org/ldk/structs/InvoiceWithExplicitSigningPubkeyBuilder.cs @@ -45,7 +45,8 @@ public class InvoiceWithExplicitSigningPubkeyBuilder : CommonBase { } /** - * Sets the [`Bolt12Invoice::relative_expiry`] as seconds since [`Bolt12Invoice::created_at`]. + * 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`]. * @@ -130,8 +131,8 @@ public class InvoiceWithExplicitSigningPubkeyBuilder : CommonBase { } /** - * Sets [`Bolt12Invoice::invoice_features`] to indicate MPP may be used. Otherwise, MPP is - * disallowed. + * Sets [`Bolt12Invoice::invoice_features`] + * to indicate MPP may be used. Otherwise, MPP is disallowed. */ public void allow_mpp() { bindings.InvoiceWithExplicitSigningPubkeyBuilder_allow_mpp(this.ptr); diff --git a/c_sharp/src/org/ldk/structs/KeysManager.cs b/c_sharp/src/org/ldk/structs/KeysManager.cs index 333c1de4..df1e2962 100644 --- a/c_sharp/src/org/ldk/structs/KeysManager.cs +++ b/c_sharp/src/org/ldk/structs/KeysManager.cs @@ -69,7 +69,7 @@ public class KeysManager : CommonBase { } /** - * Derive an old [`WriteableEcdsaChannelSigner`] containing per-channel secrets based on a key derivation parameters. + * Derive an old [`EcdsaChannelSigner`] containing per-channel secrets based on a key derivation parameters. */ public InMemorySigner derive_channel_keys(long channel_value_satoshis, byte[] _params) { long ret = bindings.KeysManager_derive_channel_keys(this.ptr, channel_value_satoshis, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(_params, 32))); @@ -83,7 +83,7 @@ public class KeysManager : CommonBase { } /** - * Signs the given [`PartiallySignedTransaction`] which spends the given [`SpendableOutputDescriptor`]s. + * Signs the given [`Psbt`] which spends the given [`SpendableOutputDescriptor`]s. * The resulting inputs will be finalized and the PSBT will be ready for broadcast if there * are no other inputs that need signing. * @@ -99,7 +99,6 @@ public class KeysManager : CommonBase { GC.KeepAlive(psbt); if (ret >= 0 && ret <= 4096) { return null; } Result_CVec_u8ZNoneZ ret_hu_conv = Result_CVec_u8ZNoneZ.constr_from_ptr(ret); - foreach (SpendableOutputDescriptor descriptors_conv_27 in descriptors) { if (this != null) { this.ptrs_to.AddLast(descriptors_conv_27); }; }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/LightningError.cs b/c_sharp/src/org/ldk/structs/LightningError.cs index b06f312f..e64c1310 100644 --- a/c_sharp/src/org/ldk/structs/LightningError.cs +++ b/c_sharp/src/org/ldk/structs/LightningError.cs @@ -54,7 +54,6 @@ public class LightningError : CommonBase { bindings.LightningError_set_action(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -67,7 +66,6 @@ public class LightningError : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.LightningError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.LightningError(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(action_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/MessageContext.cs b/c_sharp/src/org/ldk/structs/MessageContext.cs new file mode 100644 index 00000000..0f12e152 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/MessageContext.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 { + +/** + * Additional data included by the recipient in a [`BlindedMessagePath`]. + * + * This data is encrypted by the recipient and will be given to the corresponding message handler + * when handling a message sent over the [`BlindedMessagePath`]. The recipient can use this data to + * authenticate the message or for further processing if needed. + */ +public class MessageContext : CommonBase { + protected MessageContext(object _dummy, long ptr) : base(ptr) { } + ~MessageContext() { + if (ptr != 0) { bindings.MessageContext_free(ptr); } + } + + internal static MessageContext constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKMessageContext_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new MessageContext_Offers(ptr); + case 1: return new MessageContext_Custom(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A MessageContext of type Offers */ + public class MessageContext_Offers : MessageContext { + public OffersContext offers; + internal MessageContext_Offers(long ptr) : base(null, ptr) { + long offers = bindings.LDKMessageContext_Offers_get_offers(ptr); + org.ldk.structs.OffersContext offers_hu_conv = org.ldk.structs.OffersContext.constr_from_ptr(offers); + if (offers_hu_conv != null) { offers_hu_conv.ptrs_to.AddLast(this); }; + this.offers = offers_hu_conv; + } + } + /** A MessageContext of type Custom */ + public class MessageContext_Custom : MessageContext { + public byte[] custom; + internal MessageContext_Custom(long ptr) : base(null, ptr) { + long custom = bindings.LDKMessageContext_Custom_get_custom(ptr); + byte[] custom_conv = InternalUtils.decodeUint8Array(custom); + this.custom = custom_conv; + } + } + internal long clone_ptr() { + long ret = bindings.MessageContext_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the MessageContext + */ + public MessageContext clone() { + long ret = bindings.MessageContext_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageContext ret_hu_conv = org.ldk.structs.MessageContext.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 Offers-variant MessageContext + */ + public static MessageContext offers(org.ldk.structs.OffersContext a) { + long ret = bindings.MessageContext_offers(a.ptr); + GC.KeepAlive(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageContext ret_hu_conv = org.ldk.structs.MessageContext.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 Custom-variant MessageContext + */ + public static MessageContext custom(byte[] a) { + long ret = bindings.MessageContext_custom(InternalUtils.encodeUint8Array(a)); + GC.KeepAlive(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageContext ret_hu_conv = org.ldk.structs.MessageContext.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Serialize the MessageContext object into a byte array which can be read by MessageContext_read + */ + public byte[] write() { + long ret = bindings.MessageContext_write(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Read a MessageContext from a byte array, created by MessageContext_write + */ + public static Result_MessageContextDecodeErrorZ read(byte[] ser) { + long ret = bindings.MessageContext_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_MessageContextDecodeErrorZ ret_hu_conv = Result_MessageContextDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/MessageForwardNode.cs b/c_sharp/src/org/ldk/structs/MessageForwardNode.cs new file mode 100644 index 00000000..a9f22f8b --- /dev/null +++ b/c_sharp/src/org/ldk/structs/MessageForwardNode.cs @@ -0,0 +1,124 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * An intermediate node, and possibly a short channel id leading to the next node. + */ +public class MessageForwardNode : CommonBase { + internal MessageForwardNode(object _dummy, long ptr) : base(ptr) { } + ~MessageForwardNode() { + if (ptr != 0) { bindings.MessageForwardNode_free(ptr); } + } + + /** + * This node's pubkey. + */ + public byte[] get_node_id() { + long ret = bindings.MessageForwardNode_get_node_id(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * This node's pubkey. + */ + public void set_node_id(byte[] val) { + bindings.MessageForwardNode_set_node_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The channel between `node_id` and the next hop. If set, the constructed [`BlindedHop`]'s + * `encrypted_payload` will use this instead of the next [`MessageForwardNode::node_id`] for a + * more compact representation. + */ + public Option_u64Z get_short_channel_id() { + long ret = bindings.MessageForwardNode_get_short_channel_id(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 channel between `node_id` and the next hop. If set, the constructed [`BlindedHop`]'s + * `encrypted_payload` will use this instead of the next [`MessageForwardNode::node_id`] for a + * more compact representation. + */ + public void set_short_channel_id(org.ldk.structs.Option_u64Z val) { + bindings.MessageForwardNode_set_short_channel_id(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Constructs a new MessageForwardNode given each field + */ + public static MessageForwardNode of(byte[] node_id_arg, org.ldk.structs.Option_u64Z short_channel_id_arg) { + long ret = bindings.MessageForwardNode_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id_arg, 33)), short_channel_id_arg.ptr); + GC.KeepAlive(node_id_arg); + GC.KeepAlive(short_channel_id_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageForwardNode ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.MessageForwardNode(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.MessageForwardNode_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the MessageForwardNode + */ + public MessageForwardNode clone() { + long ret = bindings.MessageForwardNode_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageForwardNode ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.MessageForwardNode(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 MessageForwardNode. + */ + public long hash() { + long ret = bindings.MessageForwardNode_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + public override int GetHashCode() { + return (int)this.hash(); + } + /** + * Checks if two MessageForwardNodes 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.MessageForwardNode b) { + bool ret = bindings.MessageForwardNode_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 MessageForwardNode)) return false; + return this.eq((MessageForwardNode)o); + } +} +} } } diff --git a/c_sharp/src/org/ldk/structs/MessageRouter.cs b/c_sharp/src/org/ldk/structs/MessageRouter.cs index 28b3b20b..5043e516 100644 --- a/c_sharp/src/org/ldk/structs/MessageRouter.cs +++ b/c_sharp/src/org/ldk/structs/MessageRouter.cs @@ -13,10 +13,25 @@ public interface MessageRouterInterface { /**Returns a route for sending an [`OnionMessage`] to the given [`Destination`]. */ Result_OnionMessagePathNoneZ find_path(byte[] sender, byte[][] peers, Destination destination); - /**Creates [`BlindedPath`]s to the `recipient` node. The nodes in `peers` are assumed to be - * direct peers with the `recipient`. + /**Creates [`BlindedMessagePath`]s to the `recipient` node. The nodes in `peers` are assumed to + * be direct peers with the `recipient`. */ - Result_CVec_BlindedPathZNoneZ create_blinded_paths(byte[] recipient, byte[][] peers); + Result_CVec_BlindedMessagePathZNoneZ create_blinded_paths(byte[] recipient, MessageContext context, byte[][] peers); + /**Creates compact [`BlindedMessagePath`]s to the `recipient` node. The nodes in `peers` are + * assumed to be direct peers with the `recipient`. + * + * Compact blinded paths use short channel ids instead of pubkeys for a smaller serialization, + * which is beneficial when a QR code is used to transport the data. The SCID is passed using + * a [`MessageForwardNode`] but may be `None` for graceful degradation. + * + * Implementations using additional intermediate nodes are responsible for using a + * [`MessageForwardNode`] with `Some` short channel id, if possible. Similarly, implementations + * should call [`BlindedMessagePath::use_compact_introduction_node`]. + * + * The provided implementation simply delegates to [`MessageRouter::create_blinded_paths`], + * ignoring the short channel ids. + */ + Result_CVec_BlindedMessagePathZNoneZ create_compact_blinded_paths(byte[] recipient, MessageContext context, MessageForwardNode[] peers); } /** @@ -53,8 +68,10 @@ public class MessageRouter : CommonBase { long result = ret.clone_ptr(); return result; } - public long create_blinded_paths(long _recipient, long _peers) { + public long create_blinded_paths(long _recipient, long _context, long _peers) { byte[] _recipient_conv = InternalUtils.decodeUint8Array(_recipient); + org.ldk.structs.MessageContext _context_hu_conv = org.ldk.structs.MessageContext.constr_from_ptr(_context); + if (_context_hu_conv != null) { _context_hu_conv.ptrs_to.AddLast(this); }; int _peers_conv_8_len = InternalUtils.getArrayLength(_peers); byte[][] _peers_conv_8_arr = new byte[_peers_conv_8_len][]; for (int i = 0; i < _peers_conv_8_len; i++) { @@ -63,7 +80,25 @@ public class MessageRouter : CommonBase { _peers_conv_8_arr[i] = _peers_conv_8_conv; } bindings.free_buffer(_peers); - Result_CVec_BlindedPathZNoneZ ret = arg.create_blinded_paths(_recipient_conv, _peers_conv_8_arr); + Result_CVec_BlindedMessagePathZNoneZ ret = arg.create_blinded_paths(_recipient_conv, _context_hu_conv, _peers_conv_8_arr); + GC.KeepAlive(arg); + long result = ret.clone_ptr(); + return result; + } + public long create_compact_blinded_paths(long _recipient, long _context, long _peers) { + byte[] _recipient_conv = InternalUtils.decodeUint8Array(_recipient); + org.ldk.structs.MessageContext _context_hu_conv = org.ldk.structs.MessageContext.constr_from_ptr(_context); + if (_context_hu_conv != null) { _context_hu_conv.ptrs_to.AddLast(this); }; + int _peers_conv_20_len = InternalUtils.getArrayLength(_peers); + MessageForwardNode[] _peers_conv_20_arr = new MessageForwardNode[_peers_conv_20_len]; + for (int u = 0; u < _peers_conv_20_len; u++) { + long _peers_conv_20 = InternalUtils.getU64ArrayElem(_peers, u); + org.ldk.structs.MessageForwardNode _peers_conv_20_hu_conv = null; if (_peers_conv_20 < 0 || _peers_conv_20 > 4096) { _peers_conv_20_hu_conv = new org.ldk.structs.MessageForwardNode(null, _peers_conv_20); } + if (_peers_conv_20_hu_conv != null) { _peers_conv_20_hu_conv.ptrs_to.AddLast(this); }; + _peers_conv_20_arr[u] = _peers_conv_20_hu_conv; + } + bindings.free_buffer(_peers); + Result_CVec_BlindedMessagePathZNoneZ ret = arg.create_compact_blinded_paths(_recipient_conv, _context_hu_conv, _peers_conv_20_arr); GC.KeepAlive(arg); long result = ret.clone_ptr(); return result; @@ -93,21 +128,47 @@ public class MessageRouter : CommonBase { GC.KeepAlive(destination); if (ret >= 0 && ret <= 4096) { return null; } Result_OnionMessagePathNoneZ ret_hu_conv = Result_OnionMessagePathNoneZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(destination); }; return ret_hu_conv; } /** - * Creates [`BlindedPath`]s to the `recipient` node. The nodes in `peers` are assumed to be - * direct peers with the `recipient`. + * Creates [`BlindedMessagePath`]s to the `recipient` node. The nodes in `peers` are assumed to + * be direct peers with the `recipient`. + */ + public Result_CVec_BlindedMessagePathZNoneZ create_blinded_paths(byte[] recipient, org.ldk.structs.MessageContext context, byte[][] peers) { + long ret = bindings.MessageRouter_create_blinded_paths(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(recipient, 33)), context.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(peers, peers_conv_8 => InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(peers_conv_8, 33))))); + GC.KeepAlive(this); + GC.KeepAlive(recipient); + GC.KeepAlive(context); + GC.KeepAlive(peers); + if (ret >= 0 && ret <= 4096) { return null; } + Result_CVec_BlindedMessagePathZNoneZ ret_hu_conv = Result_CVec_BlindedMessagePathZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates compact [`BlindedMessagePath`]s to the `recipient` node. The nodes in `peers` are + * assumed to be direct peers with the `recipient`. + * + * Compact blinded paths use short channel ids instead of pubkeys for a smaller serialization, + * which is beneficial when a QR code is used to transport the data. The SCID is passed using + * a [`MessageForwardNode`] but may be `None` for graceful degradation. + * + * Implementations using additional intermediate nodes are responsible for using a + * [`MessageForwardNode`] with `Some` short channel id, if possible. Similarly, implementations + * should call [`BlindedMessagePath::use_compact_introduction_node`]. + * + * The provided implementation simply delegates to [`MessageRouter::create_blinded_paths`], + * ignoring the short channel ids. */ - public Result_CVec_BlindedPathZNoneZ create_blinded_paths(byte[] recipient, byte[][] peers) { - long ret = bindings.MessageRouter_create_blinded_paths(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(recipient, 33)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(peers, peers_conv_8 => InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(peers_conv_8, 33))))); + public Result_CVec_BlindedMessagePathZNoneZ create_compact_blinded_paths(byte[] recipient, org.ldk.structs.MessageContext context, MessageForwardNode[] peers) { + long ret = bindings.MessageRouter_create_compact_blinded_paths(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(recipient, 33)), context.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(peers, peers_conv_20 => peers_conv_20.ptr))); GC.KeepAlive(this); GC.KeepAlive(recipient); + GC.KeepAlive(context); GC.KeepAlive(peers); if (ret >= 0 && ret <= 4096) { return null; } - Result_CVec_BlindedPathZNoneZ ret_hu_conv = Result_CVec_BlindedPathZNoneZ.constr_from_ptr(ret); + Result_CVec_BlindedMessagePathZNoneZ ret_hu_conv = Result_CVec_BlindedMessagePathZNoneZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/MessageSendEvent.cs b/c_sharp/src/org/ldk/structs/MessageSendEvent.cs index 66b8c585..92503bca 100644 --- a/c_sharp/src/org/ldk/structs/MessageSendEvent.cs +++ b/c_sharp/src/org/ldk/structs/MessageSendEvent.cs @@ -26,7 +26,7 @@ public class MessageSendEvent : CommonBase { case 4: return new MessageSendEvent_SendFundingCreated(ptr); case 5: return new MessageSendEvent_SendFundingSigned(ptr); case 6: return new MessageSendEvent_SendStfu(ptr); - case 7: return new MessageSendEvent_SendSplice(ptr); + case 7: return new MessageSendEvent_SendSpliceInit(ptr); case 8: return new MessageSendEvent_SendSpliceAck(ptr); case 9: return new MessageSendEvent_SendSpliceLocked(ptr); case 10: return new MessageSendEvent_SendTxAddInput(ptr); @@ -200,8 +200,8 @@ public class MessageSendEvent : CommonBase { this.msg = msg_hu_conv; } } - /** A MessageSendEvent of type SendSplice */ - public class MessageSendEvent_SendSplice : MessageSendEvent { + /** A MessageSendEvent of type SendSpliceInit */ + public class MessageSendEvent_SendSpliceInit : MessageSendEvent { /** * The node_id of the node which should receive this message */ @@ -209,13 +209,13 @@ public class MessageSendEvent : CommonBase { /** * The message which should be sent. */ - public Splice msg; - internal MessageSendEvent_SendSplice(long ptr) : base(null, ptr) { - long node_id = bindings.LDKMessageSendEvent_SendSplice_get_node_id(ptr); + public SpliceInit msg; + internal MessageSendEvent_SendSpliceInit(long ptr) : base(null, ptr) { + long node_id = bindings.LDKMessageSendEvent_SendSpliceInit_get_node_id(ptr); byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id); this.node_id = node_id_conv; - long msg = bindings.LDKMessageSendEvent_SendSplice_get_msg(ptr); - org.ldk.structs.Splice msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.Splice(null, msg); } + long msg = bindings.LDKMessageSendEvent_SendSpliceInit_get_msg(ptr); + org.ldk.structs.SpliceInit msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.SpliceInit(null, msg); } if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); }; this.msg = msg_hu_conv; } @@ -805,7 +805,6 @@ public class MessageSendEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.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(msg); }; return ret_hu_conv; } @@ -819,7 +818,6 @@ public class MessageSendEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.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(msg); }; return ret_hu_conv; } @@ -833,7 +831,6 @@ public class MessageSendEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.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(msg); }; return ret_hu_conv; } @@ -847,7 +844,6 @@ public class MessageSendEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.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(msg); }; return ret_hu_conv; } @@ -861,7 +857,6 @@ public class MessageSendEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.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(msg); }; return ret_hu_conv; } @@ -875,7 +870,6 @@ public class MessageSendEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.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(msg); }; return ret_hu_conv; } @@ -889,21 +883,19 @@ public class MessageSendEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.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(msg); }; return ret_hu_conv; } /** - * Utility method to constructs a new SendSplice-variant MessageSendEvent + * Utility method to constructs a new SendSpliceInit-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.ptr); + public static MessageSendEvent send_splice_init(byte[] node_id, org.ldk.structs.SpliceInit msg) { + long ret = bindings.MessageSendEvent_send_splice_init(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; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.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(msg); }; return ret_hu_conv; } @@ -917,7 +909,6 @@ public class MessageSendEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.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(msg); }; return ret_hu_conv; } @@ -931,7 +922,6 @@ public class MessageSendEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.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(msg); }; return ret_hu_conv; } @@ -945,7 +935,6 @@ public class MessageSendEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.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(msg); }; return ret_hu_conv; } @@ -959,7 +948,6 @@ public class MessageSendEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.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(msg); }; return ret_hu_conv; } @@ -973,7 +961,6 @@ public class MessageSendEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.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(msg); }; return ret_hu_conv; } @@ -987,7 +974,6 @@ public class MessageSendEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.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(msg); }; return ret_hu_conv; } @@ -1001,7 +987,6 @@ public class MessageSendEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.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(msg); }; return ret_hu_conv; } @@ -1015,7 +1000,6 @@ public class MessageSendEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.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(msg); }; return ret_hu_conv; } @@ -1029,7 +1013,6 @@ public class MessageSendEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.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(msg); }; return ret_hu_conv; } @@ -1043,7 +1026,6 @@ public class MessageSendEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.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(msg); }; return ret_hu_conv; } @@ -1057,7 +1039,6 @@ public class MessageSendEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.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(msg); }; return ret_hu_conv; } @@ -1071,7 +1052,6 @@ public class MessageSendEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.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(msg); }; return ret_hu_conv; } @@ -1085,7 +1065,6 @@ public class MessageSendEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.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(msg); }; return ret_hu_conv; } @@ -1099,7 +1078,6 @@ public class MessageSendEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.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(updates); }; return ret_hu_conv; } @@ -1113,7 +1091,6 @@ public class MessageSendEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.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(msg); }; return ret_hu_conv; } @@ -1127,7 +1104,6 @@ public class MessageSendEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.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(msg); }; return ret_hu_conv; } @@ -1141,7 +1117,6 @@ public class MessageSendEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.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(msg); }; return ret_hu_conv; } @@ -1155,7 +1130,6 @@ public class MessageSendEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.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(msg); }; return ret_hu_conv; } @@ -1170,8 +1144,6 @@ public class MessageSendEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.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(msg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(update_msg); }; return ret_hu_conv; } @@ -1185,8 +1157,6 @@ public class MessageSendEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.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(msg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(update_msg); }; return ret_hu_conv; } @@ -1199,7 +1169,6 @@ public class MessageSendEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.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(msg); }; return ret_hu_conv; } @@ -1212,7 +1181,6 @@ public class MessageSendEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.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(msg); }; return ret_hu_conv; } @@ -1226,7 +1194,6 @@ public class MessageSendEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.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(msg); }; return ret_hu_conv; } @@ -1240,7 +1207,6 @@ public class MessageSendEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.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(action); }; return ret_hu_conv; } @@ -1254,7 +1220,6 @@ public class MessageSendEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.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(msg); }; return ret_hu_conv; } @@ -1268,7 +1233,6 @@ public class MessageSendEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.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(msg); }; return ret_hu_conv; } @@ -1282,7 +1246,6 @@ public class MessageSendEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.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(msg); }; return ret_hu_conv; } @@ -1296,7 +1259,6 @@ public class MessageSendEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.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(msg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/MessageSendEventsProvider.cs b/c_sharp/src/org/ldk/structs/MessageSendEventsProvider.cs index 5bb12c5b..6f40449a 100644 --- a/c_sharp/src/org/ldk/structs/MessageSendEventsProvider.cs +++ b/c_sharp/src/org/ldk/structs/MessageSendEventsProvider.cs @@ -37,7 +37,6 @@ public class MessageSendEventsProvider : CommonBase { 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.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/MessageSendInstructions.cs b/c_sharp/src/org/ldk/structs/MessageSendInstructions.cs new file mode 100644 index 00000000..f89de219 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/MessageSendInstructions.cs @@ -0,0 +1,167 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * Instructions for how and where to send a message. + */ +public class MessageSendInstructions : CommonBase { + protected MessageSendInstructions(object _dummy, long ptr) : base(ptr) { } + ~MessageSendInstructions() { + if (ptr != 0) { bindings.MessageSendInstructions_free(ptr); } + } + + internal static MessageSendInstructions constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKMessageSendInstructions_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new MessageSendInstructions_WithSpecifiedReplyPath(ptr); + case 1: return new MessageSendInstructions_WithReplyPath(ptr); + case 2: return new MessageSendInstructions_WithoutReplyPath(ptr); + case 3: return new MessageSendInstructions_ForReply(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A MessageSendInstructions of type WithSpecifiedReplyPath */ + public class MessageSendInstructions_WithSpecifiedReplyPath : MessageSendInstructions { + /** + * The destination where we need to send our message. + */ + public Destination destination; + /** + * The reply path which should be included in the message. + */ + public BlindedMessagePath reply_path; + internal MessageSendInstructions_WithSpecifiedReplyPath(long ptr) : base(null, ptr) { + long destination = bindings.LDKMessageSendInstructions_WithSpecifiedReplyPath_get_destination(ptr); + org.ldk.structs.Destination destination_hu_conv = org.ldk.structs.Destination.constr_from_ptr(destination); + if (destination_hu_conv != null) { destination_hu_conv.ptrs_to.AddLast(this); }; + this.destination = destination_hu_conv; + long reply_path = bindings.LDKMessageSendInstructions_WithSpecifiedReplyPath_get_reply_path(ptr); + org.ldk.structs.BlindedMessagePath reply_path_hu_conv = null; if (reply_path < 0 || reply_path > 4096) { reply_path_hu_conv = new org.ldk.structs.BlindedMessagePath(null, reply_path); } + if (reply_path_hu_conv != null) { reply_path_hu_conv.ptrs_to.AddLast(this); }; + this.reply_path = reply_path_hu_conv; + } + } + /** A MessageSendInstructions of type WithReplyPath */ + public class MessageSendInstructions_WithReplyPath : MessageSendInstructions { + /** + * The destination where we need to send our message. + */ + public Destination destination; + /** + * The context to include in the reply path we'll give the recipient so they can respond + * to us. + */ + public MessageContext context; + internal MessageSendInstructions_WithReplyPath(long ptr) : base(null, ptr) { + long destination = bindings.LDKMessageSendInstructions_WithReplyPath_get_destination(ptr); + org.ldk.structs.Destination destination_hu_conv = org.ldk.structs.Destination.constr_from_ptr(destination); + if (destination_hu_conv != null) { destination_hu_conv.ptrs_to.AddLast(this); }; + this.destination = destination_hu_conv; + long context = bindings.LDKMessageSendInstructions_WithReplyPath_get_context(ptr); + org.ldk.structs.MessageContext context_hu_conv = org.ldk.structs.MessageContext.constr_from_ptr(context); + if (context_hu_conv != null) { context_hu_conv.ptrs_to.AddLast(this); }; + this.context = context_hu_conv; + } + } + /** A MessageSendInstructions of type WithoutReplyPath */ + public class MessageSendInstructions_WithoutReplyPath : MessageSendInstructions { + /** + * The destination where we need to send our message. + */ + public Destination destination; + internal MessageSendInstructions_WithoutReplyPath(long ptr) : base(null, ptr) { + long destination = bindings.LDKMessageSendInstructions_WithoutReplyPath_get_destination(ptr); + org.ldk.structs.Destination destination_hu_conv = org.ldk.structs.Destination.constr_from_ptr(destination); + if (destination_hu_conv != null) { destination_hu_conv.ptrs_to.AddLast(this); }; + this.destination = destination_hu_conv; + } + } + /** A MessageSendInstructions of type ForReply */ + public class MessageSendInstructions_ForReply : MessageSendInstructions { + /** + * The instructions provided by the [`Responder`]. + */ + public ResponseInstruction instructions; + internal MessageSendInstructions_ForReply(long ptr) : base(null, ptr) { + long instructions = bindings.LDKMessageSendInstructions_ForReply_get_instructions(ptr); + org.ldk.structs.ResponseInstruction instructions_hu_conv = null; if (instructions < 0 || instructions > 4096) { instructions_hu_conv = new org.ldk.structs.ResponseInstruction(null, instructions); } + if (instructions_hu_conv != null) { instructions_hu_conv.ptrs_to.AddLast(this); }; + this.instructions = instructions_hu_conv; + } + } + internal long clone_ptr() { + long ret = bindings.MessageSendInstructions_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the MessageSendInstructions + */ + public MessageSendInstructions clone() { + long ret = bindings.MessageSendInstructions_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageSendInstructions ret_hu_conv = org.ldk.structs.MessageSendInstructions.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 WithSpecifiedReplyPath-variant MessageSendInstructions + */ + public static MessageSendInstructions with_specified_reply_path(org.ldk.structs.Destination destination, org.ldk.structs.BlindedMessagePath reply_path) { + long ret = bindings.MessageSendInstructions_with_specified_reply_path(destination.ptr, reply_path.ptr); + GC.KeepAlive(destination); + GC.KeepAlive(reply_path); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageSendInstructions ret_hu_conv = org.ldk.structs.MessageSendInstructions.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 WithReplyPath-variant MessageSendInstructions + */ + public static MessageSendInstructions with_reply_path(org.ldk.structs.Destination destination, org.ldk.structs.MessageContext context) { + long ret = bindings.MessageSendInstructions_with_reply_path(destination.ptr, context.ptr); + GC.KeepAlive(destination); + GC.KeepAlive(context); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageSendInstructions ret_hu_conv = org.ldk.structs.MessageSendInstructions.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 WithoutReplyPath-variant MessageSendInstructions + */ + public static MessageSendInstructions without_reply_path(org.ldk.structs.Destination destination) { + long ret = bindings.MessageSendInstructions_without_reply_path(destination.ptr); + GC.KeepAlive(destination); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageSendInstructions ret_hu_conv = org.ldk.structs.MessageSendInstructions.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 ForReply-variant MessageSendInstructions + */ + public static MessageSendInstructions for_reply(org.ldk.structs.ResponseInstruction instructions) { + long ret = bindings.MessageSendInstructions_for_reply(instructions.ptr); + GC.KeepAlive(instructions); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageSendInstructions ret_hu_conv = org.ldk.structs.MessageSendInstructions.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/MonitorEvent.cs b/c_sharp/src/org/ldk/structs/MonitorEvent.cs index dc163a41..0d81439e 100644 --- a/c_sharp/src/org/ldk/structs/MonitorEvent.cs +++ b/c_sharp/src/org/ldk/structs/MonitorEvent.cs @@ -132,7 +132,6 @@ public class MonitorEvent : CommonBase { 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(a); }; return ret_hu_conv; } @@ -147,9 +146,6 @@ public class MonitorEvent : CommonBase { 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; } @@ -162,7 +158,6 @@ public class MonitorEvent : CommonBase { 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(a); }; return ret_hu_conv; } @@ -177,8 +172,6 @@ public class MonitorEvent : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/MonitorUpdateId.cs b/c_sharp/src/org/ldk/structs/MonitorUpdateId.cs deleted file mode 100644 index ec125837..00000000 --- a/c_sharp/src/org/ldk/structs/MonitorUpdateId.cs +++ /dev/null @@ -1,66 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - - -/** - * An opaque identifier describing a specific [`Persist`] method call. - */ -public class MonitorUpdateId : CommonBase { - internal MonitorUpdateId(object _dummy, long ptr) : base(ptr) { } - ~MonitorUpdateId() { - if (ptr != 0) { bindings.MonitorUpdateId_free(ptr); } - } - - internal long clone_ptr() { - long ret = bindings.MonitorUpdateId_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a copy of the MonitorUpdateId - */ - public MonitorUpdateId clone() { - long ret = bindings.MonitorUpdateId_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.MonitorUpdateId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.MonitorUpdateId(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 MonitorUpdateId. - */ - public long hash() { - long ret = bindings.MonitorUpdateId_hash(this.ptr); - GC.KeepAlive(this); - return ret; - } - - public override int GetHashCode() { - return (int)this.hash(); - } - /** - * Checks if two MonitorUpdateIds 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.MonitorUpdateId b) { - bool ret = bindings.MonitorUpdateId_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 MonitorUpdateId)) return false; - return this.eq((MonitorUpdateId)o); - } -} -} } } diff --git a/c_sharp/src/org/ldk/structs/MonitorUpdatingPersister.cs b/c_sharp/src/org/ldk/structs/MonitorUpdatingPersister.cs index 6a3c5447..7bd534dc 100644 --- a/c_sharp/src/org/ldk/structs/MonitorUpdatingPersister.cs +++ b/c_sharp/src/org/ldk/structs/MonitorUpdatingPersister.cs @@ -115,13 +115,15 @@ public class MonitorUpdatingPersister : CommonBase { * - [`MonitorUpdatingPersister`] will potentially have more listing to do if you need to run * [`MonitorUpdatingPersister::cleanup_stale_updates`]. */ - public static MonitorUpdatingPersister of(org.ldk.structs.KVStore kv_store, org.ldk.structs.Logger logger, long maximum_pending_updates, org.ldk.structs.EntropySource entropy_source, org.ldk.structs.SignerProvider signer_provider) { - long ret = bindings.MonitorUpdatingPersister_new(kv_store.ptr, logger.ptr, maximum_pending_updates, entropy_source.ptr, signer_provider.ptr); + public static MonitorUpdatingPersister of(org.ldk.structs.KVStore kv_store, org.ldk.structs.Logger logger, long maximum_pending_updates, org.ldk.structs.EntropySource entropy_source, org.ldk.structs.SignerProvider signer_provider, org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator) { + long ret = bindings.MonitorUpdatingPersister_new(kv_store.ptr, logger.ptr, maximum_pending_updates, entropy_source.ptr, signer_provider.ptr, broadcaster.ptr, fee_estimator.ptr); GC.KeepAlive(kv_store); GC.KeepAlive(logger); GC.KeepAlive(maximum_pending_updates); GC.KeepAlive(entropy_source); GC.KeepAlive(signer_provider); + GC.KeepAlive(broadcaster); + GC.KeepAlive(fee_estimator); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MonitorUpdatingPersister ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.MonitorUpdatingPersister(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; @@ -129,6 +131,8 @@ public class MonitorUpdatingPersister : CommonBase { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(logger); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(entropy_source); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(signer_provider); }; + 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); }; return ret_hu_conv; } @@ -139,15 +143,11 @@ public class MonitorUpdatingPersister : CommonBase { * [`io::ErrorKind::NotFound`] variant correctly. For more information, please see the * documentation for [`MonitorUpdatingPersister`]. */ - public Result_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ read_all_channel_monitors_with_updates(org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator) { - long ret = bindings.MonitorUpdatingPersister_read_all_channel_monitors_with_updates(this.ptr, broadcaster.ptr, fee_estimator.ptr); + public Result_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ read_all_channel_monitors_with_updates() { + long ret = bindings.MonitorUpdatingPersister_read_all_channel_monitors_with_updates(this.ptr); GC.KeepAlive(this); - GC.KeepAlive(broadcaster); - GC.KeepAlive(fee_estimator); if (ret >= 0 && ret <= 4096) { return null; } Result_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ ret_hu_conv = Result_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(broadcaster); }; - if (this != null) { this.ptrs_to.AddLast(fee_estimator); }; return ret_hu_conv; } @@ -170,16 +170,12 @@ public class MonitorUpdatingPersister : CommonBase { * Loading a large number of monitors will be faster if done in parallel. You can use this * function to accomplish this. Take care to limit the number of parallel readers. */ - public Result_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ read_channel_monitor_with_updates(org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator, string monitor_key) { - long ret = bindings.MonitorUpdatingPersister_read_channel_monitor_with_updates(this.ptr, broadcaster.ptr, fee_estimator.ptr, InternalUtils.encodeString(monitor_key)); + public Result_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ read_channel_monitor_with_updates(string monitor_key) { + long ret = bindings.MonitorUpdatingPersister_read_channel_monitor_with_updates(this.ptr, InternalUtils.encodeString(monitor_key)); GC.KeepAlive(this); - GC.KeepAlive(broadcaster); - GC.KeepAlive(fee_estimator); GC.KeepAlive(monitor_key); if (ret >= 0 && ret <= 4096) { return null; } Result_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ ret_hu_conv = Result_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(broadcaster); }; - if (this != null) { this.ptrs_to.AddLast(fee_estimator); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/NetworkGraph.cs b/c_sharp/src/org/ldk/structs/NetworkGraph.cs index 24f4931f..6f2fc876 100644 --- a/c_sharp/src/org/ldk/structs/NetworkGraph.cs +++ b/c_sharp/src/org/ldk/structs/NetworkGraph.cs @@ -17,8 +17,6 @@ public class NetworkGraph : CommonBase { /** * Handles any network updates originating from [`Event`]s. - * Note that this will skip applying any [`NetworkUpdate::ChannelUpdateMessage`] to avoid - * leaking possibly identifying information of the sender to the public network. * * [`Event`]: crate::events::Event */ @@ -236,7 +234,6 @@ public class NetworkGraph : CommonBase { GC.KeepAlive(node_id_2); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(features); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/NetworkUpdate.cs b/c_sharp/src/org/ldk/structs/NetworkUpdate.cs index 8642d16a..2d728375 100644 --- a/c_sharp/src/org/ldk/structs/NetworkUpdate.cs +++ b/c_sharp/src/org/ldk/structs/NetworkUpdate.cs @@ -20,27 +20,13 @@ public class NetworkUpdate : CommonBase { internal static NetworkUpdate constr_from_ptr(long ptr) { long raw_ty = bindings.LDKNetworkUpdate_ty_from_ptr(ptr); switch (raw_ty) { - case 0: return new NetworkUpdate_ChannelUpdateMessage(ptr); - case 1: return new NetworkUpdate_ChannelFailure(ptr); - case 2: return new NetworkUpdate_NodeFailure(ptr); + case 0: return new NetworkUpdate_ChannelFailure(ptr); + case 1: return new NetworkUpdate_NodeFailure(ptr); default: throw new ArgumentException("Impossible enum variant"); } } - /** A NetworkUpdate of type ChannelUpdateMessage */ - public class NetworkUpdate_ChannelUpdateMessage : NetworkUpdate { - /** - * The update to apply via [`NetworkGraph::update_channel`]. - */ - public ChannelUpdate msg; - internal NetworkUpdate_ChannelUpdateMessage(long ptr) : base(null, ptr) { - long msg = bindings.LDKNetworkUpdate_ChannelUpdateMessage_get_msg(ptr); - org.ldk.structs.ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelUpdate(null, msg); } - if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); }; - this.msg = msg_hu_conv; - } - } /** A NetworkUpdate of type ChannelFailure */ public class NetworkUpdate_ChannelFailure : NetworkUpdate { /** @@ -93,19 +79,6 @@ public class NetworkUpdate : CommonBase { return ret_hu_conv; } - /** - * 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.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); - 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(msg); }; - return ret_hu_conv; - } - /** * Utility method to constructs a new ChannelFailure-variant NetworkUpdate */ diff --git a/c_sharp/src/org/ldk/structs/NodeAnnouncement.cs b/c_sharp/src/org/ldk/structs/NodeAnnouncement.cs index 26d28c70..89c9f510 100644 --- a/c_sharp/src/org/ldk/structs/NodeAnnouncement.cs +++ b/c_sharp/src/org/ldk/structs/NodeAnnouncement.cs @@ -56,7 +56,6 @@ public class NodeAnnouncement : CommonBase { bindings.NodeAnnouncement_set_contents(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -69,7 +68,6 @@ public class NodeAnnouncement : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.NodeAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAnnouncement(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(contents_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/NodeAnnouncementDetails.cs b/c_sharp/src/org/ldk/structs/NodeAnnouncementDetails.cs new file mode 100644 index 00000000..84ef3fae --- /dev/null +++ b/c_sharp/src/org/ldk/structs/NodeAnnouncementDetails.cs @@ -0,0 +1,186 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * Non-relayable information received in the latest node_announcement from this node. + */ +public class NodeAnnouncementDetails : CommonBase { + internal NodeAnnouncementDetails(object _dummy, long ptr) : base(ptr) { } + ~NodeAnnouncementDetails() { + if (ptr != 0) { bindings.NodeAnnouncementDetails_free(ptr); } + } + + /** + * Protocol features the node announced support for + */ + public NodeFeatures get_features() { + long ret = bindings.NodeAnnouncementDetails_get_features(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Protocol features the node announced support for + */ + public void set_features(org.ldk.structs.NodeFeatures val) { + bindings.NodeAnnouncementDetails_set_features(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * When the last known update to the node state was issued. + * Value is opaque, as set in the announcement. + */ + public int get_last_update() { + int ret = bindings.NodeAnnouncementDetails_get_last_update(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * When the last known update to the node state was issued. + * Value is opaque, as set in the announcement. + */ + public void set_last_update(int val) { + bindings.NodeAnnouncementDetails_set_last_update(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Color assigned to the node + */ + public byte[] get_rgb() { + long ret = bindings.NodeAnnouncementDetails_get_rgb(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Color assigned to the node + */ + public void set_rgb(byte[] val) { + bindings.NodeAnnouncementDetails_set_rgb(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 3))); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Moniker assigned to the node. + * May be invalid or malicious (eg control chars), + * should not be exposed to the user. + */ + public NodeAlias get_alias() { + long ret = bindings.NodeAnnouncementDetails_get_alias(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.NodeAlias ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAlias(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Moniker assigned to the node. + * May be invalid or malicious (eg control chars), + * should not be exposed to the user. + */ + public void set_alias(org.ldk.structs.NodeAlias val) { + bindings.NodeAnnouncementDetails_set_alias(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Internet-level addresses via which one can connect to the node + * + * Returns a copy of the field. + */ + public SocketAddress[] get_addresses() { + long ret = bindings.NodeAnnouncementDetails_get_addresses(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + int ret_conv_15_len = InternalUtils.getArrayLength(ret); + SocketAddress[] ret_conv_15_arr = new SocketAddress[ret_conv_15_len]; + for (int p = 0; p < ret_conv_15_len; p++) { + long ret_conv_15 = InternalUtils.getU64ArrayElem(ret, p); + org.ldk.structs.SocketAddress ret_conv_15_hu_conv = org.ldk.structs.SocketAddress.constr_from_ptr(ret_conv_15); + if (ret_conv_15_hu_conv != null) { ret_conv_15_hu_conv.ptrs_to.AddLast(this); }; + ret_conv_15_arr[p] = ret_conv_15_hu_conv; + } + bindings.free_buffer(ret); + return ret_conv_15_arr; + } + + /** + * Internet-level addresses via which one can connect to the node + */ + public void set_addresses(SocketAddress[] val) { + bindings.NodeAnnouncementDetails_set_addresses(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(val, val_conv_15 => val_conv_15.ptr))); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Constructs a new NodeAnnouncementDetails given each field + */ + public static NodeAnnouncementDetails of(org.ldk.structs.NodeFeatures features_arg, int last_update_arg, byte[] rgb_arg, org.ldk.structs.NodeAlias alias_arg, SocketAddress[] addresses_arg) { + long ret = bindings.NodeAnnouncementDetails_new(features_arg.ptr, last_update_arg, 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))); + GC.KeepAlive(features_arg); + GC.KeepAlive(last_update_arg); + GC.KeepAlive(rgb_arg); + GC.KeepAlive(alias_arg); + GC.KeepAlive(addresses_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.NodeAnnouncementDetails ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAnnouncementDetails(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.NodeAnnouncementDetails_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the NodeAnnouncementDetails + */ + public NodeAnnouncementDetails clone() { + long ret = bindings.NodeAnnouncementDetails_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.NodeAnnouncementDetails ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAnnouncementDetails(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Checks if two NodeAnnouncementDetailss 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.NodeAnnouncementDetails b) { + bool ret = bindings.NodeAnnouncementDetails_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 NodeAnnouncementDetails)) return false; + return this.eq((NodeAnnouncementDetails)o); + } +} +} } } diff --git a/c_sharp/src/org/ldk/structs/NodeAnnouncementInfo.cs b/c_sharp/src/org/ldk/structs/NodeAnnouncementInfo.cs index b44a9b98..baa8504d 100644 --- a/c_sharp/src/org/ldk/structs/NodeAnnouncementInfo.cs +++ b/c_sharp/src/org/ldk/structs/NodeAnnouncementInfo.cs @@ -5,192 +5,150 @@ using System; namespace org { namespace ldk { namespace structs { - /** * Information received in the latest node_announcement from this node. */ public class NodeAnnouncementInfo : CommonBase { - internal NodeAnnouncementInfo(object _dummy, long ptr) : base(ptr) { } + protected NodeAnnouncementInfo(object _dummy, long ptr) : base(ptr) { } ~NodeAnnouncementInfo() { if (ptr != 0) { bindings.NodeAnnouncementInfo_free(ptr); } } - /** - * Protocol features the node announced support for - */ - public NodeFeatures get_features() { - long ret = bindings.NodeAnnouncementInfo_get_features(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeFeatures(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; + internal static NodeAnnouncementInfo constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKNodeAnnouncementInfo_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new NodeAnnouncementInfo_Relayed(ptr); + case 1: return new NodeAnnouncementInfo_Local(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } } - /** - * Protocol features the node announced support for - */ - public void set_features(org.ldk.structs.NodeFeatures val) { - bindings.NodeAnnouncementInfo_set_features(this.ptr, val.ptr); - GC.KeepAlive(this); - GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; + /** A NodeAnnouncementInfo of type Relayed */ + public class NodeAnnouncementInfo_Relayed : NodeAnnouncementInfo { + public NodeAnnouncement relayed; + internal NodeAnnouncementInfo_Relayed(long ptr) : base(null, ptr) { + long relayed = bindings.LDKNodeAnnouncementInfo_Relayed_get_relayed(ptr); + org.ldk.structs.NodeAnnouncement relayed_hu_conv = null; if (relayed < 0 || relayed > 4096) { relayed_hu_conv = new org.ldk.structs.NodeAnnouncement(null, relayed); } + if (relayed_hu_conv != null) { relayed_hu_conv.ptrs_to.AddLast(this); }; + this.relayed = relayed_hu_conv; + } } - - /** - * When the last known update to the node state was issued. - * Value is opaque, as set in the announcement. - */ - public int get_last_update() { - int ret = bindings.NodeAnnouncementInfo_get_last_update(this.ptr); - GC.KeepAlive(this); - return ret; + /** A NodeAnnouncementInfo of type Local */ + public class NodeAnnouncementInfo_Local : NodeAnnouncementInfo { + public NodeAnnouncementDetails local; + internal NodeAnnouncementInfo_Local(long ptr) : base(null, ptr) { + long local = bindings.LDKNodeAnnouncementInfo_Local_get_local(ptr); + org.ldk.structs.NodeAnnouncementDetails local_hu_conv = null; if (local < 0 || local > 4096) { local_hu_conv = new org.ldk.structs.NodeAnnouncementDetails(null, local); } + if (local_hu_conv != null) { local_hu_conv.ptrs_to.AddLast(this); }; + this.local = local_hu_conv; + } } - - /** - * When the last known update to the node state was issued. - * Value is opaque, as set in the announcement. - */ - public void set_last_update(int val) { - bindings.NodeAnnouncementInfo_set_last_update(this.ptr, val); + internal long clone_ptr() { + long ret = bindings.NodeAnnouncementInfo_clone_ptr(this.ptr); GC.KeepAlive(this); - GC.KeepAlive(val); + return ret; } /** - * Color assigned to the node + * Creates a copy of the NodeAnnouncementInfo */ - public byte[] get_rgb() { - long ret = bindings.NodeAnnouncementInfo_get_rgb(this.ptr); + public NodeAnnouncementInfo clone() { + long ret = bindings.NodeAnnouncementInfo_clone(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + org.ldk.structs.NodeAnnouncementInfo ret_hu_conv = org.ldk.structs.NodeAnnouncementInfo.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** - * Color assigned to the node + * Utility method to constructs a new Relayed-variant NodeAnnouncementInfo */ - public void set_rgb(byte[] val) { - bindings.NodeAnnouncementInfo_set_rgb(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 3))); - GC.KeepAlive(this); - GC.KeepAlive(val); + public static NodeAnnouncementInfo relayed(org.ldk.structs.NodeAnnouncement a) { + long ret = bindings.NodeAnnouncementInfo_relayed(a.ptr); + GC.KeepAlive(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.NodeAnnouncementInfo ret_hu_conv = org.ldk.structs.NodeAnnouncementInfo.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; } /** - * Moniker assigned to the node. - * May be invalid or malicious (eg control chars), - * should not be exposed to the user. + * Utility method to constructs a new Local-variant NodeAnnouncementInfo */ - public NodeAlias get_alias() { - long ret = bindings.NodeAnnouncementInfo_get_alias(this.ptr); - GC.KeepAlive(this); + public static NodeAnnouncementInfo local(org.ldk.structs.NodeAnnouncementDetails a) { + long ret = bindings.NodeAnnouncementInfo_local(a.ptr); + GC.KeepAlive(a); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.NodeAlias ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAlias(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + org.ldk.structs.NodeAnnouncementInfo ret_hu_conv = org.ldk.structs.NodeAnnouncementInfo.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; return ret_hu_conv; } /** - * Moniker assigned to the node. - * May be invalid or malicious (eg control chars), - * should not be exposed to the user. + * Checks if two NodeAnnouncementInfos contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. */ - public void set_alias(org.ldk.structs.NodeAlias val) { - bindings.NodeAnnouncementInfo_set_alias(this.ptr, val.ptr); + public bool eq(org.ldk.structs.NodeAnnouncementInfo b) { + bool ret = bindings.NodeAnnouncementInfo_eq(this.ptr, b.ptr); GC.KeepAlive(this); - GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; + GC.KeepAlive(b); + return ret; } + public override bool Equals(object o) { + if (!(o is NodeAnnouncementInfo)) return false; + return this.eq((NodeAnnouncementInfo)o); + } /** - * An initial announcement of the node - * Mostly redundant with the data we store in fields explicitly. - * Everything else is useful only for sending out for initial routing sync. - * Not stored if contains excess data to prevent DoS. - * - * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + * Protocol features the node announced support for */ - public NodeAnnouncement get_announcement_message() { - long ret = bindings.NodeAnnouncementInfo_get_announcement_message(this.ptr); + public NodeFeatures features() { + long ret = bindings.NodeAnnouncementInfo_features(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.NodeAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAnnouncement(null, ret); } + org.ldk.structs.NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeFeatures(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; return ret_hu_conv; } /** - * An initial announcement of the node - * Mostly redundant with the data we store in fields explicitly. - * Everything else is useful only for sending out for initial routing sync. - * Not stored if contains excess data to prevent DoS. + * When the last known update to the node state was issued. * - * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + * Value may or may not be a timestamp, depending on the policy of the origin node. */ - public void set_announcement_message(org.ldk.structs.NodeAnnouncement val) { - bindings.NodeAnnouncementInfo_set_announcement_message(this.ptr, val == null ? 0 : val.ptr); + public int last_update() { + int ret = bindings.NodeAnnouncementInfo_last_update(this.ptr); GC.KeepAlive(this); - GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; + return ret; } /** - * Constructs a new NodeAnnouncementInfo given each field - * - * Note that announcement_message_arg (or a relevant inner pointer) may be NULL or all-0s to represent None + * Color assigned to the node */ - 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.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); - GC.KeepAlive(alias_arg); - GC.KeepAlive(announcement_message_arg); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.NodeAnnouncementInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAnnouncementInfo(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(alias_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(announcement_message_arg); }; - return ret_hu_conv; - } - - internal long clone_ptr() { - long ret = bindings.NodeAnnouncementInfo_clone_ptr(this.ptr); + public byte[] rgb() { + long ret = bindings.NodeAnnouncementInfo_rgb(this.ptr); GC.KeepAlive(this); - return ret; + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; } /** - * Creates a copy of the NodeAnnouncementInfo + * Moniker assigned to the node. + * + * May be invalid or malicious (eg control chars), should not be exposed to the user. */ - public NodeAnnouncementInfo clone() { - long ret = bindings.NodeAnnouncementInfo_clone(this.ptr); + public NodeAlias alias() { + long ret = bindings.NodeAnnouncementInfo_alias(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.NodeAnnouncementInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAnnouncementInfo(null, ret); } + org.ldk.structs.NodeAlias ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAlias(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; return ret_hu_conv; } - /** - * Checks if two NodeAnnouncementInfos 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.NodeAnnouncementInfo b) { - bool ret = bindings.NodeAnnouncementInfo_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 NodeAnnouncementInfo)) return false; - return this.eq((NodeAnnouncementInfo)o); - } /** * Internet-level addresses via which one can connect to the node */ @@ -210,6 +168,22 @@ public class NodeAnnouncementInfo : CommonBase { return ret_conv_15_arr; } + /** + * An initial announcement of the node + * + * Not stored if contains excess data to prevent DoS. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public NodeAnnouncement announcement_message() { + long ret = bindings.NodeAnnouncementInfo_announcement_message(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.NodeAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAnnouncement(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + /** * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read */ diff --git a/c_sharp/src/org/ldk/structs/NodeFeatures.cs b/c_sharp/src/org/ldk/structs/NodeFeatures.cs index 38871aba..e8b0f9b2 100644 --- a/c_sharp/src/org/ldk/structs/NodeFeatures.cs +++ b/c_sharp/src/org/ldk/structs/NodeFeatures.cs @@ -15,6 +15,28 @@ public class NodeFeatures : CommonBase { if (ptr != 0) { bindings.NodeFeatures_free(ptr); } } + /** + * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read + */ + public byte[] write() { + long ret = bindings.NodeFeatures_write(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Read a NodeFeatures from a byte array, created by NodeFeatures_write + */ + public static Result_NodeFeaturesDecodeErrorZ read(byte[] ser) { + long ret = bindings.NodeFeatures_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NodeFeaturesDecodeErrorZ ret_hu_conv = Result_NodeFeaturesDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + /** * Checks if two NodeFeaturess contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. @@ -73,6 +95,27 @@ public class NodeFeatures : CommonBase { return ret_hu_conv; } + /** + * Returns the feature set as a list of bytes, in little-endian. This is in reverse byte order + * from most on-the-wire encodings. + */ + public byte[] le_flags() { + long ret = bindings.NodeFeatures_le_flags(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Returns true if this `Features` has any optional flags set + */ + public bool supports_any_optional_bits() { + bool ret = bindings.NodeFeatures_supports_any_optional_bits(this.ptr); + GC.KeepAlive(this); + return ret; + } + /** * Returns true if this `Features` object contains required features unknown by `other`. */ @@ -84,6 +127,19 @@ public class NodeFeatures : CommonBase { return ret; } + /** + * Returns the set of required features unknown by `other`, as their bit position. + */ + public long[] required_unknown_bits_from(org.ldk.structs.NodeFeatures other) { + long ret = bindings.NodeFeatures_required_unknown_bits_from(this.ptr, other.ptr); + GC.KeepAlive(this); + GC.KeepAlive(other); + if (ret >= 0 && ret <= 4096) { return null; } + long[] ret_conv = InternalUtils.decodeUint64Array(ret); + if (this != null) { this.ptrs_to.AddLast(other); }; + return ret_conv; + } + /** * Returns true if this `Features` object contains unknown feature flags which are set as * \"required\". @@ -94,6 +150,15 @@ public class NodeFeatures : CommonBase { return ret; } + /** + * Returns true if this `Features` supports any bits which we do not know of + */ + public bool supports_unknown_bits() { + bool ret = bindings.NodeFeatures_supports_unknown_bits(this.ptr); + GC.KeepAlive(this); + return ret; + } + /** * Sets a required feature bit. Errors if `bit` is outside the feature range as defined * by [BOLT 9]. @@ -167,27 +232,68 @@ public class NodeFeatures : CommonBase { } /** - * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read + * Unsets the `upfront_shutdown_script` feature */ - public byte[] write() { - long ret = bindings.NodeFeatures_write(this.ptr); + public NodeFeatures clear_upfront_shutdown_script() { + long ret = bindings.NodeFeatures_clear_upfront_shutdown_script(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + org.ldk.structs.NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + ; + return ret_hu_conv; } /** - * Read a NodeFeatures from a byte array, created by NodeFeatures_write + * Unsets the `shutdown_anysegwit` feature */ - public static Result_NodeFeaturesDecodeErrorZ read(byte[] ser) { - long ret = bindings.NodeFeatures_read(InternalUtils.encodeUint8Array(ser)); - GC.KeepAlive(ser); + public NodeFeatures clear_shutdown_anysegwit() { + long ret = bindings.NodeFeatures_clear_shutdown_anysegwit(this.ptr); + GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - Result_NodeFeaturesDecodeErrorZ ret_hu_conv = Result_NodeFeaturesDecodeErrorZ.constr_from_ptr(ret); + org.ldk.structs.NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + ; return ret_hu_conv; } + /** + * Unsets the `wumbo` feature + */ + public NodeFeatures clear_wumbo() { + long ret = bindings.NodeFeatures_clear_wumbo(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + ; + return ret_hu_conv; + } + + /** + * Unsets the `scid_privacy` feature + */ + public void clear_scid_privacy() { + bindings.NodeFeatures_clear_scid_privacy(this.ptr); + GC.KeepAlive(this); + } + + /** + * Unsets the `anchors_zero_fee_htlc_tx` feature + */ + public void clear_anchors_zero_fee_htlc_tx() { + bindings.NodeFeatures_clear_anchors_zero_fee_htlc_tx(this.ptr); + GC.KeepAlive(this); + } + + /** + * Unsets the `route_blinding` feature + */ + public void clear_route_blinding() { + bindings.NodeFeatures_clear_route_blinding(this.ptr); + GC.KeepAlive(this); + } + /** * Set this feature as optional. */ diff --git a/c_sharp/src/org/ldk/structs/NodeId.cs b/c_sharp/src/org/ldk/structs/NodeId.cs index a7a211ad..586896de 100644 --- a/c_sharp/src/org/ldk/structs/NodeId.cs +++ b/c_sharp/src/org/ldk/structs/NodeId.cs @@ -33,6 +33,23 @@ public class NodeId : CommonBase { return ret_hu_conv; } + /** + * Checks if two NodeIds 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.NodeId b) { + bool ret = bindings.NodeId_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 NodeId)) return false; + return this.eq((NodeId)o); + } /** * Create a new NodeId from a public key */ diff --git a/c_sharp/src/org/ldk/structs/NodeInfo.cs b/c_sharp/src/org/ldk/structs/NodeInfo.cs index e7975e61..9cf8a85d 100644 --- a/c_sharp/src/org/ldk/structs/NodeInfo.cs +++ b/c_sharp/src/org/ldk/structs/NodeInfo.cs @@ -42,13 +42,13 @@ public class NodeInfo : CommonBase { * Optional because we store a Node entry after learning about it from * a channel announcement, but before receiving a node announcement. * - * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + * Returns a copy of the field. */ - public NodeAnnouncementInfo get_announcement_info() { + public Option_NodeAnnouncementInfoZ get_announcement_info() { long ret = bindings.NodeInfo_get_announcement_info(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.NodeAnnouncementInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAnnouncementInfo(null, ret); } + org.ldk.structs.Option_NodeAnnouncementInfoZ ret_hu_conv = org.ldk.structs.Option_NodeAnnouncementInfoZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; return ret_hu_conv; } @@ -57,30 +57,11 @@ public class NodeInfo : CommonBase { * More information about a node from node_announcement. * Optional because we store a Node entry after learning about it from * a channel announcement, but before receiving a node announcement. - * - * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public void set_announcement_info(org.ldk.structs.NodeAnnouncementInfo val) { - bindings.NodeInfo_set_announcement_info(this.ptr, val == null ? 0 : val.ptr); + public void set_announcement_info(org.ldk.structs.Option_NodeAnnouncementInfoZ val) { + bindings.NodeInfo_set_announcement_info(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; - } - - /** - * Constructs a new NodeInfo given each field - * - * Note that announcement_info_arg (or a relevant inner pointer) may be NULL or all-0s to represent None - */ - public static NodeInfo of(long[] channels_arg, org.ldk.structs.NodeAnnouncementInfo announcement_info_arg) { - long ret = bindings.NodeInfo_new(InternalUtils.encodeUint64Array(channels_arg), announcement_info_arg == null ? 0 : announcement_info_arg.ptr); - GC.KeepAlive(channels_arg); - GC.KeepAlive(announcement_info_arg); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.NodeInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeInfo(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(announcement_info_arg); }; - return ret_hu_conv; } internal long clone_ptr() { diff --git a/c_sharp/src/org/ldk/structs/NodeSigner.cs b/c_sharp/src/org/ldk/structs/NodeSigner.cs index f5f001b9..98f74033 100644 --- a/c_sharp/src/org/ldk/structs/NodeSigner.cs +++ b/c_sharp/src/org/ldk/structs/NodeSigner.cs @@ -51,7 +51,7 @@ public interface NodeSignerInterface { * * Errors if the [`Recipient`] variant is not supported by the implementation. */ - Result_RecoverableSignatureNoneZ sign_invoice(byte[] hrp_bytes, UInt5[] invoice_data, Recipient recipient); + Result_RecoverableSignatureNoneZ sign_invoice(RawBolt11Invoice invoice, Recipient recipient); /**Signs the [`TaggedHash`] of a BOLT 12 invoice request. * * May be called by a function passed to [`UnsignedInvoiceRequest::sign`] where @@ -126,17 +126,9 @@ public class NodeSigner : CommonBase { long result = ret.clone_ptr(); return result; } - public long sign_invoice(long _hrp_bytes, long _invoice_data, Recipient _recipient) { - byte[] _hrp_bytes_conv = InternalUtils.decodeUint8Array(_hrp_bytes); - int _invoice_data_conv_7_len = InternalUtils.getArrayLength(_invoice_data); - UInt5[] _invoice_data_conv_7_arr = new UInt5[_invoice_data_conv_7_len]; - for (int h = 0; h < _invoice_data_conv_7_len; h++) { - byte _invoice_data_conv_7 = InternalUtils.getU8ArrayElem(_invoice_data, h); - UInt5 _invoice_data_conv_7_conv = new UInt5(_invoice_data_conv_7); - _invoice_data_conv_7_arr[h] = _invoice_data_conv_7_conv; - } - bindings.free_buffer(_invoice_data); - Result_RecoverableSignatureNoneZ ret = arg.sign_invoice(_hrp_bytes_conv, _invoice_data_conv_7_arr, _recipient); + public long sign_invoice(long _invoice, Recipient _recipient) { + org.ldk.structs.RawBolt11Invoice _invoice_hu_conv = null; if (_invoice < 0 || _invoice > 4096) { _invoice_hu_conv = new org.ldk.structs.RawBolt11Invoice(null, _invoice); } + Result_RecoverableSignatureNoneZ ret = arg.sign_invoice(_invoice_hu_conv, _recipient); GC.KeepAlive(arg); long result = ret.clone_ptr(); return result; @@ -231,7 +223,6 @@ public class NodeSigner : CommonBase { GC.KeepAlive(tweak); if (ret >= 0 && ret <= 4096) { return null; } Result_ThirtyTwoBytesNoneZ ret_hu_conv = Result_ThirtyTwoBytesNoneZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(tweak); }; return ret_hu_conv; } @@ -248,14 +239,14 @@ public class NodeSigner : CommonBase { * * Errors if the [`Recipient`] variant is not supported by the implementation. */ - public Result_RecoverableSignatureNoneZ sign_invoice(byte[] hrp_bytes, UInt5[] invoice_data, Recipient recipient) { - long ret = bindings.NodeSigner_sign_invoice(this.ptr, InternalUtils.encodeUint8Array(hrp_bytes), InternalUtils.encodeUint8Array(InternalUtils.convUInt5Array(invoice_data)), recipient); + public Result_RecoverableSignatureNoneZ sign_invoice(org.ldk.structs.RawBolt11Invoice invoice, Recipient recipient) { + long ret = bindings.NodeSigner_sign_invoice(this.ptr, invoice.ptr, recipient); GC.KeepAlive(this); - GC.KeepAlive(hrp_bytes); - GC.KeepAlive(invoice_data); + GC.KeepAlive(invoice); GC.KeepAlive(recipient); if (ret >= 0 && ret <= 4096) { return null; } Result_RecoverableSignatureNoneZ ret_hu_conv = Result_RecoverableSignatureNoneZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(invoice); }; return ret_hu_conv; } @@ -319,7 +310,6 @@ public class NodeSigner : CommonBase { GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } Result_ECDSASignatureNoneZ ret_hu_conv = Result_ECDSASignatureNoneZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(msg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Nonce.cs b/c_sharp/src/org/ldk/structs/Nonce.cs new file mode 100644 index 00000000..804922af --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Nonce.cs @@ -0,0 +1,107 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A 128-bit number used only once. + * + * Needed when constructing [`Offer::metadata`] and deriving [`Offer::signing_pubkey`] from + * [`ExpandedKey`]. Must not be reused for any other derivation without first hashing. + * + * [`Offer::metadata`]: crate::offers::offer::Offer::metadata + * [`Offer::signing_pubkey`]: crate::offers::offer::Offer::signing_pubkey + * [`ExpandedKey`]: crate::ln::inbound_payment::ExpandedKey + */ +public class Nonce : CommonBase { + internal Nonce(object _dummy, long ptr) : base(ptr) { } + ~Nonce() { + if (ptr != 0) { bindings.Nonce_free(ptr); } + } + + internal long clone_ptr() { + long ret = bindings.Nonce_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the Nonce + */ + public Nonce clone() { + long ret = bindings.Nonce_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Nonce ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Nonce(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Checks if two Nonces 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.Nonce b) { + bool ret = bindings.Nonce_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 Nonce)) return false; + return this.eq((Nonce)o); + } + /** + * Creates a `Nonce` from the given [`EntropySource`]. + */ + public static Nonce from_entropy_source(org.ldk.structs.EntropySource entropy_source) { + long ret = bindings.Nonce_from_entropy_source(entropy_source.ptr); + GC.KeepAlive(entropy_source); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Nonce ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Nonce(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; + } + + /** + * Returns a slice of the underlying bytes of size [`Nonce::LENGTH`]. + */ + public byte[] as_slice() { + long ret = bindings.Nonce_as_slice(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Serialize the Nonce object into a byte array which can be read by Nonce_read + */ + public byte[] write() { + long ret = bindings.Nonce_write(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Read a Nonce from a byte array, created by Nonce_write + */ + public static Result_NonceDecodeErrorZ read(byte[] ser) { + long ret = bindings.Nonce_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NonceDecodeErrorZ ret_hu_conv = Result_NonceDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Offer.cs b/c_sharp/src/org/ldk/structs/Offer.cs index 3db5c844..283c0f7e 100644 --- a/c_sharp/src/org/ldk/structs/Offer.cs +++ b/c_sharp/src/org/ldk/structs/Offer.cs @@ -16,7 +16,7 @@ namespace org { namespace ldk { namespace structs { * Offers may be denominated in currency other than bitcoin but are ultimately paid using the * latter. * - * Through the use of [`BlindedPath`]s, offers provide recipient privacy. + * Through the use of [`BlindedMessagePath`]s, offers provide recipient privacy. * * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice @@ -150,20 +150,20 @@ public class Offer : CommonBase { * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide * recipient privacy by obfuscating its node id. */ - public BlindedPath[] paths() { + public BlindedMessagePath[] paths() { long ret = bindings.Offer_paths(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - int ret_conv_13_len = InternalUtils.getArrayLength(ret); - BlindedPath[] ret_conv_13_arr = new BlindedPath[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.BlindedPath ret_conv_13_hu_conv = null; if (ret_conv_13 < 0 || ret_conv_13 > 4096) { ret_conv_13_hu_conv = new org.ldk.structs.BlindedPath(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; + int ret_conv_20_len = InternalUtils.getArrayLength(ret); + BlindedMessagePath[] ret_conv_20_arr = new BlindedMessagePath[ret_conv_20_len]; + for (int u = 0; u < ret_conv_20_len; u++) { + long ret_conv_20 = InternalUtils.getU64ArrayElem(ret, u); + org.ldk.structs.BlindedMessagePath ret_conv_20_hu_conv = null; if (ret_conv_20 < 0 || ret_conv_20 > 4096) { ret_conv_20_hu_conv = new org.ldk.structs.BlindedMessagePath(null, ret_conv_20); } + if (ret_conv_20_hu_conv != null) { ret_conv_20_hu_conv.ptrs_to.AddLast(this); }; + ret_conv_20_arr[u] = ret_conv_20_hu_conv; } bindings.free_buffer(ret); - return ret_conv_13_arr; + return ret_conv_20_arr; } /** @@ -258,8 +258,9 @@ public class Offer : CommonBase { * - 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 + * such that it can be used by [`Bolt12Invoice::verify_using_metadata`] 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. * @@ -267,19 +268,18 @@ public class Offer : CommonBase { * * [`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 + * [`Bolt12Invoice::verify_using_metadata`]: crate::offers::invoice::Bolt12Invoice::verify_using_metadata * [`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))); + public Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ request_invoice_deriving_payer_id(org.ldk.structs.ExpandedKey expanded_key, org.ldk.structs.Nonce nonce, byte[] payment_id) { + long ret = bindings.Offer_request_invoice_deriving_payer_id(this.ptr, expanded_key.ptr, nonce.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_id, 32))); GC.KeepAlive(this); GC.KeepAlive(expanded_key); - GC.KeepAlive(entropy_source); + GC.KeepAlive(nonce); 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; } @@ -291,17 +291,16 @@ public class Offer : CommonBase { * * [`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))); + public Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ request_invoice_deriving_metadata(byte[] payer_id, org.ldk.structs.ExpandedKey expanded_key, org.ldk.structs.Nonce nonce, 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, nonce.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(nonce); 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; } @@ -342,6 +341,17 @@ public class Offer : CommonBase { public override int GetHashCode() { return (int)this.hash(); } + /** + * Read a Offer from a byte array, created by Offer_write + */ + public static Result_OfferDecodeErrorZ read(byte[] ser) { + long ret = bindings.Offer_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OfferDecodeErrorZ ret_hu_conv = Result_OfferDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + /** * 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 d72a7ad0..5bb423ac 100644 --- a/c_sharp/src/org/ldk/structs/OfferFeatures.cs +++ b/c_sharp/src/org/ldk/structs/OfferFeatures.cs @@ -73,6 +73,27 @@ public class OfferFeatures : CommonBase { return ret_hu_conv; } + /** + * Returns the feature set as a list of bytes, in little-endian. This is in reverse byte order + * from most on-the-wire encodings. + */ + public byte[] le_flags() { + long ret = bindings.OfferFeatures_le_flags(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Returns true if this `Features` has any optional flags set + */ + public bool supports_any_optional_bits() { + bool ret = bindings.OfferFeatures_supports_any_optional_bits(this.ptr); + GC.KeepAlive(this); + return ret; + } + /** * Returns true if this `Features` object contains required features unknown by `other`. */ @@ -84,6 +105,19 @@ public class OfferFeatures : CommonBase { return ret; } + /** + * Returns the set of required features unknown by `other`, as their bit position. + */ + public long[] required_unknown_bits_from(org.ldk.structs.OfferFeatures other) { + long ret = bindings.OfferFeatures_required_unknown_bits_from(this.ptr, other.ptr); + GC.KeepAlive(this); + GC.KeepAlive(other); + if (ret >= 0 && ret <= 4096) { return null; } + long[] ret_conv = InternalUtils.decodeUint64Array(ret); + if (this != null) { this.ptrs_to.AddLast(other); }; + return ret_conv; + } + /** * Returns true if this `Features` object contains unknown feature flags which are set as * \"required\". @@ -94,6 +128,15 @@ public class OfferFeatures : CommonBase { return ret; } + /** + * Returns true if this `Features` supports any bits which we do not know of + */ + public bool supports_unknown_bits() { + bool ret = bindings.OfferFeatures_supports_unknown_bits(this.ptr); + GC.KeepAlive(this); + return ret; + } + /** * Sets a required feature bit. Errors if `bit` is outside the feature range as defined * by [BOLT 9]. diff --git a/c_sharp/src/org/ldk/structs/OfferWithDerivedMetadataBuilder.cs b/c_sharp/src/org/ldk/structs/OfferWithDerivedMetadataBuilder.cs index ae8349ab..40016960 100644 --- a/c_sharp/src/org/ldk/structs/OfferWithDerivedMetadataBuilder.cs +++ b/c_sharp/src/org/ldk/structs/OfferWithDerivedMetadataBuilder.cs @@ -39,27 +39,29 @@ public class OfferWithDerivedMetadataBuilder : CommonBase { /** * 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. + * pubkey is derived from the given [`ExpandedKey`] and [`Nonce`]. 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_using_metadata`] to determine if the request was produced for the + * offer given an [`ExpandedKey`]. However, if [`OfferBuilder::path`] is called, then the + * metadata will not be set and must be included in each [`BlindedMessagePath`] instead. In this case, + * use [`InvoiceRequest::verify_using_recipient_data`]. * - * [`InvoiceRequest::verify`]: crate::offers::invoice_request::InvoiceRequest::verify + * [`InvoiceRequest::verify_using_metadata`]: crate::offers::invoice_request::InvoiceRequest::verify_using_metadata + * [`InvoiceRequest::verify_using_recipient_data`]: crate::offers::invoice_request::InvoiceRequest::verify_using_recipient_data * [`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); + public static OfferWithDerivedMetadataBuilder deriving_signing_pubkey(byte[] node_id, org.ldk.structs.ExpandedKey expanded_key, org.ldk.structs.Nonce nonce) { + long ret = bindings.OfferWithDerivedMetadataBuilder_deriving_signing_pubkey(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), expanded_key.ptr, nonce.ptr); GC.KeepAlive(node_id); GC.KeepAlive(expanded_key); - GC.KeepAlive(entropy_source); + GC.KeepAlive(nonce); 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; } @@ -75,7 +77,7 @@ public class OfferWithDerivedMetadataBuilder : CommonBase { bindings.OfferWithDerivedMetadataBuilder_chain(this.ptr, network); GC.KeepAlive(this); GC.KeepAlive(network); - if (this != null) { this.ptrs_to.AddLast(this); }; + ; } /** @@ -87,7 +89,7 @@ public class OfferWithDerivedMetadataBuilder : CommonBase { bindings.OfferWithDerivedMetadataBuilder_amount_msats(this.ptr, amount_msats); GC.KeepAlive(this); GC.KeepAlive(amount_msats); - if (this != null) { this.ptrs_to.AddLast(this); }; + ; } /** @@ -100,7 +102,7 @@ public class OfferWithDerivedMetadataBuilder : CommonBase { bindings.OfferWithDerivedMetadataBuilder_absolute_expiry(this.ptr, absolute_expiry); GC.KeepAlive(this); GC.KeepAlive(absolute_expiry); - if (this != null) { this.ptrs_to.AddLast(this); }; + ; } /** @@ -112,7 +114,7 @@ public class OfferWithDerivedMetadataBuilder : CommonBase { bindings.OfferWithDerivedMetadataBuilder_description(this.ptr, InternalUtils.encodeString(description)); GC.KeepAlive(this); GC.KeepAlive(description); - if (this != null) { this.ptrs_to.AddLast(this); }; + ; } /** @@ -124,7 +126,7 @@ public class OfferWithDerivedMetadataBuilder : CommonBase { bindings.OfferWithDerivedMetadataBuilder_issuer(this.ptr, InternalUtils.encodeString(issuer)); GC.KeepAlive(this); GC.KeepAlive(issuer); - if (this != null) { this.ptrs_to.AddLast(this); }; + ; } /** @@ -134,12 +136,11 @@ public class OfferWithDerivedMetadataBuilder : CommonBase { * 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) { + public void path(org.ldk.structs.BlindedMessagePath 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); }; + ; } /** @@ -152,8 +153,7 @@ public class OfferWithDerivedMetadataBuilder : CommonBase { 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); }; + ; } /** @@ -164,7 +164,7 @@ public class OfferWithDerivedMetadataBuilder : CommonBase { 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 index 23dfa87d..d8841886 100644 --- a/c_sharp/src/org/ldk/structs/OfferWithExplicitMetadataBuilder.cs +++ b/c_sharp/src/org/ldk/structs/OfferWithExplicitMetadataBuilder.cs @@ -71,7 +71,7 @@ public class OfferWithExplicitMetadataBuilder : CommonBase { 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; } @@ -87,7 +87,7 @@ public class OfferWithExplicitMetadataBuilder : CommonBase { bindings.OfferWithExplicitMetadataBuilder_chain(this.ptr, network); GC.KeepAlive(this); GC.KeepAlive(network); - if (this != null) { this.ptrs_to.AddLast(this); }; + ; } /** @@ -99,7 +99,7 @@ public class OfferWithExplicitMetadataBuilder : CommonBase { bindings.OfferWithExplicitMetadataBuilder_amount_msats(this.ptr, amount_msats); GC.KeepAlive(this); GC.KeepAlive(amount_msats); - if (this != null) { this.ptrs_to.AddLast(this); }; + ; } /** @@ -112,7 +112,7 @@ public class OfferWithExplicitMetadataBuilder : CommonBase { bindings.OfferWithExplicitMetadataBuilder_absolute_expiry(this.ptr, absolute_expiry); GC.KeepAlive(this); GC.KeepAlive(absolute_expiry); - if (this != null) { this.ptrs_to.AddLast(this); }; + ; } /** @@ -124,7 +124,7 @@ public class OfferWithExplicitMetadataBuilder : CommonBase { bindings.OfferWithExplicitMetadataBuilder_description(this.ptr, InternalUtils.encodeString(description)); GC.KeepAlive(this); GC.KeepAlive(description); - if (this != null) { this.ptrs_to.AddLast(this); }; + ; } /** @@ -136,7 +136,7 @@ public class OfferWithExplicitMetadataBuilder : CommonBase { bindings.OfferWithExplicitMetadataBuilder_issuer(this.ptr, InternalUtils.encodeString(issuer)); GC.KeepAlive(this); GC.KeepAlive(issuer); - if (this != null) { this.ptrs_to.AddLast(this); }; + ; } /** @@ -146,12 +146,11 @@ public class OfferWithExplicitMetadataBuilder : CommonBase { * 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) { + public void path(org.ldk.structs.BlindedMessagePath 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); }; + ; } /** @@ -164,8 +163,7 @@ public class OfferWithExplicitMetadataBuilder : CommonBase { 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); }; + ; } /** @@ -176,7 +174,7 @@ public class OfferWithExplicitMetadataBuilder : CommonBase { 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/OffersContext.cs b/c_sharp/src/org/ldk/structs/OffersContext.cs new file mode 100644 index 00000000..54055723 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/OffersContext.cs @@ -0,0 +1,195 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * Contains data specific to an [`OffersMessage`]. + * + * [`OffersMessage`]: crate::onion_message::offers::OffersMessage + */ +public class OffersContext : CommonBase { + protected OffersContext(object _dummy, long ptr) : base(ptr) { } + ~OffersContext() { + if (ptr != 0) { bindings.OffersContext_free(ptr); } + } + + internal static OffersContext constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKOffersContext_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new OffersContext_InvoiceRequest(ptr); + case 1: return new OffersContext_OutboundPayment(ptr); + case 2: return new OffersContext_InboundPayment(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A OffersContext of type InvoiceRequest */ + public class OffersContext_InvoiceRequest : OffersContext { + /** + * A nonce used for authenticating that an [`InvoiceRequest`] is for a valid [`Offer`] and + * for deriving the offer's signing keys. + * + * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest + * [`Offer`]: crate::offers::offer::Offer + */ + public Nonce nonce; + internal OffersContext_InvoiceRequest(long ptr) : base(null, ptr) { + long nonce = bindings.LDKOffersContext_InvoiceRequest_get_nonce(ptr); + org.ldk.structs.Nonce nonce_hu_conv = null; if (nonce < 0 || nonce > 4096) { nonce_hu_conv = new org.ldk.structs.Nonce(null, nonce); } + if (nonce_hu_conv != null) { nonce_hu_conv.ptrs_to.AddLast(this); }; + this.nonce = nonce_hu_conv; + } + } + /** A OffersContext of type OutboundPayment */ + public class OffersContext_OutboundPayment : OffersContext { + /** + * Payment ID used when creating a [`Refund`] or [`InvoiceRequest`]. + * + * [`Refund`]: crate::offers::refund::Refund + * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest + */ + public byte[] payment_id; + /** + * A nonce used for authenticating that a [`Bolt12Invoice`] is for a valid [`Refund`] or + * [`InvoiceRequest`] and for deriving their signing keys. + * + * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice + * [`Refund`]: crate::offers::refund::Refund + * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest + */ + public Nonce nonce; + /** + * Authentication code for the [`PaymentId`], which should be checked when the context is + * used with an [`InvoiceError`]. + * + * [`InvoiceError`]: crate::offers::invoice_error::InvoiceError + * + * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public byte[] hmac; + internal OffersContext_OutboundPayment(long ptr) : base(null, ptr) { + long payment_id = bindings.LDKOffersContext_OutboundPayment_get_payment_id(ptr); + byte[] payment_id_conv = InternalUtils.decodeUint8Array(payment_id); + this.payment_id = payment_id_conv; + long nonce = bindings.LDKOffersContext_OutboundPayment_get_nonce(ptr); + org.ldk.structs.Nonce nonce_hu_conv = null; if (nonce < 0 || nonce > 4096) { nonce_hu_conv = new org.ldk.structs.Nonce(null, nonce); } + if (nonce_hu_conv != null) { nonce_hu_conv.ptrs_to.AddLast(this); }; + this.nonce = nonce_hu_conv; + long hmac = bindings.LDKOffersContext_OutboundPayment_get_hmac(ptr); + byte[] hmac_conv = InternalUtils.decodeUint8Array(hmac); + this.hmac = hmac_conv; + } + } + /** A OffersContext of type InboundPayment */ + public class OffersContext_InboundPayment : OffersContext { + /** + * The same payment hash as [`Bolt12Invoice::payment_hash`]. + * + * [`Bolt12Invoice::payment_hash`]: crate::offers::invoice::Bolt12Invoice::payment_hash + */ + public byte[] payment_hash; + internal OffersContext_InboundPayment(long ptr) : base(null, ptr) { + long payment_hash = bindings.LDKOffersContext_InboundPayment_get_payment_hash(ptr); + byte[] payment_hash_conv = InternalUtils.decodeUint8Array(payment_hash); + this.payment_hash = payment_hash_conv; + } + } + internal long clone_ptr() { + long ret = bindings.OffersContext_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the OffersContext + */ + public OffersContext clone() { + long ret = bindings.OffersContext_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OffersContext ret_hu_conv = org.ldk.structs.OffersContext.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 InvoiceRequest-variant OffersContext + */ + public static OffersContext invoice_request(org.ldk.structs.Nonce nonce) { + long ret = bindings.OffersContext_invoice_request(nonce.ptr); + GC.KeepAlive(nonce); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OffersContext ret_hu_conv = org.ldk.structs.OffersContext.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 OutboundPayment-variant OffersContext + */ + public static OffersContext outbound_payment(byte[] payment_id, org.ldk.structs.Nonce nonce, byte[] hmac) { + long ret = bindings.OffersContext_outbound_payment(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_id, 32)), nonce.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(hmac, 32))); + GC.KeepAlive(payment_id); + GC.KeepAlive(nonce); + GC.KeepAlive(hmac); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OffersContext ret_hu_conv = org.ldk.structs.OffersContext.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 InboundPayment-variant OffersContext + */ + public static OffersContext inbound_payment(byte[] payment_hash) { + long ret = bindings.OffersContext_inbound_payment(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32))); + GC.KeepAlive(payment_hash); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OffersContext ret_hu_conv = org.ldk.structs.OffersContext.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 OffersContexts contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + */ + public bool eq(org.ldk.structs.OffersContext b) { + bool ret = bindings.OffersContext_eq(this.ptr, b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + return ret; + } + + public override bool Equals(object o) { + if (!(o is OffersContext)) return false; + return this.eq((OffersContext)o); + } + /** + * Serialize the OffersContext object into a byte array which can be read by OffersContext_read + */ + public byte[] write() { + long ret = bindings.OffersContext_write(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Read a OffersContext from a byte array, created by OffersContext_write + */ + public static Result_OffersContextDecodeErrorZ read(byte[] ser) { + long ret = bindings.OffersContext_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OffersContextDecodeErrorZ ret_hu_conv = Result_OffersContextDecodeErrorZ.constr_from_ptr(ret); + 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 f5e7b8b8..7a9a9790 100644 --- a/c_sharp/src/org/ldk/structs/OffersMessage.cs +++ b/c_sharp/src/org/ldk/structs/OffersMessage.cs @@ -84,7 +84,6 @@ public class OffersMessage : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.OffersMessage ret_hu_conv = org.ldk.structs.OffersMessage.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; } @@ -97,7 +96,6 @@ public class OffersMessage : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.OffersMessage ret_hu_conv = org.ldk.structs.OffersMessage.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; } @@ -110,7 +108,6 @@ public class OffersMessage : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.OffersMessage ret_hu_conv = org.ldk.structs.OffersMessage.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; } diff --git a/c_sharp/src/org/ldk/structs/OffersMessageHandler.cs b/c_sharp/src/org/ldk/structs/OffersMessageHandler.cs index 3197fcc6..ef8921b3 100644 --- a/c_sharp/src/org/ldk/structs/OffersMessageHandler.cs +++ b/c_sharp/src/org/ldk/structs/OffersMessageHandler.cs @@ -16,14 +16,16 @@ public interface OffersMessageHandlerInterface { * The returned [`OffersMessage`], if any, is enqueued to be sent by [`OnionMessenger`]. * * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger + * + * Note that responder (or a relevant inner pointer) may be NULL or all-0s to represent None */ - Option_OffersMessageZ handle_message(OffersMessage message); + Option_C2Tuple_OffersMessageResponseInstructionZZ handle_message(OffersMessage message, Option_OffersContextZ context, Responder responder); /**Releases any [`OffersMessage`]s that need to be sent. * * Typically, this is used for messages initiating a payment flow rather than in response to * another message. The latter should use the return value of [`Self::handle_message`]. */ - ThreeTuple_OffersMessageDestinationBlindedPathZ[] release_pending_messages(); + TwoTuple_OffersMessageMessageSendInstructionsZ[] release_pending_messages(); } /** @@ -45,19 +47,22 @@ public class OffersMessageHandler : CommonBase { internal LDKOffersMessageHandlerImpl(OffersMessageHandlerInterface arg, LDKOffersMessageHandlerHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; } private OffersMessageHandlerInterface arg; private LDKOffersMessageHandlerHolder impl_holder; - public long handle_message(long _message) { + public long handle_message(long _message, long _context, long _responder) { org.ldk.structs.OffersMessage _message_hu_conv = org.ldk.structs.OffersMessage.constr_from_ptr(_message); if (_message_hu_conv != null) { _message_hu_conv.ptrs_to.AddLast(this); }; - Option_OffersMessageZ ret = arg.handle_message(_message_hu_conv); + org.ldk.structs.Option_OffersContextZ _context_hu_conv = org.ldk.structs.Option_OffersContextZ.constr_from_ptr(_context); + if (_context_hu_conv != null) { _context_hu_conv.ptrs_to.AddLast(this); }; + org.ldk.structs.Responder _responder_hu_conv = null; if (_responder < 0 || _responder > 4096) { _responder_hu_conv = new org.ldk.structs.Responder(null, _responder); } + if (_responder_hu_conv != null) { _responder_hu_conv.ptrs_to.AddLast(this); }; + Option_C2Tuple_OffersMessageResponseInstructionZZ ret = arg.handle_message(_message_hu_conv, _context_hu_conv, _responder_hu_conv); GC.KeepAlive(arg); 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(); + TwoTuple_OffersMessageMessageSendInstructionsZ[] ret = arg.release_pending_messages(); GC.KeepAlive(arg); - long result = InternalUtils.encodeUint64Array(InternalUtils.mapArray(ret, ret_conv_49 => ret_conv_49.clone_ptr())); + long result = InternalUtils.encodeUint64Array(InternalUtils.mapArray(ret, ret_conv_48 => ret_conv_48.clone_ptr())); return result; } } @@ -81,15 +86,18 @@ public class OffersMessageHandler : CommonBase { * The returned [`OffersMessage`], if any, is enqueued to be sent by [`OnionMessenger`]. * * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger + * + * Note that responder (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public Option_OffersMessageZ handle_message(org.ldk.structs.OffersMessage message) { - long ret = bindings.OffersMessageHandler_handle_message(this.ptr, message.ptr); + public Option_C2Tuple_OffersMessageResponseInstructionZZ handle_message(org.ldk.structs.OffersMessage message, org.ldk.structs.Option_OffersContextZ context, org.ldk.structs.Responder responder) { + long ret = bindings.OffersMessageHandler_handle_message(this.ptr, message.ptr, context.ptr, responder == null ? 0 : responder.ptr); GC.KeepAlive(this); GC.KeepAlive(message); + GC.KeepAlive(context); + GC.KeepAlive(responder); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Option_OffersMessageZ ret_hu_conv = org.ldk.structs.Option_OffersMessageZ.constr_from_ptr(ret); + org.ldk.structs.Option_C2Tuple_OffersMessageResponseInstructionZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_OffersMessageResponseInstructionZZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - if (this != null) { this.ptrs_to.AddLast(message); }; return ret_hu_conv; } @@ -99,20 +107,20 @@ public class OffersMessageHandler : CommonBase { * Typically, this is used for messages initiating a payment flow rather than in response to * another message. The latter should use the return value of [`Self::handle_message`]. */ - public ThreeTuple_OffersMessageDestinationBlindedPathZ[] release_pending_messages() { + public TwoTuple_OffersMessageMessageSendInstructionsZ[] release_pending_messages() { long ret = bindings.OffersMessageHandler_release_pending_messages(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - int ret_conv_49_len = InternalUtils.getArrayLength(ret); - ThreeTuple_OffersMessageDestinationBlindedPathZ[] ret_conv_49_arr = new ThreeTuple_OffersMessageDestinationBlindedPathZ[ret_conv_49_len]; - for (int x = 0; x < ret_conv_49_len; x++) { - long ret_conv_49 = InternalUtils.getU64ArrayElem(ret, x); - ThreeTuple_OffersMessageDestinationBlindedPathZ ret_conv_49_hu_conv = new ThreeTuple_OffersMessageDestinationBlindedPathZ(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_48_len = InternalUtils.getArrayLength(ret); + TwoTuple_OffersMessageMessageSendInstructionsZ[] ret_conv_48_arr = new TwoTuple_OffersMessageMessageSendInstructionsZ[ret_conv_48_len]; + for (int w = 0; w < ret_conv_48_len; w++) { + long ret_conv_48 = InternalUtils.getU64ArrayElem(ret, w); + TwoTuple_OffersMessageMessageSendInstructionsZ ret_conv_48_hu_conv = new TwoTuple_OffersMessageMessageSendInstructionsZ(null, ret_conv_48); + if (ret_conv_48_hu_conv != null) { ret_conv_48_hu_conv.ptrs_to.AddLast(this); }; + ret_conv_48_arr[w] = ret_conv_48_hu_conv; } bindings.free_buffer(ret); - return ret_conv_49_arr; + return ret_conv_48_arr; } } diff --git a/c_sharp/src/org/ldk/structs/OnionMessage.cs b/c_sharp/src/org/ldk/structs/OnionMessage.cs index 5a809be7..09628369 100644 --- a/c_sharp/src/org/ldk/structs/OnionMessage.cs +++ b/c_sharp/src/org/ldk/structs/OnionMessage.cs @@ -54,7 +54,6 @@ public class OnionMessage : CommonBase { bindings.OnionMessage_set_onion_routing_packet(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -67,7 +66,6 @@ public class OnionMessage : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.OnionMessage ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OnionMessage(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(onion_routing_packet_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/OnionMessageContents.cs b/c_sharp/src/org/ldk/structs/OnionMessageContents.cs index 61f863d9..be89103a 100644 --- a/c_sharp/src/org/ldk/structs/OnionMessageContents.cs +++ b/c_sharp/src/org/ldk/structs/OnionMessageContents.cs @@ -13,6 +13,9 @@ public interface OnionMessageContentsInterface { /**Returns the TLV type identifying the message contents. MUST be >= 64. */ long tlv_type(); + /**Returns the message type + */ + string msg_type(); /**Serialize the object into a byte array */ byte[] write(); @@ -43,6 +46,12 @@ public class OnionMessageContents : CommonBase { GC.KeepAlive(arg); return ret; } + public long msg_type() { + string ret = arg.msg_type(); + GC.KeepAlive(arg); + long result = InternalUtils.encodeString(ret); + return result; + } public long write() { byte[] ret = arg.write(); GC.KeepAlive(arg); @@ -78,6 +87,17 @@ public class OnionMessageContents : CommonBase { return ret; } + /** + * Returns the message type + */ + public string msg_type() { + long ret = bindings.OnionMessageContents_msg_type(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + string ret_conv = InternalUtils.decodeString(ret); + return ret_conv; + } + /** * Serialize the object into a byte array */ diff --git a/c_sharp/src/org/ldk/structs/OnionMessageHandler.cs b/c_sharp/src/org/ldk/structs/OnionMessageHandler.cs index b75211ea..5fa44ad2 100644 --- a/c_sharp/src/org/ldk/structs/OnionMessageHandler.cs +++ b/c_sharp/src/org/ldk/structs/OnionMessageHandler.cs @@ -10,15 +10,6 @@ namespace org { namespace ldk { namespace structs { /** An implementation of OnionMessageHandler */ public interface OnionMessageHandlerInterface { - /**Because much of the lightning network does not yet support forwarding onion messages, we - * may need to directly connect to a node which will forward a message for us. In such a case, - * this method will return the set of nodes which need connection by node_id and the - * corresponding socket addresses where they may accept incoming connections. - * - * Thus, this method should be polled regularly to detect messages await such a direct - * connection. - */ - TwoTuple_PublicKeyCVec_SocketAddressZZ[] get_and_clear_connections_needed(); /**Handle an incoming `onion_message` message from the given peer. */ void handle_onion_message(byte[] peer_node_id, OnionMessage msg); @@ -74,12 +65,6 @@ public class OnionMessageHandler : CommonBase { internal LDKOnionMessageHandlerImpl(OnionMessageHandlerInterface arg, LDKOnionMessageHandlerHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; } private OnionMessageHandlerInterface arg; private LDKOnionMessageHandlerHolder impl_holder; - 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.clone_ptr())); - return result; - } public void handle_onion_message(long _peer_node_id, long _msg) { byte[] _peer_node_id_conv = InternalUtils.decodeUint8Array(_peer_node_id); org.ldk.structs.OnionMessage _msg_hu_conv = null; if (_msg < 0 || _msg > 4096) { _msg_hu_conv = new org.ldk.structs.OnionMessage(null, _msg); } @@ -137,31 +122,6 @@ public class OnionMessageHandler : CommonBase { return impl_holder.held; } - /** - * Because much of the lightning network does not yet support forwarding onion messages, we - * may need to directly connect to a node which will forward a message for us. In such a case, - * this method will return the set of nodes which need connection by node_id and the - * corresponding socket addresses where they may accept incoming connections. - * - * Thus, this method should be polled regularly to detect messages await such a direct - * connection. - */ - public TwoTuple_PublicKeyCVec_SocketAddressZZ[] get_and_clear_connections_needed() { - long ret = bindings.OnionMessageHandler_get_and_clear_connections_needed(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - int ret_conv_40_len = InternalUtils.getArrayLength(ret); - TwoTuple_PublicKeyCVec_SocketAddressZZ[] ret_conv_40_arr = new TwoTuple_PublicKeyCVec_SocketAddressZZ[ret_conv_40_len]; - for (int o = 0; o < ret_conv_40_len; o++) { - long ret_conv_40 = InternalUtils.getU64ArrayElem(ret, o); - TwoTuple_PublicKeyCVec_SocketAddressZZ ret_conv_40_hu_conv = new TwoTuple_PublicKeyCVec_SocketAddressZZ(null, ret_conv_40); - if (ret_conv_40_hu_conv != null) { ret_conv_40_hu_conv.ptrs_to.AddLast(this); }; - ret_conv_40_arr[o] = ret_conv_40_hu_conv; - } - bindings.free_buffer(ret); - return ret_conv_40_arr; - } - /** * Handle an incoming `onion_message` message from the given peer. */ diff --git a/c_sharp/src/org/ldk/structs/OnionMessagePath.cs b/c_sharp/src/org/ldk/structs/OnionMessagePath.cs index 8c825a43..390e93c8 100644 --- a/c_sharp/src/org/ldk/structs/OnionMessagePath.cs +++ b/c_sharp/src/org/ldk/structs/OnionMessagePath.cs @@ -63,7 +63,6 @@ public class OnionMessagePath : CommonBase { bindings.OnionMessagePath_set_destination(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -93,7 +92,6 @@ public class OnionMessagePath : CommonBase { bindings.OnionMessagePath_set_first_node_addresses(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -107,8 +105,6 @@ public class OnionMessagePath : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.OnionMessagePath ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OnionMessagePath(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(destination_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(first_node_addresses_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/OnionMessenger.cs b/c_sharp/src/org/ldk/structs/OnionMessenger.cs index 56e89563..6a163c76 100644 --- a/c_sharp/src/org/ldk/structs/OnionMessenger.cs +++ b/c_sharp/src/org/ldk/structs/OnionMessenger.cs @@ -28,12 +28,13 @@ namespace org { namespace ldk { namespace structs { * ``` * # extern crate bitcoin; * # use bitcoin::hashes::_export::_core::time::Duration; - * # use bitcoin::hashes::hex::FromHex; + * # use bitcoin::hex::FromHex; * # use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey, self}; - * # use lightning::blinded_path::{BlindedPath, EmptyNodeIdLookUp}; + * # use lightning::blinded_path::EmptyNodeIdLookUp; + * # use lightning::blinded_path::message::{BlindedMessagePath, MessageForwardNode, MessageContext}; * # use lightning::sign::{EntropySource, KeysManager}; * # use lightning::ln::peer_handler::IgnoringMessageHandler; - * # use lightning::onion_message::messenger::{Destination, MessageRouter, OnionMessagePath, OnionMessenger}; + * # use lightning::onion_message::messenger::{Destination, MessageRouter, MessageSendInstructions, OnionMessagePath, OnionMessenger}; * # use lightning::onion_message::packet::OnionMessageContents; * # use lightning::util::logger::{Logger, Record}; * # use lightning::util::ser::{Writeable, Writer}; @@ -57,8 +58,8 @@ namespace org { namespace ldk { namespace structs { * # }) * # } * # fn create_blinded_paths( - * # &self, _recipient: PublicKey, _peers: Vec, _secp_ctx: &Secp256k1 - * # ) -> Result, ()> { + * # &self, _recipient: PublicKey, _context: MessageContext, _peers: Vec, _secp_ctx: &Secp256k1 + * # ) -> Result, ()> { * # unreachable!() * # } * # } @@ -75,11 +76,12 @@ namespace org { namespace ldk { namespace structs { * # let message_router = Arc::new(FakeMessageRouter {}); * # let custom_message_handler = IgnoringMessageHandler {}; * # let offers_message_handler = IgnoringMessageHandler {}; + * # let async_payments_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, &node_id_lookup, message_router, - * &offers_message_handler, &custom_message_handler + * &offers_message_handler, &async_payments_message_handler, &custom_message_handler * ); * * # #[derive(Debug, Clone)] @@ -95,23 +97,28 @@ namespace org { namespace ldk { namespace structs { * \t\t# let your_custom_message_type = 42; * \t\tyour_custom_message_type * \t} + * \tfn msg_type(&self) -> &'static str { \"YourCustomMessageType\" } * } * Send a custom onion message to a node id. * let destination = Destination::Node(destination_node_id); - * let reply_path = None; + * let instructions = MessageSendInstructions::WithoutReplyPath { destination }; * # let message = YourCustomMessage {}; - * onion_messenger.send_onion_message(message, destination, reply_path); + * onion_messenger.send_onion_message(message, instructions); * * Create a blinded path to yourself, for someone to send an onion message to. * # let your_node_id = hop_node_id1; - * let hops = [hop_node_id3, hop_node_id4, your_node_id]; - * let blinded_path = BlindedPath::new_for_message(&hops, &keys_manager, &secp_ctx).unwrap(); + * let hops = [ + * \tMessageForwardNode { node_id: hop_node_id3, short_channel_id: None }, + * \tMessageForwardNode { node_id: hop_node_id4, short_channel_id: None }, + * ]; + * let context = MessageContext::Custom(Vec::new()); + * let blinded_path = BlindedMessagePath::new(&hops, your_node_id, context, &keys_manager, &secp_ctx).unwrap(); * * Send a custom onion message to a blinded path. * let destination = Destination::BlindedPath(blinded_path); - * let reply_path = None; + * let instructions = MessageSendInstructions::WithoutReplyPath { destination }; * # let message = YourCustomMessage {}; - * onion_messenger.send_onion_message(message, destination, reply_path); + * onion_messenger.send_onion_message(message, instructions); * ``` * * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest @@ -127,14 +134,15 @@ 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.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); + 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.AsyncPaymentsMessageHandler async_payments_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, async_payments_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(async_payments_handler); GC.KeepAlive(custom_handler); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.OnionMessenger ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OnionMessenger(null, ret); } @@ -145,28 +153,137 @@ public class OnionMessenger : CommonBase { 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(async_payments_handler); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(custom_handler); }; return ret_hu_conv; } /** - * Sends an [`OnionMessage`] with the given `contents` to `destination`. + * Similar to [`Self::new`], but rather than dropping onion messages that are + * intended to be forwarded to offline peers, we will intercept them for + * later forwarding. * - * See [`OnionMessenger`] for example usage. + * Interception flow: + * 1. If an onion message for an offline peer is received, `OnionMessenger` will + * generate an [`Event::OnionMessageIntercepted`]. Event handlers can + * then choose to persist this onion message for later forwarding, or drop + * it. + * 2. When the offline peer later comes back online, `OnionMessenger` will + * generate an [`Event::OnionMessagePeerConnected`]. Event handlers will + * then fetch all previously intercepted onion messages for this peer. + * 3. Once the stored onion messages are fetched, they can finally be + * forwarded to the now-online peer via [`Self::forward_onion_message`]. * - * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None + * # Note + * + * LDK will not rate limit how many [`Event::OnionMessageIntercepted`]s + * are generated, so it is the caller's responsibility to limit how many + * onion messages are persisted and only persist onion messages for relevant + * peers. */ - public Result_SendSuccessSendErrorZ send_onion_message(org.ldk.structs.OnionMessageContents contents, org.ldk.structs.Destination destination, org.ldk.structs.BlindedPath reply_path) { - long ret = bindings.OnionMessenger_send_onion_message(this.ptr, contents.ptr, destination.ptr, reply_path == null ? 0 : reply_path.ptr); + public static OnionMessenger new_with_offline_peer_interception(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.AsyncPaymentsMessageHandler async_payments_handler, org.ldk.structs.CustomOnionMessageHandler custom_handler) { + long ret = bindings.OnionMessenger_new_with_offline_peer_interception(entropy_source.ptr, node_signer.ptr, logger.ptr, node_id_lookup.ptr, message_router.ptr, offers_handler.ptr, async_payments_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(async_payments_handler); + GC.KeepAlive(custom_handler); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OnionMessenger ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OnionMessenger(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); }; + 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(async_payments_handler); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(custom_handler); }; + return ret_hu_conv; + } + + /** + * Sends an [`OnionMessage`] based on its [`MessageSendInstructions`]. + */ + public Result_SendSuccessSendErrorZ send_onion_message(org.ldk.structs.OnionMessageContents contents, org.ldk.structs.MessageSendInstructions instructions) { + long ret = bindings.OnionMessenger_send_onion_message(this.ptr, contents.ptr, instructions.ptr); GC.KeepAlive(this); GC.KeepAlive(contents); - GC.KeepAlive(destination); - GC.KeepAlive(reply_path); + GC.KeepAlive(instructions); if (ret >= 0 && ret <= 4096) { return null; } Result_SendSuccessSendErrorZ ret_hu_conv = Result_SendSuccessSendErrorZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.AddLast(contents); }; - if (this != null) { this.ptrs_to.AddLast(destination); }; - if (this != null) { this.ptrs_to.AddLast(reply_path); }; + return ret_hu_conv; + } + + /** + * Forwards an [`OnionMessage`] to `peer_node_id`. Useful if we initialized + * the [`OnionMessenger`] with [`Self::new_with_offline_peer_interception`] + * and want to forward a previously intercepted onion message to a peer that + * has just come online. + */ + public Result_NoneSendErrorZ forward_onion_message(org.ldk.structs.OnionMessage message, byte[] peer_node_id) { + long ret = bindings.OnionMessenger_forward_onion_message(this.ptr, message.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(peer_node_id, 33))); + GC.KeepAlive(this); + GC.KeepAlive(message); + GC.KeepAlive(peer_node_id); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneSendErrorZ ret_hu_conv = Result_NoneSendErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Handles the response to an [`OnionMessage`] based on its [`ResponseInstruction`], + * enqueueing any response for sending. + * + * This function is useful for asynchronous handling of [`OnionMessage`]s. + * Handlers have the option to return `None`, indicating that no immediate response should be + * sent. Then, they can transfer the associated [`Responder`] to another task responsible for + * generating the response asynchronously. Subsequently, when the response is prepared and + * ready for sending, that task can invoke this method to enqueue the response for delivery. + */ + public Result_SendSuccessSendErrorZ handle_onion_message_response(org.ldk.structs.OnionMessageContents response, org.ldk.structs.ResponseInstruction instructions) { + long ret = bindings.OnionMessenger_handle_onion_message_response(this.ptr, response.ptr, instructions.ptr); + GC.KeepAlive(this); + GC.KeepAlive(response); + GC.KeepAlive(instructions); + if (ret >= 0 && ret <= 4096) { return null; } + Result_SendSuccessSendErrorZ ret_hu_conv = Result_SendSuccessSendErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(response); }; + return ret_hu_conv; + } + + /** + * Gets a [`Future`] that completes when an event is available via + * [`EventsProvider::process_pending_events`] or [`Self::process_pending_events_async`]. + * + * Note that callbacks registered on the [`Future`] MUST NOT call back into this + * [`OnionMessenger`] and should instead register actions to be taken later. + * + * [`EventsProvider::process_pending_events`]: crate::events::EventsProvider::process_pending_events + */ + public Future get_update_future() { + long ret = bindings.OnionMessenger_get_update_future(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; + } + + /** + * Constructs a new EventsProvider which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is + */ + public EventsProvider as_EventsProvider() { + long ret = bindings.OnionMessenger_as_EventsProvider(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + EventsProvider ret_hu_conv = new EventsProvider(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/OpenChannel.cs b/c_sharp/src/org/ldk/structs/OpenChannel.cs index 418bc33e..26ddf376 100644 --- a/c_sharp/src/org/ldk/structs/OpenChannel.cs +++ b/c_sharp/src/org/ldk/structs/OpenChannel.cs @@ -38,7 +38,6 @@ public class OpenChannel : CommonBase { bindings.OpenChannel_set_common_fields(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -88,7 +87,6 @@ public class OpenChannel : CommonBase { 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(common_fields_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/OpenChannelV2.cs b/c_sharp/src/org/ldk/structs/OpenChannelV2.cs index 73689945..aeaebcab 100644 --- a/c_sharp/src/org/ldk/structs/OpenChannelV2.cs +++ b/c_sharp/src/org/ldk/structs/OpenChannelV2.cs @@ -36,7 +36,6 @@ public class OpenChannelV2 : CommonBase { bindings.OpenChannelV2_set_common_fields(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -126,7 +125,6 @@ public class OpenChannelV2 : CommonBase { 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(common_fields_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Option_APIErrorZ.cs b/c_sharp/src/org/ldk/structs/Option_APIErrorZ.cs index 79a86b95..271036db 100644 --- a/c_sharp/src/org/ldk/structs/Option_APIErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Option_APIErrorZ.cs @@ -48,7 +48,6 @@ public class Option_APIErrorZ : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_APIErrorZ ret_hu_conv = org.ldk.structs.Option_APIErrorZ.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; } diff --git a/c_sharp/src/org/ldk/structs/Option_AmountZ.cs b/c_sharp/src/org/ldk/structs/Option_AmountZ.cs index 21bfe561..c809a569 100644 --- a/c_sharp/src/org/ldk/structs/Option_AmountZ.cs +++ b/c_sharp/src/org/ldk/structs/Option_AmountZ.cs @@ -48,7 +48,6 @@ public class Option_AmountZ : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/Option_C2Tuple_OffersMessageResponseInstructionZZ.cs b/c_sharp/src/org/ldk/structs/Option_C2Tuple_OffersMessageResponseInstructionZZ.cs new file mode 100644 index 00000000..0f192e9d --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Option_C2Tuple_OffersMessageResponseInstructionZZ.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 enum which can either contain a crate::c_types::derived::C2Tuple_OffersMessageResponseInstructionZ or not + */ +public class Option_C2Tuple_OffersMessageResponseInstructionZZ : CommonBase { + protected Option_C2Tuple_OffersMessageResponseInstructionZZ(object _dummy, long ptr) : base(ptr) { } + ~Option_C2Tuple_OffersMessageResponseInstructionZZ() { + if (ptr != 0) { bindings.COption_C2Tuple_OffersMessageResponseInstructionZZ_free(ptr); } + } + + internal static Option_C2Tuple_OffersMessageResponseInstructionZZ constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Option_C2Tuple_OffersMessageResponseInstructionZZ_Some(ptr); + case 1: return new Option_C2Tuple_OffersMessageResponseInstructionZZ_None(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Option_C2Tuple_OffersMessageResponseInstructionZZ of type Some */ + public class Option_C2Tuple_OffersMessageResponseInstructionZZ_Some : Option_C2Tuple_OffersMessageResponseInstructionZZ { + public TwoTuple_OffersMessageResponseInstructionZ some; + internal Option_C2Tuple_OffersMessageResponseInstructionZZ_Some(long ptr) : base(null, ptr) { + long some = bindings.LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_Some_get_some(ptr); + TwoTuple_OffersMessageResponseInstructionZ some_hu_conv = new TwoTuple_OffersMessageResponseInstructionZ(null, some); + if (some_hu_conv != null) { some_hu_conv.ptrs_to.AddLast(this); }; + this.some = some_hu_conv; + } + } + /** A Option_C2Tuple_OffersMessageResponseInstructionZZ of type None */ + public class Option_C2Tuple_OffersMessageResponseInstructionZZ_None : Option_C2Tuple_OffersMessageResponseInstructionZZ { + internal Option_C2Tuple_OffersMessageResponseInstructionZZ_None(long ptr) : base(null, ptr) { + } + } + /** + * Constructs a new COption_C2Tuple_OffersMessageResponseInstructionZZ containing a crate::c_types::derived::C2Tuple_OffersMessageResponseInstructionZ + */ + public static Option_C2Tuple_OffersMessageResponseInstructionZZ some(org.ldk.structs.TwoTuple_OffersMessageResponseInstructionZ o) { + long ret = bindings.COption_C2Tuple_OffersMessageResponseInstructionZZ_some(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_OffersMessageResponseInstructionZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_OffersMessageResponseInstructionZZ.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_C2Tuple_OffersMessageResponseInstructionZZ containing nothing + */ + public static Option_C2Tuple_OffersMessageResponseInstructionZZ none() { + long ret = bindings.COption_C2Tuple_OffersMessageResponseInstructionZZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_OffersMessageResponseInstructionZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_OffersMessageResponseInstructionZZ.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_C2Tuple_OffersMessageResponseInstructionZZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new COption_C2Tuple_OffersMessageResponseInstructionZZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_C2Tuple_OffersMessageResponseInstructionZZ clone() { + long ret = bindings.COption_C2Tuple_OffersMessageResponseInstructionZZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_OffersMessageResponseInstructionZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_OffersMessageResponseInstructionZZ.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_C2Tuple_OnionMessageContentsResponseInstructionZZ.cs b/c_sharp/src/org/ldk/structs/Option_C2Tuple_OnionMessageContentsResponseInstructionZZ.cs new file mode 100644 index 00000000..f1346c53 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Option_C2Tuple_OnionMessageContentsResponseInstructionZZ.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 enum which can either contain a crate::c_types::derived::C2Tuple_OnionMessageContentsResponseInstructionZ or not + */ +public class Option_C2Tuple_OnionMessageContentsResponseInstructionZZ : CommonBase { + protected Option_C2Tuple_OnionMessageContentsResponseInstructionZZ(object _dummy, long ptr) : base(ptr) { } + ~Option_C2Tuple_OnionMessageContentsResponseInstructionZZ() { + if (ptr != 0) { bindings.COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_free(ptr); } + } + + internal static Option_C2Tuple_OnionMessageContentsResponseInstructionZZ constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Option_C2Tuple_OnionMessageContentsResponseInstructionZZ_Some(ptr); + case 1: return new Option_C2Tuple_OnionMessageContentsResponseInstructionZZ_None(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Option_C2Tuple_OnionMessageContentsResponseInstructionZZ of type Some */ + public class Option_C2Tuple_OnionMessageContentsResponseInstructionZZ_Some : Option_C2Tuple_OnionMessageContentsResponseInstructionZZ { + public TwoTuple_OnionMessageContentsResponseInstructionZ some; + internal Option_C2Tuple_OnionMessageContentsResponseInstructionZZ_Some(long ptr) : base(null, ptr) { + long some = bindings.LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Some_get_some(ptr); + TwoTuple_OnionMessageContentsResponseInstructionZ some_hu_conv = new TwoTuple_OnionMessageContentsResponseInstructionZ(null, some); + if (some_hu_conv != null) { some_hu_conv.ptrs_to.AddLast(this); }; + this.some = some_hu_conv; + } + } + /** A Option_C2Tuple_OnionMessageContentsResponseInstructionZZ of type None */ + public class Option_C2Tuple_OnionMessageContentsResponseInstructionZZ_None : Option_C2Tuple_OnionMessageContentsResponseInstructionZZ { + internal Option_C2Tuple_OnionMessageContentsResponseInstructionZZ_None(long ptr) : base(null, ptr) { + } + } + /** + * Constructs a new COption_C2Tuple_OnionMessageContentsResponseInstructionZZ containing a crate::c_types::derived::C2Tuple_OnionMessageContentsResponseInstructionZ + */ + public static Option_C2Tuple_OnionMessageContentsResponseInstructionZZ some(org.ldk.structs.TwoTuple_OnionMessageContentsResponseInstructionZ o) { + long ret = bindings.COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_some(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_OnionMessageContentsResponseInstructionZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_OnionMessageContentsResponseInstructionZZ.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_C2Tuple_OnionMessageContentsResponseInstructionZZ containing nothing + */ + public static Option_C2Tuple_OnionMessageContentsResponseInstructionZZ none() { + long ret = bindings.COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_OnionMessageContentsResponseInstructionZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_OnionMessageContentsResponseInstructionZZ.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_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new COption_C2Tuple_OnionMessageContentsResponseInstructionZZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_C2Tuple_OnionMessageContentsResponseInstructionZZ clone() { + long ret = bindings.COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_OnionMessageContentsResponseInstructionZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_OnionMessageContentsResponseInstructionZZ.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_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ.cs b/c_sharp/src/org/ldk/structs/Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ.cs new file mode 100644 index 00000000..637d054e --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ.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 enum which can either contain a crate::c_types::derived::C2Tuple_ReleaseHeldHtlcResponseInstructionZ or not + */ +public class Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ : CommonBase { + protected Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ(object _dummy, long ptr) : base(ptr) { } + ~Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ() { + if (ptr != 0) { bindings.COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_free(ptr); } + } + + internal static Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_Some(ptr); + case 1: return new Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_None(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ of type Some */ + public class Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_Some : Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ { + public TwoTuple_ReleaseHeldHtlcResponseInstructionZ some; + internal Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_Some(long ptr) : base(null, ptr) { + long some = bindings.LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_Some_get_some(ptr); + TwoTuple_ReleaseHeldHtlcResponseInstructionZ some_hu_conv = new TwoTuple_ReleaseHeldHtlcResponseInstructionZ(null, some); + if (some_hu_conv != null) { some_hu_conv.ptrs_to.AddLast(this); }; + this.some = some_hu_conv; + } + } + /** A Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ of type None */ + public class Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_None : Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ { + internal Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_None(long ptr) : base(null, ptr) { + } + } + /** + * Constructs a new COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ containing a crate::c_types::derived::C2Tuple_ReleaseHeldHtlcResponseInstructionZ + */ + public static Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ some(org.ldk.structs.TwoTuple_ReleaseHeldHtlcResponseInstructionZ o) { + long ret = bindings.COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_some(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ.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_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ containing nothing + */ + public static Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ none() { + long ret = bindings.COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ.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_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ clone() { + long ret = bindings.COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ.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_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ.cs b/c_sharp/src/org/ldk/structs/Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ.cs index a85bb2fe..912e631b 100644 --- a/c_sharp/src/org/ldk/structs/Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ.cs +++ b/c_sharp/src/org/ldk/structs/Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ.cs @@ -48,6 +48,7 @@ public class Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ : CommonBase { 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); 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; } diff --git a/c_sharp/src/org/ldk/structs/Option_CVec_SocketAddressZZ.cs b/c_sharp/src/org/ldk/structs/Option_CVec_SocketAddressZZ.cs index 616239ee..dc5f7645 100644 --- a/c_sharp/src/org/ldk/structs/Option_CVec_SocketAddressZZ.cs +++ b/c_sharp/src/org/ldk/structs/Option_CVec_SocketAddressZZ.cs @@ -55,7 +55,6 @@ public class Option_CVec_SocketAddressZZ : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_CVec_SocketAddressZZ ret_hu_conv = org.ldk.structs.Option_CVec_SocketAddressZZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - foreach (SocketAddress o_conv_15 in o) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o_conv_15); }; }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Option_ClosureReasonZ.cs b/c_sharp/src/org/ldk/structs/Option_ClosureReasonZ.cs index b446b58f..e23a39f1 100644 --- a/c_sharp/src/org/ldk/structs/Option_ClosureReasonZ.cs +++ b/c_sharp/src/org/ldk/structs/Option_ClosureReasonZ.cs @@ -48,7 +48,6 @@ public class Option_ClosureReasonZ : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_ClosureReasonZ ret_hu_conv = org.ldk.structs.Option_ClosureReasonZ.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; } diff --git a/c_sharp/src/org/ldk/structs/Option_EventZ.cs b/c_sharp/src/org/ldk/structs/Option_EventZ.cs index 7dbb57ae..f9cd535d 100644 --- a/c_sharp/src/org/ldk/structs/Option_EventZ.cs +++ b/c_sharp/src/org/ldk/structs/Option_EventZ.cs @@ -48,7 +48,6 @@ public class Option_EventZ : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_EventZ ret_hu_conv = org.ldk.structs.Option_EventZ.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; } diff --git a/c_sharp/src/org/ldk/structs/Option_HTLCDestinationZ.cs b/c_sharp/src/org/ldk/structs/Option_HTLCDestinationZ.cs index b7ba1f9f..a16b1785 100644 --- a/c_sharp/src/org/ldk/structs/Option_HTLCDestinationZ.cs +++ b/c_sharp/src/org/ldk/structs/Option_HTLCDestinationZ.cs @@ -48,7 +48,6 @@ public class Option_HTLCDestinationZ : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_HTLCDestinationZ ret_hu_conv = org.ldk.structs.Option_HTLCDestinationZ.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; } diff --git a/c_sharp/src/org/ldk/structs/Option_MaxDustHTLCExposureZ.cs b/c_sharp/src/org/ldk/structs/Option_MaxDustHTLCExposureZ.cs index d1857790..961f7a2a 100644 --- a/c_sharp/src/org/ldk/structs/Option_MaxDustHTLCExposureZ.cs +++ b/c_sharp/src/org/ldk/structs/Option_MaxDustHTLCExposureZ.cs @@ -48,7 +48,6 @@ public class Option_MaxDustHTLCExposureZ : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_MaxDustHTLCExposureZ ret_hu_conv = org.ldk.structs.Option_MaxDustHTLCExposureZ.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; } diff --git a/c_sharp/src/org/ldk/structs/Option_MessageContextZ.cs b/c_sharp/src/org/ldk/structs/Option_MessageContextZ.cs new file mode 100644 index 00000000..abb682fc --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Option_MessageContextZ.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 enum which can either contain a crate::lightning::blinded_path::message::MessageContext or not + */ +public class Option_MessageContextZ : CommonBase { + protected Option_MessageContextZ(object _dummy, long ptr) : base(ptr) { } + ~Option_MessageContextZ() { + if (ptr != 0) { bindings.COption_MessageContextZ_free(ptr); } + } + + internal static Option_MessageContextZ constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKCOption_MessageContextZ_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Option_MessageContextZ_Some(ptr); + case 1: return new Option_MessageContextZ_None(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Option_MessageContextZ of type Some */ + public class Option_MessageContextZ_Some : Option_MessageContextZ { + public MessageContext some; + internal Option_MessageContextZ_Some(long ptr) : base(null, ptr) { + long some = bindings.LDKCOption_MessageContextZ_Some_get_some(ptr); + org.ldk.structs.MessageContext some_hu_conv = org.ldk.structs.MessageContext.constr_from_ptr(some); + if (some_hu_conv != null) { some_hu_conv.ptrs_to.AddLast(this); }; + this.some = some_hu_conv; + } + } + /** A Option_MessageContextZ of type None */ + public class Option_MessageContextZ_None : Option_MessageContextZ { + internal Option_MessageContextZ_None(long ptr) : base(null, ptr) { + } + } + /** + * Constructs a new COption_MessageContextZ containing a crate::lightning::blinded_path::message::MessageContext + */ + public static Option_MessageContextZ some(org.ldk.structs.MessageContext o) { + long ret = bindings.COption_MessageContextZ_some(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_MessageContextZ ret_hu_conv = org.ldk.structs.Option_MessageContextZ.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_MessageContextZ containing nothing + */ + public static Option_MessageContextZ none() { + long ret = bindings.COption_MessageContextZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_MessageContextZ ret_hu_conv = org.ldk.structs.Option_MessageContextZ.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_MessageContextZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new COption_MessageContextZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_MessageContextZ clone() { + long ret = bindings.COption_MessageContextZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_MessageContextZ ret_hu_conv = org.ldk.structs.Option_MessageContextZ.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_MonitorEventZ.cs b/c_sharp/src/org/ldk/structs/Option_MonitorEventZ.cs index 1032ce18..10ca0582 100644 --- a/c_sharp/src/org/ldk/structs/Option_MonitorEventZ.cs +++ b/c_sharp/src/org/ldk/structs/Option_MonitorEventZ.cs @@ -48,7 +48,6 @@ public class Option_MonitorEventZ : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_MonitorEventZ ret_hu_conv = org.ldk.structs.Option_MonitorEventZ.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; } diff --git a/c_sharp/src/org/ldk/structs/Option_NetworkUpdateZ.cs b/c_sharp/src/org/ldk/structs/Option_NetworkUpdateZ.cs index a5b3b4f1..ff05f1d9 100644 --- a/c_sharp/src/org/ldk/structs/Option_NetworkUpdateZ.cs +++ b/c_sharp/src/org/ldk/structs/Option_NetworkUpdateZ.cs @@ -48,7 +48,6 @@ public class Option_NetworkUpdateZ : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_NetworkUpdateZ ret_hu_conv = org.ldk.structs.Option_NetworkUpdateZ.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; } diff --git a/c_sharp/src/org/ldk/structs/Option_NodeAnnouncementInfoZ.cs b/c_sharp/src/org/ldk/structs/Option_NodeAnnouncementInfoZ.cs new file mode 100644 index 00000000..12b5d0f3 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Option_NodeAnnouncementInfoZ.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 enum which can either contain a crate::lightning::routing::gossip::NodeAnnouncementInfo or not + */ +public class Option_NodeAnnouncementInfoZ : CommonBase { + protected Option_NodeAnnouncementInfoZ(object _dummy, long ptr) : base(ptr) { } + ~Option_NodeAnnouncementInfoZ() { + if (ptr != 0) { bindings.COption_NodeAnnouncementInfoZ_free(ptr); } + } + + internal static Option_NodeAnnouncementInfoZ constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKCOption_NodeAnnouncementInfoZ_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Option_NodeAnnouncementInfoZ_Some(ptr); + case 1: return new Option_NodeAnnouncementInfoZ_None(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Option_NodeAnnouncementInfoZ of type Some */ + public class Option_NodeAnnouncementInfoZ_Some : Option_NodeAnnouncementInfoZ { + public NodeAnnouncementInfo some; + internal Option_NodeAnnouncementInfoZ_Some(long ptr) : base(null, ptr) { + long some = bindings.LDKCOption_NodeAnnouncementInfoZ_Some_get_some(ptr); + org.ldk.structs.NodeAnnouncementInfo some_hu_conv = org.ldk.structs.NodeAnnouncementInfo.constr_from_ptr(some); + if (some_hu_conv != null) { some_hu_conv.ptrs_to.AddLast(this); }; + this.some = some_hu_conv; + } + } + /** A Option_NodeAnnouncementInfoZ of type None */ + public class Option_NodeAnnouncementInfoZ_None : Option_NodeAnnouncementInfoZ { + internal Option_NodeAnnouncementInfoZ_None(long ptr) : base(null, ptr) { + } + } + /** + * Constructs a new COption_NodeAnnouncementInfoZ containing a crate::lightning::routing::gossip::NodeAnnouncementInfo + */ + public static Option_NodeAnnouncementInfoZ some(org.ldk.structs.NodeAnnouncementInfo o) { + long ret = bindings.COption_NodeAnnouncementInfoZ_some(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_NodeAnnouncementInfoZ ret_hu_conv = org.ldk.structs.Option_NodeAnnouncementInfoZ.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_NodeAnnouncementInfoZ containing nothing + */ + public static Option_NodeAnnouncementInfoZ none() { + long ret = bindings.COption_NodeAnnouncementInfoZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_NodeAnnouncementInfoZ ret_hu_conv = org.ldk.structs.Option_NodeAnnouncementInfoZ.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_NodeAnnouncementInfoZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new COption_NodeAnnouncementInfoZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_NodeAnnouncementInfoZ clone() { + long ret = bindings.COption_NodeAnnouncementInfoZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_NodeAnnouncementInfoZ ret_hu_conv = org.ldk.structs.Option_NodeAnnouncementInfoZ.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_OffersContextZ.cs b/c_sharp/src/org/ldk/structs/Option_OffersContextZ.cs new file mode 100644 index 00000000..c006fae2 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Option_OffersContextZ.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 enum which can either contain a crate::lightning::blinded_path::message::OffersContext or not + */ +public class Option_OffersContextZ : CommonBase { + protected Option_OffersContextZ(object _dummy, long ptr) : base(ptr) { } + ~Option_OffersContextZ() { + if (ptr != 0) { bindings.COption_OffersContextZ_free(ptr); } + } + + internal static Option_OffersContextZ constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKCOption_OffersContextZ_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Option_OffersContextZ_Some(ptr); + case 1: return new Option_OffersContextZ_None(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Option_OffersContextZ of type Some */ + public class Option_OffersContextZ_Some : Option_OffersContextZ { + public OffersContext some; + internal Option_OffersContextZ_Some(long ptr) : base(null, ptr) { + long some = bindings.LDKCOption_OffersContextZ_Some_get_some(ptr); + org.ldk.structs.OffersContext some_hu_conv = org.ldk.structs.OffersContext.constr_from_ptr(some); + if (some_hu_conv != null) { some_hu_conv.ptrs_to.AddLast(this); }; + this.some = some_hu_conv; + } + } + /** A Option_OffersContextZ of type None */ + public class Option_OffersContextZ_None : Option_OffersContextZ { + internal Option_OffersContextZ_None(long ptr) : base(null, ptr) { + } + } + /** + * Constructs a new COption_OffersContextZ containing a crate::lightning::blinded_path::message::OffersContext + */ + public static Option_OffersContextZ some(org.ldk.structs.OffersContext o) { + long ret = bindings.COption_OffersContextZ_some(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_OffersContextZ ret_hu_conv = org.ldk.structs.Option_OffersContextZ.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_OffersContextZ containing nothing + */ + public static Option_OffersContextZ none() { + long ret = bindings.COption_OffersContextZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_OffersContextZ ret_hu_conv = org.ldk.structs.Option_OffersContextZ.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_OffersContextZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new COption_OffersContextZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_OffersContextZ clone() { + long ret = bindings.COption_OffersContextZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_OffersContextZ ret_hu_conv = org.ldk.structs.Option_OffersContextZ.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_OffersMessageZ.cs b/c_sharp/src/org/ldk/structs/Option_OffersMessageZ.cs deleted file mode 100644 index 88a2c1fa..00000000 --- a/c_sharp/src/org/ldk/structs/Option_OffersMessageZ.cs +++ /dev/null @@ -1,86 +0,0 @@ -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::onion_message::offers::OffersMessage or not - */ -public class Option_OffersMessageZ : CommonBase { - protected Option_OffersMessageZ(object _dummy, long ptr) : base(ptr) { } - ~Option_OffersMessageZ() { - if (ptr != 0) { bindings.COption_OffersMessageZ_free(ptr); } - } - - internal static Option_OffersMessageZ constr_from_ptr(long ptr) { - long raw_ty = bindings.LDKCOption_OffersMessageZ_ty_from_ptr(ptr); - switch (raw_ty) { - case 0: return new Option_OffersMessageZ_Some(ptr); - case 1: return new Option_OffersMessageZ_None(ptr); - default: - throw new ArgumentException("Impossible enum variant"); - } - } - - /** A Option_OffersMessageZ of type Some */ - public class Option_OffersMessageZ_Some : Option_OffersMessageZ { - public OffersMessage some; - internal Option_OffersMessageZ_Some(long ptr) : base(null, ptr) { - long some = bindings.LDKCOption_OffersMessageZ_Some_get_some(ptr); - org.ldk.structs.OffersMessage some_hu_conv = org.ldk.structs.OffersMessage.constr_from_ptr(some); - if (some_hu_conv != null) { some_hu_conv.ptrs_to.AddLast(this); }; - this.some = some_hu_conv; - } - } - /** A Option_OffersMessageZ of type None */ - public class Option_OffersMessageZ_None : Option_OffersMessageZ { - internal Option_OffersMessageZ_None(long ptr) : base(null, ptr) { - } - } - /** - * Constructs a new COption_OffersMessageZ containing a crate::lightning::onion_message::offers::OffersMessage - */ - public static Option_OffersMessageZ some(org.ldk.structs.OffersMessage o) { - long ret = bindings.COption_OffersMessageZ_some(o.ptr); - GC.KeepAlive(o); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Option_OffersMessageZ ret_hu_conv = org.ldk.structs.Option_OffersMessageZ.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_OffersMessageZ containing nothing - */ - public static Option_OffersMessageZ none() { - long ret = bindings.COption_OffersMessageZ_none(); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Option_OffersMessageZ ret_hu_conv = org.ldk.structs.Option_OffersMessageZ.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_OffersMessageZ_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a new COption_OffersMessageZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Option_OffersMessageZ clone() { - long ret = bindings.COption_OffersMessageZ_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Option_OffersMessageZ ret_hu_conv = org.ldk.structs.Option_OffersMessageZ.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_PathFailureZ.cs b/c_sharp/src/org/ldk/structs/Option_PathFailureZ.cs index b16753b9..a05bdfaa 100644 --- a/c_sharp/src/org/ldk/structs/Option_PathFailureZ.cs +++ b/c_sharp/src/org/ldk/structs/Option_PathFailureZ.cs @@ -48,7 +48,6 @@ public class Option_PathFailureZ : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_PathFailureZ ret_hu_conv = org.ldk.structs.Option_PathFailureZ.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; } diff --git a/c_sharp/src/org/ldk/structs/Option_PaymentContextZ.cs b/c_sharp/src/org/ldk/structs/Option_PaymentContextZ.cs index 115f523a..e7e7a5ae 100644 --- a/c_sharp/src/org/ldk/structs/Option_PaymentContextZ.cs +++ b/c_sharp/src/org/ldk/structs/Option_PaymentContextZ.cs @@ -48,7 +48,6 @@ public class Option_PaymentContextZ : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/Option_QuantityZ.cs b/c_sharp/src/org/ldk/structs/Option_QuantityZ.cs index 20188125..27b96b8c 100644 --- a/c_sharp/src/org/ldk/structs/Option_QuantityZ.cs +++ b/c_sharp/src/org/ldk/structs/Option_QuantityZ.cs @@ -48,7 +48,6 @@ public class Option_QuantityZ : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/Option_SecretKeyZ.cs b/c_sharp/src/org/ldk/structs/Option_SecretKeyZ.cs deleted file mode 100644 index b716b0ba..00000000 --- a/c_sharp/src/org/ldk/structs/Option_SecretKeyZ.cs +++ /dev/null @@ -1,84 +0,0 @@ -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::SecretKey or not - */ -public class Option_SecretKeyZ : CommonBase { - protected Option_SecretKeyZ(object _dummy, long ptr) : base(ptr) { } - ~Option_SecretKeyZ() { - if (ptr != 0) { bindings.COption_SecretKeyZ_free(ptr); } - } - - internal static Option_SecretKeyZ constr_from_ptr(long ptr) { - long raw_ty = bindings.LDKCOption_SecretKeyZ_ty_from_ptr(ptr); - switch (raw_ty) { - case 0: return new Option_SecretKeyZ_Some(ptr); - case 1: return new Option_SecretKeyZ_None(ptr); - default: - throw new ArgumentException("Impossible enum variant"); - } - } - - /** A Option_SecretKeyZ of type Some */ - public class Option_SecretKeyZ_Some : Option_SecretKeyZ { - public byte[] some; - internal Option_SecretKeyZ_Some(long ptr) : base(null, ptr) { - long some = bindings.LDKCOption_SecretKeyZ_Some_get_some(ptr); - byte[] some_conv = InternalUtils.decodeUint8Array(some); - this.some = some_conv; - } - } - /** A Option_SecretKeyZ of type None */ - public class Option_SecretKeyZ_None : Option_SecretKeyZ { - internal Option_SecretKeyZ_None(long ptr) : base(null, ptr) { - } - } - /** - * Constructs a new COption_SecretKeyZ containing a crate::c_types::SecretKey - */ - public static Option_SecretKeyZ some(byte[] o) { - long ret = bindings.COption_SecretKeyZ_some(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(o, 32))); - GC.KeepAlive(o); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Option_SecretKeyZ ret_hu_conv = org.ldk.structs.Option_SecretKeyZ.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_SecretKeyZ containing nothing - */ - public static Option_SecretKeyZ none() { - long ret = bindings.COption_SecretKeyZ_none(); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Option_SecretKeyZ ret_hu_conv = org.ldk.structs.Option_SecretKeyZ.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_SecretKeyZ_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a new COption_SecretKeyZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Option_SecretKeyZ clone() { - long ret = bindings.COption_SecretKeyZ_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Option_SecretKeyZ ret_hu_conv = org.ldk.structs.Option_SecretKeyZ.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_SocketAddressZ.cs b/c_sharp/src/org/ldk/structs/Option_SocketAddressZ.cs index fda7b85e..bb4c2664 100644 --- a/c_sharp/src/org/ldk/structs/Option_SocketAddressZ.cs +++ b/c_sharp/src/org/ldk/structs/Option_SocketAddressZ.cs @@ -48,7 +48,6 @@ public class Option_SocketAddressZ : CommonBase { 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(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; 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 b7058423..48f2dd71 100644 --- a/c_sharp/src/org/ldk/structs/OutPoint.cs +++ b/c_sharp/src/org/ldk/structs/OutPoint.cs @@ -9,7 +9,7 @@ namespace org { namespace ldk { namespace structs { /** * A reference to a transaction output. * - * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32 + * Differs from bitcoin::transaction::OutPoint as the index is a u16 instead of u32 * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way. */ public class OutPoint : CommonBase { diff --git a/c_sharp/src/org/ldk/structs/OutboundHTLCDetails.cs b/c_sharp/src/org/ldk/structs/OutboundHTLCDetails.cs index 05130de9..d0e0a053 100644 --- a/c_sharp/src/org/ldk/structs/OutboundHTLCDetails.cs +++ b/c_sharp/src/org/ldk/structs/OutboundHTLCDetails.cs @@ -44,7 +44,6 @@ public class OutboundHTLCDetails : CommonBase { bindings.OutboundHTLCDetails_set_htlc_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -138,7 +137,6 @@ public class OutboundHTLCDetails : CommonBase { bindings.OutboundHTLCDetails_set_state(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -160,7 +158,6 @@ public class OutboundHTLCDetails : CommonBase { bindings.OutboundHTLCDetails_set_skimmed_fee_msat(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -216,9 +213,6 @@ public class OutboundHTLCDetails : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.OutboundHTLCDetails ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutboundHTLCDetails(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(htlc_id_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(state_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(skimmed_fee_msat_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/OutputSpendStatus.cs b/c_sharp/src/org/ldk/structs/OutputSpendStatus.cs index d07d1245..585964a6 100644 --- a/c_sharp/src/org/ldk/structs/OutputSpendStatus.cs +++ b/c_sharp/src/org/ldk/structs/OutputSpendStatus.cs @@ -125,7 +125,6 @@ public class OutputSpendStatus : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/OutputSpender.cs b/c_sharp/src/org/ldk/structs/OutputSpender.cs index 93283417..572e7a41 100644 --- a/c_sharp/src/org/ldk/structs/OutputSpender.cs +++ b/c_sharp/src/org/ldk/structs/OutputSpender.cs @@ -108,8 +108,6 @@ public class OutputSpender : CommonBase { 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 index 1f2632e6..dea5a194 100644 --- a/c_sharp/src/org/ldk/structs/OutputSweeper.cs +++ b/c_sharp/src/org/ldk/structs/OutputSweeper.cs @@ -47,7 +47,6 @@ public class OutputSweeper : CommonBase { 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); }; @@ -86,9 +85,6 @@ public class OutputSweeper : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/ParseOrSemanticError.cs b/c_sharp/src/org/ldk/structs/ParseOrSemanticError.cs index 0eed4d37..ed298afd 100644 --- a/c_sharp/src/org/ldk/structs/ParseOrSemanticError.cs +++ b/c_sharp/src/org/ldk/structs/ParseOrSemanticError.cs @@ -70,7 +70,6 @@ public class ParseOrSemanticError : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ParseOrSemanticError ret_hu_conv = org.ldk.structs.ParseOrSemanticError.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; } diff --git a/c_sharp/src/org/ldk/structs/ParsedOnionMessageContents.cs b/c_sharp/src/org/ldk/structs/ParsedOnionMessageContents.cs index 9bf441fd..a900895e 100644 --- a/c_sharp/src/org/ldk/structs/ParsedOnionMessageContents.cs +++ b/c_sharp/src/org/ldk/structs/ParsedOnionMessageContents.cs @@ -73,7 +73,6 @@ public class ParsedOnionMessageContents : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ParsedOnionMessageContents ret_hu_conv = org.ldk.structs.ParsedOnionMessageContents.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; } diff --git a/c_sharp/src/org/ldk/structs/Path.cs b/c_sharp/src/org/ldk/structs/Path.cs index 3022b37d..cf6f889a 100644 --- a/c_sharp/src/org/ldk/structs/Path.cs +++ b/c_sharp/src/org/ldk/structs/Path.cs @@ -42,7 +42,6 @@ public class Path : CommonBase { 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); }; }; } /** @@ -68,7 +67,6 @@ public class Path : CommonBase { bindings.Path_set_blinded_tail(this.ptr, val == null ? 0 : val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -83,8 +81,6 @@ public class Path : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Path ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Path(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - foreach (RouteHop hops_arg_conv_10 in hops_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(hops_arg_conv_10); }; }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(blinded_tail_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/PathFailure.cs b/c_sharp/src/org/ldk/structs/PathFailure.cs index a3ca0ae6..eb2a925f 100644 --- a/c_sharp/src/org/ldk/structs/PathFailure.cs +++ b/c_sharp/src/org/ldk/structs/PathFailure.cs @@ -85,7 +85,6 @@ public class PathFailure : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PathFailure ret_hu_conv = org.ldk.structs.PathFailure.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(err); }; return ret_hu_conv; } @@ -98,7 +97,6 @@ public class PathFailure : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PathFailure ret_hu_conv = org.ldk.structs.PathFailure.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(network_update); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Payee.cs b/c_sharp/src/org/ldk/structs/Payee.cs index 2d72ccb3..a98de512 100644 --- a/c_sharp/src/org/ldk/structs/Payee.cs +++ b/c_sharp/src/org/ldk/structs/Payee.cs @@ -31,7 +31,7 @@ public class Payee : CommonBase { * Aggregated routing info and blinded paths, for routing to the payee without knowing their * node id. */ - public TwoTuple_BlindedPayInfoBlindedPathZ[] route_hints; + public BlindedPaymentPath[] route_hints; /** * Features supported by the payee. * @@ -43,16 +43,16 @@ public class Payee : CommonBase { public Bolt12InvoiceFeatures features; internal Payee_Blinded(long ptr) : base(null, ptr) { long route_hints = bindings.LDKPayee_Blinded_get_route_hints(ptr); - int route_hints_conv_37_len = InternalUtils.getArrayLength(route_hints); - TwoTuple_BlindedPayInfoBlindedPathZ[] route_hints_conv_37_arr = new TwoTuple_BlindedPayInfoBlindedPathZ[route_hints_conv_37_len]; - for (int l = 0; l < route_hints_conv_37_len; l++) { - long route_hints_conv_37 = InternalUtils.getU64ArrayElem(route_hints, l); - TwoTuple_BlindedPayInfoBlindedPathZ route_hints_conv_37_hu_conv = new TwoTuple_BlindedPayInfoBlindedPathZ(null, route_hints_conv_37); - if (route_hints_conv_37_hu_conv != null) { route_hints_conv_37_hu_conv.ptrs_to.AddLast(this); }; - route_hints_conv_37_arr[l] = route_hints_conv_37_hu_conv; + int route_hints_conv_20_len = InternalUtils.getArrayLength(route_hints); + BlindedPaymentPath[] route_hints_conv_20_arr = new BlindedPaymentPath[route_hints_conv_20_len]; + for (int u = 0; u < route_hints_conv_20_len; u++) { + long route_hints_conv_20 = InternalUtils.getU64ArrayElem(route_hints, u); + org.ldk.structs.BlindedPaymentPath route_hints_conv_20_hu_conv = null; if (route_hints_conv_20 < 0 || route_hints_conv_20 > 4096) { route_hints_conv_20_hu_conv = new org.ldk.structs.BlindedPaymentPath(null, route_hints_conv_20); } + if (route_hints_conv_20_hu_conv != null) { route_hints_conv_20_hu_conv.ptrs_to.AddLast(this); }; + route_hints_conv_20_arr[u] = route_hints_conv_20_hu_conv; } bindings.free_buffer(route_hints); - this.route_hints = route_hints_conv_37_arr; + this.route_hints = route_hints_conv_20_arr; long features = bindings.LDKPayee_Blinded_get_features(ptr); org.ldk.structs.Bolt12InvoiceFeatures features_hu_conv = null; if (features < 0 || features > 4096) { features_hu_conv = new org.ldk.structs.Bolt12InvoiceFeatures(null, features); } if (features_hu_conv != null) { features_hu_conv.ptrs_to.AddLast(this); }; @@ -127,14 +127,13 @@ 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.ptr)), features.ptr); + public static Payee blinded(BlindedPaymentPath[] route_hints, org.ldk.structs.Bolt12InvoiceFeatures features) { + long ret = bindings.Payee_blinded(InternalUtils.encodeUint64Array(InternalUtils.mapArray(route_hints, route_hints_conv_20 => route_hints_conv_20.ptr)), features.ptr); GC.KeepAlive(route_hints); GC.KeepAlive(features); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Payee ret_hu_conv = org.ldk.structs.Payee.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(features); }; return ret_hu_conv; } @@ -150,8 +149,6 @@ public class Payee : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Payee ret_hu_conv = org.ldk.structs.Payee.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - foreach (RouteHint route_hints_conv_11 in route_hints) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(route_hints_conv_11); }; }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(features); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/PaymentContext.cs b/c_sharp/src/org/ldk/structs/PaymentContext.cs index 1512c1e4..e450f03d 100644 --- a/c_sharp/src/org/ldk/structs/PaymentContext.cs +++ b/c_sharp/src/org/ldk/structs/PaymentContext.cs @@ -6,10 +6,9 @@ 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`]. + * The context of an inbound payment, which is included in a [`BlindedPaymentPath`] via + * [`ReceiveTlvs`] and surfaced in [`PaymentPurpose`]. * - * [`BlindedPath`]: crate::blinded_path::BlindedPath * [`PaymentPurpose`]: crate::events::PaymentPurpose */ public class PaymentContext : CommonBase { @@ -86,7 +85,6 @@ public class PaymentContext : CommonBase { 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; } @@ -99,7 +97,6 @@ public class PaymentContext : CommonBase { 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; } @@ -112,7 +109,6 @@ public class PaymentContext : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/PaymentForwardNode.cs b/c_sharp/src/org/ldk/structs/PaymentForwardNode.cs new file mode 100644 index 00000000..6c165cd3 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/PaymentForwardNode.cs @@ -0,0 +1,112 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * An intermediate node, its outbound channel, and relay parameters. + */ +public class PaymentForwardNode : CommonBase { + internal PaymentForwardNode(object _dummy, long ptr) : base(ptr) { } + ~PaymentForwardNode() { + if (ptr != 0) { bindings.PaymentForwardNode_free(ptr); } + } + + /** + * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also + * used for [`BlindedPayInfo`] construction. + */ + public ForwardTlvs get_tlvs() { + long ret = bindings.PaymentForwardNode_get_tlvs(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ForwardTlvs ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ForwardTlvs(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also + * used for [`BlindedPayInfo`] construction. + */ + public void set_tlvs(org.ldk.structs.ForwardTlvs val) { + bindings.PaymentForwardNode_set_tlvs(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * This node's pubkey. + */ + public byte[] get_node_id() { + long ret = bindings.PaymentForwardNode_get_node_id(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * This node's pubkey. + */ + public void set_node_id(byte[] val) { + bindings.PaymentForwardNode_set_node_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The maximum value, in msat, that may be accepted by this node. + */ + public long get_htlc_maximum_msat() { + long ret = bindings.PaymentForwardNode_get_htlc_maximum_msat(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The maximum value, in msat, that may be accepted by this node. + */ + public void set_htlc_maximum_msat(long val) { + bindings.PaymentForwardNode_set_htlc_maximum_msat(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Constructs a new PaymentForwardNode given each field + */ + public static PaymentForwardNode of(org.ldk.structs.ForwardTlvs tlvs_arg, byte[] node_id_arg, long htlc_maximum_msat_arg) { + long ret = bindings.PaymentForwardNode_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); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.PaymentForwardNode ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PaymentForwardNode(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.PaymentForwardNode_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the PaymentForwardNode + */ + public PaymentForwardNode clone() { + long ret = bindings.PaymentForwardNode_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.PaymentForwardNode ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PaymentForwardNode(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/PaymentParameters.cs b/c_sharp/src/org/ldk/structs/PaymentParameters.cs index 8c7ffcfc..0554b508 100644 --- a/c_sharp/src/org/ldk/structs/PaymentParameters.cs +++ b/c_sharp/src/org/ldk/structs/PaymentParameters.cs @@ -34,7 +34,6 @@ public class PaymentParameters : CommonBase { bindings.PaymentParameters_set_payee(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -56,7 +55,6 @@ public class PaymentParameters : CommonBase { bindings.PaymentParameters_set_expiry_time(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -99,6 +97,26 @@ public class PaymentParameters : CommonBase { GC.KeepAlive(val); } + /** + * The maximum number of [`Path::hops`] in any returned path. + * Defaults to [`MAX_PATH_LENGTH_ESTIMATE`]. + */ + public byte get_max_path_length() { + byte ret = bindings.PaymentParameters_get_max_path_length(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The maximum number of [`Path::hops`] in any returned path. + * Defaults to [`MAX_PATH_LENGTH_ESTIMATE`]. + */ + public void set_max_path_length(byte val) { + bindings.PaymentParameters_set_max_path_length(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + /** * Selects the maximum share of a channel's total capacity which will be sent over a channel, * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas @@ -196,20 +214,19 @@ public class PaymentParameters : CommonBase { /** * Constructs a new PaymentParameters given each field */ - public static PaymentParameters of(org.ldk.structs.Payee payee_arg, org.ldk.structs.Option_u64Z expiry_time_arg, int max_total_cltv_expiry_delta_arg, byte max_path_count_arg, byte max_channel_saturation_power_of_half_arg, long[] previously_failed_channels_arg, long[] previously_failed_blinded_path_idxs_arg) { - long ret = bindings.PaymentParameters_new(payee_arg.ptr, expiry_time_arg.ptr, max_total_cltv_expiry_delta_arg, max_path_count_arg, max_channel_saturation_power_of_half_arg, InternalUtils.encodeUint64Array(previously_failed_channels_arg), InternalUtils.encodeUint64Array(previously_failed_blinded_path_idxs_arg)); + public static PaymentParameters of(org.ldk.structs.Payee payee_arg, org.ldk.structs.Option_u64Z expiry_time_arg, int max_total_cltv_expiry_delta_arg, byte max_path_count_arg, byte max_path_length_arg, byte max_channel_saturation_power_of_half_arg, long[] previously_failed_channels_arg, long[] previously_failed_blinded_path_idxs_arg) { + long ret = bindings.PaymentParameters_new(payee_arg.ptr, expiry_time_arg.ptr, max_total_cltv_expiry_delta_arg, max_path_count_arg, max_path_length_arg, max_channel_saturation_power_of_half_arg, InternalUtils.encodeUint64Array(previously_failed_channels_arg), InternalUtils.encodeUint64Array(previously_failed_blinded_path_idxs_arg)); GC.KeepAlive(payee_arg); GC.KeepAlive(expiry_time_arg); GC.KeepAlive(max_total_cltv_expiry_delta_arg); GC.KeepAlive(max_path_count_arg); + GC.KeepAlive(max_path_length_arg); GC.KeepAlive(max_channel_saturation_power_of_half_arg); GC.KeepAlive(previously_failed_channels_arg); GC.KeepAlive(previously_failed_blinded_path_idxs_arg); 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); } 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(payee_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(expiry_time_arg); }; return ret_hu_conv; } @@ -341,8 +358,8 @@ 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.ptr))); + public static PaymentParameters blinded(BlindedPaymentPath[] blinded_route_hints) { + long ret = bindings.PaymentParameters_blinded(InternalUtils.encodeUint64Array(InternalUtils.mapArray(blinded_route_hints, blinded_route_hints_conv_20 => blinded_route_hints_conv_20.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 5fc9c02c..0af95501 100644 --- a/c_sharp/src/org/ldk/structs/PaymentPurpose.cs +++ b/c_sharp/src/org/ldk/structs/PaymentPurpose.cs @@ -175,7 +175,6 @@ public class PaymentPurpose : CommonBase { 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; } @@ -190,8 +189,6 @@ public class PaymentPurpose : CommonBase { 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; } @@ -206,8 +203,6 @@ public class PaymentPurpose : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/PaymentSendFailure.cs b/c_sharp/src/org/ldk/structs/PaymentSendFailure.cs index 03e37fe0..7e77cbb9 100644 --- a/c_sharp/src/org/ldk/structs/PaymentSendFailure.cs +++ b/c_sharp/src/org/ldk/structs/PaymentSendFailure.cs @@ -143,7 +143,6 @@ public class PaymentSendFailure : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PaymentSendFailure ret_hu_conv = org.ldk.structs.PaymentSendFailure.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; } @@ -168,7 +167,6 @@ public class PaymentSendFailure : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PaymentSendFailure ret_hu_conv = org.ldk.structs.PaymentSendFailure.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - foreach (APIError a_conv_10 in a) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(a_conv_10); }; }; return ret_hu_conv; } @@ -194,7 +192,6 @@ public class PaymentSendFailure : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PaymentSendFailure ret_hu_conv = org.ldk.structs.PaymentSendFailure.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(failed_paths_retry); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/PeeledOnion.cs b/c_sharp/src/org/ldk/structs/PeeledOnion.cs index c7d741bd..c805dda6 100644 --- a/c_sharp/src/org/ldk/structs/PeeledOnion.cs +++ b/c_sharp/src/org/ldk/structs/PeeledOnion.cs @@ -43,24 +43,22 @@ public class PeeledOnion : CommonBase { /** A PeeledOnion of type Receive */ public class PeeledOnion_Receive : PeeledOnion { public ParsedOnionMessageContents _0; + public Option_MessageContextZ _1; /** * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public byte[] _1; - /** - * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None - */ - public BlindedPath _2; + public BlindedMessagePath _2; internal PeeledOnion_Receive(long ptr) : base(null, ptr) { long _0 = bindings.LDKPeeledOnion_Receive_get__0(ptr); org.ldk.structs.ParsedOnionMessageContents _0_hu_conv = org.ldk.structs.ParsedOnionMessageContents.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_Receive_get__1(ptr); - byte[] _1_conv = InternalUtils.decodeUint8Array(_1); - this._1 = _1_conv; + org.ldk.structs.Option_MessageContextZ _1_hu_conv = org.ldk.structs.Option_MessageContextZ.constr_from_ptr(_1); + if (_1_hu_conv != null) { _1_hu_conv.ptrs_to.AddLast(this); }; + this._1 = _1_hu_conv; long _2 = bindings.LDKPeeledOnion_Receive_get__2(ptr); - org.ldk.structs.BlindedPath _2_hu_conv = null; if (_2 < 0 || _2 > 4096) { _2_hu_conv = new org.ldk.structs.BlindedPath(null, _2); } + org.ldk.structs.BlindedMessagePath _2_hu_conv = null; if (_2 < 0 || _2 > 4096) { _2_hu_conv = new org.ldk.structs.BlindedMessagePath(null, _2); } if (_2_hu_conv != null) { _2_hu_conv.ptrs_to.AddLast(this); }; this._2 = _2_hu_conv; } @@ -93,16 +91,14 @@ public class PeeledOnion : CommonBase { 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; } /** * 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.ptr); + public static PeeledOnion receive(org.ldk.structs.ParsedOnionMessageContents a, org.ldk.structs.Option_MessageContextZ b, org.ldk.structs.BlindedMessagePath c) { + long ret = bindings.PeeledOnion_receive(a.ptr, b.ptr, c.ptr); GC.KeepAlive(a); GC.KeepAlive(b); GC.KeepAlive(c); @@ -110,7 +106,6 @@ public class PeeledOnion : CommonBase { 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(c); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/PeerDetails.cs b/c_sharp/src/org/ldk/structs/PeerDetails.cs index 3b9c6ffa..e4df3809 100644 --- a/c_sharp/src/org/ldk/structs/PeerDetails.cs +++ b/c_sharp/src/org/ldk/structs/PeerDetails.cs @@ -68,7 +68,6 @@ public class PeerDetails : CommonBase { bindings.PeerDetails_set_socket_address(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -90,7 +89,6 @@ public class PeerDetails : CommonBase { bindings.PeerDetails_set_init_features(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -127,8 +125,6 @@ public class PeerDetails : CommonBase { 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 c2e1eeb0..b8edbedf 100644 --- a/c_sharp/src/org/ldk/structs/PeerManager.cs +++ b/c_sharp/src/org/ldk/structs/PeerManager.cs @@ -129,7 +129,6 @@ public class PeerManager : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } Result_CVec_u8ZPeerHandleErrorZ ret_hu_conv = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.AddLast(descriptor); }; - if (this != null) { this.ptrs_to.AddLast(remote_network_address); }; return ret_hu_conv; } @@ -158,7 +157,6 @@ public class PeerManager : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } Result_NonePeerHandleErrorZ ret_hu_conv = Result_NonePeerHandleErrorZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.AddLast(descriptor); }; - if (this != null) { this.ptrs_to.AddLast(remote_network_address); }; return ret_hu_conv; } @@ -312,7 +310,6 @@ public class PeerManager : CommonBase { GC.KeepAlive(rgb); GC.KeepAlive(alias); GC.KeepAlive(addresses); - foreach (SocketAddress addresses_conv_15 in addresses) { if (this != null) { this.ptrs_to.AddLast(addresses_conv_15); }; }; } } diff --git a/c_sharp/src/org/ldk/structs/PendingHTLCInfo.cs b/c_sharp/src/org/ldk/structs/PendingHTLCInfo.cs index f65bc0d0..8305dd34 100644 --- a/c_sharp/src/org/ldk/structs/PendingHTLCInfo.cs +++ b/c_sharp/src/org/ldk/structs/PendingHTLCInfo.cs @@ -35,7 +35,6 @@ public class PendingHTLCInfo : CommonBase { bindings.PendingHTLCInfo_set_routing(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -107,7 +106,6 @@ public class PendingHTLCInfo : CommonBase { bindings.PendingHTLCInfo_set_incoming_amt_msat(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -203,7 +201,6 @@ public class PendingHTLCInfo : CommonBase { bindings.PendingHTLCInfo_set_skimmed_fee_msat(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -221,9 +218,6 @@ public class PendingHTLCInfo : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PendingHTLCInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PendingHTLCInfo(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(routing_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(incoming_amt_msat_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(skimmed_fee_msat_arg); }; 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 b771b900..acbf4cdf 100644 --- a/c_sharp/src/org/ldk/structs/PendingHTLCRouting.cs +++ b/c_sharp/src/org/ldk/structs/PendingHTLCRouting.cs @@ -235,8 +235,6 @@ public class PendingHTLCRouting : CommonBase { 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); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(onion_packet); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(blinded); }; return ret_hu_conv; } @@ -255,9 +253,6 @@ public class PendingHTLCRouting : CommonBase { 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); }; - 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; } @@ -275,8 +270,6 @@ public class PendingHTLCRouting : CommonBase { 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); }; - 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); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Persist.cs b/c_sharp/src/org/ldk/structs/Persist.cs index 8ce9e19e..0f07b875 100644 --- a/c_sharp/src/org/ldk/structs/Persist.cs +++ b/c_sharp/src/org/ldk/structs/Persist.cs @@ -17,8 +17,9 @@ public interface PersistInterface { * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint * and the stored channel data). Note that you **must** persist every new monitor to disk. * - * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`], - * if you return [`ChannelMonitorUpdateStatus::InProgress`]. + * The [`ChannelMonitor::get_latest_update_id`] uniquely links this call to [`ChainMonitor::channel_monitor_updated`]. + * For [`Persist::persist_new_channel`], it is only necessary to call [`ChainMonitor::channel_monitor_updated`] + * when you return [`ChannelMonitorUpdateStatus::InProgress`]. * * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor` * and [`ChannelMonitorUpdateStatus`] for requirements when returning errors. @@ -26,7 +27,7 @@ public interface PersistInterface { * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager * [`Writeable::write`]: crate::util::ser::Writeable::write */ - ChannelMonitorUpdateStatus persist_new_channel(OutPoint channel_funding_outpoint, ChannelMonitor data, MonitorUpdateId update_id); + ChannelMonitorUpdateStatus persist_new_channel(OutPoint channel_funding_outpoint, ChannelMonitor monitor); /**Update one channel's data. The provided [`ChannelMonitor`] has already applied the given * update. * @@ -43,7 +44,9 @@ public interface PersistInterface { * If an implementer chooses to persist the updates only, they need to make * sure that all the updates are applied to the `ChannelMonitors` *before * the set of channel monitors is given to the `ChannelManager` - * deserialization routine. See [`ChannelMonitor::update_monitor`] for + * deserialization routine. If there are any gaps in the persisted [`ChannelMonitorUpdate`]s, + * implementer can safely ignore [`ChannelMonitorUpdate`]s after the gap and load without them. + * See [`ChannelMonitor::update_monitor`] for * applying a monitor update to a monitor. If full `ChannelMonitors` are * persisted, then there is no need to persist individual updates. * @@ -52,8 +55,10 @@ public interface PersistInterface { * them in batches. The size of each monitor grows `O(number of state updates)` * whereas updates are small and `O(1)`. * - * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`], - * if you return [`ChannelMonitorUpdateStatus::InProgress`]. + * The [`ChannelMonitorUpdate::update_id`] or [`ChannelMonitor::get_latest_update_id`] uniquely + * links this call to [`ChainMonitor::channel_monitor_updated`]. + * For [`Persist::update_persisted_channel`], it is only necessary to call [`ChainMonitor::channel_monitor_updated`] + * when a [`ChannelMonitorUpdate`] is provided and when you return [`ChannelMonitorUpdateStatus::InProgress`]. * * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`, * [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and @@ -61,9 +66,9 @@ public interface PersistInterface { * * [`Writeable::write`]: crate::util::ser::Writeable::write * - * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None + * Note that monitor_update (or a relevant inner pointer) may be NULL or all-0s to represent None */ - ChannelMonitorUpdateStatus update_persisted_channel(OutPoint channel_funding_outpoint, ChannelMonitorUpdate update, ChannelMonitor data, MonitorUpdateId update_id); + ChannelMonitorUpdateStatus update_persisted_channel(OutPoint channel_funding_outpoint, ChannelMonitorUpdate monitor_update, ChannelMonitor monitor); /**Prevents the channel monitor from being loaded on startup. * * Archiving the data in a backup location (rather than deleting it fully) is useful for @@ -105,7 +110,7 @@ public interface PersistInterface { * All calls should generally spawn a background task and immediately return * [`ChannelMonitorUpdateStatus::InProgress`]. Once the update completes, * [`ChainMonitor::channel_monitor_updated`] should be called with the corresponding - * [`MonitorUpdateId`]. + * [`ChannelMonitor::get_latest_update_id`] or [`ChannelMonitorUpdate::update_id`]. * * Note that unlike the direct [`chain::Watch`] interface, * [`ChainMonitor::channel_monitor_updated`] must be called once for *each* update which occurs. @@ -143,25 +148,21 @@ 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_funding_outpoint, long _data, long _update_id) { + public ChannelMonitorUpdateStatus persist_new_channel(long _channel_funding_outpoint, long _monitor) { 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_funding_outpoint_hu_conv, _data_hu_conv, _update_id_hu_conv); + org.ldk.structs.ChannelMonitor _monitor_hu_conv = null; if (_monitor < 0 || _monitor > 4096) { _monitor_hu_conv = new org.ldk.structs.ChannelMonitor(null, _monitor); } + ChannelMonitorUpdateStatus ret = arg.persist_new_channel(_channel_funding_outpoint_hu_conv, _monitor_hu_conv); GC.KeepAlive(arg); return ret; } - public ChannelMonitorUpdateStatus update_persisted_channel(long _channel_funding_outpoint, long _update, long _data, long _update_id) { + public ChannelMonitorUpdateStatus update_persisted_channel(long _channel_funding_outpoint, long _monitor_update, long _monitor) { 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_funding_outpoint_hu_conv, _update_hu_conv, _data_hu_conv, _update_id_hu_conv); + org.ldk.structs.ChannelMonitorUpdate _monitor_update_hu_conv = null; if (_monitor_update < 0 || _monitor_update > 4096) { _monitor_update_hu_conv = new org.ldk.structs.ChannelMonitorUpdate(null, _monitor_update); } + if (_monitor_update_hu_conv != null) { _monitor_update_hu_conv.ptrs_to.AddLast(this); }; + org.ldk.structs.ChannelMonitor _monitor_hu_conv = null; if (_monitor < 0 || _monitor > 4096) { _monitor_hu_conv = new org.ldk.structs.ChannelMonitor(null, _monitor); } + ChannelMonitorUpdateStatus ret = arg.update_persisted_channel(_channel_funding_outpoint_hu_conv, _monitor_update_hu_conv, _monitor_hu_conv); GC.KeepAlive(arg); return ret; } @@ -193,8 +194,9 @@ public class Persist : CommonBase { * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint * and the stored channel data). Note that you **must** persist every new monitor to disk. * - * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`], - * if you return [`ChannelMonitorUpdateStatus::InProgress`]. + * The [`ChannelMonitor::get_latest_update_id`] uniquely links this call to [`ChainMonitor::channel_monitor_updated`]. + * For [`Persist::persist_new_channel`], it is only necessary to call [`ChainMonitor::channel_monitor_updated`] + * when you return [`ChannelMonitorUpdateStatus::InProgress`]. * * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor` * and [`ChannelMonitorUpdateStatus`] for requirements when returning errors. @@ -202,15 +204,12 @@ 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_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); + public ChannelMonitorUpdateStatus persist_new_channel(org.ldk.structs.OutPoint channel_funding_outpoint, org.ldk.structs.ChannelMonitor monitor) { + ChannelMonitorUpdateStatus ret = bindings.Persist_persist_new_channel(this.ptr, channel_funding_outpoint.ptr, monitor.ptr); GC.KeepAlive(this); GC.KeepAlive(channel_funding_outpoint); - GC.KeepAlive(data); - GC.KeepAlive(update_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); }; + GC.KeepAlive(monitor); + if (this != null) { this.ptrs_to.AddLast(monitor); }; return ret; } @@ -231,7 +230,9 @@ public class Persist : CommonBase { * If an implementer chooses to persist the updates only, they need to make * sure that all the updates are applied to the `ChannelMonitors` *before * the set of channel monitors is given to the `ChannelManager` - * deserialization routine. See [`ChannelMonitor::update_monitor`] for + * deserialization routine. If there are any gaps in the persisted [`ChannelMonitorUpdate`]s, + * implementer can safely ignore [`ChannelMonitorUpdate`]s after the gap and load without them. + * See [`ChannelMonitor::update_monitor`] for * applying a monitor update to a monitor. If full `ChannelMonitors` are * persisted, then there is no need to persist individual updates. * @@ -240,8 +241,10 @@ public class Persist : CommonBase { * them in batches. The size of each monitor grows `O(number of state updates)` * whereas updates are small and `O(1)`. * - * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`], - * if you return [`ChannelMonitorUpdateStatus::InProgress`]. + * The [`ChannelMonitorUpdate::update_id`] or [`ChannelMonitor::get_latest_update_id`] uniquely + * links this call to [`ChainMonitor::channel_monitor_updated`]. + * For [`Persist::update_persisted_channel`], it is only necessary to call [`ChainMonitor::channel_monitor_updated`] + * when a [`ChannelMonitorUpdate`] is provided and when you return [`ChannelMonitorUpdateStatus::InProgress`]. * * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`, * [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and @@ -249,19 +252,15 @@ public class Persist : CommonBase { * * [`Writeable::write`]: crate::util::ser::Writeable::write * - * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None + * Note that monitor_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_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); + public ChannelMonitorUpdateStatus update_persisted_channel(org.ldk.structs.OutPoint channel_funding_outpoint, org.ldk.structs.ChannelMonitorUpdate monitor_update, org.ldk.structs.ChannelMonitor monitor) { + ChannelMonitorUpdateStatus ret = bindings.Persist_update_persisted_channel(this.ptr, channel_funding_outpoint.ptr, monitor_update == null ? 0 : monitor_update.ptr, monitor.ptr); GC.KeepAlive(this); GC.KeepAlive(channel_funding_outpoint); - GC.KeepAlive(update); - GC.KeepAlive(data); - GC.KeepAlive(update_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); }; + GC.KeepAlive(monitor_update); + GC.KeepAlive(monitor); + if (this != null) { this.ptrs_to.AddLast(monitor); }; return ret; } @@ -275,7 +274,6 @@ public class Persist : CommonBase { 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/PhantomRouteHints.cs b/c_sharp/src/org/ldk/structs/PhantomRouteHints.cs index 1ff36125..ff96c479 100644 --- a/c_sharp/src/org/ldk/structs/PhantomRouteHints.cs +++ b/c_sharp/src/org/ldk/structs/PhantomRouteHints.cs @@ -43,7 +43,6 @@ public class PhantomRouteHints : CommonBase { 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); }; }; } /** @@ -97,7 +96,6 @@ public class PhantomRouteHints : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PhantomRouteHints ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PhantomRouteHints(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - foreach (ChannelDetails channels_arg_conv_16 in channels_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channels_arg_conv_16); }; }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/PrivateRoute.cs b/c_sharp/src/org/ldk/structs/PrivateRoute.cs index 8c6f7f70..ffceb14e 100644 --- a/c_sharp/src/org/ldk/structs/PrivateRoute.cs +++ b/c_sharp/src/org/ldk/structs/PrivateRoute.cs @@ -73,7 +73,6 @@ public class PrivateRoute : CommonBase { GC.KeepAlive(hops); if (ret >= 0 && ret <= 4096) { return null; } Result_PrivateRouteCreationErrorZ ret_hu_conv = Result_PrivateRouteCreationErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(hops); }; return ret_hu_conv; } @@ -86,7 +85,7 @@ public class PrivateRoute : CommonBase { 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); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - if (this != null) { this.ptrs_to.AddLast(this); }; + ; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/ProbabilisticScorer.cs b/c_sharp/src/org/ldk/structs/ProbabilisticScorer.cs index bffdc449..a7f31b5b 100644 --- a/c_sharp/src/org/ldk/structs/ProbabilisticScorer.cs +++ b/c_sharp/src/org/ldk/structs/ProbabilisticScorer.cs @@ -57,7 +57,6 @@ public class ProbabilisticScorer : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ProbabilisticScorer ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ProbabilisticScorer(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(decay_params); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(network_graph); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(logger); }; return ret_hu_conv; @@ -215,7 +214,6 @@ public class ProbabilisticScorer : CommonBase { GC.KeepAlive(arg_c); if (ret >= 0 && ret <= 4096) { return null; } Result_ProbabilisticScorerDecodeErrorZ ret_hu_conv = Result_ProbabilisticScorerDecodeErrorZ.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); }; return ret_hu_conv; diff --git a/c_sharp/src/org/ldk/structs/ProbabilisticScoringFeeParameters.cs b/c_sharp/src/org/ldk/structs/ProbabilisticScoringFeeParameters.cs index f22e31df..d1287bed 100644 --- a/c_sharp/src/org/ldk/structs/ProbabilisticScoringFeeParameters.cs +++ b/c_sharp/src/org/ldk/structs/ProbabilisticScoringFeeParameters.cs @@ -471,7 +471,6 @@ public class ProbabilisticScoringFeeParameters : CommonBase { 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); }; }; } /** diff --git a/c_sharp/src/org/ldk/structs/ProbeSendFailure.cs b/c_sharp/src/org/ldk/structs/ProbeSendFailure.cs index fec1e3e7..a34c3da4 100644 --- a/c_sharp/src/org/ldk/structs/ProbeSendFailure.cs +++ b/c_sharp/src/org/ldk/structs/ProbeSendFailure.cs @@ -80,7 +80,6 @@ public class ProbeSendFailure : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ProbeSendFailure ret_hu_conv = org.ldk.structs.ProbeSendFailure.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; } diff --git a/c_sharp/src/org/ldk/structs/RapidGossipSync.cs b/c_sharp/src/org/ldk/structs/RapidGossipSync.cs index 02731cf2..d16d293d 100644 --- a/c_sharp/src/org/ldk/structs/RapidGossipSync.cs +++ b/c_sharp/src/org/ldk/structs/RapidGossipSync.cs @@ -80,7 +80,6 @@ public class RapidGossipSync : CommonBase { GC.KeepAlive(current_time_unix); if (ret >= 0 && ret <= 4096) { return null; } Result_u32GraphSyncErrorZ ret_hu_conv = Result_u32GraphSyncErrorZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(current_time_unix); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/RawBolt11Invoice.cs b/c_sharp/src/org/ldk/structs/RawBolt11Invoice.cs index 8f3d8111..be74e1ce 100644 --- a/c_sharp/src/org/ldk/structs/RawBolt11Invoice.cs +++ b/c_sharp/src/org/ldk/structs/RawBolt11Invoice.cs @@ -38,7 +38,6 @@ public class RawBolt11Invoice : CommonBase { bindings.RawBolt11Invoice_set_data(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** diff --git a/c_sharp/src/org/ldk/structs/RawDataPart.cs b/c_sharp/src/org/ldk/structs/RawDataPart.cs index c63b214a..7f0fb869 100644 --- a/c_sharp/src/org/ldk/structs/RawDataPart.cs +++ b/c_sharp/src/org/ldk/structs/RawDataPart.cs @@ -34,7 +34,6 @@ public class RawDataPart : CommonBase { bindings.RawDataPart_set_timestamp(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** diff --git a/c_sharp/src/org/ldk/structs/ReceiveTlvs.cs b/c_sharp/src/org/ldk/structs/ReceiveTlvs.cs index bccc65e3..a76c5f84 100644 --- a/c_sharp/src/org/ldk/structs/ReceiveTlvs.cs +++ b/c_sharp/src/org/ldk/structs/ReceiveTlvs.cs @@ -55,7 +55,6 @@ public class ReceiveTlvs : CommonBase { bindings.ReceiveTlvs_set_payment_constraints(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -77,7 +76,6 @@ public class ReceiveTlvs : CommonBase { bindings.ReceiveTlvs_set_payment_context(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -91,8 +89,6 @@ public class ReceiveTlvs : CommonBase { 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/RecentPaymentDetails.cs b/c_sharp/src/org/ldk/structs/RecentPaymentDetails.cs index 0a258bae..0651692c 100644 --- a/c_sharp/src/org/ldk/structs/RecentPaymentDetails.cs +++ b/c_sharp/src/org/ldk/structs/RecentPaymentDetails.cs @@ -163,7 +163,6 @@ public class RecentPaymentDetails : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.RecentPaymentDetails ret_hu_conv = org.ldk.structs.RecentPaymentDetails.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_hash); }; 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 cec4805f..e3ae80a8 100644 --- a/c_sharp/src/org/ldk/structs/RecipientOnionFields.cs +++ b/c_sharp/src/org/ldk/structs/RecipientOnionFields.cs @@ -57,7 +57,6 @@ public class RecipientOnionFields : CommonBase { bindings.RecipientOnionFields_set_payment_secret(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -103,7 +102,6 @@ public class RecipientOnionFields : CommonBase { bindings.RecipientOnionFields_set_payment_metadata(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } internal long clone_ptr() { @@ -212,7 +210,7 @@ public class RecipientOnionFields : CommonBase { GC.KeepAlive(custom_tlvs); if (ret >= 0 && ret <= 4096) { return null; } Result_RecipientOnionFieldsNoneZ ret_hu_conv = Result_RecipientOnionFieldsNoneZ.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/Record.cs b/c_sharp/src/org/ldk/structs/Record.cs index 3720b7be..0d3ae571 100644 --- a/c_sharp/src/org/ldk/structs/Record.cs +++ b/c_sharp/src/org/ldk/structs/Record.cs @@ -91,7 +91,6 @@ public class Record : CommonBase { 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,14 +171,41 @@ public class Record : CommonBase { GC.KeepAlive(val); } + /** + * The payment hash. + * + * Note that this is only filled in for logs pertaining to a specific payment, and will be + * `None` for logs which are not directly related to a payment. + */ + public Option_ThirtyTwoBytesZ get_payment_hash() { + long ret = bindings.Record_get_payment_hash(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); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The payment hash. + * + * Note that this is only filled in for logs pertaining to a specific payment, and will be + * `None` for logs which are not directly related to a payment. + */ + public void set_payment_hash(org.ldk.structs.Option_ThirtyTwoBytesZ val) { + bindings.Record_set_payment_hash(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + /** * 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.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); + 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, org.ldk.structs.Option_ThirtyTwoBytesZ payment_hash_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, payment_hash_arg.ptr); GC.KeepAlive(level_arg); GC.KeepAlive(peer_id_arg); GC.KeepAlive(channel_id_arg); @@ -187,10 +213,10 @@ public class Record : CommonBase { GC.KeepAlive(module_path_arg); GC.KeepAlive(file_arg); GC.KeepAlive(line_arg); + GC.KeepAlive(payment_hash_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Record ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Record(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; } diff --git a/c_sharp/src/org/ldk/structs/Refund.cs b/c_sharp/src/org/ldk/structs/Refund.cs index f9a20662..e447a08a 100644 --- a/c_sharp/src/org/ldk/structs/Refund.cs +++ b/c_sharp/src/org/ldk/structs/Refund.cs @@ -105,20 +105,20 @@ public class Refund : CommonBase { * Paths to the sender originating from publicly reachable nodes. Blinded paths provide sender * privacy by obfuscating its node id. */ - public BlindedPath[] paths() { + public BlindedMessagePath[] paths() { long ret = bindings.Refund_paths(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - int ret_conv_13_len = InternalUtils.getArrayLength(ret); - BlindedPath[] ret_conv_13_arr = new BlindedPath[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.BlindedPath ret_conv_13_hu_conv = null; if (ret_conv_13 < 0 || ret_conv_13 > 4096) { ret_conv_13_hu_conv = new org.ldk.structs.BlindedPath(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; + int ret_conv_20_len = InternalUtils.getArrayLength(ret); + BlindedMessagePath[] ret_conv_20_arr = new BlindedMessagePath[ret_conv_20_len]; + for (int u = 0; u < ret_conv_20_len; u++) { + long ret_conv_20 = InternalUtils.getU64ArrayElem(ret, u); + org.ldk.structs.BlindedMessagePath ret_conv_20_hu_conv = null; if (ret_conv_20 < 0 || ret_conv_20 > 4096) { ret_conv_20_hu_conv = new org.ldk.structs.BlindedMessagePath(null, ret_conv_20); } + if (ret_conv_20_hu_conv != null) { ret_conv_20_hu_conv.ptrs_to.AddLast(this); }; + ret_conv_20_arr[u] = ret_conv_20_hu_conv; } bindings.free_buffer(ret); - return ret_conv_13_arr; + return ret_conv_20_arr; } /** @@ -221,6 +221,17 @@ public class Refund : CommonBase { public override int GetHashCode() { return (int)this.hash(); } + /** + * Read a Refund from a byte array, created by Refund_write + */ + public static Result_RefundDecodeErrorZ read(byte[] ser) { + long ret = bindings.Refund_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_RefundDecodeErrorZ ret_hu_conv = Result_RefundDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + /** * 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 index 1aae4506..d93a96b6 100644 --- a/c_sharp/src/org/ldk/structs/RefundMaybeWithDerivedMetadataBuilder.cs +++ b/c_sharp/src/org/ldk/structs/RefundMaybeWithDerivedMetadataBuilder.cs @@ -68,26 +68,29 @@ public class RefundMaybeWithDerivedMetadataBuilder : CommonBase { * 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`]. + * Also, sets the metadata when [`RefundBuilder::build`] is called such that it can be used by + * [`Bolt12Invoice::verify_using_metadata`] to determine if the invoice was produced for the + * refund given an [`ExpandedKey`]. However, if [`RefundBuilder::path`] is called, then the + * metadata must be included in each [`BlindedMessagePath`] instead. In this case, use + * [`Bolt12Invoice::verify_using_payer_data`]. * * 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 + * [`Bolt12Invoice::verify_using_metadata`]: crate::offers::invoice::Bolt12Invoice::verify_using_metadata + * [`Bolt12Invoice::verify_using_payer_data`]: crate::offers::invoice::Bolt12Invoice::verify_using_payer_data * [`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))); + public static Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ deriving_payer_id(byte[] node_id, org.ldk.structs.ExpandedKey expanded_key, org.ldk.structs.Nonce nonce, 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, nonce.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(nonce); 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; } @@ -100,7 +103,7 @@ public class RefundMaybeWithDerivedMetadataBuilder : CommonBase { bindings.RefundMaybeWithDerivedMetadataBuilder_description(this.ptr, InternalUtils.encodeString(description)); GC.KeepAlive(this); GC.KeepAlive(description); - if (this != null) { this.ptrs_to.AddLast(this); }; + ; } /** @@ -113,7 +116,7 @@ public class RefundMaybeWithDerivedMetadataBuilder : CommonBase { bindings.RefundMaybeWithDerivedMetadataBuilder_absolute_expiry(this.ptr, absolute_expiry); GC.KeepAlive(this); GC.KeepAlive(absolute_expiry); - if (this != null) { this.ptrs_to.AddLast(this); }; + ; } /** @@ -125,7 +128,7 @@ public class RefundMaybeWithDerivedMetadataBuilder : CommonBase { bindings.RefundMaybeWithDerivedMetadataBuilder_issuer(this.ptr, InternalUtils.encodeString(issuer)); GC.KeepAlive(this); GC.KeepAlive(issuer); - if (this != null) { this.ptrs_to.AddLast(this); }; + ; } /** @@ -135,12 +138,11 @@ public class RefundMaybeWithDerivedMetadataBuilder : CommonBase { * 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) { + public void path(org.ldk.structs.BlindedMessagePath 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); }; + ; } /** @@ -153,7 +155,7 @@ public class RefundMaybeWithDerivedMetadataBuilder : CommonBase { bindings.RefundMaybeWithDerivedMetadataBuilder_chain(this.ptr, network); GC.KeepAlive(this); GC.KeepAlive(network); - if (this != null) { this.ptrs_to.AddLast(this); }; + ; } /** @@ -171,7 +173,7 @@ public class RefundMaybeWithDerivedMetadataBuilder : CommonBase { bindings.RefundMaybeWithDerivedMetadataBuilder_quantity(this.ptr, quantity); GC.KeepAlive(this); GC.KeepAlive(quantity); - if (this != null) { this.ptrs_to.AddLast(this); }; + ; } /** @@ -183,7 +185,7 @@ public class RefundMaybeWithDerivedMetadataBuilder : CommonBase { 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); }; + ; } /** @@ -194,7 +196,7 @@ public class RefundMaybeWithDerivedMetadataBuilder : CommonBase { 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/ReleaseHeldHtlc.cs b/c_sharp/src/org/ldk/structs/ReleaseHeldHtlc.cs new file mode 100644 index 00000000..df630d83 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/ReleaseHeldHtlc.cs @@ -0,0 +1,106 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * Releases the HTLC corresponding to an inbound [`HeldHtlcAvailable`] message. + */ +public class ReleaseHeldHtlc : CommonBase { + internal ReleaseHeldHtlc(object _dummy, long ptr) : base(ptr) { } + ~ReleaseHeldHtlc() { + if (ptr != 0) { bindings.ReleaseHeldHtlc_free(ptr); } + } + + /** + * Used to release the HTLC held upstream if it matches the corresponding + * [`HeldHtlcAvailable::payment_release_secret`]. + */ + public byte[] get_payment_release_secret() { + long ret = bindings.ReleaseHeldHtlc_get_payment_release_secret(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Used to release the HTLC held upstream if it matches the corresponding + * [`HeldHtlcAvailable::payment_release_secret`]. + */ + public void set_payment_release_secret(byte[] val) { + bindings.ReleaseHeldHtlc_set_payment_release_secret(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Constructs a new ReleaseHeldHtlc given each field + */ + public static ReleaseHeldHtlc of(byte[] payment_release_secret_arg) { + long ret = bindings.ReleaseHeldHtlc_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_release_secret_arg, 32))); + GC.KeepAlive(payment_release_secret_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ReleaseHeldHtlc ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ReleaseHeldHtlc(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.ReleaseHeldHtlc_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the ReleaseHeldHtlc + */ + public ReleaseHeldHtlc clone() { + long ret = bindings.ReleaseHeldHtlc_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ReleaseHeldHtlc ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ReleaseHeldHtlc(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Constructs a new OnionMessageContents which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned OnionMessageContents must be freed before this_arg is + */ + public OnionMessageContents as_OnionMessageContents() { + long ret = bindings.ReleaseHeldHtlc_as_OnionMessageContents(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + OnionMessageContents ret_hu_conv = new OnionMessageContents(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Serialize the ReleaseHeldHtlc object into a byte array which can be read by ReleaseHeldHtlc_read + */ + public byte[] write() { + long ret = bindings.ReleaseHeldHtlc_write(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Read a ReleaseHeldHtlc from a byte array, created by ReleaseHeldHtlc_write + */ + public static Result_ReleaseHeldHtlcDecodeErrorZ read(byte[] ser) { + long ret = bindings.ReleaseHeldHtlc_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ReleaseHeldHtlcDecodeErrorZ ret_hu_conv = Result_ReleaseHeldHtlcDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/ReplayEvent.cs b/c_sharp/src/org/ldk/structs/ReplayEvent.cs new file mode 100644 index 00000000..f6e91b3f --- /dev/null +++ b/c_sharp/src/org/ldk/structs/ReplayEvent.cs @@ -0,0 +1,52 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * An error type that may be returned to LDK in order to safely abort event handling if it can't + * currently succeed (e.g., due to a persistence failure). + * + * Depending on the type, LDK may ensure the event is persisted and will eventually be replayed. + * Please refer to the documentation of each [`Event`] variant for more details. + */ +public class ReplayEvent : CommonBase { + internal ReplayEvent(object _dummy, long ptr) : base(ptr) { } + ~ReplayEvent() { + if (ptr != 0) { bindings.ReplayEvent_free(ptr); } + } + + /** + * Constructs a new ReplayEvent given each field + */ + public static ReplayEvent of() { + long ret = bindings.ReplayEvent_new(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ReplayEvent ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ReplayEvent(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.ReplayEvent_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the ReplayEvent + */ + public ReplayEvent clone() { + long ret = bindings.ReplayEvent_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ReplayEvent ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ReplayEvent(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/Responder.cs b/c_sharp/src/org/ldk/structs/Responder.cs new file mode 100644 index 00000000..37f78148 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Responder.cs @@ -0,0 +1,108 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * The `Responder` struct creates an appropriate [`ResponseInstruction`] for responding to a + * message. + */ +public class Responder : CommonBase { + internal Responder(object _dummy, long ptr) : base(ptr) { } + ~Responder() { + if (ptr != 0) { bindings.Responder_free(ptr); } + } + + internal long clone_ptr() { + long ret = bindings.Responder_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the Responder + */ + public Responder clone() { + long ret = bindings.Responder_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Responder ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Responder(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Checks if two Responders 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.Responder b) { + bool ret = bindings.Responder_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 Responder)) return false; + return this.eq((Responder)o); + } + /** + * Serialize the Responder object into a byte array which can be read by Responder_read + */ + public byte[] write() { + long ret = bindings.Responder_write(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Read a Responder from a byte array, created by Responder_write + */ + public static Result_ResponderDecodeErrorZ read(byte[] ser) { + long ret = bindings.Responder_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ResponderDecodeErrorZ ret_hu_conv = Result_ResponderDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a [`ResponseInstruction`] for responding without including a reply path. + * + * Use when the recipient doesn't need to send back a reply to us. + */ + public ResponseInstruction respond() { + long ret = bindings.Responder_respond(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ResponseInstruction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ResponseInstruction(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + ; + return ret_hu_conv; + } + + /** + * Creates a [`ResponseInstruction`] for responding including a reply path. + * + * Use when the recipient needs to send back a reply to us. + */ + public ResponseInstruction respond_with_reply_path(org.ldk.structs.MessageContext context) { + long ret = bindings.Responder_respond_with_reply_path(this.ptr, context.ptr); + GC.KeepAlive(this); + GC.KeepAlive(context); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ResponseInstruction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ResponseInstruction(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/ResponseInstruction.cs b/c_sharp/src/org/ldk/structs/ResponseInstruction.cs new file mode 100644 index 00000000..0ff51c79 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/ResponseInstruction.cs @@ -0,0 +1,37 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * Instructions for how and where to send the response to an onion message. + */ +public class ResponseInstruction : CommonBase { + internal ResponseInstruction(object _dummy, long ptr) : base(ptr) { } + ~ResponseInstruction() { + if (ptr != 0) { bindings.ResponseInstruction_free(ptr); } + } + + internal long clone_ptr() { + long ret = bindings.ResponseInstruction_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the ResponseInstruction + */ + public ResponseInstruction clone() { + long ret = bindings.ResponseInstruction_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ResponseInstruction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ResponseInstruction(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/Result_AcceptChannelDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_AcceptChannelDecodeErrorZ.cs index 1009ab38..34a6bb14 100644 --- a/c_sharp/src/org/ldk/structs/Result_AcceptChannelDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_AcceptChannelDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_AcceptChannelDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_AcceptChannelDecodeErrorZ ret_hu_conv = Result_AcceptChannelDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_AcceptChannelDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_AcceptChannelDecodeErrorZ ret_hu_conv = Result_AcceptChannelDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_AcceptChannelV2DecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_AcceptChannelV2DecodeErrorZ.cs index 9adb37a2..e57c0dae 100644 --- a/c_sharp/src/org/ldk/structs/Result_AcceptChannelV2DecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_AcceptChannelV2DecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_AcceptChannelV2DecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_AcceptChannelV2DecodeErrorZ ret_hu_conv = Result_AcceptChannelV2DecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_AcceptChannelV2DecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_AcceptChannelV2DecodeErrorZ ret_hu_conv = Result_AcceptChannelV2DecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_AnnouncementSignaturesDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_AnnouncementSignaturesDecodeErrorZ.cs index ff6be21d..e032190a 100644 --- a/c_sharp/src/org/ldk/structs/Result_AnnouncementSignaturesDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_AnnouncementSignaturesDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_AnnouncementSignaturesDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_AnnouncementSignaturesDecodeErrorZ ret_hu_conv = Result_AnnouncementSignaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_AnnouncementSignaturesDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_AnnouncementSignaturesDecodeErrorZ ret_hu_conv = Result_AnnouncementSignaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_AsyncPaymentsMessageDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_AsyncPaymentsMessageDecodeErrorZ.cs new file mode 100644 index 00000000..a4498260 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_AsyncPaymentsMessageDecodeErrorZ.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 { + +public class Result_AsyncPaymentsMessageDecodeErrorZ : CommonBase { + Result_AsyncPaymentsMessageDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_AsyncPaymentsMessageDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_AsyncPaymentsMessageDecodeErrorZ_free(ptr); } + } + + internal static Result_AsyncPaymentsMessageDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_AsyncPaymentsMessageDecodeErrorZ_is_ok(ptr)) { + return new Result_AsyncPaymentsMessageDecodeErrorZ_OK(null, ptr); + } else { + return new Result_AsyncPaymentsMessageDecodeErrorZ_Err(null, ptr); + } + } + public class Result_AsyncPaymentsMessageDecodeErrorZ_OK : Result_AsyncPaymentsMessageDecodeErrorZ { + public readonly AsyncPaymentsMessage res; + internal Result_AsyncPaymentsMessageDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_AsyncPaymentsMessageDecodeErrorZ_get_ok(ptr); + org.ldk.structs.AsyncPaymentsMessage res_hu_conv = org.ldk.structs.AsyncPaymentsMessage.constr_from_ptr(res); + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_AsyncPaymentsMessageDecodeErrorZ_Err : Result_AsyncPaymentsMessageDecodeErrorZ { + public readonly DecodeError err; + internal Result_AsyncPaymentsMessageDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_AsyncPaymentsMessageDecodeErrorZ_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_AsyncPaymentsMessageDecodeErrorZ in the success state. + */ + public static Result_AsyncPaymentsMessageDecodeErrorZ ok(org.ldk.structs.AsyncPaymentsMessage o) { + long ret = bindings.CResult_AsyncPaymentsMessageDecodeErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_AsyncPaymentsMessageDecodeErrorZ ret_hu_conv = Result_AsyncPaymentsMessageDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_AsyncPaymentsMessageDecodeErrorZ in the error state. + */ + public static Result_AsyncPaymentsMessageDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_AsyncPaymentsMessageDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_AsyncPaymentsMessageDecodeErrorZ ret_hu_conv = Result_AsyncPaymentsMessageDecodeErrorZ.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_AsyncPaymentsMessageDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_AsyncPaymentsMessageDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_AsyncPaymentsMessageDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_AsyncPaymentsMessageDecodeErrorZ clone() { + long ret = bindings.CResult_AsyncPaymentsMessageDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_AsyncPaymentsMessageDecodeErrorZ ret_hu_conv = Result_AsyncPaymentsMessageDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_BestBlockDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_BestBlockDecodeErrorZ.cs index 1a63cd01..56f175ed 100644 --- a/c_sharp/src/org/ldk/structs/Result_BestBlockDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_BestBlockDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_BestBlockDecodeErrorZ : CommonBase { 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; } @@ -58,7 +57,6 @@ public class Result_BestBlockDecodeErrorZ : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/Result_BigSizeDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_BigSizeDecodeErrorZ.cs index 3381ec30..264f5ecb 100644 --- a/c_sharp/src/org/ldk/structs/Result_BigSizeDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_BigSizeDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_BigSizeDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_BigSizeDecodeErrorZ ret_hu_conv = Result_BigSizeDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_BigSizeDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_BigSizeDecodeErrorZ ret_hu_conv = Result_BigSizeDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_BlindedFailureDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_BlindedFailureDecodeErrorZ.cs index 63508778..b990637f 100644 --- a/c_sharp/src/org/ldk/structs/Result_BlindedFailureDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_BlindedFailureDecodeErrorZ.cs @@ -54,7 +54,6 @@ public class Result_BlindedFailureDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_BlindedFailureDecodeErrorZ ret_hu_conv = Result_BlindedFailureDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_BlindedForwardDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_BlindedForwardDecodeErrorZ.cs index ea0e13bd..c9ae5368 100644 --- a/c_sharp/src/org/ldk/structs/Result_BlindedForwardDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_BlindedForwardDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_BlindedForwardDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_BlindedForwardDecodeErrorZ ret_hu_conv = Result_BlindedForwardDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_BlindedForwardDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_BlindedForwardDecodeErrorZ ret_hu_conv = Result_BlindedForwardDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_BlindedHopDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_BlindedHopDecodeErrorZ.cs index 6affe112..f81fcb64 100644 --- a/c_sharp/src/org/ldk/structs/Result_BlindedHopDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_BlindedHopDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_BlindedHopDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_BlindedHopDecodeErrorZ ret_hu_conv = Result_BlindedHopDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_BlindedHopDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_BlindedHopDecodeErrorZ ret_hu_conv = Result_BlindedHopDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_BlindedHopFeaturesDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_BlindedHopFeaturesDecodeErrorZ.cs index 8cc73f14..abd4cfe4 100644 --- a/c_sharp/src/org/ldk/structs/Result_BlindedHopFeaturesDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_BlindedHopFeaturesDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_BlindedHopFeaturesDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_BlindedHopFeaturesDecodeErrorZ ret_hu_conv = Result_BlindedHopFeaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_BlindedHopFeaturesDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_BlindedHopFeaturesDecodeErrorZ ret_hu_conv = Result_BlindedHopFeaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_BlindedMessagePathDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_BlindedMessagePathDecodeErrorZ.cs new file mode 100644 index 00000000..0fcbfa97 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_BlindedMessagePathDecodeErrorZ.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 { + +public class Result_BlindedMessagePathDecodeErrorZ : CommonBase { + Result_BlindedMessagePathDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_BlindedMessagePathDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_BlindedMessagePathDecodeErrorZ_free(ptr); } + } + + internal static Result_BlindedMessagePathDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_BlindedMessagePathDecodeErrorZ_is_ok(ptr)) { + return new Result_BlindedMessagePathDecodeErrorZ_OK(null, ptr); + } else { + return new Result_BlindedMessagePathDecodeErrorZ_Err(null, ptr); + } + } + public class Result_BlindedMessagePathDecodeErrorZ_OK : Result_BlindedMessagePathDecodeErrorZ { + public readonly BlindedMessagePath res; + internal Result_BlindedMessagePathDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_BlindedMessagePathDecodeErrorZ_get_ok(ptr); + org.ldk.structs.BlindedMessagePath res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.BlindedMessagePath(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_BlindedMessagePathDecodeErrorZ_Err : Result_BlindedMessagePathDecodeErrorZ { + public readonly DecodeError err; + internal Result_BlindedMessagePathDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_BlindedMessagePathDecodeErrorZ_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_BlindedMessagePathDecodeErrorZ in the success state. + */ + public static Result_BlindedMessagePathDecodeErrorZ ok(org.ldk.structs.BlindedMessagePath o) { + long ret = bindings.CResult_BlindedMessagePathDecodeErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedMessagePathDecodeErrorZ ret_hu_conv = Result_BlindedMessagePathDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_BlindedMessagePathDecodeErrorZ in the error state. + */ + public static Result_BlindedMessagePathDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_BlindedMessagePathDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedMessagePathDecodeErrorZ ret_hu_conv = Result_BlindedMessagePathDecodeErrorZ.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_BlindedMessagePathDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_BlindedMessagePathDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_BlindedMessagePathDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_BlindedMessagePathDecodeErrorZ clone() { + long ret = bindings.CResult_BlindedMessagePathDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedMessagePathDecodeErrorZ ret_hu_conv = Result_BlindedMessagePathDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_BlindedMessagePathNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_BlindedMessagePathNoneZ.cs new file mode 100644 index 00000000..cace601d --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_BlindedMessagePathNoneZ.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 { + +public class Result_BlindedMessagePathNoneZ : CommonBase { + Result_BlindedMessagePathNoneZ(object _dummy, long ptr) : base(ptr) { } + ~Result_BlindedMessagePathNoneZ() { + if (ptr != 0) { bindings.CResult_BlindedMessagePathNoneZ_free(ptr); } + } + + internal static Result_BlindedMessagePathNoneZ constr_from_ptr(long ptr) { + if (bindings.CResult_BlindedMessagePathNoneZ_is_ok(ptr)) { + return new Result_BlindedMessagePathNoneZ_OK(null, ptr); + } else { + return new Result_BlindedMessagePathNoneZ_Err(null, ptr); + } + } + public class Result_BlindedMessagePathNoneZ_OK : Result_BlindedMessagePathNoneZ { + public readonly BlindedMessagePath res; + internal Result_BlindedMessagePathNoneZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_BlindedMessagePathNoneZ_get_ok(ptr); + org.ldk.structs.BlindedMessagePath res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.BlindedMessagePath(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_BlindedMessagePathNoneZ_Err : Result_BlindedMessagePathNoneZ { + internal Result_BlindedMessagePathNoneZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + } + } + + /** + * Creates a new CResult_BlindedMessagePathNoneZ in the success state. + */ + public static Result_BlindedMessagePathNoneZ ok(org.ldk.structs.BlindedMessagePath o) { + long ret = bindings.CResult_BlindedMessagePathNoneZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedMessagePathNoneZ ret_hu_conv = Result_BlindedMessagePathNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_BlindedMessagePathNoneZ in the error state. + */ + public static Result_BlindedMessagePathNoneZ err() { + long ret = bindings.CResult_BlindedMessagePathNoneZ_err(); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedMessagePathNoneZ ret_hu_conv = Result_BlindedMessagePathNoneZ.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_BlindedMessagePathNoneZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_BlindedMessagePathNoneZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_BlindedMessagePathNoneZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_BlindedMessagePathNoneZ clone() { + long ret = bindings.CResult_BlindedMessagePathNoneZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedMessagePathNoneZ ret_hu_conv = Result_BlindedMessagePathNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_BlindedPathDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_BlindedPathDecodeErrorZ.cs deleted file mode 100644 index 7932b6b6..00000000 --- a/c_sharp/src/org/ldk/structs/Result_BlindedPathDecodeErrorZ.cs +++ /dev/null @@ -1,93 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - -public class Result_BlindedPathDecodeErrorZ : CommonBase { - Result_BlindedPathDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } - ~Result_BlindedPathDecodeErrorZ() { - if (ptr != 0) { bindings.CResult_BlindedPathDecodeErrorZ_free(ptr); } - } - - internal static Result_BlindedPathDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.CResult_BlindedPathDecodeErrorZ_is_ok(ptr)) { - return new Result_BlindedPathDecodeErrorZ_OK(null, ptr); - } else { - return new Result_BlindedPathDecodeErrorZ_Err(null, ptr); - } - } - public class Result_BlindedPathDecodeErrorZ_OK : Result_BlindedPathDecodeErrorZ { - public readonly BlindedPath res; - internal Result_BlindedPathDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { - long res = bindings.CResult_BlindedPathDecodeErrorZ_get_ok(ptr); - org.ldk.structs.BlindedPath res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.BlindedPath(null, res); } - if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; - this.res = res_hu_conv; - } - } - - public class Result_BlindedPathDecodeErrorZ_Err : Result_BlindedPathDecodeErrorZ { - public readonly DecodeError err; - internal Result_BlindedPathDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { - long err = bindings.CResult_BlindedPathDecodeErrorZ_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_BlindedPathDecodeErrorZ in the success state. - */ - public static Result_BlindedPathDecodeErrorZ ok(org.ldk.structs.BlindedPath o) { - 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); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; - return ret_hu_conv; - } - - /** - * Creates a new CResult_BlindedPathDecodeErrorZ in the error state. - */ - public static Result_BlindedPathDecodeErrorZ err(org.ldk.structs.DecodeError e) { - long ret = bindings.CResult_BlindedPathDecodeErrorZ_err(e.ptr); - GC.KeepAlive(e); - if (ret >= 0 && ret <= 4096) { return null; } - Result_BlindedPathDecodeErrorZ ret_hu_conv = Result_BlindedPathDecodeErrorZ.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_BlindedPathDecodeErrorZ_is_ok(this.ptr); - GC.KeepAlive(this); - return ret; - } - - internal long clone_ptr() { - long ret = bindings.CResult_BlindedPathDecodeErrorZ_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a new CResult_BlindedPathDecodeErrorZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_BlindedPathDecodeErrorZ clone() { - long ret = bindings.CResult_BlindedPathDecodeErrorZ_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_BlindedPathDecodeErrorZ ret_hu_conv = Result_BlindedPathDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/Result_BlindedPathNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_BlindedPathNoneZ.cs deleted file mode 100644 index fdc90701..00000000 --- a/c_sharp/src/org/ldk/structs/Result_BlindedPathNoneZ.cs +++ /dev/null @@ -1,86 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - -public class Result_BlindedPathNoneZ : CommonBase { - Result_BlindedPathNoneZ(object _dummy, long ptr) : base(ptr) { } - ~Result_BlindedPathNoneZ() { - if (ptr != 0) { bindings.CResult_BlindedPathNoneZ_free(ptr); } - } - - internal static Result_BlindedPathNoneZ constr_from_ptr(long ptr) { - if (bindings.CResult_BlindedPathNoneZ_is_ok(ptr)) { - return new Result_BlindedPathNoneZ_OK(null, ptr); - } else { - return new Result_BlindedPathNoneZ_Err(null, ptr); - } - } - public class Result_BlindedPathNoneZ_OK : Result_BlindedPathNoneZ { - public readonly BlindedPath res; - internal Result_BlindedPathNoneZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { - long res = bindings.CResult_BlindedPathNoneZ_get_ok(ptr); - org.ldk.structs.BlindedPath res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.BlindedPath(null, res); } - if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; - this.res = res_hu_conv; - } - } - - public class Result_BlindedPathNoneZ_Err : Result_BlindedPathNoneZ { - internal Result_BlindedPathNoneZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { - } - } - - /** - * 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.ptr); - GC.KeepAlive(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_BlindedPathNoneZ ret_hu_conv = Result_BlindedPathNoneZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; - return ret_hu_conv; - } - - /** - * Creates a new CResult_BlindedPathNoneZ in the error state. - */ - public static Result_BlindedPathNoneZ err() { - long ret = bindings.CResult_BlindedPathNoneZ_err(); - if (ret >= 0 && ret <= 4096) { return null; } - Result_BlindedPathNoneZ ret_hu_conv = Result_BlindedPathNoneZ.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_BlindedPathNoneZ_is_ok(this.ptr); - GC.KeepAlive(this); - return ret; - } - - internal long clone_ptr() { - long ret = bindings.CResult_BlindedPathNoneZ_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a new CResult_BlindedPathNoneZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_BlindedPathNoneZ clone() { - long ret = bindings.CResult_BlindedPathNoneZ_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_BlindedPathNoneZ ret_hu_conv = Result_BlindedPathNoneZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/Result_BlindedPayInfoDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_BlindedPayInfoDecodeErrorZ.cs index 6e4b58e3..c4ce9dc0 100644 --- a/c_sharp/src/org/ldk/structs/Result_BlindedPayInfoDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_BlindedPayInfoDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_BlindedPayInfoDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_BlindedPayInfoDecodeErrorZ ret_hu_conv = Result_BlindedPayInfoDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_BlindedPayInfoDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_BlindedPayInfoDecodeErrorZ ret_hu_conv = Result_BlindedPayInfoDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_BlindedPaymentPathNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_BlindedPaymentPathNoneZ.cs new file mode 100644 index 00000000..99dfdb16 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_BlindedPaymentPathNoneZ.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 { + +public class Result_BlindedPaymentPathNoneZ : CommonBase { + Result_BlindedPaymentPathNoneZ(object _dummy, long ptr) : base(ptr) { } + ~Result_BlindedPaymentPathNoneZ() { + if (ptr != 0) { bindings.CResult_BlindedPaymentPathNoneZ_free(ptr); } + } + + internal static Result_BlindedPaymentPathNoneZ constr_from_ptr(long ptr) { + if (bindings.CResult_BlindedPaymentPathNoneZ_is_ok(ptr)) { + return new Result_BlindedPaymentPathNoneZ_OK(null, ptr); + } else { + return new Result_BlindedPaymentPathNoneZ_Err(null, ptr); + } + } + public class Result_BlindedPaymentPathNoneZ_OK : Result_BlindedPaymentPathNoneZ { + public readonly BlindedPaymentPath res; + internal Result_BlindedPaymentPathNoneZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_BlindedPaymentPathNoneZ_get_ok(ptr); + org.ldk.structs.BlindedPaymentPath res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.BlindedPaymentPath(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_BlindedPaymentPathNoneZ_Err : Result_BlindedPaymentPathNoneZ { + internal Result_BlindedPaymentPathNoneZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + } + } + + /** + * Creates a new CResult_BlindedPaymentPathNoneZ in the success state. + */ + public static Result_BlindedPaymentPathNoneZ ok(org.ldk.structs.BlindedPaymentPath o) { + long ret = bindings.CResult_BlindedPaymentPathNoneZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedPaymentPathNoneZ ret_hu_conv = Result_BlindedPaymentPathNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_BlindedPaymentPathNoneZ in the error state. + */ + public static Result_BlindedPaymentPathNoneZ err() { + long ret = bindings.CResult_BlindedPaymentPathNoneZ_err(); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedPaymentPathNoneZ ret_hu_conv = Result_BlindedPaymentPathNoneZ.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_BlindedPaymentPathNoneZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_BlindedPaymentPathNoneZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_BlindedPaymentPathNoneZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_BlindedPaymentPathNoneZ clone() { + long ret = bindings.CResult_BlindedPaymentPathNoneZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedPaymentPathNoneZ ret_hu_conv = Result_BlindedPaymentPathNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_BlindedTailDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_BlindedTailDecodeErrorZ.cs index 0bfc6ebb..d6b572d8 100644 --- a/c_sharp/src/org/ldk/structs/Result_BlindedTailDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_BlindedTailDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_BlindedTailDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_BlindedTailDecodeErrorZ ret_hu_conv = Result_BlindedTailDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_BlindedTailDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_BlindedTailDecodeErrorZ ret_hu_conv = Result_BlindedTailDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceBolt11SemanticErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceBolt11SemanticErrorZ.cs index c2ce8a54..125582be 100644 --- a/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceBolt11SemanticErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceBolt11SemanticErrorZ.cs @@ -43,7 +43,6 @@ public class Result_Bolt11InvoiceBolt11SemanticErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_Bolt11InvoiceBolt11SemanticErrorZ ret_hu_conv = Result_Bolt11InvoiceBolt11SemanticErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceFeaturesDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceFeaturesDecodeErrorZ.cs index f7f65454..c85e8b0d 100644 --- a/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceFeaturesDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceFeaturesDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_Bolt11InvoiceFeaturesDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_Bolt11InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_Bolt11InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_Bolt11InvoiceFeaturesDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_Bolt11InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_Bolt11InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceParseOrSemanticErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceParseOrSemanticErrorZ.cs index 9e464393..61ed1481 100644 --- a/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceParseOrSemanticErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceParseOrSemanticErrorZ.cs @@ -46,7 +46,6 @@ public class Result_Bolt11InvoiceParseOrSemanticErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_Bolt11InvoiceParseOrSemanticErrorZ ret_hu_conv = Result_Bolt11InvoiceParseOrSemanticErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_Bolt11InvoiceParseOrSemanticErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_Bolt11InvoiceParseOrSemanticErrorZ ret_hu_conv = Result_Bolt11InvoiceParseOrSemanticErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceSignOrCreationErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceSignOrCreationErrorZ.cs index 26d6a249..3cf57396 100644 --- a/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceSignOrCreationErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceSignOrCreationErrorZ.cs @@ -46,7 +46,6 @@ public class Result_Bolt11InvoiceSignOrCreationErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_Bolt11InvoiceSignOrCreationErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_Bolt12InvoiceBolt12SemanticErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_Bolt12InvoiceBolt12SemanticErrorZ.cs index 7dfe984d..4f3bbbf5 100644 --- a/c_sharp/src/org/ldk/structs/Result_Bolt12InvoiceBolt12SemanticErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_Bolt12InvoiceBolt12SemanticErrorZ.cs @@ -43,7 +43,6 @@ public class Result_Bolt12InvoiceBolt12SemanticErrorZ : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/Result_Bolt12InvoiceDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_Bolt12InvoiceDecodeErrorZ.cs new file mode 100644 index 00000000..300c01a3 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_Bolt12InvoiceDecodeErrorZ.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 { + +public class Result_Bolt12InvoiceDecodeErrorZ : CommonBase { + Result_Bolt12InvoiceDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_Bolt12InvoiceDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_Bolt12InvoiceDecodeErrorZ_free(ptr); } + } + + internal static Result_Bolt12InvoiceDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_Bolt12InvoiceDecodeErrorZ_is_ok(ptr)) { + return new Result_Bolt12InvoiceDecodeErrorZ_OK(null, ptr); + } else { + return new Result_Bolt12InvoiceDecodeErrorZ_Err(null, ptr); + } + } + public class Result_Bolt12InvoiceDecodeErrorZ_OK : Result_Bolt12InvoiceDecodeErrorZ { + public readonly Bolt12Invoice res; + internal Result_Bolt12InvoiceDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_Bolt12InvoiceDecodeErrorZ_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_Bolt12InvoiceDecodeErrorZ_Err : Result_Bolt12InvoiceDecodeErrorZ { + public readonly DecodeError err; + internal Result_Bolt12InvoiceDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_Bolt12InvoiceDecodeErrorZ_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_Bolt12InvoiceDecodeErrorZ in the success state. + */ + public static Result_Bolt12InvoiceDecodeErrorZ ok(org.ldk.structs.Bolt12Invoice o) { + long ret = bindings.CResult_Bolt12InvoiceDecodeErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt12InvoiceDecodeErrorZ ret_hu_conv = Result_Bolt12InvoiceDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_Bolt12InvoiceDecodeErrorZ in the error state. + */ + public static Result_Bolt12InvoiceDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_Bolt12InvoiceDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt12InvoiceDecodeErrorZ ret_hu_conv = Result_Bolt12InvoiceDecodeErrorZ.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_Bolt12InvoiceDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_Bolt12InvoiceDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_Bolt12InvoiceDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_Bolt12InvoiceDecodeErrorZ clone() { + long ret = bindings.CResult_Bolt12InvoiceDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt12InvoiceDecodeErrorZ ret_hu_conv = Result_Bolt12InvoiceDecodeErrorZ.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 1501b052..1b8dba7b 100644 --- a/c_sharp/src/org/ldk/structs/Result_Bolt12InvoiceFeaturesDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_Bolt12InvoiceFeaturesDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_Bolt12InvoiceFeaturesDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_Bolt12InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_Bolt12InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_Bolt12InvoiceFeaturesDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_Bolt12InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_Bolt12InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_Bolt12OfferContextDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_Bolt12OfferContextDecodeErrorZ.cs index 8d99376f..779e5171 100644 --- a/c_sharp/src/org/ldk/structs/Result_Bolt12OfferContextDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_Bolt12OfferContextDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_Bolt12OfferContextDecodeErrorZ : CommonBase { 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; } @@ -58,7 +57,6 @@ public class Result_Bolt12OfferContextDecodeErrorZ : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/Result_Bolt12RefundContextDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_Bolt12RefundContextDecodeErrorZ.cs index dc91b8d3..d0641812 100644 --- a/c_sharp/src/org/ldk/structs/Result_Bolt12RefundContextDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_Bolt12RefundContextDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_Bolt12RefundContextDecodeErrorZ : CommonBase { 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; } @@ -58,7 +57,6 @@ public class Result_Bolt12RefundContextDecodeErrorZ : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.cs index 67ea9ab2..e21a5d6f 100644 --- a/c_sharp/src/org/ldk/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_BuiltCommitmentTransactionDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_BuiltCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_BuiltCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_BuiltCommitmentTransactionDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_BuiltCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_BuiltCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ.cs index 23d3f310..ba9251e3 100644 --- a/c_sharp/src/org/ldk/structs/Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ.cs @@ -46,6 +46,7 @@ public class Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ : CommonBase { GC.KeepAlive(o); 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(o); }; return ret_hu_conv; } @@ -57,7 +58,6 @@ public class Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.cs deleted file mode 100644 index 35b8b5f1..00000000 --- a/c_sharp/src/org/ldk/structs/Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.cs +++ /dev/null @@ -1,85 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - -public class Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ : CommonBase { - Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ(object _dummy, long ptr) : base(ptr) { } - ~Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ() { - if (ptr != 0) { bindings.CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free(ptr); } - } - - internal static Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ constr_from_ptr(long ptr) { - if (bindings.CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_is_ok(ptr)) { - return new Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_OK(null, ptr); - } else { - return new Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_Err(null, ptr); - } - } - public class Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_OK : Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ { - public readonly TwoTuple_BlindedPayInfoBlindedPathZ res; - internal Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { - long res = bindings.CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_get_ok(ptr); - TwoTuple_BlindedPayInfoBlindedPathZ res_hu_conv = new TwoTuple_BlindedPayInfoBlindedPathZ(null, res); - if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; - this.res = res_hu_conv; - } - } - - public class Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_Err : Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ { - internal Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { - } - } - - /** - * 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.ptr); - GC.KeepAlive(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ ret_hu_conv = Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ in the error state. - */ - public static Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ err() { - long ret = bindings.CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_err(); - if (ret >= 0 && ret <= 4096) { return null; } - Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ ret_hu_conv = Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.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_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_is_ok(this.ptr); - GC.KeepAlive(this); - return ret; - } - - internal long clone_ptr() { - long ret = bindings.CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ clone() { - long ret = bindings.CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ ret_hu_conv = Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} -} } } 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 627f6344..0e37fc32 100644 --- a/c_sharp/src/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ.cs @@ -46,6 +46,7 @@ public class Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ : CommonBa GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ ret_hu_conv = Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -57,7 +58,6 @@ public class Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ : CommonBa GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ ret_hu_conv = Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } 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 3582541d..dffb063b 100644 --- a/c_sharp/src/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ.cs @@ -57,7 +57,6 @@ public class Result_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ : CommonBa GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ ret_hu_conv = Result_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } 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 ce21d578..0426359b 100644 --- a/c_sharp/src/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ.cs @@ -57,7 +57,6 @@ public class Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ : C GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ ret_hu_conv = Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } 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 b8ab9339..9482296d 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 @@ -57,7 +57,6 @@ public class Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSe GC.KeepAlive(e); 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(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_COption_APIErrorZDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_COption_APIErrorZDecodeErrorZ.cs index c3ef6037..d3a81957 100644 --- a/c_sharp/src/org/ldk/structs/Result_COption_APIErrorZDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_COption_APIErrorZDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_COption_APIErrorZDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_APIErrorZDecodeErrorZ ret_hu_conv = Result_COption_APIErrorZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_COption_APIErrorZDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_APIErrorZDecodeErrorZ ret_hu_conv = Result_COption_APIErrorZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_COption_ClosureReasonZDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_COption_ClosureReasonZDecodeErrorZ.cs index 258edbe7..2471d6ee 100644 --- a/c_sharp/src/org/ldk/structs/Result_COption_ClosureReasonZDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_COption_ClosureReasonZDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_COption_ClosureReasonZDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_ClosureReasonZDecodeErrorZ ret_hu_conv = Result_COption_ClosureReasonZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_COption_ClosureReasonZDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_ClosureReasonZDecodeErrorZ ret_hu_conv = Result_COption_ClosureReasonZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_COption_EventZDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_COption_EventZDecodeErrorZ.cs index 02d7c7f9..16982439 100644 --- a/c_sharp/src/org/ldk/structs/Result_COption_EventZDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_COption_EventZDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_COption_EventZDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_EventZDecodeErrorZ ret_hu_conv = Result_COption_EventZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_COption_EventZDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_EventZDecodeErrorZ ret_hu_conv = Result_COption_EventZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_COption_HTLCDestinationZDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_COption_HTLCDestinationZDecodeErrorZ.cs index 7d92a7f1..5b392a4d 100644 --- a/c_sharp/src/org/ldk/structs/Result_COption_HTLCDestinationZDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_COption_HTLCDestinationZDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_COption_HTLCDestinationZDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_HTLCDestinationZDecodeErrorZ ret_hu_conv = Result_COption_HTLCDestinationZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_COption_HTLCDestinationZDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_HTLCDestinationZDecodeErrorZ ret_hu_conv = Result_COption_HTLCDestinationZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_COption_InboundHTLCStateDetailsZDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_COption_InboundHTLCStateDetailsZDecodeErrorZ.cs index 153d8d21..a2270d91 100644 --- a/c_sharp/src/org/ldk/structs/Result_COption_InboundHTLCStateDetailsZDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_COption_InboundHTLCStateDetailsZDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_COption_InboundHTLCStateDetailsZDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_InboundHTLCStateDetailsZDecodeErrorZ ret_hu_conv = Result_COption_InboundHTLCStateDetailsZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_COption_InboundHTLCStateDetailsZDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_InboundHTLCStateDetailsZDecodeErrorZ ret_hu_conv = Result_COption_InboundHTLCStateDetailsZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_COption_MonitorEventZDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_COption_MonitorEventZDecodeErrorZ.cs index 02395f8d..2f75f616 100644 --- a/c_sharp/src/org/ldk/structs/Result_COption_MonitorEventZDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_COption_MonitorEventZDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_COption_MonitorEventZDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_MonitorEventZDecodeErrorZ ret_hu_conv = Result_COption_MonitorEventZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_COption_MonitorEventZDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_MonitorEventZDecodeErrorZ ret_hu_conv = Result_COption_MonitorEventZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_COption_NetworkUpdateZDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_COption_NetworkUpdateZDecodeErrorZ.cs index 2dad04a9..bb5228aa 100644 --- a/c_sharp/src/org/ldk/structs/Result_COption_NetworkUpdateZDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_COption_NetworkUpdateZDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_COption_NetworkUpdateZDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_NetworkUpdateZDecodeErrorZ ret_hu_conv = Result_COption_NetworkUpdateZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_COption_NetworkUpdateZDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_NetworkUpdateZDecodeErrorZ ret_hu_conv = Result_COption_NetworkUpdateZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_COption_OnionMessageContentsZDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_COption_OnionMessageContentsZDecodeErrorZ.cs index a71c821d..5b723d57 100644 --- a/c_sharp/src/org/ldk/structs/Result_COption_OnionMessageContentsZDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_COption_OnionMessageContentsZDecodeErrorZ.cs @@ -58,7 +58,6 @@ public class Result_COption_OnionMessageContentsZDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_OnionMessageContentsZDecodeErrorZ ret_hu_conv = Result_COption_OnionMessageContentsZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ.cs index 6caee8bb..015221db 100644 --- a/c_sharp/src/org/ldk/structs/Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ ret_hu_conv = Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ ret_hu_conv = Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_COption_PathFailureZDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_COption_PathFailureZDecodeErrorZ.cs index 52b19168..7ea378f6 100644 --- a/c_sharp/src/org/ldk/structs/Result_COption_PathFailureZDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_COption_PathFailureZDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_COption_PathFailureZDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_PathFailureZDecodeErrorZ ret_hu_conv = Result_COption_PathFailureZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_COption_PathFailureZDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_PathFailureZDecodeErrorZ ret_hu_conv = Result_COption_PathFailureZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_COption_PaymentFailureReasonZDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_COption_PaymentFailureReasonZDecodeErrorZ.cs new file mode 100644 index 00000000..3644ad56 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_COption_PaymentFailureReasonZDecodeErrorZ.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 { + +public class Result_COption_PaymentFailureReasonZDecodeErrorZ : CommonBase { + Result_COption_PaymentFailureReasonZDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_COption_PaymentFailureReasonZDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_COption_PaymentFailureReasonZDecodeErrorZ_free(ptr); } + } + + internal static Result_COption_PaymentFailureReasonZDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_COption_PaymentFailureReasonZDecodeErrorZ_is_ok(ptr)) { + return new Result_COption_PaymentFailureReasonZDecodeErrorZ_OK(null, ptr); + } else { + return new Result_COption_PaymentFailureReasonZDecodeErrorZ_Err(null, ptr); + } + } + public class Result_COption_PaymentFailureReasonZDecodeErrorZ_OK : Result_COption_PaymentFailureReasonZDecodeErrorZ { + public readonly Option_PaymentFailureReasonZ res; + internal Result_COption_PaymentFailureReasonZDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_COption_PaymentFailureReasonZDecodeErrorZ_get_ok(ptr); + org.ldk.structs.Option_PaymentFailureReasonZ res_hu_conv = org.ldk.structs.Option_PaymentFailureReasonZ.constr_from_ptr(res); + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_COption_PaymentFailureReasonZDecodeErrorZ_Err : Result_COption_PaymentFailureReasonZDecodeErrorZ { + public readonly DecodeError err; + internal Result_COption_PaymentFailureReasonZDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_COption_PaymentFailureReasonZDecodeErrorZ_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_COption_PaymentFailureReasonZDecodeErrorZ in the success state. + */ + public static Result_COption_PaymentFailureReasonZDecodeErrorZ ok(org.ldk.structs.Option_PaymentFailureReasonZ o) { + long ret = bindings.CResult_COption_PaymentFailureReasonZDecodeErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_PaymentFailureReasonZDecodeErrorZ ret_hu_conv = Result_COption_PaymentFailureReasonZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_COption_PaymentFailureReasonZDecodeErrorZ in the error state. + */ + public static Result_COption_PaymentFailureReasonZDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_COption_PaymentFailureReasonZDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_PaymentFailureReasonZDecodeErrorZ ret_hu_conv = Result_COption_PaymentFailureReasonZDecodeErrorZ.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_COption_PaymentFailureReasonZDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_COption_PaymentFailureReasonZDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_COption_PaymentFailureReasonZDecodeErrorZ clone() { + long ret = bindings.CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_PaymentFailureReasonZDecodeErrorZ ret_hu_conv = Result_COption_PaymentFailureReasonZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_COption_TypeZDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_COption_TypeZDecodeErrorZ.cs index 483e59d4..a0b17de7 100644 --- a/c_sharp/src/org/ldk/structs/Result_COption_TypeZDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_COption_TypeZDecodeErrorZ.cs @@ -58,7 +58,6 @@ public class Result_COption_TypeZDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_TypeZDecodeErrorZ ret_hu_conv = Result_COption_TypeZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_CVec_BlindedMessagePathZNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_CVec_BlindedMessagePathZNoneZ.cs new file mode 100644 index 00000000..ba934765 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_CVec_BlindedMessagePathZNoneZ.cs @@ -0,0 +1,92 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_CVec_BlindedMessagePathZNoneZ : CommonBase { + Result_CVec_BlindedMessagePathZNoneZ(object _dummy, long ptr) : base(ptr) { } + ~Result_CVec_BlindedMessagePathZNoneZ() { + if (ptr != 0) { bindings.CResult_CVec_BlindedMessagePathZNoneZ_free(ptr); } + } + + internal static Result_CVec_BlindedMessagePathZNoneZ constr_from_ptr(long ptr) { + if (bindings.CResult_CVec_BlindedMessagePathZNoneZ_is_ok(ptr)) { + return new Result_CVec_BlindedMessagePathZNoneZ_OK(null, ptr); + } else { + return new Result_CVec_BlindedMessagePathZNoneZ_Err(null, ptr); + } + } + public class Result_CVec_BlindedMessagePathZNoneZ_OK : Result_CVec_BlindedMessagePathZNoneZ { + public readonly BlindedMessagePath[] res; + internal Result_CVec_BlindedMessagePathZNoneZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_CVec_BlindedMessagePathZNoneZ_get_ok(ptr); + int res_conv_20_len = InternalUtils.getArrayLength(res); + BlindedMessagePath[] res_conv_20_arr = new BlindedMessagePath[res_conv_20_len]; + for (int u = 0; u < res_conv_20_len; u++) { + long res_conv_20 = InternalUtils.getU64ArrayElem(res, u); + org.ldk.structs.BlindedMessagePath res_conv_20_hu_conv = null; if (res_conv_20 < 0 || res_conv_20 > 4096) { res_conv_20_hu_conv = new org.ldk.structs.BlindedMessagePath(null, res_conv_20); } + if (res_conv_20_hu_conv != null) { res_conv_20_hu_conv.ptrs_to.AddLast(this); }; + res_conv_20_arr[u] = res_conv_20_hu_conv; + } + bindings.free_buffer(res); + this.res = res_conv_20_arr; + } + } + + public class Result_CVec_BlindedMessagePathZNoneZ_Err : Result_CVec_BlindedMessagePathZNoneZ { + internal Result_CVec_BlindedMessagePathZNoneZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + } + } + + /** + * Creates a new CResult_CVec_BlindedMessagePathZNoneZ in the success state. + */ + public static Result_CVec_BlindedMessagePathZNoneZ ok(BlindedMessagePath[] o) { + long ret = bindings.CResult_CVec_BlindedMessagePathZNoneZ_ok(InternalUtils.encodeUint64Array(InternalUtils.mapArray(o, o_conv_20 => o_conv_20.ptr))); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_CVec_BlindedMessagePathZNoneZ ret_hu_conv = Result_CVec_BlindedMessagePathZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_CVec_BlindedMessagePathZNoneZ in the error state. + */ + public static Result_CVec_BlindedMessagePathZNoneZ err() { + long ret = bindings.CResult_CVec_BlindedMessagePathZNoneZ_err(); + if (ret >= 0 && ret <= 4096) { return null; } + Result_CVec_BlindedMessagePathZNoneZ ret_hu_conv = Result_CVec_BlindedMessagePathZNoneZ.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_CVec_BlindedMessagePathZNoneZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_CVec_BlindedMessagePathZNoneZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_CVec_BlindedMessagePathZNoneZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_CVec_BlindedMessagePathZNoneZ clone() { + long ret = bindings.CResult_CVec_BlindedMessagePathZNoneZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_CVec_BlindedMessagePathZNoneZ ret_hu_conv = Result_CVec_BlindedMessagePathZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_CVec_BlindedPathZNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_CVec_BlindedPathZNoneZ.cs deleted file mode 100644 index 2e7e899e..00000000 --- a/c_sharp/src/org/ldk/structs/Result_CVec_BlindedPathZNoneZ.cs +++ /dev/null @@ -1,93 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - -public class Result_CVec_BlindedPathZNoneZ : CommonBase { - Result_CVec_BlindedPathZNoneZ(object _dummy, long ptr) : base(ptr) { } - ~Result_CVec_BlindedPathZNoneZ() { - if (ptr != 0) { bindings.CResult_CVec_BlindedPathZNoneZ_free(ptr); } - } - - internal static Result_CVec_BlindedPathZNoneZ constr_from_ptr(long ptr) { - if (bindings.CResult_CVec_BlindedPathZNoneZ_is_ok(ptr)) { - return new Result_CVec_BlindedPathZNoneZ_OK(null, ptr); - } else { - return new Result_CVec_BlindedPathZNoneZ_Err(null, ptr); - } - } - public class Result_CVec_BlindedPathZNoneZ_OK : Result_CVec_BlindedPathZNoneZ { - public readonly BlindedPath[] res; - internal Result_CVec_BlindedPathZNoneZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { - long res = bindings.CResult_CVec_BlindedPathZNoneZ_get_ok(ptr); - int res_conv_13_len = InternalUtils.getArrayLength(res); - BlindedPath[] res_conv_13_arr = new BlindedPath[res_conv_13_len]; - for (int n = 0; n < res_conv_13_len; n++) { - long res_conv_13 = InternalUtils.getU64ArrayElem(res, n); - org.ldk.structs.BlindedPath res_conv_13_hu_conv = null; if (res_conv_13 < 0 || res_conv_13 > 4096) { res_conv_13_hu_conv = new org.ldk.structs.BlindedPath(null, res_conv_13); } - if (res_conv_13_hu_conv != null) { res_conv_13_hu_conv.ptrs_to.AddLast(this); }; - res_conv_13_arr[n] = res_conv_13_hu_conv; - } - bindings.free_buffer(res); - this.res = res_conv_13_arr; - } - } - - public class Result_CVec_BlindedPathZNoneZ_Err : Result_CVec_BlindedPathZNoneZ { - internal Result_CVec_BlindedPathZNoneZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { - } - } - - /** - * 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.ptr))); - GC.KeepAlive(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_CVec_BlindedPathZNoneZ ret_hu_conv = Result_CVec_BlindedPathZNoneZ.constr_from_ptr(ret); - foreach (BlindedPath o_conv_13 in o) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o_conv_13); }; }; - return ret_hu_conv; - } - - /** - * Creates a new CResult_CVec_BlindedPathZNoneZ in the error state. - */ - public static Result_CVec_BlindedPathZNoneZ err() { - long ret = bindings.CResult_CVec_BlindedPathZNoneZ_err(); - if (ret >= 0 && ret <= 4096) { return null; } - Result_CVec_BlindedPathZNoneZ ret_hu_conv = Result_CVec_BlindedPathZNoneZ.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_CVec_BlindedPathZNoneZ_is_ok(this.ptr); - GC.KeepAlive(this); - return ret; - } - - internal long clone_ptr() { - long ret = bindings.CResult_CVec_BlindedPathZNoneZ_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a new CResult_CVec_BlindedPathZNoneZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_CVec_BlindedPathZNoneZ clone() { - long ret = bindings.CResult_CVec_BlindedPathZNoneZ_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_CVec_BlindedPathZNoneZ ret_hu_conv = Result_CVec_BlindedPathZNoneZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/Result_CVec_BlindedPaymentPathZNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_CVec_BlindedPaymentPathZNoneZ.cs new file mode 100644 index 00000000..879774c0 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_CVec_BlindedPaymentPathZNoneZ.cs @@ -0,0 +1,92 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_CVec_BlindedPaymentPathZNoneZ : CommonBase { + Result_CVec_BlindedPaymentPathZNoneZ(object _dummy, long ptr) : base(ptr) { } + ~Result_CVec_BlindedPaymentPathZNoneZ() { + if (ptr != 0) { bindings.CResult_CVec_BlindedPaymentPathZNoneZ_free(ptr); } + } + + internal static Result_CVec_BlindedPaymentPathZNoneZ constr_from_ptr(long ptr) { + if (bindings.CResult_CVec_BlindedPaymentPathZNoneZ_is_ok(ptr)) { + return new Result_CVec_BlindedPaymentPathZNoneZ_OK(null, ptr); + } else { + return new Result_CVec_BlindedPaymentPathZNoneZ_Err(null, ptr); + } + } + public class Result_CVec_BlindedPaymentPathZNoneZ_OK : Result_CVec_BlindedPaymentPathZNoneZ { + public readonly BlindedPaymentPath[] res; + internal Result_CVec_BlindedPaymentPathZNoneZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_CVec_BlindedPaymentPathZNoneZ_get_ok(ptr); + int res_conv_20_len = InternalUtils.getArrayLength(res); + BlindedPaymentPath[] res_conv_20_arr = new BlindedPaymentPath[res_conv_20_len]; + for (int u = 0; u < res_conv_20_len; u++) { + long res_conv_20 = InternalUtils.getU64ArrayElem(res, u); + org.ldk.structs.BlindedPaymentPath res_conv_20_hu_conv = null; if (res_conv_20 < 0 || res_conv_20 > 4096) { res_conv_20_hu_conv = new org.ldk.structs.BlindedPaymentPath(null, res_conv_20); } + if (res_conv_20_hu_conv != null) { res_conv_20_hu_conv.ptrs_to.AddLast(this); }; + res_conv_20_arr[u] = res_conv_20_hu_conv; + } + bindings.free_buffer(res); + this.res = res_conv_20_arr; + } + } + + public class Result_CVec_BlindedPaymentPathZNoneZ_Err : Result_CVec_BlindedPaymentPathZNoneZ { + internal Result_CVec_BlindedPaymentPathZNoneZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + } + } + + /** + * Creates a new CResult_CVec_BlindedPaymentPathZNoneZ in the success state. + */ + public static Result_CVec_BlindedPaymentPathZNoneZ ok(BlindedPaymentPath[] o) { + long ret = bindings.CResult_CVec_BlindedPaymentPathZNoneZ_ok(InternalUtils.encodeUint64Array(InternalUtils.mapArray(o, o_conv_20 => o_conv_20.ptr))); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_CVec_BlindedPaymentPathZNoneZ ret_hu_conv = Result_CVec_BlindedPaymentPathZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_CVec_BlindedPaymentPathZNoneZ in the error state. + */ + public static Result_CVec_BlindedPaymentPathZNoneZ err() { + long ret = bindings.CResult_CVec_BlindedPaymentPathZNoneZ_err(); + if (ret >= 0 && ret <= 4096) { return null; } + Result_CVec_BlindedPaymentPathZNoneZ ret_hu_conv = Result_CVec_BlindedPaymentPathZNoneZ.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_CVec_BlindedPaymentPathZNoneZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_CVec_BlindedPaymentPathZNoneZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_CVec_BlindedPaymentPathZNoneZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_CVec_BlindedPaymentPathZNoneZ clone() { + long ret = bindings.CResult_CVec_BlindedPaymentPathZNoneZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_CVec_BlindedPaymentPathZNoneZ ret_hu_conv = Result_CVec_BlindedPaymentPathZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } 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 deleted file mode 100644 index cc8501a7..00000000 --- a/c_sharp/src/org/ldk/structs/Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ.cs +++ /dev/null @@ -1,92 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - -public class Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ : CommonBase { - Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ(object _dummy, long ptr) : base(ptr) { } - ~Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ() { - if (ptr != 0) { bindings.CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_free(ptr); } - } - - internal static Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ constr_from_ptr(long ptr) { - if (bindings.CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_is_ok(ptr)) { - return new Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_OK(null, ptr); - } else { - return new Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_Err(null, ptr); - } - } - public class Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_OK : Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ { - public readonly TwoTuple_BlindedPayInfoBlindedPathZ[] res; - internal Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { - long res = bindings.CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_ok(ptr); - int res_conv_37_len = InternalUtils.getArrayLength(res); - TwoTuple_BlindedPayInfoBlindedPathZ[] res_conv_37_arr = new TwoTuple_BlindedPayInfoBlindedPathZ[res_conv_37_len]; - for (int l = 0; l < res_conv_37_len; l++) { - long res_conv_37 = InternalUtils.getU64ArrayElem(res, l); - TwoTuple_BlindedPayInfoBlindedPathZ res_conv_37_hu_conv = new TwoTuple_BlindedPayInfoBlindedPathZ(null, res_conv_37); - if (res_conv_37_hu_conv != null) { res_conv_37_hu_conv.ptrs_to.AddLast(this); }; - res_conv_37_arr[l] = res_conv_37_hu_conv; - } - bindings.free_buffer(res); - this.res = res_conv_37_arr; - } - } - - public class Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_Err : Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ { - internal Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { - } - } - - /** - * 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.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); - return ret_hu_conv; - } - - /** - * Creates a new CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ in the error state. - */ - public static Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ err() { - long ret = bindings.CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_err(); - if (ret >= 0 && ret <= 4096) { return null; } - Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ ret_hu_conv = Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ.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_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_is_ok(this.ptr); - GC.KeepAlive(this); - return ret; - } - - internal long clone_ptr() { - long ret = bindings.CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a new CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ clone() { - long ret = bindings.CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ ret_hu_conv = Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} -} } } 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 27308203..d7ebe0b0 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 @@ -64,7 +64,6 @@ public class Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ ret_hu_conv = Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } 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 c3d60e0a..b47e72ef 100644 --- a/c_sharp/src/org/ldk/structs/Result_CVec_UtxoZNoneZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_CVec_UtxoZNoneZ.cs @@ -48,7 +48,6 @@ public class Result_CVec_UtxoZNoneZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_CVec_UtxoZNoneZ ret_hu_conv = Result_CVec_UtxoZNoneZ.constr_from_ptr(ret); - foreach (Utxo o_conv_6 in o) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o_conv_6); }; }; return ret_hu_conv; } 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 c5b1cf3e..c3ea14fc 100644 --- a/c_sharp/src/org/ldk/structs/Result_CVec_u8ZPeerHandleErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_CVec_u8ZPeerHandleErrorZ.cs @@ -56,7 +56,6 @@ public class Result_CVec_u8ZPeerHandleErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_CVec_u8ZPeerHandleErrorZ ret_hu_conv = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelAnnouncementDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelAnnouncementDecodeErrorZ.cs index f8f2007a..54e651d8 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelAnnouncementDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelAnnouncementDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_ChannelAnnouncementDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_ChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_ChannelAnnouncementDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_ChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelConfigDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelConfigDecodeErrorZ.cs index 146a8fa0..b612f7b9 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelConfigDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelConfigDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_ChannelConfigDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelConfigDecodeErrorZ ret_hu_conv = Result_ChannelConfigDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_ChannelConfigDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelConfigDecodeErrorZ ret_hu_conv = Result_ChannelConfigDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelCounterpartyDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelCounterpartyDecodeErrorZ.cs index 7f0af086..4e7cf30c 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelCounterpartyDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelCounterpartyDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_ChannelCounterpartyDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelCounterpartyDecodeErrorZ ret_hu_conv = Result_ChannelCounterpartyDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_ChannelCounterpartyDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelCounterpartyDecodeErrorZ ret_hu_conv = Result_ChannelCounterpartyDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelDerivationParametersDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelDerivationParametersDecodeErrorZ.cs index 58c0f193..aac47833 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelDerivationParametersDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelDerivationParametersDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_ChannelDerivationParametersDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelDerivationParametersDecodeErrorZ ret_hu_conv = Result_ChannelDerivationParametersDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_ChannelDerivationParametersDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelDerivationParametersDecodeErrorZ ret_hu_conv = Result_ChannelDerivationParametersDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelDetailsDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelDetailsDecodeErrorZ.cs index 715ed0c4..42001339 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelDetailsDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelDetailsDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_ChannelDetailsDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelDetailsDecodeErrorZ ret_hu_conv = Result_ChannelDetailsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_ChannelDetailsDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelDetailsDecodeErrorZ ret_hu_conv = Result_ChannelDetailsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelFeaturesDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelFeaturesDecodeErrorZ.cs index 07b2d0d2..0faff45a 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelFeaturesDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelFeaturesDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_ChannelFeaturesDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelFeaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_ChannelFeaturesDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelFeaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelIdAPIErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelIdAPIErrorZ.cs index dc4db8de..7a903455 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelIdAPIErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelIdAPIErrorZ.cs @@ -46,7 +46,6 @@ public class Result_ChannelIdAPIErrorZ : CommonBase { 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; } @@ -58,7 +57,6 @@ public class Result_ChannelIdAPIErrorZ : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelIdDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelIdDecodeErrorZ.cs index 4ec32de9..b3aa59b8 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelIdDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelIdDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_ChannelIdDecodeErrorZ : CommonBase { 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; } @@ -58,7 +57,6 @@ public class Result_ChannelIdDecodeErrorZ : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelInfoDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelInfoDecodeErrorZ.cs index d25c231a..c834f9c2 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelInfoDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelInfoDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_ChannelInfoDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelInfoDecodeErrorZ ret_hu_conv = Result_ChannelInfoDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_ChannelInfoDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelInfoDecodeErrorZ ret_hu_conv = Result_ChannelInfoDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.cs index 80316e3f..af695e37 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_ChannelMonitorUpdateDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelMonitorUpdateDecodeErrorZ ret_hu_conv = Result_ChannelMonitorUpdateDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_ChannelMonitorUpdateDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelMonitorUpdateDecodeErrorZ ret_hu_conv = Result_ChannelMonitorUpdateDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelPublicKeysDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelPublicKeysDecodeErrorZ.cs index 0208a7a8..02d35294 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelPublicKeysDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelPublicKeysDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_ChannelPublicKeysDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelPublicKeysDecodeErrorZ ret_hu_conv = Result_ChannelPublicKeysDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_ChannelPublicKeysDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelPublicKeysDecodeErrorZ ret_hu_conv = Result_ChannelPublicKeysDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelReadyDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelReadyDecodeErrorZ.cs index 0bbd1bc9..cb9231b0 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelReadyDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelReadyDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_ChannelReadyDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelReadyDecodeErrorZ ret_hu_conv = Result_ChannelReadyDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_ChannelReadyDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelReadyDecodeErrorZ ret_hu_conv = Result_ChannelReadyDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.cs index 0632b14e..3f603790 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_ChannelReestablishDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelReestablishDecodeErrorZ ret_hu_conv = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_ChannelReestablishDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelReestablishDecodeErrorZ ret_hu_conv = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelShutdownStateDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelShutdownStateDecodeErrorZ.cs index eaf104c5..27f50287 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelShutdownStateDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelShutdownStateDecodeErrorZ.cs @@ -54,7 +54,6 @@ public class Result_ChannelShutdownStateDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelShutdownStateDecodeErrorZ ret_hu_conv = Result_ChannelShutdownStateDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelTransactionParametersDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelTransactionParametersDecodeErrorZ.cs index d0d82ee8..b9bc1dd8 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelTransactionParametersDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelTransactionParametersDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_ChannelTransactionParametersDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_ChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_ChannelTransactionParametersDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_ChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelTypeFeaturesDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelTypeFeaturesDecodeErrorZ.cs index d68db307..21d1706f 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelTypeFeaturesDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelTypeFeaturesDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_ChannelTypeFeaturesDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelTypeFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelTypeFeaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_ChannelTypeFeaturesDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelTypeFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelTypeFeaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelUpdateDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelUpdateDecodeErrorZ.cs index 906676d1..676b1549 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelUpdateDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelUpdateDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_ChannelUpdateDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelUpdateDecodeErrorZ ret_hu_conv = Result_ChannelUpdateDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_ChannelUpdateDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelUpdateDecodeErrorZ ret_hu_conv = Result_ChannelUpdateDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelUpdateInfoDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelUpdateInfoDecodeErrorZ.cs index 9407eb56..61abbbda 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelUpdateInfoDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelUpdateInfoDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_ChannelUpdateInfoDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelUpdateInfoDecodeErrorZ ret_hu_conv = Result_ChannelUpdateInfoDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_ChannelUpdateInfoDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelUpdateInfoDecodeErrorZ ret_hu_conv = Result_ChannelUpdateInfoDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ClaimedHTLCDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ClaimedHTLCDecodeErrorZ.cs index 79f8ff04..62b5700b 100644 --- a/c_sharp/src/org/ldk/structs/Result_ClaimedHTLCDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ClaimedHTLCDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_ClaimedHTLCDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ClaimedHTLCDecodeErrorZ ret_hu_conv = Result_ClaimedHTLCDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_ClaimedHTLCDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ClaimedHTLCDecodeErrorZ ret_hu_conv = Result_ClaimedHTLCDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ClosingSignedDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ClosingSignedDecodeErrorZ.cs index dc96f366..326531f1 100644 --- a/c_sharp/src/org/ldk/structs/Result_ClosingSignedDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ClosingSignedDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_ClosingSignedDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ClosingSignedDecodeErrorZ ret_hu_conv = Result_ClosingSignedDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_ClosingSignedDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ClosingSignedDecodeErrorZ ret_hu_conv = Result_ClosingSignedDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ClosingSignedFeeRangeDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ClosingSignedFeeRangeDecodeErrorZ.cs index fd43cd58..00d5ad90 100644 --- a/c_sharp/src/org/ldk/structs/Result_ClosingSignedFeeRangeDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ClosingSignedFeeRangeDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_ClosingSignedFeeRangeDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ClosingSignedFeeRangeDecodeErrorZ ret_hu_conv = Result_ClosingSignedFeeRangeDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_ClosingSignedFeeRangeDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ClosingSignedFeeRangeDecodeErrorZ ret_hu_conv = Result_ClosingSignedFeeRangeDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_CoinSelectionNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_CoinSelectionNoneZ.cs index 7564078b..687898e6 100644 --- a/c_sharp/src/org/ldk/structs/Result_CoinSelectionNoneZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_CoinSelectionNoneZ.cs @@ -41,7 +41,6 @@ public class Result_CoinSelectionNoneZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_CoinSelectionNoneZ ret_hu_conv = Result_CoinSelectionNoneZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_CommitmentSignedBatchDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_CommitmentSignedBatchDecodeErrorZ.cs new file mode 100644 index 00000000..2db36c3f --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_CommitmentSignedBatchDecodeErrorZ.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 { + +public class Result_CommitmentSignedBatchDecodeErrorZ : CommonBase { + Result_CommitmentSignedBatchDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_CommitmentSignedBatchDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_CommitmentSignedBatchDecodeErrorZ_free(ptr); } + } + + internal static Result_CommitmentSignedBatchDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_CommitmentSignedBatchDecodeErrorZ_is_ok(ptr)) { + return new Result_CommitmentSignedBatchDecodeErrorZ_OK(null, ptr); + } else { + return new Result_CommitmentSignedBatchDecodeErrorZ_Err(null, ptr); + } + } + public class Result_CommitmentSignedBatchDecodeErrorZ_OK : Result_CommitmentSignedBatchDecodeErrorZ { + public readonly CommitmentSignedBatch res; + internal Result_CommitmentSignedBatchDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_CommitmentSignedBatchDecodeErrorZ_get_ok(ptr); + org.ldk.structs.CommitmentSignedBatch res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.CommitmentSignedBatch(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_CommitmentSignedBatchDecodeErrorZ_Err : Result_CommitmentSignedBatchDecodeErrorZ { + public readonly DecodeError err; + internal Result_CommitmentSignedBatchDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_CommitmentSignedBatchDecodeErrorZ_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_CommitmentSignedBatchDecodeErrorZ in the success state. + */ + public static Result_CommitmentSignedBatchDecodeErrorZ ok(org.ldk.structs.CommitmentSignedBatch o) { + long ret = bindings.CResult_CommitmentSignedBatchDecodeErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_CommitmentSignedBatchDecodeErrorZ ret_hu_conv = Result_CommitmentSignedBatchDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_CommitmentSignedBatchDecodeErrorZ in the error state. + */ + public static Result_CommitmentSignedBatchDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_CommitmentSignedBatchDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_CommitmentSignedBatchDecodeErrorZ ret_hu_conv = Result_CommitmentSignedBatchDecodeErrorZ.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_CommitmentSignedBatchDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_CommitmentSignedBatchDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_CommitmentSignedBatchDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_CommitmentSignedBatchDecodeErrorZ clone() { + long ret = bindings.CResult_CommitmentSignedBatchDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_CommitmentSignedBatchDecodeErrorZ ret_hu_conv = Result_CommitmentSignedBatchDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_CommitmentSignedDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_CommitmentSignedDecodeErrorZ.cs index e281fd18..f00f8062 100644 --- a/c_sharp/src/org/ldk/structs/Result_CommitmentSignedDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_CommitmentSignedDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_CommitmentSignedDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_CommitmentSignedDecodeErrorZ ret_hu_conv = Result_CommitmentSignedDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_CommitmentSignedDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_CommitmentSignedDecodeErrorZ ret_hu_conv = Result_CommitmentSignedDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_CommitmentTransactionDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_CommitmentTransactionDecodeErrorZ.cs index d3dae238..7226be0c 100644 --- a/c_sharp/src/org/ldk/structs/Result_CommitmentTransactionDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_CommitmentTransactionDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_CommitmentTransactionDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_CommitmentTransactionDecodeErrorZ ret_hu_conv = Result_CommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_CommitmentTransactionDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_CommitmentTransactionDecodeErrorZ ret_hu_conv = Result_CommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.cs index 72f78bbe..52b7efce 100644 --- a/c_sharp/src/org/ldk/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_CounterpartyChannelTransactionParametersDecodeErrorZ : Commo GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_CounterpartyChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_CounterpartyChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_CounterpartyChannelTransactionParametersDecodeErrorZ : Commo GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_CounterpartyChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_CounterpartyChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_CounterpartyCommitmentSecretsDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_CounterpartyCommitmentSecretsDecodeErrorZ.cs index 7b1edace..50283c13 100644 --- a/c_sharp/src/org/ldk/structs/Result_CounterpartyCommitmentSecretsDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_CounterpartyCommitmentSecretsDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_CounterpartyCommitmentSecretsDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_CounterpartyCommitmentSecretsDecodeErrorZ ret_hu_conv = Result_CounterpartyCommitmentSecretsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_CounterpartyCommitmentSecretsDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_CounterpartyCommitmentSecretsDecodeErrorZ ret_hu_conv = Result_CounterpartyCommitmentSecretsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_CounterpartyForwardingInfoDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_CounterpartyForwardingInfoDecodeErrorZ.cs index a21839e7..234c2178 100644 --- a/c_sharp/src/org/ldk/structs/Result_CounterpartyForwardingInfoDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_CounterpartyForwardingInfoDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_CounterpartyForwardingInfoDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_CounterpartyForwardingInfoDecodeErrorZ ret_hu_conv = Result_CounterpartyForwardingInfoDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_CounterpartyForwardingInfoDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_CounterpartyForwardingInfoDecodeErrorZ ret_hu_conv = Result_CounterpartyForwardingInfoDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_DelayedPaymentBasepointDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_DelayedPaymentBasepointDecodeErrorZ.cs index 47049152..6cee23ec 100644 --- a/c_sharp/src/org/ldk/structs/Result_DelayedPaymentBasepointDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_DelayedPaymentBasepointDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_DelayedPaymentBasepointDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_DelayedPaymentBasepointDecodeErrorZ ret_hu_conv = Result_DelayedPaymentBasepointDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_DelayedPaymentBasepointDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_DelayedPaymentBasepointDecodeErrorZ ret_hu_conv = Result_DelayedPaymentBasepointDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_DelayedPaymentKeyDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_DelayedPaymentKeyDecodeErrorZ.cs index 2e5355a7..3f487bdb 100644 --- a/c_sharp/src/org/ldk/structs/Result_DelayedPaymentKeyDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_DelayedPaymentKeyDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_DelayedPaymentKeyDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_DelayedPaymentKeyDecodeErrorZ ret_hu_conv = Result_DelayedPaymentKeyDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_DelayedPaymentKeyDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_DelayedPaymentKeyDecodeErrorZ ret_hu_conv = Result_DelayedPaymentKeyDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.cs index 36570ac4..719a52a5 100644 --- a/c_sharp/src/org/ldk/structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_DelayedPaymentOutputDescriptorDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_DelayedPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_DelayedPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_DelayedPaymentOutputDescriptorDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_DelayedPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_DelayedPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_DescriptionCreationErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_DescriptionCreationErrorZ.cs index d3496ff8..763f4ba7 100644 --- a/c_sharp/src/org/ldk/structs/Result_DescriptionCreationErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_DescriptionCreationErrorZ.cs @@ -43,7 +43,6 @@ public class Result_DescriptionCreationErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_DescriptionCreationErrorZ ret_hu_conv = Result_DescriptionCreationErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_EcdsaChannelSignerDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_EcdsaChannelSignerDecodeErrorZ.cs new file mode 100644 index 00000000..a349449f --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_EcdsaChannelSignerDecodeErrorZ.cs @@ -0,0 +1,92 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_EcdsaChannelSignerDecodeErrorZ : CommonBase { + Result_EcdsaChannelSignerDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_EcdsaChannelSignerDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_EcdsaChannelSignerDecodeErrorZ_free(ptr); } + } + + internal static Result_EcdsaChannelSignerDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_EcdsaChannelSignerDecodeErrorZ_is_ok(ptr)) { + return new Result_EcdsaChannelSignerDecodeErrorZ_OK(null, ptr); + } else { + return new Result_EcdsaChannelSignerDecodeErrorZ_Err(null, ptr); + } + } + public class Result_EcdsaChannelSignerDecodeErrorZ_OK : Result_EcdsaChannelSignerDecodeErrorZ { + public readonly EcdsaChannelSigner res; + internal Result_EcdsaChannelSignerDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_EcdsaChannelSignerDecodeErrorZ_get_ok(ptr); + EcdsaChannelSigner ret_hu_conv = new EcdsaChannelSigner(null, res); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + this.res = ret_hu_conv; + } + } + + public class Result_EcdsaChannelSignerDecodeErrorZ_Err : Result_EcdsaChannelSignerDecodeErrorZ { + public readonly DecodeError err; + internal Result_EcdsaChannelSignerDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_EcdsaChannelSignerDecodeErrorZ_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_EcdsaChannelSignerDecodeErrorZ in the success state. + */ + public static Result_EcdsaChannelSignerDecodeErrorZ ok(org.ldk.structs.EcdsaChannelSigner o) { + long ret = bindings.CResult_EcdsaChannelSignerDecodeErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_EcdsaChannelSignerDecodeErrorZ ret_hu_conv = Result_EcdsaChannelSignerDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_EcdsaChannelSignerDecodeErrorZ in the error state. + */ + public static Result_EcdsaChannelSignerDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_EcdsaChannelSignerDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_EcdsaChannelSignerDecodeErrorZ ret_hu_conv = Result_EcdsaChannelSignerDecodeErrorZ.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_EcdsaChannelSignerDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_EcdsaChannelSignerDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_EcdsaChannelSignerDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_EcdsaChannelSignerDecodeErrorZ clone() { + long ret = bindings.CResult_EcdsaChannelSignerDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_EcdsaChannelSignerDecodeErrorZ ret_hu_conv = Result_EcdsaChannelSignerDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.cs index aedf8291..1c6dad88 100644 --- a/c_sharp/src/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_ErrorMessageDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ErrorMessageDecodeErrorZ ret_hu_conv = Result_ErrorMessageDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_ErrorMessageDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ErrorMessageDecodeErrorZ ret_hu_conv = Result_ErrorMessageDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_FinalOnionHopDataDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_FinalOnionHopDataDecodeErrorZ.cs index 8bce2530..00c76c6d 100644 --- a/c_sharp/src/org/ldk/structs/Result_FinalOnionHopDataDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_FinalOnionHopDataDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_FinalOnionHopDataDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_FinalOnionHopDataDecodeErrorZ ret_hu_conv = Result_FinalOnionHopDataDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_FinalOnionHopDataDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_FinalOnionHopDataDecodeErrorZ ret_hu_conv = Result_FinalOnionHopDataDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_FixedPenaltyScorerDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_FixedPenaltyScorerDecodeErrorZ.cs index 84c522a8..36aa92e2 100644 --- a/c_sharp/src/org/ldk/structs/Result_FixedPenaltyScorerDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_FixedPenaltyScorerDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_FixedPenaltyScorerDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_FixedPenaltyScorerDecodeErrorZ ret_hu_conv = Result_FixedPenaltyScorerDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_FixedPenaltyScorerDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_FixedPenaltyScorerDecodeErrorZ ret_hu_conv = Result_FixedPenaltyScorerDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_FundingCreatedDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_FundingCreatedDecodeErrorZ.cs index 20411eeb..3b5e7a7f 100644 --- a/c_sharp/src/org/ldk/structs/Result_FundingCreatedDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_FundingCreatedDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_FundingCreatedDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_FundingCreatedDecodeErrorZ ret_hu_conv = Result_FundingCreatedDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_FundingCreatedDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_FundingCreatedDecodeErrorZ ret_hu_conv = Result_FundingCreatedDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_FundingInfoDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_FundingInfoDecodeErrorZ.cs new file mode 100644 index 00000000..cd5bdd83 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_FundingInfoDecodeErrorZ.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 { + +public class Result_FundingInfoDecodeErrorZ : CommonBase { + Result_FundingInfoDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_FundingInfoDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_FundingInfoDecodeErrorZ_free(ptr); } + } + + internal static Result_FundingInfoDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_FundingInfoDecodeErrorZ_is_ok(ptr)) { + return new Result_FundingInfoDecodeErrorZ_OK(null, ptr); + } else { + return new Result_FundingInfoDecodeErrorZ_Err(null, ptr); + } + } + public class Result_FundingInfoDecodeErrorZ_OK : Result_FundingInfoDecodeErrorZ { + public readonly FundingInfo res; + internal Result_FundingInfoDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_FundingInfoDecodeErrorZ_get_ok(ptr); + org.ldk.structs.FundingInfo res_hu_conv = org.ldk.structs.FundingInfo.constr_from_ptr(res); + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_FundingInfoDecodeErrorZ_Err : Result_FundingInfoDecodeErrorZ { + public readonly DecodeError err; + internal Result_FundingInfoDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_FundingInfoDecodeErrorZ_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_FundingInfoDecodeErrorZ in the success state. + */ + public static Result_FundingInfoDecodeErrorZ ok(org.ldk.structs.FundingInfo o) { + long ret = bindings.CResult_FundingInfoDecodeErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_FundingInfoDecodeErrorZ ret_hu_conv = Result_FundingInfoDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_FundingInfoDecodeErrorZ in the error state. + */ + public static Result_FundingInfoDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_FundingInfoDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_FundingInfoDecodeErrorZ ret_hu_conv = Result_FundingInfoDecodeErrorZ.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_FundingInfoDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_FundingInfoDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_FundingInfoDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_FundingInfoDecodeErrorZ clone() { + long ret = bindings.CResult_FundingInfoDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_FundingInfoDecodeErrorZ ret_hu_conv = Result_FundingInfoDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_FundingSignedDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_FundingSignedDecodeErrorZ.cs index e32fac25..539879eb 100644 --- a/c_sharp/src/org/ldk/structs/Result_FundingSignedDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_FundingSignedDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_FundingSignedDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_FundingSignedDecodeErrorZ ret_hu_conv = Result_FundingSignedDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_FundingSignedDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_FundingSignedDecodeErrorZ ret_hu_conv = Result_FundingSignedDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.cs index 4a580887..a957937d 100644 --- a/c_sharp/src/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_GossipTimestampFilterDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_GossipTimestampFilterDecodeErrorZ ret_hu_conv = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_GossipTimestampFilterDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_GossipTimestampFilterDecodeErrorZ ret_hu_conv = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_HTLCDescriptorDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_HTLCDescriptorDecodeErrorZ.cs index 34f1b855..c852fbd5 100644 --- a/c_sharp/src/org/ldk/structs/Result_HTLCDescriptorDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_HTLCDescriptorDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_HTLCDescriptorDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_HTLCDescriptorDecodeErrorZ ret_hu_conv = Result_HTLCDescriptorDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_HTLCDescriptorDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_HTLCDescriptorDecodeErrorZ ret_hu_conv = Result_HTLCDescriptorDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.cs index 501a8fba..946aeeea 100644 --- a/c_sharp/src/org/ldk/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_HTLCOutputInCommitmentDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_HTLCOutputInCommitmentDecodeErrorZ ret_hu_conv = Result_HTLCOutputInCommitmentDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_HTLCOutputInCommitmentDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_HTLCOutputInCommitmentDecodeErrorZ ret_hu_conv = Result_HTLCOutputInCommitmentDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_HTLCUpdateDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_HTLCUpdateDecodeErrorZ.cs index 3ef6aa6a..cc1e3522 100644 --- a/c_sharp/src/org/ldk/structs/Result_HTLCUpdateDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_HTLCUpdateDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_HTLCUpdateDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_HTLCUpdateDecodeErrorZ ret_hu_conv = Result_HTLCUpdateDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_HTLCUpdateDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_HTLCUpdateDecodeErrorZ ret_hu_conv = Result_HTLCUpdateDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_HeldHtlcAvailableDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_HeldHtlcAvailableDecodeErrorZ.cs new file mode 100644 index 00000000..43b65f35 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_HeldHtlcAvailableDecodeErrorZ.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 { + +public class Result_HeldHtlcAvailableDecodeErrorZ : CommonBase { + Result_HeldHtlcAvailableDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_HeldHtlcAvailableDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_HeldHtlcAvailableDecodeErrorZ_free(ptr); } + } + + internal static Result_HeldHtlcAvailableDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_HeldHtlcAvailableDecodeErrorZ_is_ok(ptr)) { + return new Result_HeldHtlcAvailableDecodeErrorZ_OK(null, ptr); + } else { + return new Result_HeldHtlcAvailableDecodeErrorZ_Err(null, ptr); + } + } + public class Result_HeldHtlcAvailableDecodeErrorZ_OK : Result_HeldHtlcAvailableDecodeErrorZ { + public readonly HeldHtlcAvailable res; + internal Result_HeldHtlcAvailableDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_HeldHtlcAvailableDecodeErrorZ_get_ok(ptr); + org.ldk.structs.HeldHtlcAvailable res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.HeldHtlcAvailable(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_HeldHtlcAvailableDecodeErrorZ_Err : Result_HeldHtlcAvailableDecodeErrorZ { + public readonly DecodeError err; + internal Result_HeldHtlcAvailableDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_HeldHtlcAvailableDecodeErrorZ_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_HeldHtlcAvailableDecodeErrorZ in the success state. + */ + public static Result_HeldHtlcAvailableDecodeErrorZ ok(org.ldk.structs.HeldHtlcAvailable o) { + long ret = bindings.CResult_HeldHtlcAvailableDecodeErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_HeldHtlcAvailableDecodeErrorZ ret_hu_conv = Result_HeldHtlcAvailableDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_HeldHtlcAvailableDecodeErrorZ in the error state. + */ + public static Result_HeldHtlcAvailableDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_HeldHtlcAvailableDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_HeldHtlcAvailableDecodeErrorZ ret_hu_conv = Result_HeldHtlcAvailableDecodeErrorZ.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_HeldHtlcAvailableDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_HeldHtlcAvailableDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_HeldHtlcAvailableDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_HeldHtlcAvailableDecodeErrorZ clone() { + long ret = bindings.CResult_HeldHtlcAvailableDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_HeldHtlcAvailableDecodeErrorZ ret_hu_conv = Result_HeldHtlcAvailableDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_HolderCommitmentTransactionDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_HolderCommitmentTransactionDecodeErrorZ.cs index e37b5e44..f6c4a191 100644 --- a/c_sharp/src/org/ldk/structs/Result_HolderCommitmentTransactionDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_HolderCommitmentTransactionDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_HolderCommitmentTransactionDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_HolderCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_HolderCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_HolderCommitmentTransactionDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_HolderCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_HolderCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_HostnameDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_HostnameDecodeErrorZ.cs index c7e34cfc..d4089142 100644 --- a/c_sharp/src/org/ldk/structs/Result_HostnameDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_HostnameDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_HostnameDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_HostnameDecodeErrorZ ret_hu_conv = Result_HostnameDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_HostnameDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_HostnameDecodeErrorZ ret_hu_conv = Result_HostnameDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_HtlcBasepointDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_HtlcBasepointDecodeErrorZ.cs index 7e4886d6..70c1d37e 100644 --- a/c_sharp/src/org/ldk/structs/Result_HtlcBasepointDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_HtlcBasepointDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_HtlcBasepointDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_HtlcBasepointDecodeErrorZ ret_hu_conv = Result_HtlcBasepointDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_HtlcBasepointDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_HtlcBasepointDecodeErrorZ ret_hu_conv = Result_HtlcBasepointDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_HtlcKeyDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_HtlcKeyDecodeErrorZ.cs index 7037bc7f..e859206d 100644 --- a/c_sharp/src/org/ldk/structs/Result_HtlcKeyDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_HtlcKeyDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_HtlcKeyDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_HtlcKeyDecodeErrorZ ret_hu_conv = Result_HtlcKeyDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_HtlcKeyDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_HtlcKeyDecodeErrorZ ret_hu_conv = Result_HtlcKeyDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_InFlightHtlcsDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_InFlightHtlcsDecodeErrorZ.cs index 09681eab..6aa4fbff 100644 --- a/c_sharp/src/org/ldk/structs/Result_InFlightHtlcsDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_InFlightHtlcsDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_InFlightHtlcsDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_InFlightHtlcsDecodeErrorZ ret_hu_conv = Result_InFlightHtlcsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_InFlightHtlcsDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_InFlightHtlcsDecodeErrorZ ret_hu_conv = Result_InFlightHtlcsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_InMemorySignerDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_InMemorySignerDecodeErrorZ.cs index 0fdca818..271d7edc 100644 --- a/c_sharp/src/org/ldk/structs/Result_InMemorySignerDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_InMemorySignerDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_InMemorySignerDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_InMemorySignerDecodeErrorZ ret_hu_conv = Result_InMemorySignerDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_InMemorySignerDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_InMemorySignerDecodeErrorZ ret_hu_conv = Result_InMemorySignerDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_InboundHTLCDetailsDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_InboundHTLCDetailsDecodeErrorZ.cs index 1039db70..346935df 100644 --- a/c_sharp/src/org/ldk/structs/Result_InboundHTLCDetailsDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_InboundHTLCDetailsDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_InboundHTLCDetailsDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_InboundHTLCDetailsDecodeErrorZ ret_hu_conv = Result_InboundHTLCDetailsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_InboundHTLCDetailsDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_InboundHTLCDetailsDecodeErrorZ ret_hu_conv = Result_InboundHTLCDetailsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_InitDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_InitDecodeErrorZ.cs index f0e3abc5..ee1dacd4 100644 --- a/c_sharp/src/org/ldk/structs/Result_InitDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_InitDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_InitDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_InitDecodeErrorZ ret_hu_conv = Result_InitDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_InitDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_InitDecodeErrorZ ret_hu_conv = Result_InitDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_InitFeaturesDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_InitFeaturesDecodeErrorZ.cs index 18bd0b75..3b2d4302 100644 --- a/c_sharp/src/org/ldk/structs/Result_InitFeaturesDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_InitFeaturesDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_InitFeaturesDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_InitFeaturesDecodeErrorZ ret_hu_conv = Result_InitFeaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_InitFeaturesDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_InitFeaturesDecodeErrorZ ret_hu_conv = Result_InitFeaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_InvoiceErrorDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_InvoiceErrorDecodeErrorZ.cs index 96667d99..c6fc3007 100644 --- a/c_sharp/src/org/ldk/structs/Result_InvoiceErrorDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_InvoiceErrorDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_InvoiceErrorDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_InvoiceErrorDecodeErrorZ ret_hu_conv = Result_InvoiceErrorDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_InvoiceErrorDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_InvoiceErrorDecodeErrorZ ret_hu_conv = Result_InvoiceErrorDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_InvoiceRequestBolt12SemanticErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_InvoiceRequestBolt12SemanticErrorZ.cs index f24d56d7..746d21cc 100644 --- a/c_sharp/src/org/ldk/structs/Result_InvoiceRequestBolt12SemanticErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_InvoiceRequestBolt12SemanticErrorZ.cs @@ -43,7 +43,6 @@ public class Result_InvoiceRequestBolt12SemanticErrorZ : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/Result_InvoiceRequestFieldsDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_InvoiceRequestFieldsDecodeErrorZ.cs index cf99b087..34847c7d 100644 --- a/c_sharp/src/org/ldk/structs/Result_InvoiceRequestFieldsDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_InvoiceRequestFieldsDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_InvoiceRequestFieldsDecodeErrorZ : CommonBase { 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; } @@ -58,7 +57,6 @@ public class Result_InvoiceRequestFieldsDecodeErrorZ : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/Result_MaxDustHTLCExposureDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_MaxDustHTLCExposureDecodeErrorZ.cs index 3d3b7f81..b86b32ea 100644 --- a/c_sharp/src/org/ldk/structs/Result_MaxDustHTLCExposureDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_MaxDustHTLCExposureDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_MaxDustHTLCExposureDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_MaxDustHTLCExposureDecodeErrorZ ret_hu_conv = Result_MaxDustHTLCExposureDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_MaxDustHTLCExposureDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_MaxDustHTLCExposureDecodeErrorZ ret_hu_conv = Result_MaxDustHTLCExposureDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_MessageContextDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_MessageContextDecodeErrorZ.cs new file mode 100644 index 00000000..8a43e566 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_MessageContextDecodeErrorZ.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 { + +public class Result_MessageContextDecodeErrorZ : CommonBase { + Result_MessageContextDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_MessageContextDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_MessageContextDecodeErrorZ_free(ptr); } + } + + internal static Result_MessageContextDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_MessageContextDecodeErrorZ_is_ok(ptr)) { + return new Result_MessageContextDecodeErrorZ_OK(null, ptr); + } else { + return new Result_MessageContextDecodeErrorZ_Err(null, ptr); + } + } + public class Result_MessageContextDecodeErrorZ_OK : Result_MessageContextDecodeErrorZ { + public readonly MessageContext res; + internal Result_MessageContextDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_MessageContextDecodeErrorZ_get_ok(ptr); + org.ldk.structs.MessageContext res_hu_conv = org.ldk.structs.MessageContext.constr_from_ptr(res); + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_MessageContextDecodeErrorZ_Err : Result_MessageContextDecodeErrorZ { + public readonly DecodeError err; + internal Result_MessageContextDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_MessageContextDecodeErrorZ_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_MessageContextDecodeErrorZ in the success state. + */ + public static Result_MessageContextDecodeErrorZ ok(org.ldk.structs.MessageContext o) { + long ret = bindings.CResult_MessageContextDecodeErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_MessageContextDecodeErrorZ ret_hu_conv = Result_MessageContextDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_MessageContextDecodeErrorZ in the error state. + */ + public static Result_MessageContextDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_MessageContextDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_MessageContextDecodeErrorZ ret_hu_conv = Result_MessageContextDecodeErrorZ.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_MessageContextDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_MessageContextDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_MessageContextDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_MessageContextDecodeErrorZ clone() { + long ret = bindings.CResult_MessageContextDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_MessageContextDecodeErrorZ ret_hu_conv = Result_MessageContextDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_NetworkGraphDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_NetworkGraphDecodeErrorZ.cs index 31f4e81d..1a76915e 100644 --- a/c_sharp/src/org/ldk/structs/Result_NetworkGraphDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_NetworkGraphDecodeErrorZ.cs @@ -59,7 +59,6 @@ public class Result_NetworkGraphDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_NetworkGraphDecodeErrorZ ret_hu_conv = Result_NetworkGraphDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_NodeAliasDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_NodeAliasDecodeErrorZ.cs index c6358766..68168bac 100644 --- a/c_sharp/src/org/ldk/structs/Result_NodeAliasDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_NodeAliasDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_NodeAliasDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_NodeAliasDecodeErrorZ ret_hu_conv = Result_NodeAliasDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_NodeAliasDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_NodeAliasDecodeErrorZ ret_hu_conv = Result_NodeAliasDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_NodeAnnouncementDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_NodeAnnouncementDecodeErrorZ.cs index c17dff49..8a16b13e 100644 --- a/c_sharp/src/org/ldk/structs/Result_NodeAnnouncementDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_NodeAnnouncementDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_NodeAnnouncementDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_NodeAnnouncementDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_NodeAnnouncementDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_NodeAnnouncementDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.cs index d9214823..3c3a2fcf 100644 --- a/c_sharp/src/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.cs @@ -22,7 +22,7 @@ public class Result_NodeAnnouncementInfoDecodeErrorZ : CommonBase { public readonly NodeAnnouncementInfo res; internal Result_NodeAnnouncementInfoDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { long res = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(ptr); - org.ldk.structs.NodeAnnouncementInfo res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.NodeAnnouncementInfo(null, res); } + org.ldk.structs.NodeAnnouncementInfo res_hu_conv = org.ldk.structs.NodeAnnouncementInfo.constr_from_ptr(res); if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; this.res = res_hu_conv; } @@ -46,7 +46,6 @@ public class Result_NodeAnnouncementInfoDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_NodeAnnouncementInfoDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_NodeAnnouncementInfoDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_NodeAnnouncementInfoDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_NodeFeaturesDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_NodeFeaturesDecodeErrorZ.cs index f7eba84f..112198c2 100644 --- a/c_sharp/src/org/ldk/structs/Result_NodeFeaturesDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_NodeFeaturesDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_NodeFeaturesDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_NodeFeaturesDecodeErrorZ ret_hu_conv = Result_NodeFeaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_NodeFeaturesDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_NodeFeaturesDecodeErrorZ ret_hu_conv = Result_NodeFeaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_NodeIdDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_NodeIdDecodeErrorZ.cs index 0d1f6e9c..af32cb7d 100644 --- a/c_sharp/src/org/ldk/structs/Result_NodeIdDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_NodeIdDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_NodeIdDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_NodeIdDecodeErrorZ ret_hu_conv = Result_NodeIdDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_NodeIdDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_NodeIdDecodeErrorZ ret_hu_conv = Result_NodeIdDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_NodeInfoDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_NodeInfoDecodeErrorZ.cs index 7474a7da..118b0b30 100644 --- a/c_sharp/src/org/ldk/structs/Result_NodeInfoDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_NodeInfoDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_NodeInfoDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_NodeInfoDecodeErrorZ ret_hu_conv = Result_NodeInfoDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_NodeInfoDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_NodeInfoDecodeErrorZ ret_hu_conv = Result_NodeInfoDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_NonceDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_NonceDecodeErrorZ.cs new file mode 100644 index 00000000..309e2239 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_NonceDecodeErrorZ.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 { + +public class Result_NonceDecodeErrorZ : CommonBase { + Result_NonceDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_NonceDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_NonceDecodeErrorZ_free(ptr); } + } + + internal static Result_NonceDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_NonceDecodeErrorZ_is_ok(ptr)) { + return new Result_NonceDecodeErrorZ_OK(null, ptr); + } else { + return new Result_NonceDecodeErrorZ_Err(null, ptr); + } + } + public class Result_NonceDecodeErrorZ_OK : Result_NonceDecodeErrorZ { + public readonly Nonce res; + internal Result_NonceDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_NonceDecodeErrorZ_get_ok(ptr); + org.ldk.structs.Nonce res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.Nonce(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_NonceDecodeErrorZ_Err : Result_NonceDecodeErrorZ { + public readonly DecodeError err; + internal Result_NonceDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_NonceDecodeErrorZ_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_NonceDecodeErrorZ in the success state. + */ + public static Result_NonceDecodeErrorZ ok(org.ldk.structs.Nonce o) { + long ret = bindings.CResult_NonceDecodeErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NonceDecodeErrorZ ret_hu_conv = Result_NonceDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_NonceDecodeErrorZ in the error state. + */ + public static Result_NonceDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_NonceDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NonceDecodeErrorZ ret_hu_conv = Result_NonceDecodeErrorZ.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_NonceDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_NonceDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_NonceDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_NonceDecodeErrorZ clone() { + long ret = bindings.CResult_NonceDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NonceDecodeErrorZ ret_hu_conv = Result_NonceDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_NoneAPIErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_NoneAPIErrorZ.cs index a89d3eb0..9ec27783 100644 --- a/c_sharp/src/org/ldk/structs/Result_NoneAPIErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_NoneAPIErrorZ.cs @@ -51,7 +51,6 @@ public class Result_NoneAPIErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_NoneLightningErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_NoneLightningErrorZ.cs index a69057fb..2d921404 100644 --- a/c_sharp/src/org/ldk/structs/Result_NoneLightningErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_NoneLightningErrorZ.cs @@ -51,7 +51,6 @@ public class Result_NoneLightningErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_NonePaymentSendFailureZ.cs b/c_sharp/src/org/ldk/structs/Result_NonePaymentSendFailureZ.cs index 91eb7602..11184a98 100644 --- a/c_sharp/src/org/ldk/structs/Result_NonePaymentSendFailureZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_NonePaymentSendFailureZ.cs @@ -51,7 +51,6 @@ public class Result_NonePaymentSendFailureZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_NonePeerHandleErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_NonePeerHandleErrorZ.cs index 41960438..3d2b3dcd 100644 --- a/c_sharp/src/org/ldk/structs/Result_NonePeerHandleErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_NonePeerHandleErrorZ.cs @@ -51,7 +51,6 @@ public class Result_NonePeerHandleErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_NonePeerHandleErrorZ ret_hu_conv = Result_NonePeerHandleErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_NoneReplayEventZ.cs b/c_sharp/src/org/ldk/structs/Result_NoneReplayEventZ.cs new file mode 100644 index 00000000..d849065d --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_NoneReplayEventZ.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 { + +public class Result_NoneReplayEventZ : CommonBase { + Result_NoneReplayEventZ(object _dummy, long ptr) : base(ptr) { } + ~Result_NoneReplayEventZ() { + if (ptr != 0) { bindings.CResult_NoneReplayEventZ_free(ptr); } + } + + internal static Result_NoneReplayEventZ constr_from_ptr(long ptr) { + if (bindings.CResult_NoneReplayEventZ_is_ok(ptr)) { + return new Result_NoneReplayEventZ_OK(null, ptr); + } else { + return new Result_NoneReplayEventZ_Err(null, ptr); + } + } + public class Result_NoneReplayEventZ_OK : Result_NoneReplayEventZ { + internal Result_NoneReplayEventZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + } + } + + public class Result_NoneReplayEventZ_Err : Result_NoneReplayEventZ { + public readonly ReplayEvent err; + internal Result_NoneReplayEventZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_NoneReplayEventZ_get_err(ptr); + org.ldk.structs.ReplayEvent err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.ReplayEvent(null, err); } + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_NoneReplayEventZ in the success state. + */ + public static Result_NoneReplayEventZ ok() { + long ret = bindings.CResult_NoneReplayEventZ_ok(); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneReplayEventZ ret_hu_conv = Result_NoneReplayEventZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_NoneReplayEventZ in the error state. + */ + public static Result_NoneReplayEventZ err(org.ldk.structs.ReplayEvent e) { + long ret = bindings.CResult_NoneReplayEventZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneReplayEventZ ret_hu_conv = Result_NoneReplayEventZ.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_NoneReplayEventZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_NoneReplayEventZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_NoneReplayEventZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_NoneReplayEventZ clone() { + long ret = bindings.CResult_NoneReplayEventZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneReplayEventZ ret_hu_conv = Result_NoneReplayEventZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_NoneSendErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_NoneSendErrorZ.cs new file mode 100644 index 00000000..e0e09e74 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_NoneSendErrorZ.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 { + +public class Result_NoneSendErrorZ : CommonBase { + Result_NoneSendErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_NoneSendErrorZ() { + if (ptr != 0) { bindings.CResult_NoneSendErrorZ_free(ptr); } + } + + internal static Result_NoneSendErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_NoneSendErrorZ_is_ok(ptr)) { + return new Result_NoneSendErrorZ_OK(null, ptr); + } else { + return new Result_NoneSendErrorZ_Err(null, ptr); + } + } + public class Result_NoneSendErrorZ_OK : Result_NoneSendErrorZ { + internal Result_NoneSendErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + } + } + + public class Result_NoneSendErrorZ_Err : Result_NoneSendErrorZ { + public readonly SendError err; + internal Result_NoneSendErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_NoneSendErrorZ_get_err(ptr); + org.ldk.structs.SendError err_hu_conv = org.ldk.structs.SendError.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_NoneSendErrorZ in the success state. + */ + public static Result_NoneSendErrorZ ok() { + long ret = bindings.CResult_NoneSendErrorZ_ok(); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneSendErrorZ ret_hu_conv = Result_NoneSendErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_NoneSendErrorZ in the error state. + */ + public static Result_NoneSendErrorZ err(org.ldk.structs.SendError e) { + long ret = bindings.CResult_NoneSendErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneSendErrorZ ret_hu_conv = Result_NoneSendErrorZ.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_NoneSendErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_NoneSendErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_NoneSendErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_NoneSendErrorZ clone() { + long ret = bindings.CResult_NoneSendErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneSendErrorZ ret_hu_conv = Result_NoneSendErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_OfferBolt12ParseErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_OfferBolt12ParseErrorZ.cs index 9a90137a..09f3cb22 100644 --- a/c_sharp/src/org/ldk/structs/Result_OfferBolt12ParseErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_OfferBolt12ParseErrorZ.cs @@ -46,7 +46,6 @@ public class Result_OfferBolt12ParseErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_OfferBolt12ParseErrorZ ret_hu_conv = Result_OfferBolt12ParseErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_OfferBolt12ParseErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_OfferBolt12ParseErrorZ ret_hu_conv = Result_OfferBolt12ParseErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_OfferBolt12SemanticErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_OfferBolt12SemanticErrorZ.cs index a0cd0655..b90fdf36 100644 --- a/c_sharp/src/org/ldk/structs/Result_OfferBolt12SemanticErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_OfferBolt12SemanticErrorZ.cs @@ -43,7 +43,6 @@ public class Result_OfferBolt12SemanticErrorZ : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/Result_OfferDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_OfferDecodeErrorZ.cs new file mode 100644 index 00000000..70e5b6a5 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_OfferDecodeErrorZ.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 { + +public class Result_OfferDecodeErrorZ : CommonBase { + Result_OfferDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_OfferDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_OfferDecodeErrorZ_free(ptr); } + } + + internal static Result_OfferDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_OfferDecodeErrorZ_is_ok(ptr)) { + return new Result_OfferDecodeErrorZ_OK(null, ptr); + } else { + return new Result_OfferDecodeErrorZ_Err(null, ptr); + } + } + public class Result_OfferDecodeErrorZ_OK : Result_OfferDecodeErrorZ { + public readonly Offer res; + internal Result_OfferDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_OfferDecodeErrorZ_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_OfferDecodeErrorZ_Err : Result_OfferDecodeErrorZ { + public readonly DecodeError err; + internal Result_OfferDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_OfferDecodeErrorZ_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_OfferDecodeErrorZ in the success state. + */ + public static Result_OfferDecodeErrorZ ok(org.ldk.structs.Offer o) { + long ret = bindings.CResult_OfferDecodeErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OfferDecodeErrorZ ret_hu_conv = Result_OfferDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_OfferDecodeErrorZ in the error state. + */ + public static Result_OfferDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_OfferDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OfferDecodeErrorZ ret_hu_conv = Result_OfferDecodeErrorZ.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_OfferDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_OfferDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_OfferDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_OfferDecodeErrorZ clone() { + long ret = bindings.CResult_OfferDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OfferDecodeErrorZ ret_hu_conv = Result_OfferDecodeErrorZ.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 index 75dccc42..fcba1157 100644 --- a/c_sharp/src/org/ldk/structs/Result_OfferIdDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_OfferIdDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_OfferIdDecodeErrorZ : CommonBase { 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; } @@ -58,7 +57,6 @@ public class Result_OfferIdDecodeErrorZ : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ.cs index a653b236..5d82574e 100644 --- a/c_sharp/src/org/ldk/structs/Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ.cs @@ -43,7 +43,6 @@ public class Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ : Common 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; } diff --git a/c_sharp/src/org/ldk/structs/Result_OffersContextDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_OffersContextDecodeErrorZ.cs new file mode 100644 index 00000000..dc33586b --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_OffersContextDecodeErrorZ.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 { + +public class Result_OffersContextDecodeErrorZ : CommonBase { + Result_OffersContextDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_OffersContextDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_OffersContextDecodeErrorZ_free(ptr); } + } + + internal static Result_OffersContextDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_OffersContextDecodeErrorZ_is_ok(ptr)) { + return new Result_OffersContextDecodeErrorZ_OK(null, ptr); + } else { + return new Result_OffersContextDecodeErrorZ_Err(null, ptr); + } + } + public class Result_OffersContextDecodeErrorZ_OK : Result_OffersContextDecodeErrorZ { + public readonly OffersContext res; + internal Result_OffersContextDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_OffersContextDecodeErrorZ_get_ok(ptr); + org.ldk.structs.OffersContext res_hu_conv = org.ldk.structs.OffersContext.constr_from_ptr(res); + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_OffersContextDecodeErrorZ_Err : Result_OffersContextDecodeErrorZ { + public readonly DecodeError err; + internal Result_OffersContextDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_OffersContextDecodeErrorZ_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_OffersContextDecodeErrorZ in the success state. + */ + public static Result_OffersContextDecodeErrorZ ok(org.ldk.structs.OffersContext o) { + long ret = bindings.CResult_OffersContextDecodeErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OffersContextDecodeErrorZ ret_hu_conv = Result_OffersContextDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_OffersContextDecodeErrorZ in the error state. + */ + public static Result_OffersContextDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_OffersContextDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OffersContextDecodeErrorZ ret_hu_conv = Result_OffersContextDecodeErrorZ.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_OffersContextDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_OffersContextDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_OffersContextDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_OffersContextDecodeErrorZ clone() { + long ret = bindings.CResult_OffersContextDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OffersContextDecodeErrorZ ret_hu_conv = Result_OffersContextDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_OffersMessageDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_OffersMessageDecodeErrorZ.cs index fc13b343..7a3a48dd 100644 --- a/c_sharp/src/org/ldk/structs/Result_OffersMessageDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_OffersMessageDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_OffersMessageDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_OffersMessageDecodeErrorZ ret_hu_conv = Result_OffersMessageDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_OffersMessageDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_OffersMessageDecodeErrorZ ret_hu_conv = Result_OffersMessageDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; 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 680124ef..5cbea5b1 100644 --- a/c_sharp/src/org/ldk/structs/Result_OnionMessageDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_OnionMessageDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_OnionMessageDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_OnionMessageDecodeErrorZ ret_hu_conv = Result_OnionMessageDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_OnionMessageDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_OnionMessageDecodeErrorZ ret_hu_conv = Result_OnionMessageDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_OnionMessagePathNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_OnionMessagePathNoneZ.cs index 7ed0a895..30082094 100644 --- a/c_sharp/src/org/ldk/structs/Result_OnionMessagePathNoneZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_OnionMessagePathNoneZ.cs @@ -41,7 +41,6 @@ public class Result_OnionMessagePathNoneZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_OnionMessagePathNoneZ ret_hu_conv = Result_OnionMessagePathNoneZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_OnionPacketDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_OnionPacketDecodeErrorZ.cs index 99f3eaed..049dd259 100644 --- a/c_sharp/src/org/ldk/structs/Result_OnionPacketDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_OnionPacketDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_OnionPacketDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_OnionPacketDecodeErrorZ ret_hu_conv = Result_OnionPacketDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_OnionPacketDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_OnionPacketDecodeErrorZ ret_hu_conv = Result_OnionPacketDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_OpenChannelDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_OpenChannelDecodeErrorZ.cs index a3b6e9c0..feb09055 100644 --- a/c_sharp/src/org/ldk/structs/Result_OpenChannelDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_OpenChannelDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_OpenChannelDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_OpenChannelDecodeErrorZ ret_hu_conv = Result_OpenChannelDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_OpenChannelDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_OpenChannelDecodeErrorZ ret_hu_conv = Result_OpenChannelDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_OpenChannelV2DecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_OpenChannelV2DecodeErrorZ.cs index f6814da3..db4ee336 100644 --- a/c_sharp/src/org/ldk/structs/Result_OpenChannelV2DecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_OpenChannelV2DecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_OpenChannelV2DecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_OpenChannelV2DecodeErrorZ ret_hu_conv = Result_OpenChannelV2DecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_OpenChannelV2DecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_OpenChannelV2DecodeErrorZ ret_hu_conv = Result_OpenChannelV2DecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_OutPointDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_OutPointDecodeErrorZ.cs index ae29f7e0..85bbab2f 100644 --- a/c_sharp/src/org/ldk/structs/Result_OutPointDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_OutPointDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_OutPointDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_OutPointDecodeErrorZ ret_hu_conv = Result_OutPointDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_OutPointDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_OutPointDecodeErrorZ ret_hu_conv = Result_OutPointDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_OutboundHTLCDetailsDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_OutboundHTLCDetailsDecodeErrorZ.cs index 8a084cd1..5b5eb34d 100644 --- a/c_sharp/src/org/ldk/structs/Result_OutboundHTLCDetailsDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_OutboundHTLCDetailsDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_OutboundHTLCDetailsDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_OutboundHTLCDetailsDecodeErrorZ ret_hu_conv = Result_OutboundHTLCDetailsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_OutboundHTLCDetailsDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_OutboundHTLCDetailsDecodeErrorZ ret_hu_conv = Result_OutboundHTLCDetailsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_OutputSpendStatusDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_OutputSpendStatusDecodeErrorZ.cs index ca8bcb05..ac3e88f8 100644 --- a/c_sharp/src/org/ldk/structs/Result_OutputSpendStatusDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_OutputSpendStatusDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_OutputSpendStatusDecodeErrorZ : CommonBase { 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; } @@ -58,7 +57,6 @@ public class Result_OutputSpendStatusDecodeErrorZ : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/Result_OutputSweeperDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_OutputSweeperDecodeErrorZ.cs index bc1dcc90..ae08ede4 100644 --- a/c_sharp/src/org/ldk/structs/Result_OutputSweeperDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_OutputSweeperDecodeErrorZ.cs @@ -53,7 +53,7 @@ public class Result_OutputSweeperDecodeErrorZ : CommonBase { 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); }; @@ -72,7 +72,6 @@ public class Result_OutputSweeperDecodeErrorZ : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/Result_PayeePubKeySecp256k1ErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_PayeePubKeySecp256k1ErrorZ.cs index 6cdfdd88..26189dda 100644 --- a/c_sharp/src/org/ldk/structs/Result_PayeePubKeySecp256k1ErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_PayeePubKeySecp256k1ErrorZ.cs @@ -43,7 +43,6 @@ public class Result_PayeePubKeySecp256k1ErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PayeePubKeySecp256k1ErrorZ ret_hu_conv = Result_PayeePubKeySecp256k1ErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_PaymentConstraintsDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_PaymentConstraintsDecodeErrorZ.cs index 2b95c9c5..983b8d58 100644 --- a/c_sharp/src/org/ldk/structs/Result_PaymentConstraintsDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_PaymentConstraintsDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_PaymentConstraintsDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentConstraintsDecodeErrorZ ret_hu_conv = Result_PaymentConstraintsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_PaymentConstraintsDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentConstraintsDecodeErrorZ ret_hu_conv = Result_PaymentConstraintsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_PaymentContextDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_PaymentContextDecodeErrorZ.cs index 6742f4a3..ae812f41 100644 --- a/c_sharp/src/org/ldk/structs/Result_PaymentContextDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_PaymentContextDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_PaymentContextDecodeErrorZ : CommonBase { 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; } @@ -58,7 +57,6 @@ public class Result_PaymentContextDecodeErrorZ : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/Result_PaymentFailureReasonDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_PaymentFailureReasonDecodeErrorZ.cs deleted file mode 100644 index 433c819d..00000000 --- a/c_sharp/src/org/ldk/structs/Result_PaymentFailureReasonDecodeErrorZ.cs +++ /dev/null @@ -1,89 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - -public class Result_PaymentFailureReasonDecodeErrorZ : CommonBase { - Result_PaymentFailureReasonDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } - ~Result_PaymentFailureReasonDecodeErrorZ() { - if (ptr != 0) { bindings.CResult_PaymentFailureReasonDecodeErrorZ_free(ptr); } - } - - internal static Result_PaymentFailureReasonDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.CResult_PaymentFailureReasonDecodeErrorZ_is_ok(ptr)) { - return new Result_PaymentFailureReasonDecodeErrorZ_OK(null, ptr); - } else { - return new Result_PaymentFailureReasonDecodeErrorZ_Err(null, ptr); - } - } - public class Result_PaymentFailureReasonDecodeErrorZ_OK : Result_PaymentFailureReasonDecodeErrorZ { - public readonly PaymentFailureReason res; - internal Result_PaymentFailureReasonDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { - this.res = bindings.CResult_PaymentFailureReasonDecodeErrorZ_get_ok(ptr); - } - } - - public class Result_PaymentFailureReasonDecodeErrorZ_Err : Result_PaymentFailureReasonDecodeErrorZ { - public readonly DecodeError err; - internal Result_PaymentFailureReasonDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { - long err = bindings.CResult_PaymentFailureReasonDecodeErrorZ_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_PaymentFailureReasonDecodeErrorZ in the success state. - */ - public static Result_PaymentFailureReasonDecodeErrorZ ok(PaymentFailureReason o) { - long ret = bindings.CResult_PaymentFailureReasonDecodeErrorZ_ok(o); - GC.KeepAlive(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_PaymentFailureReasonDecodeErrorZ ret_hu_conv = Result_PaymentFailureReasonDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Creates a new CResult_PaymentFailureReasonDecodeErrorZ in the error state. - */ - public static Result_PaymentFailureReasonDecodeErrorZ err(org.ldk.structs.DecodeError e) { - long ret = bindings.CResult_PaymentFailureReasonDecodeErrorZ_err(e.ptr); - GC.KeepAlive(e); - if (ret >= 0 && ret <= 4096) { return null; } - Result_PaymentFailureReasonDecodeErrorZ ret_hu_conv = Result_PaymentFailureReasonDecodeErrorZ.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_PaymentFailureReasonDecodeErrorZ_is_ok(this.ptr); - GC.KeepAlive(this); - return ret; - } - - internal long clone_ptr() { - long ret = bindings.CResult_PaymentFailureReasonDecodeErrorZ_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a new CResult_PaymentFailureReasonDecodeErrorZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_PaymentFailureReasonDecodeErrorZ clone() { - long ret = bindings.CResult_PaymentFailureReasonDecodeErrorZ_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_PaymentFailureReasonDecodeErrorZ ret_hu_conv = Result_PaymentFailureReasonDecodeErrorZ.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 1464897d..6c1fe339 100644 --- a/c_sharp/src/org/ldk/structs/Result_PaymentParametersDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_PaymentParametersDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_PaymentParametersDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentParametersDecodeErrorZ ret_hu_conv = Result_PaymentParametersDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_PaymentParametersDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentParametersDecodeErrorZ ret_hu_conv = Result_PaymentParametersDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_PaymentPurposeDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_PaymentPurposeDecodeErrorZ.cs index f4ab8b26..3c6d0198 100644 --- a/c_sharp/src/org/ldk/structs/Result_PaymentPurposeDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_PaymentPurposeDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_PaymentPurposeDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentPurposeDecodeErrorZ ret_hu_conv = Result_PaymentPurposeDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_PaymentPurposeDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentPurposeDecodeErrorZ ret_hu_conv = Result_PaymentPurposeDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_PaymentRelayDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_PaymentRelayDecodeErrorZ.cs index 01e945f8..fbc9e7bb 100644 --- a/c_sharp/src/org/ldk/structs/Result_PaymentRelayDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_PaymentRelayDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_PaymentRelayDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentRelayDecodeErrorZ ret_hu_conv = Result_PaymentRelayDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_PaymentRelayDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentRelayDecodeErrorZ ret_hu_conv = Result_PaymentRelayDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; 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 64592855..477c68aa 100644 --- a/c_sharp/src/org/ldk/structs/Result_PendingHTLCInfoDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_PendingHTLCInfoDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_PendingHTLCInfoDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PendingHTLCInfoDecodeErrorZ ret_hu_conv = Result_PendingHTLCInfoDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_PendingHTLCInfoDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_PendingHTLCInfoDecodeErrorZ ret_hu_conv = Result_PendingHTLCInfoDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_PendingHTLCInfoInboundHTLCErrZ.cs b/c_sharp/src/org/ldk/structs/Result_PendingHTLCInfoInboundHTLCErrZ.cs index aaf1b9b9..690fef62 100644 --- a/c_sharp/src/org/ldk/structs/Result_PendingHTLCInfoInboundHTLCErrZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_PendingHTLCInfoInboundHTLCErrZ.cs @@ -46,7 +46,6 @@ public class Result_PendingHTLCInfoInboundHTLCErrZ : CommonBase { GC.KeepAlive(o); 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(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_PendingHTLCInfoInboundHTLCErrZ : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/Result_PendingHTLCRoutingDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_PendingHTLCRoutingDecodeErrorZ.cs index e4527a21..6d30fa96 100644 --- a/c_sharp/src/org/ldk/structs/Result_PendingHTLCRoutingDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_PendingHTLCRoutingDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_PendingHTLCRoutingDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PendingHTLCRoutingDecodeErrorZ ret_hu_conv = Result_PendingHTLCRoutingDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_PendingHTLCRoutingDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_PendingHTLCRoutingDecodeErrorZ ret_hu_conv = Result_PendingHTLCRoutingDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; 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 6878b86f..65d6f0cb 100644 --- a/c_sharp/src/org/ldk/structs/Result_PhantomRouteHintsDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_PhantomRouteHintsDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_PhantomRouteHintsDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PhantomRouteHintsDecodeErrorZ ret_hu_conv = Result_PhantomRouteHintsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_PhantomRouteHintsDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_PhantomRouteHintsDecodeErrorZ ret_hu_conv = Result_PhantomRouteHintsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_PingDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_PingDecodeErrorZ.cs index e0e355b3..54f6fa81 100644 --- a/c_sharp/src/org/ldk/structs/Result_PingDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_PingDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_PingDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PingDecodeErrorZ ret_hu_conv = Result_PingDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_PingDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_PingDecodeErrorZ ret_hu_conv = Result_PingDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_PongDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_PongDecodeErrorZ.cs index 1211fe68..c9a0aaff 100644 --- a/c_sharp/src/org/ldk/structs/Result_PongDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_PongDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_PongDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PongDecodeErrorZ ret_hu_conv = Result_PongDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_PongDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_PongDecodeErrorZ ret_hu_conv = Result_PongDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_PositiveTimestampCreationErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_PositiveTimestampCreationErrorZ.cs index cf59f087..fb4d151a 100644 --- a/c_sharp/src/org/ldk/structs/Result_PositiveTimestampCreationErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_PositiveTimestampCreationErrorZ.cs @@ -43,7 +43,6 @@ public class Result_PositiveTimestampCreationErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PositiveTimestampCreationErrorZ ret_hu_conv = Result_PositiveTimestampCreationErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_PrivateRouteCreationErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_PrivateRouteCreationErrorZ.cs index ba1b46a1..beb5d9c1 100644 --- a/c_sharp/src/org/ldk/structs/Result_PrivateRouteCreationErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_PrivateRouteCreationErrorZ.cs @@ -43,7 +43,6 @@ public class Result_PrivateRouteCreationErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PrivateRouteCreationErrorZ ret_hu_conv = Result_PrivateRouteCreationErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ProbabilisticScorerDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ProbabilisticScorerDecodeErrorZ.cs index f887d547..e5800f56 100644 --- a/c_sharp/src/org/ldk/structs/Result_ProbabilisticScorerDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ProbabilisticScorerDecodeErrorZ.cs @@ -48,7 +48,7 @@ public class Result_ProbabilisticScorerDecodeErrorZ : CommonBase { GC.KeepAlive(o_logger); if (ret >= 0 && ret <= 4096) { return null; } Result_ProbabilisticScorerDecodeErrorZ ret_hu_conv = Result_ProbabilisticScorerDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o_decay_params); }; + ; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o_network_graph); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o_logger); }; return ret_hu_conv; @@ -62,7 +62,6 @@ public class Result_ProbabilisticScorerDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ProbabilisticScorerDecodeErrorZ ret_hu_conv = Result_ProbabilisticScorerDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.cs index 15726858..8f9ea2d5 100644 --- a/c_sharp/src/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_QueryChannelRangeDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_QueryChannelRangeDecodeErrorZ ret_hu_conv = Result_QueryChannelRangeDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_QueryChannelRangeDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_QueryChannelRangeDecodeErrorZ ret_hu_conv = Result_QueryChannelRangeDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.cs index d6979806..121845c9 100644 --- a/c_sharp/src/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_QueryShortChannelIdsDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_QueryShortChannelIdsDecodeErrorZ ret_hu_conv = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_QueryShortChannelIdsDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_QueryShortChannelIdsDecodeErrorZ ret_hu_conv = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_RecipientOnionFieldsDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RecipientOnionFieldsDecodeErrorZ.cs index a29aed19..9b180f91 100644 --- a/c_sharp/src/org/ldk/structs/Result_RecipientOnionFieldsDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_RecipientOnionFieldsDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_RecipientOnionFieldsDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RecipientOnionFieldsDecodeErrorZ ret_hu_conv = Result_RecipientOnionFieldsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_RecipientOnionFieldsDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_RecipientOnionFieldsDecodeErrorZ ret_hu_conv = Result_RecipientOnionFieldsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_RecipientOnionFieldsNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_RecipientOnionFieldsNoneZ.cs index 87b0d9e2..0939c42a 100644 --- a/c_sharp/src/org/ldk/structs/Result_RecipientOnionFieldsNoneZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_RecipientOnionFieldsNoneZ.cs @@ -41,7 +41,6 @@ public class Result_RecipientOnionFieldsNoneZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RecipientOnionFieldsNoneZ ret_hu_conv = Result_RecipientOnionFieldsNoneZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_RefundBolt12ParseErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RefundBolt12ParseErrorZ.cs index 320ee92a..1fb30f5f 100644 --- a/c_sharp/src/org/ldk/structs/Result_RefundBolt12ParseErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_RefundBolt12ParseErrorZ.cs @@ -46,7 +46,6 @@ public class Result_RefundBolt12ParseErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RefundBolt12ParseErrorZ ret_hu_conv = Result_RefundBolt12ParseErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_RefundBolt12ParseErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_RefundBolt12ParseErrorZ ret_hu_conv = Result_RefundBolt12ParseErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_RefundBolt12SemanticErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RefundBolt12SemanticErrorZ.cs index d926ad2d..c9706739 100644 --- a/c_sharp/src/org/ldk/structs/Result_RefundBolt12SemanticErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_RefundBolt12SemanticErrorZ.cs @@ -43,7 +43,6 @@ public class Result_RefundBolt12SemanticErrorZ : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/Result_RefundDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RefundDecodeErrorZ.cs new file mode 100644 index 00000000..8cb4249a --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_RefundDecodeErrorZ.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 { + +public class Result_RefundDecodeErrorZ : CommonBase { + Result_RefundDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_RefundDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_RefundDecodeErrorZ_free(ptr); } + } + + internal static Result_RefundDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_RefundDecodeErrorZ_is_ok(ptr)) { + return new Result_RefundDecodeErrorZ_OK(null, ptr); + } else { + return new Result_RefundDecodeErrorZ_Err(null, ptr); + } + } + public class Result_RefundDecodeErrorZ_OK : Result_RefundDecodeErrorZ { + public readonly Refund res; + internal Result_RefundDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_RefundDecodeErrorZ_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_RefundDecodeErrorZ_Err : Result_RefundDecodeErrorZ { + public readonly DecodeError err; + internal Result_RefundDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_RefundDecodeErrorZ_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_RefundDecodeErrorZ in the success state. + */ + public static Result_RefundDecodeErrorZ ok(org.ldk.structs.Refund o) { + long ret = bindings.CResult_RefundDecodeErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_RefundDecodeErrorZ ret_hu_conv = Result_RefundDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_RefundDecodeErrorZ in the error state. + */ + public static Result_RefundDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_RefundDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_RefundDecodeErrorZ ret_hu_conv = Result_RefundDecodeErrorZ.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_RefundDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_RefundDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_RefundDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_RefundDecodeErrorZ clone() { + long ret = bindings.CResult_RefundDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_RefundDecodeErrorZ ret_hu_conv = Result_RefundDecodeErrorZ.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 index 820bf5bf..f3e23d88 100644 --- a/c_sharp/src/org/ldk/structs/Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ.cs @@ -43,7 +43,6 @@ public class Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ : 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; } diff --git a/c_sharp/src/org/ldk/structs/Result_ReleaseHeldHtlcDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ReleaseHeldHtlcDecodeErrorZ.cs new file mode 100644 index 00000000..1dc830d0 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_ReleaseHeldHtlcDecodeErrorZ.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 { + +public class Result_ReleaseHeldHtlcDecodeErrorZ : CommonBase { + Result_ReleaseHeldHtlcDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_ReleaseHeldHtlcDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_ReleaseHeldHtlcDecodeErrorZ_free(ptr); } + } + + internal static Result_ReleaseHeldHtlcDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_ReleaseHeldHtlcDecodeErrorZ_is_ok(ptr)) { + return new Result_ReleaseHeldHtlcDecodeErrorZ_OK(null, ptr); + } else { + return new Result_ReleaseHeldHtlcDecodeErrorZ_Err(null, ptr); + } + } + public class Result_ReleaseHeldHtlcDecodeErrorZ_OK : Result_ReleaseHeldHtlcDecodeErrorZ { + public readonly ReleaseHeldHtlc res; + internal Result_ReleaseHeldHtlcDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_ReleaseHeldHtlcDecodeErrorZ_get_ok(ptr); + org.ldk.structs.ReleaseHeldHtlc res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.ReleaseHeldHtlc(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_ReleaseHeldHtlcDecodeErrorZ_Err : Result_ReleaseHeldHtlcDecodeErrorZ { + public readonly DecodeError err; + internal Result_ReleaseHeldHtlcDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_ReleaseHeldHtlcDecodeErrorZ_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_ReleaseHeldHtlcDecodeErrorZ in the success state. + */ + public static Result_ReleaseHeldHtlcDecodeErrorZ ok(org.ldk.structs.ReleaseHeldHtlc o) { + long ret = bindings.CResult_ReleaseHeldHtlcDecodeErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ReleaseHeldHtlcDecodeErrorZ ret_hu_conv = Result_ReleaseHeldHtlcDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_ReleaseHeldHtlcDecodeErrorZ in the error state. + */ + public static Result_ReleaseHeldHtlcDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_ReleaseHeldHtlcDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ReleaseHeldHtlcDecodeErrorZ ret_hu_conv = Result_ReleaseHeldHtlcDecodeErrorZ.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_ReleaseHeldHtlcDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_ReleaseHeldHtlcDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_ReleaseHeldHtlcDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_ReleaseHeldHtlcDecodeErrorZ clone() { + long ret = bindings.CResult_ReleaseHeldHtlcDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ReleaseHeldHtlcDecodeErrorZ ret_hu_conv = Result_ReleaseHeldHtlcDecodeErrorZ.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 513b5e4e..33b2171b 100644 --- a/c_sharp/src/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_ReplyChannelRangeDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ReplyChannelRangeDecodeErrorZ ret_hu_conv = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_ReplyChannelRangeDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ReplyChannelRangeDecodeErrorZ ret_hu_conv = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.cs index 59802c4c..b1c2d23e 100644 --- a/c_sharp/src/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_ReplyShortChannelIdsEndDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ReplyShortChannelIdsEndDecodeErrorZ ret_hu_conv = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_ReplyShortChannelIdsEndDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ReplyShortChannelIdsEndDecodeErrorZ ret_hu_conv = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ResponderDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ResponderDecodeErrorZ.cs new file mode 100644 index 00000000..65d8f081 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_ResponderDecodeErrorZ.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 { + +public class Result_ResponderDecodeErrorZ : CommonBase { + Result_ResponderDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_ResponderDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_ResponderDecodeErrorZ_free(ptr); } + } + + internal static Result_ResponderDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_ResponderDecodeErrorZ_is_ok(ptr)) { + return new Result_ResponderDecodeErrorZ_OK(null, ptr); + } else { + return new Result_ResponderDecodeErrorZ_Err(null, ptr); + } + } + public class Result_ResponderDecodeErrorZ_OK : Result_ResponderDecodeErrorZ { + public readonly Responder res; + internal Result_ResponderDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_ResponderDecodeErrorZ_get_ok(ptr); + org.ldk.structs.Responder res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.Responder(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_ResponderDecodeErrorZ_Err : Result_ResponderDecodeErrorZ { + public readonly DecodeError err; + internal Result_ResponderDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_ResponderDecodeErrorZ_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_ResponderDecodeErrorZ in the success state. + */ + public static Result_ResponderDecodeErrorZ ok(org.ldk.structs.Responder o) { + long ret = bindings.CResult_ResponderDecodeErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ResponderDecodeErrorZ ret_hu_conv = Result_ResponderDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_ResponderDecodeErrorZ in the error state. + */ + public static Result_ResponderDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_ResponderDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ResponderDecodeErrorZ ret_hu_conv = Result_ResponderDecodeErrorZ.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_ResponderDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_ResponderDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_ResponderDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_ResponderDecodeErrorZ clone() { + long ret = bindings.CResult_ResponderDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ResponderDecodeErrorZ ret_hu_conv = Result_ResponderDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_RetryDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RetryDecodeErrorZ.cs index db35a4d0..27e7daf0 100644 --- a/c_sharp/src/org/ldk/structs/Result_RetryDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_RetryDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_RetryDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RetryDecodeErrorZ ret_hu_conv = Result_RetryDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_RetryDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_RetryDecodeErrorZ ret_hu_conv = Result_RetryDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_RevocationBasepointDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RevocationBasepointDecodeErrorZ.cs index ec111f90..7d788382 100644 --- a/c_sharp/src/org/ldk/structs/Result_RevocationBasepointDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_RevocationBasepointDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_RevocationBasepointDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RevocationBasepointDecodeErrorZ ret_hu_conv = Result_RevocationBasepointDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_RevocationBasepointDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_RevocationBasepointDecodeErrorZ ret_hu_conv = Result_RevocationBasepointDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_RevocationKeyDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RevocationKeyDecodeErrorZ.cs index 8b672e6a..fc556c91 100644 --- a/c_sharp/src/org/ldk/structs/Result_RevocationKeyDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_RevocationKeyDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_RevocationKeyDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RevocationKeyDecodeErrorZ ret_hu_conv = Result_RevocationKeyDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_RevocationKeyDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_RevocationKeyDecodeErrorZ ret_hu_conv = Result_RevocationKeyDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_RevokeAndACKDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RevokeAndACKDecodeErrorZ.cs index 9fb090dd..47f8dd25 100644 --- a/c_sharp/src/org/ldk/structs/Result_RevokeAndACKDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_RevokeAndACKDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_RevokeAndACKDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RevokeAndACKDecodeErrorZ ret_hu_conv = Result_RevokeAndACKDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_RevokeAndACKDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_RevokeAndACKDecodeErrorZ ret_hu_conv = Result_RevokeAndACKDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_RouteDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RouteDecodeErrorZ.cs index 548a404c..a4361434 100644 --- a/c_sharp/src/org/ldk/structs/Result_RouteDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_RouteDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_RouteDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteDecodeErrorZ ret_hu_conv = Result_RouteDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_RouteDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteDecodeErrorZ ret_hu_conv = Result_RouteDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_RouteHintDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RouteHintDecodeErrorZ.cs index aa7ab448..e8def913 100644 --- a/c_sharp/src/org/ldk/structs/Result_RouteHintDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_RouteHintDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_RouteHintDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteHintDecodeErrorZ ret_hu_conv = Result_RouteHintDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_RouteHintDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteHintDecodeErrorZ ret_hu_conv = Result_RouteHintDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_RouteHintHopDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RouteHintHopDecodeErrorZ.cs index 1dfe84a7..c4a9a17b 100644 --- a/c_sharp/src/org/ldk/structs/Result_RouteHintHopDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_RouteHintHopDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_RouteHintHopDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteHintHopDecodeErrorZ ret_hu_conv = Result_RouteHintHopDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_RouteHintHopDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteHintHopDecodeErrorZ ret_hu_conv = Result_RouteHintHopDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_RouteHopDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RouteHopDecodeErrorZ.cs index 5dc79887..a92aacfc 100644 --- a/c_sharp/src/org/ldk/structs/Result_RouteHopDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_RouteHopDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_RouteHopDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteHopDecodeErrorZ ret_hu_conv = Result_RouteHopDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_RouteHopDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteHopDecodeErrorZ ret_hu_conv = Result_RouteHopDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_RouteLightningErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RouteLightningErrorZ.cs index 52d35517..b661bddb 100644 --- a/c_sharp/src/org/ldk/structs/Result_RouteLightningErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_RouteLightningErrorZ.cs @@ -46,7 +46,6 @@ public class Result_RouteLightningErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_RouteLightningErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_RouteParametersDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RouteParametersDecodeErrorZ.cs index 77380130..09103182 100644 --- a/c_sharp/src/org/ldk/structs/Result_RouteParametersDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_RouteParametersDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_RouteParametersDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteParametersDecodeErrorZ ret_hu_conv = Result_RouteParametersDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_RouteParametersDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteParametersDecodeErrorZ ret_hu_conv = Result_RouteParametersDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.cs index 21d1577a..a7a123f7 100644 --- a/c_sharp/src/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_RoutingFeesDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RoutingFeesDecodeErrorZ ret_hu_conv = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_RoutingFeesDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_RoutingFeesDecodeErrorZ ret_hu_conv = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_SendSuccessSendErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_SendSuccessSendErrorZ.cs index b23c46ac..9faa8371 100644 --- a/c_sharp/src/org/ldk/structs/Result_SendSuccessSendErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_SendSuccessSendErrorZ.cs @@ -46,7 +46,6 @@ public class Result_SendSuccessSendErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_SendSuccessSendErrorZ ret_hu_conv = Result_SendSuccessSendErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_SendSuccessSendErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_SendSuccessSendErrorZ ret_hu_conv = Result_SendSuccessSendErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; 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 c7112702..2bbe1585 100644 --- a/c_sharp/src/org/ldk/structs/Result_ShutdownDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ShutdownDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_ShutdownDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ShutdownDecodeErrorZ ret_hu_conv = Result_ShutdownDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_ShutdownDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ShutdownDecodeErrorZ ret_hu_conv = Result_ShutdownDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ShutdownScriptDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ShutdownScriptDecodeErrorZ.cs index d1791c16..cecab43d 100644 --- a/c_sharp/src/org/ldk/structs/Result_ShutdownScriptDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ShutdownScriptDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_ShutdownScriptDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ShutdownScriptDecodeErrorZ ret_hu_conv = Result_ShutdownScriptDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_ShutdownScriptDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ShutdownScriptDecodeErrorZ ret_hu_conv = Result_ShutdownScriptDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ShutdownScriptInvalidShutdownScriptZ.cs b/c_sharp/src/org/ldk/structs/Result_ShutdownScriptInvalidShutdownScriptZ.cs index c6c8cdb9..4e4a1567 100644 --- a/c_sharp/src/org/ldk/structs/Result_ShutdownScriptInvalidShutdownScriptZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ShutdownScriptInvalidShutdownScriptZ.cs @@ -46,7 +46,6 @@ public class Result_ShutdownScriptInvalidShutdownScriptZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ShutdownScriptInvalidShutdownScriptZ ret_hu_conv = Result_ShutdownScriptInvalidShutdownScriptZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_ShutdownScriptInvalidShutdownScriptZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ShutdownScriptInvalidShutdownScriptZ ret_hu_conv = Result_ShutdownScriptInvalidShutdownScriptZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ShutdownScriptNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_ShutdownScriptNoneZ.cs index 13e659f0..2e3b30dd 100644 --- a/c_sharp/src/org/ldk/structs/Result_ShutdownScriptNoneZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ShutdownScriptNoneZ.cs @@ -41,7 +41,6 @@ public class Result_ShutdownScriptNoneZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ShutdownScriptNoneZ ret_hu_conv = Result_ShutdownScriptNoneZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_SiPrefixBolt11ParseErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_SiPrefixBolt11ParseErrorZ.cs index 442c71b6..e4f5ab38 100644 --- a/c_sharp/src/org/ldk/structs/Result_SiPrefixBolt11ParseErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_SiPrefixBolt11ParseErrorZ.cs @@ -54,7 +54,6 @@ public class Result_SiPrefixBolt11ParseErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_SiPrefixBolt11ParseErrorZ ret_hu_conv = Result_SiPrefixBolt11ParseErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_SignedRawBolt11InvoiceBolt11ParseErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_SignedRawBolt11InvoiceBolt11ParseErrorZ.cs index 5377866e..ef2f5585 100644 --- a/c_sharp/src/org/ldk/structs/Result_SignedRawBolt11InvoiceBolt11ParseErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_SignedRawBolt11InvoiceBolt11ParseErrorZ.cs @@ -46,7 +46,6 @@ public class Result_SignedRawBolt11InvoiceBolt11ParseErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_SignedRawBolt11InvoiceBolt11ParseErrorZ ret_hu_conv = Result_SignedRawBolt11InvoiceBolt11ParseErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_SignedRawBolt11InvoiceBolt11ParseErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_SignedRawBolt11InvoiceBolt11ParseErrorZ ret_hu_conv = Result_SignedRawBolt11InvoiceBolt11ParseErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_SocketAddressDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_SocketAddressDecodeErrorZ.cs index 4752af6c..275b8c37 100644 --- a/c_sharp/src/org/ldk/structs/Result_SocketAddressDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_SocketAddressDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_SocketAddressDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_SocketAddressDecodeErrorZ ret_hu_conv = Result_SocketAddressDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_SocketAddressDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_SocketAddressDecodeErrorZ ret_hu_conv = Result_SocketAddressDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_SocketAddressSocketAddressParseErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_SocketAddressSocketAddressParseErrorZ.cs index 6972f8cd..354c3a68 100644 --- a/c_sharp/src/org/ldk/structs/Result_SocketAddressSocketAddressParseErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_SocketAddressSocketAddressParseErrorZ.cs @@ -43,7 +43,6 @@ public class Result_SocketAddressSocketAddressParseErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_SocketAddressSocketAddressParseErrorZ ret_hu_conv = Result_SocketAddressSocketAddressParseErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_SpendableOutputDescriptorDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_SpendableOutputDescriptorDecodeErrorZ.cs index a04b460c..b0bc1e8f 100644 --- a/c_sharp/src/org/ldk/structs/Result_SpendableOutputDescriptorDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_SpendableOutputDescriptorDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_SpendableOutputDescriptorDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_SpendableOutputDescriptorDecodeErrorZ ret_hu_conv = Result_SpendableOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_SpendableOutputDescriptorDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_SpendableOutputDescriptorDecodeErrorZ ret_hu_conv = Result_SpendableOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_SpliceAckDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_SpliceAckDecodeErrorZ.cs index e3da67c7..2954e110 100644 --- a/c_sharp/src/org/ldk/structs/Result_SpliceAckDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_SpliceAckDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_SpliceAckDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_SpliceAckDecodeErrorZ ret_hu_conv = Result_SpliceAckDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_SpliceAckDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_SpliceAckDecodeErrorZ ret_hu_conv = Result_SpliceAckDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_SpliceDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_SpliceDecodeErrorZ.cs deleted file mode 100644 index c7f5c790..00000000 --- a/c_sharp/src/org/ldk/structs/Result_SpliceDecodeErrorZ.cs +++ /dev/null @@ -1,93 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - -public class Result_SpliceDecodeErrorZ : CommonBase { - Result_SpliceDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } - ~Result_SpliceDecodeErrorZ() { - if (ptr != 0) { bindings.CResult_SpliceDecodeErrorZ_free(ptr); } - } - - internal static Result_SpliceDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.CResult_SpliceDecodeErrorZ_is_ok(ptr)) { - return new Result_SpliceDecodeErrorZ_OK(null, ptr); - } else { - return new Result_SpliceDecodeErrorZ_Err(null, ptr); - } - } - public class Result_SpliceDecodeErrorZ_OK : Result_SpliceDecodeErrorZ { - public readonly Splice res; - internal Result_SpliceDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { - long res = bindings.CResult_SpliceDecodeErrorZ_get_ok(ptr); - org.ldk.structs.Splice res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.Splice(null, res); } - if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; - this.res = res_hu_conv; - } - } - - public class Result_SpliceDecodeErrorZ_Err : Result_SpliceDecodeErrorZ { - public readonly DecodeError err; - internal Result_SpliceDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { - long err = bindings.CResult_SpliceDecodeErrorZ_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_SpliceDecodeErrorZ in the success state. - */ - public static Result_SpliceDecodeErrorZ ok(org.ldk.structs.Splice o) { - 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); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; - return ret_hu_conv; - } - - /** - * Creates a new CResult_SpliceDecodeErrorZ in the error state. - */ - public static Result_SpliceDecodeErrorZ err(org.ldk.structs.DecodeError e) { - long ret = bindings.CResult_SpliceDecodeErrorZ_err(e.ptr); - GC.KeepAlive(e); - if (ret >= 0 && ret <= 4096) { return null; } - Result_SpliceDecodeErrorZ ret_hu_conv = Result_SpliceDecodeErrorZ.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_SpliceDecodeErrorZ_is_ok(this.ptr); - GC.KeepAlive(this); - return ret; - } - - internal long clone_ptr() { - long ret = bindings.CResult_SpliceDecodeErrorZ_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a new CResult_SpliceDecodeErrorZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_SpliceDecodeErrorZ clone() { - long ret = bindings.CResult_SpliceDecodeErrorZ_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_SpliceDecodeErrorZ ret_hu_conv = Result_SpliceDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/Result_SpliceInitDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_SpliceInitDecodeErrorZ.cs new file mode 100644 index 00000000..c89021f5 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_SpliceInitDecodeErrorZ.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 { + +public class Result_SpliceInitDecodeErrorZ : CommonBase { + Result_SpliceInitDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_SpliceInitDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_SpliceInitDecodeErrorZ_free(ptr); } + } + + internal static Result_SpliceInitDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_SpliceInitDecodeErrorZ_is_ok(ptr)) { + return new Result_SpliceInitDecodeErrorZ_OK(null, ptr); + } else { + return new Result_SpliceInitDecodeErrorZ_Err(null, ptr); + } + } + public class Result_SpliceInitDecodeErrorZ_OK : Result_SpliceInitDecodeErrorZ { + public readonly SpliceInit res; + internal Result_SpliceInitDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_SpliceInitDecodeErrorZ_get_ok(ptr); + org.ldk.structs.SpliceInit res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.SpliceInit(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_SpliceInitDecodeErrorZ_Err : Result_SpliceInitDecodeErrorZ { + public readonly DecodeError err; + internal Result_SpliceInitDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_SpliceInitDecodeErrorZ_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_SpliceInitDecodeErrorZ in the success state. + */ + public static Result_SpliceInitDecodeErrorZ ok(org.ldk.structs.SpliceInit o) { + long ret = bindings.CResult_SpliceInitDecodeErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_SpliceInitDecodeErrorZ ret_hu_conv = Result_SpliceInitDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_SpliceInitDecodeErrorZ in the error state. + */ + public static Result_SpliceInitDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_SpliceInitDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_SpliceInitDecodeErrorZ ret_hu_conv = Result_SpliceInitDecodeErrorZ.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_SpliceInitDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_SpliceInitDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_SpliceInitDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_SpliceInitDecodeErrorZ clone() { + long ret = bindings.CResult_SpliceInitDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_SpliceInitDecodeErrorZ ret_hu_conv = Result_SpliceInitDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_SpliceLockedDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_SpliceLockedDecodeErrorZ.cs index 0aa08456..65dba3c0 100644 --- a/c_sharp/src/org/ldk/structs/Result_SpliceLockedDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_SpliceLockedDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_SpliceLockedDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_SpliceLockedDecodeErrorZ ret_hu_conv = Result_SpliceLockedDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_SpliceLockedDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_SpliceLockedDecodeErrorZ ret_hu_conv = Result_SpliceLockedDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.cs index dd98f277..877f7a0a 100644 --- a/c_sharp/src/org/ldk/structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_StaticPaymentOutputDescriptorDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_StaticPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_StaticPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_StaticPaymentOutputDescriptorDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_StaticPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_StaticPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_StfuDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_StfuDecodeErrorZ.cs index be1dd770..1877b3c1 100644 --- a/c_sharp/src/org/ldk/structs/Result_StfuDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_StfuDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_StfuDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_StfuDecodeErrorZ ret_hu_conv = Result_StfuDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_StfuDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_StfuDecodeErrorZ ret_hu_conv = Result_StfuDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_StrSecp256k1ErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_StrSecp256k1ErrorZ.cs deleted file mode 100644 index 421ccb31..00000000 --- a/c_sharp/src/org/ldk/structs/Result_StrSecp256k1ErrorZ.cs +++ /dev/null @@ -1,87 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - -public class Result_StrSecp256k1ErrorZ : CommonBase { - Result_StrSecp256k1ErrorZ(object _dummy, long ptr) : base(ptr) { } - ~Result_StrSecp256k1ErrorZ() { - if (ptr != 0) { bindings.CResult_StrSecp256k1ErrorZ_free(ptr); } - } - - internal static Result_StrSecp256k1ErrorZ constr_from_ptr(long ptr) { - if (bindings.CResult_StrSecp256k1ErrorZ_is_ok(ptr)) { - return new Result_StrSecp256k1ErrorZ_OK(null, ptr); - } else { - return new Result_StrSecp256k1ErrorZ_Err(null, ptr); - } - } - public class Result_StrSecp256k1ErrorZ_OK : Result_StrSecp256k1ErrorZ { - public readonly string res; - internal Result_StrSecp256k1ErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { - long res = bindings.CResult_StrSecp256k1ErrorZ_get_ok(ptr); - string res_conv = InternalUtils.decodeString(res); - this.res = res_conv; - } - } - - public class Result_StrSecp256k1ErrorZ_Err : Result_StrSecp256k1ErrorZ { - public readonly Secp256k1Error err; - internal Result_StrSecp256k1ErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { - this.err = bindings.CResult_StrSecp256k1ErrorZ_get_err(ptr); - } - } - - /** - * Creates a new CResult_StrSecp256k1ErrorZ in the success state. - */ - public static Result_StrSecp256k1ErrorZ ok(string o) { - long ret = bindings.CResult_StrSecp256k1ErrorZ_ok(InternalUtils.encodeString(o)); - GC.KeepAlive(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_StrSecp256k1ErrorZ ret_hu_conv = Result_StrSecp256k1ErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Creates a new CResult_StrSecp256k1ErrorZ in the error state. - */ - public static Result_StrSecp256k1ErrorZ err(Secp256k1Error e) { - long ret = bindings.CResult_StrSecp256k1ErrorZ_err(e); - GC.KeepAlive(e); - if (ret >= 0 && ret <= 4096) { return null; } - Result_StrSecp256k1ErrorZ ret_hu_conv = Result_StrSecp256k1ErrorZ.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_StrSecp256k1ErrorZ_is_ok(this.ptr); - GC.KeepAlive(this); - return ret; - } - - internal long clone_ptr() { - long ret = bindings.CResult_StrSecp256k1ErrorZ_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a new CResult_StrSecp256k1ErrorZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_StrSecp256k1ErrorZ clone() { - long ret = bindings.CResult_StrSecp256k1ErrorZ_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_StrSecp256k1ErrorZ ret_hu_conv = Result_StrSecp256k1ErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/Result_ThirtyTwoBytesAPIErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ThirtyTwoBytesAPIErrorZ.cs index 44bfed18..2675950c 100644 --- a/c_sharp/src/org/ldk/structs/Result_ThirtyTwoBytesAPIErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ThirtyTwoBytesAPIErrorZ.cs @@ -56,7 +56,6 @@ public class Result_ThirtyTwoBytesAPIErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ThirtyTwoBytesAPIErrorZ ret_hu_conv = Result_ThirtyTwoBytesAPIErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ThirtyTwoBytesPaymentSendFailureZ.cs b/c_sharp/src/org/ldk/structs/Result_ThirtyTwoBytesPaymentSendFailureZ.cs index f3869ba1..64a67ef5 100644 --- a/c_sharp/src/org/ldk/structs/Result_ThirtyTwoBytesPaymentSendFailureZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ThirtyTwoBytesPaymentSendFailureZ.cs @@ -56,7 +56,6 @@ public class Result_ThirtyTwoBytesPaymentSendFailureZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ThirtyTwoBytesPaymentSendFailureZ ret_hu_conv = Result_ThirtyTwoBytesPaymentSendFailureZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_TrackedSpendableOutputDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_TrackedSpendableOutputDecodeErrorZ.cs index 3afd7ee1..0292ad29 100644 --- a/c_sharp/src/org/ldk/structs/Result_TrackedSpendableOutputDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_TrackedSpendableOutputDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_TrackedSpendableOutputDecodeErrorZ : CommonBase { 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; } @@ -58,7 +57,6 @@ public class Result_TrackedSpendableOutputDecodeErrorZ : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/Result_TransactionU16LenLimitedDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_TransactionU16LenLimitedDecodeErrorZ.cs index 7508f500..2169fb25 100644 --- a/c_sharp/src/org/ldk/structs/Result_TransactionU16LenLimitedDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_TransactionU16LenLimitedDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_TransactionU16LenLimitedDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TransactionU16LenLimitedDecodeErrorZ ret_hu_conv = Result_TransactionU16LenLimitedDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_TransactionU16LenLimitedDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_TransactionU16LenLimitedDecodeErrorZ ret_hu_conv = Result_TransactionU16LenLimitedDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_TransactionU16LenLimitedNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_TransactionU16LenLimitedNoneZ.cs index 5b5442ec..a3d493cf 100644 --- a/c_sharp/src/org/ldk/structs/Result_TransactionU16LenLimitedNoneZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_TransactionU16LenLimitedNoneZ.cs @@ -41,7 +41,6 @@ public class Result_TransactionU16LenLimitedNoneZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TransactionU16LenLimitedNoneZ ret_hu_conv = Result_TransactionU16LenLimitedNoneZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_TxAbortDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_TxAbortDecodeErrorZ.cs index 2c25b573..9cd26713 100644 --- a/c_sharp/src/org/ldk/structs/Result_TxAbortDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_TxAbortDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_TxAbortDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TxAbortDecodeErrorZ ret_hu_conv = Result_TxAbortDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_TxAbortDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_TxAbortDecodeErrorZ ret_hu_conv = Result_TxAbortDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_TxAckRbfDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_TxAckRbfDecodeErrorZ.cs index 19ff18c3..cc921659 100644 --- a/c_sharp/src/org/ldk/structs/Result_TxAckRbfDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_TxAckRbfDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_TxAckRbfDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TxAckRbfDecodeErrorZ ret_hu_conv = Result_TxAckRbfDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_TxAckRbfDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_TxAckRbfDecodeErrorZ ret_hu_conv = Result_TxAckRbfDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_TxAddInputDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_TxAddInputDecodeErrorZ.cs index ad5ead8f..18d6f31b 100644 --- a/c_sharp/src/org/ldk/structs/Result_TxAddInputDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_TxAddInputDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_TxAddInputDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TxAddInputDecodeErrorZ ret_hu_conv = Result_TxAddInputDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_TxAddInputDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_TxAddInputDecodeErrorZ ret_hu_conv = Result_TxAddInputDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_TxAddOutputDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_TxAddOutputDecodeErrorZ.cs index 0d2d4143..7ff87091 100644 --- a/c_sharp/src/org/ldk/structs/Result_TxAddOutputDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_TxAddOutputDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_TxAddOutputDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TxAddOutputDecodeErrorZ ret_hu_conv = Result_TxAddOutputDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_TxAddOutputDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_TxAddOutputDecodeErrorZ ret_hu_conv = Result_TxAddOutputDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_TxCompleteDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_TxCompleteDecodeErrorZ.cs index 9d2e5d6d..534d35a7 100644 --- a/c_sharp/src/org/ldk/structs/Result_TxCompleteDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_TxCompleteDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_TxCompleteDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TxCompleteDecodeErrorZ ret_hu_conv = Result_TxCompleteDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_TxCompleteDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_TxCompleteDecodeErrorZ ret_hu_conv = Result_TxCompleteDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_TxCreationKeysDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_TxCreationKeysDecodeErrorZ.cs index 66017604..98339610 100644 --- a/c_sharp/src/org/ldk/structs/Result_TxCreationKeysDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_TxCreationKeysDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_TxCreationKeysDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TxCreationKeysDecodeErrorZ ret_hu_conv = Result_TxCreationKeysDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_TxCreationKeysDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_TxCreationKeysDecodeErrorZ ret_hu_conv = Result_TxCreationKeysDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_TxInitRbfDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_TxInitRbfDecodeErrorZ.cs index 33e38697..1b91bc93 100644 --- a/c_sharp/src/org/ldk/structs/Result_TxInitRbfDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_TxInitRbfDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_TxInitRbfDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TxInitRbfDecodeErrorZ ret_hu_conv = Result_TxInitRbfDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_TxInitRbfDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_TxInitRbfDecodeErrorZ ret_hu_conv = Result_TxInitRbfDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_TxRemoveInputDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_TxRemoveInputDecodeErrorZ.cs index 3d0b4ee8..daf6543c 100644 --- a/c_sharp/src/org/ldk/structs/Result_TxRemoveInputDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_TxRemoveInputDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_TxRemoveInputDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TxRemoveInputDecodeErrorZ ret_hu_conv = Result_TxRemoveInputDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_TxRemoveInputDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_TxRemoveInputDecodeErrorZ ret_hu_conv = Result_TxRemoveInputDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_TxRemoveOutputDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_TxRemoveOutputDecodeErrorZ.cs index f005783e..992a3b30 100644 --- a/c_sharp/src/org/ldk/structs/Result_TxRemoveOutputDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_TxRemoveOutputDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_TxRemoveOutputDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TxRemoveOutputDecodeErrorZ ret_hu_conv = Result_TxRemoveOutputDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_TxRemoveOutputDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_TxRemoveOutputDecodeErrorZ ret_hu_conv = Result_TxRemoveOutputDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_TxSignaturesDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_TxSignaturesDecodeErrorZ.cs index db18f188..4fc22ed6 100644 --- a/c_sharp/src/org/ldk/structs/Result_TxSignaturesDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_TxSignaturesDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_TxSignaturesDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TxSignaturesDecodeErrorZ ret_hu_conv = Result_TxSignaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_TxSignaturesDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_TxSignaturesDecodeErrorZ ret_hu_conv = Result_TxSignaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_UnknownPaymentContextDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_UnknownPaymentContextDecodeErrorZ.cs index 805857dd..d98d08d5 100644 --- a/c_sharp/src/org/ldk/structs/Result_UnknownPaymentContextDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_UnknownPaymentContextDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_UnknownPaymentContextDecodeErrorZ : CommonBase { 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; } @@ -58,7 +57,6 @@ public class Result_UnknownPaymentContextDecodeErrorZ : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ.cs index a51ee9eb..11e7757f 100644 --- a/c_sharp/src/org/ldk/structs/Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ.cs @@ -43,7 +43,6 @@ public class Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.cs index 8ee0b210..dca0fc26 100644 --- a/c_sharp/src/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_UnsignedChannelAnnouncementDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_UnsignedChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_UnsignedChannelAnnouncementDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_UnsignedChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.cs index 048c120d..60064cc5 100644 --- a/c_sharp/src/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_UnsignedChannelUpdateDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_UnsignedChannelUpdateDecodeErrorZ ret_hu_conv = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_UnsignedChannelUpdateDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_UnsignedChannelUpdateDecodeErrorZ ret_hu_conv = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_UnsignedInvoiceRequestBolt12SemanticErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_UnsignedInvoiceRequestBolt12SemanticErrorZ.cs index 7a19769d..58f20047 100644 --- a/c_sharp/src/org/ldk/structs/Result_UnsignedInvoiceRequestBolt12SemanticErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_UnsignedInvoiceRequestBolt12SemanticErrorZ.cs @@ -43,7 +43,6 @@ public class Result_UnsignedInvoiceRequestBolt12SemanticErrorZ : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.cs index a1aa0e53..b7c6394a 100644 --- a/c_sharp/src/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_UnsignedNodeAnnouncementDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_UnsignedNodeAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedNodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_UnsignedNodeAnnouncementDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_UnsignedNodeAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedNodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_UntrustedStringDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_UntrustedStringDecodeErrorZ.cs index 5efe4543..d0d45e34 100644 --- a/c_sharp/src/org/ldk/structs/Result_UntrustedStringDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_UntrustedStringDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_UntrustedStringDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_UntrustedStringDecodeErrorZ ret_hu_conv = Result_UntrustedStringDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_UntrustedStringDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_UntrustedStringDecodeErrorZ ret_hu_conv = Result_UntrustedStringDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_UpdateAddHTLCDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_UpdateAddHTLCDecodeErrorZ.cs index c1dbef0f..a58de8b0 100644 --- a/c_sharp/src/org/ldk/structs/Result_UpdateAddHTLCDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_UpdateAddHTLCDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_UpdateAddHTLCDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_UpdateAddHTLCDecodeErrorZ ret_hu_conv = Result_UpdateAddHTLCDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_UpdateAddHTLCDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_UpdateAddHTLCDecodeErrorZ ret_hu_conv = Result_UpdateAddHTLCDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_UpdateFailHTLCDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_UpdateFailHTLCDecodeErrorZ.cs index ec4bd624..5825a2df 100644 --- a/c_sharp/src/org/ldk/structs/Result_UpdateFailHTLCDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_UpdateFailHTLCDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_UpdateFailHTLCDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_UpdateFailHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailHTLCDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_UpdateFailHTLCDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_UpdateFailHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailHTLCDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.cs index 4bc43bb3..2f8f43dd 100644 --- a/c_sharp/src/org/ldk/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_UpdateFailMalformedHTLCDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_UpdateFailMalformedHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailMalformedHTLCDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_UpdateFailMalformedHTLCDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_UpdateFailMalformedHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailMalformedHTLCDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_UpdateFeeDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_UpdateFeeDecodeErrorZ.cs index 5345c4d8..2cb5a2ae 100644 --- a/c_sharp/src/org/ldk/structs/Result_UpdateFeeDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_UpdateFeeDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_UpdateFeeDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_UpdateFeeDecodeErrorZ ret_hu_conv = Result_UpdateFeeDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_UpdateFeeDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_UpdateFeeDecodeErrorZ ret_hu_conv = Result_UpdateFeeDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.cs index 52c70d5e..c7a40a72 100644 --- a/c_sharp/src/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_UpdateFulfillHTLCDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_UpdateFulfillHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFulfillHTLCDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_UpdateFulfillHTLCDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_UpdateFulfillHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFulfillHTLCDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_VerifiedInvoiceRequestNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_VerifiedInvoiceRequestNoneZ.cs index 5604a78c..e55b81c3 100644 --- a/c_sharp/src/org/ldk/structs/Result_VerifiedInvoiceRequestNoneZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_VerifiedInvoiceRequestNoneZ.cs @@ -41,7 +41,6 @@ public class Result_VerifiedInvoiceRequestNoneZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_VerifiedInvoiceRequestNoneZ ret_hu_conv = Result_VerifiedInvoiceRequestNoneZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_WarningMessageDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_WarningMessageDecodeErrorZ.cs index 30e4e181..077c9456 100644 --- a/c_sharp/src/org/ldk/structs/Result_WarningMessageDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_WarningMessageDecodeErrorZ.cs @@ -46,7 +46,6 @@ public class Result_WarningMessageDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_WarningMessageDecodeErrorZ ret_hu_conv = Result_WarningMessageDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -58,7 +57,6 @@ public class Result_WarningMessageDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_WarningMessageDecodeErrorZ ret_hu_conv = Result_WarningMessageDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_WriteableEcdsaChannelSignerDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_WriteableEcdsaChannelSignerDecodeErrorZ.cs deleted file mode 100644 index 6c4cb5ca..00000000 --- a/c_sharp/src/org/ldk/structs/Result_WriteableEcdsaChannelSignerDecodeErrorZ.cs +++ /dev/null @@ -1,93 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - -public class Result_WriteableEcdsaChannelSignerDecodeErrorZ : CommonBase { - Result_WriteableEcdsaChannelSignerDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } - ~Result_WriteableEcdsaChannelSignerDecodeErrorZ() { - if (ptr != 0) { bindings.CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free(ptr); } - } - - internal static Result_WriteableEcdsaChannelSignerDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok(ptr)) { - return new Result_WriteableEcdsaChannelSignerDecodeErrorZ_OK(null, ptr); - } else { - return new Result_WriteableEcdsaChannelSignerDecodeErrorZ_Err(null, ptr); - } - } - public class Result_WriteableEcdsaChannelSignerDecodeErrorZ_OK : Result_WriteableEcdsaChannelSignerDecodeErrorZ { - public readonly WriteableEcdsaChannelSigner res; - internal Result_WriteableEcdsaChannelSignerDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { - long res = bindings.CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_ok(ptr); - WriteableEcdsaChannelSigner ret_hu_conv = new WriteableEcdsaChannelSigner(null, res); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - this.res = ret_hu_conv; - } - } - - public class Result_WriteableEcdsaChannelSignerDecodeErrorZ_Err : Result_WriteableEcdsaChannelSignerDecodeErrorZ { - public readonly DecodeError err; - internal Result_WriteableEcdsaChannelSignerDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { - long err = bindings.CResult_WriteableEcdsaChannelSignerDecodeErrorZ_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_WriteableEcdsaChannelSignerDecodeErrorZ in the success state. - */ - public static Result_WriteableEcdsaChannelSignerDecodeErrorZ ok(org.ldk.structs.WriteableEcdsaChannelSigner o) { - long ret = bindings.CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(o.ptr); - GC.KeepAlive(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_WriteableEcdsaChannelSignerDecodeErrorZ ret_hu_conv = Result_WriteableEcdsaChannelSignerDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; - return ret_hu_conv; - } - - /** - * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the error state. - */ - public static Result_WriteableEcdsaChannelSignerDecodeErrorZ err(org.ldk.structs.DecodeError e) { - long ret = bindings.CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err(e.ptr); - GC.KeepAlive(e); - if (ret >= 0 && ret <= 4096) { return null; } - Result_WriteableEcdsaChannelSignerDecodeErrorZ ret_hu_conv = Result_WriteableEcdsaChannelSignerDecodeErrorZ.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_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok(this.ptr); - GC.KeepAlive(this); - return ret; - } - - internal long clone_ptr() { - long ret = bindings.CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_WriteableEcdsaChannelSignerDecodeErrorZ clone() { - long ret = bindings.CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_WriteableEcdsaChannelSignerDecodeErrorZ ret_hu_conv = Result_WriteableEcdsaChannelSignerDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/Result__u832NoneZ.cs b/c_sharp/src/org/ldk/structs/Result__u832NoneZ.cs new file mode 100644 index 00000000..a1279c5c --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result__u832NoneZ.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 { + +public class Result__u832NoneZ : CommonBase { + Result__u832NoneZ(object _dummy, long ptr) : base(ptr) { } + ~Result__u832NoneZ() { + if (ptr != 0) { bindings.CResult__u832NoneZ_free(ptr); } + } + + internal static Result__u832NoneZ constr_from_ptr(long ptr) { + if (bindings.CResult__u832NoneZ_is_ok(ptr)) { + return new Result__u832NoneZ_OK(null, ptr); + } else { + return new Result__u832NoneZ_Err(null, ptr); + } + } + public class Result__u832NoneZ_OK : Result__u832NoneZ { + public readonly byte[] res; + internal Result__u832NoneZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult__u832NoneZ_get_ok(ptr); + byte[] res_conv = InternalUtils.decodeUint8Array(res); + this.res = res_conv; + } + } + + public class Result__u832NoneZ_Err : Result__u832NoneZ { + internal Result__u832NoneZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + } + } + + /** + * Creates a new CResult__u832NoneZ in the success state. + */ + public static Result__u832NoneZ ok(byte[] o) { + long ret = bindings.CResult__u832NoneZ_ok(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(o, 32))); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result__u832NoneZ ret_hu_conv = Result__u832NoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult__u832NoneZ in the error state. + */ + public static Result__u832NoneZ err() { + long ret = bindings.CResult__u832NoneZ_err(); + if (ret >= 0 && ret <= 4096) { return null; } + Result__u832NoneZ ret_hu_conv = Result__u832NoneZ.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__u832NoneZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult__u832NoneZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult__u832NoneZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result__u832NoneZ clone() { + long ret = bindings.CResult__u832NoneZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result__u832NoneZ ret_hu_conv = Result__u832NoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_boolLightningErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_boolLightningErrorZ.cs index 8ecbc7f8..f9c4e961 100644 --- a/c_sharp/src/org/ldk/structs/Result_boolLightningErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_boolLightningErrorZ.cs @@ -54,7 +54,6 @@ public class Result_boolLightningErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_boolPeerHandleErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_boolPeerHandleErrorZ.cs index 951b16fd..85f2df48 100644 --- a/c_sharp/src/org/ldk/structs/Result_boolPeerHandleErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_boolPeerHandleErrorZ.cs @@ -54,7 +54,6 @@ public class Result_boolPeerHandleErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_boolPeerHandleErrorZ ret_hu_conv = Result_boolPeerHandleErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_u32GraphSyncErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_u32GraphSyncErrorZ.cs index 30e15ca2..38ea424b 100644 --- a/c_sharp/src/org/ldk/structs/Result_u32GraphSyncErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_u32GraphSyncErrorZ.cs @@ -54,7 +54,6 @@ public class Result_u32GraphSyncErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_u32GraphSyncErrorZ ret_hu_conv = Result_u32GraphSyncErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/RevocationKey.cs b/c_sharp/src/org/ldk/structs/RevocationKey.cs index f57166a7..abe0c095 100644 --- a/c_sharp/src/org/ldk/structs/RevocationKey.cs +++ b/c_sharp/src/org/ldk/structs/RevocationKey.cs @@ -14,7 +14,7 @@ namespace org { namespace ldk { namespace structs { * per_commitment_point which is used in both commitment and HTLC transactions. * * See [the BOLT spec for derivation details] - * (https://github.com/lightning/bolts/blob/master/03-transactions.md#revocationpubkey-derivation) + * */ public class RevocationKey : CommonBase { internal RevocationKey(object _dummy, long ptr) : base(ptr) { } diff --git a/c_sharp/src/org/ldk/structs/RevokeAndACK.cs b/c_sharp/src/org/ldk/structs/RevokeAndACK.cs index e4ea40c7..0c1a3c22 100644 --- a/c_sharp/src/org/ldk/structs/RevokeAndACK.cs +++ b/c_sharp/src/org/ldk/structs/RevokeAndACK.cs @@ -36,7 +36,6 @@ public class RevokeAndACK : CommonBase { bindings.RevokeAndACK_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -90,7 +89,6 @@ public class RevokeAndACK : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/Route.cs b/c_sharp/src/org/ldk/structs/Route.cs index d5a7f296..c5f455a5 100644 --- a/c_sharp/src/org/ldk/structs/Route.cs +++ b/c_sharp/src/org/ldk/structs/Route.cs @@ -46,7 +46,6 @@ public class Route : CommonBase { 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); }; }; } /** @@ -80,7 +79,6 @@ public class Route : CommonBase { bindings.Route_set_route_params(this.ptr, val == null ? 0 : val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -95,8 +93,6 @@ public class Route : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Route ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Route(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - foreach (Path paths_arg_conv_6 in paths_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(paths_arg_conv_6); }; }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(route_params_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/RouteHint.cs b/c_sharp/src/org/ldk/structs/RouteHint.cs index 04597b7d..dc727f1e 100644 --- a/c_sharp/src/org/ldk/structs/RouteHint.cs +++ b/c_sharp/src/org/ldk/structs/RouteHint.cs @@ -15,6 +15,28 @@ public class RouteHint : CommonBase { if (ptr != 0) { bindings.RouteHint_free(ptr); } } + /** + * Serialize the RouteHint object into a byte array which can be read by RouteHint_read + */ + public byte[] write() { + long ret = bindings.RouteHint_write(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Read a RouteHint from a byte array, created by RouteHint_write + */ + public static Result_RouteHintDecodeErrorZ read(byte[] ser) { + long ret = bindings.RouteHint_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_RouteHintDecodeErrorZ ret_hu_conv = Result_RouteHintDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + public RouteHintHop[] get_a() { long ret = bindings.RouteHint_get_a(this.ptr); GC.KeepAlive(this); @@ -35,7 +57,6 @@ public class RouteHint : CommonBase { 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); }; }; } /** @@ -47,7 +68,6 @@ public class RouteHint : CommonBase { 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); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - foreach (RouteHintHop a_arg_conv_14 in a_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(a_arg_conv_14); }; }; return ret_hu_conv; } @@ -98,27 +118,5 @@ public class RouteHint : CommonBase { if (!(o is RouteHint)) return false; return this.eq((RouteHint)o); } - /** - * Serialize the RouteHint object into a byte array which can be read by RouteHint_read - */ - public byte[] write() { - long ret = bindings.RouteHint_write(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * Read a RouteHint from a byte array, created by RouteHint_write - */ - public static Result_RouteHintDecodeErrorZ read(byte[] ser) { - long ret = bindings.RouteHint_read(InternalUtils.encodeUint8Array(ser)); - GC.KeepAlive(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_RouteHintDecodeErrorZ ret_hu_conv = Result_RouteHintDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - } } } } diff --git a/c_sharp/src/org/ldk/structs/RouteHintHop.cs b/c_sharp/src/org/ldk/structs/RouteHintHop.cs index 54d00a4c..c5a5e303 100644 --- a/c_sharp/src/org/ldk/structs/RouteHintHop.cs +++ b/c_sharp/src/org/ldk/structs/RouteHintHop.cs @@ -19,6 +19,28 @@ public class RouteHintHop : CommonBase { if (ptr != 0) { bindings.RouteHintHop_free(ptr); } } + /** + * Serialize the RouteHintHop object into a byte array which can be read by RouteHintHop_read + */ + public byte[] write() { + long ret = bindings.RouteHintHop_write(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Read a RouteHintHop from a byte array, created by RouteHintHop_write + */ + public static Result_RouteHintHopDecodeErrorZ read(byte[] ser) { + long ret = bindings.RouteHintHop_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_RouteHintHopDecodeErrorZ ret_hu_conv = Result_RouteHintHopDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + /** * The node_id of the non-target end of the route */ @@ -76,7 +98,6 @@ public class RouteHintHop : CommonBase { bindings.RouteHintHop_set_fees(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -116,7 +137,6 @@ public class RouteHintHop : CommonBase { bindings.RouteHintHop_set_htlc_minimum_msat(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -138,7 +158,6 @@ public class RouteHintHop : CommonBase { bindings.RouteHintHop_set_htlc_maximum_msat(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -155,9 +174,6 @@ public class RouteHintHop : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.RouteHintHop ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RouteHintHop(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(fees_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(htlc_minimum_msat_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(htlc_maximum_msat_arg); }; return ret_hu_conv; } @@ -208,27 +224,5 @@ public class RouteHintHop : CommonBase { if (!(o is RouteHintHop)) return false; return this.eq((RouteHintHop)o); } - /** - * Serialize the RouteHintHop object into a byte array which can be read by RouteHintHop_read - */ - public byte[] write() { - long ret = bindings.RouteHintHop_write(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * Read a RouteHintHop from a byte array, created by RouteHintHop_write - */ - public static Result_RouteHintHopDecodeErrorZ read(byte[] ser) { - long ret = bindings.RouteHintHop_read(InternalUtils.encodeUint8Array(ser)); - GC.KeepAlive(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_RouteHintHopDecodeErrorZ ret_hu_conv = Result_RouteHintHopDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - } } } } diff --git a/c_sharp/src/org/ldk/structs/RouteHop.cs b/c_sharp/src/org/ldk/structs/RouteHop.cs index e26de5bb..4ecae165 100644 --- a/c_sharp/src/org/ldk/structs/RouteHop.cs +++ b/c_sharp/src/org/ldk/structs/RouteHop.cs @@ -57,7 +57,6 @@ public class RouteHop : CommonBase { bindings.RouteHop_set_node_features(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -99,16 +98,14 @@ public class RouteHop : CommonBase { bindings.RouteHop_set_channel_features(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** * The fee taken on this hop (for paying for the use of the *next* channel in the path). * If this is the last hop in [`Path::hops`]: - * if we're sending to a [`BlindedPath`], this is the fee paid for use of the entire blinded path + * if we're sending to a [`BlindedPaymentPath`], this is the fee paid for use of the entire + * blinded path * otherwise, this is the full value of this [`Path`]'s part of the payment - * - * [`BlindedPath`]: crate::blinded_path::BlindedPath */ public long get_fee_msat() { long ret = bindings.RouteHop_get_fee_msat(this.ptr); @@ -119,10 +116,9 @@ public class RouteHop : CommonBase { /** * The fee taken on this hop (for paying for the use of the *next* channel in the path). * If this is the last hop in [`Path::hops`]: - * if we're sending to a [`BlindedPath`], this is the fee paid for use of the entire blinded path + * if we're sending to a [`BlindedPaymentPath`], this is the fee paid for use of the entire + * blinded path * otherwise, this is the full value of this [`Path`]'s part of the payment - * - * [`BlindedPath`]: crate::blinded_path::BlindedPath */ public void set_fee_msat(long val) { bindings.RouteHop_set_fee_msat(this.ptr, val); @@ -133,10 +129,9 @@ public class RouteHop : CommonBase { /** * The CLTV delta added for this hop. * If this is the last hop in [`Path::hops`]: - * if we're sending to a [`BlindedPath`], this is the CLTV delta for the entire blinded path + * if we're sending to a [`BlindedPaymentPath`], this is the CLTV delta for the entire blinded + * path * otherwise, this is the CLTV delta expected at the destination - * - * [`BlindedPath`]: crate::blinded_path::BlindedPath */ public int get_cltv_expiry_delta() { int ret = bindings.RouteHop_get_cltv_expiry_delta(this.ptr); @@ -147,10 +142,9 @@ public class RouteHop : CommonBase { /** * The CLTV delta added for this hop. * If this is the last hop in [`Path::hops`]: - * if we're sending to a [`BlindedPath`], this is the CLTV delta for the entire blinded path + * if we're sending to a [`BlindedPaymentPath`], this is the CLTV delta for the entire blinded + * path * otherwise, this is the CLTV delta expected at the destination - * - * [`BlindedPath`]: crate::blinded_path::BlindedPath */ public void set_cltv_expiry_delta(int val) { bindings.RouteHop_set_cltv_expiry_delta(this.ptr, val); @@ -205,8 +199,6 @@ public class RouteHop : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.RouteHop ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RouteHop(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(node_features_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_features_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/RouteParameters.cs b/c_sharp/src/org/ldk/structs/RouteParameters.cs index 48fb9758..ed61d088 100644 --- a/c_sharp/src/org/ldk/structs/RouteParameters.cs +++ b/c_sharp/src/org/ldk/structs/RouteParameters.cs @@ -36,7 +36,6 @@ public class RouteParameters : CommonBase { bindings.RouteParameters_set_payment_params(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -86,7 +85,6 @@ public class RouteParameters : CommonBase { bindings.RouteParameters_set_max_total_routing_fee_msat(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -100,8 +98,6 @@ public class RouteParameters : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.RouteParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RouteParameters(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_params_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(max_total_routing_fee_msat_arg); }; return ret_hu_conv; } @@ -164,7 +160,22 @@ public class RouteParameters : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.RouteParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RouteParameters(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_params); }; + return ret_hu_conv; + } + + /** + * Sets the maximum number of hops that can be included in a payment path, based on the provided + * [`RecipientOnionFields`] and blinded paths. + */ + public Result_NoneNoneZ set_max_path_length(org.ldk.structs.RecipientOnionFields recipient_onion, bool is_keysend, int best_block_height) { + long ret = bindings.RouteParameters_set_max_path_length(this.ptr, recipient_onion.ptr, is_keysend, best_block_height); + GC.KeepAlive(this); + GC.KeepAlive(recipient_onion); + GC.KeepAlive(is_keysend); + GC.KeepAlive(best_block_height); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(recipient_onion); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Router.cs b/c_sharp/src/org/ldk/structs/Router.cs index bff09f0f..21dddeca 100644 --- a/c_sharp/src/org/ldk/structs/Router.cs +++ b/c_sharp/src/org/ldk/structs/Router.cs @@ -29,11 +29,11 @@ public interface RouterInterface { * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None */ Result_RouteLightningErrorZ find_route_with_id(byte[] payer, RouteParameters route_params, ChannelDetails[] first_hops, InFlightHtlcs inflight_htlcs, byte[] _payment_hash, byte[] _payment_id); - /**Creates [`BlindedPath`]s for payment to the `recipient` node. The channels in `first_hops` + /**Creates [`BlindedPaymentPath`]s for payment to the `recipient` node. The channels in `first_hops` * are assumed to be with the `recipient`'s peers. The payment secret and any constraints are * given in `tlvs`. */ - Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ create_blinded_payment_paths(byte[] recipient, ChannelDetails[] first_hops, ReceiveTlvs tlvs, long amount_msats); + Result_CVec_BlindedPaymentPathZNoneZ create_blinded_payment_paths(byte[] recipient, ChannelDetails[] first_hops, ReceiveTlvs tlvs, long amount_msats); } /** @@ -110,7 +110,7 @@ public class Router : CommonBase { bindings.free_buffer(_first_hops); org.ldk.structs.ReceiveTlvs _tlvs_hu_conv = null; if (_tlvs < 0 || _tlvs > 4096) { _tlvs_hu_conv = new org.ldk.structs.ReceiveTlvs(null, _tlvs); } 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); + Result_CVec_BlindedPaymentPathZNoneZ ret = arg.create_blinded_payment_paths(_recipient_conv, _first_hops_conv_16_arr, _tlvs_hu_conv, _amount_msats); GC.KeepAlive(arg); long result = ret.clone_ptr(); return result; @@ -150,7 +150,6 @@ public class Router : CommonBase { Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.AddLast(route_params); }; if (first_hops != null) { foreach (ChannelDetails first_hops_conv_16 in first_hops) { if (this != null) { this.ptrs_to.AddLast(first_hops_conv_16); }; } }; - if (this != null) { this.ptrs_to.AddLast(inflight_htlcs); }; return ret_hu_conv; } @@ -178,16 +177,15 @@ public class Router : CommonBase { Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.AddLast(route_params); }; if (first_hops != null) { foreach (ChannelDetails first_hops_conv_16 in first_hops) { if (this != null) { this.ptrs_to.AddLast(first_hops_conv_16); }; } }; - if (this != null) { this.ptrs_to.AddLast(inflight_htlcs); }; return ret_hu_conv; } /** - * Creates [`BlindedPath`]s for payment to the `recipient` node. The channels in `first_hops` + * Creates [`BlindedPaymentPath`]s for payment to the `recipient` node. The channels in `first_hops` * are assumed to be with the `recipient`'s peers. The payment secret and any constraints are * 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) { + public Result_CVec_BlindedPaymentPathZNoneZ 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.ptr)), tlvs.ptr, amount_msats); GC.KeepAlive(this); GC.KeepAlive(recipient); @@ -195,9 +193,7 @@ public class Router : CommonBase { GC.KeepAlive(tlvs); GC.KeepAlive(amount_msats); if (ret >= 0 && ret <= 4096) { return null; } - Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ ret_hu_conv = Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ.constr_from_ptr(ret); - foreach (ChannelDetails first_hops_conv_16 in first_hops) { if (this != null) { this.ptrs_to.AddLast(first_hops_conv_16); }; }; - if (this != null) { this.ptrs_to.AddLast(tlvs); }; + Result_CVec_BlindedPaymentPathZNoneZ ret_hu_conv = Result_CVec_BlindedPaymentPathZNoneZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/RoutingFees.cs b/c_sharp/src/org/ldk/structs/RoutingFees.cs index 5cf7bbc2..0ab4d547 100644 --- a/c_sharp/src/org/ldk/structs/RoutingFees.cs +++ b/c_sharp/src/org/ldk/structs/RoutingFees.cs @@ -15,6 +15,28 @@ public class RoutingFees : CommonBase { if (ptr != 0) { bindings.RoutingFees_free(ptr); } } + /** + * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read + */ + public byte[] write() { + long ret = bindings.RoutingFees_write(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Read a RoutingFees from a byte array, created by RoutingFees_write + */ + public static Result_RoutingFeesDecodeErrorZ read(byte[] ser) { + long ret = bindings.RoutingFees_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_RoutingFeesDecodeErrorZ ret_hu_conv = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + /** * Flat routing fee in millisatoshis. */ @@ -113,27 +135,5 @@ public class RoutingFees : CommonBase { public override int GetHashCode() { return (int)this.hash(); } - /** - * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read - */ - public byte[] write() { - long ret = bindings.RoutingFees_write(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * Read a RoutingFees from a byte array, created by RoutingFees_write - */ - public static Result_RoutingFeesDecodeErrorZ read(byte[] ser) { - long ret = bindings.RoutingFees_read(InternalUtils.encodeUint8Array(ser)); - GC.KeepAlive(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_RoutingFeesDecodeErrorZ ret_hu_conv = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - } } } } diff --git a/c_sharp/src/org/ldk/structs/RoutingMessageHandler.cs b/c_sharp/src/org/ldk/structs/RoutingMessageHandler.cs index 5b645f23..63659d55 100644 --- a/c_sharp/src/org/ldk/structs/RoutingMessageHandler.cs +++ b/c_sharp/src/org/ldk/structs/RoutingMessageHandler.cs @@ -132,7 +132,6 @@ public class RoutingMessageHandler : CommonBase { Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret = arg.get_next_channel_announcement(_starting_point); GC.KeepAlive(arg); long result = ret.clone_ptr(); - if (impl_holder.held != null) { impl_holder.held.ptrs_to.AddLast(ret); }; return result; } public long get_next_node_announcement(long _starting_point) { @@ -294,7 +293,6 @@ public class RoutingMessageHandler : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.NodeAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAnnouncement(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - if (this != null) { this.ptrs_to.AddLast(starting_point); }; return ret_hu_conv; } @@ -331,7 +329,6 @@ public class RoutingMessageHandler : CommonBase { GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(msg); }; return ret_hu_conv; } @@ -348,7 +345,6 @@ public class RoutingMessageHandler : CommonBase { GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(msg); }; return ret_hu_conv; } @@ -363,7 +359,6 @@ public class RoutingMessageHandler : CommonBase { GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(msg); }; return ret_hu_conv; } @@ -378,7 +373,6 @@ public class RoutingMessageHandler : CommonBase { GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(msg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/ScoreLookUp.cs b/c_sharp/src/org/ldk/structs/ScoreLookUp.cs index 7406d650..f1d72df2 100644 --- a/c_sharp/src/org/ldk/structs/ScoreLookUp.cs +++ b/c_sharp/src/org/ldk/structs/ScoreLookUp.cs @@ -82,7 +82,6 @@ public class ScoreLookUp : CommonBase { GC.KeepAlive(candidate); GC.KeepAlive(usage); GC.KeepAlive(score_params); - if (this != null) { this.ptrs_to.AddLast(usage); }; if (this != null) { this.ptrs_to.AddLast(score_params); }; return ret; } diff --git a/c_sharp/src/org/ldk/structs/Shutdown.cs b/c_sharp/src/org/ldk/structs/Shutdown.cs index f9c46f70..40fc0331 100644 --- a/c_sharp/src/org/ldk/structs/Shutdown.cs +++ b/c_sharp/src/org/ldk/structs/Shutdown.cs @@ -36,7 +36,6 @@ public class Shutdown : CommonBase { bindings.Shutdown_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -73,7 +72,6 @@ public class Shutdown : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/ShutdownScript.cs b/c_sharp/src/org/ldk/structs/ShutdownScript.cs index 8ffbf5d3..07c95eea 100644 --- a/c_sharp/src/org/ldk/structs/ShutdownScript.cs +++ b/c_sharp/src/org/ldk/structs/ShutdownScript.cs @@ -124,7 +124,7 @@ public class ShutdownScript : CommonBase { GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - if (this != null) { this.ptrs_to.AddLast(this); }; + ; return ret_conv; } diff --git a/c_sharp/src/org/ldk/structs/SignedRawBolt11Invoice.cs b/c_sharp/src/org/ldk/structs/SignedRawBolt11Invoice.cs index d0811627..f55f7d65 100644 --- a/c_sharp/src/org/ldk/structs/SignedRawBolt11Invoice.cs +++ b/c_sharp/src/org/ldk/structs/SignedRawBolt11Invoice.cs @@ -78,7 +78,7 @@ public class SignedRawBolt11Invoice : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ ret_hu_conv = new ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ(null, ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - if (this != null) { this.ptrs_to.AddLast(this); }; + ; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/SignerProvider.cs b/c_sharp/src/org/ldk/structs/SignerProvider.cs index 053f60cd..d56b2e51 100644 --- a/c_sharp/src/org/ldk/structs/SignerProvider.cs +++ b/c_sharp/src/org/ldk/structs/SignerProvider.cs @@ -25,10 +25,10 @@ public interface SignerProviderInterface { * re-derived from its `channel_keys_id`, which can be obtained through its trait method * [`ChannelSigner::channel_keys_id`]. */ - WriteableEcdsaChannelSigner derive_channel_signer(long channel_value_satoshis, byte[] channel_keys_id); + EcdsaChannelSigner derive_channel_signer(long channel_value_satoshis, byte[] channel_keys_id); /**Reads a [`Signer`] for this [`SignerProvider`] from the given input stream. * This is only called during deserialization of other objects which contain - * [`WriteableEcdsaChannelSigner`]-implementing objects (i.e., [`ChannelMonitor`]s and [`ChannelManager`]s). + * [`EcdsaChannelSigner`]-implementing objects (i.e., [`ChannelMonitor`]s and [`ChannelManager`]s). * The bytes are exactly those which `::write()` writes, and * contain no versioning scheme. You may wish to include your own version prefix and ensure * you've read all of the provided bytes to ensure no corruption occurred. @@ -40,7 +40,7 @@ public interface SignerProviderInterface { * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager */ - Result_WriteableEcdsaChannelSignerDecodeErrorZ read_chan_signer(byte[] reader); + Result_EcdsaChannelSignerDecodeErrorZ read_chan_signer(byte[] reader); /**Get a script pubkey which we send funds to when claiming on-chain contestable outputs. * * If this function returns an error, this will result in a channel failing to open. @@ -88,7 +88,7 @@ public class SignerProvider : CommonBase { } public long derive_channel_signer(long _channel_value_satoshis, long _channel_keys_id) { byte[] _channel_keys_id_conv = InternalUtils.decodeUint8Array(_channel_keys_id); - WriteableEcdsaChannelSigner ret = arg.derive_channel_signer(_channel_value_satoshis, _channel_keys_id_conv); + EcdsaChannelSigner ret = arg.derive_channel_signer(_channel_value_satoshis, _channel_keys_id_conv); GC.KeepAlive(arg); long result = ret.clone_ptr(); if (impl_holder.held != null) { impl_holder.held.ptrs_to.AddLast(ret); }; @@ -96,7 +96,7 @@ public class SignerProvider : CommonBase { } public long read_chan_signer(long _reader) { byte[] _reader_conv = InternalUtils.decodeUint8Array(_reader); - Result_WriteableEcdsaChannelSignerDecodeErrorZ ret = arg.read_chan_signer(_reader_conv); + Result_EcdsaChannelSignerDecodeErrorZ ret = arg.read_chan_signer(_reader_conv); GC.KeepAlive(arg); long result = ret.clone_ptr(); return result; @@ -155,13 +155,13 @@ public class SignerProvider : CommonBase { * re-derived from its `channel_keys_id`, which can be obtained through its trait method * [`ChannelSigner::channel_keys_id`]. */ - public WriteableEcdsaChannelSigner derive_channel_signer(long channel_value_satoshis, byte[] channel_keys_id) { + public EcdsaChannelSigner derive_channel_signer(long channel_value_satoshis, byte[] channel_keys_id) { long ret = bindings.SignerProvider_derive_channel_signer(this.ptr, channel_value_satoshis, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_keys_id, 32))); GC.KeepAlive(this); GC.KeepAlive(channel_value_satoshis); GC.KeepAlive(channel_keys_id); if (ret >= 0 && ret <= 4096) { return null; } - WriteableEcdsaChannelSigner ret_hu_conv = new WriteableEcdsaChannelSigner(null, ret); + EcdsaChannelSigner ret_hu_conv = new EcdsaChannelSigner(null, ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; return ret_hu_conv; } @@ -169,7 +169,7 @@ public class SignerProvider : CommonBase { /** * Reads a [`Signer`] for this [`SignerProvider`] from the given input stream. * This is only called during deserialization of other objects which contain - * [`WriteableEcdsaChannelSigner`]-implementing objects (i.e., [`ChannelMonitor`]s and [`ChannelManager`]s). + * [`EcdsaChannelSigner`]-implementing objects (i.e., [`ChannelMonitor`]s and [`ChannelManager`]s). * The bytes are exactly those which `::write()` writes, and * contain no versioning scheme. You may wish to include your own version prefix and ensure * you've read all of the provided bytes to ensure no corruption occurred. @@ -181,12 +181,12 @@ public class SignerProvider : CommonBase { * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager */ - public Result_WriteableEcdsaChannelSignerDecodeErrorZ read_chan_signer(byte[] reader) { + public Result_EcdsaChannelSignerDecodeErrorZ read_chan_signer(byte[] reader) { long ret = bindings.SignerProvider_read_chan_signer(this.ptr, InternalUtils.encodeUint8Array(reader)); GC.KeepAlive(this); GC.KeepAlive(reader); if (ret >= 0 && ret <= 4096) { return null; } - Result_WriteableEcdsaChannelSignerDecodeErrorZ ret_hu_conv = Result_WriteableEcdsaChannelSignerDecodeErrorZ.constr_from_ptr(ret); + Result_EcdsaChannelSignerDecodeErrorZ ret_hu_conv = Result_EcdsaChannelSignerDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Sleeper.cs b/c_sharp/src/org/ldk/structs/Sleeper.cs index d086beb1..4ed4f8aa 100644 --- a/c_sharp/src/org/ldk/structs/Sleeper.cs +++ b/c_sharp/src/org/ldk/structs/Sleeper.cs @@ -44,6 +44,23 @@ public class Sleeper : CommonBase { return ret_hu_conv; } + /** + * Constructs a new sleeper from three futures, allowing blocking on all three at once. + */ + public static Sleeper from_three_futures(org.ldk.structs.Future fut_a, org.ldk.structs.Future fut_b, org.ldk.structs.Future fut_c) { + long ret = bindings.Sleeper_from_three_futures(fut_a.ptr, fut_b.ptr, fut_c.ptr); + GC.KeepAlive(fut_a); + GC.KeepAlive(fut_b); + GC.KeepAlive(fut_c); + 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); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(fut_a); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(fut_b); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(fut_c); }; + return ret_hu_conv; + } + /** * Constructs a new sleeper on many futures, allowing blocking on all at once. */ diff --git a/c_sharp/src/org/ldk/structs/SocketAddress.cs b/c_sharp/src/org/ldk/structs/SocketAddress.cs index 88754d7d..3cb06960 100644 --- a/c_sharp/src/org/ldk/structs/SocketAddress.cs +++ b/c_sharp/src/org/ldk/structs/SocketAddress.cs @@ -196,7 +196,6 @@ public class SocketAddress : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.SocketAddress ret_hu_conv = org.ldk.structs.SocketAddress.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(hostname); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/SpendableOutputDescriptor.cs b/c_sharp/src/org/ldk/structs/SpendableOutputDescriptor.cs index b5c67001..689b2447 100644 --- a/c_sharp/src/org/ldk/structs/SpendableOutputDescriptor.cs +++ b/c_sharp/src/org/ldk/structs/SpendableOutputDescriptor.cs @@ -118,7 +118,6 @@ public class SpendableOutputDescriptor : CommonBase { 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(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(outpoint); }; return ret_hu_conv; } @@ -131,7 +130,6 @@ public class SpendableOutputDescriptor : CommonBase { 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(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(a); }; return ret_hu_conv; } @@ -144,7 +142,6 @@ public class SpendableOutputDescriptor : CommonBase { 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(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/Splice.cs b/c_sharp/src/org/ldk/structs/Splice.cs deleted file mode 100644 index 3cc1c468..00000000 --- a/c_sharp/src/org/ldk/structs/Splice.cs +++ /dev/null @@ -1,212 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - - -/** - * A splice message to be sent by or received from the stfu initiator (splice initiator). - */ -public class Splice : CommonBase { - internal Splice(object _dummy, long ptr) : base(ptr) { } - ~Splice() { - if (ptr != 0) { bindings.Splice_free(ptr); } - } - - /** - * The channel ID where splicing is intended - */ - public ChannelId get_channel_id() { - long ret = bindings.Splice_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 where splicing is intended - */ - 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); }; - } - - /** - * The genesis hash of the blockchain where the channel is intended to be spliced - */ - public byte[] get_chain_hash() { - long ret = bindings.Splice_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 intended to be spliced - */ - public void set_chain_hash(byte[] val) { - bindings.Splice_set_chain_hash(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * The intended change in channel capacity: the amount to be added (positive value) - * or removed (negative value) by the sender (splice initiator) by splicing into/from the channel. - */ - public long get_relative_satoshis() { - long ret = bindings.Splice_get_relative_satoshis(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * The intended change in channel capacity: the amount to be added (positive value) - * or removed (negative value) by the sender (splice initiator) by splicing into/from the channel. - */ - public void set_relative_satoshis(long val) { - bindings.Splice_set_relative_satoshis(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * The feerate for the new funding transaction, set by the splice initiator - */ - public int get_funding_feerate_perkw() { - int ret = bindings.Splice_get_funding_feerate_perkw(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * The feerate for the new funding transaction, set by the splice initiator - */ - public void set_funding_feerate_perkw(int val) { - bindings.Splice_set_funding_feerate_perkw(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * The locktime for the new funding transaction - */ - public int get_locktime() { - int ret = bindings.Splice_get_locktime(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * The locktime for the new funding transaction - */ - public void set_locktime(int val) { - bindings.Splice_set_locktime(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * The key of the sender (splice initiator) controlling the new funding transaction - */ - public byte[] get_funding_pubkey() { - long ret = bindings.Splice_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 key of the sender (splice initiator) controlling the new funding transaction - */ - public void set_funding_pubkey(byte[] val) { - bindings.Splice_set_funding_pubkey(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * Constructs a new Splice given each field - */ - 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); - GC.KeepAlive(funding_feerate_perkw_arg); - GC.KeepAlive(locktime_arg); - GC.KeepAlive(funding_pubkey_arg); - 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; - } - - internal long clone_ptr() { - long ret = bindings.Splice_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a copy of the Splice - */ - public Splice clone() { - long ret = bindings.Splice_clone(this.ptr); - GC.KeepAlive(this); - 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(this); }; - return ret_hu_conv; - } - - /** - * Checks if two Splices 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.Splice b) { - bool ret = bindings.Splice_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 Splice)) return false; - return this.eq((Splice)o); - } - /** - * Serialize the Splice object into a byte array which can be read by Splice_read - */ - public byte[] write() { - long ret = bindings.Splice_write(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * Read a Splice from a byte array, created by Splice_write - */ - public static Result_SpliceDecodeErrorZ read(byte[] ser) { - long ret = bindings.Splice_read(InternalUtils.encodeUint8Array(ser)); - GC.KeepAlive(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_SpliceDecodeErrorZ ret_hu_conv = Result_SpliceDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/SpliceAck.cs b/c_sharp/src/org/ldk/structs/SpliceAck.cs index 9c557d26..7748928a 100644 --- a/c_sharp/src/org/ldk/structs/SpliceAck.cs +++ b/c_sharp/src/org/ldk/structs/SpliceAck.cs @@ -7,7 +7,7 @@ namespace org { namespace ldk { namespace structs { /** - * A splice_ack message to be received by or sent to the splice initiator. + * A `splice_ack` message to be received by or sent to the splice initiator. */ public class SpliceAck : CommonBase { internal SpliceAck(object _dummy, long ptr) : base(ptr) { } @@ -34,65 +34,62 @@ public class SpliceAck : CommonBase { bindings.SpliceAck_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** - * The genesis hash of the blockchain where the channel is intended to be spliced + * The amount the splice acceptor is intending to add to its channel balance (splice-in) + * or remove from its channel balance (splice-out). */ - public byte[] get_chain_hash() { - long ret = bindings.SpliceAck_get_chain_hash(this.ptr); + public long get_funding_contribution_satoshis() { + long ret = bindings.SpliceAck_get_funding_contribution_satoshis(this.ptr); GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + return ret; } /** - * The genesis hash of the blockchain where the channel is intended to be spliced + * The amount the splice acceptor is intending to add to its channel balance (splice-in) + * or remove from its channel balance (splice-out). */ - public void set_chain_hash(byte[] val) { - bindings.SpliceAck_set_chain_hash(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + public void set_funding_contribution_satoshis(long val) { + bindings.SpliceAck_set_funding_contribution_satoshis(this.ptr, val); GC.KeepAlive(this); GC.KeepAlive(val); } /** - * The intended change in channel capacity: the amount to be added (positive value) - * or removed (negative value) by the sender (splice acceptor) by splicing into/from the channel. + * The key of the sender (splice acceptor) controlling the new funding transaction */ - public long get_relative_satoshis() { - long ret = bindings.SpliceAck_get_relative_satoshis(this.ptr); + public byte[] get_funding_pubkey() { + long ret = bindings.SpliceAck_get_funding_pubkey(this.ptr); GC.KeepAlive(this); - return ret; + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; } /** - * The intended change in channel capacity: the amount to be added (positive value) - * or removed (negative value) by the sender (splice acceptor) by splicing into/from the channel. + * The key of the sender (splice acceptor) controlling the new funding transaction */ - public void set_relative_satoshis(long val) { - bindings.SpliceAck_set_relative_satoshis(this.ptr, val); + public void set_funding_pubkey(byte[] val) { + bindings.SpliceAck_set_funding_pubkey(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); GC.KeepAlive(this); GC.KeepAlive(val); } /** - * The key of the sender (splice acceptor) controlling the new funding transaction + * If set, only confirmed inputs added (by the splice initiator) will be accepted */ - public byte[] get_funding_pubkey() { - long ret = bindings.SpliceAck_get_funding_pubkey(this.ptr); + public COption_NoneZ get_require_confirmed_inputs() { + COption_NoneZ ret = bindings.SpliceAck_get_require_confirmed_inputs(this.ptr); GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + return ret; } /** - * The key of the sender (splice acceptor) controlling the new funding transaction + * If set, only confirmed inputs added (by the splice initiator) will be accepted */ - public void set_funding_pubkey(byte[] val) { - bindings.SpliceAck_set_funding_pubkey(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); + public void set_require_confirmed_inputs(COption_NoneZ val) { + bindings.SpliceAck_set_require_confirmed_inputs(this.ptr, val); GC.KeepAlive(this); GC.KeepAlive(val); } @@ -100,16 +97,15 @@ public class SpliceAck : CommonBase { /** * Constructs a new SpliceAck given each field */ - 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))); + public static SpliceAck of(org.ldk.structs.ChannelId channel_id_arg, long funding_contribution_satoshis_arg, byte[] funding_pubkey_arg, COption_NoneZ require_confirmed_inputs_arg) { + long ret = bindings.SpliceAck_new(channel_id_arg.ptr, funding_contribution_satoshis_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(funding_pubkey_arg, 33)), require_confirmed_inputs_arg); GC.KeepAlive(channel_id_arg); - GC.KeepAlive(chain_hash_arg); - GC.KeepAlive(relative_satoshis_arg); + GC.KeepAlive(funding_contribution_satoshis_arg); GC.KeepAlive(funding_pubkey_arg); + GC.KeepAlive(require_confirmed_inputs_arg); 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; } diff --git a/c_sharp/src/org/ldk/structs/SpliceInit.cs b/c_sharp/src/org/ldk/structs/SpliceInit.cs new file mode 100644 index 00000000..30705389 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/SpliceInit.cs @@ -0,0 +1,208 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A `splice_init` message to be sent by or received from the stfu initiator (splice initiator). + */ +public class SpliceInit : CommonBase { + internal SpliceInit(object _dummy, long ptr) : base(ptr) { } + ~SpliceInit() { + if (ptr != 0) { bindings.SpliceInit_free(ptr); } + } + + /** + * The channel ID where splicing is intended + */ + public ChannelId get_channel_id() { + long ret = bindings.SpliceInit_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 where splicing is intended + */ + public void set_channel_id(org.ldk.structs.ChannelId val) { + bindings.SpliceInit_set_channel_id(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The amount the splice initiator is intending to add to its channel balance (splice-in) + * or remove from its channel balance (splice-out). + */ + public long get_funding_contribution_satoshis() { + long ret = bindings.SpliceInit_get_funding_contribution_satoshis(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The amount the splice initiator is intending to add to its channel balance (splice-in) + * or remove from its channel balance (splice-out). + */ + public void set_funding_contribution_satoshis(long val) { + bindings.SpliceInit_set_funding_contribution_satoshis(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The feerate for the new funding transaction, set by the splice initiator + */ + public int get_funding_feerate_perkw() { + int ret = bindings.SpliceInit_get_funding_feerate_perkw(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The feerate for the new funding transaction, set by the splice initiator + */ + public void set_funding_feerate_perkw(int val) { + bindings.SpliceInit_set_funding_feerate_perkw(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The locktime for the new funding transaction + */ + public int get_locktime() { + int ret = bindings.SpliceInit_get_locktime(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The locktime for the new funding transaction + */ + public void set_locktime(int val) { + bindings.SpliceInit_set_locktime(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The key of the sender (splice initiator) controlling the new funding transaction + */ + public byte[] get_funding_pubkey() { + long ret = bindings.SpliceInit_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 key of the sender (splice initiator) controlling the new funding transaction + */ + public void set_funding_pubkey(byte[] val) { + bindings.SpliceInit_set_funding_pubkey(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * If set, only confirmed inputs added (by the splice acceptor) will be accepted + */ + public COption_NoneZ get_require_confirmed_inputs() { + COption_NoneZ ret = bindings.SpliceInit_get_require_confirmed_inputs(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * If set, only confirmed inputs added (by the splice acceptor) will be accepted + */ + public void set_require_confirmed_inputs(COption_NoneZ val) { + bindings.SpliceInit_set_require_confirmed_inputs(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Constructs a new SpliceInit given each field + */ + public static SpliceInit of(org.ldk.structs.ChannelId channel_id_arg, long funding_contribution_satoshis_arg, int funding_feerate_perkw_arg, int locktime_arg, byte[] funding_pubkey_arg, COption_NoneZ require_confirmed_inputs_arg) { + long ret = bindings.SpliceInit_new(channel_id_arg.ptr, funding_contribution_satoshis_arg, funding_feerate_perkw_arg, locktime_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(funding_pubkey_arg, 33)), require_confirmed_inputs_arg); + GC.KeepAlive(channel_id_arg); + GC.KeepAlive(funding_contribution_satoshis_arg); + GC.KeepAlive(funding_feerate_perkw_arg); + GC.KeepAlive(locktime_arg); + GC.KeepAlive(funding_pubkey_arg); + GC.KeepAlive(require_confirmed_inputs_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.SpliceInit ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.SpliceInit(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.SpliceInit_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the SpliceInit + */ + public SpliceInit clone() { + long ret = bindings.SpliceInit_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.SpliceInit ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.SpliceInit(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Checks if two SpliceInits 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.SpliceInit b) { + bool ret = bindings.SpliceInit_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 SpliceInit)) return false; + return this.eq((SpliceInit)o); + } + /** + * Serialize the SpliceInit object into a byte array which can be read by SpliceInit_read + */ + public byte[] write() { + long ret = bindings.SpliceInit_write(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Read a SpliceInit from a byte array, created by SpliceInit_write + */ + public static Result_SpliceInitDecodeErrorZ read(byte[] ser) { + long ret = bindings.SpliceInit_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_SpliceInitDecodeErrorZ ret_hu_conv = Result_SpliceInitDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/SpliceLocked.cs b/c_sharp/src/org/ldk/structs/SpliceLocked.cs index ac5d31fb..7fde9159 100644 --- a/c_sharp/src/org/ldk/structs/SpliceLocked.cs +++ b/c_sharp/src/org/ldk/structs/SpliceLocked.cs @@ -7,7 +7,7 @@ namespace org { namespace ldk { namespace structs { /** - * A splice_locked message to be sent to or received from a peer. + * A `splice_locked` message to be sent to or received from a peer. */ public class SpliceLocked : CommonBase { internal SpliceLocked(object _dummy, long ptr) : base(ptr) { } @@ -34,19 +34,38 @@ public class SpliceLocked : CommonBase { bindings.SpliceLocked_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * The ID of the new funding transaction that has been locked + */ + public byte[] get_splice_txid() { + long ret = bindings.SpliceLocked_get_splice_txid(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * The ID of the new funding transaction that has been locked + */ + public void set_splice_txid(byte[] val) { + bindings.SpliceLocked_set_splice_txid(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + GC.KeepAlive(this); + GC.KeepAlive(val); } /** * Constructs a new SpliceLocked given each field */ - public static SpliceLocked of(org.ldk.structs.ChannelId channel_id_arg) { - long ret = bindings.SpliceLocked_new(channel_id_arg.ptr); + public static SpliceLocked of(org.ldk.structs.ChannelId channel_id_arg, byte[] splice_txid_arg) { + long ret = bindings.SpliceLocked_new(channel_id_arg.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(splice_txid_arg, 32))); GC.KeepAlive(channel_id_arg); + GC.KeepAlive(splice_txid_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; } diff --git a/c_sharp/src/org/ldk/structs/StaticPaymentOutputDescriptor.cs b/c_sharp/src/org/ldk/structs/StaticPaymentOutputDescriptor.cs index 31145844..2af31d1f 100644 --- a/c_sharp/src/org/ldk/structs/StaticPaymentOutputDescriptor.cs +++ b/c_sharp/src/org/ldk/structs/StaticPaymentOutputDescriptor.cs @@ -36,7 +36,6 @@ public class StaticPaymentOutputDescriptor : CommonBase { bindings.StaticPaymentOutputDescriptor_set_outpoint(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -128,7 +127,6 @@ public class StaticPaymentOutputDescriptor : CommonBase { bindings.StaticPaymentOutputDescriptor_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); }; } /** @@ -146,8 +144,6 @@ public class StaticPaymentOutputDescriptor : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.StaticPaymentOutputDescriptor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.StaticPaymentOutputDescriptor(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(channel_transaction_parameters_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Stfu.cs b/c_sharp/src/org/ldk/structs/Stfu.cs index 5b7cd65e..c9b0cc9c 100644 --- a/c_sharp/src/org/ldk/structs/Stfu.cs +++ b/c_sharp/src/org/ldk/structs/Stfu.cs @@ -7,7 +7,7 @@ namespace org { namespace ldk { namespace structs { /** - * An stfu (quiescence) message to be sent by or received from the stfu initiator. + * An `stfu` (quiescence) message to be sent by or received from the stfu initiator. */ public class Stfu : CommonBase { internal Stfu(object _dummy, long ptr) : base(ptr) { } @@ -34,7 +34,6 @@ public class Stfu : CommonBase { bindings.Stfu_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -65,7 +64,6 @@ public class Stfu : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.cs b/c_sharp/src/org/ldk/structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.cs index d0524d17..de68d158 100644 --- a/c_sharp/src/org/ldk/structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.cs +++ b/c_sharp/src/org/ldk/structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.cs @@ -81,9 +81,6 @@ public class ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ : CommonB if (ret >= 0 && ret <= 4096) { return null; } ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ ret_hu_conv = new ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ(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); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(c); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/ThreeTuple_OffersMessageDestinationBlindedPathZ.cs b/c_sharp/src/org/ldk/structs/ThreeTuple_OffersMessageDestinationBlindedPathZ.cs deleted file mode 100644 index b17f5a7c..00000000 --- a/c_sharp/src/org/ldk/structs/ThreeTuple_OffersMessageDestinationBlindedPathZ.cs +++ /dev/null @@ -1,91 +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_OffersMessageDestinationBlindedPathZ : CommonBase { - internal ThreeTuple_OffersMessageDestinationBlindedPathZ(object _dummy, long ptr) : base(ptr) { } - ~ThreeTuple_OffersMessageDestinationBlindedPathZ() { - if (ptr != 0) { bindings.C3Tuple_OffersMessageDestinationBlindedPathZ_free(ptr); } - } - - /** - * - */ - public OffersMessage get_a() { - long ret = bindings.C3Tuple_OffersMessageDestinationBlindedPathZ_get_a(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.OffersMessage ret_hu_conv = org.ldk.structs.OffersMessage.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * - */ - public Destination get_b() { - long ret = bindings.C3Tuple_OffersMessageDestinationBlindedPathZ_get_b(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Destination ret_hu_conv = org.ldk.structs.Destination.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * - */ - public BlindedPath get_c() { - long ret = bindings.C3Tuple_OffersMessageDestinationBlindedPathZ_get_c(this.ptr); - GC.KeepAlive(this); - 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(this); }; - return ret_hu_conv; - } - - internal long clone_ptr() { - long ret = bindings.C3Tuple_OffersMessageDestinationBlindedPathZ_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_OffersMessageDestinationBlindedPathZ clone() { - long ret = bindings.C3Tuple_OffersMessageDestinationBlindedPathZ_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - ThreeTuple_OffersMessageDestinationBlindedPathZ ret_hu_conv = new ThreeTuple_OffersMessageDestinationBlindedPathZ(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * 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.ptr); - GC.KeepAlive(a); - GC.KeepAlive(b); - GC.KeepAlive(c); - if (ret >= 0 && ret <= 4096) { return null; } - ThreeTuple_OffersMessageDestinationBlindedPathZ ret_hu_conv = new ThreeTuple_OffersMessageDestinationBlindedPathZ(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); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(c); }; - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/ThreeTuple_OnionMessageContentsDestinationBlindedPathZ.cs b/c_sharp/src/org/ldk/structs/ThreeTuple_OnionMessageContentsDestinationBlindedPathZ.cs deleted file mode 100644 index d9fc379e..00000000 --- a/c_sharp/src/org/ldk/structs/ThreeTuple_OnionMessageContentsDestinationBlindedPathZ.cs +++ /dev/null @@ -1,91 +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_OnionMessageContentsDestinationBlindedPathZ : CommonBase { - internal ThreeTuple_OnionMessageContentsDestinationBlindedPathZ(object _dummy, long ptr) : base(ptr) { } - ~ThreeTuple_OnionMessageContentsDestinationBlindedPathZ() { - if (ptr != 0) { bindings.C3Tuple_OnionMessageContentsDestinationBlindedPathZ_free(ptr); } - } - - /** - * - */ - public OnionMessageContents get_a() { - long ret = bindings.C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_a(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - OnionMessageContents ret_hu_conv = new OnionMessageContents(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * - */ - public Destination get_b() { - long ret = bindings.C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_b(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Destination ret_hu_conv = org.ldk.structs.Destination.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * - */ - public BlindedPath get_c() { - long ret = bindings.C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_c(this.ptr); - GC.KeepAlive(this); - 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(this); }; - return ret_hu_conv; - } - - internal long clone_ptr() { - long ret = bindings.C3Tuple_OnionMessageContentsDestinationBlindedPathZ_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_OnionMessageContentsDestinationBlindedPathZ clone() { - long ret = bindings.C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - ThreeTuple_OnionMessageContentsDestinationBlindedPathZ ret_hu_conv = new ThreeTuple_OnionMessageContentsDestinationBlindedPathZ(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * 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.ptr); - GC.KeepAlive(a); - GC.KeepAlive(b); - GC.KeepAlive(c); - if (ret >= 0 && ret <= 4096) { return null; } - ThreeTuple_OnionMessageContentsDestinationBlindedPathZ ret_hu_conv = new ThreeTuple_OnionMessageContentsDestinationBlindedPathZ(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); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(c); }; - 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 bc304560..027b3e18 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 @@ -80,8 +80,6 @@ public class ThreeTuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ : Com if (ret >= 0 && ret <= 4096) { return null; } ThreeTuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ ret_hu_conv = new ThreeTuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ(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); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(c); }; return ret_hu_conv; } 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 cfc2eab8..5a63e32c 100644 --- a/c_sharp/src/org/ldk/structs/ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ.cs +++ b/c_sharp/src/org/ldk/structs/ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ.cs @@ -80,8 +80,6 @@ public class ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ : CommonBas if (ret >= 0 && ret <= 4096) { return null; } ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ ret_hu_conv = new ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ(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(c); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/ThreeTuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ.cs b/c_sharp/src/org/ldk/structs/ThreeTuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ.cs index ea5e4a99..0831e87a 100644 --- a/c_sharp/src/org/ldk/structs/ThreeTuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ.cs +++ b/c_sharp/src/org/ldk/structs/ThreeTuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ.cs @@ -80,8 +80,6 @@ public class ThreeTuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ : Com if (ret >= 0 && ret <= 4096) { return null; } ThreeTuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ ret_hu_conv = new ThreeTuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ(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); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(c); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/ThreeTuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ.cs b/c_sharp/src/org/ldk/structs/ThreeTuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ.cs index 2fd402ad..ba0cf55a 100644 --- a/c_sharp/src/org/ldk/structs/ThreeTuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ.cs +++ b/c_sharp/src/org/ldk/structs/ThreeTuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ.cs @@ -77,7 +77,6 @@ public class ThreeTuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } ThreeTuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ ret_hu_conv = new ThreeTuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ(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(c); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/TrackedSpendableOutput.cs b/c_sharp/src/org/ldk/structs/TrackedSpendableOutput.cs index 0ad49eec..63af8afd 100644 --- a/c_sharp/src/org/ldk/structs/TrackedSpendableOutput.cs +++ b/c_sharp/src/org/ldk/structs/TrackedSpendableOutput.cs @@ -34,7 +34,6 @@ public class TrackedSpendableOutput : CommonBase { bindings.TrackedSpendableOutput_set_descriptor(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -64,7 +63,6 @@ public class TrackedSpendableOutput : CommonBase { 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); }; } /** @@ -86,7 +84,6 @@ public class TrackedSpendableOutput : CommonBase { bindings.TrackedSpendableOutput_set_status(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -102,9 +99,6 @@ public class TrackedSpendableOutput : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/TransactionU16LenLimited.cs b/c_sharp/src/org/ldk/structs/TransactionU16LenLimited.cs index 9e0974ca..d131009a 100644 --- a/c_sharp/src/org/ldk/structs/TransactionU16LenLimited.cs +++ b/c_sharp/src/org/ldk/structs/TransactionU16LenLimited.cs @@ -85,7 +85,7 @@ public class TransactionU16LenLimited : CommonBase { GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - if (this != null) { this.ptrs_to.AddLast(this); }; + ; return ret_conv; } diff --git a/c_sharp/src/org/ldk/structs/TwoTuple_AsyncPaymentsMessageMessageSendInstructionsZ.cs b/c_sharp/src/org/ldk/structs/TwoTuple_AsyncPaymentsMessageMessageSendInstructionsZ.cs new file mode 100644 index 00000000..ec00c354 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/TwoTuple_AsyncPaymentsMessageMessageSendInstructionsZ.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_AsyncPaymentsMessageMessageSendInstructionsZ : CommonBase { + internal TwoTuple_AsyncPaymentsMessageMessageSendInstructionsZ(object _dummy, long ptr) : base(ptr) { } + ~TwoTuple_AsyncPaymentsMessageMessageSendInstructionsZ() { + if (ptr != 0) { bindings.C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_free(ptr); } + } + + /** + * + */ + public AsyncPaymentsMessage get_a() { + long ret = bindings.C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_get_a(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.AsyncPaymentsMessage ret_hu_conv = org.ldk.structs.AsyncPaymentsMessage.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * + */ + public MessageSendInstructions get_b() { + long ret = bindings.C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_get_b(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageSendInstructions ret_hu_conv = org.ldk.structs.MessageSendInstructions.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_AsyncPaymentsMessageMessageSendInstructionsZ_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_AsyncPaymentsMessageMessageSendInstructionsZ clone() { + long ret = bindings.C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_AsyncPaymentsMessageMessageSendInstructionsZ ret_hu_conv = new TwoTuple_AsyncPaymentsMessageMessageSendInstructionsZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Creates a new C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ from the contained elements. + */ + public static TwoTuple_AsyncPaymentsMessageMessageSendInstructionsZ of(org.ldk.structs.AsyncPaymentsMessage a, org.ldk.structs.MessageSendInstructions b) { + long ret = bindings.C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_new(a.ptr, b.ptr); + GC.KeepAlive(a); + GC.KeepAlive(b); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_AsyncPaymentsMessageMessageSendInstructionsZ ret_hu_conv = new TwoTuple_AsyncPaymentsMessageMessageSendInstructionsZ(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/TwoTuple_BestBlockOutputSweeperZ.cs b/c_sharp/src/org/ldk/structs/TwoTuple_BestBlockOutputSweeperZ.cs index 4ddd8b99..5f2f361d 100644 --- a/c_sharp/src/org/ldk/structs/TwoTuple_BestBlockOutputSweeperZ.cs +++ b/c_sharp/src/org/ldk/structs/TwoTuple_BestBlockOutputSweeperZ.cs @@ -56,8 +56,7 @@ public class TwoTuple_BestBlockOutputSweeperZ : CommonBase { 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); }; diff --git a/c_sharp/src/org/ldk/structs/TwoTuple_BlindedPayInfoBlindedPathZ.cs b/c_sharp/src/org/ldk/structs/TwoTuple_BlindedPayInfoBlindedPathZ.cs deleted file mode 100644 index a6a31bcc..00000000 --- a/c_sharp/src/org/ldk/structs/TwoTuple_BlindedPayInfoBlindedPathZ.cs +++ /dev/null @@ -1,77 +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_BlindedPayInfoBlindedPathZ : CommonBase { - internal TwoTuple_BlindedPayInfoBlindedPathZ(object _dummy, long ptr) : base(ptr) { } - ~TwoTuple_BlindedPayInfoBlindedPathZ() { - if (ptr != 0) { bindings.C2Tuple_BlindedPayInfoBlindedPathZ_free(ptr); } - } - - /** - * - */ - public BlindedPayInfo get_a() { - long ret = bindings.C2Tuple_BlindedPayInfoBlindedPathZ_get_a(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.BlindedPayInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedPayInfo(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * - */ - public BlindedPath get_b() { - long ret = bindings.C2Tuple_BlindedPayInfoBlindedPathZ_get_b(this.ptr); - GC.KeepAlive(this); - 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(this); }; - return ret_hu_conv; - } - - internal long clone_ptr() { - long ret = bindings.C2Tuple_BlindedPayInfoBlindedPathZ_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_BlindedPayInfoBlindedPathZ clone() { - long ret = bindings.C2Tuple_BlindedPayInfoBlindedPathZ_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - TwoTuple_BlindedPayInfoBlindedPathZ ret_hu_conv = new TwoTuple_BlindedPayInfoBlindedPathZ(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * 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.ptr, b.ptr); - GC.KeepAlive(a); - GC.KeepAlive(b); - if (ret >= 0 && ret <= 4096) { return null; } - TwoTuple_BlindedPayInfoBlindedPathZ ret_hu_conv = new TwoTuple_BlindedPayInfoBlindedPathZ(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_ChannelIdPublicKeyZ.cs b/c_sharp/src/org/ldk/structs/TwoTuple_ChannelIdPublicKeyZ.cs index 8bccf7a6..cf1ad0b0 100644 --- a/c_sharp/src/org/ldk/structs/TwoTuple_ChannelIdPublicKeyZ.cs +++ b/c_sharp/src/org/ldk/structs/TwoTuple_ChannelIdPublicKeyZ.cs @@ -67,7 +67,6 @@ public class TwoTuple_ChannelIdPublicKeyZ : CommonBase { 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_OffersMessageMessageSendInstructionsZ.cs b/c_sharp/src/org/ldk/structs/TwoTuple_OffersMessageMessageSendInstructionsZ.cs new file mode 100644 index 00000000..0a5d5541 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/TwoTuple_OffersMessageMessageSendInstructionsZ.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_OffersMessageMessageSendInstructionsZ : CommonBase { + internal TwoTuple_OffersMessageMessageSendInstructionsZ(object _dummy, long ptr) : base(ptr) { } + ~TwoTuple_OffersMessageMessageSendInstructionsZ() { + if (ptr != 0) { bindings.C2Tuple_OffersMessageMessageSendInstructionsZ_free(ptr); } + } + + /** + * + */ + public OffersMessage get_a() { + long ret = bindings.C2Tuple_OffersMessageMessageSendInstructionsZ_get_a(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OffersMessage ret_hu_conv = org.ldk.structs.OffersMessage.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * + */ + public MessageSendInstructions get_b() { + long ret = bindings.C2Tuple_OffersMessageMessageSendInstructionsZ_get_b(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageSendInstructions ret_hu_conv = org.ldk.structs.MessageSendInstructions.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_OffersMessageMessageSendInstructionsZ_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_OffersMessageMessageSendInstructionsZ clone() { + long ret = bindings.C2Tuple_OffersMessageMessageSendInstructionsZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_OffersMessageMessageSendInstructionsZ ret_hu_conv = new TwoTuple_OffersMessageMessageSendInstructionsZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Creates a new C2Tuple_OffersMessageMessageSendInstructionsZ from the contained elements. + */ + public static TwoTuple_OffersMessageMessageSendInstructionsZ of(org.ldk.structs.OffersMessage a, org.ldk.structs.MessageSendInstructions b) { + long ret = bindings.C2Tuple_OffersMessageMessageSendInstructionsZ_new(a.ptr, b.ptr); + GC.KeepAlive(a); + GC.KeepAlive(b); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_OffersMessageMessageSendInstructionsZ ret_hu_conv = new TwoTuple_OffersMessageMessageSendInstructionsZ(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/TwoTuple_OffersMessageResponseInstructionZ.cs b/c_sharp/src/org/ldk/structs/TwoTuple_OffersMessageResponseInstructionZ.cs new file mode 100644 index 00000000..7628df27 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/TwoTuple_OffersMessageResponseInstructionZ.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_OffersMessageResponseInstructionZ : CommonBase { + internal TwoTuple_OffersMessageResponseInstructionZ(object _dummy, long ptr) : base(ptr) { } + ~TwoTuple_OffersMessageResponseInstructionZ() { + if (ptr != 0) { bindings.C2Tuple_OffersMessageResponseInstructionZ_free(ptr); } + } + + /** + * + */ + public OffersMessage get_a() { + long ret = bindings.C2Tuple_OffersMessageResponseInstructionZ_get_a(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OffersMessage ret_hu_conv = org.ldk.structs.OffersMessage.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * + */ + public ResponseInstruction get_b() { + long ret = bindings.C2Tuple_OffersMessageResponseInstructionZ_get_b(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ResponseInstruction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ResponseInstruction(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_OffersMessageResponseInstructionZ_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_OffersMessageResponseInstructionZ clone() { + long ret = bindings.C2Tuple_OffersMessageResponseInstructionZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_OffersMessageResponseInstructionZ ret_hu_conv = new TwoTuple_OffersMessageResponseInstructionZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Creates a new C2Tuple_OffersMessageResponseInstructionZ from the contained elements. + */ + public static TwoTuple_OffersMessageResponseInstructionZ of(org.ldk.structs.OffersMessage a, org.ldk.structs.ResponseInstruction b) { + long ret = bindings.C2Tuple_OffersMessageResponseInstructionZ_new(a.ptr, b.ptr); + GC.KeepAlive(a); + GC.KeepAlive(b); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_OffersMessageResponseInstructionZ ret_hu_conv = new TwoTuple_OffersMessageResponseInstructionZ(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/TwoTuple_OnionMessageContentsMessageSendInstructionsZ.cs b/c_sharp/src/org/ldk/structs/TwoTuple_OnionMessageContentsMessageSendInstructionsZ.cs new file mode 100644 index 00000000..937efad6 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/TwoTuple_OnionMessageContentsMessageSendInstructionsZ.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 { + + +/** + * A Tuple + */ +public class TwoTuple_OnionMessageContentsMessageSendInstructionsZ : CommonBase { + internal TwoTuple_OnionMessageContentsMessageSendInstructionsZ(object _dummy, long ptr) : base(ptr) { } + ~TwoTuple_OnionMessageContentsMessageSendInstructionsZ() { + if (ptr != 0) { bindings.C2Tuple_OnionMessageContentsMessageSendInstructionsZ_free(ptr); } + } + + /** + * + */ + public OnionMessageContents get_a() { + long ret = bindings.C2Tuple_OnionMessageContentsMessageSendInstructionsZ_get_a(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + OnionMessageContents ret_hu_conv = new OnionMessageContents(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * + */ + public MessageSendInstructions get_b() { + long ret = bindings.C2Tuple_OnionMessageContentsMessageSendInstructionsZ_get_b(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageSendInstructions ret_hu_conv = org.ldk.structs.MessageSendInstructions.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_OnionMessageContentsMessageSendInstructionsZ_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_OnionMessageContentsMessageSendInstructionsZ clone() { + long ret = bindings.C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_OnionMessageContentsMessageSendInstructionsZ ret_hu_conv = new TwoTuple_OnionMessageContentsMessageSendInstructionsZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Creates a new C2Tuple_OnionMessageContentsMessageSendInstructionsZ from the contained elements. + */ + public static TwoTuple_OnionMessageContentsMessageSendInstructionsZ of(org.ldk.structs.OnionMessageContents a, org.ldk.structs.MessageSendInstructions b) { + long ret = bindings.C2Tuple_OnionMessageContentsMessageSendInstructionsZ_new(a.ptr, b.ptr); + GC.KeepAlive(a); + GC.KeepAlive(b); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_OnionMessageContentsMessageSendInstructionsZ ret_hu_conv = new TwoTuple_OnionMessageContentsMessageSendInstructionsZ(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_OnionMessageContentsResponseInstructionZ.cs b/c_sharp/src/org/ldk/structs/TwoTuple_OnionMessageContentsResponseInstructionZ.cs new file mode 100644 index 00000000..9aeae2d0 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/TwoTuple_OnionMessageContentsResponseInstructionZ.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 { + + +/** + * A Tuple + */ +public class TwoTuple_OnionMessageContentsResponseInstructionZ : CommonBase { + internal TwoTuple_OnionMessageContentsResponseInstructionZ(object _dummy, long ptr) : base(ptr) { } + ~TwoTuple_OnionMessageContentsResponseInstructionZ() { + if (ptr != 0) { bindings.C2Tuple_OnionMessageContentsResponseInstructionZ_free(ptr); } + } + + /** + * + */ + public OnionMessageContents get_a() { + long ret = bindings.C2Tuple_OnionMessageContentsResponseInstructionZ_get_a(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + OnionMessageContents ret_hu_conv = new OnionMessageContents(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * + */ + public ResponseInstruction get_b() { + long ret = bindings.C2Tuple_OnionMessageContentsResponseInstructionZ_get_b(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ResponseInstruction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ResponseInstruction(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_OnionMessageContentsResponseInstructionZ_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_OnionMessageContentsResponseInstructionZ clone() { + long ret = bindings.C2Tuple_OnionMessageContentsResponseInstructionZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_OnionMessageContentsResponseInstructionZ ret_hu_conv = new TwoTuple_OnionMessageContentsResponseInstructionZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Creates a new C2Tuple_OnionMessageContentsResponseInstructionZ from the contained elements. + */ + public static TwoTuple_OnionMessageContentsResponseInstructionZ of(org.ldk.structs.OnionMessageContents a, org.ldk.structs.ResponseInstruction b) { + long ret = bindings.C2Tuple_OnionMessageContentsResponseInstructionZ_new(a.ptr, b.ptr); + GC.KeepAlive(a); + GC.KeepAlive(b); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_OnionMessageContentsResponseInstructionZ ret_hu_conv = new TwoTuple_OnionMessageContentsResponseInstructionZ(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 deleted file mode 100644 index 6d6594f2..00000000 --- a/c_sharp/src/org/ldk/structs/TwoTuple_OutPointCVec_MonitorUpdateIdZZ.cs +++ /dev/null @@ -1,84 +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_OutPointCVec_MonitorUpdateIdZZ : CommonBase { - internal TwoTuple_OutPointCVec_MonitorUpdateIdZZ(object _dummy, long ptr) : base(ptr) { } - ~TwoTuple_OutPointCVec_MonitorUpdateIdZZ() { - if (ptr != 0) { bindings.C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(ptr); } - } - - /** - * - */ - public OutPoint get_a() { - long ret = bindings.C2Tuple_OutPointCVec_MonitorUpdateIdZZ_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 MonitorUpdateId[] get_b() { - long ret = bindings.C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - int ret_conv_17_len = InternalUtils.getArrayLength(ret); - MonitorUpdateId[] ret_conv_17_arr = new MonitorUpdateId[ret_conv_17_len]; - for (int r = 0; r < ret_conv_17_len; r++) { - long ret_conv_17 = InternalUtils.getU64ArrayElem(ret, r); - org.ldk.structs.MonitorUpdateId ret_conv_17_hu_conv = null; if (ret_conv_17 < 0 || ret_conv_17 > 4096) { ret_conv_17_hu_conv = new org.ldk.structs.MonitorUpdateId(null, ret_conv_17); } - if (ret_conv_17_hu_conv != null) { ret_conv_17_hu_conv.ptrs_to.AddLast(this); }; - ret_conv_17_arr[r] = ret_conv_17_hu_conv; - } - bindings.free_buffer(ret); - return ret_conv_17_arr; - } - - internal long clone_ptr() { - long ret = bindings.C2Tuple_OutPointCVec_MonitorUpdateIdZZ_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_OutPointCVec_MonitorUpdateIdZZ clone() { - long ret = bindings.C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - TwoTuple_OutPointCVec_MonitorUpdateIdZZ ret_hu_conv = new TwoTuple_OutPointCVec_MonitorUpdateIdZZ(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * 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.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; } - TwoTuple_OutPointCVec_MonitorUpdateIdZZ ret_hu_conv = new TwoTuple_OutPointCVec_MonitorUpdateIdZZ(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 (MonitorUpdateId b_conv_17 in b) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(b_conv_17); }; }; - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/TwoTuple_OutPointCVec_u64ZZ.cs b/c_sharp/src/org/ldk/structs/TwoTuple_OutPointCVec_u64ZZ.cs new file mode 100644 index 00000000..47c33013 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/TwoTuple_OutPointCVec_u64ZZ.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 { + + +/** + * A Tuple + */ +public class TwoTuple_OutPointCVec_u64ZZ : CommonBase { + internal TwoTuple_OutPointCVec_u64ZZ(object _dummy, long ptr) : base(ptr) { } + ~TwoTuple_OutPointCVec_u64ZZ() { + if (ptr != 0) { bindings.C2Tuple_OutPointCVec_u64ZZ_free(ptr); } + } + + /** + * + */ + public OutPoint get_a() { + long ret = bindings.C2Tuple_OutPointCVec_u64ZZ_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 long[] get_b() { + long ret = bindings.C2Tuple_OutPointCVec_u64ZZ_get_b(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + long[] ret_conv = InternalUtils.decodeUint64Array(ret); + return ret_conv; + } + + internal long clone_ptr() { + long ret = bindings.C2Tuple_OutPointCVec_u64ZZ_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_OutPointCVec_u64ZZ clone() { + long ret = bindings.C2Tuple_OutPointCVec_u64ZZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_OutPointCVec_u64ZZ ret_hu_conv = new TwoTuple_OutPointCVec_u64ZZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Creates a new C2Tuple_OutPointCVec_u64ZZ from the contained elements. + */ + public static TwoTuple_OutPointCVec_u64ZZ of(org.ldk.structs.OutPoint a, long[] b) { + long ret = bindings.C2Tuple_OutPointCVec_u64ZZ_new(a.ptr, InternalUtils.encodeUint64Array(b)); + GC.KeepAlive(a); + GC.KeepAlive(b); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_OutPointCVec_u64ZZ ret_hu_conv = new TwoTuple_OutPointCVec_u64ZZ(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/TwoTuple_OutPointCVec_u8ZZ.cs b/c_sharp/src/org/ldk/structs/TwoTuple_OutPointCVec_u8ZZ.cs index 4a9d7c14..d2480a14 100644 --- a/c_sharp/src/org/ldk/structs/TwoTuple_OutPointCVec_u8ZZ.cs +++ b/c_sharp/src/org/ldk/structs/TwoTuple_OutPointCVec_u8ZZ.cs @@ -67,7 +67,6 @@ public class TwoTuple_OutPointCVec_u8ZZ : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } TwoTuple_OutPointCVec_u8ZZ ret_hu_conv = new TwoTuple_OutPointCVec_u8ZZ(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_OutPointChannelIdZ.cs b/c_sharp/src/org/ldk/structs/TwoTuple_OutPointChannelIdZ.cs index a13da11c..a3f7101a 100644 --- a/c_sharp/src/org/ldk/structs/TwoTuple_OutPointChannelIdZ.cs +++ b/c_sharp/src/org/ldk/structs/TwoTuple_OutPointChannelIdZ.cs @@ -68,8 +68,6 @@ public class TwoTuple_OutPointChannelIdZ : CommonBase { 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_PublicKeyCVec_SocketAddressZZ.cs b/c_sharp/src/org/ldk/structs/TwoTuple_PublicKeyCVec_SocketAddressZZ.cs deleted file mode 100644 index a6060a83..00000000 --- a/c_sharp/src/org/ldk/structs/TwoTuple_PublicKeyCVec_SocketAddressZZ.cs +++ /dev/null @@ -1,82 +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_PublicKeyCVec_SocketAddressZZ : CommonBase { - internal TwoTuple_PublicKeyCVec_SocketAddressZZ(object _dummy, long ptr) : base(ptr) { } - ~TwoTuple_PublicKeyCVec_SocketAddressZZ() { - if (ptr != 0) { bindings.C2Tuple_PublicKeyCVec_SocketAddressZZ_free(ptr); } - } - - /** - * - */ - public byte[] get_a() { - long ret = bindings.C2Tuple_PublicKeyCVec_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 SocketAddress[] get_b() { - long ret = bindings.C2Tuple_PublicKeyCVec_SocketAddressZZ_get_b(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - int ret_conv_15_len = InternalUtils.getArrayLength(ret); - SocketAddress[] ret_conv_15_arr = new SocketAddress[ret_conv_15_len]; - for (int p = 0; p < ret_conv_15_len; p++) { - long ret_conv_15 = InternalUtils.getU64ArrayElem(ret, p); - org.ldk.structs.SocketAddress ret_conv_15_hu_conv = org.ldk.structs.SocketAddress.constr_from_ptr(ret_conv_15); - if (ret_conv_15_hu_conv != null) { ret_conv_15_hu_conv.ptrs_to.AddLast(this); }; - ret_conv_15_arr[p] = ret_conv_15_hu_conv; - } - bindings.free_buffer(ret); - return ret_conv_15_arr; - } - - internal long clone_ptr() { - long ret = bindings.C2Tuple_PublicKeyCVec_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_PublicKeyCVec_SocketAddressZZ clone() { - long ret = bindings.C2Tuple_PublicKeyCVec_SocketAddressZZ_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - TwoTuple_PublicKeyCVec_SocketAddressZZ ret_hu_conv = new TwoTuple_PublicKeyCVec_SocketAddressZZ(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * Creates a new C2Tuple_PublicKeyCVec_SocketAddressZZ from the contained elements. - */ - public static TwoTuple_PublicKeyCVec_SocketAddressZZ of(byte[] a, SocketAddress[] b) { - long ret = bindings.C2Tuple_PublicKeyCVec_SocketAddressZZ_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(a, 33)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(b, b_conv_15 => b_conv_15.ptr))); - GC.KeepAlive(a); - GC.KeepAlive(b); - if (ret >= 0 && ret <= 4096) { return null; } - TwoTuple_PublicKeyCVec_SocketAddressZZ ret_hu_conv = new TwoTuple_PublicKeyCVec_SocketAddressZZ(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - foreach (SocketAddress b_conv_15 in b) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(b_conv_15); }; }; - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/TwoTuple_ReleaseHeldHtlcResponseInstructionZ.cs b/c_sharp/src/org/ldk/structs/TwoTuple_ReleaseHeldHtlcResponseInstructionZ.cs new file mode 100644 index 00000000..bd71e81a --- /dev/null +++ b/c_sharp/src/org/ldk/structs/TwoTuple_ReleaseHeldHtlcResponseInstructionZ.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_ReleaseHeldHtlcResponseInstructionZ : CommonBase { + internal TwoTuple_ReleaseHeldHtlcResponseInstructionZ(object _dummy, long ptr) : base(ptr) { } + ~TwoTuple_ReleaseHeldHtlcResponseInstructionZ() { + if (ptr != 0) { bindings.C2Tuple_ReleaseHeldHtlcResponseInstructionZ_free(ptr); } + } + + /** + * + */ + public ReleaseHeldHtlc get_a() { + long ret = bindings.C2Tuple_ReleaseHeldHtlcResponseInstructionZ_get_a(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ReleaseHeldHtlc ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ReleaseHeldHtlc(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * + */ + public ResponseInstruction get_b() { + long ret = bindings.C2Tuple_ReleaseHeldHtlcResponseInstructionZ_get_b(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ResponseInstruction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ResponseInstruction(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_ReleaseHeldHtlcResponseInstructionZ_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_ReleaseHeldHtlcResponseInstructionZ clone() { + long ret = bindings.C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_ReleaseHeldHtlcResponseInstructionZ ret_hu_conv = new TwoTuple_ReleaseHeldHtlcResponseInstructionZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Creates a new C2Tuple_ReleaseHeldHtlcResponseInstructionZ from the contained elements. + */ + public static TwoTuple_ReleaseHeldHtlcResponseInstructionZ of(org.ldk.structs.ReleaseHeldHtlc a, org.ldk.structs.ResponseInstruction b) { + long ret = bindings.C2Tuple_ReleaseHeldHtlcResponseInstructionZ_new(a.ptr, b.ptr); + GC.KeepAlive(a); + GC.KeepAlive(b); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_ReleaseHeldHtlcResponseInstructionZ ret_hu_conv = new TwoTuple_ReleaseHeldHtlcResponseInstructionZ(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/TwoTuple_ThirtyTwoBytesChannelManagerZ.cs b/c_sharp/src/org/ldk/structs/TwoTuple_ThirtyTwoBytesChannelManagerZ.cs index 9429f8ae..b19e2aea 100644 --- a/c_sharp/src/org/ldk/structs/TwoTuple_ThirtyTwoBytesChannelManagerZ.cs +++ b/c_sharp/src/org/ldk/structs/TwoTuple_ThirtyTwoBytesChannelManagerZ.cs @@ -66,8 +66,8 @@ public class TwoTuple_ThirtyTwoBytesChannelManagerZ : CommonBase { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(b_entropy_source); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(b_node_signer); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(b_signer_provider); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(b_config); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(b_params); }; + ; + ; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/TwoTuple_ThirtyTwoBytesChannelMonitorZ.cs b/c_sharp/src/org/ldk/structs/TwoTuple_ThirtyTwoBytesChannelMonitorZ.cs index 33876e00..dcd058b6 100644 --- a/c_sharp/src/org/ldk/structs/TwoTuple_ThirtyTwoBytesChannelMonitorZ.cs +++ b/c_sharp/src/org/ldk/structs/TwoTuple_ThirtyTwoBytesChannelMonitorZ.cs @@ -67,7 +67,6 @@ public class TwoTuple_ThirtyTwoBytesChannelMonitorZ : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } TwoTuple_ThirtyTwoBytesChannelMonitorZ ret_hu_conv = new TwoTuple_ThirtyTwoBytesChannelMonitorZ(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/TxAbort.cs b/c_sharp/src/org/ldk/structs/TxAbort.cs index d40f628e..d7d850ec 100644 --- a/c_sharp/src/org/ldk/structs/TxAbort.cs +++ b/c_sharp/src/org/ldk/structs/TxAbort.cs @@ -34,7 +34,6 @@ public class TxAbort : CommonBase { bindings.TxAbort_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -69,7 +68,6 @@ public class TxAbort : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/TxAckRbf.cs b/c_sharp/src/org/ldk/structs/TxAckRbf.cs index 52362a53..c85895f8 100644 --- a/c_sharp/src/org/ldk/structs/TxAckRbf.cs +++ b/c_sharp/src/org/ldk/structs/TxAckRbf.cs @@ -35,7 +35,6 @@ public class TxAckRbf : CommonBase { bindings.TxAckRbf_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -59,7 +58,6 @@ public class TxAckRbf : CommonBase { bindings.TxAckRbf_set_funding_output_contribution(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -72,8 +70,6 @@ public class TxAckRbf : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/TxAddInput.cs b/c_sharp/src/org/ldk/structs/TxAddInput.cs index 2893c182..195f40f2 100644 --- a/c_sharp/src/org/ldk/structs/TxAddInput.cs +++ b/c_sharp/src/org/ldk/structs/TxAddInput.cs @@ -34,7 +34,6 @@ public class TxAddInput : CommonBase { bindings.TxAddInput_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -78,7 +77,6 @@ public class TxAddInput : CommonBase { bindings.TxAddInput_set_prevtx(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -117,21 +115,41 @@ public class TxAddInput : CommonBase { GC.KeepAlive(val); } + /** + * The ID of the previous funding transaction, when it is being added as an input during splicing + */ + public Option_ThirtyTwoBytesZ get_shared_input_txid() { + long ret = bindings.TxAddInput_get_shared_input_txid(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); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The ID of the previous funding transaction, when it is being added as an input during splicing + */ + public void set_shared_input_txid(org.ldk.structs.Option_ThirtyTwoBytesZ val) { + bindings.TxAddInput_set_shared_input_txid(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + /** * Constructs a new TxAddInput given each field */ - 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); + 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, org.ldk.structs.Option_ThirtyTwoBytesZ shared_input_txid_arg) { + long ret = bindings.TxAddInput_new(channel_id_arg.ptr, serial_id_arg, prevtx_arg.ptr, prevtx_out_arg, sequence_arg, shared_input_txid_arg.ptr); GC.KeepAlive(channel_id_arg); GC.KeepAlive(serial_id_arg); GC.KeepAlive(prevtx_arg); GC.KeepAlive(prevtx_out_arg); GC.KeepAlive(sequence_arg); + GC.KeepAlive(shared_input_txid_arg); 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; } diff --git a/c_sharp/src/org/ldk/structs/TxAddOutput.cs b/c_sharp/src/org/ldk/structs/TxAddOutput.cs index 1b1fffe2..4eb42fca 100644 --- a/c_sharp/src/org/ldk/structs/TxAddOutput.cs +++ b/c_sharp/src/org/ldk/structs/TxAddOutput.cs @@ -34,7 +34,6 @@ public class TxAddOutput : CommonBase { bindings.TxAddOutput_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -107,7 +106,6 @@ 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; } diff --git a/c_sharp/src/org/ldk/structs/TxComplete.cs b/c_sharp/src/org/ldk/structs/TxComplete.cs index 906528fa..c2c0dfc6 100644 --- a/c_sharp/src/org/ldk/structs/TxComplete.cs +++ b/c_sharp/src/org/ldk/structs/TxComplete.cs @@ -35,7 +35,6 @@ public class TxComplete : CommonBase { bindings.TxComplete_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -47,7 +46,6 @@ public class TxComplete : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/TxCreationKeys.cs b/c_sharp/src/org/ldk/structs/TxCreationKeys.cs index 4be4a177..e692ad56 100644 --- a/c_sharp/src/org/ldk/structs/TxCreationKeys.cs +++ b/c_sharp/src/org/ldk/structs/TxCreationKeys.cs @@ -68,7 +68,6 @@ public class TxCreationKeys : CommonBase { bindings.TxCreationKeys_set_revocation_key(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -90,7 +89,6 @@ public class TxCreationKeys : CommonBase { bindings.TxCreationKeys_set_broadcaster_htlc_key(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -112,7 +110,6 @@ public class TxCreationKeys : CommonBase { bindings.TxCreationKeys_set_countersignatory_htlc_key(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -134,7 +131,6 @@ public class TxCreationKeys : CommonBase { 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); }; } /** @@ -150,10 +146,6 @@ public class TxCreationKeys : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.TxCreationKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxCreationKeys(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(revocation_key_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(broadcaster_htlc_key_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(countersignatory_htlc_key_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(broadcaster_delayed_payment_key_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/TxInitRbf.cs b/c_sharp/src/org/ldk/structs/TxInitRbf.cs index f071512f..fabf8e35 100644 --- a/c_sharp/src/org/ldk/structs/TxInitRbf.cs +++ b/c_sharp/src/org/ldk/structs/TxInitRbf.cs @@ -35,7 +35,6 @@ public class TxInitRbf : CommonBase { bindings.TxInitRbf_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -95,7 +94,6 @@ public class TxInitRbf : CommonBase { bindings.TxInitRbf_set_funding_output_contribution(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -110,8 +108,6 @@ 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; } diff --git a/c_sharp/src/org/ldk/structs/TxRemoveInput.cs b/c_sharp/src/org/ldk/structs/TxRemoveInput.cs index 3a83aa73..cc1199b4 100644 --- a/c_sharp/src/org/ldk/structs/TxRemoveInput.cs +++ b/c_sharp/src/org/ldk/structs/TxRemoveInput.cs @@ -34,7 +34,6 @@ public class TxRemoveInput : CommonBase { bindings.TxRemoveInput_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -65,7 +64,6 @@ public class TxRemoveInput : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/TxRemoveOutput.cs b/c_sharp/src/org/ldk/structs/TxRemoveOutput.cs index 3779df9a..6e921273 100644 --- a/c_sharp/src/org/ldk/structs/TxRemoveOutput.cs +++ b/c_sharp/src/org/ldk/structs/TxRemoveOutput.cs @@ -34,7 +34,6 @@ public class TxRemoveOutput : CommonBase { bindings.TxRemoveOutput_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -65,7 +64,6 @@ public class TxRemoveOutput : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/TxSignatures.cs b/c_sharp/src/org/ldk/structs/TxSignatures.cs index 6de18a09..ef1b70dd 100644 --- a/c_sharp/src/org/ldk/structs/TxSignatures.cs +++ b/c_sharp/src/org/ldk/structs/TxSignatures.cs @@ -35,7 +35,6 @@ public class TxSignatures : CommonBase { bindings.TxSignatures_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -90,8 +89,8 @@ public class TxSignatures : CommonBase { /** * 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); + public Option_ECDSASignatureZ get_shared_input_signature() { + long ret = bindings.TxSignatures_get_shared_input_signature(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); @@ -102,27 +101,24 @@ public class TxSignatures : CommonBase { /** * 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); + public void set_shared_input_signature(org.ldk.structs.Option_ECDSASignatureZ val) { + bindings.TxSignatures_set_shared_input_signature(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(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); + public static TxSignatures of(org.ldk.structs.ChannelId channel_id_arg, byte[] tx_hash_arg, byte[][] witnesses_arg, org.ldk.structs.Option_ECDSASignatureZ shared_input_signature_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))), shared_input_signature_arg.ptr); GC.KeepAlive(channel_id_arg); GC.KeepAlive(tx_hash_arg); GC.KeepAlive(witnesses_arg); - GC.KeepAlive(funding_outpoint_sig_arg); + GC.KeepAlive(shared_input_signature_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; } diff --git a/c_sharp/src/org/ldk/structs/UnsignedBolt12Invoice.cs b/c_sharp/src/org/ldk/structs/UnsignedBolt12Invoice.cs index 0b81898f..27da41c6 100644 --- a/c_sharp/src/org/ldk/structs/UnsignedBolt12Invoice.cs +++ b/c_sharp/src/org/ldk/structs/UnsignedBolt12Invoice.cs @@ -50,6 +50,77 @@ public class UnsignedBolt12Invoice : CommonBase { return ret_hu_conv; } + /** + * Duration since the Unix epoch when the invoice was created. + */ + public long created_at() { + long ret = bindings.UnsignedBolt12Invoice_created_at(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Duration since + * [`Bolt12Invoice::created_at`] + * when the invoice has expired and therefore should no longer be paid. + */ + public long relative_expiry() { + long ret = bindings.UnsignedBolt12Invoice_relative_expiry(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Whether the invoice has expired. + */ + public bool is_expired() { + bool ret = bindings.UnsignedBolt12Invoice_is_expired(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Fallback addresses for paying the invoice on-chain, in order of most-preferred to + * least-preferred. + */ + public string[] fallbacks() { + long ret = bindings.UnsignedBolt12Invoice_fallbacks(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + int ret_conv_8_len = InternalUtils.getArrayLength(ret); + string[] ret_conv_8_arr = new string[ret_conv_8_len]; + for (int i = 0; i < ret_conv_8_len; i++) { + long ret_conv_8 = InternalUtils.getU64ArrayElem(ret, i); + string ret_conv_8_conv = InternalUtils.decodeString(ret_conv_8); + ret_conv_8_arr[i] = ret_conv_8_conv; + } + bindings.free_buffer(ret); + return ret_conv_8_arr; + } + + /** + * Features pertaining to paying an invoice. + */ + public Bolt12InvoiceFeatures invoice_features() { + long ret = bindings.UnsignedBolt12Invoice_invoice_features(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt12InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Bolt12InvoiceFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The public key corresponding to the key used to sign the invoice. + */ + public byte[] signing_pubkey() { + long ret = bindings.UnsignedBolt12Invoice_signing_pubkey(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + /** * The chains that may be used when paying a requested invoice. * @@ -198,20 +269,20 @@ public class UnsignedBolt12Invoice : CommonBase { * * [`Offer::paths`]: crate::offers::offer::Offer::paths */ - public BlindedPath[] message_paths() { + public BlindedMessagePath[] message_paths() { long ret = bindings.UnsignedBolt12Invoice_message_paths(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - int ret_conv_13_len = InternalUtils.getArrayLength(ret); - BlindedPath[] ret_conv_13_arr = new BlindedPath[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.BlindedPath ret_conv_13_hu_conv = null; if (ret_conv_13 < 0 || ret_conv_13 > 4096) { ret_conv_13_hu_conv = new org.ldk.structs.BlindedPath(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; + int ret_conv_20_len = InternalUtils.getArrayLength(ret); + BlindedMessagePath[] ret_conv_20_arr = new BlindedMessagePath[ret_conv_20_len]; + for (int u = 0; u < ret_conv_20_len; u++) { + long ret_conv_20 = InternalUtils.getU64ArrayElem(ret, u); + org.ldk.structs.BlindedMessagePath ret_conv_20_hu_conv = null; if (ret_conv_20 < 0 || ret_conv_20 > 4096) { ret_conv_20_hu_conv = new org.ldk.structs.BlindedMessagePath(null, ret_conv_20); } + if (ret_conv_20_hu_conv != null) { ret_conv_20_hu_conv.ptrs_to.AddLast(this); }; + ret_conv_20_arr[u] = ret_conv_20_hu_conv; } bindings.free_buffer(ret); - return ret_conv_13_arr; + return ret_conv_20_arr; } /** @@ -302,34 +373,6 @@ public class UnsignedBolt12Invoice : CommonBase { return ret_hu_conv; } - /** - * Duration since the Unix epoch when the invoice was created. - */ - public long created_at() { - long ret = bindings.UnsignedBolt12Invoice_created_at(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Duration since [`Bolt12Invoice::created_at`] when the invoice has expired and therefore - * should no longer be paid. - */ - public long relative_expiry() { - long ret = bindings.UnsignedBolt12Invoice_relative_expiry(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Whether the invoice has expired. - */ - public bool is_expired() { - bool ret = bindings.UnsignedBolt12Invoice_is_expired(this.ptr); - GC.KeepAlive(this); - return ret; - } - /** * SHA256 hash of the payment preimage that will be given in return for paying the invoice. */ @@ -350,29 +393,6 @@ public class UnsignedBolt12Invoice : CommonBase { return ret; } - /** - * Features pertaining to paying an invoice. - */ - public Bolt12InvoiceFeatures invoice_features() { - long ret = bindings.UnsignedBolt12Invoice_invoice_features(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Bolt12InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Bolt12InvoiceFeatures(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * The public key corresponding to the key used to sign the invoice. - */ - public byte[] signing_pubkey() { - long ret = bindings.UnsignedBolt12Invoice_signing_pubkey(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - /** * Serialize the UnsignedBolt12Invoice object into a byte array which can be read by UnsignedBolt12Invoice_read */ diff --git a/c_sharp/src/org/ldk/structs/UnsignedChannelAnnouncement.cs b/c_sharp/src/org/ldk/structs/UnsignedChannelAnnouncement.cs index d1d55119..09d2ddc5 100644 --- a/c_sharp/src/org/ldk/structs/UnsignedChannelAnnouncement.cs +++ b/c_sharp/src/org/ldk/structs/UnsignedChannelAnnouncement.cs @@ -36,7 +36,6 @@ public class UnsignedChannelAnnouncement : CommonBase { bindings.UnsignedChannelAnnouncement_set_features(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -96,7 +95,6 @@ public class UnsignedChannelAnnouncement : CommonBase { bindings.UnsignedChannelAnnouncement_set_node_id_1(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -118,7 +116,6 @@ public class UnsignedChannelAnnouncement : CommonBase { bindings.UnsignedChannelAnnouncement_set_node_id_2(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -140,7 +137,6 @@ public class UnsignedChannelAnnouncement : CommonBase { bindings.UnsignedChannelAnnouncement_set_bitcoin_key_1(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -162,7 +158,6 @@ public class UnsignedChannelAnnouncement : CommonBase { bindings.UnsignedChannelAnnouncement_set_bitcoin_key_2(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -209,11 +204,6 @@ public class UnsignedChannelAnnouncement : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.UnsignedChannelAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UnsignedChannelAnnouncement(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_1_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(node_id_2_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(bitcoin_key_1_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(bitcoin_key_2_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/UnsignedChannelUpdate.cs b/c_sharp/src/org/ldk/structs/UnsignedChannelUpdate.cs index 5601f3c9..3217ee57 100644 --- a/c_sharp/src/org/ldk/structs/UnsignedChannelUpdate.cs +++ b/c_sharp/src/org/ldk/structs/UnsignedChannelUpdate.cs @@ -74,19 +74,39 @@ public class UnsignedChannelUpdate : CommonBase { } /** - * Channel flags + * Flags pertaining to this message. */ - public byte get_flags() { - byte ret = bindings.UnsignedChannelUpdate_get_flags(this.ptr); + public byte get_message_flags() { + byte ret = bindings.UnsignedChannelUpdate_get_message_flags(this.ptr); GC.KeepAlive(this); return ret; } /** - * Channel flags + * Flags pertaining to this message. */ - public void set_flags(byte val) { - bindings.UnsignedChannelUpdate_set_flags(this.ptr, val); + public void set_message_flags(byte val) { + bindings.UnsignedChannelUpdate_set_message_flags(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Flags pertaining to the channel, including to which direction in the channel this update + * applies and whether the direction is currently able to forward HTLCs. + */ + public byte get_channel_flags() { + byte ret = bindings.UnsignedChannelUpdate_get_channel_flags(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Flags pertaining to the channel, including to which direction in the channel this update + * applies and whether the direction is currently able to forward HTLCs. + */ + public void set_channel_flags(byte val) { + bindings.UnsignedChannelUpdate_set_channel_flags(this.ptr, val); GC.KeepAlive(this); GC.KeepAlive(val); } @@ -230,12 +250,13 @@ public class UnsignedChannelUpdate : CommonBase { /** * Constructs a new UnsignedChannelUpdate given each field */ - public static UnsignedChannelUpdate of(byte[] chain_hash_arg, long short_channel_id_arg, int timestamp_arg, byte flags_arg, short cltv_expiry_delta_arg, long htlc_minimum_msat_arg, long htlc_maximum_msat_arg, int fee_base_msat_arg, int fee_proportional_millionths_arg, byte[] excess_data_arg) { - long ret = bindings.UnsignedChannelUpdate_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(chain_hash_arg, 32)), short_channel_id_arg, timestamp_arg, flags_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, fee_base_msat_arg, fee_proportional_millionths_arg, InternalUtils.encodeUint8Array(excess_data_arg)); + public static UnsignedChannelUpdate of(byte[] chain_hash_arg, long short_channel_id_arg, int timestamp_arg, byte message_flags_arg, byte channel_flags_arg, short cltv_expiry_delta_arg, long htlc_minimum_msat_arg, long htlc_maximum_msat_arg, int fee_base_msat_arg, int fee_proportional_millionths_arg, byte[] excess_data_arg) { + long ret = bindings.UnsignedChannelUpdate_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(chain_hash_arg, 32)), short_channel_id_arg, timestamp_arg, message_flags_arg, channel_flags_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, fee_base_msat_arg, fee_proportional_millionths_arg, InternalUtils.encodeUint8Array(excess_data_arg)); GC.KeepAlive(chain_hash_arg); GC.KeepAlive(short_channel_id_arg); GC.KeepAlive(timestamp_arg); - GC.KeepAlive(flags_arg); + GC.KeepAlive(message_flags_arg); + GC.KeepAlive(channel_flags_arg); GC.KeepAlive(cltv_expiry_delta_arg); GC.KeepAlive(htlc_minimum_msat_arg); GC.KeepAlive(htlc_maximum_msat_arg); diff --git a/c_sharp/src/org/ldk/structs/UnsignedGossipMessage.cs b/c_sharp/src/org/ldk/structs/UnsignedGossipMessage.cs index fee4ac0f..61d5b5af 100644 --- a/c_sharp/src/org/ldk/structs/UnsignedGossipMessage.cs +++ b/c_sharp/src/org/ldk/structs/UnsignedGossipMessage.cs @@ -82,7 +82,6 @@ public class UnsignedGossipMessage : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.UnsignedGossipMessage ret_hu_conv = org.ldk.structs.UnsignedGossipMessage.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; } @@ -95,7 +94,6 @@ public class UnsignedGossipMessage : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.UnsignedGossipMessage ret_hu_conv = org.ldk.structs.UnsignedGossipMessage.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; } @@ -108,7 +106,6 @@ public class UnsignedGossipMessage : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.UnsignedGossipMessage ret_hu_conv = org.ldk.structs.UnsignedGossipMessage.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; } diff --git a/c_sharp/src/org/ldk/structs/UnsignedInvoiceRequest.cs b/c_sharp/src/org/ldk/structs/UnsignedInvoiceRequest.cs index 8a3dd22a..68e9fa24 100644 --- a/c_sharp/src/org/ldk/structs/UnsignedInvoiceRequest.cs +++ b/c_sharp/src/org/ldk/structs/UnsignedInvoiceRequest.cs @@ -155,20 +155,20 @@ public class UnsignedInvoiceRequest : CommonBase { * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide * recipient privacy by obfuscating its node id. */ - public BlindedPath[] paths() { + public BlindedMessagePath[] paths() { long ret = bindings.UnsignedInvoiceRequest_paths(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - int ret_conv_13_len = InternalUtils.getArrayLength(ret); - BlindedPath[] ret_conv_13_arr = new BlindedPath[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.BlindedPath ret_conv_13_hu_conv = null; if (ret_conv_13 < 0 || ret_conv_13 > 4096) { ret_conv_13_hu_conv = new org.ldk.structs.BlindedPath(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; + int ret_conv_20_len = InternalUtils.getArrayLength(ret); + BlindedMessagePath[] ret_conv_20_arr = new BlindedMessagePath[ret_conv_20_len]; + for (int u = 0; u < ret_conv_20_len; u++) { + long ret_conv_20 = InternalUtils.getU64ArrayElem(ret, u); + org.ldk.structs.BlindedMessagePath ret_conv_20_hu_conv = null; if (ret_conv_20 < 0 || ret_conv_20 > 4096) { ret_conv_20_hu_conv = new org.ldk.structs.BlindedMessagePath(null, ret_conv_20); } + if (ret_conv_20_hu_conv != null) { ret_conv_20_hu_conv.ptrs_to.AddLast(this); }; + ret_conv_20_arr[u] = ret_conv_20_hu_conv; } bindings.free_buffer(ret); - return ret_conv_13_arr; + return ret_conv_20_arr; } /** diff --git a/c_sharp/src/org/ldk/structs/UnsignedNodeAnnouncement.cs b/c_sharp/src/org/ldk/structs/UnsignedNodeAnnouncement.cs index 402811f5..c89d7f3b 100644 --- a/c_sharp/src/org/ldk/structs/UnsignedNodeAnnouncement.cs +++ b/c_sharp/src/org/ldk/structs/UnsignedNodeAnnouncement.cs @@ -36,7 +36,6 @@ public class UnsignedNodeAnnouncement : CommonBase { bindings.UnsignedNodeAnnouncement_set_features(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -78,7 +77,6 @@ public class UnsignedNodeAnnouncement : CommonBase { bindings.UnsignedNodeAnnouncement_set_node_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -124,7 +122,6 @@ public class UnsignedNodeAnnouncement : CommonBase { bindings.UnsignedNodeAnnouncement_set_alias(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -155,7 +152,6 @@ public class UnsignedNodeAnnouncement : CommonBase { bindings.UnsignedNodeAnnouncement_set_addresses(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(val, val_conv_15 => val_conv_15.ptr))); GC.KeepAlive(this); GC.KeepAlive(val); - foreach (SocketAddress val_conv_15 in val) { if (this != null) { this.ptrs_to.AddLast(val_conv_15); }; }; } /** @@ -230,10 +226,6 @@ public class UnsignedNodeAnnouncement : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/UntrustedString.cs b/c_sharp/src/org/ldk/structs/UntrustedString.cs index c23c97ba..b697ffff 100644 --- a/c_sharp/src/org/ldk/structs/UntrustedString.cs +++ b/c_sharp/src/org/ldk/structs/UntrustedString.cs @@ -15,6 +15,28 @@ public class UntrustedString : CommonBase { if (ptr != 0) { bindings.UntrustedString_free(ptr); } } + /** + * Serialize the UntrustedString object into a byte array which can be read by UntrustedString_read + */ + public byte[] write() { + long ret = bindings.UntrustedString_write(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Read a UntrustedString from a byte array, created by UntrustedString_write + */ + public static Result_UntrustedStringDecodeErrorZ read(byte[] ser) { + long ret = bindings.UntrustedString_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_UntrustedStringDecodeErrorZ ret_hu_conv = Result_UntrustedStringDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + public string get_a() { long ret = bindings.UntrustedString_get_a(this.ptr); GC.KeepAlive(this); @@ -88,28 +110,6 @@ public class UntrustedString : CommonBase { public override int GetHashCode() { return (int)this.hash(); } - /** - * Serialize the UntrustedString object into a byte array which can be read by UntrustedString_read - */ - public byte[] write() { - long ret = bindings.UntrustedString_write(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * Read a UntrustedString from a byte array, created by UntrustedString_write - */ - public static Result_UntrustedStringDecodeErrorZ read(byte[] ser) { - long ret = bindings.UntrustedString_read(InternalUtils.encodeUint8Array(ser)); - GC.KeepAlive(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_UntrustedStringDecodeErrorZ ret_hu_conv = Result_UntrustedStringDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - /** * Get the string representation of a UntrustedString object */ diff --git a/c_sharp/src/org/ldk/structs/UpdateAddHTLC.cs b/c_sharp/src/org/ldk/structs/UpdateAddHTLC.cs index 52acd06f..b5fc80f4 100644 --- a/c_sharp/src/org/ldk/structs/UpdateAddHTLC.cs +++ b/c_sharp/src/org/ldk/structs/UpdateAddHTLC.cs @@ -36,7 +36,6 @@ public class UpdateAddHTLC : CommonBase { bindings.UpdateAddHTLC_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -138,7 +137,6 @@ public class UpdateAddHTLC : CommonBase { bindings.UpdateAddHTLC_set_skimmed_fee_msat(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -160,7 +158,6 @@ public class UpdateAddHTLC : CommonBase { bindings.UpdateAddHTLC_set_onion_routing_packet(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -207,9 +204,6 @@ 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; } diff --git a/c_sharp/src/org/ldk/structs/UpdateFailHTLC.cs b/c_sharp/src/org/ldk/structs/UpdateFailHTLC.cs index 767f3390..0dc3cf7a 100644 --- a/c_sharp/src/org/ldk/structs/UpdateFailHTLC.cs +++ b/c_sharp/src/org/ldk/structs/UpdateFailHTLC.cs @@ -36,7 +36,6 @@ public class UpdateFailHTLC : CommonBase { bindings.UpdateFailHTLC_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** diff --git a/c_sharp/src/org/ldk/structs/UpdateFailMalformedHTLC.cs b/c_sharp/src/org/ldk/structs/UpdateFailMalformedHTLC.cs index 67f93a4c..d6f8f442 100644 --- a/c_sharp/src/org/ldk/structs/UpdateFailMalformedHTLC.cs +++ b/c_sharp/src/org/ldk/structs/UpdateFailMalformedHTLC.cs @@ -36,7 +36,6 @@ public class UpdateFailMalformedHTLC : CommonBase { bindings.UpdateFailMalformedHTLC_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** diff --git a/c_sharp/src/org/ldk/structs/UpdateFee.cs b/c_sharp/src/org/ldk/structs/UpdateFee.cs index 1d752e1f..5bf05213 100644 --- a/c_sharp/src/org/ldk/structs/UpdateFee.cs +++ b/c_sharp/src/org/ldk/structs/UpdateFee.cs @@ -36,7 +36,6 @@ public class UpdateFee : CommonBase { bindings.UpdateFee_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -67,7 +66,6 @@ public class UpdateFee : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/UpdateFulfillHTLC.cs b/c_sharp/src/org/ldk/structs/UpdateFulfillHTLC.cs index 9ca1f566..494f30d1 100644 --- a/c_sharp/src/org/ldk/structs/UpdateFulfillHTLC.cs +++ b/c_sharp/src/org/ldk/structs/UpdateFulfillHTLC.cs @@ -36,7 +36,6 @@ public class UpdateFulfillHTLC : CommonBase { bindings.UpdateFulfillHTLC_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -88,7 +87,6 @@ public class UpdateFulfillHTLC : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/UserConfig.cs b/c_sharp/src/org/ldk/structs/UserConfig.cs index b64a22e4..7dd3148d 100644 --- a/c_sharp/src/org/ldk/structs/UserConfig.cs +++ b/c_sharp/src/org/ldk/structs/UserConfig.cs @@ -9,8 +9,8 @@ namespace org { namespace ldk { namespace structs { /** * Top-level config which holds ChannelHandshakeLimits and ChannelConfig. * - * Default::default() provides sane defaults for most configurations - * (but currently with 0 relay fees!) + * `Default::default()` provides sane defaults for most configurations + * (but currently with zero relay fees!) */ public class UserConfig : CommonBase { internal UserConfig(object _dummy, long ptr) : base(ptr) { } @@ -37,7 +37,6 @@ public class UserConfig : CommonBase { bindings.UserConfig_set_channel_handshake_config(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -59,7 +58,6 @@ public class UserConfig : CommonBase { bindings.UserConfig_set_channel_handshake_limits(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -81,17 +79,16 @@ public class UserConfig : CommonBase { bindings.UserConfig_set_channel_config(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** - * If this is set to false, we will reject any HTLCs which were to be forwarded over private + * If this is set to `false`, we will reject any HTLCs which were to be forwarded over private * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a * node which is not online reliably. * * For nodes which are not online reliably, you should set all channels to *not* be announced - * (using [`ChannelHandshakeConfig::announced_channel`] and - * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to + * (using [`ChannelHandshakeConfig::announce_for_forwarding`] and + * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to `false` to * ensure you are not exposed to any forwarding risk. * * Note that because you cannot change a channel's announced state after creation, there is no @@ -100,7 +97,7 @@ public class UserConfig : CommonBase { * all your channels and open new ones. For privacy, you should also change your node_id * (swapping all private and public key material for new ones) at that time. * - * Default value: false. + * Default value: `false` */ public bool get_accept_forwards_to_priv_channels() { bool ret = bindings.UserConfig_get_accept_forwards_to_priv_channels(this.ptr); @@ -109,13 +106,13 @@ public class UserConfig : CommonBase { } /** - * If this is set to false, we will reject any HTLCs which were to be forwarded over private + * If this is set to `false`, we will reject any HTLCs which were to be forwarded over private * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a * node which is not online reliably. * * For nodes which are not online reliably, you should set all channels to *not* be announced - * (using [`ChannelHandshakeConfig::announced_channel`] and - * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to + * (using [`ChannelHandshakeConfig::announce_for_forwarding`] and + * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to `false` to * ensure you are not exposed to any forwarding risk. * * Note that because you cannot change a channel's announced state after creation, there is no @@ -124,7 +121,7 @@ public class UserConfig : CommonBase { * all your channels and open new ones. For privacy, you should also change your node_id * (swapping all private and public key material for new ones) at that time. * - * Default value: false. + * Default value: `false` */ public void set_accept_forwards_to_priv_channels(bool val) { bindings.UserConfig_set_accept_forwards_to_priv_channels(this.ptr, val); @@ -133,8 +130,9 @@ public class UserConfig : CommonBase { } /** - * If this is set to false, we do not accept inbound requests to open a new channel. - * Default value: true. + * If this is set to `false`, we do not accept inbound requests to open a new channel. + * + * Default value: `true` */ public bool get_accept_inbound_channels() { bool ret = bindings.UserConfig_get_accept_inbound_channels(this.ptr); @@ -143,8 +141,9 @@ public class UserConfig : CommonBase { } /** - * If this is set to false, we do not accept inbound requests to open a new channel. - * Default value: true. + * If this is set to `false`, we do not accept inbound requests to open a new channel. + * + * Default value: `true` */ public void set_accept_inbound_channels(bool val) { bindings.UserConfig_set_accept_inbound_channels(this.ptr, val); @@ -153,15 +152,15 @@ public class UserConfig : CommonBase { } /** - * If this is set to true, the user needs to manually accept inbound requests to open a new + * If this is set to `true`, the user needs to manually accept inbound requests to open a new * channel. * - * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a + * When set to `true`, [`Event::OpenChannelRequest`] will be triggered once a request to open a * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the * user explicitly chooses to accept the request. * - * Default value: false. + * Default value: `false` * * [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel @@ -174,15 +173,15 @@ public class UserConfig : CommonBase { } /** - * If this is set to true, the user needs to manually accept inbound requests to open a new + * If this is set to `true`, the user needs to manually accept inbound requests to open a new * channel. * - * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a + * When set to `true`, [`Event::OpenChannelRequest`] will be triggered once a request to open a * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the * user explicitly chooses to accept the request. * - * Default value: false. + * Default value: `false` * * [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel @@ -195,13 +194,13 @@ public class UserConfig : CommonBase { } /** - * If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over + * If this is set to `true`, LDK will intercept HTLCs that are attempting to be forwarded over * fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC * intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user. * - * Setting this to true may break backwards compatibility with LDK versions < 0.0.113. + * Setting this to `true` may break backwards compatibility with LDK versions < 0.0.113. * - * Default value: false. + * Default value: `false` * * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid * [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted @@ -213,13 +212,13 @@ public class UserConfig : CommonBase { } /** - * If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over + * If this is set to `true`, LDK will intercept HTLCs that are attempting to be forwarded over * fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC * intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user. * - * Setting this to true may break backwards compatibility with LDK versions < 0.0.113. + * Setting this to `true` may break backwards compatibility with LDK versions < 0.0.113. * - * Default value: false. + * Default value: `false` * * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid * [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted @@ -231,14 +230,14 @@ public class UserConfig : CommonBase { } /** - * If this is set to false, when receiving a keysend payment we'll fail it if it has multiple - * parts. If this is set to true, we'll accept the payment. + * If this is set to `false`, when receiving a keysend payment we'll fail it if it has multiple + * parts. If this is set to `true`, we'll accept the payment. * - * Setting this to true will break backwards compatibility upon downgrading to an LDK - * version < 0.0.116 while receiving an MPP keysend. If we have already received an MPP + * Setting this to `true` will break backwards compatibility upon downgrading to an LDK + * version prior to 0.0.116 while receiving an MPP keysend. If we have already received an MPP * keysend, downgrading will cause us to fail to deserialize [`ChannelManager`]. * - * Default value: false. + * Default value: `false` * * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager */ @@ -249,14 +248,14 @@ public class UserConfig : CommonBase { } /** - * If this is set to false, when receiving a keysend payment we'll fail it if it has multiple - * parts. If this is set to true, we'll accept the payment. + * If this is set to `false`, when receiving a keysend payment we'll fail it if it has multiple + * parts. If this is set to `true`, we'll accept the payment. * - * Setting this to true will break backwards compatibility upon downgrading to an LDK - * version < 0.0.116 while receiving an MPP keysend. If we have already received an MPP + * Setting this to `true` will break backwards compatibility upon downgrading to an LDK + * version prior to 0.0.116 while receiving an MPP keysend. If we have already received an MPP * keysend, downgrading will cause us to fail to deserialize [`ChannelManager`]. * - * Default value: false. + * Default value: `false` * * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager */ @@ -266,11 +265,53 @@ public class UserConfig : CommonBase { GC.KeepAlive(val); } + /** + * If this is set to `true`, the user needs to manually pay [`Bolt12Invoice`]s when received. + * + * When set to `true`, [`Event::InvoiceReceived`] will be generated for each received + * [`Bolt12Invoice`] instead of being automatically paid after verification. Use + * [`ChannelManager::send_payment_for_bolt12_invoice`] to pay the invoice or + * [`ChannelManager::abandon_payment`] to abandon the associated payment. + * + * Default value: `false` + * + * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice + * [`Event::InvoiceReceived`]: crate::events::Event::InvoiceReceived + * [`ChannelManager::send_payment_for_bolt12_invoice`]: crate::ln::channelmanager::ChannelManager::send_payment_for_bolt12_invoice + * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment + */ + public bool get_manually_handle_bolt12_invoices() { + bool ret = bindings.UserConfig_get_manually_handle_bolt12_invoices(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * If this is set to `true`, the user needs to manually pay [`Bolt12Invoice`]s when received. + * + * When set to `true`, [`Event::InvoiceReceived`] will be generated for each received + * [`Bolt12Invoice`] instead of being automatically paid after verification. Use + * [`ChannelManager::send_payment_for_bolt12_invoice`] to pay the invoice or + * [`ChannelManager::abandon_payment`] to abandon the associated payment. + * + * Default value: `false` + * + * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice + * [`Event::InvoiceReceived`]: crate::events::Event::InvoiceReceived + * [`ChannelManager::send_payment_for_bolt12_invoice`]: crate::ln::channelmanager::ChannelManager::send_payment_for_bolt12_invoice + * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment + */ + public void set_manually_handle_bolt12_invoices(bool val) { + bindings.UserConfig_set_manually_handle_bolt12_invoices(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + /** * 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.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); + 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, bool manually_handle_bolt12_invoices_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, manually_handle_bolt12_invoices_arg); GC.KeepAlive(channel_handshake_config_arg); GC.KeepAlive(channel_handshake_limits_arg); GC.KeepAlive(channel_config_arg); @@ -279,12 +320,10 @@ public class UserConfig : CommonBase { GC.KeepAlive(manually_accept_inbound_channels_arg); GC.KeepAlive(accept_intercept_htlcs_arg); GC.KeepAlive(accept_mpp_keysend_arg); + GC.KeepAlive(manually_handle_bolt12_invoices_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.UserConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UserConfig(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_handshake_config_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_handshake_limits_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_config_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/UtilMethods.cs b/c_sharp/src/org/ldk/structs/UtilMethods.cs index 281808f7..e8b1761a 100644 --- a/c_sharp/src/org/ldk/structs/UtilMethods.cs +++ b/c_sharp/src/org/ldk/structs/UtilMethods.cs @@ -60,13 +60,13 @@ public class UtilMethods { * A receiver knowing the PublicKey (e.g. the node's id) and the message can be sure that the signature was generated by the caller. * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted. */ - public static Result_StrSecp256k1ErrorZ sign(byte[] msg, byte[] sk) { + public static string sign(byte[] msg, byte[] sk) { long ret = bindings.sign(InternalUtils.encodeUint8Array(msg), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(sk, 32))); GC.KeepAlive(msg); GC.KeepAlive(sk); if (ret >= 0 && ret <= 4096) { return null; } - Result_StrSecp256k1ErrorZ ret_hu_conv = Result_StrSecp256k1ErrorZ.constr_from_ptr(ret); - return ret_hu_conv; + string ret_conv = InternalUtils.decodeString(ret); + return ret_conv; } /** @@ -93,18 +93,6 @@ public class UtilMethods { return ret; } - /** - * Construct the invoice's HRP and signatureless data into a preimage to be hashed. - */ - public static byte[] construct_invoice_preimage(byte[] hrp_bytes, UInt5[] data_without_signature) { - long ret = bindings.construct_invoice_preimage(InternalUtils.encodeUint8Array(hrp_bytes), InternalUtils.encodeUint8Array(InternalUtils.convUInt5Array(data_without_signature))); - GC.KeepAlive(hrp_bytes); - GC.KeepAlive(data_without_signature); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - /** * Read previously persisted [`ChannelMonitor`]s from the store. */ @@ -280,7 +268,7 @@ public class UtilMethods { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(arg_tx_broadcaster); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(arg_router); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(arg_logger); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(arg_default_config); }; + ; foreach (ChannelMonitor arg_channel_monitors_conv_16 in arg_channel_monitors) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(arg_channel_monitors_conv_16); }; }; return ret_hu_conv; } @@ -349,9 +337,7 @@ public class UtilMethods { if (ret >= 0 && ret <= 4096) { return null; } Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ ret_hu_conv = Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(keys); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(min_value_msat); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(entropy_source); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(min_final_cltv_expiry_delta); }; return ret_hu_conv; } @@ -378,8 +364,6 @@ public class UtilMethods { if (ret >= 0 && ret <= 4096) { return null; } Result_ThirtyTwoBytesNoneZ ret_hu_conv = Result_ThirtyTwoBytesNoneZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(keys); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(min_value_msat); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(min_final_cltv_expiry_delta); }; return ret_hu_conv; } @@ -633,326 +617,271 @@ public class UtilMethods { } /** - * Read a NetworkUpdate from a byte array, created by NetworkUpdate_write - */ - public static Result_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(byte[] ser) { - long ret = bindings.NetworkUpdate_read(InternalUtils.encodeUint8Array(ser)); - GC.KeepAlive(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_COption_NetworkUpdateZDecodeErrorZ ret_hu_conv = Result_COption_NetworkUpdateZDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Verifies the signature of a [`NodeAnnouncement`]. + * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\" + * See [`PhantomKeysManager`] for more information on phantom node payments. * - * 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.ptr); - GC.KeepAlive(msg); - if (ret >= 0 && ret <= 4096) { return null; } - Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); }; - return ret_hu_conv; - } - - /** - * Verifies all signatures included in a [`ChannelAnnouncement`]. + * `phantom_route_hints` parameter: + * Contains channel info for all nodes participating in the phantom invoice + * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each + * participating node + * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is + * updated when a channel becomes disabled or closes + * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice + * may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared + * down * - * Returns an error if one of the signatures is invalid. + * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference + * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]). + * If `None` is provided for `payment_hash`, then one will be created. + * + * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for + * in excess of the current time. + * + * `duration_since_epoch` is the current time since epoch in seconds. + * + * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to + * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`] - 3. + * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block + * confirmations during routing. + * + * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom + * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this + * requirement). + * + * [`PhantomKeysManager`]: crate::sign::PhantomKeysManager + * [`ChannelManager::get_phantom_route_hints`]: crate::ln::channelmanager::ChannelManager::get_phantom_route_hints + * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment + * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash + * [`PhantomRouteHints::channels`]: crate::ln::channelmanager::PhantomRouteHints::channels + * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: crate::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA + * + * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not + * available and the current time is supplied by the caller. */ - public static Result_NoneLightningErrorZ verify_channel_announcement(org.ldk.structs.ChannelAnnouncement msg) { - long ret = bindings.verify_channel_announcement(msg.ptr); - GC.KeepAlive(msg); + 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.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); + GC.KeepAlive(invoice_expiry_delta_secs); + GC.KeepAlive(phantom_route_hints); + GC.KeepAlive(entropy_source); + GC.KeepAlive(node_signer); + GC.KeepAlive(logger); + GC.KeepAlive(network); + GC.KeepAlive(min_final_cltv_expiry_delta); + GC.KeepAlive(duration_since_epoch); if (ret >= 0 && ret <= 4096) { return null; } - Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); }; + Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.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(logger); }; return ret_hu_conv; } /** - * Finds a route from us (payer) to the given target node (payee). + * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\" + * See [`PhantomKeysManager`] for more information on phantom node payments. * - * If the payee provided features in their invoice, they should be provided via the `payee` field - * in the given [`RouteParameters::payment_params`]. - * Without this, MPP will only be used if the payee's features are available in the network graph. + * `phantom_route_hints` parameter: + * Contains channel info for all nodes participating in the phantom invoice + * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each + * participating node + * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is + * updated when a channel becomes disabled or closes + * Note that the route hints generated from `phantom_route_hints` will be limited to a maximum + * of 3 hints to ensure that the invoice can be scanned in a QR code. These hints are selected + * in the order that the nodes in `PhantomRouteHints` are specified, selecting one hint per node + * until the maximum is hit. Callers may provide as many `PhantomRouteHints::channels` as + * desired, but note that some nodes will be trimmed if more than 3 nodes are provided. * - * Private routing paths between a public node and the target may be included in the `payee` field - * of [`RouteParameters::payment_params`]. + * `description_hash` is a SHA-256 hash of the description text * - * If some channels aren't announced, it may be useful to fill in `first_hops` with the results - * from [`ChannelManager::list_usable_channels`]. If it is filled in, the view of these channels - * from `network_graph` will be ignored, and only those in `first_hops` will be used. + * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference + * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]). + * If `None` is provided for `payment_hash`, then one will be created. * - * The fees on channels from us to the next hop are ignored as they are assumed to all be equal. - * However, the enabled/disabled bit on such channels as well as the `htlc_minimum_msat` / - * `htlc_maximum_msat` *are* checked as they may change based on the receiving node. + * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for + * in excess of the current time. * - * # Panics + * `duration_since_epoch` is the current time since epoch in seconds. * - * Panics if first_hops contains channels without `short_channel_id`s; - * [`ChannelManager::list_usable_channels`] will never include such channels. + * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom + * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this + * requirement). * - * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels - * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed - * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph + * [`PhantomKeysManager`]: crate::sign::PhantomKeysManager + * [`ChannelManager::get_phantom_route_hints`]: crate::ln::channelmanager::ChannelManager::get_phantom_route_hints + * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment + * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash + * [`PhantomRouteHints::channels`]: crate::ln::channelmanager::PhantomRouteHints::channels * - * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None + * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not + * available and the current time is supplied by the caller. */ - 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.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); - GC.KeepAlive(first_hops); + 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.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); + GC.KeepAlive(description_hash); + GC.KeepAlive(phantom_route_hints); + GC.KeepAlive(entropy_source); + GC.KeepAlive(node_signer); GC.KeepAlive(logger); - GC.KeepAlive(scorer); - GC.KeepAlive(score_params); - GC.KeepAlive(random_seed_bytes); + GC.KeepAlive(network); + GC.KeepAlive(min_final_cltv_expiry_delta); + GC.KeepAlive(duration_since_epoch); if (ret >= 0 && ret <= 4096) { return null; } - Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(route_params); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(network_graph); }; - if (first_hops != null) { foreach (ChannelDetails first_hops_conv_16 in first_hops) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(first_hops_conv_16); }; } }; + Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.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(logger); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(scorer); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(score_params); }; return ret_hu_conv; } /** - * Construct a route from us (payer) to the target node (payee) via the given hops (which should - * exclude the payer, but include the payee). This may be useful, e.g., for probing the chosen path. + * Utility to construct an invoice. Generally, unless you want to do something like a custom + * cltv_expiry, this is what you should be using to create an invoice. The reason being, this + * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user + * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify + * that the payment secret is valid when the invoice is paid. * - * Re-uses logic from `find_route`, so the restrictions described there also apply here. + * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for + * in excess of the current time. + * + * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to + * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. + * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block + * confirmations during routing. + * + * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: crate::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA */ - 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.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); - GC.KeepAlive(network_graph); + 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.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); - GC.KeepAlive(random_seed_bytes); + GC.KeepAlive(network); + GC.KeepAlive(amt_msat); + GC.KeepAlive(description); + GC.KeepAlive(invoice_expiry_delta_secs); + GC.KeepAlive(min_final_cltv_expiry_delta); if (ret >= 0 && ret <= 4096) { return null; } - Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(route_params); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(network_graph); }; + Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channelmanager); }; + 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); }; return ret_hu_conv; } /** - * Creates an unsigned [`PartiallySignedTransaction`] which spends the given descriptors to - * the given outputs, plus an output to the given change destination (if sufficient - * change value remains). The PSBT 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. + * Utility to construct an invoice. Generally, unless you want to do something like a custom + * cltv_expiry, this is what you should be using to create an invoice. The reason being, this + * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user + * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify + * that the payment secret is valid when the invoice is paid. + * Use this variant if you want to pass the `description_hash` to the invoice. * - * Returns the PSBT and expected max transaction weight. + * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for + * in excess of the current time. * - * 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. + * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to + * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. + * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block + * confirmations during routing. * - * We do not enforce that outputs meet the dust limit or that any output scripts are standard. + * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: crate::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA */ - public static Result_C2Tuple_CVec_u8Zu64ZNoneZ SpendableOutputDescriptor_create_spendable_outputs_psbt(SpendableOutputDescriptor[] descriptors, TxOut[] outputs, byte[] change_destination_script, int feerate_sat_per_1000_weight, org.ldk.structs.Option_u32Z locktime) { - long ret = bindings.SpendableOutputDescriptor_create_spendable_outputs_psbt(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(descriptors); - GC.KeepAlive(outputs); - GC.KeepAlive(change_destination_script); - GC.KeepAlive(feerate_sat_per_1000_weight); - GC.KeepAlive(locktime); + 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.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); + GC.KeepAlive(network); + GC.KeepAlive(amt_msat); + GC.KeepAlive(description_hash); + GC.KeepAlive(invoice_expiry_delta_secs); + GC.KeepAlive(min_final_cltv_expiry_delta); if (ret >= 0 && ret <= 4096) { return null; } - Result_C2Tuple_CVec_u8Zu64ZNoneZ ret_hu_conv = Result_C2Tuple_CVec_u8Zu64ZNoneZ.constr_from_ptr(ret); - foreach (SpendableOutputDescriptor descriptors_conv_27 in descriptors) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(descriptors_conv_27); }; }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(locktime); }; + Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channelmanager); }; + 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); }; 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 - * 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 + * See [`create_invoice_from_channelmanager_with_description_hash`] + * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not + * available and the current time is supplied by the caller. */ - 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); + 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.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(node_id_lookup); - GC.KeepAlive(path); - GC.KeepAlive(contents); - GC.KeepAlive(reply_path); + GC.KeepAlive(logger); + GC.KeepAlive(network); + GC.KeepAlive(amt_msat); + GC.KeepAlive(description_hash); + GC.KeepAlive(duration_since_epoch); + GC.KeepAlive(invoice_expiry_delta_secs); + GC.KeepAlive(min_final_cltv_expiry_delta); 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); }; + Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channelmanager); }; 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); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(logger); }; return ret_hu_conv; } /** - * Decode one layer of an incoming [`OnionMessage`]. - * - * Returns either the next layer of the onion for forwarding or the decrypted content for the - * receiver. + * See [`create_invoice_from_channelmanager`] + * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not + * available and the current time is supplied by the caller. */ - 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.ptr, node_signer.ptr, logger.ptr, custom_handler.ptr); - GC.KeepAlive(msg); + 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.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); - GC.KeepAlive(custom_handler); + GC.KeepAlive(network); + GC.KeepAlive(amt_msat); + GC.KeepAlive(description); + GC.KeepAlive(duration_since_epoch); + GC.KeepAlive(invoice_expiry_delta_secs); + GC.KeepAlive(min_final_cltv_expiry_delta); if (ret >= 0 && ret <= 4096) { return null; } - Result_PeeledOnionNoneZ ret_hu_conv = Result_PeeledOnionNoneZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); }; + Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channelmanager); }; 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(custom_handler); }; return ret_hu_conv; } /** - * Returns whether `tlv_type` corresponds to a TLV record for Offers. - */ - public static bool OffersMessage_is_known_type(long tlv_type) { - bool ret = bindings.OffersMessage_is_known_type(tlv_type); - GC.KeepAlive(tlv_type); - return ret; - } - - /** - * Create a one-hop blinded path for a payment. + * See [`create_invoice_from_channelmanager_and_duration_since_epoch`] + * This version allows for providing a custom [`PaymentHash`] for the invoice. + * This may be useful if you're building an on-chain swap or involving another protocol where + * the payment hash is also involved outside the scope of lightning. */ - 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); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(payee_tlvs); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(entropy_source); }; - return ret_hu_conv; - } - - /** - * Create a blinded path for a payment, to be forwarded along `intermediate_nodes`. - * - * Errors if: - * a provided node id is invalid - * [`BlindedPayInfo`] calculation results in an integer overflow - * any unknown features are required in the provided [`ForwardTlvs`] - * - * [`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, 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); + 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.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); + GC.KeepAlive(network); + GC.KeepAlive(amt_msat); + GC.KeepAlive(description); + GC.KeepAlive(duration_since_epoch); + GC.KeepAlive(invoice_expiry_delta_secs); + GC.KeepAlive(payment_hash); 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); - foreach (ForwardNode intermediate_nodes_conv_13 in intermediate_nodes) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(intermediate_nodes_conv_13); }; }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(payee_tlvs); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(entropy_source); }; - return ret_hu_conv; - } - - /** - * Read a PathFailure from a byte array, created by PathFailure_write - */ - public static Result_COption_PathFailureZDecodeErrorZ PathFailure_read(byte[] ser) { - long ret = bindings.PathFailure_read(InternalUtils.encodeUint8Array(ser)); - GC.KeepAlive(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_COption_PathFailureZDecodeErrorZ ret_hu_conv = Result_COption_PathFailureZDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Read a ClosureReason from a byte array, created by ClosureReason_write - */ - public static Result_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(byte[] ser) { - long ret = bindings.ClosureReason_read(InternalUtils.encodeUint8Array(ser)); - GC.KeepAlive(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_COption_ClosureReasonZDecodeErrorZ ret_hu_conv = Result_COption_ClosureReasonZDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Read a HTLCDestination from a byte array, created by HTLCDestination_write - */ - public static Result_COption_HTLCDestinationZDecodeErrorZ HTLCDestination_read(byte[] ser) { - long ret = bindings.HTLCDestination_read(InternalUtils.encodeUint8Array(ser)); - GC.KeepAlive(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_COption_HTLCDestinationZDecodeErrorZ ret_hu_conv = Result_COption_HTLCDestinationZDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Read a Event from a byte array, created by Event_write - */ - public static Result_COption_EventZDecodeErrorZ Event_read(byte[] ser) { - long ret = bindings.Event_read(InternalUtils.encodeUint8Array(ser)); - GC.KeepAlive(ser); if (ret >= 0 && ret <= 4096) { return null; } - Result_COption_EventZDecodeErrorZ ret_hu_conv = Result_COption_EventZDecodeErrorZ.constr_from_ptr(ret); + Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channelmanager); }; + 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); }; return ret_hu_conv; } @@ -967,8 +896,8 @@ public class UtilMethods { * Will always succeed unless the invoice has an amount specified, in which case * [`payment_parameters_from_invoice`] should be used. * - * [`ChannelManager::send_payment`]: lightning::ln::channelmanager::ChannelManager::send_payment - * [`ChannelManager::send_preflight_probes`]: lightning::ln::channelmanager::ChannelManager::send_preflight_probes + * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment + * [`ChannelManager::send_preflight_probes`]: crate::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.ptr, amount_msat); @@ -990,8 +919,8 @@ public class UtilMethods { * Will always succeed unless the invoice has no amount specified, in which case * [`payment_parameters_from_zero_amount_invoice`] should be used. * - * [`ChannelManager::send_payment`]: lightning::ln::channelmanager::ChannelManager::send_payment - * [`ChannelManager::send_preflight_probes`]: lightning::ln::channelmanager::ChannelManager::send_preflight_probes + * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment + * [`ChannelManager::send_preflight_probes`]: crate::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.ptr); @@ -1003,292 +932,298 @@ public class UtilMethods { } /** - * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\" - * See [`PhantomKeysManager`] for more information on phantom node payments. - * - * `phantom_route_hints` parameter: - * Contains channel info for all nodes participating in the phantom invoice - * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each - * participating node - * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is - * updated when a channel becomes disabled or closes - * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice - * may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared - * down - * - * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference - * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]). - * If `None` is provided for `payment_hash`, then one will be created. - * - * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for - * in excess of the current time. - * - * `duration_since_epoch` is the current time since epoch in seconds. - * - * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to - * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`] - 3. - * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block - * confirmations during routing. - * - * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom - * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this - * requirement). + * Read a NetworkUpdate from a byte array, created by NetworkUpdate_write + */ + public static Result_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(byte[] ser) { + long ret = bindings.NetworkUpdate_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_NetworkUpdateZDecodeErrorZ ret_hu_conv = Result_COption_NetworkUpdateZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Verifies the signature of a [`NodeAnnouncement`]. * - * [`PhantomKeysManager`]: lightning::sign::PhantomKeysManager - * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints - * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment - * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash - * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels - * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA + * 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.ptr); + GC.KeepAlive(msg); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); }; + return ret_hu_conv; + } + + /** + * Verifies all signatures included in a [`ChannelAnnouncement`]. * - * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not - * available and the current time is supplied by the caller. + * Returns an error if one of the signatures is invalid. */ - 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.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); - GC.KeepAlive(invoice_expiry_delta_secs); - GC.KeepAlive(phantom_route_hints); - GC.KeepAlive(entropy_source); - GC.KeepAlive(node_signer); - GC.KeepAlive(logger); - GC.KeepAlive(network); - GC.KeepAlive(min_final_cltv_expiry_delta); - GC.KeepAlive(duration_since_epoch); + public static Result_NoneLightningErrorZ verify_channel_announcement(org.ldk.structs.ChannelAnnouncement msg) { + long ret = bindings.verify_channel_announcement(msg.ptr); + GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } - Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(amt_msat); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(payment_hash); }; - foreach (PhantomRouteHints phantom_route_hints_conv_19 in phantom_route_hints) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(phantom_route_hints_conv_19); }; }; - 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(min_final_cltv_expiry_delta); }; + Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); }; return ret_hu_conv; } /** - * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\" - * See [`PhantomKeysManager`] for more information on phantom node payments. + * Finds a route from us (payer) to the given target node (payee). * - * `phantom_route_hints` parameter: - * Contains channel info for all nodes participating in the phantom invoice - * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each - * participating node - * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is - * updated when a channel becomes disabled or closes - * Note that the route hints generated from `phantom_route_hints` will be limited to a maximum - * of 3 hints to ensure that the invoice can be scanned in a QR code. These hints are selected - * in the order that the nodes in `PhantomRouteHints` are specified, selecting one hint per node - * until the maximum is hit. Callers may provide as many `PhantomRouteHints::channels` as - * desired, but note that some nodes will be trimmed if more than 3 nodes are provided. + * If the payee provided features in their invoice, they should be provided via the `payee` field + * in the given [`RouteParameters::payment_params`]. + * Without this, MPP will only be used if the payee's features are available in the network graph. * - * `description_hash` is a SHA-256 hash of the description text + * Private routing paths between a public node and the target may be included in the `payee` field + * of [`RouteParameters::payment_params`]. * - * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference - * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]). - * If `None` is provided for `payment_hash`, then one will be created. + * If some channels aren't announced, it may be useful to fill in `first_hops` with the results + * from [`ChannelManager::list_usable_channels`]. If it is filled in, the view of these channels + * from `network_graph` will be ignored, and only those in `first_hops` will be used. * - * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for - * in excess of the current time. + * The fees on channels from us to the next hop are ignored as they are assumed to all be equal. + * However, the enabled/disabled bit on such channels as well as the `htlc_minimum_msat` / + * `htlc_maximum_msat` *are* checked as they may change based on the receiving node. * - * `duration_since_epoch` is the current time since epoch in seconds. + * # Panics * - * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom - * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this - * requirement). + * Panics if first_hops contains channels without `short_channel_id`s; + * [`ChannelManager::list_usable_channels`] will never include such channels. * - * [`PhantomKeysManager`]: lightning::sign::PhantomKeysManager - * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints - * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment - * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash - * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels + * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels + * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed + * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph * - * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not - * available and the current time is supplied by the caller. + * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None */ - 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.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); - GC.KeepAlive(description_hash); - GC.KeepAlive(phantom_route_hints); - GC.KeepAlive(entropy_source); - GC.KeepAlive(node_signer); + 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.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); + GC.KeepAlive(first_hops); GC.KeepAlive(logger); - GC.KeepAlive(network); - GC.KeepAlive(min_final_cltv_expiry_delta); - GC.KeepAlive(duration_since_epoch); + GC.KeepAlive(scorer); + GC.KeepAlive(score_params); + GC.KeepAlive(random_seed_bytes); if (ret >= 0 && ret <= 4096) { return null; } - Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(amt_msat); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(payment_hash); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(description_hash); }; - foreach (PhantomRouteHints phantom_route_hints_conv_19 in phantom_route_hints) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(phantom_route_hints_conv_19); }; }; - 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); }; + Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(route_params); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(network_graph); }; + if (first_hops != null) { foreach (ChannelDetails first_hops_conv_16 in first_hops) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(first_hops_conv_16); }; } }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(logger); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(min_final_cltv_expiry_delta); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(scorer); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(score_params); }; return ret_hu_conv; } /** - * Utility to construct an invoice. Generally, unless you want to do something like a custom - * cltv_expiry, this is what you should be using to create an invoice. The reason being, this - * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user - * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify - * that the payment secret is valid when the invoice is paid. - * - * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for - * in excess of the current time. - * - * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to - * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. - * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block - * confirmations during routing. + * Construct a route from us (payer) to the target node (payee) via the given hops (which should + * exclude the payer, but include the payee). This may be useful, e.g., for probing the chosen path. * - * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA + * Re-uses logic from `find_route`, so the restrictions described there also apply here. */ - 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.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); + 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.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); + GC.KeepAlive(network_graph); GC.KeepAlive(logger); - GC.KeepAlive(network); - GC.KeepAlive(amt_msat); - GC.KeepAlive(description); - GC.KeepAlive(invoice_expiry_delta_secs); - GC.KeepAlive(min_final_cltv_expiry_delta); + GC.KeepAlive(random_seed_bytes); if (ret >= 0 && ret <= 4096) { return null; } - Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channelmanager); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(node_signer); }; + Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(route_params); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(network_graph); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(logger); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(amt_msat); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(min_final_cltv_expiry_delta); }; return ret_hu_conv; } /** - * Utility to construct an invoice. Generally, unless you want to do something like a custom - * cltv_expiry, this is what you should be using to create an invoice. The reason being, this - * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user - * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify - * that the payment secret is valid when the invoice is paid. - * Use this variant if you want to pass the `description_hash` to the invoice. + * Creates an unsigned [`Psbt`] which spends the given descriptors to + * the given outputs, plus an output to the given change destination (if sufficient + * change value remains). The PSBT will have a feerate, at least, of the given value. * - * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for - * in excess of the current time. + * 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. * - * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to - * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. - * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block - * confirmations during routing. + * Returns the PSBT and expected max transaction weight. + * + * 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. * - * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA + * We do not enforce that outputs meet the dust limit or that any output scripts are standard. */ - 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.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); - GC.KeepAlive(network); - GC.KeepAlive(amt_msat); - GC.KeepAlive(description_hash); - GC.KeepAlive(invoice_expiry_delta_secs); - GC.KeepAlive(min_final_cltv_expiry_delta); + public static Result_C2Tuple_CVec_u8Zu64ZNoneZ SpendableOutputDescriptor_create_spendable_outputs_psbt(SpendableOutputDescriptor[] descriptors, TxOut[] outputs, byte[] change_destination_script, int feerate_sat_per_1000_weight, org.ldk.structs.Option_u32Z locktime) { + long ret = bindings.SpendableOutputDescriptor_create_spendable_outputs_psbt(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(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_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channelmanager); }; - 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(amt_msat); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(description_hash); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(min_final_cltv_expiry_delta); }; + Result_C2Tuple_CVec_u8Zu64ZNoneZ ret_hu_conv = Result_C2Tuple_CVec_u8Zu64ZNoneZ.constr_from_ptr(ret); return ret_hu_conv; } /** - * See [`create_invoice_from_channelmanager_with_description_hash`] - * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not - * available and the current time is supplied by the caller. + * Returns whether `tlv_type` corresponds to a TLV record for async payment messages. */ - 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.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); + public static bool AsyncPaymentsMessage_is_known_type(long tlv_type) { + bool ret = bindings.AsyncPaymentsMessage_is_known_type(tlv_type); + GC.KeepAlive(tlv_type); + return ret; + } + + /** + * 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.BlindedMessagePath 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(logger); - GC.KeepAlive(network); - GC.KeepAlive(amt_msat); - GC.KeepAlive(description_hash); - GC.KeepAlive(duration_since_epoch); - GC.KeepAlive(invoice_expiry_delta_secs); - GC.KeepAlive(min_final_cltv_expiry_delta); + 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_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channelmanager); }; + 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(logger); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(amt_msat); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(description_hash); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(min_final_cltv_expiry_delta); }; + 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(contents); }; return ret_hu_conv; } /** - * See [`create_invoice_from_channelmanager`] - * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not - * available and the current time is supplied by the caller. + * 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 + * 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_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.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); + 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.BlindedMessagePath 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(logger); - GC.KeepAlive(network); - GC.KeepAlive(amt_msat); - GC.KeepAlive(description); - GC.KeepAlive(duration_since_epoch); - GC.KeepAlive(invoice_expiry_delta_secs); - GC.KeepAlive(min_final_cltv_expiry_delta); + GC.KeepAlive(node_id_lookup); + GC.KeepAlive(path); + GC.KeepAlive(contents); + GC.KeepAlive(reply_path); if (ret >= 0 && ret <= 4096) { return null; } - Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channelmanager); }; + 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(logger); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(amt_msat); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(min_final_cltv_expiry_delta); }; + 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(contents); }; return ret_hu_conv; } /** - * See [`create_invoice_from_channelmanager_and_duration_since_epoch`] - * This version allows for providing a custom [`PaymentHash`] for the invoice. - * This may be useful if you're building an on-chain swap or involving another protocol where - * the payment hash is also involved outside the scope of lightning. + * Decode one layer of an incoming [`OnionMessage`]. + * + * Returns either the next layer of the onion for forwarding or the decrypted content for the + * receiver. */ - 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.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); + 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.ptr, node_signer.ptr, logger.ptr, custom_handler.ptr); + GC.KeepAlive(msg); GC.KeepAlive(node_signer); GC.KeepAlive(logger); - GC.KeepAlive(network); - GC.KeepAlive(amt_msat); - GC.KeepAlive(description); - GC.KeepAlive(duration_since_epoch); - GC.KeepAlive(invoice_expiry_delta_secs); - GC.KeepAlive(payment_hash); - GC.KeepAlive(min_final_cltv_expiry_delta); + GC.KeepAlive(custom_handler); if (ret >= 0 && ret <= 4096) { return null; } - Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channelmanager); }; + Result_PeeledOnionNoneZ ret_hu_conv = Result_PeeledOnionNoneZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); }; 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(amt_msat); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(min_final_cltv_expiry_delta); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(custom_handler); }; + return ret_hu_conv; + } + + /** + * Returns whether `tlv_type` corresponds to a TLV record for Offers. + */ + public static bool OffersMessage_is_known_type(long tlv_type) { + bool ret = bindings.OffersMessage_is_known_type(tlv_type); + GC.KeepAlive(tlv_type); + return ret; + } + + /** + * Read a PathFailure from a byte array, created by PathFailure_write + */ + public static Result_COption_PathFailureZDecodeErrorZ PathFailure_read(byte[] ser) { + long ret = bindings.PathFailure_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_PathFailureZDecodeErrorZ ret_hu_conv = Result_COption_PathFailureZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Read a ClosureReason from a byte array, created by ClosureReason_write + */ + public static Result_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(byte[] ser) { + long ret = bindings.ClosureReason_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_ClosureReasonZDecodeErrorZ ret_hu_conv = Result_COption_ClosureReasonZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Read a HTLCDestination from a byte array, created by HTLCDestination_write + */ + public static Result_COption_HTLCDestinationZDecodeErrorZ HTLCDestination_read(byte[] ser) { + long ret = bindings.HTLCDestination_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_HTLCDestinationZDecodeErrorZ ret_hu_conv = Result_COption_HTLCDestinationZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Read a PaymentFailureReason from a byte array, created by PaymentFailureReason_write + */ + public static Result_COption_PaymentFailureReasonZDecodeErrorZ PaymentFailureReason_read(byte[] ser) { + long ret = bindings.PaymentFailureReason_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_PaymentFailureReasonZDecodeErrorZ ret_hu_conv = Result_COption_PaymentFailureReasonZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Read a Event from a byte array, created by Event_write + */ + public static Result_COption_EventZDecodeErrorZ Event_read(byte[] ser) { + long ret = bindings.Event_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_EventZDecodeErrorZ ret_hu_conv = Result_COption_EventZDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Utxo.cs b/c_sharp/src/org/ldk/structs/Utxo.cs index 9749cfa6..d72d551e 100644 --- a/c_sharp/src/org/ldk/structs/Utxo.cs +++ b/c_sharp/src/org/ldk/structs/Utxo.cs @@ -35,7 +35,6 @@ public class Utxo : CommonBase { bindings.Utxo_set_outpoint(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -91,7 +90,6 @@ public class Utxo : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Utxo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Utxo(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); }; return ret_hu_conv; } @@ -153,7 +151,6 @@ public class Utxo : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Utxo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Utxo(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; } diff --git a/c_sharp/src/org/ldk/structs/UtxoLookup.cs b/c_sharp/src/org/ldk/structs/UtxoLookup.cs index bd6705ae..fb7be3d6 100644 --- a/c_sharp/src/org/ldk/structs/UtxoLookup.cs +++ b/c_sharp/src/org/ldk/structs/UtxoLookup.cs @@ -41,7 +41,6 @@ public class UtxoLookup : CommonBase { UtxoResult ret = arg.get_utxo(_chain_hash_conv, _short_channel_id); GC.KeepAlive(arg); 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 8dbbc699..a4bc6167 100644 --- a/c_sharp/src/org/ldk/structs/UtxoResult.cs +++ b/c_sharp/src/org/ldk/structs/UtxoResult.cs @@ -84,7 +84,6 @@ public class UtxoResult : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.UtxoResult ret_hu_conv = org.ldk.structs.UtxoResult.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; } diff --git a/c_sharp/src/org/ldk/structs/VerifiedInvoiceRequest.cs b/c_sharp/src/org/ldk/structs/VerifiedInvoiceRequest.cs index b3bff35f..7f2519b4 100644 --- a/c_sharp/src/org/ldk/structs/VerifiedInvoiceRequest.cs +++ b/c_sharp/src/org/ldk/structs/VerifiedInvoiceRequest.cs @@ -7,8 +7,9 @@ namespace org { namespace ldk { namespace structs { /** - * An [`InvoiceRequest`] that has been verified by [`InvoiceRequest::verify`] and exposes different - * ways to respond depending on whether the signing keys were derived. + * An [`InvoiceRequest`] that has been verified by [`InvoiceRequest::verify_using_metadata`] or + * [`InvoiceRequest::verify_using_recipient_data`] and exposes different ways to respond depending + * on whether the signing keys were derived. */ public class VerifiedInvoiceRequest : CommonBase { internal VerifiedInvoiceRequest(object _dummy, long ptr) : base(ptr) { } @@ -35,43 +36,6 @@ public class VerifiedInvoiceRequest : CommonBase { 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. - * - * If `Some`, must call [`respond_using_derived_keys`] when responding. Otherwise, call - * [`respond_with`]. - * - * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice - * [`respond_using_derived_keys`]: Self::respond_using_derived_keys - * [`respond_with`]: Self::respond_with - */ - public Option_SecretKeyZ get_keys() { - long ret = bindings.VerifiedInvoiceRequest_get_keys(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Option_SecretKeyZ ret_hu_conv = org.ldk.structs.Option_SecretKeyZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * Keys used for signing a [`Bolt12Invoice`] if they can be derived. - * - * If `Some`, must call [`respond_using_derived_keys`] when responding. Otherwise, call - * [`respond_with`]. - * - * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice - * [`respond_using_derived_keys`]: Self::respond_using_derived_keys - * [`respond_with`]: Self::respond_with - */ - public void set_keys(org.ldk.structs.Option_SecretKeyZ val) { - bindings.VerifiedInvoiceRequest_set_keys(this.ptr, val.ptr); - GC.KeepAlive(this); - GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } internal long clone_ptr() { @@ -197,20 +161,20 @@ public class VerifiedInvoiceRequest : CommonBase { * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide * recipient privacy by obfuscating its node id. */ - public BlindedPath[] paths() { + public BlindedMessagePath[] paths() { long ret = bindings.VerifiedInvoiceRequest_paths(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - int ret_conv_13_len = InternalUtils.getArrayLength(ret); - BlindedPath[] ret_conv_13_arr = new BlindedPath[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.BlindedPath ret_conv_13_hu_conv = null; if (ret_conv_13 < 0 || ret_conv_13 > 4096) { ret_conv_13_hu_conv = new org.ldk.structs.BlindedPath(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; + int ret_conv_20_len = InternalUtils.getArrayLength(ret); + BlindedMessagePath[] ret_conv_20_arr = new BlindedMessagePath[ret_conv_20_len]; + for (int u = 0; u < ret_conv_20_len; u++) { + long ret_conv_20 = InternalUtils.getU64ArrayElem(ret, u); + org.ldk.structs.BlindedMessagePath ret_conv_20_hu_conv = null; if (ret_conv_20 < 0 || ret_conv_20 > 4096) { ret_conv_20_hu_conv = new org.ldk.structs.BlindedMessagePath(null, ret_conv_20); } + if (ret_conv_20_hu_conv != null) { ret_conv_20_hu_conv.ptrs_to.AddLast(this); }; + ret_conv_20_arr[u] = ret_conv_20_hu_conv; } bindings.free_buffer(ret); - return ret_conv_13_arr; + return ret_conv_20_arr; } /** @@ -337,8 +301,8 @@ public class VerifiedInvoiceRequest : CommonBase { * * [`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))); + public Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ respond_with(BlindedPaymentPath[] payment_paths, byte[] payment_hash) { + long ret = bindings.VerifiedInvoiceRequest_respond_with(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(payment_paths, payment_paths_conv_20 => payment_paths_conv_20.ptr)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32))); GC.KeepAlive(this); GC.KeepAlive(payment_paths); GC.KeepAlive(payment_hash); @@ -367,13 +331,15 @@ public class VerifiedInvoiceRequest : CommonBase { * # Note * * If the originating [`Offer`] was created using [`OfferBuilder::deriving_signing_pubkey`], - * then use [`InvoiceRequest::verify`] and [`VerifiedInvoiceRequest`] methods instead. + * then first use [`InvoiceRequest::verify_using_metadata`] or + * [`InvoiceRequest::verify_using_recipient_data`] and then [`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); + public Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ respond_with_no_std(BlindedPaymentPath[] 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_20 => payment_paths_conv_20.ptr)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32)), created_at); GC.KeepAlive(this); GC.KeepAlive(payment_paths); GC.KeepAlive(payment_hash); @@ -392,8 +358,8 @@ public class VerifiedInvoiceRequest : CommonBase { * * [`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))); + public Result_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ respond_using_derived_keys(BlindedPaymentPath[] payment_paths, byte[] payment_hash) { + long ret = bindings.VerifiedInvoiceRequest_respond_using_derived_keys(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(payment_paths, payment_paths_conv_20 => payment_paths_conv_20.ptr)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32))); GC.KeepAlive(this); GC.KeepAlive(payment_paths); GC.KeepAlive(payment_hash); @@ -411,8 +377,8 @@ public class VerifiedInvoiceRequest : CommonBase { * * [`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); + public Result_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ respond_using_derived_keys_no_std(BlindedPaymentPath[] 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_20 => payment_paths_conv_20.ptr)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32)), created_at); GC.KeepAlive(this); GC.KeepAlive(payment_paths); GC.KeepAlive(payment_hash); diff --git a/c_sharp/src/org/ldk/structs/WarningMessage.cs b/c_sharp/src/org/ldk/structs/WarningMessage.cs index 37699b4d..de7ae0a4 100644 --- a/c_sharp/src/org/ldk/structs/WarningMessage.cs +++ b/c_sharp/src/org/ldk/structs/WarningMessage.cs @@ -40,7 +40,6 @@ public class WarningMessage : CommonBase { bindings.WarningMessage_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -81,7 +80,6 @@ public class WarningMessage : CommonBase { 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; } diff --git a/c_sharp/src/org/ldk/structs/Watch.cs b/c_sharp/src/org/ldk/structs/Watch.cs index cc60fa6f..f8210ff0 100644 --- a/c_sharp/src/org/ldk/structs/Watch.cs +++ b/c_sharp/src/org/ldk/structs/Watch.cs @@ -145,8 +145,6 @@ public class Watch : CommonBase { GC.KeepAlive(monitor); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelMonitorUpdateStatusNoneZ ret_hu_conv = Result_ChannelMonitorUpdateStatusNoneZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(funding_txo); }; - if (this != null) { this.ptrs_to.AddLast(monitor); }; return ret_hu_conv; } @@ -172,7 +170,6 @@ public class Watch : CommonBase { GC.KeepAlive(this); GC.KeepAlive(funding_txo); GC.KeepAlive(update); - if (this != null) { this.ptrs_to.AddLast(funding_txo); }; if (this != null) { this.ptrs_to.AddLast(update); }; return ret; } diff --git a/c_sharp/src/org/ldk/structs/WatchedOutput.cs b/c_sharp/src/org/ldk/structs/WatchedOutput.cs index 70f17e08..71887698 100644 --- a/c_sharp/src/org/ldk/structs/WatchedOutput.cs +++ b/c_sharp/src/org/ldk/structs/WatchedOutput.cs @@ -16,6 +16,9 @@ namespace org { namespace ldk { namespace structs { * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and * may have been spent there. See [`Filter::register_output`] for details. * + * Depending on your block source, you may need one or both of either [`Self::outpoint`] or + * [`Self::script_pubkey`]. + * * [`ChannelMonitor`]: channelmonitor::ChannelMonitor * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected */ @@ -44,7 +47,6 @@ public class WatchedOutput : CommonBase { bindings.WatchedOutput_set_block_hash(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -66,7 +68,6 @@ public class WatchedOutput : CommonBase { bindings.WatchedOutput_set_outpoint(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -100,8 +101,6 @@ public class WatchedOutput : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.WatchedOutput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.WatchedOutput(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(block_hash_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(outpoint_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/WriteableEcdsaChannelSigner.cs b/c_sharp/src/org/ldk/structs/WriteableEcdsaChannelSigner.cs deleted file mode 100644 index 045861df..00000000 --- a/c_sharp/src/org/ldk/structs/WriteableEcdsaChannelSigner.cs +++ /dev/null @@ -1,95 +0,0 @@ - -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - - - -/** An implementation of WriteableEcdsaChannelSigner */ -public interface WriteableEcdsaChannelSignerInterface { - /**Serialize the object into a byte array - */ - byte[] write(); -} - -/** - * A writeable signer. - * - * There will always be two instances of a signer per channel, one occupied by the - * [`ChannelManager`] and another by the channel's [`ChannelMonitor`]. - * - * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager - * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor - */ -public class WriteableEcdsaChannelSigner : CommonBase { - internal bindings.LDKWriteableEcdsaChannelSigner bindings_instance; - internal long instance_idx; - - internal WriteableEcdsaChannelSigner(object _dummy, long ptr) : base(ptr) { bindings_instance = null; } - ~WriteableEcdsaChannelSigner() { - if (ptr != 0) { bindings.WriteableEcdsaChannelSigner_free(ptr); } - } - - private class LDKWriteableEcdsaChannelSignerHolder { internal WriteableEcdsaChannelSigner held; } - private class LDKWriteableEcdsaChannelSignerImpl : bindings.LDKWriteableEcdsaChannelSigner { - internal LDKWriteableEcdsaChannelSignerImpl(WriteableEcdsaChannelSignerInterface arg, LDKWriteableEcdsaChannelSignerHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; } - private WriteableEcdsaChannelSignerInterface arg; - private LDKWriteableEcdsaChannelSignerHolder impl_holder; - public long write() { - byte[] ret = arg.write(); - GC.KeepAlive(arg); - long result = InternalUtils.encodeUint8Array(ret); - return result; - } - } - - /** Creates a new instance of WriteableEcdsaChannelSigner from a given implementation */ - public static WriteableEcdsaChannelSigner new_impl(WriteableEcdsaChannelSignerInterface arg, EcdsaChannelSignerInterface ecdsaChannelSigner_impl, ChannelSignerInterface channelSigner_impl, ChannelPublicKeys pubkeys) { - LDKWriteableEcdsaChannelSignerHolder impl_holder = new LDKWriteableEcdsaChannelSignerHolder(); - 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.clone_ptr()); - - impl_holder.held = new WriteableEcdsaChannelSigner(null, ptr_idx[0]); - impl_holder.held.instance_idx = ptr_idx[1]; - impl_holder.held.bindings_instance = impl; - impl_holder.held.ptrs_to.AddLast(ecdsaChannelSigner); - impl_holder.held.ptrs_to.AddLast(channelSigner); - return impl_holder.held; - } - - /** - * Serialize the object into a byte array - */ - public byte[] write() { - long ret = bindings.WriteableEcdsaChannelSigner_write(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.WriteableEcdsaChannelSigner_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a copy of a WriteableEcdsaChannelSigner - */ - public WriteableEcdsaChannelSigner clone() { - long ret = bindings.WriteableEcdsaChannelSigner_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - WriteableEcdsaChannelSigner ret_hu_conv = new WriteableEcdsaChannelSigner(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - -} -} } }