From 152d721883552dd92925833d15687d7d64d01c35 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 6 Jun 2024 14:10:28 +0000 Subject: [PATCH] [C#] Update auto-generated bindings to LDK-C-Bindings 0.0.123.1 --- c_sharp/bindings.c | 21249 +++++++++------- c_sharp/bindings.c.body | 21249 +++++++++------- .../org/ldk/enums/InboundHTLCStateDetails.cs | 47 + .../org/ldk/enums/OutboundHTLCStateDetails.cs | 44 + c_sharp/src/org/ldk/impl/bindings.cs | 800 +- c_sharp/src/org/ldk/structs/ChannelDetails.cs | 133 + c_sharp/src/org/ldk/structs/ChannelId.cs | 11 + c_sharp/src/org/ldk/structs/ChannelInfo.cs | 11 + .../src/org/ldk/structs/ChannelUpdateInfo.cs | 11 + c_sharp/src/org/ldk/structs/ClosureReason.cs | 11 + c_sharp/src/org/ldk/structs/DecodeError.cs | 11 + c_sharp/src/org/ldk/structs/Hostname.cs | 11 + .../src/org/ldk/structs/InboundHTLCDetails.cs | 233 + c_sharp/src/org/ldk/structs/InvoiceError.cs | 11 + c_sharp/src/org/ldk/structs/NetworkGraph.cs | 11 + c_sharp/src/org/ldk/structs/NodeAlias.cs | 11 + c_sharp/src/org/ldk/structs/NodeId.cs | 11 + c_sharp/src/org/ldk/structs/NodeInfo.cs | 11 + c_sharp/src/org/ldk/structs/Offer.cs | 11 + .../structs/Option_ChannelShutdownStateZ.cs | 4 +- .../Option_InboundHTLCStateDetailsZ.cs | 82 + .../Option_OutboundHTLCStateDetailsZ.cs | 82 + c_sharp/src/org/ldk/structs/OutPoint.cs | 11 + .../org/ldk/structs/OutboundHTLCDetails.cs | 266 + .../src/org/ldk/structs/PeerHandleError.cs | 11 + .../src/org/ldk/structs/PrintableString.cs | 11 + c_sharp/src/org/ldk/structs/Refund.cs | 11 + ...on_InboundHTLCStateDetailsZDecodeErrorZ.cs | 93 + ...n_OutboundHTLCStateDetailsZDecodeErrorZ.cs | 93 + .../Result_InboundHTLCDetailsDecodeErrorZ.cs | 93 + .../Result_OutboundHTLCDetailsDecodeErrorZ.cs | 93 + c_sharp/src/org/ldk/structs/Route.cs | 11 + c_sharp/src/org/ldk/structs/ShutdownScript.cs | 11 + .../src/org/ldk/structs/UntrustedString.cs | 11 + c_sharp/src/org/ldk/structs/UtilMethods.cs | 22 + 35 files changed, 24760 insertions(+), 20032 deletions(-) create mode 100644 c_sharp/src/org/ldk/enums/InboundHTLCStateDetails.cs create mode 100644 c_sharp/src/org/ldk/enums/OutboundHTLCStateDetails.cs create mode 100644 c_sharp/src/org/ldk/structs/InboundHTLCDetails.cs create mode 100644 c_sharp/src/org/ldk/structs/Option_InboundHTLCStateDetailsZ.cs create mode 100644 c_sharp/src/org/ldk/structs/Option_OutboundHTLCStateDetailsZ.cs create mode 100644 c_sharp/src/org/ldk/structs/OutboundHTLCDetails.cs create mode 100644 c_sharp/src/org/ldk/structs/Result_COption_InboundHTLCStateDetailsZDecodeErrorZ.cs create mode 100644 c_sharp/src/org/ldk/structs/Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ.cs create mode 100644 c_sharp/src/org/ldk/structs/Result_InboundHTLCDetailsDecodeErrorZ.cs create mode 100644 c_sharp/src/org/ldk/structs/Result_OutboundHTLCDetailsDecodeErrorZ.cs diff --git a/c_sharp/bindings.c b/c_sharp/bindings.c index 2284cefa..ee78f2ad 100644 --- a/c_sharp/bindings.c +++ b/c_sharp/bindings.c @@ -81,7 +81,8 @@ static inline LDKStr str_ref_to_owned_c(const jstring str) { return res; } -typedef bool jboolean; +// The C# Bool marshalling is defined as 4 bytes, but the size of bool is platform-dependent +typedef int32_t jboolean; int64_t CS_LDK_allocate_buffer(int64_t len) { return (int64_t)MALLOC(len, "C#-requested buffer"); @@ -671,6 +672,24 @@ static inline int32_t LDKIOError_to_cs(LDKIOError val) { default: abort(); } } +static inline LDKInboundHTLCStateDetails LDKInboundHTLCStateDetails_from_cs(int32_t ord) { + switch (ord) { + case 0: return LDKInboundHTLCStateDetails_AwaitingRemoteRevokeToAdd; + case 1: return LDKInboundHTLCStateDetails_Committed; + case 2: return LDKInboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFulfill; + case 3: return LDKInboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFail; + default: abort(); + } +} +static inline int32_t LDKInboundHTLCStateDetails_to_cs(LDKInboundHTLCStateDetails val) { + switch (val) { + case LDKInboundHTLCStateDetails_AwaitingRemoteRevokeToAdd: return 0; + case LDKInboundHTLCStateDetails_Committed: return 1; + case LDKInboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFulfill: return 2; + case LDKInboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFail: return 3; + default: abort(); + } +} static inline LDKLevel LDKLevel_from_cs(int32_t ord) { switch (ord) { case 0: return LDKLevel_Gossip; @@ -711,6 +730,24 @@ static inline int32_t LDKNetwork_to_cs(LDKNetwork val) { default: abort(); } } +static inline LDKOutboundHTLCStateDetails LDKOutboundHTLCStateDetails_from_cs(int32_t ord) { + switch (ord) { + case 0: return LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToAdd; + case 1: return LDKOutboundHTLCStateDetails_Committed; + case 2: return LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveSuccess; + case 3: return LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFailure; + default: abort(); + } +} +static inline int32_t LDKOutboundHTLCStateDetails_to_cs(LDKOutboundHTLCStateDetails val) { + switch (val) { + case LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToAdd: return 0; + case LDKOutboundHTLCStateDetails_Committed: return 1; + case LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveSuccess: return 2; + case LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFailure: return 3; + default: abort(); + } +} static inline LDKPaymentFailureReason LDKPaymentFailureReason_from_cs(int32_t ord) { switch (ord) { case 0: return LDKPaymentFailureReason_RecipientRejected; @@ -5923,20 +5960,6 @@ int64_t CS_LDK_LDKCOption_C2Tuple_u64u16ZZ_Some_get_some(int64_t ptr) { *some_conv = C2Tuple_u64u16Z_clone(some_conv); return tag_ptr(some_conv, true); } -uint32_t CS_LDK_LDKCOption_ChannelShutdownStateZ_ty_from_ptr(int64_t ptr) { - LDKCOption_ChannelShutdownStateZ *obj = (LDKCOption_ChannelShutdownStateZ*)untag_ptr(ptr); - switch(obj->tag) { - case LDKCOption_ChannelShutdownStateZ_Some: return 0; - case LDKCOption_ChannelShutdownStateZ_None: return 1; - default: abort(); - } -} -int32_t CS_LDK_LDKCOption_ChannelShutdownStateZ_Some_get_some(int64_t ptr) { - LDKCOption_ChannelShutdownStateZ *obj = (LDKCOption_ChannelShutdownStateZ*)untag_ptr(ptr); - CHECK(obj->tag == LDKCOption_ChannelShutdownStateZ_Some); - int32_t some_conv = LDKChannelShutdownState_to_cs(obj->some); - return some_conv; -} static inline struct LDKChannelId CResult_ChannelIdAPIErrorZ_get_ok(LDKCResult_ChannelIdAPIErrorZ *NONNULL_PTR owner){ LDKChannelId ret = *owner->contents.result; ret.is_owned = false; @@ -6530,84 +6553,6 @@ static inline LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ CVec_C3Tuple } return ret; } -static inline struct LDKCounterpartyForwardingInfo CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner){ - LDKCounterpartyForwardingInfo ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -int64_t CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(int64_t owner) { - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(owner); - LDKCounterpartyForwardingInfo ret_var = CResult_CounterpartyForwardingInfoDecodeErrorZ_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_CounterpartyForwardingInfoDecodeErrorZ_get_err(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -int64_t CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(int64_t owner) { - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline struct LDKChannelCounterparty CResult_ChannelCounterpartyDecodeErrorZ_get_ok(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner){ - LDKChannelCounterparty ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -int64_t CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_get_ok(int64_t owner) { - LDKCResult_ChannelCounterpartyDecodeErrorZ* owner_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(owner); - LDKChannelCounterparty ret_var = CResult_ChannelCounterpartyDecodeErrorZ_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_ChannelCounterpartyDecodeErrorZ_get_err(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -int64_t CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_get_err(int64_t owner) { - LDKCResult_ChannelCounterpartyDecodeErrorZ* owner_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_ChannelCounterpartyDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline struct LDKChannelDetails CResult_ChannelDetailsDecodeErrorZ_get_ok(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner){ - LDKChannelDetails ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -int64_t CS_LDK_CResult_ChannelDetailsDecodeErrorZ_get_ok(int64_t owner) { - LDKCResult_ChannelDetailsDecodeErrorZ* owner_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(owner); - LDKChannelDetails ret_var = CResult_ChannelDetailsDecodeErrorZ_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_ChannelDetailsDecodeErrorZ_get_err(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -int64_t CS_LDK_CResult_ChannelDetailsDecodeErrorZ_get_err(int64_t owner) { - LDKCResult_ChannelDetailsDecodeErrorZ* owner_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_ChannelDetailsDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - static inline struct LDKPhantomRouteHints CResult_PhantomRouteHintsDecodeErrorZ_get_ok(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR owner){ LDKPhantomRouteHints ret = *owner->contents.result; ret.is_owned = false; @@ -6871,28 +6816,6 @@ int64_t CS_LDK_CResult_BlindedFailureDecodeErrorZ_get_err(int64_t owner) { return ret_ref; } -static inline enum LDKChannelShutdownState CResult_ChannelShutdownStateDecodeErrorZ_get_ok(LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return ChannelShutdownState_clone(&*owner->contents.result); -} -int32_t CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_get_ok(int64_t owner) { - LDKCResult_ChannelShutdownStateDecodeErrorZ* owner_conv = (LDKCResult_ChannelShutdownStateDecodeErrorZ*)untag_ptr(owner); - int32_t ret_conv = LDKChannelShutdownState_to_cs(CResult_ChannelShutdownStateDecodeErrorZ_get_ok(owner_conv)); - return ret_conv; -} - -static inline struct LDKDecodeError CResult_ChannelShutdownStateDecodeErrorZ_get_err(LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -int64_t CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_get_err(int64_t owner) { - LDKCResult_ChannelShutdownStateDecodeErrorZ* owner_conv = (LDKCResult_ChannelShutdownStateDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_ChannelShutdownStateDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - static inline LDKCVec_ChannelMonitorZ CVec_ChannelMonitorZ_clone(const LDKCVec_ChannelMonitorZ *orig) { LDKCVec_ChannelMonitorZ ret = { .data = MALLOC(sizeof(LDKChannelMonitor) * orig->datalen, "LDKCVec_ChannelMonitorZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -10838,6 +10761,262 @@ int64_t CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err(int64_t owner) 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) { + case LDKCOption_InboundHTLCStateDetailsZ_Some: return 0; + case LDKCOption_InboundHTLCStateDetailsZ_None: return 1; + default: abort(); + } +} +int32_t CS_LDK_LDKCOption_InboundHTLCStateDetailsZ_Some_get_some(int64_t ptr) { + LDKCOption_InboundHTLCStateDetailsZ *obj = (LDKCOption_InboundHTLCStateDetailsZ*)untag_ptr(ptr); + CHECK(obj->tag == LDKCOption_InboundHTLCStateDetailsZ_Some); + int32_t some_conv = LDKInboundHTLCStateDetails_to_cs(obj->some); + return some_conv; +} +static inline struct LDKCOption_InboundHTLCStateDetailsZ CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_get_ok(LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return COption_InboundHTLCStateDetailsZ_clone(&*owner->contents.result); +} +int64_t CS_LDK_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ* owner_conv = (LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ*)untag_ptr(owner); + LDKCOption_InboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_InboundHTLCStateDetailsZ), "LDKCOption_InboundHTLCStateDetailsZ"); + *ret_copy = CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_get_err(LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ* owner_conv = (LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKInboundHTLCDetails CResult_InboundHTLCDetailsDecodeErrorZ_get_ok(LDKCResult_InboundHTLCDetailsDecodeErrorZ *NONNULL_PTR owner){ + LDKInboundHTLCDetails ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_InboundHTLCDetailsDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_InboundHTLCDetailsDecodeErrorZ* owner_conv = (LDKCResult_InboundHTLCDetailsDecodeErrorZ*)untag_ptr(owner); + LDKInboundHTLCDetails ret_var = CResult_InboundHTLCDetailsDecodeErrorZ_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_InboundHTLCDetailsDecodeErrorZ_get_err(LDKCResult_InboundHTLCDetailsDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_InboundHTLCDetailsDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_InboundHTLCDetailsDecodeErrorZ* owner_conv = (LDKCResult_InboundHTLCDetailsDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_InboundHTLCDetailsDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint32_t CS_LDK_LDKCOption_OutboundHTLCStateDetailsZ_ty_from_ptr(int64_t ptr) { + LDKCOption_OutboundHTLCStateDetailsZ *obj = (LDKCOption_OutboundHTLCStateDetailsZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_OutboundHTLCStateDetailsZ_Some: return 0; + case LDKCOption_OutboundHTLCStateDetailsZ_None: return 1; + default: abort(); + } +} +int32_t CS_LDK_LDKCOption_OutboundHTLCStateDetailsZ_Some_get_some(int64_t ptr) { + LDKCOption_OutboundHTLCStateDetailsZ *obj = (LDKCOption_OutboundHTLCStateDetailsZ*)untag_ptr(ptr); + CHECK(obj->tag == LDKCOption_OutboundHTLCStateDetailsZ_Some); + int32_t some_conv = LDKOutboundHTLCStateDetails_to_cs(obj->some); + return some_conv; +} +static inline struct LDKCOption_OutboundHTLCStateDetailsZ CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_get_ok(LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return COption_OutboundHTLCStateDetailsZ_clone(&*owner->contents.result); +} +int64_t CS_LDK_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ* owner_conv = (LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ*)untag_ptr(owner); + LDKCOption_OutboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_OutboundHTLCStateDetailsZ), "LDKCOption_OutboundHTLCStateDetailsZ"); + *ret_copy = CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_get_err(LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ* owner_conv = (LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKOutboundHTLCDetails CResult_OutboundHTLCDetailsDecodeErrorZ_get_ok(LDKCResult_OutboundHTLCDetailsDecodeErrorZ *NONNULL_PTR owner){ + LDKOutboundHTLCDetails ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_OutboundHTLCDetailsDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_OutboundHTLCDetailsDecodeErrorZ* owner_conv = (LDKCResult_OutboundHTLCDetailsDecodeErrorZ*)untag_ptr(owner); + LDKOutboundHTLCDetails ret_var = CResult_OutboundHTLCDetailsDecodeErrorZ_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_OutboundHTLCDetailsDecodeErrorZ_get_err(LDKCResult_OutboundHTLCDetailsDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_OutboundHTLCDetailsDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_OutboundHTLCDetailsDecodeErrorZ* owner_conv = (LDKCResult_OutboundHTLCDetailsDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_OutboundHTLCDetailsDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKCounterpartyForwardingInfo CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner){ + LDKCounterpartyForwardingInfo ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(owner); + LDKCounterpartyForwardingInfo ret_var = CResult_CounterpartyForwardingInfoDecodeErrorZ_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_CounterpartyForwardingInfoDecodeErrorZ_get_err(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKChannelCounterparty CResult_ChannelCounterpartyDecodeErrorZ_get_ok(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner){ + LDKChannelCounterparty ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_ChannelCounterpartyDecodeErrorZ* owner_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(owner); + LDKChannelCounterparty ret_var = CResult_ChannelCounterpartyDecodeErrorZ_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_ChannelCounterpartyDecodeErrorZ_get_err(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_ChannelCounterpartyDecodeErrorZ* owner_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ChannelCounterpartyDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint32_t CS_LDK_LDKCOption_ChannelShutdownStateZ_ty_from_ptr(int64_t ptr) { + LDKCOption_ChannelShutdownStateZ *obj = (LDKCOption_ChannelShutdownStateZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_ChannelShutdownStateZ_Some: return 0; + case LDKCOption_ChannelShutdownStateZ_None: return 1; + default: abort(); + } +} +int32_t CS_LDK_LDKCOption_ChannelShutdownStateZ_Some_get_some(int64_t ptr) { + LDKCOption_ChannelShutdownStateZ *obj = (LDKCOption_ChannelShutdownStateZ*)untag_ptr(ptr); + CHECK(obj->tag == LDKCOption_ChannelShutdownStateZ_Some); + int32_t some_conv = LDKChannelShutdownState_to_cs(obj->some); + return some_conv; +} +static inline LDKCVec_InboundHTLCDetailsZ CVec_InboundHTLCDetailsZ_clone(const LDKCVec_InboundHTLCDetailsZ *orig) { + LDKCVec_InboundHTLCDetailsZ ret = { .data = MALLOC(sizeof(LDKInboundHTLCDetails) * orig->datalen, "LDKCVec_InboundHTLCDetailsZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = InboundHTLCDetails_clone(&orig->data[i]); + } + return ret; +} +static inline LDKCVec_OutboundHTLCDetailsZ CVec_OutboundHTLCDetailsZ_clone(const LDKCVec_OutboundHTLCDetailsZ *orig) { + LDKCVec_OutboundHTLCDetailsZ ret = { .data = MALLOC(sizeof(LDKOutboundHTLCDetails) * orig->datalen, "LDKCVec_OutboundHTLCDetailsZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = OutboundHTLCDetails_clone(&orig->data[i]); + } + return ret; +} +static inline struct LDKChannelDetails CResult_ChannelDetailsDecodeErrorZ_get_ok(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner){ + LDKChannelDetails ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_ChannelDetailsDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_ChannelDetailsDecodeErrorZ* owner_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(owner); + LDKChannelDetails ret_var = CResult_ChannelDetailsDecodeErrorZ_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_ChannelDetailsDecodeErrorZ_get_err(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_ChannelDetailsDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_ChannelDetailsDecodeErrorZ* owner_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ChannelDetailsDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline enum LDKChannelShutdownState CResult_ChannelShutdownStateDecodeErrorZ_get_ok(LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return ChannelShutdownState_clone(&*owner->contents.result); +} +int32_t CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_ChannelShutdownStateDecodeErrorZ* owner_conv = (LDKCResult_ChannelShutdownStateDecodeErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKChannelShutdownState_to_cs(CResult_ChannelShutdownStateDecodeErrorZ_get_ok(owner_conv)); + return ret_conv; +} + +static inline struct LDKDecodeError CResult_ChannelShutdownStateDecodeErrorZ_get_err(LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_ChannelShutdownStateDecodeErrorZ* owner_conv = (LDKCResult_ChannelShutdownStateDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ChannelShutdownStateDecodeErrorZ_get_err(owner_conv); + 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); @@ -24139,50 +24318,6 @@ int64_t CS_LDK_COption_C2Tuple_u64u16ZZ_clone(int64_t orig) { return ret_ref; } -int64_t CS_LDK_COption_ChannelShutdownStateZ_some(int32_t o) { - LDKChannelShutdownState o_conv = LDKChannelShutdownState_from_cs(o); - LDKCOption_ChannelShutdownStateZ *ret_copy = MALLOC(sizeof(LDKCOption_ChannelShutdownStateZ), "LDKCOption_ChannelShutdownStateZ"); - *ret_copy = COption_ChannelShutdownStateZ_some(o_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_COption_ChannelShutdownStateZ_none() { - LDKCOption_ChannelShutdownStateZ *ret_copy = MALLOC(sizeof(LDKCOption_ChannelShutdownStateZ), "LDKCOption_ChannelShutdownStateZ"); - *ret_copy = COption_ChannelShutdownStateZ_none(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -void CS_LDK_COption_ChannelShutdownStateZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCOption_ChannelShutdownStateZ _res_conv = *(LDKCOption_ChannelShutdownStateZ*)(_res_ptr); - FREE(untag_ptr(_res)); - COption_ChannelShutdownStateZ_free(_res_conv); -} - -static inline uint64_t COption_ChannelShutdownStateZ_clone_ptr(LDKCOption_ChannelShutdownStateZ *NONNULL_PTR arg) { - LDKCOption_ChannelShutdownStateZ *ret_copy = MALLOC(sizeof(LDKCOption_ChannelShutdownStateZ), "LDKCOption_ChannelShutdownStateZ"); - *ret_copy = COption_ChannelShutdownStateZ_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -int64_t CS_LDK_COption_ChannelShutdownStateZ_clone_ptr(int64_t arg) { - LDKCOption_ChannelShutdownStateZ* arg_conv = (LDKCOption_ChannelShutdownStateZ*)untag_ptr(arg); - int64_t ret_conv = COption_ChannelShutdownStateZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_COption_ChannelShutdownStateZ_clone(int64_t orig) { - LDKCOption_ChannelShutdownStateZ* orig_conv = (LDKCOption_ChannelShutdownStateZ*)untag_ptr(orig); - LDKCOption_ChannelShutdownStateZ *ret_copy = MALLOC(sizeof(LDKCOption_ChannelShutdownStateZ), "LDKCOption_ChannelShutdownStateZ"); - *ret_copy = COption_ChannelShutdownStateZ_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - int64_t CS_LDK_CResult_ChannelIdAPIErrorZ_ok(int64_t o) { LDKChannelId o_conv; o_conv.inner = untag_ptr(o); @@ -25020,168 +25155,6 @@ void CS_LDK_CVec_C3Tuple_OffersMessageDestinationBlindedPathZZ_free(int64_tArra CVec_C3Tuple_OffersMessageDestinationBlindedPathZZ_free(_res_constr); } -int64_t CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(int64_t o) { - LDKCounterpartyForwardingInfo o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = CounterpartyForwardingInfo_clone(&o_conv); - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); - *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_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_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); - *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -jboolean CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* o_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -void CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_CounterpartyForwardingInfoDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); - *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(int64_t orig) { - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(orig); - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); - *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_ok(int64_t o) { - LDKChannelCounterparty o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = ChannelCounterparty_clone(&o_conv); - LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); - *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_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_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); - *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -jboolean CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_ChannelCounterpartyDecodeErrorZ* o_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -void CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_ChannelCounterpartyDecodeErrorZ _res_conv = *(LDKCResult_ChannelCounterpartyDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_ChannelCounterpartyDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); - *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_ChannelCounterpartyDecodeErrorZ* arg_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_clone(int64_t orig) { - LDKCResult_ChannelCounterpartyDecodeErrorZ* orig_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(orig); - LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); - *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_ChannelDetailsDecodeErrorZ_ok(int64_t o) { - LDKChannelDetails o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = ChannelDetails_clone(&o_conv); - LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); - *ret_conv = CResult_ChannelDetailsDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_ChannelDetailsDecodeErrorZ_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_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); - *ret_conv = CResult_ChannelDetailsDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -jboolean CS_LDK_CResult_ChannelDetailsDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_ChannelDetailsDecodeErrorZ* o_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ChannelDetailsDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -void CS_LDK_CResult_ChannelDetailsDecodeErrorZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_ChannelDetailsDecodeErrorZ _res_conv = *(LDKCResult_ChannelDetailsDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_ChannelDetailsDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_ChannelDetailsDecodeErrorZ_clone_ptr(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); - *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t CS_LDK_CResult_ChannelDetailsDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_ChannelDetailsDecodeErrorZ* arg_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_CResult_ChannelDetailsDecodeErrorZ_clone(int64_t orig) { - LDKCResult_ChannelDetailsDecodeErrorZ* orig_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(orig); - LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); - *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - int64_t CS_LDK_CResult_PhantomRouteHintsDecodeErrorZ_ok(int64_t o) { LDKPhantomRouteHints o_conv; o_conv.inner = untag_ptr(o); @@ -25447,56 +25420,6 @@ int64_t CS_LDK_CResult_BlindedFailureDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_ok(int32_t o) { - LDKChannelShutdownState o_conv = LDKChannelShutdownState_from_cs(o); - LDKCResult_ChannelShutdownStateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelShutdownStateDecodeErrorZ), "LDKCResult_ChannelShutdownStateDecodeErrorZ"); - *ret_conv = CResult_ChannelShutdownStateDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_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_ChannelShutdownStateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelShutdownStateDecodeErrorZ), "LDKCResult_ChannelShutdownStateDecodeErrorZ"); - *ret_conv = CResult_ChannelShutdownStateDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -jboolean CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_ChannelShutdownStateDecodeErrorZ* o_conv = (LDKCResult_ChannelShutdownStateDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ChannelShutdownStateDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -void CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_ChannelShutdownStateDecodeErrorZ _res_conv = *(LDKCResult_ChannelShutdownStateDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_ChannelShutdownStateDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_ChannelShutdownStateDecodeErrorZ_clone_ptr(LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ChannelShutdownStateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelShutdownStateDecodeErrorZ), "LDKCResult_ChannelShutdownStateDecodeErrorZ"); - *ret_conv = CResult_ChannelShutdownStateDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_ChannelShutdownStateDecodeErrorZ* arg_conv = (LDKCResult_ChannelShutdownStateDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ChannelShutdownStateDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_clone(int64_t orig) { - LDKCResult_ChannelShutdownStateDecodeErrorZ* orig_conv = (LDKCResult_ChannelShutdownStateDecodeErrorZ*)untag_ptr(orig); - LDKCResult_ChannelShutdownStateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelShutdownStateDecodeErrorZ), "LDKCResult_ChannelShutdownStateDecodeErrorZ"); - *ret_conv = CResult_ChannelShutdownStateDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - void CS_LDK_CVec_ChannelMonitorZ_free(int64_tArray _res) { LDKCVec_ChannelMonitorZ _res_constr; _res_constr.datalen = _res->arr_len; @@ -30848,9704 +30771,10358 @@ int64_t CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -void CS_LDK_CVec_FutureZ_free(int64_tArray _res) { - LDKCVec_FutureZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKFuture), "LDKCVec_FutureZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = _res->elems; - for (size_t i = 0; i < _res_constr.datalen; i++) { - int64_t _res_conv_8 = _res_vals[i]; - LDKFuture _res_conv_8_conv; - _res_conv_8_conv.inner = untag_ptr(_res_conv_8); - _res_conv_8_conv.is_owned = ptr_is_owned(_res_conv_8); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_8_conv); - _res_constr.data[i] = _res_conv_8_conv; - } - FREE(_res); - CVec_FutureZ_free(_res_constr); -} - -int64_t CS_LDK_CResult_OffersMessageDecodeErrorZ_ok(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)); - LDKCResult_OffersMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersMessageDecodeErrorZ), "LDKCResult_OffersMessageDecodeErrorZ"); - *ret_conv = CResult_OffersMessageDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_OffersMessageDecodeErrorZ_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_OffersMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersMessageDecodeErrorZ), "LDKCResult_OffersMessageDecodeErrorZ"); - *ret_conv = CResult_OffersMessageDecodeErrorZ_err(e_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"); + *ret_copy = COption_InboundHTLCStateDetailsZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_CResult_OffersMessageDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_OffersMessageDecodeErrorZ* o_conv = (LDKCResult_OffersMessageDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_OffersMessageDecodeErrorZ_is_ok(o_conv); - return ret_conv; +int64_t CS_LDK_COption_InboundHTLCStateDetailsZ_none() { + LDKCOption_InboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_InboundHTLCStateDetailsZ), "LDKCOption_InboundHTLCStateDetailsZ"); + *ret_copy = COption_InboundHTLCStateDetailsZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_CResult_OffersMessageDecodeErrorZ_free(int64_t _res) { +void CS_LDK_COption_InboundHTLCStateDetailsZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_OffersMessageDecodeErrorZ _res_conv = *(LDKCResult_OffersMessageDecodeErrorZ*)(_res_ptr); + LDKCOption_InboundHTLCStateDetailsZ _res_conv = *(LDKCOption_InboundHTLCStateDetailsZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_OffersMessageDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_OffersMessageDecodeErrorZ_clone_ptr(LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_OffersMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersMessageDecodeErrorZ), "LDKCResult_OffersMessageDecodeErrorZ"); - *ret_conv = CResult_OffersMessageDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t CS_LDK_CResult_OffersMessageDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_OffersMessageDecodeErrorZ* arg_conv = (LDKCResult_OffersMessageDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_OffersMessageDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_CResult_OffersMessageDecodeErrorZ_clone(int64_t orig) { - LDKCResult_OffersMessageDecodeErrorZ* orig_conv = (LDKCResult_OffersMessageDecodeErrorZ*)untag_ptr(orig); - LDKCResult_OffersMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersMessageDecodeErrorZ), "LDKCResult_OffersMessageDecodeErrorZ"); - *ret_conv = CResult_OffersMessageDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); + COption_InboundHTLCStateDetailsZ_free(_res_conv); } -int64_t CS_LDK_COption_HTLCClaimZ_some(int32_t o) { - LDKHTLCClaim o_conv = LDKHTLCClaim_from_cs(o); - LDKCOption_HTLCClaimZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCClaimZ), "LDKCOption_HTLCClaimZ"); - *ret_copy = COption_HTLCClaimZ_some(o_conv); +static inline uint64_t COption_InboundHTLCStateDetailsZ_clone_ptr(LDKCOption_InboundHTLCStateDetailsZ *NONNULL_PTR arg) { + LDKCOption_InboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_InboundHTLCStateDetailsZ), "LDKCOption_InboundHTLCStateDetailsZ"); + *ret_copy = COption_InboundHTLCStateDetailsZ_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } +int64_t CS_LDK_COption_InboundHTLCStateDetailsZ_clone_ptr(int64_t arg) { + LDKCOption_InboundHTLCStateDetailsZ* arg_conv = (LDKCOption_InboundHTLCStateDetailsZ*)untag_ptr(arg); + int64_t ret_conv = COption_InboundHTLCStateDetailsZ_clone_ptr(arg_conv); + return ret_conv; +} -int64_t CS_LDK_COption_HTLCClaimZ_none() { - LDKCOption_HTLCClaimZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCClaimZ), "LDKCOption_HTLCClaimZ"); - *ret_copy = COption_HTLCClaimZ_none(); +int64_t CS_LDK_COption_InboundHTLCStateDetailsZ_clone(int64_t orig) { + LDKCOption_InboundHTLCStateDetailsZ* orig_conv = (LDKCOption_InboundHTLCStateDetailsZ*)untag_ptr(orig); + LDKCOption_InboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_InboundHTLCStateDetailsZ), "LDKCOption_InboundHTLCStateDetailsZ"); + *ret_copy = COption_InboundHTLCStateDetailsZ_clone(orig_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void CS_LDK_COption_HTLCClaimZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCOption_HTLCClaimZ _res_conv = *(LDKCOption_HTLCClaimZ*)(_res_ptr); - FREE(untag_ptr(_res)); - COption_HTLCClaimZ_free(_res_conv); -} - -int64_t CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(int64_t o) { - LDKCounterpartyCommitmentSecrets o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = CounterpartyCommitmentSecrets_clone(&o_conv); - LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ"); - *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKCOption_InboundHTLCStateDetailsZ o_conv = *(LDKCOption_InboundHTLCStateDetailsZ*)(o_ptr); + o_conv = COption_InboundHTLCStateDetailsZ_clone((LDKCOption_InboundHTLCStateDetailsZ*)untag_ptr(o)); + LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ), "LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ"); + *ret_conv = CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_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_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ"); - *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(e_conv); + LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ), "LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ"); + *ret_conv = CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* o_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ* o_conv = (LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)(_res_ptr); + LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ _res_conv = *(LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(_res_conv); + CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ"); - *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(arg); +static inline uint64_t CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_clone_ptr(LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ), "LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ"); + *ret_conv = CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ* arg_conv = (LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(int64_t orig) { - LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(orig); - LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ"); - *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_clone(int64_t orig) { + LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ* orig_conv = (LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ*)untag_ptr(orig); + LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ), "LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ"); + *ret_conv = CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_TxCreationKeysDecodeErrorZ_ok(int64_t o) { - LDKTxCreationKeys o_conv; +int64_t CS_LDK_CResult_InboundHTLCDetailsDecodeErrorZ_ok(int64_t o) { + LDKInboundHTLCDetails o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = TxCreationKeys_clone(&o_conv); - LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); - *ret_conv = CResult_TxCreationKeysDecodeErrorZ_ok(o_conv); + o_conv = InboundHTLCDetails_clone(&o_conv); + LDKCResult_InboundHTLCDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InboundHTLCDetailsDecodeErrorZ), "LDKCResult_InboundHTLCDetailsDecodeErrorZ"); + *ret_conv = CResult_InboundHTLCDetailsDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_TxCreationKeysDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_InboundHTLCDetailsDecodeErrorZ_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_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); - *ret_conv = CResult_TxCreationKeysDecodeErrorZ_err(e_conv); + LDKCResult_InboundHTLCDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InboundHTLCDetailsDecodeErrorZ), "LDKCResult_InboundHTLCDetailsDecodeErrorZ"); + *ret_conv = CResult_InboundHTLCDetailsDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_TxCreationKeysDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_TxCreationKeysDecodeErrorZ* o_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_TxCreationKeysDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_InboundHTLCDetailsDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_InboundHTLCDetailsDecodeErrorZ* o_conv = (LDKCResult_InboundHTLCDetailsDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InboundHTLCDetailsDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_TxCreationKeysDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_InboundHTLCDetailsDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_TxCreationKeysDecodeErrorZ _res_conv = *(LDKCResult_TxCreationKeysDecodeErrorZ*)(_res_ptr); + LDKCResult_InboundHTLCDetailsDecodeErrorZ _res_conv = *(LDKCResult_InboundHTLCDetailsDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_TxCreationKeysDecodeErrorZ_free(_res_conv); + CResult_InboundHTLCDetailsDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_TxCreationKeysDecodeErrorZ_clone_ptr(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); - *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(arg); +static inline uint64_t CResult_InboundHTLCDetailsDecodeErrorZ_clone_ptr(LDKCResult_InboundHTLCDetailsDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_InboundHTLCDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InboundHTLCDetailsDecodeErrorZ), "LDKCResult_InboundHTLCDetailsDecodeErrorZ"); + *ret_conv = CResult_InboundHTLCDetailsDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_TxCreationKeysDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_TxCreationKeysDecodeErrorZ* arg_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_InboundHTLCDetailsDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_InboundHTLCDetailsDecodeErrorZ* arg_conv = (LDKCResult_InboundHTLCDetailsDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_InboundHTLCDetailsDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_TxCreationKeysDecodeErrorZ_clone(int64_t orig) { - LDKCResult_TxCreationKeysDecodeErrorZ* orig_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(orig); - LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); - *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_ok(int64_t o) { - LDKChannelPublicKeys o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = ChannelPublicKeys_clone(&o_conv); - LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); - *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_InboundHTLCDetailsDecodeErrorZ_clone(int64_t orig) { + LDKCResult_InboundHTLCDetailsDecodeErrorZ* orig_conv = (LDKCResult_InboundHTLCDetailsDecodeErrorZ*)untag_ptr(orig); + LDKCResult_InboundHTLCDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InboundHTLCDetailsDecodeErrorZ), "LDKCResult_InboundHTLCDetailsDecodeErrorZ"); + *ret_conv = CResult_InboundHTLCDetailsDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_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_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); - *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_COption_OutboundHTLCStateDetailsZ_some(int32_t o) { + LDKOutboundHTLCStateDetails o_conv = LDKOutboundHTLCStateDetails_from_cs(o); + LDKCOption_OutboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_OutboundHTLCStateDetailsZ), "LDKCOption_OutboundHTLCStateDetailsZ"); + *ret_copy = COption_OutboundHTLCStateDetailsZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_ChannelPublicKeysDecodeErrorZ* o_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_is_ok(o_conv); - return ret_conv; +int64_t CS_LDK_COption_OutboundHTLCStateDetailsZ_none() { + LDKCOption_OutboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_OutboundHTLCStateDetailsZ), "LDKCOption_OutboundHTLCStateDetailsZ"); + *ret_copy = COption_OutboundHTLCStateDetailsZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_free(int64_t _res) { +void CS_LDK_COption_OutboundHTLCStateDetailsZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_ChannelPublicKeysDecodeErrorZ _res_conv = *(LDKCResult_ChannelPublicKeysDecodeErrorZ*)(_res_ptr); + LDKCOption_OutboundHTLCStateDetailsZ _res_conv = *(LDKCOption_OutboundHTLCStateDetailsZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_ChannelPublicKeysDecodeErrorZ_free(_res_conv); + COption_OutboundHTLCStateDetailsZ_free(_res_conv); } -static inline uint64_t CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); - *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); +static inline uint64_t COption_OutboundHTLCStateDetailsZ_clone_ptr(LDKCOption_OutboundHTLCStateDetailsZ *NONNULL_PTR arg) { + LDKCOption_OutboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_OutboundHTLCStateDetailsZ), "LDKCOption_OutboundHTLCStateDetailsZ"); + *ret_copy = COption_OutboundHTLCStateDetailsZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_ChannelPublicKeysDecodeErrorZ* arg_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_COption_OutboundHTLCStateDetailsZ_clone_ptr(int64_t arg) { + LDKCOption_OutboundHTLCStateDetailsZ* arg_conv = (LDKCOption_OutboundHTLCStateDetailsZ*)untag_ptr(arg); + int64_t ret_conv = COption_OutboundHTLCStateDetailsZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_clone(int64_t orig) { - LDKCResult_ChannelPublicKeysDecodeErrorZ* orig_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(orig); - LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); - *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_COption_OutboundHTLCStateDetailsZ_clone(int64_t orig) { + LDKCOption_OutboundHTLCStateDetailsZ* orig_conv = (LDKCOption_OutboundHTLCStateDetailsZ*)untag_ptr(orig); + LDKCOption_OutboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_OutboundHTLCStateDetailsZ), "LDKCOption_OutboundHTLCStateDetailsZ"); + *ret_copy = COption_OutboundHTLCStateDetailsZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(int64_t o) { - LDKHTLCOutputInCommitment o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = HTLCOutputInCommitment_clone(&o_conv); - LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); - *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKCOption_OutboundHTLCStateDetailsZ o_conv = *(LDKCOption_OutboundHTLCStateDetailsZ*)(o_ptr); + o_conv = COption_OutboundHTLCStateDetailsZ_clone((LDKCOption_OutboundHTLCStateDetailsZ*)untag_ptr(o)); + LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ), "LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ"); + *ret_conv = CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_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_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); - *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e_conv); + LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ), "LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ"); + *ret_conv = CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* o_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ* o_conv = (LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res_conv = *(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(_res_ptr); + LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ _res_conv = *(LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_HTLCOutputInCommitmentDecodeErrorZ_free(_res_conv); + CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); - *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(arg); +static inline uint64_t CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_clone_ptr(LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ), "LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ"); + *ret_conv = CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* arg_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ* arg_conv = (LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(int64_t orig) { - LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* orig_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(orig); - LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); - *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_clone(int64_t orig) { + LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ* orig_conv = (LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ*)untag_ptr(orig); + LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ), "LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ"); + *ret_conv = CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(int64_t o) { - LDKCounterpartyChannelTransactionParameters o_conv; +int64_t CS_LDK_CResult_OutboundHTLCDetailsDecodeErrorZ_ok(int64_t o) { + LDKOutboundHTLCDetails o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = CounterpartyChannelTransactionParameters_clone(&o_conv); - LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); - *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(o_conv); + o_conv = OutboundHTLCDetails_clone(&o_conv); + LDKCResult_OutboundHTLCDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutboundHTLCDetailsDecodeErrorZ), "LDKCResult_OutboundHTLCDetailsDecodeErrorZ"); + *ret_conv = CResult_OutboundHTLCDetailsDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_OutboundHTLCDetailsDecodeErrorZ_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_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); - *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e_conv); + LDKCResult_OutboundHTLCDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutboundHTLCDetailsDecodeErrorZ), "LDKCResult_OutboundHTLCDetailsDecodeErrorZ"); + *ret_conv = CResult_OutboundHTLCDetailsDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_OutboundHTLCDetailsDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_OutboundHTLCDetailsDecodeErrorZ* o_conv = (LDKCResult_OutboundHTLCDetailsDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OutboundHTLCDetailsDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_OutboundHTLCDetailsDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(_res_ptr); + LDKCResult_OutboundHTLCDetailsDecodeErrorZ _res_conv = *(LDKCResult_OutboundHTLCDetailsDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(_res_conv); + CResult_OutboundHTLCDetailsDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); - *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(arg); +static inline uint64_t CResult_OutboundHTLCDetailsDecodeErrorZ_clone_ptr(LDKCResult_OutboundHTLCDetailsDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OutboundHTLCDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutboundHTLCDetailsDecodeErrorZ), "LDKCResult_OutboundHTLCDetailsDecodeErrorZ"); + *ret_conv = CResult_OutboundHTLCDetailsDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_OutboundHTLCDetailsDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_OutboundHTLCDetailsDecodeErrorZ* arg_conv = (LDKCResult_OutboundHTLCDetailsDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OutboundHTLCDetailsDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(int64_t orig) { - LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(orig); - LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); - *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_OutboundHTLCDetailsDecodeErrorZ_clone(int64_t orig) { + LDKCResult_OutboundHTLCDetailsDecodeErrorZ* orig_conv = (LDKCResult_OutboundHTLCDetailsDecodeErrorZ*)untag_ptr(orig); + LDKCResult_OutboundHTLCDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutboundHTLCDetailsDecodeErrorZ), "LDKCResult_OutboundHTLCDetailsDecodeErrorZ"); + *ret_conv = CResult_OutboundHTLCDetailsDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_ok(int64_t o) { - LDKChannelTransactionParameters o_conv; +int64_t CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(int64_t o) { + LDKCounterpartyForwardingInfo o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = ChannelTransactionParameters_clone(&o_conv); - LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); - *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_ok(o_conv); + o_conv = CounterpartyForwardingInfo_clone(&o_conv); + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); + *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_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_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); - *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_err(e_conv); + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); + *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_ChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* o_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_ChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(_res_ptr); + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_ChannelTransactionParametersDecodeErrorZ_free(_res_conv); + CResult_CounterpartyForwardingInfoDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); - *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(arg); +static inline uint64_t CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); + *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_ChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_clone(int64_t orig) { - LDKCResult_ChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(orig); - LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); - *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(int64_t orig) { + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(orig); + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); + *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_ok(int64_t o) { - LDKHolderCommitmentTransaction o_conv; +int64_t CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_ok(int64_t o) { + LDKChannelCounterparty o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = HolderCommitmentTransaction_clone(&o_conv); - LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); - *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_ok(o_conv); + o_conv = ChannelCounterparty_clone(&o_conv); + LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); + *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_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_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); - *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_err(e_conv); + LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); + *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_HolderCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_ChannelCounterpartyDecodeErrorZ* o_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(_res_ptr); + LDKCResult_ChannelCounterpartyDecodeErrorZ _res_conv = *(LDKCResult_ChannelCounterpartyDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_HolderCommitmentTransactionDecodeErrorZ_free(_res_conv); + CResult_ChannelCounterpartyDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); - *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(arg); +static inline uint64_t CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); + *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_HolderCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_ChannelCounterpartyDecodeErrorZ* arg_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_clone(int64_t orig) { - LDKCResult_HolderCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(orig); - LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); - *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(int64_t o) { - LDKBuiltCommitmentTransaction o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = BuiltCommitmentTransaction_clone(&o_conv); - LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); - *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_clone(int64_t orig) { + LDKCResult_ChannelCounterpartyDecodeErrorZ* orig_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); + *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_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_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); - *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_COption_ChannelShutdownStateZ_some(int32_t o) { + LDKChannelShutdownState o_conv = LDKChannelShutdownState_from_cs(o); + LDKCOption_ChannelShutdownStateZ *ret_copy = MALLOC(sizeof(LDKCOption_ChannelShutdownStateZ), "LDKCOption_ChannelShutdownStateZ"); + *ret_copy = COption_ChannelShutdownStateZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(o_conv); - return ret_conv; +int64_t CS_LDK_COption_ChannelShutdownStateZ_none() { + LDKCOption_ChannelShutdownStateZ *ret_copy = MALLOC(sizeof(LDKCOption_ChannelShutdownStateZ), "LDKCOption_ChannelShutdownStateZ"); + *ret_copy = COption_ChannelShutdownStateZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_free(int64_t _res) { +void CS_LDK_COption_ChannelShutdownStateZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(_res_ptr); + LDKCOption_ChannelShutdownStateZ _res_conv = *(LDKCOption_ChannelShutdownStateZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_BuiltCommitmentTransactionDecodeErrorZ_free(_res_conv); + COption_ChannelShutdownStateZ_free(_res_conv); } -static inline uint64_t CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); - *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); +static inline uint64_t COption_ChannelShutdownStateZ_clone_ptr(LDKCOption_ChannelShutdownStateZ *NONNULL_PTR arg) { + LDKCOption_ChannelShutdownStateZ *ret_copy = MALLOC(sizeof(LDKCOption_ChannelShutdownStateZ), "LDKCOption_ChannelShutdownStateZ"); + *ret_copy = COption_ChannelShutdownStateZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_COption_ChannelShutdownStateZ_clone_ptr(int64_t arg) { + LDKCOption_ChannelShutdownStateZ* arg_conv = (LDKCOption_ChannelShutdownStateZ*)untag_ptr(arg); + int64_t ret_conv = COption_ChannelShutdownStateZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(int64_t orig) { - LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(orig); - LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); - *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_TrustedClosingTransactionNoneZ_ok(int64_t o) { - LDKTrustedClosingTransaction o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - // WARNING: we need a move here but no clone is available for LDKTrustedClosingTransaction - - LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ"); - *ret_conv = CResult_TrustedClosingTransactionNoneZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_TrustedClosingTransactionNoneZ_err() { - LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ"); - *ret_conv = CResult_TrustedClosingTransactionNoneZ_err(); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_COption_ChannelShutdownStateZ_clone(int64_t orig) { + LDKCOption_ChannelShutdownStateZ* orig_conv = (LDKCOption_ChannelShutdownStateZ*)untag_ptr(orig); + LDKCOption_ChannelShutdownStateZ *ret_copy = MALLOC(sizeof(LDKCOption_ChannelShutdownStateZ), "LDKCOption_ChannelShutdownStateZ"); + *ret_copy = COption_ChannelShutdownStateZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_CResult_TrustedClosingTransactionNoneZ_is_ok(int64_t o) { - LDKCResult_TrustedClosingTransactionNoneZ* o_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_TrustedClosingTransactionNoneZ_is_ok(o_conv); - return ret_conv; +void CS_LDK_CVec_InboundHTLCDetailsZ_free(int64_tArray _res) { + LDKCVec_InboundHTLCDetailsZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKInboundHTLCDetails), "LDKCVec_InboundHTLCDetailsZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = _res->elems; + for (size_t u = 0; u < _res_constr.datalen; u++) { + int64_t _res_conv_20 = _res_vals[u]; + LDKInboundHTLCDetails _res_conv_20_conv; + _res_conv_20_conv.inner = untag_ptr(_res_conv_20); + _res_conv_20_conv.is_owned = ptr_is_owned(_res_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_20_conv); + _res_constr.data[u] = _res_conv_20_conv; + } + FREE(_res); + CVec_InboundHTLCDetailsZ_free(_res_constr); } -void CS_LDK_CResult_TrustedClosingTransactionNoneZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_TrustedClosingTransactionNoneZ _res_conv = *(LDKCResult_TrustedClosingTransactionNoneZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_TrustedClosingTransactionNoneZ_free(_res_conv); +void CS_LDK_CVec_OutboundHTLCDetailsZ_free(int64_tArray _res) { + LDKCVec_OutboundHTLCDetailsZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKOutboundHTLCDetails), "LDKCVec_OutboundHTLCDetailsZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = _res->elems; + for (size_t v = 0; v < _res_constr.datalen; v++) { + int64_t _res_conv_21 = _res_vals[v]; + LDKOutboundHTLCDetails _res_conv_21_conv; + _res_conv_21_conv.inner = untag_ptr(_res_conv_21); + _res_conv_21_conv.is_owned = ptr_is_owned(_res_conv_21); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_21_conv); + _res_constr.data[v] = _res_conv_21_conv; + } + FREE(_res); + CVec_OutboundHTLCDetailsZ_free(_res_constr); } -int64_t CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_ok(int64_t o) { - LDKCommitmentTransaction o_conv; +int64_t CS_LDK_CResult_ChannelDetailsDecodeErrorZ_ok(int64_t o) { + LDKChannelDetails o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = CommitmentTransaction_clone(&o_conv); - LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); - *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_ok(o_conv); + o_conv = ChannelDetails_clone(&o_conv); + LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); + *ret_conv = CResult_ChannelDetailsDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_ChannelDetailsDecodeErrorZ_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_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); - *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_err(e_conv); + LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); + *ret_conv = CResult_ChannelDetailsDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_CommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_CommitmentTransactionDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_ChannelDetailsDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_ChannelDetailsDecodeErrorZ* o_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ChannelDetailsDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_ChannelDetailsDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_CommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_CommitmentTransactionDecodeErrorZ*)(_res_ptr); + LDKCResult_ChannelDetailsDecodeErrorZ _res_conv = *(LDKCResult_ChannelDetailsDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_CommitmentTransactionDecodeErrorZ_free(_res_conv); + CResult_ChannelDetailsDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); - *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(arg); +static inline uint64_t CResult_ChannelDetailsDecodeErrorZ_clone_ptr(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); + *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_CommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_ChannelDetailsDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_ChannelDetailsDecodeErrorZ* arg_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_clone(int64_t orig) { - LDKCResult_CommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(orig); - LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); - *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_ChannelDetailsDecodeErrorZ_clone(int64_t orig) { + LDKCResult_ChannelDetailsDecodeErrorZ* orig_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); + *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_TrustedCommitmentTransactionNoneZ_ok(int64_t o) { - LDKTrustedCommitmentTransaction o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - // WARNING: we need a move here but no clone is available for LDKTrustedCommitmentTransaction - - LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ"); - *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_ok(o_conv); +int64_t CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_ok(int32_t o) { + LDKChannelShutdownState o_conv = LDKChannelShutdownState_from_cs(o); + LDKCResult_ChannelShutdownStateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelShutdownStateDecodeErrorZ), "LDKCResult_ChannelShutdownStateDecodeErrorZ"); + *ret_conv = CResult_ChannelShutdownStateDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_TrustedCommitmentTransactionNoneZ_err() { - LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ"); - *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_err(); +int64_t CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_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_ChannelShutdownStateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelShutdownStateDecodeErrorZ), "LDKCResult_ChannelShutdownStateDecodeErrorZ"); + *ret_conv = CResult_ChannelShutdownStateDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_TrustedCommitmentTransactionNoneZ_is_ok(int64_t o) { - LDKCResult_TrustedCommitmentTransactionNoneZ* o_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_TrustedCommitmentTransactionNoneZ_is_ok(o_conv); +jboolean CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_ChannelShutdownStateDecodeErrorZ* o_conv = (LDKCResult_ChannelShutdownStateDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ChannelShutdownStateDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_TrustedCommitmentTransactionNoneZ_free(int64_t _res) { +void CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_TrustedCommitmentTransactionNoneZ _res_conv = *(LDKCResult_TrustedCommitmentTransactionNoneZ*)(_res_ptr); + LDKCResult_ChannelShutdownStateDecodeErrorZ _res_conv = *(LDKCResult_ChannelShutdownStateDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_TrustedCommitmentTransactionNoneZ_free(_res_conv); + CResult_ChannelShutdownStateDecodeErrorZ_free(_res_conv); } -int64_t CS_LDK_CResult_CVec_ECDSASignatureZNoneZ_ok(ptrArray o) { - LDKCVec_ECDSASignatureZ o_constr; - o_constr.datalen = o->arr_len; - if (o_constr.datalen > 0) - o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKECDSASignature), "LDKCVec_ECDSASignatureZ Elements"); +static inline uint64_t CResult_ChannelShutdownStateDecodeErrorZ_clone_ptr(LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelShutdownStateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelShutdownStateDecodeErrorZ), "LDKCResult_ChannelShutdownStateDecodeErrorZ"); + *ret_conv = CResult_ChannelShutdownStateDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_ChannelShutdownStateDecodeErrorZ* arg_conv = (LDKCResult_ChannelShutdownStateDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ChannelShutdownStateDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_clone(int64_t orig) { + LDKCResult_ChannelShutdownStateDecodeErrorZ* orig_conv = (LDKCResult_ChannelShutdownStateDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ChannelShutdownStateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelShutdownStateDecodeErrorZ), "LDKCResult_ChannelShutdownStateDecodeErrorZ"); + *ret_conv = CResult_ChannelShutdownStateDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_CVec_FutureZ_free(int64_tArray _res) { + LDKCVec_FutureZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKFuture), "LDKCVec_FutureZ Elements"); else - o_constr.data = NULL; - int8_tArray* o_vals = (void*) o->elems; - for (size_t i = 0; i < o_constr.datalen; i++) { - int8_tArray o_conv_8 = o_vals[i]; - LDKECDSASignature o_conv_8_ref; - CHECK(o_conv_8->arr_len == 64); - memcpy(o_conv_8_ref.compact_form, o_conv_8->elems, 64); FREE(o_conv_8); - o_constr.data[i] = o_conv_8_ref; + _res_constr.data = NULL; + int64_t* _res_vals = _res->elems; + for (size_t i = 0; i < _res_constr.datalen; i++) { + int64_t _res_conv_8 = _res_vals[i]; + LDKFuture _res_conv_8_conv; + _res_conv_8_conv.inner = untag_ptr(_res_conv_8); + _res_conv_8_conv.is_owned = ptr_is_owned(_res_conv_8); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_8_conv); + _res_constr.data[i] = _res_conv_8_conv; } - FREE(o); - LDKCResult_CVec_ECDSASignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_ECDSASignatureZNoneZ), "LDKCResult_CVec_ECDSASignatureZNoneZ"); - *ret_conv = CResult_CVec_ECDSASignatureZNoneZ_ok(o_constr); + FREE(_res); + CVec_FutureZ_free(_res_constr); +} + +int64_t CS_LDK_CResult_OffersMessageDecodeErrorZ_ok(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)); + LDKCResult_OffersMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersMessageDecodeErrorZ), "LDKCResult_OffersMessageDecodeErrorZ"); + *ret_conv = CResult_OffersMessageDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_CVec_ECDSASignatureZNoneZ_err() { - LDKCResult_CVec_ECDSASignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_ECDSASignatureZNoneZ), "LDKCResult_CVec_ECDSASignatureZNoneZ"); - *ret_conv = CResult_CVec_ECDSASignatureZNoneZ_err(); +int64_t CS_LDK_CResult_OffersMessageDecodeErrorZ_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_OffersMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersMessageDecodeErrorZ), "LDKCResult_OffersMessageDecodeErrorZ"); + *ret_conv = CResult_OffersMessageDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_CVec_ECDSASignatureZNoneZ_is_ok(int64_t o) { - LDKCResult_CVec_ECDSASignatureZNoneZ* o_conv = (LDKCResult_CVec_ECDSASignatureZNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_CVec_ECDSASignatureZNoneZ_is_ok(o_conv); +jboolean CS_LDK_CResult_OffersMessageDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_OffersMessageDecodeErrorZ* o_conv = (LDKCResult_OffersMessageDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OffersMessageDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_CVec_ECDSASignatureZNoneZ_free(int64_t _res) { +void CS_LDK_CResult_OffersMessageDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_CVec_ECDSASignatureZNoneZ _res_conv = *(LDKCResult_CVec_ECDSASignatureZNoneZ*)(_res_ptr); + LDKCResult_OffersMessageDecodeErrorZ _res_conv = *(LDKCResult_OffersMessageDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_CVec_ECDSASignatureZNoneZ_free(_res_conv); + CResult_OffersMessageDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_CVec_ECDSASignatureZNoneZ_clone_ptr(LDKCResult_CVec_ECDSASignatureZNoneZ *NONNULL_PTR arg) { - LDKCResult_CVec_ECDSASignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_ECDSASignatureZNoneZ), "LDKCResult_CVec_ECDSASignatureZNoneZ"); - *ret_conv = CResult_CVec_ECDSASignatureZNoneZ_clone(arg); +static inline uint64_t CResult_OffersMessageDecodeErrorZ_clone_ptr(LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OffersMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersMessageDecodeErrorZ), "LDKCResult_OffersMessageDecodeErrorZ"); + *ret_conv = CResult_OffersMessageDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_CVec_ECDSASignatureZNoneZ_clone_ptr(int64_t arg) { - LDKCResult_CVec_ECDSASignatureZNoneZ* arg_conv = (LDKCResult_CVec_ECDSASignatureZNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_CVec_ECDSASignatureZNoneZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_OffersMessageDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_OffersMessageDecodeErrorZ* arg_conv = (LDKCResult_OffersMessageDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OffersMessageDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_CVec_ECDSASignatureZNoneZ_clone(int64_t orig) { - LDKCResult_CVec_ECDSASignatureZNoneZ* orig_conv = (LDKCResult_CVec_ECDSASignatureZNoneZ*)untag_ptr(orig); - LDKCResult_CVec_ECDSASignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_ECDSASignatureZNoneZ), "LDKCResult_CVec_ECDSASignatureZNoneZ"); - *ret_conv = CResult_CVec_ECDSASignatureZNoneZ_clone(orig_conv); +int64_t CS_LDK_CResult_OffersMessageDecodeErrorZ_clone(int64_t orig) { + LDKCResult_OffersMessageDecodeErrorZ* orig_conv = (LDKCResult_OffersMessageDecodeErrorZ*)untag_ptr(orig); + LDKCResult_OffersMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersMessageDecodeErrorZ), "LDKCResult_OffersMessageDecodeErrorZ"); + *ret_conv = CResult_OffersMessageDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_COption_usizeZ_some(int64_t o) { - LDKCOption_usizeZ *ret_copy = MALLOC(sizeof(LDKCOption_usizeZ), "LDKCOption_usizeZ"); - *ret_copy = COption_usizeZ_some(o); +int64_t CS_LDK_COption_HTLCClaimZ_some(int32_t o) { + LDKHTLCClaim o_conv = LDKHTLCClaim_from_cs(o); + LDKCOption_HTLCClaimZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCClaimZ), "LDKCOption_HTLCClaimZ"); + *ret_copy = COption_HTLCClaimZ_some(o_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_COption_usizeZ_none() { - LDKCOption_usizeZ *ret_copy = MALLOC(sizeof(LDKCOption_usizeZ), "LDKCOption_usizeZ"); - *ret_copy = COption_usizeZ_none(); +int64_t CS_LDK_COption_HTLCClaimZ_none() { + LDKCOption_HTLCClaimZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCClaimZ), "LDKCOption_HTLCClaimZ"); + *ret_copy = COption_HTLCClaimZ_none(); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void CS_LDK_COption_usizeZ_free(int64_t _res) { +void CS_LDK_COption_HTLCClaimZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCOption_usizeZ _res_conv = *(LDKCOption_usizeZ*)(_res_ptr); + LDKCOption_HTLCClaimZ _res_conv = *(LDKCOption_HTLCClaimZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_usizeZ_free(_res_conv); -} - -static inline uint64_t COption_usizeZ_clone_ptr(LDKCOption_usizeZ *NONNULL_PTR arg) { - LDKCOption_usizeZ *ret_copy = MALLOC(sizeof(LDKCOption_usizeZ), "LDKCOption_usizeZ"); - *ret_copy = COption_usizeZ_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -int64_t CS_LDK_COption_usizeZ_clone_ptr(int64_t arg) { - LDKCOption_usizeZ* arg_conv = (LDKCOption_usizeZ*)untag_ptr(arg); - int64_t ret_conv = COption_usizeZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_COption_usizeZ_clone(int64_t orig) { - LDKCOption_usizeZ* orig_conv = (LDKCOption_usizeZ*)untag_ptr(orig); - LDKCOption_usizeZ *ret_copy = MALLOC(sizeof(LDKCOption_usizeZ), "LDKCOption_usizeZ"); - *ret_copy = COption_usizeZ_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + COption_HTLCClaimZ_free(_res_conv); } -int64_t CS_LDK_CResult_ShutdownScriptDecodeErrorZ_ok(int64_t o) { - LDKShutdownScript o_conv; +int64_t CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(int64_t o) { + LDKCounterpartyCommitmentSecrets o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = ShutdownScript_clone(&o_conv); - LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); - *ret_conv = CResult_ShutdownScriptDecodeErrorZ_ok(o_conv); + o_conv = CounterpartyCommitmentSecrets_clone(&o_conv); + LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ"); + *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ShutdownScriptDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_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_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); - *ret_conv = CResult_ShutdownScriptDecodeErrorZ_err(e_conv); + LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ"); + *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_ShutdownScriptDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_ShutdownScriptDecodeErrorZ* o_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ShutdownScriptDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* o_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_ShutdownScriptDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_ShutdownScriptDecodeErrorZ _res_conv = *(LDKCResult_ShutdownScriptDecodeErrorZ*)(_res_ptr); + LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_ShutdownScriptDecodeErrorZ_free(_res_conv); + CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_ShutdownScriptDecodeErrorZ_clone_ptr(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); - *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(arg); +static inline uint64_t CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ"); + *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ShutdownScriptDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_ShutdownScriptDecodeErrorZ* arg_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_ShutdownScriptDecodeErrorZ_clone(int64_t orig) { - LDKCResult_ShutdownScriptDecodeErrorZ* orig_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(orig); - LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); - *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(int64_t orig) { + LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(orig); + LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ"); + *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_ok(int64_t o) { - LDKShutdownScript o_conv; +int64_t CS_LDK_CResult_TxCreationKeysDecodeErrorZ_ok(int64_t o) { + LDKTxCreationKeys o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = ShutdownScript_clone(&o_conv); - LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); - *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_ok(o_conv); + o_conv = TxCreationKeys_clone(&o_conv); + LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); + *ret_conv = CResult_TxCreationKeysDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_err(int64_t e) { - LDKInvalidShutdownScript e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = InvalidShutdownScript_clone(&e_conv); - LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); - *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_err(e_conv); +int64_t CS_LDK_CResult_TxCreationKeysDecodeErrorZ_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_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); + *ret_conv = CResult_TxCreationKeysDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(int64_t o) { - LDKCResult_ShutdownScriptInvalidShutdownScriptZ* o_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(o); - jboolean ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(o_conv); +jboolean CS_LDK_CResult_TxCreationKeysDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_TxCreationKeysDecodeErrorZ* o_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_TxCreationKeysDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_free(int64_t _res) { +void CS_LDK_CResult_TxCreationKeysDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res_conv = *(LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(_res_ptr); + LDKCResult_TxCreationKeysDecodeErrorZ _res_conv = *(LDKCResult_TxCreationKeysDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_ShutdownScriptInvalidShutdownScriptZ_free(_res_conv); + CResult_TxCreationKeysDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR arg) { - LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); - *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(arg); +static inline uint64_t CResult_TxCreationKeysDecodeErrorZ_clone_ptr(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); + *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(int64_t arg) { - LDKCResult_ShutdownScriptInvalidShutdownScriptZ* arg_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_TxCreationKeysDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_TxCreationKeysDecodeErrorZ* arg_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_clone(int64_t orig) { - LDKCResult_ShutdownScriptInvalidShutdownScriptZ* orig_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(orig); - LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); - *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(orig_conv); +int64_t CS_LDK_CResult_TxCreationKeysDecodeErrorZ_clone(int64_t orig) { + LDKCResult_TxCreationKeysDecodeErrorZ* orig_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(orig); + LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); + *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -void CS_LDK_CVec_TransactionZ_free(ptrArray _res) { - LDKCVec_TransactionZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTransaction), "LDKCVec_TransactionZ Elements"); - else - _res_constr.data = NULL; - int8_tArray* _res_vals = (void*) _res->elems; - for (size_t i = 0; i < _res_constr.datalen; i++) { - int8_tArray _res_conv_8 = _res_vals[i]; - LDKTransaction _res_conv_8_ref; - _res_conv_8_ref.datalen = _res_conv_8->arr_len; - _res_conv_8_ref.data = MALLOC(_res_conv_8_ref.datalen, "LDKTransaction Bytes"); - memcpy(_res_conv_8_ref.data, _res_conv_8->elems, _res_conv_8_ref.datalen); FREE(_res_conv_8); - _res_conv_8_ref.data_is_owned = true; - _res_constr.data[i] = _res_conv_8_ref; - } - FREE(_res); - CVec_TransactionZ_free(_res_constr); -} - -int64_t CS_LDK_CResult_PaymentPurposeDecodeErrorZ_ok(int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKPaymentPurpose o_conv = *(LDKPaymentPurpose*)(o_ptr); - o_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(o)); - LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); - *ret_conv = CResult_PaymentPurposeDecodeErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_ok(int64_t o) { + LDKChannelPublicKeys o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = ChannelPublicKeys_clone(&o_conv); + LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); + *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PaymentPurposeDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_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_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); - *ret_conv = CResult_PaymentPurposeDecodeErrorZ_err(e_conv); + LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); + *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_PaymentPurposeDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_PaymentPurposeDecodeErrorZ* o_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_PaymentPurposeDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_ChannelPublicKeysDecodeErrorZ* o_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_PaymentPurposeDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_PaymentPurposeDecodeErrorZ _res_conv = *(LDKCResult_PaymentPurposeDecodeErrorZ*)(_res_ptr); + LDKCResult_ChannelPublicKeysDecodeErrorZ _res_conv = *(LDKCResult_ChannelPublicKeysDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_PaymentPurposeDecodeErrorZ_free(_res_conv); + CResult_ChannelPublicKeysDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_PaymentPurposeDecodeErrorZ_clone_ptr(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); - *ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone(arg); +static inline uint64_t CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); + *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PaymentPurposeDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_PaymentPurposeDecodeErrorZ* arg_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_ChannelPublicKeysDecodeErrorZ* arg_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_PaymentPurposeDecodeErrorZ_clone(int64_t orig) { - LDKCResult_PaymentPurposeDecodeErrorZ* orig_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(orig); - LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); - *ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_clone(int64_t orig) { + LDKCResult_ChannelPublicKeysDecodeErrorZ* orig_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); + *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ClaimedHTLCDecodeErrorZ_ok(int64_t o) { - LDKClaimedHTLC o_conv; +int64_t CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(int64_t o) { + LDKHTLCOutputInCommitment o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = ClaimedHTLC_clone(&o_conv); - LDKCResult_ClaimedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClaimedHTLCDecodeErrorZ), "LDKCResult_ClaimedHTLCDecodeErrorZ"); - *ret_conv = CResult_ClaimedHTLCDecodeErrorZ_ok(o_conv); + o_conv = HTLCOutputInCommitment_clone(&o_conv); + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); + *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ClaimedHTLCDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_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_ClaimedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClaimedHTLCDecodeErrorZ), "LDKCResult_ClaimedHTLCDecodeErrorZ"); - *ret_conv = CResult_ClaimedHTLCDecodeErrorZ_err(e_conv); + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); + *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_ClaimedHTLCDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_ClaimedHTLCDecodeErrorZ* o_conv = (LDKCResult_ClaimedHTLCDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ClaimedHTLCDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* o_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_ClaimedHTLCDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_ClaimedHTLCDecodeErrorZ _res_conv = *(LDKCResult_ClaimedHTLCDecodeErrorZ*)(_res_ptr); + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res_conv = *(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_ClaimedHTLCDecodeErrorZ_free(_res_conv); + CResult_HTLCOutputInCommitmentDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_ClaimedHTLCDecodeErrorZ_clone_ptr(LDKCResult_ClaimedHTLCDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ClaimedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClaimedHTLCDecodeErrorZ), "LDKCResult_ClaimedHTLCDecodeErrorZ"); - *ret_conv = CResult_ClaimedHTLCDecodeErrorZ_clone(arg); +static inline uint64_t CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); + *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ClaimedHTLCDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_ClaimedHTLCDecodeErrorZ* arg_conv = (LDKCResult_ClaimedHTLCDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ClaimedHTLCDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* arg_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_ClaimedHTLCDecodeErrorZ_clone(int64_t orig) { - LDKCResult_ClaimedHTLCDecodeErrorZ* orig_conv = (LDKCResult_ClaimedHTLCDecodeErrorZ*)untag_ptr(orig); - LDKCResult_ClaimedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClaimedHTLCDecodeErrorZ), "LDKCResult_ClaimedHTLCDecodeErrorZ"); - *ret_conv = CResult_ClaimedHTLCDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(int64_t orig) { + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* orig_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(orig); + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); + *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_COption_PathFailureZ_some(int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKPathFailure o_conv = *(LDKPathFailure*)(o_ptr); - o_conv = PathFailure_clone((LDKPathFailure*)untag_ptr(o)); - LDKCOption_PathFailureZ *ret_copy = MALLOC(sizeof(LDKCOption_PathFailureZ), "LDKCOption_PathFailureZ"); - *ret_copy = COption_PathFailureZ_some(o_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(int64_t o) { + LDKCounterpartyChannelTransactionParameters o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = CounterpartyChannelTransactionParameters_clone(&o_conv); + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); + *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_COption_PathFailureZ_none() { - LDKCOption_PathFailureZ *ret_copy = MALLOC(sizeof(LDKCOption_PathFailureZ), "LDKCOption_PathFailureZ"); - *ret_copy = COption_PathFailureZ_none(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_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_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); + *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -void CS_LDK_COption_PathFailureZ_free(int64_t _res) { +jboolean CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCOption_PathFailureZ _res_conv = *(LDKCOption_PathFailureZ*)(_res_ptr); + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_PathFailureZ_free(_res_conv); + CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(_res_conv); } -static inline uint64_t COption_PathFailureZ_clone_ptr(LDKCOption_PathFailureZ *NONNULL_PTR arg) { - LDKCOption_PathFailureZ *ret_copy = MALLOC(sizeof(LDKCOption_PathFailureZ), "LDKCOption_PathFailureZ"); - *ret_copy = COption_PathFailureZ_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +static inline uint64_t CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); + *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_COption_PathFailureZ_clone_ptr(int64_t arg) { - LDKCOption_PathFailureZ* arg_conv = (LDKCOption_PathFailureZ*)untag_ptr(arg); - int64_t ret_conv = COption_PathFailureZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_COption_PathFailureZ_clone(int64_t orig) { - LDKCOption_PathFailureZ* orig_conv = (LDKCOption_PathFailureZ*)untag_ptr(orig); - LDKCOption_PathFailureZ *ret_copy = MALLOC(sizeof(LDKCOption_PathFailureZ), "LDKCOption_PathFailureZ"); - *ret_copy = COption_PathFailureZ_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(int64_t orig) { + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(orig); + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); + *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_COption_PathFailureZDecodeErrorZ_ok(int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKCOption_PathFailureZ o_conv = *(LDKCOption_PathFailureZ*)(o_ptr); - o_conv = COption_PathFailureZ_clone((LDKCOption_PathFailureZ*)untag_ptr(o)); - LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ"); - *ret_conv = CResult_COption_PathFailureZDecodeErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_ok(int64_t o) { + LDKChannelTransactionParameters o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = ChannelTransactionParameters_clone(&o_conv); + LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); + *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_COption_PathFailureZDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_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_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ"); - *ret_conv = CResult_COption_PathFailureZDecodeErrorZ_err(e_conv); + LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); + *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_COption_PathFailureZDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_COption_PathFailureZDecodeErrorZ* o_conv = (LDKCResult_COption_PathFailureZDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_COption_PathFailureZDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_ChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_COption_PathFailureZDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_COption_PathFailureZDecodeErrorZ _res_conv = *(LDKCResult_COption_PathFailureZDecodeErrorZ*)(_res_ptr); + LDKCResult_ChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_COption_PathFailureZDecodeErrorZ_free(_res_conv); + CResult_ChannelTransactionParametersDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_COption_PathFailureZDecodeErrorZ_clone_ptr(LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ"); - *ret_conv = CResult_COption_PathFailureZDecodeErrorZ_clone(arg); +static inline uint64_t CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); + *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_COption_PathFailureZDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_COption_PathFailureZDecodeErrorZ* arg_conv = (LDKCResult_COption_PathFailureZDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_COption_PathFailureZDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_ChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_COption_PathFailureZDecodeErrorZ_clone(int64_t orig) { - LDKCResult_COption_PathFailureZDecodeErrorZ* orig_conv = (LDKCResult_COption_PathFailureZDecodeErrorZ*)untag_ptr(orig); - LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ"); - *ret_conv = CResult_COption_PathFailureZDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_clone(int64_t orig) { + LDKCResult_ChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); + *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_COption_ClosureReasonZ_some(int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKClosureReason o_conv = *(LDKClosureReason*)(o_ptr); - o_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(o)); - LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); - *ret_copy = COption_ClosureReasonZ_some(o_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_ok(int64_t o) { + LDKHolderCommitmentTransaction o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = HolderCommitmentTransaction_clone(&o_conv); + LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_COption_ClosureReasonZ_none() { - LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); - *ret_copy = COption_ClosureReasonZ_none(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_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_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -void CS_LDK_COption_ClosureReasonZ_free(int64_t _res) { +jboolean CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_HolderCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCOption_ClosureReasonZ _res_conv = *(LDKCOption_ClosureReasonZ*)(_res_ptr); + LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_ClosureReasonZ_free(_res_conv); + CResult_HolderCommitmentTransactionDecodeErrorZ_free(_res_conv); } -static inline uint64_t COption_ClosureReasonZ_clone_ptr(LDKCOption_ClosureReasonZ *NONNULL_PTR arg) { - LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); - *ret_copy = COption_ClosureReasonZ_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +static inline uint64_t CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_COption_ClosureReasonZ_clone_ptr(int64_t arg) { - LDKCOption_ClosureReasonZ* arg_conv = (LDKCOption_ClosureReasonZ*)untag_ptr(arg); - int64_t ret_conv = COption_ClosureReasonZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_HolderCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_COption_ClosureReasonZ_clone(int64_t orig) { - LDKCOption_ClosureReasonZ* orig_conv = (LDKCOption_ClosureReasonZ*)untag_ptr(orig); - LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); - *ret_copy = COption_ClosureReasonZ_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_clone(int64_t orig) { + LDKCResult_HolderCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(orig); + LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_ok(int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKCOption_ClosureReasonZ o_conv = *(LDKCOption_ClosureReasonZ*)(o_ptr); - o_conv = COption_ClosureReasonZ_clone((LDKCOption_ClosureReasonZ*)untag_ptr(o)); - LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); - *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(int64_t o) { + LDKBuiltCommitmentTransaction o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = BuiltCommitmentTransaction_clone(&o_conv); + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_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_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); - *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_err(e_conv); + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_COption_ClosureReasonZDecodeErrorZ* o_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_COption_ClosureReasonZDecodeErrorZ _res_conv = *(LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(_res_ptr); + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_COption_ClosureReasonZDecodeErrorZ_free(_res_conv); + CResult_BuiltCommitmentTransactionDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); - *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(arg); +static inline uint64_t CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_COption_ClosureReasonZDecodeErrorZ* arg_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_clone(int64_t orig) { - LDKCResult_COption_ClosureReasonZDecodeErrorZ* orig_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(orig); - LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); - *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(int64_t orig) { + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(orig); + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_COption_HTLCDestinationZ_some(int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKHTLCDestination o_conv = *(LDKHTLCDestination*)(o_ptr); - o_conv = HTLCDestination_clone((LDKHTLCDestination*)untag_ptr(o)); - LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ"); - *ret_copy = COption_HTLCDestinationZ_some(o_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_CResult_TrustedClosingTransactionNoneZ_ok(int64_t o) { + LDKTrustedClosingTransaction o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + // WARNING: we need a move here but no clone is available for LDKTrustedClosingTransaction + + LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ"); + *ret_conv = CResult_TrustedClosingTransactionNoneZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_COption_HTLCDestinationZ_none() { - LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ"); - *ret_copy = COption_HTLCDestinationZ_none(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_CResult_TrustedClosingTransactionNoneZ_err() { + LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ"); + *ret_conv = CResult_TrustedClosingTransactionNoneZ_err(); + return tag_ptr(ret_conv, true); } -void CS_LDK_COption_HTLCDestinationZ_free(int64_t _res) { +jboolean CS_LDK_CResult_TrustedClosingTransactionNoneZ_is_ok(int64_t o) { + LDKCResult_TrustedClosingTransactionNoneZ* o_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_TrustedClosingTransactionNoneZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_TrustedClosingTransactionNoneZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCOption_HTLCDestinationZ _res_conv = *(LDKCOption_HTLCDestinationZ*)(_res_ptr); + LDKCResult_TrustedClosingTransactionNoneZ _res_conv = *(LDKCResult_TrustedClosingTransactionNoneZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_HTLCDestinationZ_free(_res_conv); -} - -static inline uint64_t COption_HTLCDestinationZ_clone_ptr(LDKCOption_HTLCDestinationZ *NONNULL_PTR arg) { - LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ"); - *ret_copy = COption_HTLCDestinationZ_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -int64_t CS_LDK_COption_HTLCDestinationZ_clone_ptr(int64_t arg) { - LDKCOption_HTLCDestinationZ* arg_conv = (LDKCOption_HTLCDestinationZ*)untag_ptr(arg); - int64_t ret_conv = COption_HTLCDestinationZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_COption_HTLCDestinationZ_clone(int64_t orig) { - LDKCOption_HTLCDestinationZ* orig_conv = (LDKCOption_HTLCDestinationZ*)untag_ptr(orig); - LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ"); - *ret_copy = COption_HTLCDestinationZ_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + CResult_TrustedClosingTransactionNoneZ_free(_res_conv); } -int64_t CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_ok(int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKCOption_HTLCDestinationZ o_conv = *(LDKCOption_HTLCDestinationZ*)(o_ptr); - o_conv = COption_HTLCDestinationZ_clone((LDKCOption_HTLCDestinationZ*)untag_ptr(o)); - LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ"); - *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_ok(int64_t o) { + LDKCommitmentTransaction o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = CommitmentTransaction_clone(&o_conv); + LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_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_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ"); - *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_err(e_conv); + LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_COption_HTLCDestinationZDecodeErrorZ* o_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_CommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_CommitmentTransactionDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res_conv = *(LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)(_res_ptr); + LDKCResult_CommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_CommitmentTransactionDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_COption_HTLCDestinationZDecodeErrorZ_free(_res_conv); + CResult_CommitmentTransactionDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ"); - *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone(arg); +static inline uint64_t CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_COption_HTLCDestinationZDecodeErrorZ* arg_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_CommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_clone(int64_t orig) { - LDKCResult_COption_HTLCDestinationZDecodeErrorZ* orig_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(orig); - LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ"); - *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_clone(int64_t orig) { + LDKCResult_CommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(orig); + LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_ok(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); +int64_t CS_LDK_CResult_TrustedCommitmentTransactionNoneZ_ok(int64_t o) { + LDKTrustedCommitmentTransaction o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + // WARNING: we need a move here but no clone is available for LDKTrustedCommitmentTransaction + + LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ"); + *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_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); +int64_t CS_LDK_CResult_TrustedCommitmentTransactionNoneZ_err() { + LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ"); + *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_err(); return tag_ptr(ret_conv, true); } -jboolean 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); - return ret_conv; -} - -void CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_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); - FREE(untag_ptr(_res)); - CResult_PaymentFailureReasonDecodeErrorZ_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); - 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); +jboolean CS_LDK_CResult_TrustedCommitmentTransactionNoneZ_is_ok(int64_t o) { + LDKCResult_TrustedCommitmentTransactionNoneZ* o_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_TrustedCommitmentTransactionNoneZ_is_ok(o_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); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_COption_U128Z_some(int8_tArray o) { - LDKU128 o_ref; - CHECK(o->arr_len == 16); - memcpy(o_ref.le_bytes, o->elems, 16); FREE(o); - LDKCOption_U128Z *ret_copy = MALLOC(sizeof(LDKCOption_U128Z), "LDKCOption_U128Z"); - *ret_copy = COption_U128Z_some(o_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_COption_U128Z_none() { - LDKCOption_U128Z *ret_copy = MALLOC(sizeof(LDKCOption_U128Z), "LDKCOption_U128Z"); - *ret_copy = COption_U128Z_none(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -void CS_LDK_COption_U128Z_free(int64_t _res) { +void CS_LDK_CResult_TrustedCommitmentTransactionNoneZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCOption_U128Z _res_conv = *(LDKCOption_U128Z*)(_res_ptr); + LDKCResult_TrustedCommitmentTransactionNoneZ _res_conv = *(LDKCResult_TrustedCommitmentTransactionNoneZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_U128Z_free(_res_conv); -} - -static inline uint64_t COption_U128Z_clone_ptr(LDKCOption_U128Z *NONNULL_PTR arg) { - LDKCOption_U128Z *ret_copy = MALLOC(sizeof(LDKCOption_U128Z), "LDKCOption_U128Z"); - *ret_copy = COption_U128Z_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -int64_t CS_LDK_COption_U128Z_clone_ptr(int64_t arg) { - LDKCOption_U128Z* arg_conv = (LDKCOption_U128Z*)untag_ptr(arg); - int64_t ret_conv = COption_U128Z_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_COption_U128Z_clone(int64_t orig) { - LDKCOption_U128Z* orig_conv = (LDKCOption_U128Z*)untag_ptr(orig); - LDKCOption_U128Z *ret_copy = MALLOC(sizeof(LDKCOption_U128Z), "LDKCOption_U128Z"); - *ret_copy = COption_U128Z_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + CResult_TrustedCommitmentTransactionNoneZ_free(_res_conv); } -void CS_LDK_CVec_ClaimedHTLCZ_free(int64_tArray _res) { - LDKCVec_ClaimedHTLCZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKClaimedHTLC), "LDKCVec_ClaimedHTLCZ Elements"); +int64_t CS_LDK_CResult_CVec_ECDSASignatureZNoneZ_ok(ptrArray o) { + LDKCVec_ECDSASignatureZ o_constr; + o_constr.datalen = o->arr_len; + if (o_constr.datalen > 0) + o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKECDSASignature), "LDKCVec_ECDSASignatureZ Elements"); else - _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]; - LDKClaimedHTLC _res_conv_13_conv; - _res_conv_13_conv.inner = untag_ptr(_res_conv_13); - _res_conv_13_conv.is_owned = ptr_is_owned(_res_conv_13); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_13_conv); - _res_constr.data[n] = _res_conv_13_conv; + o_constr.data = NULL; + int8_tArray* o_vals = (void*) o->elems; + for (size_t i = 0; i < o_constr.datalen; i++) { + int8_tArray o_conv_8 = o_vals[i]; + LDKECDSASignature o_conv_8_ref; + CHECK(o_conv_8->arr_len == 64); + memcpy(o_conv_8_ref.compact_form, o_conv_8->elems, 64); FREE(o_conv_8); + o_constr.data[i] = o_conv_8_ref; } - FREE(_res); - CVec_ClaimedHTLCZ_free(_res_constr); + FREE(o); + LDKCResult_CVec_ECDSASignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_ECDSASignatureZNoneZ), "LDKCResult_CVec_ECDSASignatureZNoneZ"); + *ret_conv = CResult_CVec_ECDSASignatureZNoneZ_ok(o_constr); + return tag_ptr(ret_conv, true); } -int64_t 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_CResult_CVec_ECDSASignatureZNoneZ_err() { + LDKCResult_CVec_ECDSASignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_ECDSASignatureZNoneZ), "LDKCResult_CVec_ECDSASignatureZNoneZ"); + *ret_conv = CResult_CVec_ECDSASignatureZNoneZ_err(); + return tag_ptr(ret_conv, true); } -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; +jboolean CS_LDK_CResult_CVec_ECDSASignatureZNoneZ_is_ok(int64_t o) { + LDKCResult_CVec_ECDSASignatureZNoneZ* o_conv = (LDKCResult_CVec_ECDSASignatureZNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_CVec_ECDSASignatureZNoneZ_is_ok(o_conv); + return ret_conv; } -void CS_LDK_COption_PaymentFailureReasonZ_free(int64_t _res) { +void CS_LDK_CResult_CVec_ECDSASignatureZNoneZ_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); + LDKCResult_CVec_ECDSASignatureZNoneZ _res_conv = *(LDKCResult_CVec_ECDSASignatureZNoneZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_PaymentFailureReasonZ_free(_res_conv); + CResult_CVec_ECDSASignatureZNoneZ_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; +static inline uint64_t CResult_CVec_ECDSASignatureZNoneZ_clone_ptr(LDKCResult_CVec_ECDSASignatureZNoneZ *NONNULL_PTR arg) { + LDKCResult_CVec_ECDSASignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_ECDSASignatureZNoneZ), "LDKCResult_CVec_ECDSASignatureZNoneZ"); + *ret_conv = CResult_CVec_ECDSASignatureZNoneZ_clone(arg); + return tag_ptr(ret_conv, true); } -int64_t 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); +int64_t CS_LDK_CResult_CVec_ECDSASignatureZNoneZ_clone_ptr(int64_t arg) { + LDKCResult_CVec_ECDSASignatureZNoneZ* arg_conv = (LDKCResult_CVec_ECDSASignatureZNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_CVec_ECDSASignatureZNoneZ_clone_ptr(arg_conv); return ret_conv; } -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_CVec_ECDSASignatureZNoneZ_clone(int64_t orig) { + LDKCResult_CVec_ECDSASignatureZNoneZ* orig_conv = (LDKCResult_CVec_ECDSASignatureZNoneZ*)untag_ptr(orig); + LDKCResult_CVec_ECDSASignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_ECDSASignatureZNoneZ), "LDKCResult_CVec_ECDSASignatureZNoneZ"); + *ret_conv = CResult_CVec_ECDSASignatureZNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_COption_EventZ_some(int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKEvent o_conv = *(LDKEvent*)(o_ptr); - o_conv = Event_clone((LDKEvent*)untag_ptr(o)); - LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); - *ret_copy = COption_EventZ_some(o_conv); +int64_t CS_LDK_COption_usizeZ_some(int64_t o) { + LDKCOption_usizeZ *ret_copy = MALLOC(sizeof(LDKCOption_usizeZ), "LDKCOption_usizeZ"); + *ret_copy = COption_usizeZ_some(o); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_COption_EventZ_none() { - LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); - *ret_copy = COption_EventZ_none(); +int64_t CS_LDK_COption_usizeZ_none() { + LDKCOption_usizeZ *ret_copy = MALLOC(sizeof(LDKCOption_usizeZ), "LDKCOption_usizeZ"); + *ret_copy = COption_usizeZ_none(); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void CS_LDK_COption_EventZ_free(int64_t _res) { +void CS_LDK_COption_usizeZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCOption_EventZ _res_conv = *(LDKCOption_EventZ*)(_res_ptr); + LDKCOption_usizeZ _res_conv = *(LDKCOption_usizeZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_EventZ_free(_res_conv); + COption_usizeZ_free(_res_conv); } -static inline uint64_t COption_EventZ_clone_ptr(LDKCOption_EventZ *NONNULL_PTR arg) { - LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); - *ret_copy = COption_EventZ_clone(arg); +static inline uint64_t COption_usizeZ_clone_ptr(LDKCOption_usizeZ *NONNULL_PTR arg) { + LDKCOption_usizeZ *ret_copy = MALLOC(sizeof(LDKCOption_usizeZ), "LDKCOption_usizeZ"); + *ret_copy = COption_usizeZ_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_COption_EventZ_clone_ptr(int64_t arg) { - LDKCOption_EventZ* arg_conv = (LDKCOption_EventZ*)untag_ptr(arg); - int64_t ret_conv = COption_EventZ_clone_ptr(arg_conv); +int64_t CS_LDK_COption_usizeZ_clone_ptr(int64_t arg) { + LDKCOption_usizeZ* arg_conv = (LDKCOption_usizeZ*)untag_ptr(arg); + int64_t ret_conv = COption_usizeZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_COption_EventZ_clone(int64_t orig) { - LDKCOption_EventZ* orig_conv = (LDKCOption_EventZ*)untag_ptr(orig); - LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); - *ret_copy = COption_EventZ_clone(orig_conv); +int64_t CS_LDK_COption_usizeZ_clone(int64_t orig) { + LDKCOption_usizeZ* orig_conv = (LDKCOption_usizeZ*)untag_ptr(orig); + LDKCOption_usizeZ *ret_copy = MALLOC(sizeof(LDKCOption_usizeZ), "LDKCOption_usizeZ"); + *ret_copy = COption_usizeZ_clone(orig_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_CResult_COption_EventZDecodeErrorZ_ok(int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKCOption_EventZ o_conv = *(LDKCOption_EventZ*)(o_ptr); - o_conv = COption_EventZ_clone((LDKCOption_EventZ*)untag_ptr(o)); - LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); - *ret_conv = CResult_COption_EventZDecodeErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_ShutdownScriptDecodeErrorZ_ok(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 = ShutdownScript_clone(&o_conv); + LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); + *ret_conv = CResult_ShutdownScriptDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_COption_EventZDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_ShutdownScriptDecodeErrorZ_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_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); - *ret_conv = CResult_COption_EventZDecodeErrorZ_err(e_conv); + LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); + *ret_conv = CResult_ShutdownScriptDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_COption_EventZDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_COption_EventZDecodeErrorZ* o_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_COption_EventZDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_ShutdownScriptDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_ShutdownScriptDecodeErrorZ* o_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ShutdownScriptDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_COption_EventZDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_ShutdownScriptDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_COption_EventZDecodeErrorZ _res_conv = *(LDKCResult_COption_EventZDecodeErrorZ*)(_res_ptr); + LDKCResult_ShutdownScriptDecodeErrorZ _res_conv = *(LDKCResult_ShutdownScriptDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_COption_EventZDecodeErrorZ_free(_res_conv); + CResult_ShutdownScriptDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_COption_EventZDecodeErrorZ_clone_ptr(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); - *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(arg); +static inline uint64_t CResult_ShutdownScriptDecodeErrorZ_clone_ptr(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); + *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_COption_EventZDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_COption_EventZDecodeErrorZ* arg_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_COption_EventZDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_ShutdownScriptDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_ShutdownScriptDecodeErrorZ* arg_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_COption_EventZDecodeErrorZ_clone(int64_t orig) { - LDKCResult_COption_EventZDecodeErrorZ* orig_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(orig); - LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); - *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_ShutdownScriptDecodeErrorZ_clone(int64_t orig) { + LDKCResult_ShutdownScriptDecodeErrorZ* orig_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); + *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -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"); - *ret_conv = CResult_SiPrefixBolt11ParseErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_ok(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 = ShutdownScript_clone(&o_conv); + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); + *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_SiPrefixBolt11ParseErrorZ_err(int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKBolt11ParseError e_conv = *(LDKBolt11ParseError*)(e_ptr); - e_conv = Bolt11ParseError_clone((LDKBolt11ParseError*)untag_ptr(e)); - LDKCResult_SiPrefixBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixBolt11ParseErrorZ), "LDKCResult_SiPrefixBolt11ParseErrorZ"); - *ret_conv = CResult_SiPrefixBolt11ParseErrorZ_err(e_conv); +int64_t CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_err(int64_t e) { + LDKInvalidShutdownScript e_conv; + e_conv.inner = untag_ptr(e); + e_conv.is_owned = ptr_is_owned(e); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = InvalidShutdownScript_clone(&e_conv); + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); + *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_SiPrefixBolt11ParseErrorZ_is_ok(int64_t o) { - LDKCResult_SiPrefixBolt11ParseErrorZ* o_conv = (LDKCResult_SiPrefixBolt11ParseErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_SiPrefixBolt11ParseErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(int64_t o) { + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* o_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(o); + jboolean ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_SiPrefixBolt11ParseErrorZ_free(int64_t _res) { +void CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_SiPrefixBolt11ParseErrorZ _res_conv = *(LDKCResult_SiPrefixBolt11ParseErrorZ*)(_res_ptr); + LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res_conv = *(LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_SiPrefixBolt11ParseErrorZ_free(_res_conv); + CResult_ShutdownScriptInvalidShutdownScriptZ_free(_res_conv); } -static inline uint64_t CResult_SiPrefixBolt11ParseErrorZ_clone_ptr(LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR arg) { - LDKCResult_SiPrefixBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixBolt11ParseErrorZ), "LDKCResult_SiPrefixBolt11ParseErrorZ"); - *ret_conv = CResult_SiPrefixBolt11ParseErrorZ_clone(arg); +static inline uint64_t CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR arg) { + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); + *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_SiPrefixBolt11ParseErrorZ_clone_ptr(int64_t arg) { - LDKCResult_SiPrefixBolt11ParseErrorZ* arg_conv = (LDKCResult_SiPrefixBolt11ParseErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_SiPrefixBolt11ParseErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(int64_t arg) { + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* arg_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_SiPrefixBolt11ParseErrorZ_clone(int64_t orig) { - LDKCResult_SiPrefixBolt11ParseErrorZ* orig_conv = (LDKCResult_SiPrefixBolt11ParseErrorZ*)untag_ptr(orig); - LDKCResult_SiPrefixBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixBolt11ParseErrorZ), "LDKCResult_SiPrefixBolt11ParseErrorZ"); - *ret_conv = CResult_SiPrefixBolt11ParseErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_clone(int64_t orig) { + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* orig_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(orig); + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); + *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_Bolt11InvoiceParseOrSemanticErrorZ_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_Bolt11InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ), "LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ"); - *ret_conv = CResult_Bolt11InvoiceParseOrSemanticErrorZ_ok(o_conv); +void CS_LDK_CVec_TransactionZ_free(ptrArray _res) { + LDKCVec_TransactionZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTransaction), "LDKCVec_TransactionZ Elements"); + else + _res_constr.data = NULL; + int8_tArray* _res_vals = (void*) _res->elems; + for (size_t i = 0; i < _res_constr.datalen; i++) { + int8_tArray _res_conv_8 = _res_vals[i]; + LDKTransaction _res_conv_8_ref; + _res_conv_8_ref.datalen = _res_conv_8->arr_len; + _res_conv_8_ref.data = MALLOC(_res_conv_8_ref.datalen, "LDKTransaction Bytes"); + memcpy(_res_conv_8_ref.data, _res_conv_8->elems, _res_conv_8_ref.datalen); FREE(_res_conv_8); + _res_conv_8_ref.data_is_owned = true; + _res_constr.data[i] = _res_conv_8_ref; + } + FREE(_res); + CVec_TransactionZ_free(_res_constr); +} + +int64_t CS_LDK_CResult_PaymentPurposeDecodeErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKPaymentPurpose o_conv = *(LDKPaymentPurpose*)(o_ptr); + o_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(o)); + LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); + *ret_conv = CResult_PaymentPurposeDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_Bolt11InvoiceParseOrSemanticErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_PaymentPurposeDecodeErrorZ_err(int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); - LDKParseOrSemanticError e_conv = *(LDKParseOrSemanticError*)(e_ptr); - e_conv = ParseOrSemanticError_clone((LDKParseOrSemanticError*)untag_ptr(e)); - LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ), "LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ"); - *ret_conv = CResult_Bolt11InvoiceParseOrSemanticErrorZ_err(e_conv); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); + *ret_conv = CResult_PaymentPurposeDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_Bolt11InvoiceParseOrSemanticErrorZ_is_ok(int64_t o) { - LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* o_conv = (LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_Bolt11InvoiceParseOrSemanticErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_PaymentPurposeDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_PaymentPurposeDecodeErrorZ* o_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_PaymentPurposeDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_Bolt11InvoiceParseOrSemanticErrorZ_free(int64_t _res) { +void CS_LDK_CResult_PaymentPurposeDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ _res_conv = *(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ*)(_res_ptr); + LDKCResult_PaymentPurposeDecodeErrorZ _res_conv = *(LDKCResult_PaymentPurposeDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_Bolt11InvoiceParseOrSemanticErrorZ_free(_res_conv); + CResult_PaymentPurposeDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone_ptr(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ *NONNULL_PTR arg) { - LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ), "LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ"); - *ret_conv = CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone(arg); +static inline uint64_t CResult_PaymentPurposeDecodeErrorZ_clone_ptr(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); + *ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone_ptr(int64_t arg) { - LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* arg_conv = (LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_PaymentPurposeDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_PaymentPurposeDecodeErrorZ* arg_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone(int64_t orig) { - LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* orig_conv = (LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ*)untag_ptr(orig); - LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ), "LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ"); - *ret_conv = CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_PaymentPurposeDecodeErrorZ_clone(int64_t orig) { + LDKCResult_PaymentPurposeDecodeErrorZ* orig_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(orig); + LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); + *ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_ok(int64_t o) { - LDKSignedRawBolt11Invoice o_conv; +int64_t CS_LDK_CResult_ClaimedHTLCDecodeErrorZ_ok(int64_t o) { + LDKClaimedHTLC o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = SignedRawBolt11Invoice_clone(&o_conv); - LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ), "LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ"); - *ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_ok(o_conv); + o_conv = ClaimedHTLC_clone(&o_conv); + LDKCResult_ClaimedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClaimedHTLCDecodeErrorZ), "LDKCResult_ClaimedHTLCDecodeErrorZ"); + *ret_conv = CResult_ClaimedHTLCDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_ClaimedHTLCDecodeErrorZ_err(int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); - LDKBolt11ParseError e_conv = *(LDKBolt11ParseError*)(e_ptr); - e_conv = Bolt11ParseError_clone((LDKBolt11ParseError*)untag_ptr(e)); - LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ), "LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ"); - *ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_err(e_conv); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_ClaimedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClaimedHTLCDecodeErrorZ), "LDKCResult_ClaimedHTLCDecodeErrorZ"); + *ret_conv = CResult_ClaimedHTLCDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_is_ok(int64_t o) { - LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* o_conv = (LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_ClaimedHTLCDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_ClaimedHTLCDecodeErrorZ* o_conv = (LDKCResult_ClaimedHTLCDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ClaimedHTLCDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_free(int64_t _res) { +void CS_LDK_CResult_ClaimedHTLCDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ _res_conv = *(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ*)(_res_ptr); + LDKCResult_ClaimedHTLCDecodeErrorZ _res_conv = *(LDKCResult_ClaimedHTLCDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_free(_res_conv); + CResult_ClaimedHTLCDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone_ptr(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR arg) { - LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ), "LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ"); - *ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone(arg); +static inline uint64_t CResult_ClaimedHTLCDecodeErrorZ_clone_ptr(LDKCResult_ClaimedHTLCDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ClaimedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClaimedHTLCDecodeErrorZ), "LDKCResult_ClaimedHTLCDecodeErrorZ"); + *ret_conv = CResult_ClaimedHTLCDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone_ptr(int64_t arg) { - LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* arg_conv = (LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_ClaimedHTLCDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_ClaimedHTLCDecodeErrorZ* arg_conv = (LDKCResult_ClaimedHTLCDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ClaimedHTLCDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone(int64_t orig) { - LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* orig_conv = (LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ*)untag_ptr(orig); - LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ), "LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ"); - *ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -static inline uint64_t C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone_ptr(LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ *NONNULL_PTR arg) { - LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ), "LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ"); - *ret_conv = C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone(arg); +int64_t CS_LDK_CResult_ClaimedHTLCDecodeErrorZ_clone(int64_t orig) { + LDKCResult_ClaimedHTLCDecodeErrorZ* orig_conv = (LDKCResult_ClaimedHTLCDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ClaimedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClaimedHTLCDecodeErrorZ), "LDKCResult_ClaimedHTLCDecodeErrorZ"); + *ret_conv = CResult_ClaimedHTLCDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone_ptr(int64_t arg) { - LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ* arg_conv = (LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ*)untag_ptr(arg); - int64_t ret_conv = C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone_ptr(arg_conv); - return ret_conv; -} -int64_t CS_LDK_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone(int64_t orig) { - LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ* orig_conv = (LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ*)untag_ptr(orig); - LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ), "LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ"); - *ret_conv = C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone(orig_conv); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_COption_PathFailureZ_some(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKPathFailure o_conv = *(LDKPathFailure*)(o_ptr); + o_conv = PathFailure_clone((LDKPathFailure*)untag_ptr(o)); + LDKCOption_PathFailureZ *ret_copy = MALLOC(sizeof(LDKCOption_PathFailureZ), "LDKCOption_PathFailureZ"); + *ret_copy = COption_PathFailureZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_new(int64_t a, int8_tArray b, int64_t c) { - LDKRawBolt11Invoice a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = RawBolt11Invoice_clone(&a_conv); - LDKThirtyTwoBytes b_ref; - CHECK(b->arr_len == 32); - memcpy(b_ref.data, b->elems, 32); FREE(b); - LDKBolt11InvoiceSignature c_conv; - c_conv.inner = untag_ptr(c); - c_conv.is_owned = ptr_is_owned(c); - CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv); - c_conv = Bolt11InvoiceSignature_clone(&c_conv); - LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ), "LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ"); - *ret_conv = C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_new(a_conv, b_ref, c_conv); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_COption_PathFailureZ_none() { + LDKCOption_PathFailureZ *ret_copy = MALLOC(sizeof(LDKCOption_PathFailureZ), "LDKCOption_PathFailureZ"); + *ret_copy = COption_PathFailureZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_free(int64_t _res) { +void CS_LDK_COption_PathFailureZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ _res_conv = *(LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ*)(_res_ptr); + LDKCOption_PathFailureZ _res_conv = *(LDKCOption_PathFailureZ*)(_res_ptr); FREE(untag_ptr(_res)); - C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_free(_res_conv); + COption_PathFailureZ_free(_res_conv); } -int64_t CS_LDK_CResult_PayeePubKeySecp256k1ErrorZ_ok(int64_t o) { - LDKPayeePubKey o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = PayeePubKey_clone(&o_conv); - LDKCResult_PayeePubKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeySecp256k1ErrorZ), "LDKCResult_PayeePubKeySecp256k1ErrorZ"); - *ret_conv = CResult_PayeePubKeySecp256k1ErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); +static inline uint64_t COption_PathFailureZ_clone_ptr(LDKCOption_PathFailureZ *NONNULL_PTR arg) { + LDKCOption_PathFailureZ *ret_copy = MALLOC(sizeof(LDKCOption_PathFailureZ), "LDKCOption_PathFailureZ"); + *ret_copy = COption_PathFailureZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_COption_PathFailureZ_clone_ptr(int64_t arg) { + LDKCOption_PathFailureZ* arg_conv = (LDKCOption_PathFailureZ*)untag_ptr(arg); + int64_t ret_conv = COption_PathFailureZ_clone_ptr(arg_conv); + return ret_conv; } -int64_t CS_LDK_CResult_PayeePubKeySecp256k1ErrorZ_err(int32_t e) { - LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_cs(e); - LDKCResult_PayeePubKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeySecp256k1ErrorZ), "LDKCResult_PayeePubKeySecp256k1ErrorZ"); - *ret_conv = CResult_PayeePubKeySecp256k1ErrorZ_err(e_conv); +int64_t CS_LDK_COption_PathFailureZ_clone(int64_t orig) { + LDKCOption_PathFailureZ* orig_conv = (LDKCOption_PathFailureZ*)untag_ptr(orig); + LDKCOption_PathFailureZ *ret_copy = MALLOC(sizeof(LDKCOption_PathFailureZ), "LDKCOption_PathFailureZ"); + *ret_copy = COption_PathFailureZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_CResult_COption_PathFailureZDecodeErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKCOption_PathFailureZ o_conv = *(LDKCOption_PathFailureZ*)(o_ptr); + o_conv = COption_PathFailureZ_clone((LDKCOption_PathFailureZ*)untag_ptr(o)); + LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ"); + *ret_conv = CResult_COption_PathFailureZDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_PayeePubKeySecp256k1ErrorZ_is_ok(int64_t o) { - LDKCResult_PayeePubKeySecp256k1ErrorZ* o_conv = (LDKCResult_PayeePubKeySecp256k1ErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_PayeePubKeySecp256k1ErrorZ_is_ok(o_conv); +int64_t CS_LDK_CResult_COption_PathFailureZDecodeErrorZ_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_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ"); + *ret_conv = CResult_COption_PathFailureZDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_COption_PathFailureZDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_COption_PathFailureZDecodeErrorZ* o_conv = (LDKCResult_COption_PathFailureZDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_COption_PathFailureZDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_PayeePubKeySecp256k1ErrorZ_free(int64_t _res) { +void CS_LDK_CResult_COption_PathFailureZDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_PayeePubKeySecp256k1ErrorZ _res_conv = *(LDKCResult_PayeePubKeySecp256k1ErrorZ*)(_res_ptr); + LDKCResult_COption_PathFailureZDecodeErrorZ _res_conv = *(LDKCResult_COption_PathFailureZDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_PayeePubKeySecp256k1ErrorZ_free(_res_conv); + CResult_COption_PathFailureZDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_PayeePubKeySecp256k1ErrorZ_clone_ptr(LDKCResult_PayeePubKeySecp256k1ErrorZ *NONNULL_PTR arg) { - LDKCResult_PayeePubKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeySecp256k1ErrorZ), "LDKCResult_PayeePubKeySecp256k1ErrorZ"); - *ret_conv = CResult_PayeePubKeySecp256k1ErrorZ_clone(arg); +static inline uint64_t CResult_COption_PathFailureZDecodeErrorZ_clone_ptr(LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ"); + *ret_conv = CResult_COption_PathFailureZDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PayeePubKeySecp256k1ErrorZ_clone_ptr(int64_t arg) { - LDKCResult_PayeePubKeySecp256k1ErrorZ* arg_conv = (LDKCResult_PayeePubKeySecp256k1ErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_PayeePubKeySecp256k1ErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_COption_PathFailureZDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_COption_PathFailureZDecodeErrorZ* arg_conv = (LDKCResult_COption_PathFailureZDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_COption_PathFailureZDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_PayeePubKeySecp256k1ErrorZ_clone(int64_t orig) { - LDKCResult_PayeePubKeySecp256k1ErrorZ* orig_conv = (LDKCResult_PayeePubKeySecp256k1ErrorZ*)untag_ptr(orig); - LDKCResult_PayeePubKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeySecp256k1ErrorZ), "LDKCResult_PayeePubKeySecp256k1ErrorZ"); - *ret_conv = CResult_PayeePubKeySecp256k1ErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -void CS_LDK_CVec_PrivateRouteZ_free(int64_tArray _res) { - LDKCVec_PrivateRouteZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPrivateRoute), "LDKCVec_PrivateRouteZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = _res->elems; - for (size_t o = 0; o < _res_constr.datalen; o++) { - int64_t _res_conv_14 = _res_vals[o]; - LDKPrivateRoute _res_conv_14_conv; - _res_conv_14_conv.inner = untag_ptr(_res_conv_14); - _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv); - _res_constr.data[o] = _res_conv_14_conv; - } - FREE(_res); - CVec_PrivateRouteZ_free(_res_constr); -} - -int64_t CS_LDK_CResult_PositiveTimestampCreationErrorZ_ok(int64_t o) { - LDKPositiveTimestamp o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = PositiveTimestamp_clone(&o_conv); - LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); - *ret_conv = CResult_PositiveTimestampCreationErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_COption_PathFailureZDecodeErrorZ_clone(int64_t orig) { + LDKCResult_COption_PathFailureZDecodeErrorZ* orig_conv = (LDKCResult_COption_PathFailureZDecodeErrorZ*)untag_ptr(orig); + LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ"); + *ret_conv = CResult_COption_PathFailureZDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PositiveTimestampCreationErrorZ_err(int32_t e) { - LDKCreationError e_conv = LDKCreationError_from_cs(e); - LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); - *ret_conv = CResult_PositiveTimestampCreationErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_COption_ClosureReasonZ_some(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKClosureReason o_conv = *(LDKClosureReason*)(o_ptr); + o_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(o)); + LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); + *ret_copy = COption_ClosureReasonZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_CResult_PositiveTimestampCreationErrorZ_is_ok(int64_t o) { - LDKCResult_PositiveTimestampCreationErrorZ* o_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_PositiveTimestampCreationErrorZ_is_ok(o_conv); - return ret_conv; +int64_t CS_LDK_COption_ClosureReasonZ_none() { + LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); + *ret_copy = COption_ClosureReasonZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_CResult_PositiveTimestampCreationErrorZ_free(int64_t _res) { +void CS_LDK_COption_ClosureReasonZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_PositiveTimestampCreationErrorZ _res_conv = *(LDKCResult_PositiveTimestampCreationErrorZ*)(_res_ptr); + LDKCOption_ClosureReasonZ _res_conv = *(LDKCOption_ClosureReasonZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_PositiveTimestampCreationErrorZ_free(_res_conv); + COption_ClosureReasonZ_free(_res_conv); } -static inline uint64_t CResult_PositiveTimestampCreationErrorZ_clone_ptr(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR arg) { - LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); - *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(arg); - return tag_ptr(ret_conv, true); +static inline uint64_t COption_ClosureReasonZ_clone_ptr(LDKCOption_ClosureReasonZ *NONNULL_PTR arg) { + LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); + *ret_copy = COption_ClosureReasonZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_CResult_PositiveTimestampCreationErrorZ_clone_ptr(int64_t arg) { - LDKCResult_PositiveTimestampCreationErrorZ* arg_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_PositiveTimestampCreationErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_COption_ClosureReasonZ_clone_ptr(int64_t arg) { + LDKCOption_ClosureReasonZ* arg_conv = (LDKCOption_ClosureReasonZ*)untag_ptr(arg); + int64_t ret_conv = COption_ClosureReasonZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_PositiveTimestampCreationErrorZ_clone(int64_t orig) { - LDKCResult_PositiveTimestampCreationErrorZ* orig_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(orig); - LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); - *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_COption_ClosureReasonZ_clone(int64_t orig) { + LDKCOption_ClosureReasonZ* orig_conv = (LDKCOption_ClosureReasonZ*)untag_ptr(orig); + LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); + *ret_copy = COption_ClosureReasonZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_CResult_NoneBolt11SemanticErrorZ_ok() { - LDKCResult_NoneBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt11SemanticErrorZ), "LDKCResult_NoneBolt11SemanticErrorZ"); - *ret_conv = CResult_NoneBolt11SemanticErrorZ_ok(); +int64_t CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKCOption_ClosureReasonZ o_conv = *(LDKCOption_ClosureReasonZ*)(o_ptr); + o_conv = COption_ClosureReasonZ_clone((LDKCOption_ClosureReasonZ*)untag_ptr(o)); + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_NoneBolt11SemanticErrorZ_err(int32_t e) { - LDKBolt11SemanticError e_conv = LDKBolt11SemanticError_from_cs(e); - LDKCResult_NoneBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt11SemanticErrorZ), "LDKCResult_NoneBolt11SemanticErrorZ"); - *ret_conv = CResult_NoneBolt11SemanticErrorZ_err(e_conv); +int64_t CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_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_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_NoneBolt11SemanticErrorZ_is_ok(int64_t o) { - LDKCResult_NoneBolt11SemanticErrorZ* o_conv = (LDKCResult_NoneBolt11SemanticErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_NoneBolt11SemanticErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ* o_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_NoneBolt11SemanticErrorZ_free(int64_t _res) { +void CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_NoneBolt11SemanticErrorZ _res_conv = *(LDKCResult_NoneBolt11SemanticErrorZ*)(_res_ptr); + LDKCResult_COption_ClosureReasonZDecodeErrorZ _res_conv = *(LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_NoneBolt11SemanticErrorZ_free(_res_conv); + CResult_COption_ClosureReasonZDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_NoneBolt11SemanticErrorZ_clone_ptr(LDKCResult_NoneBolt11SemanticErrorZ *NONNULL_PTR arg) { - LDKCResult_NoneBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt11SemanticErrorZ), "LDKCResult_NoneBolt11SemanticErrorZ"); - *ret_conv = CResult_NoneBolt11SemanticErrorZ_clone(arg); +static inline uint64_t CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_NoneBolt11SemanticErrorZ_clone_ptr(int64_t arg) { - LDKCResult_NoneBolt11SemanticErrorZ* arg_conv = (LDKCResult_NoneBolt11SemanticErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_NoneBolt11SemanticErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ* arg_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_NoneBolt11SemanticErrorZ_clone(int64_t orig) { - LDKCResult_NoneBolt11SemanticErrorZ* orig_conv = (LDKCResult_NoneBolt11SemanticErrorZ*)untag_ptr(orig); - LDKCResult_NoneBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt11SemanticErrorZ), "LDKCResult_NoneBolt11SemanticErrorZ"); - *ret_conv = CResult_NoneBolt11SemanticErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_Bolt11InvoiceBolt11SemanticErrorZ_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_Bolt11InvoiceBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ), "LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ"); - *ret_conv = CResult_Bolt11InvoiceBolt11SemanticErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_clone(int64_t orig) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ* orig_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(orig); + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_Bolt11InvoiceBolt11SemanticErrorZ_err(int32_t e) { - LDKBolt11SemanticError e_conv = LDKBolt11SemanticError_from_cs(e); - LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ), "LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ"); - *ret_conv = CResult_Bolt11InvoiceBolt11SemanticErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_COption_HTLCDestinationZ_some(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKHTLCDestination o_conv = *(LDKHTLCDestination*)(o_ptr); + o_conv = HTLCDestination_clone((LDKHTLCDestination*)untag_ptr(o)); + LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ"); + *ret_copy = COption_HTLCDestinationZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_CResult_Bolt11InvoiceBolt11SemanticErrorZ_is_ok(int64_t o) { - LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* o_conv = (LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_Bolt11InvoiceBolt11SemanticErrorZ_is_ok(o_conv); - return ret_conv; +int64_t CS_LDK_COption_HTLCDestinationZ_none() { + LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ"); + *ret_copy = COption_HTLCDestinationZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_CResult_Bolt11InvoiceBolt11SemanticErrorZ_free(int64_t _res) { +void CS_LDK_COption_HTLCDestinationZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ _res_conv = *(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ*)(_res_ptr); + LDKCOption_HTLCDestinationZ _res_conv = *(LDKCOption_HTLCDestinationZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_Bolt11InvoiceBolt11SemanticErrorZ_free(_res_conv); + COption_HTLCDestinationZ_free(_res_conv); } -static inline uint64_t CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone_ptr(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ *NONNULL_PTR arg) { - LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ), "LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ"); - *ret_conv = CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone(arg); - return tag_ptr(ret_conv, true); +static inline uint64_t COption_HTLCDestinationZ_clone_ptr(LDKCOption_HTLCDestinationZ *NONNULL_PTR arg) { + LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ"); + *ret_copy = COption_HTLCDestinationZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone_ptr(int64_t arg) { - LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* arg_conv = (LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_COption_HTLCDestinationZ_clone_ptr(int64_t arg) { + LDKCOption_HTLCDestinationZ* arg_conv = (LDKCOption_HTLCDestinationZ*)untag_ptr(arg); + int64_t ret_conv = COption_HTLCDestinationZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone(int64_t orig) { - LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* orig_conv = (LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ*)untag_ptr(orig); - LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ), "LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ"); - *ret_conv = CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_COption_HTLCDestinationZ_clone(int64_t orig) { + LDKCOption_HTLCDestinationZ* orig_conv = (LDKCOption_HTLCDestinationZ*)untag_ptr(orig); + LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ"); + *ret_copy = COption_HTLCDestinationZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_CResult_DescriptionCreationErrorZ_ok(int64_t o) { - LDKDescription o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = Description_clone(&o_conv); - LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); - *ret_conv = CResult_DescriptionCreationErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKCOption_HTLCDestinationZ o_conv = *(LDKCOption_HTLCDestinationZ*)(o_ptr); + o_conv = COption_HTLCDestinationZ_clone((LDKCOption_HTLCDestinationZ*)untag_ptr(o)); + LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ"); + *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_DescriptionCreationErrorZ_err(int32_t e) { - LDKCreationError e_conv = LDKCreationError_from_cs(e); - LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); - *ret_conv = CResult_DescriptionCreationErrorZ_err(e_conv); +int64_t CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_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_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ"); + *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_DescriptionCreationErrorZ_is_ok(int64_t o) { - LDKCResult_DescriptionCreationErrorZ* o_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_DescriptionCreationErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_COption_HTLCDestinationZDecodeErrorZ* o_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_DescriptionCreationErrorZ_free(int64_t _res) { +void CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_DescriptionCreationErrorZ _res_conv = *(LDKCResult_DescriptionCreationErrorZ*)(_res_ptr); + LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res_conv = *(LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_DescriptionCreationErrorZ_free(_res_conv); + CResult_COption_HTLCDestinationZDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_DescriptionCreationErrorZ_clone_ptr(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR arg) { - LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); - *ret_conv = CResult_DescriptionCreationErrorZ_clone(arg); +static inline uint64_t CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ"); + *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_DescriptionCreationErrorZ_clone_ptr(int64_t arg) { - LDKCResult_DescriptionCreationErrorZ* arg_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_DescriptionCreationErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_COption_HTLCDestinationZDecodeErrorZ* arg_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_DescriptionCreationErrorZ_clone(int64_t orig) { - LDKCResult_DescriptionCreationErrorZ* orig_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(orig); - LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); - *ret_conv = CResult_DescriptionCreationErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_clone(int64_t orig) { + LDKCResult_COption_HTLCDestinationZDecodeErrorZ* orig_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(orig); + LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ"); + *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PrivateRouteCreationErrorZ_ok(int64_t o) { - LDKPrivateRoute o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = PrivateRoute_clone(&o_conv); - LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); - *ret_conv = CResult_PrivateRouteCreationErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_ok(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); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PrivateRouteCreationErrorZ_err(int32_t e) { - LDKCreationError e_conv = LDKCreationError_from_cs(e); - LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); - *ret_conv = CResult_PrivateRouteCreationErrorZ_err(e_conv); +int64_t CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_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); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_PrivateRouteCreationErrorZ_is_ok(int64_t o) { - LDKCResult_PrivateRouteCreationErrorZ* o_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_PrivateRouteCreationErrorZ_is_ok(o_conv); +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); return ret_conv; } -void CS_LDK_CResult_PrivateRouteCreationErrorZ_free(int64_t _res) { +void CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_PrivateRouteCreationErrorZ _res_conv = *(LDKCResult_PrivateRouteCreationErrorZ*)(_res_ptr); + LDKCResult_PaymentFailureReasonDecodeErrorZ _res_conv = *(LDKCResult_PaymentFailureReasonDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_PrivateRouteCreationErrorZ_free(_res_conv); + CResult_PaymentFailureReasonDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_PrivateRouteCreationErrorZ_clone_ptr(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR arg) { - LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); - *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(arg); +static inline uint64_t CResult_PaymentFailureReasonDecodeErrorZ_clone_ptr(LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_PaymentFailureReasonDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentFailureReasonDecodeErrorZ), "LDKCResult_PaymentFailureReasonDecodeErrorZ"); + *ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PrivateRouteCreationErrorZ_clone_ptr(int64_t arg) { - LDKCResult_PrivateRouteCreationErrorZ* arg_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_PrivateRouteCreationErrorZ_clone_ptr(arg_conv); +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); return ret_conv; } -int64_t CS_LDK_CResult_PrivateRouteCreationErrorZ_clone(int64_t orig) { - LDKCResult_PrivateRouteCreationErrorZ* orig_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(orig); - LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); - *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_OutPointDecodeErrorZ_ok(int64_t o) { - LDKOutPoint o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = OutPoint_clone(&o_conv); - LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); - *ret_conv = CResult_OutPointDecodeErrorZ_ok(o_conv); +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); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_OutPointDecodeErrorZ_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_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); - *ret_conv = CResult_OutPointDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_COption_U128Z_some(int8_tArray o) { + LDKU128 o_ref; + CHECK(o->arr_len == 16); + memcpy(o_ref.le_bytes, o->elems, 16); FREE(o); + LDKCOption_U128Z *ret_copy = MALLOC(sizeof(LDKCOption_U128Z), "LDKCOption_U128Z"); + *ret_copy = COption_U128Z_some(o_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_CResult_OutPointDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_OutPointDecodeErrorZ* o_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_OutPointDecodeErrorZ_is_ok(o_conv); - return ret_conv; +int64_t CS_LDK_COption_U128Z_none() { + LDKCOption_U128Z *ret_copy = MALLOC(sizeof(LDKCOption_U128Z), "LDKCOption_U128Z"); + *ret_copy = COption_U128Z_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_CResult_OutPointDecodeErrorZ_free(int64_t _res) { +void CS_LDK_COption_U128Z_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_OutPointDecodeErrorZ _res_conv = *(LDKCResult_OutPointDecodeErrorZ*)(_res_ptr); + LDKCOption_U128Z _res_conv = *(LDKCOption_U128Z*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_OutPointDecodeErrorZ_free(_res_conv); + COption_U128Z_free(_res_conv); } -static inline uint64_t CResult_OutPointDecodeErrorZ_clone_ptr(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); - *ret_conv = CResult_OutPointDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); +static inline uint64_t COption_U128Z_clone_ptr(LDKCOption_U128Z *NONNULL_PTR arg) { + LDKCOption_U128Z *ret_copy = MALLOC(sizeof(LDKCOption_U128Z), "LDKCOption_U128Z"); + *ret_copy = COption_U128Z_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_CResult_OutPointDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_OutPointDecodeErrorZ* arg_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_OutPointDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_COption_U128Z_clone_ptr(int64_t arg) { + LDKCOption_U128Z* arg_conv = (LDKCOption_U128Z*)untag_ptr(arg); + int64_t ret_conv = COption_U128Z_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_OutPointDecodeErrorZ_clone(int64_t orig) { - LDKCResult_OutPointDecodeErrorZ* orig_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(orig); - LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); - *ret_conv = CResult_OutPointDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_COption_U128Z_clone(int64_t orig) { + LDKCOption_U128Z* orig_conv = (LDKCOption_U128Z*)untag_ptr(orig); + LDKCOption_U128Z *ret_copy = MALLOC(sizeof(LDKCOption_U128Z), "LDKCOption_U128Z"); + *ret_copy = COption_U128Z_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_CResult_BigSizeDecodeErrorZ_ok(int64_t o) { - LDKBigSize o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = BigSize_clone(&o_conv); - LDKCResult_BigSizeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BigSizeDecodeErrorZ), "LDKCResult_BigSizeDecodeErrorZ"); - *ret_conv = CResult_BigSizeDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); +void CS_LDK_CVec_ClaimedHTLCZ_free(int64_tArray _res) { + LDKCVec_ClaimedHTLCZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKClaimedHTLC), "LDKCVec_ClaimedHTLCZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = _res->elems; + for (size_t n = 0; n < _res_constr.datalen; n++) { + int64_t _res_conv_13 = _res_vals[n]; + LDKClaimedHTLC _res_conv_13_conv; + _res_conv_13_conv.inner = untag_ptr(_res_conv_13); + _res_conv_13_conv.is_owned = ptr_is_owned(_res_conv_13); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_13_conv); + _res_constr.data[n] = _res_conv_13_conv; + } + FREE(_res); + CVec_ClaimedHTLCZ_free(_res_constr); } -int64_t CS_LDK_CResult_BigSizeDecodeErrorZ_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_BigSizeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BigSizeDecodeErrorZ), "LDKCResult_BigSizeDecodeErrorZ"); - *ret_conv = CResult_BigSizeDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); +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; } -jboolean CS_LDK_CResult_BigSizeDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_BigSizeDecodeErrorZ* o_conv = (LDKCResult_BigSizeDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_BigSizeDecodeErrorZ_is_ok(o_conv); - return ret_conv; +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_CResult_BigSizeDecodeErrorZ_free(int64_t _res) { +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); - LDKCResult_BigSizeDecodeErrorZ _res_conv = *(LDKCResult_BigSizeDecodeErrorZ*)(_res_ptr); + LDKCOption_PaymentFailureReasonZ _res_conv = *(LDKCOption_PaymentFailureReasonZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_BigSizeDecodeErrorZ_free(_res_conv); + COption_PaymentFailureReasonZ_free(_res_conv); } -static inline uint64_t CResult_BigSizeDecodeErrorZ_clone_ptr(LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_BigSizeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BigSizeDecodeErrorZ), "LDKCResult_BigSizeDecodeErrorZ"); - *ret_conv = CResult_BigSizeDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); +static inline uint64_t COption_PaymentFailureReasonZ_clone_ptr(LDKCOption_PaymentFailureReasonZ *NONNULL_PTR arg) { + LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); + *ret_copy = COption_PaymentFailureReasonZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_CResult_BigSizeDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_BigSizeDecodeErrorZ* arg_conv = (LDKCResult_BigSizeDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_BigSizeDecodeErrorZ_clone_ptr(arg_conv); +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_CResult_BigSizeDecodeErrorZ_clone(int64_t orig) { - LDKCResult_BigSizeDecodeErrorZ* orig_conv = (LDKCResult_BigSizeDecodeErrorZ*)untag_ptr(orig); - LDKCResult_BigSizeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BigSizeDecodeErrorZ), "LDKCResult_BigSizeDecodeErrorZ"); - *ret_conv = CResult_BigSizeDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_HostnameDecodeErrorZ_ok(int64_t o) { - LDKHostname o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = Hostname_clone(&o_conv); - LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); - *ret_conv = CResult_HostnameDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); +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_HostnameDecodeErrorZ_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_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); - *ret_conv = CResult_HostnameDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_COption_EventZ_some(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKEvent o_conv = *(LDKEvent*)(o_ptr); + o_conv = Event_clone((LDKEvent*)untag_ptr(o)); + LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); + *ret_copy = COption_EventZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_CResult_HostnameDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_HostnameDecodeErrorZ* o_conv = (LDKCResult_HostnameDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_HostnameDecodeErrorZ_is_ok(o_conv); - return ret_conv; +int64_t CS_LDK_COption_EventZ_none() { + LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); + *ret_copy = COption_EventZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_CResult_HostnameDecodeErrorZ_free(int64_t _res) { +void CS_LDK_COption_EventZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_HostnameDecodeErrorZ _res_conv = *(LDKCResult_HostnameDecodeErrorZ*)(_res_ptr); + LDKCOption_EventZ _res_conv = *(LDKCOption_EventZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_HostnameDecodeErrorZ_free(_res_conv); + COption_EventZ_free(_res_conv); } -static inline uint64_t CResult_HostnameDecodeErrorZ_clone_ptr(LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); - *ret_conv = CResult_HostnameDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); +static inline uint64_t COption_EventZ_clone_ptr(LDKCOption_EventZ *NONNULL_PTR arg) { + LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); + *ret_copy = COption_EventZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_CResult_HostnameDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_HostnameDecodeErrorZ* arg_conv = (LDKCResult_HostnameDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_HostnameDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_COption_EventZ_clone_ptr(int64_t arg) { + LDKCOption_EventZ* arg_conv = (LDKCOption_EventZ*)untag_ptr(arg); + int64_t ret_conv = COption_EventZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_HostnameDecodeErrorZ_clone(int64_t orig) { - LDKCResult_HostnameDecodeErrorZ* orig_conv = (LDKCResult_HostnameDecodeErrorZ*)untag_ptr(orig); - LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); - *ret_conv = CResult_HostnameDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_COption_EventZ_clone(int64_t orig) { + LDKCOption_EventZ* orig_conv = (LDKCOption_EventZ*)untag_ptr(orig); + LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); + *ret_copy = COption_EventZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_CResult_TransactionU16LenLimitedNoneZ_ok(int64_t o) { - LDKTransactionU16LenLimited o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = TransactionU16LenLimited_clone(&o_conv); - LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); - *ret_conv = CResult_TransactionU16LenLimitedNoneZ_ok(o_conv); +int64_t CS_LDK_CResult_COption_EventZDecodeErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKCOption_EventZ o_conv = *(LDKCOption_EventZ*)(o_ptr); + o_conv = COption_EventZ_clone((LDKCOption_EventZ*)untag_ptr(o)); + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = CResult_COption_EventZDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_TransactionU16LenLimitedNoneZ_err() { - LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); - *ret_conv = CResult_TransactionU16LenLimitedNoneZ_err(); +int64_t CS_LDK_CResult_COption_EventZDecodeErrorZ_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_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = CResult_COption_EventZDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_TransactionU16LenLimitedNoneZ_is_ok(int64_t o) { - LDKCResult_TransactionU16LenLimitedNoneZ* o_conv = (LDKCResult_TransactionU16LenLimitedNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_TransactionU16LenLimitedNoneZ_is_ok(o_conv); +jboolean CS_LDK_CResult_COption_EventZDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_COption_EventZDecodeErrorZ* o_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_COption_EventZDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_TransactionU16LenLimitedNoneZ_free(int64_t _res) { +void CS_LDK_CResult_COption_EventZDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_TransactionU16LenLimitedNoneZ _res_conv = *(LDKCResult_TransactionU16LenLimitedNoneZ*)(_res_ptr); + LDKCResult_COption_EventZDecodeErrorZ _res_conv = *(LDKCResult_COption_EventZDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_TransactionU16LenLimitedNoneZ_free(_res_conv); + CResult_COption_EventZDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_TransactionU16LenLimitedNoneZ_clone_ptr(LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR arg) { - LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); - *ret_conv = CResult_TransactionU16LenLimitedNoneZ_clone(arg); +static inline uint64_t CResult_COption_EventZDecodeErrorZ_clone_ptr(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_TransactionU16LenLimitedNoneZ_clone_ptr(int64_t arg) { - LDKCResult_TransactionU16LenLimitedNoneZ* arg_conv = (LDKCResult_TransactionU16LenLimitedNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_TransactionU16LenLimitedNoneZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_COption_EventZDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_COption_EventZDecodeErrorZ* arg_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_COption_EventZDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_TransactionU16LenLimitedNoneZ_clone(int64_t orig) { - LDKCResult_TransactionU16LenLimitedNoneZ* orig_conv = (LDKCResult_TransactionU16LenLimitedNoneZ*)untag_ptr(orig); - LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); - *ret_conv = CResult_TransactionU16LenLimitedNoneZ_clone(orig_conv); +int64_t CS_LDK_CResult_COption_EventZDecodeErrorZ_clone(int64_t orig) { + LDKCResult_COption_EventZDecodeErrorZ* orig_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(orig); + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_ok(int64_t o) { - LDKTransactionU16LenLimited o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = TransactionU16LenLimited_clone(&o_conv); - LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); - *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_ok(o_conv); +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"); + *ret_conv = CResult_SiPrefixBolt11ParseErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_SiPrefixBolt11ParseErrorZ_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_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); - *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_err(e_conv); + LDKBolt11ParseError e_conv = *(LDKBolt11ParseError*)(e_ptr); + e_conv = Bolt11ParseError_clone((LDKBolt11ParseError*)untag_ptr(e)); + LDKCResult_SiPrefixBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixBolt11ParseErrorZ), "LDKCResult_SiPrefixBolt11ParseErrorZ"); + *ret_conv = CResult_SiPrefixBolt11ParseErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_TransactionU16LenLimitedDecodeErrorZ* o_conv = (LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_SiPrefixBolt11ParseErrorZ_is_ok(int64_t o) { + LDKCResult_SiPrefixBolt11ParseErrorZ* o_conv = (LDKCResult_SiPrefixBolt11ParseErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_SiPrefixBolt11ParseErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_SiPrefixBolt11ParseErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_TransactionU16LenLimitedDecodeErrorZ _res_conv = *(LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)(_res_ptr); + LDKCResult_SiPrefixBolt11ParseErrorZ _res_conv = *(LDKCResult_SiPrefixBolt11ParseErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_TransactionU16LenLimitedDecodeErrorZ_free(_res_conv); + CResult_SiPrefixBolt11ParseErrorZ_free(_res_conv); } -static inline uint64_t CResult_TransactionU16LenLimitedDecodeErrorZ_clone_ptr(LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); - *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_clone(arg); +static inline uint64_t CResult_SiPrefixBolt11ParseErrorZ_clone_ptr(LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR arg) { + LDKCResult_SiPrefixBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixBolt11ParseErrorZ), "LDKCResult_SiPrefixBolt11ParseErrorZ"); + *ret_conv = CResult_SiPrefixBolt11ParseErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_TransactionU16LenLimitedDecodeErrorZ* arg_conv = (LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_SiPrefixBolt11ParseErrorZ_clone_ptr(int64_t arg) { + LDKCResult_SiPrefixBolt11ParseErrorZ* arg_conv = (LDKCResult_SiPrefixBolt11ParseErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_SiPrefixBolt11ParseErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_clone(int64_t orig) { - LDKCResult_TransactionU16LenLimitedDecodeErrorZ* orig_conv = (LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)untag_ptr(orig); - LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); - *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_SiPrefixBolt11ParseErrorZ_clone(int64_t orig) { + LDKCResult_SiPrefixBolt11ParseErrorZ* orig_conv = (LDKCResult_SiPrefixBolt11ParseErrorZ*)untag_ptr(orig); + LDKCResult_SiPrefixBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixBolt11ParseErrorZ), "LDKCResult_SiPrefixBolt11ParseErrorZ"); + *ret_conv = CResult_SiPrefixBolt11ParseErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_UntrustedStringDecodeErrorZ_ok(int64_t o) { - LDKUntrustedString o_conv; +int64_t CS_LDK_CResult_Bolt11InvoiceParseOrSemanticErrorZ_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 = UntrustedString_clone(&o_conv); - LDKCResult_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ"); - *ret_conv = CResult_UntrustedStringDecodeErrorZ_ok(o_conv); + o_conv = Bolt11Invoice_clone(&o_conv); + LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ), "LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ"); + *ret_conv = CResult_Bolt11InvoiceParseOrSemanticErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_UntrustedStringDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_Bolt11InvoiceParseOrSemanticErrorZ_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); + LDKParseOrSemanticError e_conv = *(LDKParseOrSemanticError*)(e_ptr); + e_conv = ParseOrSemanticError_clone((LDKParseOrSemanticError*)untag_ptr(e)); + LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ), "LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ"); + *ret_conv = CResult_Bolt11InvoiceParseOrSemanticErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean 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); +jboolean CS_LDK_CResult_Bolt11InvoiceParseOrSemanticErrorZ_is_ok(int64_t o) { + LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* o_conv = (LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_Bolt11InvoiceParseOrSemanticErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_UntrustedStringDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_Bolt11InvoiceParseOrSemanticErrorZ_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); + LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ _res_conv = *(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_UntrustedStringDecodeErrorZ_free(_res_conv); + CResult_Bolt11InvoiceParseOrSemanticErrorZ_free(_res_conv); } -static inline uint64_t CResult_UntrustedStringDecodeErrorZ_clone_ptr(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ"); - *ret_conv = CResult_UntrustedStringDecodeErrorZ_clone(arg); +static inline uint64_t CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone_ptr(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ), "LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ"); + *ret_conv = CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t 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); +int64_t CS_LDK_CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone_ptr(int64_t arg) { + LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* arg_conv = (LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_Bolt11InvoiceParseOrSemanticErrorZ_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); +int64_t CS_LDK_CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone(int64_t orig) { + LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* orig_conv = (LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ*)untag_ptr(orig); + LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ), "LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ"); + *ret_conv = CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ChannelIdDecodeErrorZ_ok(int64_t o) { - LDKChannelId o_conv; +int64_t CS_LDK_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_ok(int64_t o) { + LDKSignedRawBolt11Invoice o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = ChannelId_clone(&o_conv); - LDKCResult_ChannelIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdDecodeErrorZ), "LDKCResult_ChannelIdDecodeErrorZ"); - *ret_conv = CResult_ChannelIdDecodeErrorZ_ok(o_conv); + o_conv = SignedRawBolt11Invoice_clone(&o_conv); + LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ), "LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ"); + *ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ChannelIdDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_err(int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); - LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); - e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_ChannelIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdDecodeErrorZ), "LDKCResult_ChannelIdDecodeErrorZ"); - *ret_conv = CResult_ChannelIdDecodeErrorZ_err(e_conv); + LDKBolt11ParseError e_conv = *(LDKBolt11ParseError*)(e_ptr); + e_conv = Bolt11ParseError_clone((LDKBolt11ParseError*)untag_ptr(e)); + LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ), "LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ"); + *ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_ChannelIdDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_ChannelIdDecodeErrorZ* o_conv = (LDKCResult_ChannelIdDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ChannelIdDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_is_ok(int64_t o) { + LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* o_conv = (LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_ChannelIdDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_ChannelIdDecodeErrorZ _res_conv = *(LDKCResult_ChannelIdDecodeErrorZ*)(_res_ptr); + LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ _res_conv = *(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_ChannelIdDecodeErrorZ_free(_res_conv); + CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_free(_res_conv); } -static inline uint64_t CResult_ChannelIdDecodeErrorZ_clone_ptr(LDKCResult_ChannelIdDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ChannelIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdDecodeErrorZ), "LDKCResult_ChannelIdDecodeErrorZ"); - *ret_conv = CResult_ChannelIdDecodeErrorZ_clone(arg); +static inline uint64_t CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone_ptr(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR arg) { + LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ), "LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ"); + *ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ChannelIdDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_ChannelIdDecodeErrorZ* arg_conv = (LDKCResult_ChannelIdDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ChannelIdDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone_ptr(int64_t arg) { + LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* arg_conv = (LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_ChannelIdDecodeErrorZ_clone(int64_t orig) { - LDKCResult_ChannelIdDecodeErrorZ* orig_conv = (LDKCResult_ChannelIdDecodeErrorZ*)untag_ptr(orig); - LDKCResult_ChannelIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdDecodeErrorZ), "LDKCResult_ChannelIdDecodeErrorZ"); - *ret_conv = CResult_ChannelIdDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone(int64_t orig) { + LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* orig_conv = (LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ*)untag_ptr(orig); + LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ), "LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ"); + *ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -static inline uint64_t C2Tuple__u832u16Z_clone_ptr(LDKC2Tuple__u832u16Z *NONNULL_PTR arg) { - LDKC2Tuple__u832u16Z* ret_conv = MALLOC(sizeof(LDKC2Tuple__u832u16Z), "LDKC2Tuple__u832u16Z"); - *ret_conv = C2Tuple__u832u16Z_clone(arg); +static inline uint64_t C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone_ptr(LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ *NONNULL_PTR arg) { + LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ), "LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ"); + *ret_conv = C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C2Tuple__u832u16Z_clone_ptr(int64_t arg) { - LDKC2Tuple__u832u16Z* arg_conv = (LDKC2Tuple__u832u16Z*)untag_ptr(arg); - int64_t ret_conv = C2Tuple__u832u16Z_clone_ptr(arg_conv); +int64_t CS_LDK_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone_ptr(int64_t arg) { + LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ* arg_conv = (LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ*)untag_ptr(arg); + int64_t ret_conv = C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_C2Tuple__u832u16Z_clone(int64_t orig) { - LDKC2Tuple__u832u16Z* orig_conv = (LDKC2Tuple__u832u16Z*)untag_ptr(orig); - LDKC2Tuple__u832u16Z* ret_conv = MALLOC(sizeof(LDKC2Tuple__u832u16Z), "LDKC2Tuple__u832u16Z"); - *ret_conv = C2Tuple__u832u16Z_clone(orig_conv); +int64_t CS_LDK_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone(int64_t orig) { + LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ* orig_conv = (LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ*)untag_ptr(orig); + LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ), "LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ"); + *ret_conv = C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C2Tuple__u832u16Z_new(int8_tArray a, int16_t b) { - LDKThirtyTwoBytes a_ref; - CHECK(a->arr_len == 32); - memcpy(a_ref.data, a->elems, 32); FREE(a); - LDKC2Tuple__u832u16Z* ret_conv = MALLOC(sizeof(LDKC2Tuple__u832u16Z), "LDKC2Tuple__u832u16Z"); - *ret_conv = C2Tuple__u832u16Z_new(a_ref, b); +int64_t CS_LDK_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_new(int64_t a, int8_tArray b, int64_t c) { + LDKRawBolt11Invoice a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = RawBolt11Invoice_clone(&a_conv); + LDKThirtyTwoBytes b_ref; + CHECK(b->arr_len == 32); + memcpy(b_ref.data, b->elems, 32); FREE(b); + LDKBolt11InvoiceSignature c_conv; + c_conv.inner = untag_ptr(c); + c_conv.is_owned = ptr_is_owned(c); + CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv); + c_conv = Bolt11InvoiceSignature_clone(&c_conv); + LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ), "LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ"); + *ret_conv = C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_new(a_conv, b_ref, c_conv); return tag_ptr(ret_conv, true); } -void CS_LDK_C2Tuple__u832u16Z_free(int64_t _res) { +void CS_LDK_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKC2Tuple__u832u16Z _res_conv = *(LDKC2Tuple__u832u16Z*)(_res_ptr); + LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ _res_conv = *(LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ*)(_res_ptr); FREE(untag_ptr(_res)); - C2Tuple__u832u16Z_free(_res_conv); + C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_free(_res_conv); } -int64_t CS_LDK_CResult_PaymentRelayDecodeErrorZ_ok(int64_t o) { - LDKPaymentRelay o_conv; +int64_t CS_LDK_CResult_PayeePubKeySecp256k1ErrorZ_ok(int64_t o) { + LDKPayeePubKey o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = PaymentRelay_clone(&o_conv); - LDKCResult_PaymentRelayDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentRelayDecodeErrorZ), "LDKCResult_PaymentRelayDecodeErrorZ"); - *ret_conv = CResult_PaymentRelayDecodeErrorZ_ok(o_conv); + o_conv = PayeePubKey_clone(&o_conv); + LDKCResult_PayeePubKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeySecp256k1ErrorZ), "LDKCResult_PayeePubKeySecp256k1ErrorZ"); + *ret_conv = CResult_PayeePubKeySecp256k1ErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PaymentRelayDecodeErrorZ_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_PaymentRelayDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentRelayDecodeErrorZ), "LDKCResult_PaymentRelayDecodeErrorZ"); - *ret_conv = CResult_PaymentRelayDecodeErrorZ_err(e_conv); +int64_t CS_LDK_CResult_PayeePubKeySecp256k1ErrorZ_err(int32_t e) { + LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_cs(e); + LDKCResult_PayeePubKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeySecp256k1ErrorZ), "LDKCResult_PayeePubKeySecp256k1ErrorZ"); + *ret_conv = CResult_PayeePubKeySecp256k1ErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_PaymentRelayDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_PaymentRelayDecodeErrorZ* o_conv = (LDKCResult_PaymentRelayDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_PaymentRelayDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_PayeePubKeySecp256k1ErrorZ_is_ok(int64_t o) { + LDKCResult_PayeePubKeySecp256k1ErrorZ* o_conv = (LDKCResult_PayeePubKeySecp256k1ErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_PayeePubKeySecp256k1ErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_PaymentRelayDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_PayeePubKeySecp256k1ErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_PaymentRelayDecodeErrorZ _res_conv = *(LDKCResult_PaymentRelayDecodeErrorZ*)(_res_ptr); + LDKCResult_PayeePubKeySecp256k1ErrorZ _res_conv = *(LDKCResult_PayeePubKeySecp256k1ErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_PaymentRelayDecodeErrorZ_free(_res_conv); + CResult_PayeePubKeySecp256k1ErrorZ_free(_res_conv); } -static inline uint64_t CResult_PaymentRelayDecodeErrorZ_clone_ptr(LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_PaymentRelayDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentRelayDecodeErrorZ), "LDKCResult_PaymentRelayDecodeErrorZ"); - *ret_conv = CResult_PaymentRelayDecodeErrorZ_clone(arg); +static inline uint64_t CResult_PayeePubKeySecp256k1ErrorZ_clone_ptr(LDKCResult_PayeePubKeySecp256k1ErrorZ *NONNULL_PTR arg) { + LDKCResult_PayeePubKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeySecp256k1ErrorZ), "LDKCResult_PayeePubKeySecp256k1ErrorZ"); + *ret_conv = CResult_PayeePubKeySecp256k1ErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PaymentRelayDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_PaymentRelayDecodeErrorZ* arg_conv = (LDKCResult_PaymentRelayDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_PaymentRelayDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_PayeePubKeySecp256k1ErrorZ_clone_ptr(int64_t arg) { + LDKCResult_PayeePubKeySecp256k1ErrorZ* arg_conv = (LDKCResult_PayeePubKeySecp256k1ErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PayeePubKeySecp256k1ErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_PaymentRelayDecodeErrorZ_clone(int64_t orig) { - LDKCResult_PaymentRelayDecodeErrorZ* orig_conv = (LDKCResult_PaymentRelayDecodeErrorZ*)untag_ptr(orig); - LDKCResult_PaymentRelayDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentRelayDecodeErrorZ), "LDKCResult_PaymentRelayDecodeErrorZ"); - *ret_conv = CResult_PaymentRelayDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_PayeePubKeySecp256k1ErrorZ_clone(int64_t orig) { + LDKCResult_PayeePubKeySecp256k1ErrorZ* orig_conv = (LDKCResult_PayeePubKeySecp256k1ErrorZ*)untag_ptr(orig); + LDKCResult_PayeePubKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeySecp256k1ErrorZ), "LDKCResult_PayeePubKeySecp256k1ErrorZ"); + *ret_conv = CResult_PayeePubKeySecp256k1ErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PaymentConstraintsDecodeErrorZ_ok(int64_t o) { - LDKPaymentConstraints o_conv; +void CS_LDK_CVec_PrivateRouteZ_free(int64_tArray _res) { + LDKCVec_PrivateRouteZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPrivateRoute), "LDKCVec_PrivateRouteZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = _res->elems; + for (size_t o = 0; o < _res_constr.datalen; o++) { + int64_t _res_conv_14 = _res_vals[o]; + LDKPrivateRoute _res_conv_14_conv; + _res_conv_14_conv.inner = untag_ptr(_res_conv_14); + _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv); + _res_constr.data[o] = _res_conv_14_conv; + } + FREE(_res); + CVec_PrivateRouteZ_free(_res_constr); +} + +int64_t CS_LDK_CResult_PositiveTimestampCreationErrorZ_ok(int64_t o) { + LDKPositiveTimestamp o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = PaymentConstraints_clone(&o_conv); - LDKCResult_PaymentConstraintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentConstraintsDecodeErrorZ), "LDKCResult_PaymentConstraintsDecodeErrorZ"); - *ret_conv = CResult_PaymentConstraintsDecodeErrorZ_ok(o_conv); + o_conv = PositiveTimestamp_clone(&o_conv); + LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); + *ret_conv = CResult_PositiveTimestampCreationErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PaymentConstraintsDecodeErrorZ_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_PaymentConstraintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentConstraintsDecodeErrorZ), "LDKCResult_PaymentConstraintsDecodeErrorZ"); - *ret_conv = CResult_PaymentConstraintsDecodeErrorZ_err(e_conv); +int64_t CS_LDK_CResult_PositiveTimestampCreationErrorZ_err(int32_t e) { + LDKCreationError e_conv = LDKCreationError_from_cs(e); + LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); + *ret_conv = CResult_PositiveTimestampCreationErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_PaymentConstraintsDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_PaymentConstraintsDecodeErrorZ* o_conv = (LDKCResult_PaymentConstraintsDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_PaymentConstraintsDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_PositiveTimestampCreationErrorZ_is_ok(int64_t o) { + LDKCResult_PositiveTimestampCreationErrorZ* o_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_PositiveTimestampCreationErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_PaymentConstraintsDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_PositiveTimestampCreationErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_PaymentConstraintsDecodeErrorZ _res_conv = *(LDKCResult_PaymentConstraintsDecodeErrorZ*)(_res_ptr); + LDKCResult_PositiveTimestampCreationErrorZ _res_conv = *(LDKCResult_PositiveTimestampCreationErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_PaymentConstraintsDecodeErrorZ_free(_res_conv); + CResult_PositiveTimestampCreationErrorZ_free(_res_conv); } -static inline uint64_t CResult_PaymentConstraintsDecodeErrorZ_clone_ptr(LDKCResult_PaymentConstraintsDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_PaymentConstraintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentConstraintsDecodeErrorZ), "LDKCResult_PaymentConstraintsDecodeErrorZ"); - *ret_conv = CResult_PaymentConstraintsDecodeErrorZ_clone(arg); +static inline uint64_t CResult_PositiveTimestampCreationErrorZ_clone_ptr(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); + *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PaymentConstraintsDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_PaymentConstraintsDecodeErrorZ* arg_conv = (LDKCResult_PaymentConstraintsDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_PaymentConstraintsDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_PositiveTimestampCreationErrorZ_clone_ptr(int64_t arg) { + LDKCResult_PositiveTimestampCreationErrorZ* arg_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PositiveTimestampCreationErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_PaymentConstraintsDecodeErrorZ_clone(int64_t orig) { - LDKCResult_PaymentConstraintsDecodeErrorZ* orig_conv = (LDKCResult_PaymentConstraintsDecodeErrorZ*)untag_ptr(orig); - LDKCResult_PaymentConstraintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentConstraintsDecodeErrorZ), "LDKCResult_PaymentConstraintsDecodeErrorZ"); - *ret_conv = CResult_PaymentConstraintsDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_PositiveTimestampCreationErrorZ_clone(int64_t orig) { + LDKCResult_PositiveTimestampCreationErrorZ* orig_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(orig); + LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); + *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PaymentContextDecodeErrorZ_ok(int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKPaymentContext o_conv = *(LDKPaymentContext*)(o_ptr); - o_conv = PaymentContext_clone((LDKPaymentContext*)untag_ptr(o)); - LDKCResult_PaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentContextDecodeErrorZ), "LDKCResult_PaymentContextDecodeErrorZ"); - *ret_conv = CResult_PaymentContextDecodeErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_NoneBolt11SemanticErrorZ_ok() { + LDKCResult_NoneBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt11SemanticErrorZ), "LDKCResult_NoneBolt11SemanticErrorZ"); + *ret_conv = CResult_NoneBolt11SemanticErrorZ_ok(); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PaymentContextDecodeErrorZ_err(int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); - e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_PaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentContextDecodeErrorZ), "LDKCResult_PaymentContextDecodeErrorZ"); - *ret_conv = CResult_PaymentContextDecodeErrorZ_err(e_conv); +int64_t CS_LDK_CResult_NoneBolt11SemanticErrorZ_err(int32_t e) { + LDKBolt11SemanticError e_conv = LDKBolt11SemanticError_from_cs(e); + LDKCResult_NoneBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt11SemanticErrorZ), "LDKCResult_NoneBolt11SemanticErrorZ"); + *ret_conv = CResult_NoneBolt11SemanticErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_PaymentContextDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_PaymentContextDecodeErrorZ* o_conv = (LDKCResult_PaymentContextDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_PaymentContextDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_NoneBolt11SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_NoneBolt11SemanticErrorZ* o_conv = (LDKCResult_NoneBolt11SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_NoneBolt11SemanticErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_PaymentContextDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_NoneBolt11SemanticErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_PaymentContextDecodeErrorZ _res_conv = *(LDKCResult_PaymentContextDecodeErrorZ*)(_res_ptr); + LDKCResult_NoneBolt11SemanticErrorZ _res_conv = *(LDKCResult_NoneBolt11SemanticErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_PaymentContextDecodeErrorZ_free(_res_conv); + CResult_NoneBolt11SemanticErrorZ_free(_res_conv); } -static inline uint64_t CResult_PaymentContextDecodeErrorZ_clone_ptr(LDKCResult_PaymentContextDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_PaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentContextDecodeErrorZ), "LDKCResult_PaymentContextDecodeErrorZ"); - *ret_conv = CResult_PaymentContextDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t CS_LDK_CResult_PaymentContextDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_PaymentContextDecodeErrorZ* arg_conv = (LDKCResult_PaymentContextDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_PaymentContextDecodeErrorZ_clone_ptr(arg_conv); +static inline uint64_t CResult_NoneBolt11SemanticErrorZ_clone_ptr(LDKCResult_NoneBolt11SemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt11SemanticErrorZ), "LDKCResult_NoneBolt11SemanticErrorZ"); + *ret_conv = CResult_NoneBolt11SemanticErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_NoneBolt11SemanticErrorZ_clone_ptr(int64_t arg) { + LDKCResult_NoneBolt11SemanticErrorZ* arg_conv = (LDKCResult_NoneBolt11SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_NoneBolt11SemanticErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_PaymentContextDecodeErrorZ_clone(int64_t orig) { - LDKCResult_PaymentContextDecodeErrorZ* orig_conv = (LDKCResult_PaymentContextDecodeErrorZ*)untag_ptr(orig); - LDKCResult_PaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentContextDecodeErrorZ), "LDKCResult_PaymentContextDecodeErrorZ"); - *ret_conv = CResult_PaymentContextDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_NoneBolt11SemanticErrorZ_clone(int64_t orig) { + LDKCResult_NoneBolt11SemanticErrorZ* orig_conv = (LDKCResult_NoneBolt11SemanticErrorZ*)untag_ptr(orig); + LDKCResult_NoneBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt11SemanticErrorZ), "LDKCResult_NoneBolt11SemanticErrorZ"); + *ret_conv = CResult_NoneBolt11SemanticErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_ok(int64_t o) { - LDKUnknownPaymentContext o_conv; +int64_t CS_LDK_CResult_Bolt11InvoiceBolt11SemanticErrorZ_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 = UnknownPaymentContext_clone(&o_conv); - LDKCResult_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); - *ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_ok(o_conv); + o_conv = Bolt11Invoice_clone(&o_conv); + LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ), "LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ"); + *ret_conv = CResult_Bolt11InvoiceBolt11SemanticErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_err(int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); - e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); - *ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_err(e_conv); +int64_t CS_LDK_CResult_Bolt11InvoiceBolt11SemanticErrorZ_err(int32_t e) { + LDKBolt11SemanticError e_conv = LDKBolt11SemanticError_from_cs(e); + LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ), "LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ"); + *ret_conv = CResult_Bolt11InvoiceBolt11SemanticErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_UnknownPaymentContextDecodeErrorZ* o_conv = (LDKCResult_UnknownPaymentContextDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_Bolt11InvoiceBolt11SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* o_conv = (LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_Bolt11InvoiceBolt11SemanticErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_Bolt11InvoiceBolt11SemanticErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_UnknownPaymentContextDecodeErrorZ _res_conv = *(LDKCResult_UnknownPaymentContextDecodeErrorZ*)(_res_ptr); + LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ _res_conv = *(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_UnknownPaymentContextDecodeErrorZ_free(_res_conv); + CResult_Bolt11InvoiceBolt11SemanticErrorZ_free(_res_conv); } -static inline uint64_t CResult_UnknownPaymentContextDecodeErrorZ_clone_ptr(LDKCResult_UnknownPaymentContextDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); - *ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_clone(arg); +static inline uint64_t CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone_ptr(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ), "LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ"); + *ret_conv = CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_UnknownPaymentContextDecodeErrorZ* arg_conv = (LDKCResult_UnknownPaymentContextDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone_ptr(int64_t arg) { + LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* arg_conv = (LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_clone(int64_t orig) { - LDKCResult_UnknownPaymentContextDecodeErrorZ* orig_conv = (LDKCResult_UnknownPaymentContextDecodeErrorZ*)untag_ptr(orig); - LDKCResult_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); - *ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone(int64_t orig) { + LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* orig_conv = (LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ*)untag_ptr(orig); + LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ), "LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ"); + *ret_conv = CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_ok(int64_t o) { - LDKBolt12OfferContext o_conv; +int64_t CS_LDK_CResult_DescriptionCreationErrorZ_ok(int64_t o) { + LDKDescription o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = Bolt12OfferContext_clone(&o_conv); - LDKCResult_Bolt12OfferContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12OfferContextDecodeErrorZ), "LDKCResult_Bolt12OfferContextDecodeErrorZ"); - *ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_ok(o_conv); + o_conv = Description_clone(&o_conv); + LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); + *ret_conv = CResult_DescriptionCreationErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_err(int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); - e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_Bolt12OfferContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12OfferContextDecodeErrorZ), "LDKCResult_Bolt12OfferContextDecodeErrorZ"); - *ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_err(e_conv); +int64_t CS_LDK_CResult_DescriptionCreationErrorZ_err(int32_t e) { + LDKCreationError e_conv = LDKCreationError_from_cs(e); + LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); + *ret_conv = CResult_DescriptionCreationErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_Bolt12OfferContextDecodeErrorZ* o_conv = (LDKCResult_Bolt12OfferContextDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_DescriptionCreationErrorZ_is_ok(int64_t o) { + LDKCResult_DescriptionCreationErrorZ* o_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_DescriptionCreationErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_DescriptionCreationErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_Bolt12OfferContextDecodeErrorZ _res_conv = *(LDKCResult_Bolt12OfferContextDecodeErrorZ*)(_res_ptr); + LDKCResult_DescriptionCreationErrorZ _res_conv = *(LDKCResult_DescriptionCreationErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_Bolt12OfferContextDecodeErrorZ_free(_res_conv); + CResult_DescriptionCreationErrorZ_free(_res_conv); } -static inline uint64_t CResult_Bolt12OfferContextDecodeErrorZ_clone_ptr(LDKCResult_Bolt12OfferContextDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_Bolt12OfferContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12OfferContextDecodeErrorZ), "LDKCResult_Bolt12OfferContextDecodeErrorZ"); - *ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_clone(arg); +static inline uint64_t CResult_DescriptionCreationErrorZ_clone_ptr(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); + *ret_conv = CResult_DescriptionCreationErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_Bolt12OfferContextDecodeErrorZ* arg_conv = (LDKCResult_Bolt12OfferContextDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_DescriptionCreationErrorZ_clone_ptr(int64_t arg) { + LDKCResult_DescriptionCreationErrorZ* arg_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_DescriptionCreationErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_clone(int64_t orig) { - LDKCResult_Bolt12OfferContextDecodeErrorZ* orig_conv = (LDKCResult_Bolt12OfferContextDecodeErrorZ*)untag_ptr(orig); - LDKCResult_Bolt12OfferContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12OfferContextDecodeErrorZ), "LDKCResult_Bolt12OfferContextDecodeErrorZ"); - *ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_DescriptionCreationErrorZ_clone(int64_t orig) { + LDKCResult_DescriptionCreationErrorZ* orig_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(orig); + LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); + *ret_conv = CResult_DescriptionCreationErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_ok(int64_t o) { - LDKBolt12RefundContext o_conv; +int64_t CS_LDK_CResult_PrivateRouteCreationErrorZ_ok(int64_t o) { + LDKPrivateRoute o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = Bolt12RefundContext_clone(&o_conv); - LDKCResult_Bolt12RefundContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12RefundContextDecodeErrorZ), "LDKCResult_Bolt12RefundContextDecodeErrorZ"); - *ret_conv = CResult_Bolt12RefundContextDecodeErrorZ_ok(o_conv); + o_conv = PrivateRoute_clone(&o_conv); + LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); + *ret_conv = CResult_PrivateRouteCreationErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_err(int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); - e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_Bolt12RefundContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12RefundContextDecodeErrorZ), "LDKCResult_Bolt12RefundContextDecodeErrorZ"); - *ret_conv = CResult_Bolt12RefundContextDecodeErrorZ_err(e_conv); +int64_t CS_LDK_CResult_PrivateRouteCreationErrorZ_err(int32_t e) { + LDKCreationError e_conv = LDKCreationError_from_cs(e); + LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); + *ret_conv = CResult_PrivateRouteCreationErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_Bolt12RefundContextDecodeErrorZ* o_conv = (LDKCResult_Bolt12RefundContextDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_Bolt12RefundContextDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_PrivateRouteCreationErrorZ_is_ok(int64_t o) { + LDKCResult_PrivateRouteCreationErrorZ* o_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_PrivateRouteCreationErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_PrivateRouteCreationErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_Bolt12RefundContextDecodeErrorZ _res_conv = *(LDKCResult_Bolt12RefundContextDecodeErrorZ*)(_res_ptr); + LDKCResult_PrivateRouteCreationErrorZ _res_conv = *(LDKCResult_PrivateRouteCreationErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_Bolt12RefundContextDecodeErrorZ_free(_res_conv); + CResult_PrivateRouteCreationErrorZ_free(_res_conv); } -static inline uint64_t CResult_Bolt12RefundContextDecodeErrorZ_clone_ptr(LDKCResult_Bolt12RefundContextDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_Bolt12RefundContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12RefundContextDecodeErrorZ), "LDKCResult_Bolt12RefundContextDecodeErrorZ"); - *ret_conv = CResult_Bolt12RefundContextDecodeErrorZ_clone(arg); +static inline uint64_t CResult_PrivateRouteCreationErrorZ_clone_ptr(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); + *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_Bolt12RefundContextDecodeErrorZ* arg_conv = (LDKCResult_Bolt12RefundContextDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_Bolt12RefundContextDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_PrivateRouteCreationErrorZ_clone_ptr(int64_t arg) { + LDKCResult_PrivateRouteCreationErrorZ* arg_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PrivateRouteCreationErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_clone(int64_t orig) { - LDKCResult_Bolt12RefundContextDecodeErrorZ* orig_conv = (LDKCResult_Bolt12RefundContextDecodeErrorZ*)untag_ptr(orig); - LDKCResult_Bolt12RefundContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12RefundContextDecodeErrorZ), "LDKCResult_Bolt12RefundContextDecodeErrorZ"); - *ret_conv = CResult_Bolt12RefundContextDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_PrivateRouteCreationErrorZ_clone(int64_t orig) { + LDKCResult_PrivateRouteCreationErrorZ* orig_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(orig); + LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); + *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -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_OutPointDecodeErrorZ_ok(int64_t o) { + LDKOutPoint o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = OutPoint_clone(&o_conv); + LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); + *ret_conv = CResult_OutPointDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t 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_OutPointDecodeErrorZ_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_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); + *ret_conv = CResult_OutPointDecodeErrorZ_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_OutPointDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_OutPointDecodeErrorZ* o_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OutPointDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_StrSecp256k1ErrorZ_free(int64_t _res) { +void CS_LDK_CResult_OutPointDecodeErrorZ_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_OutPointDecodeErrorZ _res_conv = *(LDKCResult_OutPointDecodeErrorZ*)(_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_OutPointDecodeErrorZ_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_OutPointDecodeErrorZ_clone_ptr(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); + *ret_conv = CResult_OutPointDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -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_OutPointDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_OutPointDecodeErrorZ* arg_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OutPointDecodeErrorZ_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_OutPointDecodeErrorZ_clone(int64_t orig) { + LDKCResult_OutPointDecodeErrorZ* orig_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(orig); + LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); + *ret_conv = CResult_OutPointDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -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_BigSizeDecodeErrorZ_ok(int64_t o) { + LDKBigSize o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = BigSize_clone(&o_conv); + LDKCResult_BigSizeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BigSizeDecodeErrorZ), "LDKCResult_BigSizeDecodeErrorZ"); + *ret_conv = CResult_BigSizeDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -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_BigSizeDecodeErrorZ_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_BigSizeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BigSizeDecodeErrorZ), "LDKCResult_BigSizeDecodeErrorZ"); + *ret_conv = CResult_BigSizeDecodeErrorZ_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_BigSizeDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_BigSizeDecodeErrorZ* o_conv = (LDKCResult_BigSizeDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_BigSizeDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(int64_t _res) { +void CS_LDK_CResult_BigSizeDecodeErrorZ_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_BigSizeDecodeErrorZ _res_conv = *(LDKCResult_BigSizeDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(_res_conv); + CResult_BigSizeDecodeErrorZ_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_BigSizeDecodeErrorZ_clone_ptr(LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_BigSizeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BigSizeDecodeErrorZ), "LDKCResult_BigSizeDecodeErrorZ"); + *ret_conv = CResult_BigSizeDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -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_BigSizeDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_BigSizeDecodeErrorZ* arg_conv = (LDKCResult_BigSizeDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BigSizeDecodeErrorZ_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_BigSizeDecodeErrorZ_clone(int64_t orig) { + LDKCResult_BigSizeDecodeErrorZ* orig_conv = (LDKCResult_BigSizeDecodeErrorZ*)untag_ptr(orig); + LDKCResult_BigSizeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BigSizeDecodeErrorZ), "LDKCResult_BigSizeDecodeErrorZ"); + *ret_conv = CResult_BigSizeDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -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); +int64_t CS_LDK_CResult_HostnameDecodeErrorZ_ok(int64_t o) { + LDKHostname o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = Hostname_clone(&o_conv); + LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); + *ret_conv = CResult_HostnameDecodeErrorZ_ok(o_conv); 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); +int64_t CS_LDK_CResult_HostnameDecodeErrorZ_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_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); + *ret_conv = CResult_HostnameDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -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); +jboolean CS_LDK_CResult_HostnameDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_HostnameDecodeErrorZ* o_conv = (LDKCResult_HostnameDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_HostnameDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_TxOutUtxoLookupErrorZ_free(int64_t _res) { +void CS_LDK_CResult_HostnameDecodeErrorZ_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); + LDKCResult_HostnameDecodeErrorZ _res_conv = *(LDKCResult_HostnameDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_TxOutUtxoLookupErrorZ_free(_res_conv); + CResult_HostnameDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_TxOutUtxoLookupErrorZ_clone_ptr(LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR arg) { - LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); - *ret_conv = CResult_TxOutUtxoLookupErrorZ_clone(arg); +static inline uint64_t CResult_HostnameDecodeErrorZ_clone_ptr(LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); + *ret_conv = CResult_HostnameDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t 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_CResult_HostnameDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_HostnameDecodeErrorZ* arg_conv = (LDKCResult_HostnameDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_HostnameDecodeErrorZ_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); +int64_t CS_LDK_CResult_HostnameDecodeErrorZ_clone(int64_t orig) { + LDKCResult_HostnameDecodeErrorZ* orig_conv = (LDKCResult_HostnameDecodeErrorZ*)untag_ptr(orig); + LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); + *ret_conv = CResult_HostnameDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -static inline uint64_t C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone_ptr(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *NONNULL_PTR arg) { - LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ), "LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ"); - *ret_conv = C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone(arg); +int64_t CS_LDK_CResult_TransactionU16LenLimitedNoneZ_ok(int64_t o) { + LDKTransactionU16LenLimited o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = TransactionU16LenLimited_clone(&o_conv); + LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); + *ret_conv = CResult_TransactionU16LenLimitedNoneZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone_ptr(int64_t arg) { - LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ* arg_conv = (LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ*)untag_ptr(arg); - int64_t ret_conv = C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone_ptr(arg_conv); - return ret_conv; -} -int64_t CS_LDK_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone(int64_t orig) { - LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ* orig_conv = (LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ*)untag_ptr(orig); - LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ), "LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ"); - *ret_conv = C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone(orig_conv); +int64_t CS_LDK_CResult_TransactionU16LenLimitedNoneZ_err() { + LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); + *ret_conv = CResult_TransactionU16LenLimitedNoneZ_err(); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_new(int8_tArray a, int64_t b, int64_t c) { - LDKPublicKey a_ref; - CHECK(a->arr_len == 33); - memcpy(a_ref.compressed_form, a->elems, 33); FREE(a); - LDKOnionMessage b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv = OnionMessage_clone(&b_conv); - void* c_ptr = untag_ptr(c); - CHECK_ACCESS(c_ptr); - LDKCOption_CVec_SocketAddressZZ c_conv = *(LDKCOption_CVec_SocketAddressZZ*)(c_ptr); - c_conv = COption_CVec_SocketAddressZZ_clone((LDKCOption_CVec_SocketAddressZZ*)untag_ptr(c)); - LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ), "LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ"); - *ret_conv = C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_new(a_ref, b_conv, c_conv); - return tag_ptr(ret_conv, true); +jboolean CS_LDK_CResult_TransactionU16LenLimitedNoneZ_is_ok(int64_t o) { + LDKCResult_TransactionU16LenLimitedNoneZ* o_conv = (LDKCResult_TransactionU16LenLimitedNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_TransactionU16LenLimitedNoneZ_is_ok(o_conv); + return ret_conv; } -void CS_LDK_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_free(int64_t _res) { +void CS_LDK_CResult_TransactionU16LenLimitedNoneZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ _res_conv = *(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ*)(_res_ptr); + LDKCResult_TransactionU16LenLimitedNoneZ _res_conv = *(LDKCResult_TransactionU16LenLimitedNoneZ*)(_res_ptr); FREE(untag_ptr(_res)); - C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_free(_res_conv); + CResult_TransactionU16LenLimitedNoneZ_free(_res_conv); } -int64_t CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_ok(int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ o_conv = *(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ*)(o_ptr); - o_conv = C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone((LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ*)untag_ptr(o)); - LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ), "LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ"); - *ret_conv = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_ok(o_conv); +static inline uint64_t CResult_TransactionU16LenLimitedNoneZ_clone_ptr(LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR arg) { + LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); + *ret_conv = CResult_TransactionU16LenLimitedNoneZ_clone(arg); return tag_ptr(ret_conv, true); } +int64_t CS_LDK_CResult_TransactionU16LenLimitedNoneZ_clone_ptr(int64_t arg) { + LDKCResult_TransactionU16LenLimitedNoneZ* arg_conv = (LDKCResult_TransactionU16LenLimitedNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_TransactionU16LenLimitedNoneZ_clone_ptr(arg_conv); + return ret_conv; +} -int64_t CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_TransactionU16LenLimitedNoneZ_clone(int64_t orig) { + LDKCResult_TransactionU16LenLimitedNoneZ* orig_conv = (LDKCResult_TransactionU16LenLimitedNoneZ*)untag_ptr(orig); + LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); + *ret_conv = CResult_TransactionU16LenLimitedNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_ok(int64_t o) { + LDKTransactionU16LenLimited o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = TransactionU16LenLimited_clone(&o_conv); + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); + *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_err(int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); - LDKSendError e_conv = *(LDKSendError*)(e_ptr); - e_conv = SendError_clone((LDKSendError*)untag_ptr(e)); - LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ), "LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ"); - *ret_conv = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_err(e_conv); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); + *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_is_ok(int64_t o) { - LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* o_conv = (LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* o_conv = (LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_free(int64_t _res) { +void CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ _res_conv = *(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ*)(_res_ptr); + LDKCResult_TransactionU16LenLimitedDecodeErrorZ _res_conv = *(LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_free(_res_conv); + CResult_TransactionU16LenLimitedDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone_ptr(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ *NONNULL_PTR arg) { - LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ), "LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ"); - *ret_conv = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone(arg); +static inline uint64_t CResult_TransactionU16LenLimitedDecodeErrorZ_clone_ptr(LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); + *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone_ptr(int64_t arg) { - LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* arg_conv = (LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* arg_conv = (LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone(int64_t orig) { - LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* orig_conv = (LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ*)untag_ptr(orig); - LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ), "LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ"); - *ret_conv = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_clone(int64_t orig) { + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* orig_conv = (LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)untag_ptr(orig); + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); + *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PeeledOnionNoneZ_ok(int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKPeeledOnion o_conv = *(LDKPeeledOnion*)(o_ptr); - o_conv = PeeledOnion_clone((LDKPeeledOnion*)untag_ptr(o)); - LDKCResult_PeeledOnionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PeeledOnionNoneZ), "LDKCResult_PeeledOnionNoneZ"); - *ret_conv = CResult_PeeledOnionNoneZ_ok(o_conv); +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_PeeledOnionNoneZ_err() { - LDKCResult_PeeledOnionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PeeledOnionNoneZ), "LDKCResult_PeeledOnionNoneZ"); - *ret_conv = CResult_PeeledOnionNoneZ_err(); +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_PeeledOnionNoneZ_is_ok(int64_t o) { - LDKCResult_PeeledOnionNoneZ* o_conv = (LDKCResult_PeeledOnionNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_PeeledOnionNoneZ_is_ok(o_conv); +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_PeeledOnionNoneZ_free(int64_t _res) { +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_PeeledOnionNoneZ _res_conv = *(LDKCResult_PeeledOnionNoneZ*)(_res_ptr); + LDKCResult_UntrustedStringDecodeErrorZ _res_conv = *(LDKCResult_UntrustedStringDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_PeeledOnionNoneZ_free(_res_conv); + CResult_UntrustedStringDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_PeeledOnionNoneZ_clone_ptr(LDKCResult_PeeledOnionNoneZ *NONNULL_PTR arg) { - LDKCResult_PeeledOnionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PeeledOnionNoneZ), "LDKCResult_PeeledOnionNoneZ"); - *ret_conv = CResult_PeeledOnionNoneZ_clone(arg); +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_PeeledOnionNoneZ_clone_ptr(int64_t arg) { - LDKCResult_PeeledOnionNoneZ* arg_conv = (LDKCResult_PeeledOnionNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_PeeledOnionNoneZ_clone_ptr(arg_conv); +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_PeeledOnionNoneZ_clone(int64_t orig) { - LDKCResult_PeeledOnionNoneZ* orig_conv = (LDKCResult_PeeledOnionNoneZ*)untag_ptr(orig); - LDKCResult_PeeledOnionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PeeledOnionNoneZ), "LDKCResult_PeeledOnionNoneZ"); - *ret_conv = CResult_PeeledOnionNoneZ_clone(orig_conv); +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_SendSuccessSendErrorZ_ok(int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKSendSuccess o_conv = *(LDKSendSuccess*)(o_ptr); - o_conv = SendSuccess_clone((LDKSendSuccess*)untag_ptr(o)); - LDKCResult_SendSuccessSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SendSuccessSendErrorZ), "LDKCResult_SendSuccessSendErrorZ"); - *ret_conv = CResult_SendSuccessSendErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_ChannelIdDecodeErrorZ_ok(int64_t o) { + LDKChannelId o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = ChannelId_clone(&o_conv); + LDKCResult_ChannelIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdDecodeErrorZ), "LDKCResult_ChannelIdDecodeErrorZ"); + *ret_conv = CResult_ChannelIdDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_SendSuccessSendErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_ChannelIdDecodeErrorZ_err(int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); - LDKSendError e_conv = *(LDKSendError*)(e_ptr); - e_conv = SendError_clone((LDKSendError*)untag_ptr(e)); - LDKCResult_SendSuccessSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SendSuccessSendErrorZ), "LDKCResult_SendSuccessSendErrorZ"); - *ret_conv = CResult_SendSuccessSendErrorZ_err(e_conv); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_ChannelIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdDecodeErrorZ), "LDKCResult_ChannelIdDecodeErrorZ"); + *ret_conv = CResult_ChannelIdDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_SendSuccessSendErrorZ_is_ok(int64_t o) { - LDKCResult_SendSuccessSendErrorZ* o_conv = (LDKCResult_SendSuccessSendErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_SendSuccessSendErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_ChannelIdDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_ChannelIdDecodeErrorZ* o_conv = (LDKCResult_ChannelIdDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ChannelIdDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_SendSuccessSendErrorZ_free(int64_t _res) { +void CS_LDK_CResult_ChannelIdDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_SendSuccessSendErrorZ _res_conv = *(LDKCResult_SendSuccessSendErrorZ*)(_res_ptr); + LDKCResult_ChannelIdDecodeErrorZ _res_conv = *(LDKCResult_ChannelIdDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_SendSuccessSendErrorZ_free(_res_conv); + CResult_ChannelIdDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_SendSuccessSendErrorZ_clone_ptr(LDKCResult_SendSuccessSendErrorZ *NONNULL_PTR arg) { - LDKCResult_SendSuccessSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SendSuccessSendErrorZ), "LDKCResult_SendSuccessSendErrorZ"); - *ret_conv = CResult_SendSuccessSendErrorZ_clone(arg); +static inline uint64_t CResult_ChannelIdDecodeErrorZ_clone_ptr(LDKCResult_ChannelIdDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdDecodeErrorZ), "LDKCResult_ChannelIdDecodeErrorZ"); + *ret_conv = CResult_ChannelIdDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_SendSuccessSendErrorZ_clone_ptr(int64_t arg) { - LDKCResult_SendSuccessSendErrorZ* arg_conv = (LDKCResult_SendSuccessSendErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_SendSuccessSendErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_ChannelIdDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_ChannelIdDecodeErrorZ* arg_conv = (LDKCResult_ChannelIdDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ChannelIdDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_SendSuccessSendErrorZ_clone(int64_t orig) { - LDKCResult_SendSuccessSendErrorZ* orig_conv = (LDKCResult_SendSuccessSendErrorZ*)untag_ptr(orig); - LDKCResult_SendSuccessSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SendSuccessSendErrorZ), "LDKCResult_SendSuccessSendErrorZ"); - *ret_conv = CResult_SendSuccessSendErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_ChannelIdDecodeErrorZ_clone(int64_t orig) { + LDKCResult_ChannelIdDecodeErrorZ* orig_conv = (LDKCResult_ChannelIdDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ChannelIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdDecodeErrorZ), "LDKCResult_ChannelIdDecodeErrorZ"); + *ret_conv = CResult_ChannelIdDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -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); +static inline uint64_t C2Tuple__u832u16Z_clone_ptr(LDKC2Tuple__u832u16Z *NONNULL_PTR arg) { + LDKC2Tuple__u832u16Z* ret_conv = MALLOC(sizeof(LDKC2Tuple__u832u16Z), "LDKC2Tuple__u832u16Z"); + *ret_conv = C2Tuple__u832u16Z_clone(arg); return tag_ptr(ret_conv, true); } +int64_t CS_LDK_C2Tuple__u832u16Z_clone_ptr(int64_t arg) { + LDKC2Tuple__u832u16Z* arg_conv = (LDKC2Tuple__u832u16Z*)untag_ptr(arg); + int64_t ret_conv = C2Tuple__u832u16Z_clone_ptr(arg_conv); + return ret_conv; +} -int64_t CS_LDK_CResult_BlindedPathNoneZ_err() { - LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); - *ret_conv = CResult_BlindedPathNoneZ_err(); +int64_t CS_LDK_C2Tuple__u832u16Z_clone(int64_t orig) { + LDKC2Tuple__u832u16Z* orig_conv = (LDKC2Tuple__u832u16Z*)untag_ptr(orig); + LDKC2Tuple__u832u16Z* ret_conv = MALLOC(sizeof(LDKC2Tuple__u832u16Z), "LDKC2Tuple__u832u16Z"); + *ret_conv = C2Tuple__u832u16Z_clone(orig_conv); return tag_ptr(ret_conv, true); } -jboolean 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; +int64_t CS_LDK_C2Tuple__u832u16Z_new(int8_tArray a, int16_t b) { + LDKThirtyTwoBytes a_ref; + CHECK(a->arr_len == 32); + memcpy(a_ref.data, a->elems, 32); FREE(a); + LDKC2Tuple__u832u16Z* ret_conv = MALLOC(sizeof(LDKC2Tuple__u832u16Z), "LDKC2Tuple__u832u16Z"); + *ret_conv = C2Tuple__u832u16Z_new(a_ref, b); + return tag_ptr(ret_conv, true); } -void CS_LDK_CResult_BlindedPathNoneZ_free(int64_t _res) { +void CS_LDK_C2Tuple__u832u16Z_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); + LDKC2Tuple__u832u16Z _res_conv = *(LDKC2Tuple__u832u16Z*)(_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); + C2Tuple__u832u16Z_free(_res_conv); } -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); +int64_t CS_LDK_CResult_PaymentRelayDecodeErrorZ_ok(int64_t o) { + LDKPaymentRelay o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = PaymentRelay_clone(&o_conv); + LDKCResult_PaymentRelayDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentRelayDecodeErrorZ), "LDKCResult_PaymentRelayDecodeErrorZ"); + *ret_conv = CResult_PaymentRelayDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -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_PaymentRelayDecodeErrorZ_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_PaymentRelayDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentRelayDecodeErrorZ), "LDKCResult_PaymentRelayDecodeErrorZ"); + *ret_conv = CResult_PaymentRelayDecodeErrorZ_err(e_conv); 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); +jboolean CS_LDK_CResult_PaymentRelayDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_PaymentRelayDecodeErrorZ* o_conv = (LDKCResult_PaymentRelayDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_PaymentRelayDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free(int64_t _res) { +void CS_LDK_CResult_PaymentRelayDecodeErrorZ_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); + LDKCResult_PaymentRelayDecodeErrorZ _res_conv = *(LDKCResult_PaymentRelayDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free(_res_conv); + CResult_PaymentRelayDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone_ptr(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR arg) { - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ), "LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ"); - *ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(arg); +static inline uint64_t CResult_PaymentRelayDecodeErrorZ_clone_ptr(LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_PaymentRelayDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentRelayDecodeErrorZ), "LDKCResult_PaymentRelayDecodeErrorZ"); + *ret_conv = CResult_PaymentRelayDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t 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); +int64_t CS_LDK_CResult_PaymentRelayDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_PaymentRelayDecodeErrorZ* arg_conv = (LDKCResult_PaymentRelayDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PaymentRelayDecodeErrorZ_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); +int64_t CS_LDK_CResult_PaymentRelayDecodeErrorZ_clone(int64_t orig) { + LDKCResult_PaymentRelayDecodeErrorZ* orig_conv = (LDKCResult_PaymentRelayDecodeErrorZ*)untag_ptr(orig); + LDKCResult_PaymentRelayDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentRelayDecodeErrorZ), "LDKCResult_PaymentRelayDecodeErrorZ"); + *ret_conv = CResult_PaymentRelayDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -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; +int64_t CS_LDK_CResult_PaymentConstraintsDecodeErrorZ_ok(int64_t o) { + LDKPaymentConstraints o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = BlindedPath_clone(&o_conv); - LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ"); - *ret_conv = CResult_BlindedPathDecodeErrorZ_ok(o_conv); + o_conv = PaymentConstraints_clone(&o_conv); + LDKCResult_PaymentConstraintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentConstraintsDecodeErrorZ), "LDKCResult_PaymentConstraintsDecodeErrorZ"); + *ret_conv = CResult_PaymentConstraintsDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_BlindedPathDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_PaymentConstraintsDecodeErrorZ_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); + LDKCResult_PaymentConstraintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentConstraintsDecodeErrorZ), "LDKCResult_PaymentConstraintsDecodeErrorZ"); + *ret_conv = CResult_PaymentConstraintsDecodeErrorZ_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_PaymentConstraintsDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_PaymentConstraintsDecodeErrorZ* o_conv = (LDKCResult_PaymentConstraintsDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_PaymentConstraintsDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_BlindedPathDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_PaymentConstraintsDecodeErrorZ_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_PaymentConstraintsDecodeErrorZ _res_conv = *(LDKCResult_PaymentConstraintsDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_BlindedPathDecodeErrorZ_free(_res_conv); + CResult_PaymentConstraintsDecodeErrorZ_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_PaymentConstraintsDecodeErrorZ_clone_ptr(LDKCResult_PaymentConstraintsDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_PaymentConstraintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentConstraintsDecodeErrorZ), "LDKCResult_PaymentConstraintsDecodeErrorZ"); + *ret_conv = CResult_PaymentConstraintsDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t 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_PaymentConstraintsDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_PaymentConstraintsDecodeErrorZ* arg_conv = (LDKCResult_PaymentConstraintsDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PaymentConstraintsDecodeErrorZ_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_PaymentConstraintsDecodeErrorZ_clone(int64_t orig) { + LDKCResult_PaymentConstraintsDecodeErrorZ* orig_conv = (LDKCResult_PaymentConstraintsDecodeErrorZ*)untag_ptr(orig); + LDKCResult_PaymentConstraintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentConstraintsDecodeErrorZ), "LDKCResult_PaymentConstraintsDecodeErrorZ"); + *ret_conv = CResult_PaymentConstraintsDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_BlindedHopDecodeErrorZ_ok(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 = BlindedHop_clone(&o_conv); - LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); - *ret_conv = CResult_BlindedHopDecodeErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_PaymentContextDecodeErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKPaymentContext o_conv = *(LDKPaymentContext*)(o_ptr); + o_conv = PaymentContext_clone((LDKPaymentContext*)untag_ptr(o)); + LDKCResult_PaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentContextDecodeErrorZ), "LDKCResult_PaymentContextDecodeErrorZ"); + *ret_conv = CResult_PaymentContextDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_BlindedHopDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_PaymentContextDecodeErrorZ_err(int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); - *ret_conv = CResult_BlindedHopDecodeErrorZ_err(e_conv); + LDKCResult_PaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentContextDecodeErrorZ), "LDKCResult_PaymentContextDecodeErrorZ"); + *ret_conv = CResult_PaymentContextDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_BlindedHopDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_BlindedHopDecodeErrorZ* o_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_BlindedHopDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_PaymentContextDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_PaymentContextDecodeErrorZ* o_conv = (LDKCResult_PaymentContextDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_PaymentContextDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_BlindedHopDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_PaymentContextDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_BlindedHopDecodeErrorZ _res_conv = *(LDKCResult_BlindedHopDecodeErrorZ*)(_res_ptr); + LDKCResult_PaymentContextDecodeErrorZ _res_conv = *(LDKCResult_PaymentContextDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_BlindedHopDecodeErrorZ_free(_res_conv); + CResult_PaymentContextDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_BlindedHopDecodeErrorZ_clone_ptr(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); - *ret_conv = CResult_BlindedHopDecodeErrorZ_clone(arg); +static inline uint64_t CResult_PaymentContextDecodeErrorZ_clone_ptr(LDKCResult_PaymentContextDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_PaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentContextDecodeErrorZ), "LDKCResult_PaymentContextDecodeErrorZ"); + *ret_conv = CResult_PaymentContextDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_BlindedHopDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_BlindedHopDecodeErrorZ* arg_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_BlindedHopDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_PaymentContextDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_PaymentContextDecodeErrorZ* arg_conv = (LDKCResult_PaymentContextDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PaymentContextDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_BlindedHopDecodeErrorZ_clone(int64_t orig) { - LDKCResult_BlindedHopDecodeErrorZ* orig_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(orig); - LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); - *ret_conv = CResult_BlindedHopDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_PaymentContextDecodeErrorZ_clone(int64_t orig) { + LDKCResult_PaymentContextDecodeErrorZ* orig_conv = (LDKCResult_PaymentContextDecodeErrorZ*)untag_ptr(orig); + LDKCResult_PaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentContextDecodeErrorZ), "LDKCResult_PaymentContextDecodeErrorZ"); + *ret_conv = CResult_PaymentContextDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_InvoiceErrorDecodeErrorZ_ok(int64_t o) { - LDKInvoiceError o_conv; +int64_t CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_ok(int64_t o) { + LDKUnknownPaymentContext o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = InvoiceError_clone(&o_conv); - LDKCResult_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); - *ret_conv = CResult_InvoiceErrorDecodeErrorZ_ok(o_conv); + o_conv = UnknownPaymentContext_clone(&o_conv); + LDKCResult_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); + *ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_InvoiceErrorDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_err(int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); - *ret_conv = CResult_InvoiceErrorDecodeErrorZ_err(e_conv); + LDKCResult_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); + *ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_InvoiceErrorDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_InvoiceErrorDecodeErrorZ* o_conv = (LDKCResult_InvoiceErrorDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_InvoiceErrorDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_UnknownPaymentContextDecodeErrorZ* o_conv = (LDKCResult_UnknownPaymentContextDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_InvoiceErrorDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_InvoiceErrorDecodeErrorZ _res_conv = *(LDKCResult_InvoiceErrorDecodeErrorZ*)(_res_ptr); + LDKCResult_UnknownPaymentContextDecodeErrorZ _res_conv = *(LDKCResult_UnknownPaymentContextDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_InvoiceErrorDecodeErrorZ_free(_res_conv); + CResult_UnknownPaymentContextDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_InvoiceErrorDecodeErrorZ_clone_ptr(LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); - *ret_conv = CResult_InvoiceErrorDecodeErrorZ_clone(arg); +static inline uint64_t CResult_UnknownPaymentContextDecodeErrorZ_clone_ptr(LDKCResult_UnknownPaymentContextDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); + *ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_InvoiceErrorDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_InvoiceErrorDecodeErrorZ* arg_conv = (LDKCResult_InvoiceErrorDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_InvoiceErrorDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_UnknownPaymentContextDecodeErrorZ* arg_conv = (LDKCResult_UnknownPaymentContextDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_InvoiceErrorDecodeErrorZ_clone(int64_t orig) { - LDKCResult_InvoiceErrorDecodeErrorZ* orig_conv = (LDKCResult_InvoiceErrorDecodeErrorZ*)untag_ptr(orig); - LDKCResult_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); - *ret_conv = CResult_InvoiceErrorDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_clone(int64_t orig) { + LDKCResult_UnknownPaymentContextDecodeErrorZ* orig_conv = (LDKCResult_UnknownPaymentContextDecodeErrorZ*)untag_ptr(orig); + LDKCResult_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); + *ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_ok(int64_t o) { - LDKTrackedSpendableOutput o_conv; +int64_t CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_ok(int64_t o) { + LDKBolt12OfferContext o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = TrackedSpendableOutput_clone(&o_conv); - LDKCResult_TrackedSpendableOutputDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TrackedSpendableOutputDecodeErrorZ), "LDKCResult_TrackedSpendableOutputDecodeErrorZ"); - *ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_ok(o_conv); + o_conv = Bolt12OfferContext_clone(&o_conv); + LDKCResult_Bolt12OfferContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12OfferContextDecodeErrorZ), "LDKCResult_Bolt12OfferContextDecodeErrorZ"); + *ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_err(int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_TrackedSpendableOutputDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TrackedSpendableOutputDecodeErrorZ), "LDKCResult_TrackedSpendableOutputDecodeErrorZ"); - *ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_err(e_conv); + LDKCResult_Bolt12OfferContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12OfferContextDecodeErrorZ), "LDKCResult_Bolt12OfferContextDecodeErrorZ"); + *ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_TrackedSpendableOutputDecodeErrorZ* o_conv = (LDKCResult_TrackedSpendableOutputDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_Bolt12OfferContextDecodeErrorZ* o_conv = (LDKCResult_Bolt12OfferContextDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_TrackedSpendableOutputDecodeErrorZ _res_conv = *(LDKCResult_TrackedSpendableOutputDecodeErrorZ*)(_res_ptr); + LDKCResult_Bolt12OfferContextDecodeErrorZ _res_conv = *(LDKCResult_Bolt12OfferContextDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_TrackedSpendableOutputDecodeErrorZ_free(_res_conv); + CResult_Bolt12OfferContextDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_TrackedSpendableOutputDecodeErrorZ_clone_ptr(LDKCResult_TrackedSpendableOutputDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_TrackedSpendableOutputDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TrackedSpendableOutputDecodeErrorZ), "LDKCResult_TrackedSpendableOutputDecodeErrorZ"); - *ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_clone(arg); +static inline uint64_t CResult_Bolt12OfferContextDecodeErrorZ_clone_ptr(LDKCResult_Bolt12OfferContextDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_Bolt12OfferContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12OfferContextDecodeErrorZ), "LDKCResult_Bolt12OfferContextDecodeErrorZ"); + *ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_TrackedSpendableOutputDecodeErrorZ* arg_conv = (LDKCResult_TrackedSpendableOutputDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_Bolt12OfferContextDecodeErrorZ* arg_conv = (LDKCResult_Bolt12OfferContextDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_clone(int64_t orig) { - LDKCResult_TrackedSpendableOutputDecodeErrorZ* orig_conv = (LDKCResult_TrackedSpendableOutputDecodeErrorZ*)untag_ptr(orig); - LDKCResult_TrackedSpendableOutputDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TrackedSpendableOutputDecodeErrorZ), "LDKCResult_TrackedSpendableOutputDecodeErrorZ"); - *ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_clone(int64_t orig) { + LDKCResult_Bolt12OfferContextDecodeErrorZ* orig_conv = (LDKCResult_Bolt12OfferContextDecodeErrorZ*)untag_ptr(orig); + LDKCResult_Bolt12OfferContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12OfferContextDecodeErrorZ), "LDKCResult_Bolt12OfferContextDecodeErrorZ"); + *ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_ok(int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKOutputSpendStatus o_conv = *(LDKOutputSpendStatus*)(o_ptr); - o_conv = OutputSpendStatus_clone((LDKOutputSpendStatus*)untag_ptr(o)); - LDKCResult_OutputSpendStatusDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSpendStatusDecodeErrorZ), "LDKCResult_OutputSpendStatusDecodeErrorZ"); - *ret_conv = CResult_OutputSpendStatusDecodeErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_ok(int64_t o) { + LDKBolt12RefundContext o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = Bolt12RefundContext_clone(&o_conv); + LDKCResult_Bolt12RefundContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12RefundContextDecodeErrorZ), "LDKCResult_Bolt12RefundContextDecodeErrorZ"); + *ret_conv = CResult_Bolt12RefundContextDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_err(int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_OutputSpendStatusDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSpendStatusDecodeErrorZ), "LDKCResult_OutputSpendStatusDecodeErrorZ"); - *ret_conv = CResult_OutputSpendStatusDecodeErrorZ_err(e_conv); + LDKCResult_Bolt12RefundContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12RefundContextDecodeErrorZ), "LDKCResult_Bolt12RefundContextDecodeErrorZ"); + *ret_conv = CResult_Bolt12RefundContextDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_OutputSpendStatusDecodeErrorZ* o_conv = (LDKCResult_OutputSpendStatusDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_OutputSpendStatusDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_Bolt12RefundContextDecodeErrorZ* o_conv = (LDKCResult_Bolt12RefundContextDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_Bolt12RefundContextDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_OutputSpendStatusDecodeErrorZ _res_conv = *(LDKCResult_OutputSpendStatusDecodeErrorZ*)(_res_ptr); + LDKCResult_Bolt12RefundContextDecodeErrorZ _res_conv = *(LDKCResult_Bolt12RefundContextDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_OutputSpendStatusDecodeErrorZ_free(_res_conv); + CResult_Bolt12RefundContextDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_OutputSpendStatusDecodeErrorZ_clone_ptr(LDKCResult_OutputSpendStatusDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_OutputSpendStatusDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSpendStatusDecodeErrorZ), "LDKCResult_OutputSpendStatusDecodeErrorZ"); - *ret_conv = CResult_OutputSpendStatusDecodeErrorZ_clone(arg); +static inline uint64_t CResult_Bolt12RefundContextDecodeErrorZ_clone_ptr(LDKCResult_Bolt12RefundContextDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_Bolt12RefundContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12RefundContextDecodeErrorZ), "LDKCResult_Bolt12RefundContextDecodeErrorZ"); + *ret_conv = CResult_Bolt12RefundContextDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_OutputSpendStatusDecodeErrorZ* arg_conv = (LDKCResult_OutputSpendStatusDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_OutputSpendStatusDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_Bolt12RefundContextDecodeErrorZ* arg_conv = (LDKCResult_Bolt12RefundContextDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_Bolt12RefundContextDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_clone(int64_t orig) { - LDKCResult_OutputSpendStatusDecodeErrorZ* orig_conv = (LDKCResult_OutputSpendStatusDecodeErrorZ*)untag_ptr(orig); - LDKCResult_OutputSpendStatusDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSpendStatusDecodeErrorZ), "LDKCResult_OutputSpendStatusDecodeErrorZ"); - *ret_conv = CResult_OutputSpendStatusDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_clone(int64_t orig) { + LDKCResult_Bolt12RefundContextDecodeErrorZ* orig_conv = (LDKCResult_Bolt12RefundContextDecodeErrorZ*)untag_ptr(orig); + LDKCResult_Bolt12RefundContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12RefundContextDecodeErrorZ), "LDKCResult_Bolt12RefundContextDecodeErrorZ"); + *ret_conv = CResult_Bolt12RefundContextDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_COption_FilterZ_some(int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKFilter o_conv = *(LDKFilter*)(o_ptr); - if (o_conv.free == LDKFilter_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFilter_JCalls_cloned(&o_conv); - } - LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ"); - *ret_copy = COption_FilterZ_some(o_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_CResult_StrSecp256k1ErrorZ_ok(jstring o) { + LDKStr o_conv = str_ref_to_owned_c(o); + LDKCResult_StrSecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StrSecp256k1ErrorZ), "LDKCResult_StrSecp256k1ErrorZ"); + *ret_conv = CResult_StrSecp256k1ErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_COption_FilterZ_none() { - LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ"); - *ret_copy = COption_FilterZ_none(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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); + return tag_ptr(ret_conv, true); } -void CS_LDK_COption_FilterZ_free(int64_t _res) { +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); + return ret_conv; +} + +void CS_LDK_CResult_StrSecp256k1ErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCOption_FilterZ _res_conv = *(LDKCOption_FilterZ*)(_res_ptr); + LDKCResult_StrSecp256k1ErrorZ _res_conv = *(LDKCResult_StrSecp256k1ErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_FilterZ_free(_res_conv); + CResult_StrSecp256k1ErrorZ_free(_res_conv); } -void CS_LDK_CVec_TrackedSpendableOutputZ_free(int64_tArray _res) { - LDKCVec_TrackedSpendableOutputZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTrackedSpendableOutput), "LDKCVec_TrackedSpendableOutputZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = _res->elems; - for (size_t y = 0; y < _res_constr.datalen; y++) { - int64_t _res_conv_24 = _res_vals[y]; - LDKTrackedSpendableOutput _res_conv_24_conv; - _res_conv_24_conv.inner = untag_ptr(_res_conv_24); - _res_conv_24_conv.is_owned = ptr_is_owned(_res_conv_24); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_24_conv); - _res_constr.data[y] = _res_conv_24_conv; - } - FREE(_res); - CVec_TrackedSpendableOutputZ_free(_res_constr); +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_OutputSweeperDecodeErrorZ_ok(int64_t o) { - LDKOutputSweeper o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - // WARNING: we need a move here but no clone is available for LDKOutputSweeper - - LDKCResult_OutputSweeperDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSweeperDecodeErrorZ), "LDKCResult_OutputSweeperDecodeErrorZ"); - *ret_conv = CResult_OutputSweeperDecodeErrorZ_ok(o_conv); +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); } -int64_t CS_LDK_CResult_OutputSweeperDecodeErrorZ_err(int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); - e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_OutputSweeperDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSweeperDecodeErrorZ), "LDKCResult_OutputSweeperDecodeErrorZ"); - *ret_conv = CResult_OutputSweeperDecodeErrorZ_err(e_conv); +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); } - -jboolean CS_LDK_CResult_OutputSweeperDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_OutputSweeperDecodeErrorZ* o_conv = (LDKCResult_OutputSweeperDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_OutputSweeperDecodeErrorZ_is_ok(o_conv); +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; } -void CS_LDK_CResult_OutputSweeperDecodeErrorZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_OutputSweeperDecodeErrorZ _res_conv = *(LDKCResult_OutputSweeperDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_OutputSweeperDecodeErrorZ_free(_res_conv); +int64_t CS_LDK_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_C2Tuple_BestBlockOutputSweeperZ_new(int64_t a, int64_t b) { - LDKBestBlock a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = BestBlock_clone(&a_conv); - LDKOutputSweeper b_conv; +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); - // WARNING: we need a move here but no clone is available for LDKOutputSweeper - - LDKC2Tuple_BestBlockOutputSweeperZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BestBlockOutputSweeperZ), "LDKC2Tuple_BestBlockOutputSweeperZ"); - *ret_conv = C2Tuple_BestBlockOutputSweeperZ_new(a_conv, b_conv); + 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_C2Tuple_BestBlockOutputSweeperZ_free(int64_t _res) { +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); - LDKC2Tuple_BestBlockOutputSweeperZ _res_conv = *(LDKC2Tuple_BestBlockOutputSweeperZ*)(_res_ptr); + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ _res_conv = *(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)(_res_ptr); FREE(untag_ptr(_res)); - C2Tuple_BestBlockOutputSweeperZ_free(_res_conv); + C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(_res_conv); } -int64_t CS_LDK_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_ok(int64_t o) { +int64_t CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); - LDKC2Tuple_BestBlockOutputSweeperZ o_conv = *(LDKC2Tuple_BestBlockOutputSweeperZ*)(o_ptr); - // WARNING: we may need a move here but no clone is available for LDKC2Tuple_BestBlockOutputSweeperZ - LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ), "LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ"); - *ret_conv = CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_ok(o_conv); + 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_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_err(int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); - e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ), "LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ"); - *ret_conv = CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_err(e_conv); +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_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_is_ok(o_conv); +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_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_free(int64_t _res) { +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_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ*)(_res_ptr); + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ _res_conv = *(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_free(_res_conv); + CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(_res_conv); } -int64_t CS_LDK_CResult_DelayedPaymentBasepointDecodeErrorZ_ok(int64_t o) { - LDKDelayedPaymentBasepoint o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = DelayedPaymentBasepoint_clone(&o_conv); - LDKCResult_DelayedPaymentBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentBasepointDecodeErrorZ), "LDKCResult_DelayedPaymentBasepointDecodeErrorZ"); - *ret_conv = CResult_DelayedPaymentBasepointDecodeErrorZ_ok(o_conv); +static inline uint64_t 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_DelayedPaymentBasepointDecodeErrorZ_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_DelayedPaymentBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentBasepointDecodeErrorZ), "LDKCResult_DelayedPaymentBasepointDecodeErrorZ"); - *ret_conv = CResult_DelayedPaymentBasepointDecodeErrorZ_err(e_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); } -jboolean CS_LDK_CResult_DelayedPaymentBasepointDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_DelayedPaymentBasepointDecodeErrorZ* o_conv = (LDKCResult_DelayedPaymentBasepointDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_DelayedPaymentBasepointDecodeErrorZ_is_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_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_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_DelayedPaymentBasepointDecodeErrorZ_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_DelayedPaymentBasepointDecodeErrorZ _res_conv = *(LDKCResult_DelayedPaymentBasepointDecodeErrorZ*)(_res_ptr); + LDKCResult_TxOutUtxoLookupErrorZ _res_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_DelayedPaymentBasepointDecodeErrorZ_free(_res_conv); + CResult_TxOutUtxoLookupErrorZ_free(_res_conv); } -static inline uint64_t CResult_DelayedPaymentBasepointDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentBasepointDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_DelayedPaymentBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentBasepointDecodeErrorZ), "LDKCResult_DelayedPaymentBasepointDecodeErrorZ"); - *ret_conv = CResult_DelayedPaymentBasepointDecodeErrorZ_clone(arg); +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_CResult_DelayedPaymentBasepointDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_DelayedPaymentBasepointDecodeErrorZ* arg_conv = (LDKCResult_DelayedPaymentBasepointDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_DelayedPaymentBasepointDecodeErrorZ_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_CResult_DelayedPaymentBasepointDecodeErrorZ_clone(int64_t orig) { - LDKCResult_DelayedPaymentBasepointDecodeErrorZ* orig_conv = (LDKCResult_DelayedPaymentBasepointDecodeErrorZ*)untag_ptr(orig); - LDKCResult_DelayedPaymentBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentBasepointDecodeErrorZ), "LDKCResult_DelayedPaymentBasepointDecodeErrorZ"); - *ret_conv = CResult_DelayedPaymentBasepointDecodeErrorZ_clone(orig_conv); +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_CResult_DelayedPaymentKeyDecodeErrorZ_ok(int64_t o) { - LDKDelayedPaymentKey o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = DelayedPaymentKey_clone(&o_conv); - LDKCResult_DelayedPaymentKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentKeyDecodeErrorZ), "LDKCResult_DelayedPaymentKeyDecodeErrorZ"); - *ret_conv = CResult_DelayedPaymentKeyDecodeErrorZ_ok(o_conv); +static inline uint64_t C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone_ptr(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *NONNULL_PTR arg) { + LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ), "LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ"); + *ret_conv = C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone(arg); return tag_ptr(ret_conv, true); } +int64_t CS_LDK_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone_ptr(int64_t arg) { + LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ* arg_conv = (LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ*)untag_ptr(arg); + int64_t ret_conv = C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone_ptr(arg_conv); + return ret_conv; +} -int64_t CS_LDK_CResult_DelayedPaymentKeyDecodeErrorZ_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_DelayedPaymentKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentKeyDecodeErrorZ), "LDKCResult_DelayedPaymentKeyDecodeErrorZ"); - *ret_conv = CResult_DelayedPaymentKeyDecodeErrorZ_err(e_conv); +int64_t CS_LDK_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone(int64_t orig) { + LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ* orig_conv = (LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ*)untag_ptr(orig); + LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ), "LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ"); + *ret_conv = C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_DelayedPaymentKeyDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_DelayedPaymentKeyDecodeErrorZ* o_conv = (LDKCResult_DelayedPaymentKeyDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_DelayedPaymentKeyDecodeErrorZ_is_ok(o_conv); - return ret_conv; +int64_t CS_LDK_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_new(int8_tArray a, int64_t b, int64_t c) { + LDKPublicKey a_ref; + CHECK(a->arr_len == 33); + memcpy(a_ref.compressed_form, a->elems, 33); FREE(a); + LDKOnionMessage b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv = OnionMessage_clone(&b_conv); + void* c_ptr = untag_ptr(c); + CHECK_ACCESS(c_ptr); + LDKCOption_CVec_SocketAddressZZ c_conv = *(LDKCOption_CVec_SocketAddressZZ*)(c_ptr); + c_conv = COption_CVec_SocketAddressZZ_clone((LDKCOption_CVec_SocketAddressZZ*)untag_ptr(c)); + LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ), "LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ"); + *ret_conv = C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_new(a_ref, b_conv, c_conv); + return tag_ptr(ret_conv, true); } -void CS_LDK_CResult_DelayedPaymentKeyDecodeErrorZ_free(int64_t _res) { +void CS_LDK_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_DelayedPaymentKeyDecodeErrorZ _res_conv = *(LDKCResult_DelayedPaymentKeyDecodeErrorZ*)(_res_ptr); + LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ _res_conv = *(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_DelayedPaymentKeyDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_DelayedPaymentKeyDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentKeyDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_DelayedPaymentKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentKeyDecodeErrorZ), "LDKCResult_DelayedPaymentKeyDecodeErrorZ"); - *ret_conv = CResult_DelayedPaymentKeyDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t CS_LDK_CResult_DelayedPaymentKeyDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_DelayedPaymentKeyDecodeErrorZ* arg_conv = (LDKCResult_DelayedPaymentKeyDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_DelayedPaymentKeyDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_CResult_DelayedPaymentKeyDecodeErrorZ_clone(int64_t orig) { - LDKCResult_DelayedPaymentKeyDecodeErrorZ* orig_conv = (LDKCResult_DelayedPaymentKeyDecodeErrorZ*)untag_ptr(orig); - LDKCResult_DelayedPaymentKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentKeyDecodeErrorZ), "LDKCResult_DelayedPaymentKeyDecodeErrorZ"); - *ret_conv = CResult_DelayedPaymentKeyDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); + C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_free(_res_conv); } -int64_t CS_LDK_CResult_HtlcBasepointDecodeErrorZ_ok(int64_t o) { - LDKHtlcBasepoint o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = HtlcBasepoint_clone(&o_conv); - LDKCResult_HtlcBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcBasepointDecodeErrorZ), "LDKCResult_HtlcBasepointDecodeErrorZ"); - *ret_conv = CResult_HtlcBasepointDecodeErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ o_conv = *(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ*)(o_ptr); + o_conv = C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone((LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ*)untag_ptr(o)); + LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ), "LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ"); + *ret_conv = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_HtlcBasepointDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_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_HtlcBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcBasepointDecodeErrorZ), "LDKCResult_HtlcBasepointDecodeErrorZ"); - *ret_conv = CResult_HtlcBasepointDecodeErrorZ_err(e_conv); + LDKSendError e_conv = *(LDKSendError*)(e_ptr); + e_conv = SendError_clone((LDKSendError*)untag_ptr(e)); + LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ), "LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ"); + *ret_conv = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_HtlcBasepointDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_HtlcBasepointDecodeErrorZ* o_conv = (LDKCResult_HtlcBasepointDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_HtlcBasepointDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_is_ok(int64_t o) { + LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* o_conv = (LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_HtlcBasepointDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_HtlcBasepointDecodeErrorZ _res_conv = *(LDKCResult_HtlcBasepointDecodeErrorZ*)(_res_ptr); + LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ _res_conv = *(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_HtlcBasepointDecodeErrorZ_free(_res_conv); + CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_free(_res_conv); } -static inline uint64_t CResult_HtlcBasepointDecodeErrorZ_clone_ptr(LDKCResult_HtlcBasepointDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_HtlcBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcBasepointDecodeErrorZ), "LDKCResult_HtlcBasepointDecodeErrorZ"); - *ret_conv = CResult_HtlcBasepointDecodeErrorZ_clone(arg); +static inline uint64_t CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone_ptr(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ *NONNULL_PTR arg) { + LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ), "LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ"); + *ret_conv = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_HtlcBasepointDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_HtlcBasepointDecodeErrorZ* arg_conv = (LDKCResult_HtlcBasepointDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_HtlcBasepointDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone_ptr(int64_t arg) { + LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* arg_conv = (LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_HtlcBasepointDecodeErrorZ_clone(int64_t orig) { - LDKCResult_HtlcBasepointDecodeErrorZ* orig_conv = (LDKCResult_HtlcBasepointDecodeErrorZ*)untag_ptr(orig); - LDKCResult_HtlcBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcBasepointDecodeErrorZ), "LDKCResult_HtlcBasepointDecodeErrorZ"); - *ret_conv = CResult_HtlcBasepointDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone(int64_t orig) { + LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* orig_conv = (LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ*)untag_ptr(orig); + LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ), "LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ"); + *ret_conv = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_HtlcKeyDecodeErrorZ_ok(int64_t o) { - LDKHtlcKey o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = HtlcKey_clone(&o_conv); - LDKCResult_HtlcKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcKeyDecodeErrorZ), "LDKCResult_HtlcKeyDecodeErrorZ"); - *ret_conv = CResult_HtlcKeyDecodeErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_PeeledOnionNoneZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKPeeledOnion o_conv = *(LDKPeeledOnion*)(o_ptr); + o_conv = PeeledOnion_clone((LDKPeeledOnion*)untag_ptr(o)); + LDKCResult_PeeledOnionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PeeledOnionNoneZ), "LDKCResult_PeeledOnionNoneZ"); + *ret_conv = CResult_PeeledOnionNoneZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_HtlcKeyDecodeErrorZ_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_HtlcKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcKeyDecodeErrorZ), "LDKCResult_HtlcKeyDecodeErrorZ"); - *ret_conv = CResult_HtlcKeyDecodeErrorZ_err(e_conv); +int64_t CS_LDK_CResult_PeeledOnionNoneZ_err() { + LDKCResult_PeeledOnionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PeeledOnionNoneZ), "LDKCResult_PeeledOnionNoneZ"); + *ret_conv = CResult_PeeledOnionNoneZ_err(); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_HtlcKeyDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_HtlcKeyDecodeErrorZ* o_conv = (LDKCResult_HtlcKeyDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_HtlcKeyDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_PeeledOnionNoneZ_is_ok(int64_t o) { + LDKCResult_PeeledOnionNoneZ* o_conv = (LDKCResult_PeeledOnionNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_PeeledOnionNoneZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_HtlcKeyDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_PeeledOnionNoneZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_HtlcKeyDecodeErrorZ _res_conv = *(LDKCResult_HtlcKeyDecodeErrorZ*)(_res_ptr); + LDKCResult_PeeledOnionNoneZ _res_conv = *(LDKCResult_PeeledOnionNoneZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_HtlcKeyDecodeErrorZ_free(_res_conv); + CResult_PeeledOnionNoneZ_free(_res_conv); } -static inline uint64_t CResult_HtlcKeyDecodeErrorZ_clone_ptr(LDKCResult_HtlcKeyDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_HtlcKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcKeyDecodeErrorZ), "LDKCResult_HtlcKeyDecodeErrorZ"); - *ret_conv = CResult_HtlcKeyDecodeErrorZ_clone(arg); +static inline uint64_t CResult_PeeledOnionNoneZ_clone_ptr(LDKCResult_PeeledOnionNoneZ *NONNULL_PTR arg) { + LDKCResult_PeeledOnionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PeeledOnionNoneZ), "LDKCResult_PeeledOnionNoneZ"); + *ret_conv = CResult_PeeledOnionNoneZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_HtlcKeyDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_HtlcKeyDecodeErrorZ* arg_conv = (LDKCResult_HtlcKeyDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_HtlcKeyDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_PeeledOnionNoneZ_clone_ptr(int64_t arg) { + LDKCResult_PeeledOnionNoneZ* arg_conv = (LDKCResult_PeeledOnionNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PeeledOnionNoneZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_HtlcKeyDecodeErrorZ_clone(int64_t orig) { - LDKCResult_HtlcKeyDecodeErrorZ* orig_conv = (LDKCResult_HtlcKeyDecodeErrorZ*)untag_ptr(orig); - LDKCResult_HtlcKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcKeyDecodeErrorZ), "LDKCResult_HtlcKeyDecodeErrorZ"); - *ret_conv = CResult_HtlcKeyDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_PeeledOnionNoneZ_clone(int64_t orig) { + LDKCResult_PeeledOnionNoneZ* orig_conv = (LDKCResult_PeeledOnionNoneZ*)untag_ptr(orig); + LDKCResult_PeeledOnionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PeeledOnionNoneZ), "LDKCResult_PeeledOnionNoneZ"); + *ret_conv = CResult_PeeledOnionNoneZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_RevocationBasepointDecodeErrorZ_ok(int64_t o) { - LDKRevocationBasepoint o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = RevocationBasepoint_clone(&o_conv); - LDKCResult_RevocationBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationBasepointDecodeErrorZ), "LDKCResult_RevocationBasepointDecodeErrorZ"); - *ret_conv = CResult_RevocationBasepointDecodeErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_SendSuccessSendErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKSendSuccess o_conv = *(LDKSendSuccess*)(o_ptr); + o_conv = SendSuccess_clone((LDKSendSuccess*)untag_ptr(o)); + LDKCResult_SendSuccessSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SendSuccessSendErrorZ), "LDKCResult_SendSuccessSendErrorZ"); + *ret_conv = CResult_SendSuccessSendErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_RevocationBasepointDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_SendSuccessSendErrorZ_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_RevocationBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationBasepointDecodeErrorZ), "LDKCResult_RevocationBasepointDecodeErrorZ"); - *ret_conv = CResult_RevocationBasepointDecodeErrorZ_err(e_conv); + LDKSendError e_conv = *(LDKSendError*)(e_ptr); + e_conv = SendError_clone((LDKSendError*)untag_ptr(e)); + LDKCResult_SendSuccessSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SendSuccessSendErrorZ), "LDKCResult_SendSuccessSendErrorZ"); + *ret_conv = CResult_SendSuccessSendErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_RevocationBasepointDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_RevocationBasepointDecodeErrorZ* o_conv = (LDKCResult_RevocationBasepointDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_RevocationBasepointDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_SendSuccessSendErrorZ_is_ok(int64_t o) { + LDKCResult_SendSuccessSendErrorZ* o_conv = (LDKCResult_SendSuccessSendErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_SendSuccessSendErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_RevocationBasepointDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_SendSuccessSendErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_RevocationBasepointDecodeErrorZ _res_conv = *(LDKCResult_RevocationBasepointDecodeErrorZ*)(_res_ptr); + LDKCResult_SendSuccessSendErrorZ _res_conv = *(LDKCResult_SendSuccessSendErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_RevocationBasepointDecodeErrorZ_free(_res_conv); + CResult_SendSuccessSendErrorZ_free(_res_conv); } -static inline uint64_t CResult_RevocationBasepointDecodeErrorZ_clone_ptr(LDKCResult_RevocationBasepointDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_RevocationBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationBasepointDecodeErrorZ), "LDKCResult_RevocationBasepointDecodeErrorZ"); - *ret_conv = CResult_RevocationBasepointDecodeErrorZ_clone(arg); +static inline uint64_t CResult_SendSuccessSendErrorZ_clone_ptr(LDKCResult_SendSuccessSendErrorZ *NONNULL_PTR arg) { + LDKCResult_SendSuccessSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SendSuccessSendErrorZ), "LDKCResult_SendSuccessSendErrorZ"); + *ret_conv = CResult_SendSuccessSendErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_RevocationBasepointDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_RevocationBasepointDecodeErrorZ* arg_conv = (LDKCResult_RevocationBasepointDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_RevocationBasepointDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_SendSuccessSendErrorZ_clone_ptr(int64_t arg) { + LDKCResult_SendSuccessSendErrorZ* arg_conv = (LDKCResult_SendSuccessSendErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_SendSuccessSendErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_RevocationBasepointDecodeErrorZ_clone(int64_t orig) { - LDKCResult_RevocationBasepointDecodeErrorZ* orig_conv = (LDKCResult_RevocationBasepointDecodeErrorZ*)untag_ptr(orig); - LDKCResult_RevocationBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationBasepointDecodeErrorZ), "LDKCResult_RevocationBasepointDecodeErrorZ"); - *ret_conv = CResult_RevocationBasepointDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_SendSuccessSendErrorZ_clone(int64_t orig) { + LDKCResult_SendSuccessSendErrorZ* orig_conv = (LDKCResult_SendSuccessSendErrorZ*)untag_ptr(orig); + LDKCResult_SendSuccessSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SendSuccessSendErrorZ), "LDKCResult_SendSuccessSendErrorZ"); + *ret_conv = CResult_SendSuccessSendErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_RevocationKeyDecodeErrorZ_ok(int64_t o) { - LDKRevocationKey o_conv; +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 = RevocationKey_clone(&o_conv); - LDKCResult_RevocationKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationKeyDecodeErrorZ), "LDKCResult_RevocationKeyDecodeErrorZ"); - *ret_conv = CResult_RevocationKeyDecodeErrorZ_ok(o_conv); + o_conv = BlindedPath_clone(&o_conv); + LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); + *ret_conv = CResult_BlindedPathNoneZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_RevocationKeyDecodeErrorZ_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_RevocationKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationKeyDecodeErrorZ), "LDKCResult_RevocationKeyDecodeErrorZ"); - *ret_conv = CResult_RevocationKeyDecodeErrorZ_err(e_conv); +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_RevocationKeyDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_RevocationKeyDecodeErrorZ* o_conv = (LDKCResult_RevocationKeyDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_RevocationKeyDecodeErrorZ_is_ok(o_conv); +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_RevocationKeyDecodeErrorZ_free(int64_t _res) { +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_RevocationKeyDecodeErrorZ _res_conv = *(LDKCResult_RevocationKeyDecodeErrorZ*)(_res_ptr); + LDKCResult_BlindedPathNoneZ _res_conv = *(LDKCResult_BlindedPathNoneZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_RevocationKeyDecodeErrorZ_free(_res_conv); + CResult_BlindedPathNoneZ_free(_res_conv); } -static inline uint64_t CResult_RevocationKeyDecodeErrorZ_clone_ptr(LDKCResult_RevocationKeyDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_RevocationKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationKeyDecodeErrorZ), "LDKCResult_RevocationKeyDecodeErrorZ"); - *ret_conv = CResult_RevocationKeyDecodeErrorZ_clone(arg); +static inline uint64_t CResult_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_RevocationKeyDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_RevocationKeyDecodeErrorZ* arg_conv = (LDKCResult_RevocationKeyDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_RevocationKeyDecodeErrorZ_clone_ptr(arg_conv); +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_RevocationKeyDecodeErrorZ_clone(int64_t orig) { - LDKCResult_RevocationKeyDecodeErrorZ* orig_conv = (LDKCResult_RevocationKeyDecodeErrorZ*)untag_ptr(orig); - LDKCResult_RevocationKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationKeyDecodeErrorZ), "LDKCResult_RevocationKeyDecodeErrorZ"); - *ret_conv = CResult_RevocationKeyDecodeErrorZ_clone(orig_conv); +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_LockedChannelMonitorNoneZ_ok(int64_t o) { - LDKLockedChannelMonitor o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - // WARNING: we need a move here but no clone is available for LDKLockedChannelMonitor - - LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); - *ret_conv = CResult_LockedChannelMonitorNoneZ_ok(o_conv); +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_LockedChannelMonitorNoneZ_err() { - LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); - *ret_conv = CResult_LockedChannelMonitorNoneZ_err(); +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(); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_LockedChannelMonitorNoneZ_is_ok(int64_t o) { - LDKCResult_LockedChannelMonitorNoneZ* o_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_LockedChannelMonitorNoneZ_is_ok(o_conv); +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_LockedChannelMonitorNoneZ_free(int64_t _res) { +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_LockedChannelMonitorNoneZ _res_conv = *(LDKCResult_LockedChannelMonitorNoneZ*)(_res_ptr); + LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ _res_conv = *(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_LockedChannelMonitorNoneZ_free(_res_conv); + CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free(_res_conv); } -static inline uint64_t C2Tuple_OutPointChannelIdZ_clone_ptr(LDKC2Tuple_OutPointChannelIdZ *NONNULL_PTR arg) { - LDKC2Tuple_OutPointChannelIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointChannelIdZ), "LDKC2Tuple_OutPointChannelIdZ"); - *ret_conv = C2Tuple_OutPointChannelIdZ_clone(arg); +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_C2Tuple_OutPointChannelIdZ_clone_ptr(int64_t arg) { - LDKC2Tuple_OutPointChannelIdZ* arg_conv = (LDKC2Tuple_OutPointChannelIdZ*)untag_ptr(arg); - int64_t ret_conv = C2Tuple_OutPointChannelIdZ_clone_ptr(arg_conv); +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_C2Tuple_OutPointChannelIdZ_clone(int64_t orig) { - LDKC2Tuple_OutPointChannelIdZ* orig_conv = (LDKC2Tuple_OutPointChannelIdZ*)untag_ptr(orig); - LDKC2Tuple_OutPointChannelIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointChannelIdZ), "LDKC2Tuple_OutPointChannelIdZ"); - *ret_conv = C2Tuple_OutPointChannelIdZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_C2Tuple_OutPointChannelIdZ_new(int64_t a, int64_t b) { - LDKOutPoint a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = OutPoint_clone(&a_conv); - LDKChannelId b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv = ChannelId_clone(&b_conv); - LDKC2Tuple_OutPointChannelIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointChannelIdZ), "LDKC2Tuple_OutPointChannelIdZ"); - *ret_conv = C2Tuple_OutPointChannelIdZ_new(a_conv, b_conv); +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_C2Tuple_OutPointChannelIdZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKC2Tuple_OutPointChannelIdZ _res_conv = *(LDKC2Tuple_OutPointChannelIdZ*)(_res_ptr); - FREE(untag_ptr(_res)); - C2Tuple_OutPointChannelIdZ_free(_res_conv); -} - -void CS_LDK_CVec_C2Tuple_OutPointChannelIdZZ_free(int64_tArray _res) { - LDKCVec_C2Tuple_OutPointChannelIdZZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OutPointChannelIdZ), "LDKCVec_C2Tuple_OutPointChannelIdZZ 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_29 = _res_vals[d]; - void* _res_conv_29_ptr = untag_ptr(_res_conv_29); - CHECK_ACCESS(_res_conv_29_ptr); - LDKC2Tuple_OutPointChannelIdZ _res_conv_29_conv = *(LDKC2Tuple_OutPointChannelIdZ*)(_res_conv_29_ptr); - FREE(untag_ptr(_res_conv_29)); - _res_constr.data[d] = _res_conv_29_conv; - } - FREE(_res); - CVec_C2Tuple_OutPointChannelIdZZ_free(_res_constr); -} - -void CS_LDK_CVec_MonitorUpdateIdZ_free(int64_tArray _res) { - LDKCVec_MonitorUpdateIdZ _res_constr; +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(LDKMonitorUpdateId), "LDKCVec_MonitorUpdateIdZ Elements"); + _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 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; + 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_MonitorUpdateIdZ_free(_res_constr); + CVec_ForwardNodeZ_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); +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_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); - 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_CResult_BlindedPathDecodeErrorZ_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); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_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; - b_constr.datalen = b->arr_len; - if (b_constr.datalen > 0) - b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKMonitorUpdateId), "LDKCVec_MonitorUpdateIdZ Elements"); - else - b_constr.data = NULL; - 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; - } - FREE(b); - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ"); - *ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(a_conv, b_constr); - return tag_ptr(ret_conv, true); +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); + return ret_conv; } -void CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(int64_t _res) { +void CS_LDK_CResult_BlindedPathDecodeErrorZ_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); + LDKCResult_BlindedPathDecodeErrorZ _res_conv = *(LDKCResult_BlindedPathDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(_res_conv); -} - -void CS_LDK_CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(int64_tArray _res) { - LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ Elements"); - else - _res_constr.data = NULL; - 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; - } - FREE(_res); - CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(_res_constr); -} - -void CS_LDK_APIError_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); - LDKAPIError this_ptr_conv = *(LDKAPIError*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - APIError_free(this_ptr_conv); + CResult_BlindedPathDecodeErrorZ_free(_res_conv); } -static inline uint64_t APIError_clone_ptr(LDKAPIError *NONNULL_PTR arg) { - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +static inline uint64_t CResult_BlindedPathDecodeErrorZ_clone_ptr(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ"); + *ret_conv = CResult_BlindedPathDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_APIError_clone_ptr(int64_t arg) { - LDKAPIError* arg_conv = (LDKAPIError*)untag_ptr(arg); - int64_t ret_conv = APIError_clone_ptr(arg_conv); +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); return ret_conv; } -int64_t CS_LDK_APIError_clone(int64_t orig) { - LDKAPIError* orig_conv = (LDKAPIError*)untag_ptr(orig); - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_APIError_apimisuse_error(jstring err) { - LDKStr err_conv = str_ref_to_owned_c(err); - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_apimisuse_error(err_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_APIError_fee_rate_too_high(jstring err, int32_t feerate) { - LDKStr err_conv = str_ref_to_owned_c(err); - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_fee_rate_too_high(err_conv, feerate); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_CResult_BlindedHopDecodeErrorZ_ok(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 = BlindedHop_clone(&o_conv); + LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); + *ret_conv = CResult_BlindedHopDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_APIError_invalid_route(jstring err) { - LDKStr err_conv = str_ref_to_owned_c(err); - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_invalid_route(err_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_CResult_BlindedHopDecodeErrorZ_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_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); + *ret_conv = CResult_BlindedHopDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_APIError_channel_unavailable(jstring err) { - LDKStr err_conv = str_ref_to_owned_c(err); - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_channel_unavailable(err_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_CResult_BlindedHopDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_BlindedHopDecodeErrorZ* o_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_BlindedHopDecodeErrorZ_is_ok(o_conv); + return ret_conv; } -int64_t CS_LDK_APIError_monitor_update_in_progress() { - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_monitor_update_in_progress(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_CResult_BlindedHopDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_BlindedHopDecodeErrorZ _res_conv = *(LDKCResult_BlindedHopDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_BlindedHopDecodeErrorZ_free(_res_conv); } -int64_t CS_LDK_APIError_incompatible_shutdown_script(int64_t script) { - LDKShutdownScript script_conv; - script_conv.inner = untag_ptr(script); - script_conv.is_owned = ptr_is_owned(script); - CHECK_INNER_FIELD_ACCESS_OR_NULL(script_conv); - script_conv = ShutdownScript_clone(&script_conv); - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_incompatible_shutdown_script(script_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +static inline uint64_t CResult_BlindedHopDecodeErrorZ_clone_ptr(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); + *ret_conv = CResult_BlindedHopDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); } - -jboolean CS_LDK_APIError_eq(int64_t a, int64_t b) { - LDKAPIError* a_conv = (LDKAPIError*)untag_ptr(a); - LDKAPIError* b_conv = (LDKAPIError*)untag_ptr(b); - jboolean ret_conv = APIError_eq(a_conv, b_conv); +int64_t CS_LDK_CResult_BlindedHopDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_BlindedHopDecodeErrorZ* arg_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BlindedHopDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int8_tArray CS_LDK_APIError_write(int64_t obj) { - LDKAPIError* obj_conv = (LDKAPIError*)untag_ptr(obj); - LDKCVec_u8Z ret_var = APIError_write(obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +int64_t CS_LDK_CResult_BlindedHopDecodeErrorZ_clone(int64_t orig) { + LDKCResult_BlindedHopDecodeErrorZ* orig_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(orig); + LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); + *ret_conv = CResult_BlindedHopDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_APIError_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_COption_APIErrorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_APIErrorZDecodeErrorZ), "LDKCResult_COption_APIErrorZDecodeErrorZ"); - *ret_conv = APIError_read(ser_ref); - FREE(ser); +int64_t CS_LDK_CResult_InvoiceErrorDecodeErrorZ_ok(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 = InvoiceError_clone(&o_conv); + LDKCResult_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); + *ret_conv = CResult_InvoiceErrorDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -void CS_LDK_BigSize_free(int64_t this_obj) { - LDKBigSize this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BigSize_free(this_obj_conv); +int64_t CS_LDK_CResult_InvoiceErrorDecodeErrorZ_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_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); + *ret_conv = CResult_InvoiceErrorDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_BigSize_get_a(int64_t this_ptr) { - LDKBigSize this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = BigSize_get_a(&this_ptr_conv); +jboolean CS_LDK_CResult_InvoiceErrorDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_InvoiceErrorDecodeErrorZ* o_conv = (LDKCResult_InvoiceErrorDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceErrorDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_BigSize_set_a(int64_t this_ptr, int64_t val) { - LDKBigSize this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - BigSize_set_a(&this_ptr_conv, val); -} - -int64_t CS_LDK_BigSize_new(int64_t a_arg) { - LDKBigSize ret_var = BigSize_new(a_arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +void CS_LDK_CResult_InvoiceErrorDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_InvoiceErrorDecodeErrorZ _res_conv = *(LDKCResult_InvoiceErrorDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_InvoiceErrorDecodeErrorZ_free(_res_conv); } -static inline uint64_t BigSize_clone_ptr(LDKBigSize *NONNULL_PTR arg) { - LDKBigSize ret_var = BigSize_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +static inline uint64_t CResult_InvoiceErrorDecodeErrorZ_clone_ptr(LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); + *ret_conv = CResult_InvoiceErrorDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_BigSize_clone_ptr(int64_t arg) { - LDKBigSize arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = BigSize_clone_ptr(&arg_conv); +int64_t CS_LDK_CResult_InvoiceErrorDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_InvoiceErrorDecodeErrorZ* arg_conv = (LDKCResult_InvoiceErrorDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_InvoiceErrorDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_BigSize_clone(int64_t orig) { - LDKBigSize orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKBigSize ret_var = BigSize_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +int64_t CS_LDK_CResult_InvoiceErrorDecodeErrorZ_clone(int64_t orig) { + LDKCResult_InvoiceErrorDecodeErrorZ* orig_conv = (LDKCResult_InvoiceErrorDecodeErrorZ*)untag_ptr(orig); + LDKCResult_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); + *ret_conv = CResult_InvoiceErrorDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_BigSize_hash(int64_t o) { - LDKBigSize o_conv; +int64_t CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_ok(int64_t o) { + LDKTrackedSpendableOutput o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = BigSize_hash(&o_conv); - return ret_conv; + o_conv = TrackedSpendableOutput_clone(&o_conv); + LDKCResult_TrackedSpendableOutputDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TrackedSpendableOutputDecodeErrorZ), "LDKCResult_TrackedSpendableOutputDecodeErrorZ"); + *ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_BigSize_eq(int64_t a, int64_t b) { - LDKBigSize a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKBigSize b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = BigSize_eq(&a_conv, &b_conv); - return ret_conv; +int64_t CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_err(int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_TrackedSpendableOutputDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TrackedSpendableOutputDecodeErrorZ), "LDKCResult_TrackedSpendableOutputDecodeErrorZ"); + *ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -int8_tArray CS_LDK_BigSize_write(int64_t obj) { - LDKBigSize obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = BigSize_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +jboolean CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_TrackedSpendableOutputDecodeErrorZ* o_conv = (LDKCResult_TrackedSpendableOutputDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_is_ok(o_conv); + return ret_conv; } -int64_t CS_LDK_BigSize_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_BigSizeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BigSizeDecodeErrorZ), "LDKCResult_BigSizeDecodeErrorZ"); - *ret_conv = BigSize_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_TrackedSpendableOutputDecodeErrorZ _res_conv = *(LDKCResult_TrackedSpendableOutputDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_TrackedSpendableOutputDecodeErrorZ_free(_res_conv); } -void CS_LDK_Hostname_free(int64_t this_obj) { - LDKHostname this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Hostname_free(this_obj_conv); -} - -static inline uint64_t Hostname_clone_ptr(LDKHostname *NONNULL_PTR arg) { - LDKHostname ret_var = Hostname_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +static inline uint64_t CResult_TrackedSpendableOutputDecodeErrorZ_clone_ptr(LDKCResult_TrackedSpendableOutputDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_TrackedSpendableOutputDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TrackedSpendableOutputDecodeErrorZ), "LDKCResult_TrackedSpendableOutputDecodeErrorZ"); + *ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_Hostname_clone_ptr(int64_t arg) { - LDKHostname arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = Hostname_clone_ptr(&arg_conv); +int64_t CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_TrackedSpendableOutputDecodeErrorZ* arg_conv = (LDKCResult_TrackedSpendableOutputDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_Hostname_clone(int64_t orig) { - LDKHostname orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKHostname ret_var = Hostname_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +int64_t CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_clone(int64_t orig) { + LDKCResult_TrackedSpendableOutputDecodeErrorZ* orig_conv = (LDKCResult_TrackedSpendableOutputDecodeErrorZ*)untag_ptr(orig); + LDKCResult_TrackedSpendableOutputDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TrackedSpendableOutputDecodeErrorZ), "LDKCResult_TrackedSpendableOutputDecodeErrorZ"); + *ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_Hostname_hash(int64_t o) { - LDKHostname o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = Hostname_hash(&o_conv); - return ret_conv; +int64_t CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKOutputSpendStatus o_conv = *(LDKOutputSpendStatus*)(o_ptr); + o_conv = OutputSpendStatus_clone((LDKOutputSpendStatus*)untag_ptr(o)); + LDKCResult_OutputSpendStatusDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSpendStatusDecodeErrorZ), "LDKCResult_OutputSpendStatusDecodeErrorZ"); + *ret_conv = CResult_OutputSpendStatusDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_Hostname_eq(int64_t a, int64_t b) { - LDKHostname a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKHostname b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = Hostname_eq(&a_conv, &b_conv); - return ret_conv; +int64_t CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_err(int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_OutputSpendStatusDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSpendStatusDecodeErrorZ), "LDKCResult_OutputSpendStatusDecodeErrorZ"); + *ret_conv = CResult_OutputSpendStatusDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -int8_t CS_LDK_Hostname_len(int64_t this_arg) { - LDKHostname this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_t ret_conv = Hostname_len(&this_arg_conv); +jboolean CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_OutputSpendStatusDecodeErrorZ* o_conv = (LDKCResult_OutputSpendStatusDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OutputSpendStatusDecodeErrorZ_is_ok(o_conv); return ret_conv; } -int8_tArray CS_LDK_Hostname_write(int64_t obj) { - LDKHostname obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = Hostname_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +void CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_OutputSpendStatusDecodeErrorZ _res_conv = *(LDKCResult_OutputSpendStatusDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_OutputSpendStatusDecodeErrorZ_free(_res_conv); } -int64_t CS_LDK_Hostname_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); - *ret_conv = Hostname_read(ser_ref); - FREE(ser); +static inline uint64_t CResult_OutputSpendStatusDecodeErrorZ_clone_ptr(LDKCResult_OutputSpendStatusDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OutputSpendStatusDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSpendStatusDecodeErrorZ), "LDKCResult_OutputSpendStatusDecodeErrorZ"); + *ret_conv = CResult_OutputSpendStatusDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } +int64_t CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_OutputSpendStatusDecodeErrorZ* arg_conv = (LDKCResult_OutputSpendStatusDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OutputSpendStatusDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} -void CS_LDK_TransactionU16LenLimited_free(int64_t this_obj) { - LDKTransactionU16LenLimited this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - TransactionU16LenLimited_free(this_obj_conv); +int64_t CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_clone(int64_t orig) { + LDKCResult_OutputSpendStatusDecodeErrorZ* orig_conv = (LDKCResult_OutputSpendStatusDecodeErrorZ*)untag_ptr(orig); + LDKCResult_OutputSpendStatusDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSpendStatusDecodeErrorZ), "LDKCResult_OutputSpendStatusDecodeErrorZ"); + *ret_conv = CResult_OutputSpendStatusDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -static inline uint64_t TransactionU16LenLimited_clone_ptr(LDKTransactionU16LenLimited *NONNULL_PTR arg) { - LDKTransactionU16LenLimited ret_var = TransactionU16LenLimited_clone(arg); - 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_COption_FilterZ_some(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKFilter o_conv = *(LDKFilter*)(o_ptr); + if (o_conv.free == LDKFilter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFilter_JCalls_cloned(&o_conv); + } + LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ"); + *ret_copy = COption_FilterZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_TransactionU16LenLimited_clone_ptr(int64_t arg) { - LDKTransactionU16LenLimited arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = TransactionU16LenLimited_clone_ptr(&arg_conv); - return ret_conv; -} -int64_t CS_LDK_TransactionU16LenLimited_clone(int64_t orig) { - LDKTransactionU16LenLimited orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKTransactionU16LenLimited ret_var = TransactionU16LenLimited_clone(&orig_conv); - 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_COption_FilterZ_none() { + LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ"); + *ret_copy = COption_FilterZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_TransactionU16LenLimited_hash(int64_t o) { - LDKTransactionU16LenLimited o_conv; +void CS_LDK_COption_FilterZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_FilterZ _res_conv = *(LDKCOption_FilterZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_FilterZ_free(_res_conv); +} + +void CS_LDK_CVec_TrackedSpendableOutputZ_free(int64_tArray _res) { + LDKCVec_TrackedSpendableOutputZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTrackedSpendableOutput), "LDKCVec_TrackedSpendableOutputZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = _res->elems; + for (size_t y = 0; y < _res_constr.datalen; y++) { + int64_t _res_conv_24 = _res_vals[y]; + LDKTrackedSpendableOutput _res_conv_24_conv; + _res_conv_24_conv.inner = untag_ptr(_res_conv_24); + _res_conv_24_conv.is_owned = ptr_is_owned(_res_conv_24); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_24_conv); + _res_constr.data[y] = _res_conv_24_conv; + } + FREE(_res); + CVec_TrackedSpendableOutputZ_free(_res_constr); +} + +int64_t CS_LDK_CResult_OutputSweeperDecodeErrorZ_ok(int64_t o) { + LDKOutputSweeper o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = TransactionU16LenLimited_hash(&o_conv); + // WARNING: we need a move here but no clone is available for LDKOutputSweeper + + LDKCResult_OutputSweeperDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSweeperDecodeErrorZ), "LDKCResult_OutputSweeperDecodeErrorZ"); + *ret_conv = CResult_OutputSweeperDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_OutputSweeperDecodeErrorZ_err(int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_OutputSweeperDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSweeperDecodeErrorZ), "LDKCResult_OutputSweeperDecodeErrorZ"); + *ret_conv = CResult_OutputSweeperDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_OutputSweeperDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_OutputSweeperDecodeErrorZ* o_conv = (LDKCResult_OutputSweeperDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OutputSweeperDecodeErrorZ_is_ok(o_conv); return ret_conv; } -jboolean CS_LDK_TransactionU16LenLimited_eq(int64_t a, int64_t b) { - LDKTransactionU16LenLimited a_conv; +void CS_LDK_CResult_OutputSweeperDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_OutputSweeperDecodeErrorZ _res_conv = *(LDKCResult_OutputSweeperDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_OutputSweeperDecodeErrorZ_free(_res_conv); +} + +int64_t CS_LDK_C2Tuple_BestBlockOutputSweeperZ_new(int64_t a, int64_t b) { + LDKBestBlock a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKTransactionU16LenLimited b_conv; + a_conv = BestBlock_clone(&a_conv); + LDKOutputSweeper b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = TransactionU16LenLimited_eq(&a_conv, &b_conv); - return ret_conv; + // WARNING: we need a move here but no clone is available for LDKOutputSweeper + + LDKC2Tuple_BestBlockOutputSweeperZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BestBlockOutputSweeperZ), "LDKC2Tuple_BestBlockOutputSweeperZ"); + *ret_conv = C2Tuple_BestBlockOutputSweeperZ_new(a_conv, b_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_TransactionU16LenLimited_new(int8_tArray transaction) { - LDKTransaction transaction_ref; - transaction_ref.datalen = transaction->arr_len; - transaction_ref.data = MALLOC(transaction_ref.datalen, "LDKTransaction Bytes"); - memcpy(transaction_ref.data, transaction->elems, transaction_ref.datalen); FREE(transaction); - transaction_ref.data_is_owned = true; - LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); - *ret_conv = TransactionU16LenLimited_new(transaction_ref); - return tag_ptr(ret_conv, true); +void CS_LDK_C2Tuple_BestBlockOutputSweeperZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKC2Tuple_BestBlockOutputSweeperZ _res_conv = *(LDKC2Tuple_BestBlockOutputSweeperZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_BestBlockOutputSweeperZ_free(_res_conv); } -int8_tArray CS_LDK_TransactionU16LenLimited_into_transaction(int64_t this_arg) { - LDKTransactionU16LenLimited this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = TransactionU16LenLimited_clone(&this_arg_conv); - LDKTransaction ret_var = TransactionU16LenLimited_into_transaction(this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - Transaction_free(ret_var); - return ret_arr; +int64_t CS_LDK_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_BestBlockOutputSweeperZ o_conv = *(LDKC2Tuple_BestBlockOutputSweeperZ*)(o_ptr); + // WARNING: we may need a move here but no clone is available for LDKC2Tuple_BestBlockOutputSweeperZ + LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ), "LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ"); + *ret_conv = CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -int8_tArray CS_LDK_TransactionU16LenLimited_as_transaction(int64_t this_arg) { - LDKTransactionU16LenLimited this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKTransaction ret_var = TransactionU16LenLimited_as_transaction(&this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - Transaction_free(ret_var); - return ret_arr; +int64_t CS_LDK_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_err(int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ), "LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ"); + *ret_conv = CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -int8_tArray CS_LDK_TransactionU16LenLimited_write(int64_t obj) { - LDKTransactionU16LenLimited obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = TransactionU16LenLimited_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +jboolean CS_LDK_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_is_ok(o_conv); + return ret_conv; } -int64_t CS_LDK_TransactionU16LenLimited_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); - *ret_conv = TransactionU16LenLimited_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void CS_LDK_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_free(_res_conv); } -int64_t CS_LDK_sign(int8_tArray msg, int8_tArray sk) { - LDKu8slice msg_ref; - msg_ref.datalen = msg->arr_len; - msg_ref.data = msg->elems; - uint8_t sk_arr[32]; - CHECK(sk->arr_len == 32); - memcpy(sk_arr, sk->elems, 32); FREE(sk); - uint8_t (*sk_ref)[32] = &sk_arr; - LDKCResult_StrSecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StrSecp256k1ErrorZ), "LDKCResult_StrSecp256k1ErrorZ"); - *ret_conv = sign(msg_ref, sk_ref); - FREE(msg); +int64_t CS_LDK_CResult_DelayedPaymentBasepointDecodeErrorZ_ok(int64_t o) { + LDKDelayedPaymentBasepoint o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = DelayedPaymentBasepoint_clone(&o_conv); + LDKCResult_DelayedPaymentBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentBasepointDecodeErrorZ), "LDKCResult_DelayedPaymentBasepointDecodeErrorZ"); + *ret_conv = CResult_DelayedPaymentBasepointDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_recover_pk(int8_tArray msg, jstring sig) { - LDKu8slice msg_ref; - msg_ref.datalen = msg->arr_len; - msg_ref.data = msg->elems; - LDKStr sig_conv = str_ref_to_owned_c(sig); - LDKCResult_PublicKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecp256k1ErrorZ), "LDKCResult_PublicKeySecp256k1ErrorZ"); - *ret_conv = recover_pk(msg_ref, sig_conv); - FREE(msg); +int64_t CS_LDK_CResult_DelayedPaymentBasepointDecodeErrorZ_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_DelayedPaymentBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentBasepointDecodeErrorZ), "LDKCResult_DelayedPaymentBasepointDecodeErrorZ"); + *ret_conv = CResult_DelayedPaymentBasepointDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_verify(int8_tArray msg, jstring sig, int8_tArray pk) { - LDKu8slice msg_ref; - msg_ref.datalen = msg->arr_len; - msg_ref.data = msg->elems; - LDKStr sig_conv = str_ref_to_owned_c(sig); - LDKPublicKey pk_ref; - CHECK(pk->arr_len == 33); - memcpy(pk_ref.compressed_form, pk->elems, 33); FREE(pk); - jboolean ret_conv = verify(msg_ref, sig_conv, pk_ref); - FREE(msg); +jboolean CS_LDK_CResult_DelayedPaymentBasepointDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_DelayedPaymentBasepointDecodeErrorZ* o_conv = (LDKCResult_DelayedPaymentBasepointDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_DelayedPaymentBasepointDecodeErrorZ_is_ok(o_conv); 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_CResult_DelayedPaymentBasepointDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_DelayedPaymentBasepointDecodeErrorZ _res_conv = *(LDKCResult_DelayedPaymentBasepointDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_DelayedPaymentBasepointDecodeErrorZ_free(_res_conv); } -void CS_LDK_KVStore_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); - LDKKVStore this_ptr_conv = *(LDKKVStore*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - KVStore_free(this_ptr_conv); +static inline uint64_t CResult_DelayedPaymentBasepointDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentBasepointDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_DelayedPaymentBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentBasepointDecodeErrorZ), "LDKCResult_DelayedPaymentBasepointDecodeErrorZ"); + *ret_conv = CResult_DelayedPaymentBasepointDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_DelayedPaymentBasepointDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_DelayedPaymentBasepointDecodeErrorZ* arg_conv = (LDKCResult_DelayedPaymentBasepointDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_DelayedPaymentBasepointDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; } -void CS_LDK_Persister_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); - LDKPersister this_ptr_conv = *(LDKPersister*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Persister_free(this_ptr_conv); +int64_t CS_LDK_CResult_DelayedPaymentBasepointDecodeErrorZ_clone(int64_t orig) { + LDKCResult_DelayedPaymentBasepointDecodeErrorZ* orig_conv = (LDKCResult_DelayedPaymentBasepointDecodeErrorZ*)untag_ptr(orig); + LDKCResult_DelayedPaymentBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentBasepointDecodeErrorZ), "LDKCResult_DelayedPaymentBasepointDecodeErrorZ"); + *ret_conv = CResult_DelayedPaymentBasepointDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_read_channel_monitors(int64_t kv_store, int64_t entropy_source, int64_t signer_provider) { - void* kv_store_ptr = untag_ptr(kv_store); - CHECK_ACCESS(kv_store_ptr); - LDKKVStore kv_store_conv = *(LDKKVStore*)(kv_store_ptr); - if (kv_store_conv.free == LDKKVStore_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKKVStore_JCalls_cloned(&kv_store_conv); - } - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - void* signer_provider_ptr = untag_ptr(signer_provider); - CHECK_ACCESS(signer_provider_ptr); - LDKSignerProvider signer_provider_conv = *(LDKSignerProvider*)(signer_provider_ptr); - if (signer_provider_conv.free == LDKSignerProvider_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKSignerProvider_JCalls_cloned(&signer_provider_conv); - } - LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ), "LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ"); - *ret_conv = read_channel_monitors(kv_store_conv, entropy_source_conv, signer_provider_conv); +int64_t CS_LDK_CResult_DelayedPaymentKeyDecodeErrorZ_ok(int64_t o) { + LDKDelayedPaymentKey o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = DelayedPaymentKey_clone(&o_conv); + LDKCResult_DelayedPaymentKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentKeyDecodeErrorZ), "LDKCResult_DelayedPaymentKeyDecodeErrorZ"); + *ret_conv = CResult_DelayedPaymentKeyDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -void CS_LDK_MonitorUpdatingPersister_free(int64_t this_obj) { - LDKMonitorUpdatingPersister this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - MonitorUpdatingPersister_free(this_obj_conv); +int64_t CS_LDK_CResult_DelayedPaymentKeyDecodeErrorZ_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_DelayedPaymentKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentKeyDecodeErrorZ), "LDKCResult_DelayedPaymentKeyDecodeErrorZ"); + *ret_conv = CResult_DelayedPaymentKeyDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -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) { - void* kv_store_ptr = untag_ptr(kv_store); - CHECK_ACCESS(kv_store_ptr); - LDKKVStore kv_store_conv = *(LDKKVStore*)(kv_store_ptr); - if (kv_store_conv.free == LDKKVStore_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKKVStore_JCalls_cloned(&kv_store_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - void* signer_provider_ptr = untag_ptr(signer_provider); - CHECK_ACCESS(signer_provider_ptr); - LDKSignerProvider signer_provider_conv = *(LDKSignerProvider*)(signer_provider_ptr); - if (signer_provider_conv.free == LDKSignerProvider_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKSignerProvider_JCalls_cloned(&signer_provider_conv); - } - LDKMonitorUpdatingPersister ret_var = MonitorUpdatingPersister_new(kv_store_conv, logger_conv, maximum_pending_updates, entropy_source_conv, signer_provider_conv); - int64_t ret_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_CResult_DelayedPaymentKeyDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_DelayedPaymentKeyDecodeErrorZ* o_conv = (LDKCResult_DelayedPaymentKeyDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_DelayedPaymentKeyDecodeErrorZ_is_ok(o_conv); + return ret_conv; } -int64_t CS_LDK_MonitorUpdatingPersister_read_all_channel_monitors_with_updates(int64_t this_arg, int64_t broadcaster, int64_t fee_estimator) { - LDKMonitorUpdatingPersister this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - void* broadcaster_ptr = untag_ptr(broadcaster); - if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); } - LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; - void* fee_estimator_ptr = untag_ptr(fee_estimator); - if (ptr_is_owned(fee_estimator)) { CHECK_ACCESS(fee_estimator_ptr); } - LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; - LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ), "LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ"); - *ret_conv = MonitorUpdatingPersister_read_all_channel_monitors_with_updates(&this_arg_conv, broadcaster_conv, fee_estimator_conv); - return tag_ptr(ret_conv, true); +void CS_LDK_CResult_DelayedPaymentKeyDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_DelayedPaymentKeyDecodeErrorZ _res_conv = *(LDKCResult_DelayedPaymentKeyDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_DelayedPaymentKeyDecodeErrorZ_free(_res_conv); } -int64_t CS_LDK_MonitorUpdatingPersister_read_channel_monitor_with_updates(int64_t this_arg, int64_t broadcaster, int64_t fee_estimator, jstring monitor_key) { - LDKMonitorUpdatingPersister this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - void* broadcaster_ptr = untag_ptr(broadcaster); - if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); } - LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; - void* fee_estimator_ptr = untag_ptr(fee_estimator); - if (ptr_is_owned(fee_estimator)) { CHECK_ACCESS(fee_estimator_ptr); } - LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; - LDKStr monitor_key_conv = str_ref_to_owned_c(monitor_key); - LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ), "LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ"); - *ret_conv = MonitorUpdatingPersister_read_channel_monitor_with_updates(&this_arg_conv, broadcaster_conv, fee_estimator_conv, monitor_key_conv); +static inline uint64_t CResult_DelayedPaymentKeyDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentKeyDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_DelayedPaymentKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentKeyDecodeErrorZ), "LDKCResult_DelayedPaymentKeyDecodeErrorZ"); + *ret_conv = CResult_DelayedPaymentKeyDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } +int64_t CS_LDK_CResult_DelayedPaymentKeyDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_DelayedPaymentKeyDecodeErrorZ* arg_conv = (LDKCResult_DelayedPaymentKeyDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_DelayedPaymentKeyDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} -int64_t CS_LDK_MonitorUpdatingPersister_cleanup_stale_updates(int64_t this_arg, jboolean lazy) { - LDKMonitorUpdatingPersister this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneIOErrorZ), "LDKCResult_NoneIOErrorZ"); - *ret_conv = MonitorUpdatingPersister_cleanup_stale_updates(&this_arg_conv, lazy); +int64_t CS_LDK_CResult_DelayedPaymentKeyDecodeErrorZ_clone(int64_t orig) { + LDKCResult_DelayedPaymentKeyDecodeErrorZ* orig_conv = (LDKCResult_DelayedPaymentKeyDecodeErrorZ*)untag_ptr(orig); + LDKCResult_DelayedPaymentKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentKeyDecodeErrorZ), "LDKCResult_DelayedPaymentKeyDecodeErrorZ"); + *ret_conv = CResult_DelayedPaymentKeyDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_MonitorUpdatingPersister_as_Persist(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; - LDKPersist* ret_ret = MALLOC(sizeof(LDKPersist), "LDKPersist"); - *ret_ret = MonitorUpdatingPersister_as_Persist(&this_arg_conv); - return tag_ptr(ret_ret, true); +int64_t CS_LDK_CResult_HtlcBasepointDecodeErrorZ_ok(int64_t o) { + LDKHtlcBasepoint o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = HtlcBasepoint_clone(&o_conv); + LDKCResult_HtlcBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcBasepointDecodeErrorZ), "LDKCResult_HtlcBasepointDecodeErrorZ"); + *ret_conv = CResult_HtlcBasepointDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -int32_t CS_LDK_ShortChannelIdError_clone(int64_t orig) { - LDKShortChannelIdError* orig_conv = (LDKShortChannelIdError*)untag_ptr(orig); - int32_t ret_conv = LDKShortChannelIdError_to_cs(ShortChannelIdError_clone(orig_conv)); - return ret_conv; +int64_t CS_LDK_CResult_HtlcBasepointDecodeErrorZ_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_HtlcBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcBasepointDecodeErrorZ), "LDKCResult_HtlcBasepointDecodeErrorZ"); + *ret_conv = CResult_HtlcBasepointDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -int32_t CS_LDK_ShortChannelIdError_block_overflow() { - int32_t ret_conv = LDKShortChannelIdError_to_cs(ShortChannelIdError_block_overflow()); +jboolean CS_LDK_CResult_HtlcBasepointDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_HtlcBasepointDecodeErrorZ* o_conv = (LDKCResult_HtlcBasepointDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_HtlcBasepointDecodeErrorZ_is_ok(o_conv); return ret_conv; } -int32_t CS_LDK_ShortChannelIdError_tx_index_overflow() { - int32_t ret_conv = LDKShortChannelIdError_to_cs(ShortChannelIdError_tx_index_overflow()); - return ret_conv; +void CS_LDK_CResult_HtlcBasepointDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_HtlcBasepointDecodeErrorZ _res_conv = *(LDKCResult_HtlcBasepointDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_HtlcBasepointDecodeErrorZ_free(_res_conv); } -int32_t CS_LDK_ShortChannelIdError_vout_index_overflow() { - int32_t ret_conv = LDKShortChannelIdError_to_cs(ShortChannelIdError_vout_index_overflow()); +static inline uint64_t CResult_HtlcBasepointDecodeErrorZ_clone_ptr(LDKCResult_HtlcBasepointDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HtlcBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcBasepointDecodeErrorZ), "LDKCResult_HtlcBasepointDecodeErrorZ"); + *ret_conv = CResult_HtlcBasepointDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_HtlcBasepointDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_HtlcBasepointDecodeErrorZ* arg_conv = (LDKCResult_HtlcBasepointDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_HtlcBasepointDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -jboolean CS_LDK_ShortChannelIdError_eq(int64_t a, int64_t b) { - LDKShortChannelIdError* a_conv = (LDKShortChannelIdError*)untag_ptr(a); - LDKShortChannelIdError* b_conv = (LDKShortChannelIdError*)untag_ptr(b); - jboolean ret_conv = ShortChannelIdError_eq(a_conv, b_conv); - return ret_conv; +int64_t CS_LDK_CResult_HtlcBasepointDecodeErrorZ_clone(int64_t orig) { + LDKCResult_HtlcBasepointDecodeErrorZ* orig_conv = (LDKCResult_HtlcBasepointDecodeErrorZ*)untag_ptr(orig); + LDKCResult_HtlcBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcBasepointDecodeErrorZ), "LDKCResult_HtlcBasepointDecodeErrorZ"); + *ret_conv = CResult_HtlcBasepointDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -int32_t CS_LDK_block_from_scid(int64_t short_channel_id) { - int32_t ret_conv = block_from_scid(short_channel_id); - return ret_conv; +int64_t CS_LDK_CResult_HtlcKeyDecodeErrorZ_ok(int64_t o) { + LDKHtlcKey o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = HtlcKey_clone(&o_conv); + LDKCResult_HtlcKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcKeyDecodeErrorZ), "LDKCResult_HtlcKeyDecodeErrorZ"); + *ret_conv = CResult_HtlcKeyDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -int32_t CS_LDK_tx_index_from_scid(int64_t short_channel_id) { - int32_t ret_conv = tx_index_from_scid(short_channel_id); - return ret_conv; +int64_t CS_LDK_CResult_HtlcKeyDecodeErrorZ_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_HtlcKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcKeyDecodeErrorZ), "LDKCResult_HtlcKeyDecodeErrorZ"); + *ret_conv = CResult_HtlcKeyDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -int16_t CS_LDK_vout_from_scid(int64_t short_channel_id) { - int16_t ret_conv = vout_from_scid(short_channel_id); +jboolean CS_LDK_CResult_HtlcKeyDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_HtlcKeyDecodeErrorZ* o_conv = (LDKCResult_HtlcKeyDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_HtlcKeyDecodeErrorZ_is_ok(o_conv); return ret_conv; } -int64_t CS_LDK_scid_from_parts(int64_t block, int64_t tx_index, int64_t vout_index) { - LDKCResult_u64ShortChannelIdErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u64ShortChannelIdErrorZ), "LDKCResult_u64ShortChannelIdErrorZ"); - *ret_conv = scid_from_parts(block, tx_index, vout_index); - return tag_ptr(ret_conv, true); +void CS_LDK_CResult_HtlcKeyDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_HtlcKeyDecodeErrorZ _res_conv = *(LDKCResult_HtlcKeyDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_HtlcKeyDecodeErrorZ_free(_res_conv); } -void 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); +static inline uint64_t CResult_HtlcKeyDecodeErrorZ_clone_ptr(LDKCResult_HtlcKeyDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HtlcKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcKeyDecodeErrorZ), "LDKCResult_HtlcKeyDecodeErrorZ"); + *ret_conv = CResult_HtlcKeyDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); } - -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); +int64_t CS_LDK_CResult_HtlcKeyDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_HtlcKeyDecodeErrorZ* arg_conv = (LDKCResult_HtlcKeyDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_HtlcKeyDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -void 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_CResult_HtlcKeyDecodeErrorZ_clone(int64_t orig) { + LDKCResult_HtlcKeyDecodeErrorZ* orig_conv = (LDKCResult_HtlcKeyDecodeErrorZ*)untag_ptr(orig); + LDKCResult_HtlcKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcKeyDecodeErrorZ), "LDKCResult_HtlcKeyDecodeErrorZ"); + *ret_conv = CResult_HtlcKeyDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -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; +int64_t CS_LDK_CResult_RevocationBasepointDecodeErrorZ_ok(int64_t o) { + LDKRevocationBasepoint o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = RevocationBasepoint_clone(&o_conv); + LDKCResult_RevocationBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationBasepointDecodeErrorZ), "LDKCResult_RevocationBasepointDecodeErrorZ"); + *ret_conv = CResult_RevocationBasepointDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -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_CResult_RevocationBasepointDecodeErrorZ_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_RevocationBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationBasepointDecodeErrorZ), "LDKCResult_RevocationBasepointDecodeErrorZ"); + *ret_conv = CResult_RevocationBasepointDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -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); + +jboolean CS_LDK_CResult_RevocationBasepointDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_RevocationBasepointDecodeErrorZ* o_conv = (LDKCResult_RevocationBasepointDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_RevocationBasepointDecodeErrorZ_is_ok(o_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; +void CS_LDK_CResult_RevocationBasepointDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_RevocationBasepointDecodeErrorZ _res_conv = *(LDKCResult_RevocationBasepointDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_RevocationBasepointDecodeErrorZ_free(_res_conv); } -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); +static inline uint64_t CResult_RevocationBasepointDecodeErrorZ_clone_ptr(LDKCResult_RevocationBasepointDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RevocationBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationBasepointDecodeErrorZ), "LDKCResult_RevocationBasepointDecodeErrorZ"); + *ret_conv = CResult_RevocationBasepointDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_RevocationBasepointDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_RevocationBasepointDecodeErrorZ* arg_conv = (LDKCResult_RevocationBasepointDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_RevocationBasepointDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_UntrustedString_hash(int64_t o) { - LDKUntrustedString o_conv; +int64_t CS_LDK_CResult_RevocationBasepointDecodeErrorZ_clone(int64_t orig) { + LDKCResult_RevocationBasepointDecodeErrorZ* orig_conv = (LDKCResult_RevocationBasepointDecodeErrorZ*)untag_ptr(orig); + LDKCResult_RevocationBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationBasepointDecodeErrorZ), "LDKCResult_RevocationBasepointDecodeErrorZ"); + *ret_conv = CResult_RevocationBasepointDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_RevocationKeyDecodeErrorZ_ok(int64_t o) { + LDKRevocationKey o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = UntrustedString_hash(&o_conv); - return ret_conv; + o_conv = RevocationKey_clone(&o_conv); + LDKCResult_RevocationKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationKeyDecodeErrorZ), "LDKCResult_RevocationKeyDecodeErrorZ"); + *ret_conv = CResult_RevocationKeyDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -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_CResult_RevocationKeyDecodeErrorZ_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_RevocationKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationKeyDecodeErrorZ), "LDKCResult_RevocationKeyDecodeErrorZ"); + *ret_conv = CResult_RevocationKeyDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -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); +jboolean CS_LDK_CResult_RevocationKeyDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_RevocationKeyDecodeErrorZ* o_conv = (LDKCResult_RevocationKeyDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_RevocationKeyDecodeErrorZ_is_ok(o_conv); + 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); +void CS_LDK_CResult_RevocationKeyDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_RevocationKeyDecodeErrorZ _res_conv = *(LDKCResult_RevocationKeyDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_RevocationKeyDecodeErrorZ_free(_res_conv); } -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); +static inline uint64_t CResult_RevocationKeyDecodeErrorZ_clone_ptr(LDKCResult_RevocationKeyDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RevocationKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationKeyDecodeErrorZ), "LDKCResult_RevocationKeyDecodeErrorZ"); + *ret_conv = CResult_RevocationKeyDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_RevocationKeyDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_RevocationKeyDecodeErrorZ* arg_conv = (LDKCResult_RevocationKeyDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_RevocationKeyDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -void 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_CResult_RevocationKeyDecodeErrorZ_clone(int64_t orig) { + LDKCResult_RevocationKeyDecodeErrorZ* orig_conv = (LDKCResult_RevocationKeyDecodeErrorZ*)untag_ptr(orig); + LDKCResult_RevocationKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationKeyDecodeErrorZ), "LDKCResult_RevocationKeyDecodeErrorZ"); + *ret_conv = CResult_RevocationKeyDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -int64_t 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; +int64_t CS_LDK_CResult_LockedChannelMonitorNoneZ_ok(int64_t o) { + LDKLockedChannelMonitor o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + // WARNING: we need a move here but no clone is available for LDKLockedChannelMonitor + + LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); + *ret_conv = CResult_LockedChannelMonitorNoneZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -void CS_LDK_TrackedSpendableOutput_free(int64_t this_obj) { - LDKTrackedSpendableOutput this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - TrackedSpendableOutput_free(this_obj_conv); +int64_t CS_LDK_CResult_LockedChannelMonitorNoneZ_err() { + LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); + *ret_conv = CResult_LockedChannelMonitorNoneZ_err(); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_TrackedSpendableOutput_get_descriptor(int64_t this_ptr) { - LDKTrackedSpendableOutput this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_copy = TrackedSpendableOutput_get_descriptor(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_CResult_LockedChannelMonitorNoneZ_is_ok(int64_t o) { + LDKCResult_LockedChannelMonitorNoneZ* o_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_LockedChannelMonitorNoneZ_is_ok(o_conv); + return ret_conv; } -void CS_LDK_TrackedSpendableOutput_set_descriptor(int64_t this_ptr, int64_t val) { - LDKTrackedSpendableOutput this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKSpendableOutputDescriptor val_conv = *(LDKSpendableOutputDescriptor*)(val_ptr); - val_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(val)); - TrackedSpendableOutput_set_descriptor(&this_ptr_conv, val_conv); +void CS_LDK_CResult_LockedChannelMonitorNoneZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_LockedChannelMonitorNoneZ _res_conv = *(LDKCResult_LockedChannelMonitorNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_LockedChannelMonitorNoneZ_free(_res_conv); } -int64_t CS_LDK_TrackedSpendableOutput_get_channel_id(int64_t this_ptr) { - LDKTrackedSpendableOutput this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelId ret_var = TrackedSpendableOutput_get_channel_id(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +static inline uint64_t C2Tuple_OutPointChannelIdZ_clone_ptr(LDKC2Tuple_OutPointChannelIdZ *NONNULL_PTR arg) { + LDKC2Tuple_OutPointChannelIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointChannelIdZ), "LDKC2Tuple_OutPointChannelIdZ"); + *ret_conv = C2Tuple_OutPointChannelIdZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_C2Tuple_OutPointChannelIdZ_clone_ptr(int64_t arg) { + LDKC2Tuple_OutPointChannelIdZ* arg_conv = (LDKC2Tuple_OutPointChannelIdZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_OutPointChannelIdZ_clone_ptr(arg_conv); + return ret_conv; } -void CS_LDK_TrackedSpendableOutput_set_channel_id(int64_t this_ptr, int64_t val) { - LDKTrackedSpendableOutput this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelId val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelId_clone(&val_conv); - TrackedSpendableOutput_set_channel_id(&this_ptr_conv, val_conv); +int64_t CS_LDK_C2Tuple_OutPointChannelIdZ_clone(int64_t orig) { + LDKC2Tuple_OutPointChannelIdZ* orig_conv = (LDKC2Tuple_OutPointChannelIdZ*)untag_ptr(orig); + LDKC2Tuple_OutPointChannelIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointChannelIdZ), "LDKC2Tuple_OutPointChannelIdZ"); + *ret_conv = C2Tuple_OutPointChannelIdZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_TrackedSpendableOutput_get_status(int64_t this_ptr) { - LDKTrackedSpendableOutput this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); - *ret_copy = TrackedSpendableOutput_get_status(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_C2Tuple_OutPointChannelIdZ_new(int64_t a, int64_t b) { + LDKOutPoint a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = OutPoint_clone(&a_conv); + LDKChannelId b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv = ChannelId_clone(&b_conv); + LDKC2Tuple_OutPointChannelIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointChannelIdZ), "LDKC2Tuple_OutPointChannelIdZ"); + *ret_conv = C2Tuple_OutPointChannelIdZ_new(a_conv, b_conv); + return tag_ptr(ret_conv, true); } -void CS_LDK_TrackedSpendableOutput_set_status(int64_t this_ptr, int64_t val) { - LDKTrackedSpendableOutput this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKOutputSpendStatus val_conv = *(LDKOutputSpendStatus*)(val_ptr); - val_conv = OutputSpendStatus_clone((LDKOutputSpendStatus*)untag_ptr(val)); - TrackedSpendableOutput_set_status(&this_ptr_conv, val_conv); +void CS_LDK_C2Tuple_OutPointChannelIdZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKC2Tuple_OutPointChannelIdZ _res_conv = *(LDKC2Tuple_OutPointChannelIdZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_OutPointChannelIdZ_free(_res_conv); } -int64_t CS_LDK_TrackedSpendableOutput_new(int64_t descriptor_arg, int64_t channel_id_arg, int64_t status_arg) { - void* descriptor_arg_ptr = untag_ptr(descriptor_arg); - CHECK_ACCESS(descriptor_arg_ptr); - LDKSpendableOutputDescriptor descriptor_arg_conv = *(LDKSpendableOutputDescriptor*)(descriptor_arg_ptr); - descriptor_arg_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(descriptor_arg)); - LDKChannelId channel_id_arg_conv; - channel_id_arg_conv.inner = untag_ptr(channel_id_arg); - channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); - channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); - void* status_arg_ptr = untag_ptr(status_arg); - CHECK_ACCESS(status_arg_ptr); - LDKOutputSpendStatus status_arg_conv = *(LDKOutputSpendStatus*)(status_arg_ptr); - status_arg_conv = OutputSpendStatus_clone((LDKOutputSpendStatus*)untag_ptr(status_arg)); - LDKTrackedSpendableOutput ret_var = TrackedSpendableOutput_new(descriptor_arg_conv, channel_id_arg_conv, status_arg_conv); +void CS_LDK_CVec_C2Tuple_OutPointChannelIdZZ_free(int64_tArray _res) { + LDKCVec_C2Tuple_OutPointChannelIdZZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OutPointChannelIdZ), "LDKCVec_C2Tuple_OutPointChannelIdZZ 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_29 = _res_vals[d]; + void* _res_conv_29_ptr = untag_ptr(_res_conv_29); + CHECK_ACCESS(_res_conv_29_ptr); + LDKC2Tuple_OutPointChannelIdZ _res_conv_29_conv = *(LDKC2Tuple_OutPointChannelIdZ*)(_res_conv_29_ptr); + FREE(untag_ptr(_res_conv_29)); + _res_constr.data[d] = _res_conv_29_conv; + } + FREE(_res); + CVec_C2Tuple_OutPointChannelIdZZ_free(_res_constr); +} + +void 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); + 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); + 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); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_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; + b_constr.datalen = b->arr_len; + if (b_constr.datalen > 0) + b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKMonitorUpdateId), "LDKCVec_MonitorUpdateIdZ Elements"); + else + b_constr.data = NULL; + 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; + } + FREE(b); + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ"); + *ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(a_conv, b_constr); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_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); + FREE(untag_ptr(_res)); + C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(_res_conv); +} + +void CS_LDK_CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(int64_tArray _res) { + LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ Elements"); + else + _res_constr.data = NULL; + 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; + } + FREE(_res); + CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(_res_constr); +} + +void CS_LDK_APIError_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); + LDKAPIError this_ptr_conv = *(LDKAPIError*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + APIError_free(this_ptr_conv); +} + +static inline uint64_t APIError_clone_ptr(LDKAPIError *NONNULL_PTR arg) { + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_APIError_clone_ptr(int64_t arg) { + LDKAPIError* arg_conv = (LDKAPIError*)untag_ptr(arg); + int64_t ret_conv = APIError_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_APIError_clone(int64_t orig) { + LDKAPIError* orig_conv = (LDKAPIError*)untag_ptr(orig); + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_APIError_apimisuse_error(jstring err) { + LDKStr err_conv = str_ref_to_owned_c(err); + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_apimisuse_error(err_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_APIError_fee_rate_too_high(jstring err, int32_t feerate) { + LDKStr err_conv = str_ref_to_owned_c(err); + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_fee_rate_too_high(err_conv, feerate); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_APIError_invalid_route(jstring err) { + LDKStr err_conv = str_ref_to_owned_c(err); + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_invalid_route(err_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_APIError_channel_unavailable(jstring err) { + LDKStr err_conv = str_ref_to_owned_c(err); + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_channel_unavailable(err_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_APIError_monitor_update_in_progress() { + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_monitor_update_in_progress(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_APIError_incompatible_shutdown_script(int64_t script) { + LDKShutdownScript script_conv; + script_conv.inner = untag_ptr(script); + script_conv.is_owned = ptr_is_owned(script); + CHECK_INNER_FIELD_ACCESS_OR_NULL(script_conv); + script_conv = ShutdownScript_clone(&script_conv); + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_incompatible_shutdown_script(script_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +jboolean CS_LDK_APIError_eq(int64_t a, int64_t b) { + LDKAPIError* a_conv = (LDKAPIError*)untag_ptr(a); + LDKAPIError* b_conv = (LDKAPIError*)untag_ptr(b); + jboolean ret_conv = APIError_eq(a_conv, b_conv); + return ret_conv; +} + +int8_tArray CS_LDK_APIError_write(int64_t obj) { + LDKAPIError* obj_conv = (LDKAPIError*)untag_ptr(obj); + LDKCVec_u8Z ret_var = APIError_write(obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_APIError_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_COption_APIErrorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_APIErrorZDecodeErrorZ), "LDKCResult_COption_APIErrorZDecodeErrorZ"); + *ret_conv = APIError_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_BigSize_free(int64_t this_obj) { + LDKBigSize this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + BigSize_free(this_obj_conv); +} + +int64_t CS_LDK_BigSize_get_a(int64_t this_ptr) { + LDKBigSize this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = BigSize_get_a(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_BigSize_set_a(int64_t this_ptr, int64_t val) { + LDKBigSize this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + BigSize_set_a(&this_ptr_conv, val); +} + +int64_t CS_LDK_BigSize_new(int64_t a_arg) { + LDKBigSize ret_var = BigSize_new(a_arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t TrackedSpendableOutput_clone_ptr(LDKTrackedSpendableOutput *NONNULL_PTR arg) { - LDKTrackedSpendableOutput ret_var = TrackedSpendableOutput_clone(arg); +static inline uint64_t BigSize_clone_ptr(LDKBigSize *NONNULL_PTR arg) { + LDKBigSize ret_var = BigSize_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_TrackedSpendableOutput_clone_ptr(int64_t arg) { - LDKTrackedSpendableOutput arg_conv; +int64_t CS_LDK_BigSize_clone_ptr(int64_t arg) { + LDKBigSize arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = TrackedSpendableOutput_clone_ptr(&arg_conv); + int64_t ret_conv = BigSize_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_TrackedSpendableOutput_clone(int64_t orig) { - LDKTrackedSpendableOutput orig_conv; +int64_t CS_LDK_BigSize_clone(int64_t orig) { + LDKBigSize orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKTrackedSpendableOutput ret_var = TrackedSpendableOutput_clone(&orig_conv); + LDKBigSize ret_var = BigSize_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -jboolean CS_LDK_TrackedSpendableOutput_eq(int64_t a, int64_t b) { - LDKTrackedSpendableOutput a_conv; +int64_t CS_LDK_BigSize_hash(int64_t o) { + LDKBigSize o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = BigSize_hash(&o_conv); + return ret_conv; +} + +jboolean CS_LDK_BigSize_eq(int64_t a, int64_t b) { + LDKBigSize a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKTrackedSpendableOutput b_conv; + LDKBigSize b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = TrackedSpendableOutput_eq(&a_conv, &b_conv); - return ret_conv; -} - -jboolean CS_LDK_TrackedSpendableOutput_is_spent_in(int64_t this_arg, int8_tArray tx) { - LDKTrackedSpendableOutput this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKTransaction tx_ref; - tx_ref.datalen = tx->arr_len; - tx_ref.data = MALLOC(tx_ref.datalen, "LDKTransaction Bytes"); - memcpy(tx_ref.data, tx->elems, tx_ref.datalen); FREE(tx); - tx_ref.data_is_owned = true; - jboolean ret_conv = TrackedSpendableOutput_is_spent_in(&this_arg_conv, tx_ref); + jboolean ret_conv = BigSize_eq(&a_conv, &b_conv); return ret_conv; } -int8_tArray CS_LDK_TrackedSpendableOutput_write(int64_t obj) { - LDKTrackedSpendableOutput obj_conv; +int8_tArray CS_LDK_BigSize_write(int64_t obj) { + LDKBigSize obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = TrackedSpendableOutput_write(&obj_conv); + LDKCVec_u8Z ret_var = BigSize_write(&obj_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_TrackedSpendableOutput_read(int8_tArray ser) { +int64_t CS_LDK_BigSize_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_TrackedSpendableOutputDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TrackedSpendableOutputDecodeErrorZ), "LDKCResult_TrackedSpendableOutputDecodeErrorZ"); - *ret_conv = TrackedSpendableOutput_read(ser_ref); + LDKCResult_BigSizeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BigSizeDecodeErrorZ), "LDKCResult_BigSizeDecodeErrorZ"); + *ret_conv = BigSize_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_OutputSpendStatus_free(int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKOutputSpendStatus this_ptr_conv = *(LDKOutputSpendStatus*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - OutputSpendStatus_free(this_ptr_conv); +void CS_LDK_Hostname_free(int64_t this_obj) { + LDKHostname this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Hostname_free(this_obj_conv); } -static inline uint64_t OutputSpendStatus_clone_ptr(LDKOutputSpendStatus *NONNULL_PTR arg) { - LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); - *ret_copy = OutputSpendStatus_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); +static inline uint64_t Hostname_clone_ptr(LDKHostname *NONNULL_PTR arg) { + LDKHostname ret_var = Hostname_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_OutputSpendStatus_clone_ptr(int64_t arg) { - LDKOutputSpendStatus* arg_conv = (LDKOutputSpendStatus*)untag_ptr(arg); - int64_t ret_conv = OutputSpendStatus_clone_ptr(arg_conv); +int64_t CS_LDK_Hostname_clone_ptr(int64_t arg) { + LDKHostname arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = Hostname_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_OutputSpendStatus_clone(int64_t orig) { - LDKOutputSpendStatus* orig_conv = (LDKOutputSpendStatus*)untag_ptr(orig); - LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); - *ret_copy = OutputSpendStatus_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +int64_t CS_LDK_Hostname_clone(int64_t orig) { + LDKHostname orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKHostname ret_var = Hostname_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_OutputSpendStatus_pending_initial_broadcast(int64_t delayed_until_height) { - void* delayed_until_height_ptr = untag_ptr(delayed_until_height); - CHECK_ACCESS(delayed_until_height_ptr); - LDKCOption_u32Z delayed_until_height_conv = *(LDKCOption_u32Z*)(delayed_until_height_ptr); - delayed_until_height_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(delayed_until_height)); - LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); - *ret_copy = OutputSpendStatus_pending_initial_broadcast(delayed_until_height_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_Hostname_hash(int64_t o) { + LDKHostname o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = Hostname_hash(&o_conv); + return ret_conv; } -int64_t CS_LDK_OutputSpendStatus_pending_first_confirmation(int8_tArray first_broadcast_hash, int32_t latest_broadcast_height, int8_tArray latest_spending_tx) { - LDKThirtyTwoBytes first_broadcast_hash_ref; - CHECK(first_broadcast_hash->arr_len == 32); - memcpy(first_broadcast_hash_ref.data, first_broadcast_hash->elems, 32); FREE(first_broadcast_hash); - LDKTransaction latest_spending_tx_ref; - latest_spending_tx_ref.datalen = latest_spending_tx->arr_len; - latest_spending_tx_ref.data = MALLOC(latest_spending_tx_ref.datalen, "LDKTransaction Bytes"); - memcpy(latest_spending_tx_ref.data, latest_spending_tx->elems, latest_spending_tx_ref.datalen); FREE(latest_spending_tx); - latest_spending_tx_ref.data_is_owned = true; - LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); - *ret_copy = OutputSpendStatus_pending_first_confirmation(first_broadcast_hash_ref, latest_broadcast_height, latest_spending_tx_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_Hostname_eq(int64_t a, int64_t b) { + LDKHostname a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKHostname b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = Hostname_eq(&a_conv, &b_conv); + return ret_conv; } -int64_t CS_LDK_OutputSpendStatus_pending_threshold_confirmations(int8_tArray first_broadcast_hash, int32_t latest_broadcast_height, int8_tArray latest_spending_tx, int32_t confirmation_height, int8_tArray confirmation_hash) { - LDKThirtyTwoBytes first_broadcast_hash_ref; - CHECK(first_broadcast_hash->arr_len == 32); - memcpy(first_broadcast_hash_ref.data, first_broadcast_hash->elems, 32); FREE(first_broadcast_hash); - LDKTransaction latest_spending_tx_ref; - latest_spending_tx_ref.datalen = latest_spending_tx->arr_len; - latest_spending_tx_ref.data = MALLOC(latest_spending_tx_ref.datalen, "LDKTransaction Bytes"); - memcpy(latest_spending_tx_ref.data, latest_spending_tx->elems, latest_spending_tx_ref.datalen); FREE(latest_spending_tx); - latest_spending_tx_ref.data_is_owned = true; - LDKThirtyTwoBytes confirmation_hash_ref; - CHECK(confirmation_hash->arr_len == 32); - memcpy(confirmation_hash_ref.data, confirmation_hash->elems, 32); FREE(confirmation_hash); - LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); - *ret_copy = OutputSpendStatus_pending_threshold_confirmations(first_broadcast_hash_ref, latest_broadcast_height, latest_spending_tx_ref, confirmation_height, confirmation_hash_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int8_t CS_LDK_Hostname_len(int64_t this_arg) { + LDKHostname this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int8_t ret_conv = Hostname_len(&this_arg_conv); + return ret_conv; } -jboolean CS_LDK_OutputSpendStatus_eq(int64_t a, int64_t b) { - LDKOutputSpendStatus* a_conv = (LDKOutputSpendStatus*)untag_ptr(a); - LDKOutputSpendStatus* b_conv = (LDKOutputSpendStatus*)untag_ptr(b); - jboolean ret_conv = OutputSpendStatus_eq(a_conv, b_conv); +jstring CS_LDK_Hostname_to_str(int64_t o) { + LDKHostname o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = Hostname_to_str(&o_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); return ret_conv; } -int8_tArray CS_LDK_OutputSpendStatus_write(int64_t obj) { - LDKOutputSpendStatus* obj_conv = (LDKOutputSpendStatus*)untag_ptr(obj); - LDKCVec_u8Z ret_var = OutputSpendStatus_write(obj_conv); +int8_tArray CS_LDK_Hostname_write(int64_t obj) { + LDKHostname obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = Hostname_write(&obj_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_OutputSpendStatus_read(int8_tArray ser) { +int64_t CS_LDK_Hostname_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_OutputSpendStatusDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSpendStatusDecodeErrorZ), "LDKCResult_OutputSpendStatusDecodeErrorZ"); - *ret_conv = OutputSpendStatus_read(ser_ref); + LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); + *ret_conv = Hostname_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_OutputSweeper_free(int64_t this_obj) { - LDKOutputSweeper this_obj_conv; +void CS_LDK_TransactionU16LenLimited_free(int64_t this_obj) { + LDKTransactionU16LenLimited this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - OutputSweeper_free(this_obj_conv); + TransactionU16LenLimited_free(this_obj_conv); } -int64_t CS_LDK_OutputSweeper_new(int64_t best_block, int64_t broadcaster, int64_t fee_estimator, int64_t chain_data_source, int64_t output_spender, int64_t change_destination_source, int64_t kv_store, int64_t logger) { - LDKBestBlock best_block_conv; - best_block_conv.inner = untag_ptr(best_block); - best_block_conv.is_owned = ptr_is_owned(best_block); - CHECK_INNER_FIELD_ACCESS_OR_NULL(best_block_conv); - best_block_conv = BestBlock_clone(&best_block_conv); - void* broadcaster_ptr = untag_ptr(broadcaster); - CHECK_ACCESS(broadcaster_ptr); - LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); - } - void* fee_estimator_ptr = untag_ptr(fee_estimator); - CHECK_ACCESS(fee_estimator_ptr); - LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); - } - void* chain_data_source_ptr = untag_ptr(chain_data_source); - CHECK_ACCESS(chain_data_source_ptr); - LDKCOption_FilterZ chain_data_source_conv = *(LDKCOption_FilterZ*)(chain_data_source_ptr); - // WARNING: we may need a move here but no clone is available for LDKCOption_FilterZ - if (chain_data_source_conv.tag == LDKCOption_FilterZ_Some) { - // Manually implement clone for Java trait instances - if (chain_data_source_conv.some.free == LDKFilter_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFilter_JCalls_cloned(&chain_data_source_conv.some); - } - } - void* output_spender_ptr = untag_ptr(output_spender); - CHECK_ACCESS(output_spender_ptr); - LDKOutputSpender output_spender_conv = *(LDKOutputSpender*)(output_spender_ptr); - if (output_spender_conv.free == LDKOutputSpender_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKOutputSpender_JCalls_cloned(&output_spender_conv); - } - void* change_destination_source_ptr = untag_ptr(change_destination_source); - CHECK_ACCESS(change_destination_source_ptr); - LDKChangeDestinationSource change_destination_source_conv = *(LDKChangeDestinationSource*)(change_destination_source_ptr); - if (change_destination_source_conv.free == LDKChangeDestinationSource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKChangeDestinationSource_JCalls_cloned(&change_destination_source_conv); - } - void* kv_store_ptr = untag_ptr(kv_store); - CHECK_ACCESS(kv_store_ptr); - LDKKVStore kv_store_conv = *(LDKKVStore*)(kv_store_ptr); - if (kv_store_conv.free == LDKKVStore_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKKVStore_JCalls_cloned(&kv_store_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKOutputSweeper ret_var = OutputSweeper_new(best_block_conv, broadcaster_conv, fee_estimator_conv, chain_data_source_conv, output_spender_conv, change_destination_source_conv, kv_store_conv, logger_conv); +static inline uint64_t TransactionU16LenLimited_clone_ptr(LDKTransactionU16LenLimited *NONNULL_PTR arg) { + LDKTransactionU16LenLimited ret_var = TransactionU16LenLimited_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } +int64_t CS_LDK_TransactionU16LenLimited_clone_ptr(int64_t arg) { + LDKTransactionU16LenLimited arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = TransactionU16LenLimited_clone_ptr(&arg_conv); + return ret_conv; +} -int64_t CS_LDK_OutputSweeper_track_spendable_outputs(int64_t this_arg, int64_tArray output_descriptors, int64_t channel_id, jboolean exclude_static_outputs, int64_t delay_until_height) { - LDKOutputSweeper this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_SpendableOutputDescriptorZ output_descriptors_constr; - output_descriptors_constr.datalen = output_descriptors->arr_len; - if (output_descriptors_constr.datalen > 0) - output_descriptors_constr.data = MALLOC(output_descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); - else - output_descriptors_constr.data = NULL; - int64_t* output_descriptors_vals = output_descriptors->elems; - for (size_t b = 0; b < output_descriptors_constr.datalen; b++) { - int64_t output_descriptors_conv_27 = output_descriptors_vals[b]; - void* output_descriptors_conv_27_ptr = untag_ptr(output_descriptors_conv_27); - CHECK_ACCESS(output_descriptors_conv_27_ptr); - LDKSpendableOutputDescriptor output_descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(output_descriptors_conv_27_ptr); - output_descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(output_descriptors_conv_27)); - output_descriptors_constr.data[b] = output_descriptors_conv_27_conv; - } - FREE(output_descriptors); - LDKChannelId channel_id_conv; - channel_id_conv.inner = untag_ptr(channel_id); - channel_id_conv.is_owned = ptr_is_owned(channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); - channel_id_conv = ChannelId_clone(&channel_id_conv); - void* delay_until_height_ptr = untag_ptr(delay_until_height); - CHECK_ACCESS(delay_until_height_ptr); - LDKCOption_u32Z delay_until_height_conv = *(LDKCOption_u32Z*)(delay_until_height_ptr); - delay_until_height_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(delay_until_height)); - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = OutputSweeper_track_spendable_outputs(&this_arg_conv, output_descriptors_constr, channel_id_conv, exclude_static_outputs, delay_until_height_conv); +int64_t CS_LDK_TransactionU16LenLimited_clone(int64_t orig) { + LDKTransactionU16LenLimited orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKTransactionU16LenLimited ret_var = TransactionU16LenLimited_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int64_t CS_LDK_TransactionU16LenLimited_hash(int64_t o) { + LDKTransactionU16LenLimited o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = TransactionU16LenLimited_hash(&o_conv); + return ret_conv; +} + +jboolean CS_LDK_TransactionU16LenLimited_eq(int64_t a, int64_t b) { + LDKTransactionU16LenLimited a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKTransactionU16LenLimited b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = TransactionU16LenLimited_eq(&a_conv, &b_conv); + return ret_conv; +} + +int64_t CS_LDK_TransactionU16LenLimited_new(int8_tArray transaction) { + LDKTransaction transaction_ref; + transaction_ref.datalen = transaction->arr_len; + transaction_ref.data = MALLOC(transaction_ref.datalen, "LDKTransaction Bytes"); + memcpy(transaction_ref.data, transaction->elems, transaction_ref.datalen); FREE(transaction); + transaction_ref.data_is_owned = true; + LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); + *ret_conv = TransactionU16LenLimited_new(transaction_ref); return tag_ptr(ret_conv, true); } -int64_tArray CS_LDK_OutputSweeper_tracked_spendable_outputs(int64_t this_arg) { - LDKOutputSweeper this_arg_conv; +int8_tArray CS_LDK_TransactionU16LenLimited_into_transaction(int64_t this_arg) { + LDKTransactionU16LenLimited this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_TrackedSpendableOutputZ ret_var = OutputSweeper_tracked_spendable_outputs(&this_arg_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t y = 0; y < ret_var.datalen; y++) { - LDKTrackedSpendableOutput ret_conv_24_var = ret_var.data[y]; - int64_t ret_conv_24_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_24_var); - ret_conv_24_ref = tag_ptr(ret_conv_24_var.inner, ret_conv_24_var.is_owned); - ret_arr_ptr[y] = ret_conv_24_ref; - } - - FREE(ret_var.data); + this_arg_conv = TransactionU16LenLimited_clone(&this_arg_conv); + LDKTransaction ret_var = TransactionU16LenLimited_into_transaction(this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + Transaction_free(ret_var); return ret_arr; } -int64_t CS_LDK_OutputSweeper_current_best_block(int64_t this_arg) { - LDKOutputSweeper this_arg_conv; +int8_tArray CS_LDK_TransactionU16LenLimited_as_transaction(int64_t this_arg) { + LDKTransactionU16LenLimited this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKBestBlock ret_var = OutputSweeper_current_best_block(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + LDKTransaction ret_var = TransactionU16LenLimited_as_transaction(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + Transaction_free(ret_var); + return ret_arr; } -int64_t CS_LDK_OutputSweeper_as_Listen(int64_t this_arg) { - LDKOutputSweeper this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); - *ret_ret = OutputSweeper_as_Listen(&this_arg_conv); - return tag_ptr(ret_ret, true); +int8_tArray CS_LDK_TransactionU16LenLimited_write(int64_t obj) { + LDKTransactionU16LenLimited obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = TransactionU16LenLimited_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -int64_t CS_LDK_OutputSweeper_as_Confirm(int64_t this_arg) { - LDKOutputSweeper this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); - *ret_ret = OutputSweeper_as_Confirm(&this_arg_conv); - return tag_ptr(ret_ret, true); +int64_t CS_LDK_TransactionU16LenLimited_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); + *ret_conv = TransactionU16LenLimited_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -void CS_LDK_SpendingDelay_free(int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKSpendingDelay this_ptr_conv = *(LDKSpendingDelay*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - SpendingDelay_free(this_ptr_conv); +int64_t CS_LDK_sign(int8_tArray msg, int8_tArray sk) { + LDKu8slice msg_ref; + msg_ref.datalen = msg->arr_len; + msg_ref.data = msg->elems; + uint8_t sk_arr[32]; + CHECK(sk->arr_len == 32); + memcpy(sk_arr, sk->elems, 32); FREE(sk); + uint8_t (*sk_ref)[32] = &sk_arr; + LDKCResult_StrSecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StrSecp256k1ErrorZ), "LDKCResult_StrSecp256k1ErrorZ"); + *ret_conv = sign(msg_ref, sk_ref); + FREE(msg); + return tag_ptr(ret_conv, true); } -static inline uint64_t SpendingDelay_clone_ptr(LDKSpendingDelay *NONNULL_PTR arg) { - LDKSpendingDelay *ret_copy = MALLOC(sizeof(LDKSpendingDelay), "LDKSpendingDelay"); - *ret_copy = SpendingDelay_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_recover_pk(int8_tArray msg, jstring sig) { + LDKu8slice msg_ref; + msg_ref.datalen = msg->arr_len; + msg_ref.data = msg->elems; + LDKStr sig_conv = str_ref_to_owned_c(sig); + LDKCResult_PublicKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecp256k1ErrorZ), "LDKCResult_PublicKeySecp256k1ErrorZ"); + *ret_conv = recover_pk(msg_ref, sig_conv); + FREE(msg); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_SpendingDelay_clone_ptr(int64_t arg) { - LDKSpendingDelay* arg_conv = (LDKSpendingDelay*)untag_ptr(arg); - int64_t ret_conv = SpendingDelay_clone_ptr(arg_conv); + +jboolean CS_LDK_verify(int8_tArray msg, jstring sig, int8_tArray pk) { + LDKu8slice msg_ref; + msg_ref.datalen = msg->arr_len; + msg_ref.data = msg->elems; + LDKStr sig_conv = str_ref_to_owned_c(sig); + LDKPublicKey pk_ref; + CHECK(pk->arr_len == 33); + memcpy(pk_ref.compressed_form, pk->elems, 33); FREE(pk); + jboolean ret_conv = verify(msg_ref, sig_conv, pk_ref); + FREE(msg); return ret_conv; } -int64_t CS_LDK_SpendingDelay_clone(int64_t orig) { - LDKSpendingDelay* orig_conv = (LDKSpendingDelay*)untag_ptr(orig); - LDKSpendingDelay *ret_copy = MALLOC(sizeof(LDKSpendingDelay), "LDKSpendingDelay"); - *ret_copy = SpendingDelay_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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; } -int64_t CS_LDK_SpendingDelay_relative(int32_t num_blocks) { - LDKSpendingDelay *ret_copy = MALLOC(sizeof(LDKSpendingDelay), "LDKSpendingDelay"); - *ret_copy = SpendingDelay_relative(num_blocks); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_KVStore_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); + LDKKVStore this_ptr_conv = *(LDKKVStore*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + KVStore_free(this_ptr_conv); } -int64_t CS_LDK_SpendingDelay_absolute(int32_t height) { - LDKSpendingDelay *ret_copy = MALLOC(sizeof(LDKSpendingDelay), "LDKSpendingDelay"); - *ret_copy = SpendingDelay_absolute(height); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_Persister_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); + LDKPersister this_ptr_conv = *(LDKPersister*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Persister_free(this_ptr_conv); } -int64_t CS_LDK_OutputSweeper_read(int8_tArray ser, int64_t arg_a, int64_t arg_b, int64_t arg_c, int64_t arg_d, int64_t arg_e, int64_t arg_f, int64_t arg_g) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - void* arg_a_ptr = untag_ptr(arg_a); - CHECK_ACCESS(arg_a_ptr); - LDKBroadcasterInterface arg_a_conv = *(LDKBroadcasterInterface*)(arg_a_ptr); - if (arg_a_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&arg_a_conv); - } - void* arg_b_ptr = untag_ptr(arg_b); - CHECK_ACCESS(arg_b_ptr); - LDKFeeEstimator arg_b_conv = *(LDKFeeEstimator*)(arg_b_ptr); - if (arg_b_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&arg_b_conv); - } - void* arg_c_ptr = untag_ptr(arg_c); - CHECK_ACCESS(arg_c_ptr); - LDKCOption_FilterZ arg_c_conv = *(LDKCOption_FilterZ*)(arg_c_ptr); - // WARNING: we may need a move here but no clone is available for LDKCOption_FilterZ - if (arg_c_conv.tag == LDKCOption_FilterZ_Some) { - // Manually implement clone for Java trait instances - if (arg_c_conv.some.free == LDKFilter_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFilter_JCalls_cloned(&arg_c_conv.some); - } - } - void* arg_d_ptr = untag_ptr(arg_d); - CHECK_ACCESS(arg_d_ptr); - LDKOutputSpender arg_d_conv = *(LDKOutputSpender*)(arg_d_ptr); - if (arg_d_conv.free == LDKOutputSpender_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKOutputSpender_JCalls_cloned(&arg_d_conv); - } - void* arg_e_ptr = untag_ptr(arg_e); - CHECK_ACCESS(arg_e_ptr); - LDKChangeDestinationSource arg_e_conv = *(LDKChangeDestinationSource*)(arg_e_ptr); - if (arg_e_conv.free == LDKChangeDestinationSource_JCalls_free) { +int64_t CS_LDK_read_channel_monitors(int64_t kv_store, int64_t entropy_source, int64_t signer_provider) { + void* kv_store_ptr = untag_ptr(kv_store); + CHECK_ACCESS(kv_store_ptr); + LDKKVStore kv_store_conv = *(LDKKVStore*)(kv_store_ptr); + if (kv_store_conv.free == LDKKVStore_JCalls_free) { // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKChangeDestinationSource_JCalls_cloned(&arg_e_conv); + LDKKVStore_JCalls_cloned(&kv_store_conv); } - void* arg_f_ptr = untag_ptr(arg_f); - CHECK_ACCESS(arg_f_ptr); - LDKKVStore arg_f_conv = *(LDKKVStore*)(arg_f_ptr); - if (arg_f_conv.free == LDKKVStore_JCalls_free) { + 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. - LDKKVStore_JCalls_cloned(&arg_f_conv); + LDKEntropySource_JCalls_cloned(&entropy_source_conv); } - void* arg_g_ptr = untag_ptr(arg_g); - CHECK_ACCESS(arg_g_ptr); - LDKLogger arg_g_conv = *(LDKLogger*)(arg_g_ptr); - if (arg_g_conv.free == LDKLogger_JCalls_free) { + 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. - LDKLogger_JCalls_cloned(&arg_g_conv); + LDKSignerProvider_JCalls_cloned(&signer_provider_conv); } - LDKCResult_OutputSweeperDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSweeperDecodeErrorZ), "LDKCResult_OutputSweeperDecodeErrorZ"); - *ret_conv = OutputSweeper_read(ser_ref, arg_a_conv, arg_b_conv, arg_c_conv, arg_d_conv, arg_e_conv, arg_f_conv, arg_g_conv); - FREE(ser); + LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ), "LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ"); + *ret_conv = read_channel_monitors(kv_store_conv, entropy_source_conv, signer_provider_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C2Tuple_BestBlockOutputSweeperZ_read(int8_tArray ser, int64_t arg_a, int64_t arg_b, int64_t arg_c, int64_t arg_d, int64_t arg_e, int64_t arg_f, int64_t arg_g) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - void* arg_a_ptr = untag_ptr(arg_a); - CHECK_ACCESS(arg_a_ptr); - LDKBroadcasterInterface arg_a_conv = *(LDKBroadcasterInterface*)(arg_a_ptr); - if (arg_a_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&arg_a_conv); - } - void* arg_b_ptr = untag_ptr(arg_b); - CHECK_ACCESS(arg_b_ptr); - LDKFeeEstimator arg_b_conv = *(LDKFeeEstimator*)(arg_b_ptr); - if (arg_b_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&arg_b_conv); - } - void* arg_c_ptr = untag_ptr(arg_c); - CHECK_ACCESS(arg_c_ptr); - LDKCOption_FilterZ arg_c_conv = *(LDKCOption_FilterZ*)(arg_c_ptr); - // WARNING: we may need a move here but no clone is available for LDKCOption_FilterZ - if (arg_c_conv.tag == LDKCOption_FilterZ_Some) { - // Manually implement clone for Java trait instances - if (arg_c_conv.some.free == LDKFilter_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFilter_JCalls_cloned(&arg_c_conv.some); - } - } - void* arg_d_ptr = untag_ptr(arg_d); - CHECK_ACCESS(arg_d_ptr); - LDKOutputSpender arg_d_conv = *(LDKOutputSpender*)(arg_d_ptr); - if (arg_d_conv.free == LDKOutputSpender_JCalls_free) { +void CS_LDK_MonitorUpdatingPersister_free(int64_t this_obj) { + LDKMonitorUpdatingPersister this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + MonitorUpdatingPersister_free(this_obj_conv); +} + +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) { + void* kv_store_ptr = untag_ptr(kv_store); + CHECK_ACCESS(kv_store_ptr); + LDKKVStore kv_store_conv = *(LDKKVStore*)(kv_store_ptr); + if (kv_store_conv.free == LDKKVStore_JCalls_free) { // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKOutputSpender_JCalls_cloned(&arg_d_conv); + LDKKVStore_JCalls_cloned(&kv_store_conv); } - void* arg_e_ptr = untag_ptr(arg_e); - CHECK_ACCESS(arg_e_ptr); - LDKChangeDestinationSource arg_e_conv = *(LDKChangeDestinationSource*)(arg_e_ptr); - if (arg_e_conv.free == LDKChangeDestinationSource_JCalls_free) { + 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. - LDKChangeDestinationSource_JCalls_cloned(&arg_e_conv); + LDKLogger_JCalls_cloned(&logger_conv); } - void* arg_f_ptr = untag_ptr(arg_f); - CHECK_ACCESS(arg_f_ptr); - LDKKVStore arg_f_conv = *(LDKKVStore*)(arg_f_ptr); - if (arg_f_conv.free == LDKKVStore_JCalls_free) { + 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. - LDKKVStore_JCalls_cloned(&arg_f_conv); + LDKEntropySource_JCalls_cloned(&entropy_source_conv); } - void* arg_g_ptr = untag_ptr(arg_g); - CHECK_ACCESS(arg_g_ptr); - LDKLogger arg_g_conv = *(LDKLogger*)(arg_g_ptr); - if (arg_g_conv.free == LDKLogger_JCalls_free) { + 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. - LDKLogger_JCalls_cloned(&arg_g_conv); + LDKSignerProvider_JCalls_cloned(&signer_provider_conv); } - LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ), "LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ"); - *ret_conv = C2Tuple_BestBlockOutputSweeperZ_read(ser_ref, arg_a_conv, arg_b_conv, arg_c_conv, arg_d_conv, arg_e_conv, arg_f_conv, arg_g_conv); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -void CS_LDK_FutureCallback_free(int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKFutureCallback this_ptr_conv = *(LDKFutureCallback*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - FutureCallback_free(this_ptr_conv); -} - -void CS_LDK_Future_free(int64_t this_obj) { - LDKFuture this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Future_free(this_obj_conv); + LDKMonitorUpdatingPersister ret_var = MonitorUpdatingPersister_new(kv_store_conv, logger_conv, maximum_pending_updates, entropy_source_conv, signer_provider_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_Future_register_callback_fn(int64_t this_arg, int64_t callback) { - LDKFuture this_arg_conv; +int64_t CS_LDK_MonitorUpdatingPersister_read_all_channel_monitors_with_updates(int64_t this_arg, int64_t broadcaster, int64_t fee_estimator) { + LDKMonitorUpdatingPersister this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - void* callback_ptr = untag_ptr(callback); - CHECK_ACCESS(callback_ptr); - LDKFutureCallback callback_conv = *(LDKFutureCallback*)(callback_ptr); - if (callback_conv.free == LDKFutureCallback_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFutureCallback_JCalls_cloned(&callback_conv); - } - Future_register_callback_fn(&this_arg_conv, callback_conv); + void* broadcaster_ptr = untag_ptr(broadcaster); + if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); } + LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; + void* fee_estimator_ptr = untag_ptr(fee_estimator); + if (ptr_is_owned(fee_estimator)) { CHECK_ACCESS(fee_estimator_ptr); } + LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; + LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ), "LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ"); + *ret_conv = MonitorUpdatingPersister_read_all_channel_monitors_with_updates(&this_arg_conv, broadcaster_conv, fee_estimator_conv); + return tag_ptr(ret_conv, true); } -void CS_LDK_Future_wait(int64_t this_arg) { - LDKFuture this_arg_conv; +int64_t CS_LDK_MonitorUpdatingPersister_read_channel_monitor_with_updates(int64_t this_arg, int64_t broadcaster, int64_t fee_estimator, jstring monitor_key) { + LDKMonitorUpdatingPersister this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - Future_wait(&this_arg_conv); + void* broadcaster_ptr = untag_ptr(broadcaster); + if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); } + LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; + void* fee_estimator_ptr = untag_ptr(fee_estimator); + if (ptr_is_owned(fee_estimator)) { CHECK_ACCESS(fee_estimator_ptr); } + LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; + LDKStr monitor_key_conv = str_ref_to_owned_c(monitor_key); + LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ), "LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ"); + *ret_conv = MonitorUpdatingPersister_read_channel_monitor_with_updates(&this_arg_conv, broadcaster_conv, fee_estimator_conv, monitor_key_conv); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_Future_wait_timeout(int64_t this_arg, int64_t max_wait) { - LDKFuture this_arg_conv; +int64_t CS_LDK_MonitorUpdatingPersister_cleanup_stale_updates(int64_t this_arg, jboolean lazy) { + LDKMonitorUpdatingPersister this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = Future_wait_timeout(&this_arg_conv, max_wait); - return ret_conv; -} - -void CS_LDK_Sleeper_free(int64_t this_obj) { - LDKSleeper this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Sleeper_free(this_obj_conv); -} - -int64_t CS_LDK_Sleeper_from_single_future(int64_t future) { - LDKFuture future_conv; - future_conv.inner = untag_ptr(future); - future_conv.is_owned = ptr_is_owned(future); - CHECK_INNER_FIELD_ACCESS_OR_NULL(future_conv); - future_conv.is_owned = false; - LDKSleeper ret_var = Sleeper_from_single_future(&future_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -int64_t CS_LDK_Sleeper_from_two_futures(int64_t fut_a, int64_t fut_b) { - 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; - LDKSleeper ret_var = Sleeper_from_two_futures(&fut_a_conv, &fut_b_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -int64_t CS_LDK_Sleeper_new(int64_tArray futures) { - LDKCVec_FutureZ futures_constr; - futures_constr.datalen = futures->arr_len; - if (futures_constr.datalen > 0) - futures_constr.data = MALLOC(futures_constr.datalen * sizeof(LDKFuture), "LDKCVec_FutureZ Elements"); - else - futures_constr.data = NULL; - int64_t* futures_vals = futures->elems; - for (size_t i = 0; i < futures_constr.datalen; i++) { - int64_t futures_conv_8 = futures_vals[i]; - LDKFuture futures_conv_8_conv; - futures_conv_8_conv.inner = untag_ptr(futures_conv_8); - futures_conv_8_conv.is_owned = ptr_is_owned(futures_conv_8); - CHECK_INNER_FIELD_ACCESS_OR_NULL(futures_conv_8_conv); - // WARNING: we need a move here but no clone is available for LDKFuture - - futures_constr.data[i] = futures_conv_8_conv; - } - FREE(futures); - LDKSleeper ret_var = Sleeper_new(futures_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_Sleeper_wait(int64_t this_arg) { - LDKSleeper this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - Sleeper_wait(&this_arg_conv); + LDKCResult_NoneIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneIOErrorZ), "LDKCResult_NoneIOErrorZ"); + *ret_conv = MonitorUpdatingPersister_cleanup_stale_updates(&this_arg_conv, lazy); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_Sleeper_wait_timeout(int64_t this_arg, int64_t max_wait) { - LDKSleeper this_arg_conv; +int64_t CS_LDK_MonitorUpdatingPersister_as_Persist(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; - jboolean ret_conv = Sleeper_wait_timeout(&this_arg_conv, max_wait); - return ret_conv; -} - -int32_t CS_LDK_Level_clone(int64_t orig) { - LDKLevel* orig_conv = (LDKLevel*)untag_ptr(orig); - int32_t ret_conv = LDKLevel_to_cs(Level_clone(orig_conv)); - return ret_conv; + LDKPersist* ret_ret = MALLOC(sizeof(LDKPersist), "LDKPersist"); + *ret_ret = MonitorUpdatingPersister_as_Persist(&this_arg_conv); + return tag_ptr(ret_ret, true); } -int32_t CS_LDK_Level_gossip() { - int32_t ret_conv = LDKLevel_to_cs(Level_gossip()); +int32_t CS_LDK_ShortChannelIdError_clone(int64_t orig) { + LDKShortChannelIdError* orig_conv = (LDKShortChannelIdError*)untag_ptr(orig); + int32_t ret_conv = LDKShortChannelIdError_to_cs(ShortChannelIdError_clone(orig_conv)); return ret_conv; } -int32_t CS_LDK_Level_trace() { - int32_t ret_conv = LDKLevel_to_cs(Level_trace()); +int32_t CS_LDK_ShortChannelIdError_block_overflow() { + int32_t ret_conv = LDKShortChannelIdError_to_cs(ShortChannelIdError_block_overflow()); return ret_conv; } -int32_t CS_LDK_Level_debug() { - int32_t ret_conv = LDKLevel_to_cs(Level_debug()); +int32_t CS_LDK_ShortChannelIdError_tx_index_overflow() { + int32_t ret_conv = LDKShortChannelIdError_to_cs(ShortChannelIdError_tx_index_overflow()); return ret_conv; } -int32_t CS_LDK_Level_info() { - int32_t ret_conv = LDKLevel_to_cs(Level_info()); +int32_t CS_LDK_ShortChannelIdError_vout_index_overflow() { + int32_t ret_conv = LDKShortChannelIdError_to_cs(ShortChannelIdError_vout_index_overflow()); return ret_conv; } -int32_t CS_LDK_Level_warn() { - int32_t ret_conv = LDKLevel_to_cs(Level_warn()); +jboolean CS_LDK_ShortChannelIdError_eq(int64_t a, int64_t b) { + LDKShortChannelIdError* a_conv = (LDKShortChannelIdError*)untag_ptr(a); + LDKShortChannelIdError* b_conv = (LDKShortChannelIdError*)untag_ptr(b); + jboolean ret_conv = ShortChannelIdError_eq(a_conv, b_conv); return ret_conv; } -int32_t CS_LDK_Level_error() { - int32_t ret_conv = LDKLevel_to_cs(Level_error()); +int32_t CS_LDK_block_from_scid(int64_t short_channel_id) { + int32_t ret_conv = block_from_scid(short_channel_id); return ret_conv; } -jboolean CS_LDK_Level_eq(int64_t a, int64_t b) { - LDKLevel* a_conv = (LDKLevel*)untag_ptr(a); - LDKLevel* b_conv = (LDKLevel*)untag_ptr(b); - jboolean ret_conv = Level_eq(a_conv, b_conv); +int32_t CS_LDK_tx_index_from_scid(int64_t short_channel_id) { + int32_t ret_conv = tx_index_from_scid(short_channel_id); return ret_conv; } -int64_t CS_LDK_Level_hash(int64_t o) { - LDKLevel* o_conv = (LDKLevel*)untag_ptr(o); - int64_t ret_conv = Level_hash(o_conv); +int16_t CS_LDK_vout_from_scid(int64_t short_channel_id) { + int16_t ret_conv = vout_from_scid(short_channel_id); return ret_conv; } -int32_t CS_LDK_Level_max() { - int32_t ret_conv = LDKLevel_to_cs(Level_max()); - return ret_conv; +int64_t CS_LDK_scid_from_parts(int64_t block, int64_t tx_index, int64_t vout_index) { + LDKCResult_u64ShortChannelIdErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u64ShortChannelIdErrorZ), "LDKCResult_u64ShortChannelIdErrorZ"); + *ret_conv = scid_from_parts(block, tx_index, vout_index); + return tag_ptr(ret_conv, true); } -void CS_LDK_Record_free(int64_t this_obj) { - LDKRecord 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); - Record_free(this_obj_conv); + UntrustedString_free(this_obj_conv); } -int32_t CS_LDK_Record_get_level(int64_t this_ptr) { - LDKRecord 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; - int32_t ret_conv = LDKLevel_to_cs(Record_get_level(&this_ptr_conv)); + 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_Record_set_level(int64_t this_ptr, int32_t val) { - LDKRecord 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; - LDKLevel val_conv = LDKLevel_from_cs(val); - Record_set_level(&this_ptr_conv, val_conv); + LDKStr val_conv = str_ref_to_owned_c(val); + UntrustedString_set_a(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_Record_get_peer_id(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; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, Record_get_peer_id(&this_ptr_conv).compressed_form, 33); - return ret_arr; +int64_t 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; } -void CS_LDK_Record_set_peer_id(int64_t this_ptr, int8_tArray val) { - LDKRecord this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - Record_set_peer_id(&this_ptr_conv, val_ref); +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_Record_get_channel_id(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; - LDKChannelId ret_var = Record_get_channel_id(&this_ptr_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; } -void CS_LDK_Record_set_channel_id(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; - LDKChannelId val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelId_clone(&val_conv); - Record_set_channel_id(&this_ptr_conv, val_conv); +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; } -jstring CS_LDK_Record_get_args(int64_t this_ptr) { - LDKRecord 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; +} + +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 = Record_get_args(&this_ptr_conv); + 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_Record_set_args(int64_t this_ptr, jstring val) { - LDKRecord this_ptr_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); - Record_set_args(&this_ptr_conv, val_conv); + PrintableString_set_a(&this_ptr_conv, val_conv); } -jstring CS_LDK_Record_get_module_path(int64_t this_ptr) { - LDKRecord this_ptr_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); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + TrackedSpendableOutput_free(this_obj_conv); +} + +int64_t CS_LDK_TrackedSpendableOutput_get_descriptor(int64_t this_ptr) { + LDKTrackedSpendableOutput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKStr ret_str = Record_get_module_path(&this_ptr_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = TrackedSpendableOutput_get_descriptor(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_Record_set_module_path(int64_t this_ptr, jstring val) { - LDKRecord this_ptr_conv; +void CS_LDK_TrackedSpendableOutput_set_descriptor(int64_t this_ptr, int64_t val) { + LDKTrackedSpendableOutput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKStr val_conv = str_ref_to_owned_c(val); - Record_set_module_path(&this_ptr_conv, val_conv); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKSpendableOutputDescriptor val_conv = *(LDKSpendableOutputDescriptor*)(val_ptr); + val_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(val)); + TrackedSpendableOutput_set_descriptor(&this_ptr_conv, val_conv); } -jstring CS_LDK_Record_get_file(int64_t this_ptr) { - LDKRecord this_ptr_conv; +int64_t CS_LDK_TrackedSpendableOutput_get_channel_id(int64_t this_ptr) { + LDKTrackedSpendableOutput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKStr ret_str = Record_get_file(&this_ptr_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; + LDKChannelId ret_var = TrackedSpendableOutput_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_Record_set_file(int64_t this_ptr, jstring val) { - LDKRecord this_ptr_conv; +void CS_LDK_TrackedSpendableOutput_set_channel_id(int64_t this_ptr, int64_t val) { + LDKTrackedSpendableOutput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKStr val_conv = str_ref_to_owned_c(val); - Record_set_file(&this_ptr_conv, 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 = ChannelId_clone(&val_conv); + TrackedSpendableOutput_set_channel_id(&this_ptr_conv, val_conv); } -int32_t CS_LDK_Record_get_line(int64_t this_ptr) { - LDKRecord this_ptr_conv; +int64_t CS_LDK_TrackedSpendableOutput_get_status(int64_t this_ptr) { + LDKTrackedSpendableOutput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int32_t ret_conv = Record_get_line(&this_ptr_conv); - return ret_conv; + LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); + *ret_copy = TrackedSpendableOutput_get_status(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_Record_set_line(int64_t this_ptr, int32_t val) { - LDKRecord this_ptr_conv; +void CS_LDK_TrackedSpendableOutput_set_status(int64_t this_ptr, int64_t val) { + LDKTrackedSpendableOutput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - Record_set_line(&this_ptr_conv, val); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKOutputSpendStatus val_conv = *(LDKOutputSpendStatus*)(val_ptr); + val_conv = OutputSpendStatus_clone((LDKOutputSpendStatus*)untag_ptr(val)); + TrackedSpendableOutput_set_status(&this_ptr_conv, val_conv); } -int64_t CS_LDK_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) { - LDKLevel level_arg_conv = LDKLevel_from_cs(level_arg); - LDKPublicKey peer_id_arg_ref; - CHECK(peer_id_arg->arr_len == 33); - memcpy(peer_id_arg_ref.compressed_form, peer_id_arg->elems, 33); FREE(peer_id_arg); +int64_t CS_LDK_TrackedSpendableOutput_new(int64_t descriptor_arg, int64_t channel_id_arg, int64_t status_arg) { + void* descriptor_arg_ptr = untag_ptr(descriptor_arg); + CHECK_ACCESS(descriptor_arg_ptr); + LDKSpendableOutputDescriptor descriptor_arg_conv = *(LDKSpendableOutputDescriptor*)(descriptor_arg_ptr); + descriptor_arg_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(descriptor_arg)); LDKChannelId channel_id_arg_conv; channel_id_arg_conv.inner = untag_ptr(channel_id_arg); channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); - 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* status_arg_ptr = untag_ptr(status_arg); + CHECK_ACCESS(status_arg_ptr); + LDKOutputSpendStatus status_arg_conv = *(LDKOutputSpendStatus*)(status_arg_ptr); + status_arg_conv = OutputSpendStatus_clone((LDKOutputSpendStatus*)untag_ptr(status_arg)); + LDKTrackedSpendableOutput ret_var = TrackedSpendableOutput_new(descriptor_arg_conv, channel_id_arg_conv, status_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t Record_clone_ptr(LDKRecord *NONNULL_PTR arg) { - LDKRecord ret_var = Record_clone(arg); +static inline uint64_t TrackedSpendableOutput_clone_ptr(LDKTrackedSpendableOutput *NONNULL_PTR arg) { + LDKTrackedSpendableOutput ret_var = TrackedSpendableOutput_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_Record_clone_ptr(int64_t arg) { - LDKRecord arg_conv; +int64_t CS_LDK_TrackedSpendableOutput_clone_ptr(int64_t arg) { + LDKTrackedSpendableOutput arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Record_clone_ptr(&arg_conv); + int64_t ret_conv = TrackedSpendableOutput_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_Record_clone(int64_t orig) { - LDKRecord orig_conv; +int64_t CS_LDK_TrackedSpendableOutput_clone(int64_t orig) { + LDKTrackedSpendableOutput orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKRecord ret_var = Record_clone(&orig_conv); + LDKTrackedSpendableOutput ret_var = TrackedSpendableOutput_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -void CS_LDK_Logger_free(int64_t this_ptr) { +jboolean CS_LDK_TrackedSpendableOutput_eq(int64_t a, int64_t b) { + LDKTrackedSpendableOutput a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKTrackedSpendableOutput b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = TrackedSpendableOutput_eq(&a_conv, &b_conv); + return ret_conv; +} + +jboolean CS_LDK_TrackedSpendableOutput_is_spent_in(int64_t this_arg, int8_tArray tx) { + LDKTrackedSpendableOutput this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKTransaction tx_ref; + tx_ref.datalen = tx->arr_len; + tx_ref.data = MALLOC(tx_ref.datalen, "LDKTransaction Bytes"); + memcpy(tx_ref.data, tx->elems, tx_ref.datalen); FREE(tx); + tx_ref.data_is_owned = true; + jboolean ret_conv = TrackedSpendableOutput_is_spent_in(&this_arg_conv, tx_ref); + return ret_conv; +} + +int8_tArray CS_LDK_TrackedSpendableOutput_write(int64_t obj) { + LDKTrackedSpendableOutput obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = TrackedSpendableOutput_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_TrackedSpendableOutput_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_TrackedSpendableOutputDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TrackedSpendableOutputDecodeErrorZ), "LDKCResult_TrackedSpendableOutputDecodeErrorZ"); + *ret_conv = TrackedSpendableOutput_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_OutputSpendStatus_free(int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); CHECK_ACCESS(this_ptr_ptr); - LDKLogger this_ptr_conv = *(LDKLogger*)(this_ptr_ptr); + LDKOutputSpendStatus this_ptr_conv = *(LDKOutputSpendStatus*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - Logger_free(this_ptr_conv); + OutputSpendStatus_free(this_ptr_conv); } -void CS_LDK_ChannelHandshakeConfig_free(int64_t this_obj) { - LDKChannelHandshakeConfig this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelHandshakeConfig_free(this_obj_conv); +static inline uint64_t OutputSpendStatus_clone_ptr(LDKOutputSpendStatus *NONNULL_PTR arg) { + LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); + *ret_copy = OutputSpendStatus_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } - -int32_t CS_LDK_ChannelHandshakeConfig_get_minimum_depth(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; - int32_t ret_conv = ChannelHandshakeConfig_get_minimum_depth(&this_ptr_conv); +int64_t CS_LDK_OutputSpendStatus_clone_ptr(int64_t arg) { + LDKOutputSpendStatus* arg_conv = (LDKOutputSpendStatus*)untag_ptr(arg); + int64_t ret_conv = OutputSpendStatus_clone_ptr(arg_conv); return ret_conv; } -void CS_LDK_ChannelHandshakeConfig_set_minimum_depth(int64_t this_ptr, int32_t val) { - LDKChannelHandshakeConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeConfig_set_minimum_depth(&this_ptr_conv, val); -} - -int16_t CS_LDK_ChannelHandshakeConfig_get_our_to_self_delay(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; - int16_t ret_conv = ChannelHandshakeConfig_get_our_to_self_delay(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_ChannelHandshakeConfig_set_our_to_self_delay(int64_t this_ptr, int16_t val) { - LDKChannelHandshakeConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeConfig_set_our_to_self_delay(&this_ptr_conv, val); -} - -int64_t CS_LDK_ChannelHandshakeConfig_get_our_htlc_minimum_msat(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; - int64_t ret_conv = ChannelHandshakeConfig_get_our_htlc_minimum_msat(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_ChannelHandshakeConfig_set_our_htlc_minimum_msat(int64_t this_ptr, int64_t val) { - LDKChannelHandshakeConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeConfig_set_our_htlc_minimum_msat(&this_ptr_conv, val); -} - -int8_t CS_LDK_ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(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; - int8_t ret_conv = ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(int64_t this_ptr, int8_t val) { - LDKChannelHandshakeConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(&this_ptr_conv, val); -} - -jboolean CS_LDK_ChannelHandshakeConfig_get_negotiate_scid_privacy(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_negotiate_scid_privacy(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_ChannelHandshakeConfig_set_negotiate_scid_privacy(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_negotiate_scid_privacy(&this_ptr_conv, val); -} - -jboolean CS_LDK_ChannelHandshakeConfig_get_announced_channel(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); - return ret_conv; -} - -void CS_LDK_ChannelHandshakeConfig_set_announced_channel(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); -} - -jboolean CS_LDK_ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(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_commit_upfront_shutdown_pubkey(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_OutputSpendStatus_clone(int64_t orig) { + LDKOutputSpendStatus* orig_conv = (LDKOutputSpendStatus*)untag_ptr(orig); + LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); + *ret_copy = OutputSpendStatus_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(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_commit_upfront_shutdown_pubkey(&this_ptr_conv, val); +int64_t CS_LDK_OutputSpendStatus_pending_initial_broadcast(int64_t delayed_until_height) { + void* delayed_until_height_ptr = untag_ptr(delayed_until_height); + CHECK_ACCESS(delayed_until_height_ptr); + LDKCOption_u32Z delayed_until_height_conv = *(LDKCOption_u32Z*)(delayed_until_height_ptr); + delayed_until_height_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(delayed_until_height)); + LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); + *ret_copy = OutputSpendStatus_pending_initial_broadcast(delayed_until_height_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int32_t CS_LDK_ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(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; - int32_t ret_conv = ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_OutputSpendStatus_pending_first_confirmation(int8_tArray first_broadcast_hash, int32_t latest_broadcast_height, int8_tArray latest_spending_tx) { + LDKThirtyTwoBytes first_broadcast_hash_ref; + CHECK(first_broadcast_hash->arr_len == 32); + memcpy(first_broadcast_hash_ref.data, first_broadcast_hash->elems, 32); FREE(first_broadcast_hash); + LDKTransaction latest_spending_tx_ref; + latest_spending_tx_ref.datalen = latest_spending_tx->arr_len; + latest_spending_tx_ref.data = MALLOC(latest_spending_tx_ref.datalen, "LDKTransaction Bytes"); + memcpy(latest_spending_tx_ref.data, latest_spending_tx->elems, latest_spending_tx_ref.datalen); FREE(latest_spending_tx); + latest_spending_tx_ref.data_is_owned = true; + LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); + *ret_copy = OutputSpendStatus_pending_first_confirmation(first_broadcast_hash_ref, latest_broadcast_height, latest_spending_tx_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(int64_t this_ptr, int32_t val) { - LDKChannelHandshakeConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(&this_ptr_conv, val); +int64_t CS_LDK_OutputSpendStatus_pending_threshold_confirmations(int8_tArray first_broadcast_hash, int32_t latest_broadcast_height, int8_tArray latest_spending_tx, int32_t confirmation_height, int8_tArray confirmation_hash) { + LDKThirtyTwoBytes first_broadcast_hash_ref; + CHECK(first_broadcast_hash->arr_len == 32); + memcpy(first_broadcast_hash_ref.data, first_broadcast_hash->elems, 32); FREE(first_broadcast_hash); + LDKTransaction latest_spending_tx_ref; + latest_spending_tx_ref.datalen = latest_spending_tx->arr_len; + latest_spending_tx_ref.data = MALLOC(latest_spending_tx_ref.datalen, "LDKTransaction Bytes"); + memcpy(latest_spending_tx_ref.data, latest_spending_tx->elems, latest_spending_tx_ref.datalen); FREE(latest_spending_tx); + latest_spending_tx_ref.data_is_owned = true; + LDKThirtyTwoBytes confirmation_hash_ref; + CHECK(confirmation_hash->arr_len == 32); + memcpy(confirmation_hash_ref.data, confirmation_hash->elems, 32); FREE(confirmation_hash); + LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); + *ret_copy = OutputSpendStatus_pending_threshold_confirmations(first_broadcast_hash_ref, latest_broadcast_height, latest_spending_tx_ref, confirmation_height, confirmation_hash_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_ChannelHandshakeConfig_get_negotiate_anchors_zero_fee_htlc_tx(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_negotiate_anchors_zero_fee_htlc_tx(&this_ptr_conv); +jboolean CS_LDK_OutputSpendStatus_eq(int64_t a, int64_t b) { + LDKOutputSpendStatus* a_conv = (LDKOutputSpendStatus*)untag_ptr(a); + LDKOutputSpendStatus* b_conv = (LDKOutputSpendStatus*)untag_ptr(b); + jboolean ret_conv = OutputSpendStatus_eq(a_conv, b_conv); return ret_conv; } -void CS_LDK_ChannelHandshakeConfig_set_negotiate_anchors_zero_fee_htlc_tx(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_negotiate_anchors_zero_fee_htlc_tx(&this_ptr_conv, val); +int8_tArray CS_LDK_OutputSpendStatus_write(int64_t obj) { + LDKOutputSpendStatus* obj_conv = (LDKOutputSpendStatus*)untag_ptr(obj); + LDKCVec_u8Z ret_var = OutputSpendStatus_write(obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -int16_t CS_LDK_ChannelHandshakeConfig_get_our_max_accepted_htlcs(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; - int16_t ret_conv = ChannelHandshakeConfig_get_our_max_accepted_htlcs(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_OutputSpendStatus_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_OutputSpendStatusDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSpendStatusDecodeErrorZ), "LDKCResult_OutputSpendStatusDecodeErrorZ"); + *ret_conv = OutputSpendStatus_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -void CS_LDK_ChannelHandshakeConfig_set_our_max_accepted_htlcs(int64_t this_ptr, int16_t val) { - LDKChannelHandshakeConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeConfig_set_our_max_accepted_htlcs(&this_ptr_conv, val); +void CS_LDK_OutputSweeper_free(int64_t this_obj) { + LDKOutputSweeper this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OutputSweeper_free(this_obj_conv); } -int64_t CS_LDK_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_OutputSweeper_new(int64_t best_block, int64_t broadcaster, int64_t fee_estimator, int64_t chain_data_source, int64_t output_spender, int64_t change_destination_source, int64_t kv_store, int64_t logger) { + LDKBestBlock best_block_conv; + best_block_conv.inner = untag_ptr(best_block); + best_block_conv.is_owned = ptr_is_owned(best_block); + CHECK_INNER_FIELD_ACCESS_OR_NULL(best_block_conv); + best_block_conv = BestBlock_clone(&best_block_conv); + void* broadcaster_ptr = untag_ptr(broadcaster); + CHECK_ACCESS(broadcaster_ptr); + LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); + if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); + } + void* fee_estimator_ptr = untag_ptr(fee_estimator); + CHECK_ACCESS(fee_estimator_ptr); + LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); + if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); + } + void* chain_data_source_ptr = untag_ptr(chain_data_source); + CHECK_ACCESS(chain_data_source_ptr); + LDKCOption_FilterZ chain_data_source_conv = *(LDKCOption_FilterZ*)(chain_data_source_ptr); + // WARNING: we may need a move here but no clone is available for LDKCOption_FilterZ + if (chain_data_source_conv.tag == LDKCOption_FilterZ_Some) { + // Manually implement clone for Java trait instances + if (chain_data_source_conv.some.free == LDKFilter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFilter_JCalls_cloned(&chain_data_source_conv.some); + } + } + void* output_spender_ptr = untag_ptr(output_spender); + CHECK_ACCESS(output_spender_ptr); + LDKOutputSpender output_spender_conv = *(LDKOutputSpender*)(output_spender_ptr); + if (output_spender_conv.free == LDKOutputSpender_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOutputSpender_JCalls_cloned(&output_spender_conv); + } + void* change_destination_source_ptr = untag_ptr(change_destination_source); + CHECK_ACCESS(change_destination_source_ptr); + LDKChangeDestinationSource change_destination_source_conv = *(LDKChangeDestinationSource*)(change_destination_source_ptr); + if (change_destination_source_conv.free == LDKChangeDestinationSource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKChangeDestinationSource_JCalls_cloned(&change_destination_source_conv); + } + void* kv_store_ptr = untag_ptr(kv_store); + CHECK_ACCESS(kv_store_ptr); + LDKKVStore kv_store_conv = *(LDKKVStore*)(kv_store_ptr); + if (kv_store_conv.free == LDKKVStore_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKKVStore_JCalls_cloned(&kv_store_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKOutputSweeper ret_var = OutputSweeper_new(best_block_conv, broadcaster_conv, fee_estimator_conv, chain_data_source_conv, output_spender_conv, change_destination_source_conv, kv_store_conv, logger_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t ChannelHandshakeConfig_clone_ptr(LDKChannelHandshakeConfig *NONNULL_PTR arg) { - LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -int64_t CS_LDK_ChannelHandshakeConfig_clone_ptr(int64_t arg) { - LDKChannelHandshakeConfig arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = ChannelHandshakeConfig_clone_ptr(&arg_conv); - return ret_conv; +int64_t CS_LDK_OutputSweeper_track_spendable_outputs(int64_t this_arg, int64_tArray output_descriptors, int64_t channel_id, jboolean exclude_static_outputs, int64_t delay_until_height) { + LDKOutputSweeper this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_SpendableOutputDescriptorZ output_descriptors_constr; + output_descriptors_constr.datalen = output_descriptors->arr_len; + if (output_descriptors_constr.datalen > 0) + output_descriptors_constr.data = MALLOC(output_descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); + else + output_descriptors_constr.data = NULL; + int64_t* output_descriptors_vals = output_descriptors->elems; + for (size_t b = 0; b < output_descriptors_constr.datalen; b++) { + int64_t output_descriptors_conv_27 = output_descriptors_vals[b]; + void* output_descriptors_conv_27_ptr = untag_ptr(output_descriptors_conv_27); + CHECK_ACCESS(output_descriptors_conv_27_ptr); + LDKSpendableOutputDescriptor output_descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(output_descriptors_conv_27_ptr); + output_descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(output_descriptors_conv_27)); + output_descriptors_constr.data[b] = output_descriptors_conv_27_conv; + } + FREE(output_descriptors); + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); + void* delay_until_height_ptr = untag_ptr(delay_until_height); + CHECK_ACCESS(delay_until_height_ptr); + LDKCOption_u32Z delay_until_height_conv = *(LDKCOption_u32Z*)(delay_until_height_ptr); + delay_until_height_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(delay_until_height)); + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = OutputSweeper_track_spendable_outputs(&this_arg_conv, output_descriptors_constr, channel_id_conv, exclude_static_outputs, delay_until_height_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelHandshakeConfig_clone(int64_t orig) { - LDKChannelHandshakeConfig orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(&orig_conv); - int64_t ret_ref = 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_OutputSweeper_tracked_spendable_outputs(int64_t this_arg) { + LDKOutputSweeper this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_TrackedSpendableOutputZ ret_var = OutputSweeper_tracked_spendable_outputs(&this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t y = 0; y < ret_var.datalen; y++) { + LDKTrackedSpendableOutput ret_conv_24_var = ret_var.data[y]; + int64_t ret_conv_24_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_24_var); + ret_conv_24_ref = tag_ptr(ret_conv_24_var.inner, ret_conv_24_var.is_owned); + ret_arr_ptr[y] = ret_conv_24_ref; + } + + FREE(ret_var.data); + return ret_arr; } -int64_t CS_LDK_ChannelHandshakeConfig_default() { - LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_default(); +int64_t CS_LDK_OutputSweeper_current_best_block(int64_t this_arg) { + LDKOutputSweeper this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKBestBlock ret_var = OutputSweeper_current_best_block(&this_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -void CS_LDK_ChannelHandshakeLimits_free(int64_t this_obj) { - LDKChannelHandshakeLimits this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelHandshakeLimits_free(this_obj_conv); -} - -int64_t CS_LDK_ChannelHandshakeLimits_get_min_funding_satoshis(int64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelHandshakeLimits_get_min_funding_satoshis(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_OutputSweeper_as_Listen(int64_t this_arg) { + LDKOutputSweeper this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); + *ret_ret = OutputSweeper_as_Listen(&this_arg_conv); + return tag_ptr(ret_ret, true); } -void CS_LDK_ChannelHandshakeLimits_set_min_funding_satoshis(int64_t this_ptr, int64_t val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeLimits_set_min_funding_satoshis(&this_ptr_conv, val); +int64_t CS_LDK_OutputSweeper_as_Confirm(int64_t this_arg) { + LDKOutputSweeper this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); + *ret_ret = OutputSweeper_as_Confirm(&this_arg_conv); + return tag_ptr(ret_ret, true); } -int64_t CS_LDK_ChannelHandshakeLimits_get_max_funding_satoshis(int64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelHandshakeLimits_get_max_funding_satoshis(&this_ptr_conv); - return ret_conv; +void CS_LDK_SpendingDelay_free(int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKSpendingDelay this_ptr_conv = *(LDKSpendingDelay*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + SpendingDelay_free(this_ptr_conv); } -void CS_LDK_ChannelHandshakeLimits_set_max_funding_satoshis(int64_t this_ptr, int64_t val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeLimits_set_max_funding_satoshis(&this_ptr_conv, val); +static inline uint64_t SpendingDelay_clone_ptr(LDKSpendingDelay *NONNULL_PTR arg) { + LDKSpendingDelay *ret_copy = MALLOC(sizeof(LDKSpendingDelay), "LDKSpendingDelay"); + *ret_copy = SpendingDelay_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } - -int64_t CS_LDK_ChannelHandshakeLimits_get_max_htlc_minimum_msat(int64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelHandshakeLimits_get_max_htlc_minimum_msat(&this_ptr_conv); +int64_t CS_LDK_SpendingDelay_clone_ptr(int64_t arg) { + LDKSpendingDelay* arg_conv = (LDKSpendingDelay*)untag_ptr(arg); + int64_t ret_conv = SpendingDelay_clone_ptr(arg_conv); return ret_conv; } -void CS_LDK_ChannelHandshakeLimits_set_max_htlc_minimum_msat(int64_t this_ptr, int64_t val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeLimits_set_max_htlc_minimum_msat(&this_ptr_conv, val); -} - -int64_t CS_LDK_ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(int64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_SpendingDelay_clone(int64_t orig) { + LDKSpendingDelay* orig_conv = (LDKSpendingDelay*)untag_ptr(orig); + LDKSpendingDelay *ret_copy = MALLOC(sizeof(LDKSpendingDelay), "LDKSpendingDelay"); + *ret_copy = SpendingDelay_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(int64_t this_ptr, int64_t val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(&this_ptr_conv, val); +int64_t CS_LDK_SpendingDelay_relative(int32_t num_blocks) { + LDKSpendingDelay *ret_copy = MALLOC(sizeof(LDKSpendingDelay), "LDKSpendingDelay"); + *ret_copy = SpendingDelay_relative(num_blocks); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_ChannelHandshakeLimits_get_max_channel_reserve_satoshis(int64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelHandshakeLimits_get_max_channel_reserve_satoshis(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_SpendingDelay_absolute(int32_t height) { + LDKSpendingDelay *ret_copy = MALLOC(sizeof(LDKSpendingDelay), "LDKSpendingDelay"); + *ret_copy = SpendingDelay_absolute(height); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_ChannelHandshakeLimits_set_max_channel_reserve_satoshis(int64_t this_ptr, int64_t val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeLimits_set_max_channel_reserve_satoshis(&this_ptr_conv, val); -} - -int16_t CS_LDK_ChannelHandshakeLimits_get_min_max_accepted_htlcs(int64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int16_t ret_conv = ChannelHandshakeLimits_get_min_max_accepted_htlcs(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_ChannelHandshakeLimits_set_min_max_accepted_htlcs(int64_t this_ptr, int16_t val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeLimits_set_min_max_accepted_htlcs(&this_ptr_conv, val); -} - -int32_t CS_LDK_ChannelHandshakeLimits_get_max_minimum_depth(int64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int32_t ret_conv = ChannelHandshakeLimits_get_max_minimum_depth(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_OutputSweeper_read(int8_tArray ser, int64_t arg_a, int64_t arg_b, int64_t arg_c, int64_t arg_d, int64_t arg_e, int64_t arg_f, int64_t arg_g) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + void* arg_a_ptr = untag_ptr(arg_a); + CHECK_ACCESS(arg_a_ptr); + LDKBroadcasterInterface arg_a_conv = *(LDKBroadcasterInterface*)(arg_a_ptr); + if (arg_a_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&arg_a_conv); + } + void* arg_b_ptr = untag_ptr(arg_b); + CHECK_ACCESS(arg_b_ptr); + LDKFeeEstimator arg_b_conv = *(LDKFeeEstimator*)(arg_b_ptr); + if (arg_b_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&arg_b_conv); + } + void* arg_c_ptr = untag_ptr(arg_c); + CHECK_ACCESS(arg_c_ptr); + LDKCOption_FilterZ arg_c_conv = *(LDKCOption_FilterZ*)(arg_c_ptr); + // WARNING: we may need a move here but no clone is available for LDKCOption_FilterZ + if (arg_c_conv.tag == LDKCOption_FilterZ_Some) { + // Manually implement clone for Java trait instances + if (arg_c_conv.some.free == LDKFilter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFilter_JCalls_cloned(&arg_c_conv.some); + } + } + void* arg_d_ptr = untag_ptr(arg_d); + CHECK_ACCESS(arg_d_ptr); + LDKOutputSpender arg_d_conv = *(LDKOutputSpender*)(arg_d_ptr); + if (arg_d_conv.free == LDKOutputSpender_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOutputSpender_JCalls_cloned(&arg_d_conv); + } + void* arg_e_ptr = untag_ptr(arg_e); + CHECK_ACCESS(arg_e_ptr); + LDKChangeDestinationSource arg_e_conv = *(LDKChangeDestinationSource*)(arg_e_ptr); + if (arg_e_conv.free == LDKChangeDestinationSource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKChangeDestinationSource_JCalls_cloned(&arg_e_conv); + } + void* arg_f_ptr = untag_ptr(arg_f); + CHECK_ACCESS(arg_f_ptr); + LDKKVStore arg_f_conv = *(LDKKVStore*)(arg_f_ptr); + if (arg_f_conv.free == LDKKVStore_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKKVStore_JCalls_cloned(&arg_f_conv); + } + void* arg_g_ptr = untag_ptr(arg_g); + CHECK_ACCESS(arg_g_ptr); + LDKLogger arg_g_conv = *(LDKLogger*)(arg_g_ptr); + if (arg_g_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&arg_g_conv); + } + LDKCResult_OutputSweeperDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSweeperDecodeErrorZ), "LDKCResult_OutputSweeperDecodeErrorZ"); + *ret_conv = OutputSweeper_read(ser_ref, arg_a_conv, arg_b_conv, arg_c_conv, arg_d_conv, arg_e_conv, arg_f_conv, arg_g_conv); + FREE(ser); + return tag_ptr(ret_conv, true); } -void CS_LDK_ChannelHandshakeLimits_set_max_minimum_depth(int64_t this_ptr, int32_t val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeLimits_set_max_minimum_depth(&this_ptr_conv, val); +int64_t CS_LDK_C2Tuple_BestBlockOutputSweeperZ_read(int8_tArray ser, int64_t arg_a, int64_t arg_b, int64_t arg_c, int64_t arg_d, int64_t arg_e, int64_t arg_f, int64_t arg_g) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + void* arg_a_ptr = untag_ptr(arg_a); + CHECK_ACCESS(arg_a_ptr); + LDKBroadcasterInterface arg_a_conv = *(LDKBroadcasterInterface*)(arg_a_ptr); + if (arg_a_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&arg_a_conv); + } + void* arg_b_ptr = untag_ptr(arg_b); + CHECK_ACCESS(arg_b_ptr); + LDKFeeEstimator arg_b_conv = *(LDKFeeEstimator*)(arg_b_ptr); + if (arg_b_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&arg_b_conv); + } + void* arg_c_ptr = untag_ptr(arg_c); + CHECK_ACCESS(arg_c_ptr); + LDKCOption_FilterZ arg_c_conv = *(LDKCOption_FilterZ*)(arg_c_ptr); + // WARNING: we may need a move here but no clone is available for LDKCOption_FilterZ + if (arg_c_conv.tag == LDKCOption_FilterZ_Some) { + // Manually implement clone for Java trait instances + if (arg_c_conv.some.free == LDKFilter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFilter_JCalls_cloned(&arg_c_conv.some); + } + } + void* arg_d_ptr = untag_ptr(arg_d); + CHECK_ACCESS(arg_d_ptr); + LDKOutputSpender arg_d_conv = *(LDKOutputSpender*)(arg_d_ptr); + if (arg_d_conv.free == LDKOutputSpender_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOutputSpender_JCalls_cloned(&arg_d_conv); + } + void* arg_e_ptr = untag_ptr(arg_e); + CHECK_ACCESS(arg_e_ptr); + LDKChangeDestinationSource arg_e_conv = *(LDKChangeDestinationSource*)(arg_e_ptr); + if (arg_e_conv.free == LDKChangeDestinationSource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKChangeDestinationSource_JCalls_cloned(&arg_e_conv); + } + void* arg_f_ptr = untag_ptr(arg_f); + CHECK_ACCESS(arg_f_ptr); + LDKKVStore arg_f_conv = *(LDKKVStore*)(arg_f_ptr); + if (arg_f_conv.free == LDKKVStore_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKKVStore_JCalls_cloned(&arg_f_conv); + } + void* arg_g_ptr = untag_ptr(arg_g); + CHECK_ACCESS(arg_g_ptr); + LDKLogger arg_g_conv = *(LDKLogger*)(arg_g_ptr); + if (arg_g_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&arg_g_conv); + } + LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ), "LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ"); + *ret_conv = C2Tuple_BestBlockOutputSweeperZ_read(ser_ref, arg_a_conv, arg_b_conv, arg_c_conv, arg_d_conv, arg_e_conv, arg_f_conv, arg_g_conv); + FREE(ser); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_ChannelHandshakeLimits_get_trust_own_funding_0conf(int64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - jboolean ret_conv = ChannelHandshakeLimits_get_trust_own_funding_0conf(&this_ptr_conv); - return ret_conv; +void CS_LDK_FutureCallback_free(int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKFutureCallback this_ptr_conv = *(LDKFutureCallback*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + FutureCallback_free(this_ptr_conv); } -void CS_LDK_ChannelHandshakeLimits_set_trust_own_funding_0conf(int64_t this_ptr, jboolean val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeLimits_set_trust_own_funding_0conf(&this_ptr_conv, val); +void CS_LDK_Future_free(int64_t this_obj) { + LDKFuture this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Future_free(this_obj_conv); } -jboolean CS_LDK_ChannelHandshakeLimits_get_force_announced_channel_preference(int64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - jboolean ret_conv = ChannelHandshakeLimits_get_force_announced_channel_preference(&this_ptr_conv); - return ret_conv; +void CS_LDK_Future_register_callback_fn(int64_t this_arg, int64_t callback) { + LDKFuture this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + void* callback_ptr = untag_ptr(callback); + CHECK_ACCESS(callback_ptr); + LDKFutureCallback callback_conv = *(LDKFutureCallback*)(callback_ptr); + if (callback_conv.free == LDKFutureCallback_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFutureCallback_JCalls_cloned(&callback_conv); + } + Future_register_callback_fn(&this_arg_conv, callback_conv); } -void CS_LDK_ChannelHandshakeLimits_set_force_announced_channel_preference(int64_t this_ptr, jboolean val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeLimits_set_force_announced_channel_preference(&this_ptr_conv, val); +void CS_LDK_Future_wait(int64_t this_arg) { + LDKFuture this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + Future_wait(&this_arg_conv); } -int16_t CS_LDK_ChannelHandshakeLimits_get_their_to_self_delay(int64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int16_t ret_conv = ChannelHandshakeLimits_get_their_to_self_delay(&this_ptr_conv); +jboolean CS_LDK_Future_wait_timeout(int64_t this_arg, int64_t max_wait) { + LDKFuture this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Future_wait_timeout(&this_arg_conv, max_wait); return ret_conv; } -void CS_LDK_ChannelHandshakeLimits_set_their_to_self_delay(int64_t this_ptr, int16_t val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeLimits_set_their_to_self_delay(&this_ptr_conv, val); +void CS_LDK_Sleeper_free(int64_t this_obj) { + LDKSleeper this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Sleeper_free(this_obj_conv); } -int64_t CS_LDK_ChannelHandshakeLimits_new(int64_t min_funding_satoshis_arg, int64_t max_funding_satoshis_arg, int64_t max_htlc_minimum_msat_arg, int64_t min_max_htlc_value_in_flight_msat_arg, int64_t max_channel_reserve_satoshis_arg, int16_t min_max_accepted_htlcs_arg, int32_t max_minimum_depth_arg, jboolean trust_own_funding_0conf_arg, jboolean force_announced_channel_preference_arg, int16_t their_to_self_delay_arg) { - LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_new(min_funding_satoshis_arg, max_funding_satoshis_arg, max_htlc_minimum_msat_arg, min_max_htlc_value_in_flight_msat_arg, max_channel_reserve_satoshis_arg, min_max_accepted_htlcs_arg, max_minimum_depth_arg, trust_own_funding_0conf_arg, force_announced_channel_preference_arg, their_to_self_delay_arg); +int64_t CS_LDK_Sleeper_from_single_future(int64_t future) { + LDKFuture future_conv; + future_conv.inner = untag_ptr(future); + future_conv.is_owned = ptr_is_owned(future); + CHECK_INNER_FIELD_ACCESS_OR_NULL(future_conv); + future_conv.is_owned = false; + LDKSleeper ret_var = Sleeper_from_single_future(&future_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t ChannelHandshakeLimits_clone_ptr(LDKChannelHandshakeLimits *NONNULL_PTR arg) { - LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(arg); +int64_t CS_LDK_Sleeper_from_two_futures(int64_t fut_a, int64_t fut_b) { + 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; + LDKSleeper ret_var = Sleeper_from_two_futures(&fut_a_conv, &fut_b_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_ChannelHandshakeLimits_clone_ptr(int64_t arg) { - LDKChannelHandshakeLimits arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = ChannelHandshakeLimits_clone_ptr(&arg_conv); - return ret_conv; -} -int64_t CS_LDK_ChannelHandshakeLimits_clone(int64_t orig) { - LDKChannelHandshakeLimits orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(&orig_conv); +int64_t CS_LDK_Sleeper_new(int64_tArray futures) { + LDKCVec_FutureZ futures_constr; + futures_constr.datalen = futures->arr_len; + if (futures_constr.datalen > 0) + futures_constr.data = MALLOC(futures_constr.datalen * sizeof(LDKFuture), "LDKCVec_FutureZ Elements"); + else + futures_constr.data = NULL; + int64_t* futures_vals = futures->elems; + for (size_t i = 0; i < futures_constr.datalen; i++) { + int64_t futures_conv_8 = futures_vals[i]; + LDKFuture futures_conv_8_conv; + futures_conv_8_conv.inner = untag_ptr(futures_conv_8); + futures_conv_8_conv.is_owned = ptr_is_owned(futures_conv_8); + CHECK_INNER_FIELD_ACCESS_OR_NULL(futures_conv_8_conv); + // WARNING: we need a move here but no clone is available for LDKFuture + + futures_constr.data[i] = futures_conv_8_conv; + } + FREE(futures); + LDKSleeper ret_var = Sleeper_new(futures_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_ChannelHandshakeLimits_default() { - LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_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_Sleeper_wait(int64_t this_arg) { + LDKSleeper this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + Sleeper_wait(&this_arg_conv); } -void CS_LDK_MaxDustHTLCExposure_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); - LDKMaxDustHTLCExposure this_ptr_conv = *(LDKMaxDustHTLCExposure*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - MaxDustHTLCExposure_free(this_ptr_conv); +jboolean CS_LDK_Sleeper_wait_timeout(int64_t this_arg, int64_t max_wait) { + LDKSleeper this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Sleeper_wait_timeout(&this_arg_conv, max_wait); + return ret_conv; } -static inline uint64_t MaxDustHTLCExposure_clone_ptr(LDKMaxDustHTLCExposure *NONNULL_PTR arg) { - LDKMaxDustHTLCExposure *ret_copy = MALLOC(sizeof(LDKMaxDustHTLCExposure), "LDKMaxDustHTLCExposure"); - *ret_copy = MaxDustHTLCExposure_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_Level_clone(int64_t orig) { + LDKLevel* orig_conv = (LDKLevel*)untag_ptr(orig); + int32_t ret_conv = LDKLevel_to_cs(Level_clone(orig_conv)); + return ret_conv; } -int64_t CS_LDK_MaxDustHTLCExposure_clone_ptr(int64_t arg) { - LDKMaxDustHTLCExposure* arg_conv = (LDKMaxDustHTLCExposure*)untag_ptr(arg); - int64_t ret_conv = MaxDustHTLCExposure_clone_ptr(arg_conv); + +int32_t CS_LDK_Level_gossip() { + int32_t ret_conv = LDKLevel_to_cs(Level_gossip()); return ret_conv; } -int64_t CS_LDK_MaxDustHTLCExposure_clone(int64_t orig) { - LDKMaxDustHTLCExposure* orig_conv = (LDKMaxDustHTLCExposure*)untag_ptr(orig); - LDKMaxDustHTLCExposure *ret_copy = MALLOC(sizeof(LDKMaxDustHTLCExposure), "LDKMaxDustHTLCExposure"); - *ret_copy = MaxDustHTLCExposure_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_Level_trace() { + int32_t ret_conv = LDKLevel_to_cs(Level_trace()); + return ret_conv; } -int64_t CS_LDK_MaxDustHTLCExposure_fixed_limit_msat(int64_t a) { - LDKMaxDustHTLCExposure *ret_copy = MALLOC(sizeof(LDKMaxDustHTLCExposure), "LDKMaxDustHTLCExposure"); - *ret_copy = MaxDustHTLCExposure_fixed_limit_msat(a); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_Level_debug() { + int32_t ret_conv = LDKLevel_to_cs(Level_debug()); + return ret_conv; } -int64_t CS_LDK_MaxDustHTLCExposure_fee_rate_multiplier(int64_t a) { - LDKMaxDustHTLCExposure *ret_copy = MALLOC(sizeof(LDKMaxDustHTLCExposure), "LDKMaxDustHTLCExposure"); - *ret_copy = MaxDustHTLCExposure_fee_rate_multiplier(a); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_Level_info() { + int32_t ret_conv = LDKLevel_to_cs(Level_info()); + return ret_conv; } -jboolean CS_LDK_MaxDustHTLCExposure_eq(int64_t a, int64_t b) { - LDKMaxDustHTLCExposure* a_conv = (LDKMaxDustHTLCExposure*)untag_ptr(a); - LDKMaxDustHTLCExposure* b_conv = (LDKMaxDustHTLCExposure*)untag_ptr(b); - jboolean ret_conv = MaxDustHTLCExposure_eq(a_conv, b_conv); +int32_t CS_LDK_Level_warn() { + int32_t ret_conv = LDKLevel_to_cs(Level_warn()); return ret_conv; } -int8_tArray CS_LDK_MaxDustHTLCExposure_write(int64_t obj) { - LDKMaxDustHTLCExposure* obj_conv = (LDKMaxDustHTLCExposure*)untag_ptr(obj); - LDKCVec_u8Z ret_var = MaxDustHTLCExposure_write(obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +int32_t CS_LDK_Level_error() { + int32_t ret_conv = LDKLevel_to_cs(Level_error()); + return ret_conv; } -int64_t CS_LDK_MaxDustHTLCExposure_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_MaxDustHTLCExposureDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_MaxDustHTLCExposureDecodeErrorZ), "LDKCResult_MaxDustHTLCExposureDecodeErrorZ"); - *ret_conv = MaxDustHTLCExposure_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +jboolean CS_LDK_Level_eq(int64_t a, int64_t b) { + LDKLevel* a_conv = (LDKLevel*)untag_ptr(a); + LDKLevel* b_conv = (LDKLevel*)untag_ptr(b); + jboolean ret_conv = Level_eq(a_conv, b_conv); + return ret_conv; } -void CS_LDK_ChannelConfig_free(int64_t this_obj) { - LDKChannelConfig this_obj_conv; +int64_t CS_LDK_Level_hash(int64_t o) { + LDKLevel* o_conv = (LDKLevel*)untag_ptr(o); + int64_t ret_conv = Level_hash(o_conv); + return ret_conv; +} + +jstring CS_LDK_Level_to_str(int64_t o) { + LDKLevel* o_conv = (LDKLevel*)untag_ptr(o); + LDKStr ret_str = Level_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_Level_max() { + int32_t ret_conv = LDKLevel_to_cs(Level_max()); + return ret_conv; +} + +void CS_LDK_Record_free(int64_t this_obj) { + LDKRecord this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelConfig_free(this_obj_conv); + Record_free(this_obj_conv); } -int32_t CS_LDK_ChannelConfig_get_forwarding_fee_proportional_millionths(int64_t this_ptr) { - LDKChannelConfig this_ptr_conv; +int32_t CS_LDK_Record_get_level(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; - int32_t ret_conv = ChannelConfig_get_forwarding_fee_proportional_millionths(&this_ptr_conv); + int32_t ret_conv = LDKLevel_to_cs(Record_get_level(&this_ptr_conv)); return ret_conv; } -void CS_LDK_ChannelConfig_set_forwarding_fee_proportional_millionths(int64_t this_ptr, int32_t val) { - LDKChannelConfig this_ptr_conv; +void CS_LDK_Record_set_level(int64_t this_ptr, int32_t val) { + LDKRecord this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelConfig_set_forwarding_fee_proportional_millionths(&this_ptr_conv, val); + LDKLevel val_conv = LDKLevel_from_cs(val); + Record_set_level(&this_ptr_conv, val_conv); } -int32_t CS_LDK_ChannelConfig_get_forwarding_fee_base_msat(int64_t this_ptr) { - LDKChannelConfig this_ptr_conv; +int8_tArray CS_LDK_Record_get_peer_id(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; - int32_t ret_conv = ChannelConfig_get_forwarding_fee_base_msat(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, Record_get_peer_id(&this_ptr_conv).compressed_form, 33); + return ret_arr; } -void CS_LDK_ChannelConfig_set_forwarding_fee_base_msat(int64_t this_ptr, int32_t val) { - LDKChannelConfig this_ptr_conv; +void CS_LDK_Record_set_peer_id(int64_t this_ptr, int8_tArray val) { + LDKRecord this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelConfig_set_forwarding_fee_base_msat(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + Record_set_peer_id(&this_ptr_conv, val_ref); } -int16_t CS_LDK_ChannelConfig_get_cltv_expiry_delta(int64_t this_ptr) { - LDKChannelConfig this_ptr_conv; +int64_t CS_LDK_Record_get_channel_id(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; - int16_t ret_conv = ChannelConfig_get_cltv_expiry_delta(&this_ptr_conv); - return ret_conv; + LDKChannelId ret_var = Record_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_ChannelConfig_set_cltv_expiry_delta(int64_t this_ptr, int16_t val) { - LDKChannelConfig this_ptr_conv; +void CS_LDK_Record_set_channel_id(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; - ChannelConfig_set_cltv_expiry_delta(&this_ptr_conv, val); + LDKChannelId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelId_clone(&val_conv); + Record_set_channel_id(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelConfig_get_max_dust_htlc_exposure(int64_t this_ptr) { - LDKChannelConfig this_ptr_conv; +jstring CS_LDK_Record_get_args(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; - LDKMaxDustHTLCExposure *ret_copy = MALLOC(sizeof(LDKMaxDustHTLCExposure), "LDKMaxDustHTLCExposure"); - *ret_copy = ChannelConfig_get_max_dust_htlc_exposure(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKStr ret_str = Record_get_args(&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_ChannelConfig_set_max_dust_htlc_exposure(int64_t this_ptr, int64_t val) { - LDKChannelConfig this_ptr_conv; +void CS_LDK_Record_set_args(int64_t this_ptr, jstring val) { + LDKRecord this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKMaxDustHTLCExposure val_conv = *(LDKMaxDustHTLCExposure*)(val_ptr); - val_conv = MaxDustHTLCExposure_clone((LDKMaxDustHTLCExposure*)untag_ptr(val)); - ChannelConfig_set_max_dust_htlc_exposure(&this_ptr_conv, val_conv); + LDKStr val_conv = str_ref_to_owned_c(val); + Record_set_args(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelConfig_get_force_close_avoidance_max_fee_satoshis(int64_t this_ptr) { - LDKChannelConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); +jstring CS_LDK_Record_get_module_path(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; - int64_t ret_conv = ChannelConfig_get_force_close_avoidance_max_fee_satoshis(&this_ptr_conv); + LDKStr ret_str = Record_get_module_path(&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_ChannelConfig_set_force_close_avoidance_max_fee_satoshis(int64_t this_ptr, int64_t val) { - LDKChannelConfig this_ptr_conv; +void CS_LDK_Record_set_module_path(int64_t this_ptr, jstring val) { + LDKRecord this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelConfig_set_force_close_avoidance_max_fee_satoshis(&this_ptr_conv, val); + LDKStr val_conv = str_ref_to_owned_c(val); + Record_set_module_path(&this_ptr_conv, val_conv); } -jboolean CS_LDK_ChannelConfig_get_accept_underpaying_htlcs(int64_t this_ptr) { - LDKChannelConfig this_ptr_conv; +jstring CS_LDK_Record_get_file(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; - jboolean ret_conv = ChannelConfig_get_accept_underpaying_htlcs(&this_ptr_conv); + LDKStr ret_str = Record_get_file(&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_ChannelConfig_set_accept_underpaying_htlcs(int64_t this_ptr, jboolean val) { - LDKChannelConfig this_ptr_conv; +void CS_LDK_Record_set_file(int64_t this_ptr, jstring val) { + LDKRecord this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelConfig_set_accept_underpaying_htlcs(&this_ptr_conv, val); + LDKStr val_conv = str_ref_to_owned_c(val); + Record_set_file(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelConfig_new(int32_t forwarding_fee_proportional_millionths_arg, int32_t forwarding_fee_base_msat_arg, int16_t cltv_expiry_delta_arg, int64_t max_dust_htlc_exposure_arg, int64_t force_close_avoidance_max_fee_satoshis_arg, jboolean accept_underpaying_htlcs_arg) { - void* max_dust_htlc_exposure_arg_ptr = untag_ptr(max_dust_htlc_exposure_arg); - CHECK_ACCESS(max_dust_htlc_exposure_arg_ptr); - LDKMaxDustHTLCExposure max_dust_htlc_exposure_arg_conv = *(LDKMaxDustHTLCExposure*)(max_dust_htlc_exposure_arg_ptr); - max_dust_htlc_exposure_arg_conv = MaxDustHTLCExposure_clone((LDKMaxDustHTLCExposure*)untag_ptr(max_dust_htlc_exposure_arg)); - LDKChannelConfig ret_var = ChannelConfig_new(forwarding_fee_proportional_millionths_arg, forwarding_fee_base_msat_arg, cltv_expiry_delta_arg, max_dust_htlc_exposure_arg_conv, force_close_avoidance_max_fee_satoshis_arg, accept_underpaying_htlcs_arg); +int32_t CS_LDK_Record_get_line(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; + int32_t ret_conv = Record_get_line(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_Record_set_line(int64_t this_ptr, int32_t val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + Record_set_line(&this_ptr_conv, val); +} + +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) { + LDKLevel level_arg_conv = LDKLevel_from_cs(level_arg); + LDKPublicKey peer_id_arg_ref; + CHECK(peer_id_arg->arr_len == 33); + memcpy(peer_id_arg_ref.compressed_form, peer_id_arg->elems, 33); FREE(peer_id_arg); + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); + LDKStr args_arg_conv = str_ref_to_owned_c(args_arg); + LDKStr module_path_arg_conv = str_ref_to_owned_c(module_path_arg); + LDKStr file_arg_conv = str_ref_to_owned_c(file_arg); + LDKRecord ret_var = Record_new(level_arg_conv, peer_id_arg_ref, channel_id_arg_conv, args_arg_conv, module_path_arg_conv, file_arg_conv, line_arg); int64_t ret_ref = 0; 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 ChannelConfig_clone_ptr(LDKChannelConfig *NONNULL_PTR arg) { - LDKChannelConfig ret_var = ChannelConfig_clone(arg); +static inline uint64_t Record_clone_ptr(LDKRecord *NONNULL_PTR arg) { + LDKRecord ret_var = Record_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_ChannelConfig_clone_ptr(int64_t arg) { - LDKChannelConfig arg_conv; +int64_t CS_LDK_Record_clone_ptr(int64_t arg) { + LDKRecord arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = ChannelConfig_clone_ptr(&arg_conv); + int64_t ret_conv = Record_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_ChannelConfig_clone(int64_t orig) { - LDKChannelConfig orig_conv; +int64_t CS_LDK_Record_clone(int64_t orig) { + LDKRecord orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKChannelConfig ret_var = ChannelConfig_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_ChannelConfig_eq(int64_t a, int64_t b) { - LDKChannelConfig a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKChannelConfig b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = ChannelConfig_eq(&a_conv, &b_conv); - return ret_conv; -} - -void CS_LDK_ChannelConfig_apply(int64_t this_arg, int64_t update) { - LDKChannelConfig this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelConfigUpdate update_conv; - update_conv.inner = untag_ptr(update); - update_conv.is_owned = ptr_is_owned(update); - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv); - update_conv.is_owned = false; - ChannelConfig_apply(&this_arg_conv, &update_conv); -} - -int64_t CS_LDK_ChannelConfig_default() { - LDKChannelConfig ret_var = ChannelConfig_default(); + LDKRecord ret_var = Record_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_ChannelConfig_write(int64_t obj) { - LDKChannelConfig obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ChannelConfig_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -int64_t CS_LDK_ChannelConfig_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); - *ret_conv = ChannelConfig_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void CS_LDK_Logger_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); + LDKLogger this_ptr_conv = *(LDKLogger*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Logger_free(this_ptr_conv); } -void CS_LDK_ChannelConfigUpdate_free(int64_t this_obj) { - LDKChannelConfigUpdate this_obj_conv; +void CS_LDK_ChannelHandshakeConfig_free(int64_t this_obj) { + LDKChannelHandshakeConfig this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelConfigUpdate_free(this_obj_conv); -} - -int64_t CS_LDK_ChannelConfigUpdate_get_forwarding_fee_proportional_millionths(int64_t this_ptr) { - LDKChannelConfigUpdate this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); - *ret_copy = ChannelConfigUpdate_get_forwarding_fee_proportional_millionths(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -void CS_LDK_ChannelConfigUpdate_set_forwarding_fee_proportional_millionths(int64_t this_ptr, int64_t val) { - LDKChannelConfigUpdate this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); - val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val)); - ChannelConfigUpdate_set_forwarding_fee_proportional_millionths(&this_ptr_conv, val_conv); -} - -int64_t CS_LDK_ChannelConfigUpdate_get_forwarding_fee_base_msat(int64_t this_ptr) { - LDKChannelConfigUpdate this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); - *ret_copy = ChannelConfigUpdate_get_forwarding_fee_base_msat(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -void CS_LDK_ChannelConfigUpdate_set_forwarding_fee_base_msat(int64_t this_ptr, int64_t val) { - LDKChannelConfigUpdate this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); - val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val)); - ChannelConfigUpdate_set_forwarding_fee_base_msat(&this_ptr_conv, val_conv); -} - -int64_t CS_LDK_ChannelConfigUpdate_get_cltv_expiry_delta(int64_t this_ptr) { - LDKChannelConfigUpdate this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); - *ret_copy = ChannelConfigUpdate_get_cltv_expiry_delta(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -void CS_LDK_ChannelConfigUpdate_set_cltv_expiry_delta(int64_t this_ptr, int64_t val) { - LDKChannelConfigUpdate this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr); - val_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(val)); - ChannelConfigUpdate_set_cltv_expiry_delta(&this_ptr_conv, val_conv); + ChannelHandshakeConfig_free(this_obj_conv); } -int64_t CS_LDK_ChannelConfigUpdate_get_max_dust_htlc_exposure_msat(int64_t this_ptr) { - LDKChannelConfigUpdate this_ptr_conv; +int32_t CS_LDK_ChannelHandshakeConfig_get_minimum_depth(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; - LDKCOption_MaxDustHTLCExposureZ *ret_copy = MALLOC(sizeof(LDKCOption_MaxDustHTLCExposureZ), "LDKCOption_MaxDustHTLCExposureZ"); - *ret_copy = ChannelConfigUpdate_get_max_dust_htlc_exposure_msat(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + int32_t ret_conv = ChannelHandshakeConfig_get_minimum_depth(&this_ptr_conv); + return ret_conv; } -void CS_LDK_ChannelConfigUpdate_set_max_dust_htlc_exposure_msat(int64_t this_ptr, int64_t val) { - LDKChannelConfigUpdate this_ptr_conv; +void CS_LDK_ChannelHandshakeConfig_set_minimum_depth(int64_t this_ptr, int32_t val) { + LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_MaxDustHTLCExposureZ val_conv = *(LDKCOption_MaxDustHTLCExposureZ*)(val_ptr); - val_conv = COption_MaxDustHTLCExposureZ_clone((LDKCOption_MaxDustHTLCExposureZ*)untag_ptr(val)); - ChannelConfigUpdate_set_max_dust_htlc_exposure_msat(&this_ptr_conv, val_conv); + ChannelHandshakeConfig_set_minimum_depth(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelConfigUpdate_get_force_close_avoidance_max_fee_satoshis(int64_t this_ptr) { - LDKChannelConfigUpdate this_ptr_conv; +int16_t CS_LDK_ChannelHandshakeConfig_get_our_to_self_delay(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; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelConfigUpdate_get_force_close_avoidance_max_fee_satoshis(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + int16_t ret_conv = ChannelHandshakeConfig_get_our_to_self_delay(&this_ptr_conv); + return ret_conv; } -void CS_LDK_ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis(int64_t this_ptr, int64_t val) { - LDKChannelConfigUpdate this_ptr_conv; +void CS_LDK_ChannelHandshakeConfig_set_our_to_self_delay(int64_t this_ptr, int16_t val) { + LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis(&this_ptr_conv, val_conv); -} - -int64_t CS_LDK_ChannelConfigUpdate_new(int64_t forwarding_fee_proportional_millionths_arg, int64_t forwarding_fee_base_msat_arg, int64_t cltv_expiry_delta_arg, int64_t max_dust_htlc_exposure_msat_arg, int64_t force_close_avoidance_max_fee_satoshis_arg) { - void* forwarding_fee_proportional_millionths_arg_ptr = untag_ptr(forwarding_fee_proportional_millionths_arg); - CHECK_ACCESS(forwarding_fee_proportional_millionths_arg_ptr); - LDKCOption_u32Z forwarding_fee_proportional_millionths_arg_conv = *(LDKCOption_u32Z*)(forwarding_fee_proportional_millionths_arg_ptr); - forwarding_fee_proportional_millionths_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(forwarding_fee_proportional_millionths_arg)); - void* forwarding_fee_base_msat_arg_ptr = untag_ptr(forwarding_fee_base_msat_arg); - CHECK_ACCESS(forwarding_fee_base_msat_arg_ptr); - LDKCOption_u32Z forwarding_fee_base_msat_arg_conv = *(LDKCOption_u32Z*)(forwarding_fee_base_msat_arg_ptr); - forwarding_fee_base_msat_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(forwarding_fee_base_msat_arg)); - void* cltv_expiry_delta_arg_ptr = untag_ptr(cltv_expiry_delta_arg); - CHECK_ACCESS(cltv_expiry_delta_arg_ptr); - LDKCOption_u16Z cltv_expiry_delta_arg_conv = *(LDKCOption_u16Z*)(cltv_expiry_delta_arg_ptr); - cltv_expiry_delta_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(cltv_expiry_delta_arg)); - void* max_dust_htlc_exposure_msat_arg_ptr = untag_ptr(max_dust_htlc_exposure_msat_arg); - CHECK_ACCESS(max_dust_htlc_exposure_msat_arg_ptr); - LDKCOption_MaxDustHTLCExposureZ max_dust_htlc_exposure_msat_arg_conv = *(LDKCOption_MaxDustHTLCExposureZ*)(max_dust_htlc_exposure_msat_arg_ptr); - max_dust_htlc_exposure_msat_arg_conv = COption_MaxDustHTLCExposureZ_clone((LDKCOption_MaxDustHTLCExposureZ*)untag_ptr(max_dust_htlc_exposure_msat_arg)); - void* force_close_avoidance_max_fee_satoshis_arg_ptr = untag_ptr(force_close_avoidance_max_fee_satoshis_arg); - CHECK_ACCESS(force_close_avoidance_max_fee_satoshis_arg_ptr); - LDKCOption_u64Z force_close_avoidance_max_fee_satoshis_arg_conv = *(LDKCOption_u64Z*)(force_close_avoidance_max_fee_satoshis_arg_ptr); - force_close_avoidance_max_fee_satoshis_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(force_close_avoidance_max_fee_satoshis_arg)); - LDKChannelConfigUpdate ret_var = ChannelConfigUpdate_new(forwarding_fee_proportional_millionths_arg_conv, forwarding_fee_base_msat_arg_conv, cltv_expiry_delta_arg_conv, max_dust_htlc_exposure_msat_arg_conv, force_close_avoidance_max_fee_satoshis_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - 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); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - UserConfig_free(this_obj_conv); + ChannelHandshakeConfig_set_our_to_self_delay(&this_ptr_conv, val); } -int64_t CS_LDK_UserConfig_get_channel_handshake_config(int64_t this_ptr) { - LDKUserConfig this_ptr_conv; +int64_t CS_LDK_ChannelHandshakeConfig_get_our_htlc_minimum_msat(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; - LDKChannelHandshakeConfig ret_var = UserConfig_get_channel_handshake_config(&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 = ChannelHandshakeConfig_get_our_htlc_minimum_msat(&this_ptr_conv); + return ret_conv; } -void CS_LDK_UserConfig_set_channel_handshake_config(int64_t this_ptr, int64_t val) { - LDKUserConfig this_ptr_conv; +void CS_LDK_ChannelHandshakeConfig_set_our_htlc_minimum_msat(int64_t this_ptr, int64_t val) { + LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelHandshakeConfig val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelHandshakeConfig_clone(&val_conv); - UserConfig_set_channel_handshake_config(&this_ptr_conv, val_conv); + ChannelHandshakeConfig_set_our_htlc_minimum_msat(&this_ptr_conv, val); } -int64_t CS_LDK_UserConfig_get_channel_handshake_limits(int64_t this_ptr) { - LDKUserConfig this_ptr_conv; +int8_t CS_LDK_ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(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; - LDKChannelHandshakeLimits ret_var = UserConfig_get_channel_handshake_limits(&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_t ret_conv = ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(&this_ptr_conv); + return ret_conv; } -void CS_LDK_UserConfig_set_channel_handshake_limits(int64_t this_ptr, int64_t val) { - LDKUserConfig this_ptr_conv; +void CS_LDK_ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(int64_t this_ptr, int8_t val) { + LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelHandshakeLimits val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelHandshakeLimits_clone(&val_conv); - UserConfig_set_channel_handshake_limits(&this_ptr_conv, val_conv); + ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(&this_ptr_conv, val); } -int64_t CS_LDK_UserConfig_get_channel_config(int64_t this_ptr) { - LDKUserConfig this_ptr_conv; +jboolean CS_LDK_ChannelHandshakeConfig_get_negotiate_scid_privacy(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; - LDKChannelConfig ret_var = UserConfig_get_channel_config(&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 ret_conv = ChannelHandshakeConfig_get_negotiate_scid_privacy(&this_ptr_conv); + return ret_conv; } -void CS_LDK_UserConfig_set_channel_config(int64_t this_ptr, int64_t val) { - LDKUserConfig this_ptr_conv; +void CS_LDK_ChannelHandshakeConfig_set_negotiate_scid_privacy(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; - LDKChannelConfig val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelConfig_clone(&val_conv); - UserConfig_set_channel_config(&this_ptr_conv, val_conv); + ChannelHandshakeConfig_set_negotiate_scid_privacy(&this_ptr_conv, val); } -jboolean CS_LDK_UserConfig_get_accept_forwards_to_priv_channels(int64_t this_ptr) { - LDKUserConfig this_ptr_conv; +jboolean CS_LDK_ChannelHandshakeConfig_get_announced_channel(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 = UserConfig_get_accept_forwards_to_priv_channels(&this_ptr_conv); + jboolean ret_conv = ChannelHandshakeConfig_get_announced_channel(&this_ptr_conv); return ret_conv; } -void CS_LDK_UserConfig_set_accept_forwards_to_priv_channels(int64_t this_ptr, jboolean val) { - LDKUserConfig this_ptr_conv; +void CS_LDK_ChannelHandshakeConfig_set_announced_channel(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; - UserConfig_set_accept_forwards_to_priv_channels(&this_ptr_conv, val); + ChannelHandshakeConfig_set_announced_channel(&this_ptr_conv, val); } -jboolean CS_LDK_UserConfig_get_accept_inbound_channels(int64_t this_ptr) { - LDKUserConfig this_ptr_conv; +jboolean CS_LDK_ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(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 = UserConfig_get_accept_inbound_channels(&this_ptr_conv); + jboolean ret_conv = ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(&this_ptr_conv); return ret_conv; } -void CS_LDK_UserConfig_set_accept_inbound_channels(int64_t this_ptr, jboolean val) { - LDKUserConfig this_ptr_conv; +void CS_LDK_ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(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; - UserConfig_set_accept_inbound_channels(&this_ptr_conv, val); + ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(&this_ptr_conv, val); } -jboolean CS_LDK_UserConfig_get_manually_accept_inbound_channels(int64_t this_ptr) { - LDKUserConfig this_ptr_conv; +int32_t CS_LDK_ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(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 = UserConfig_get_manually_accept_inbound_channels(&this_ptr_conv); + int32_t ret_conv = ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(&this_ptr_conv); return ret_conv; } -void CS_LDK_UserConfig_set_manually_accept_inbound_channels(int64_t this_ptr, jboolean val) { - LDKUserConfig this_ptr_conv; +void CS_LDK_ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(int64_t this_ptr, int32_t val) { + LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - UserConfig_set_manually_accept_inbound_channels(&this_ptr_conv, val); + ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(&this_ptr_conv, val); } -jboolean CS_LDK_UserConfig_get_accept_intercept_htlcs(int64_t this_ptr) { - LDKUserConfig this_ptr_conv; +jboolean CS_LDK_ChannelHandshakeConfig_get_negotiate_anchors_zero_fee_htlc_tx(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 = UserConfig_get_accept_intercept_htlcs(&this_ptr_conv); + jboolean ret_conv = ChannelHandshakeConfig_get_negotiate_anchors_zero_fee_htlc_tx(&this_ptr_conv); return ret_conv; } -void CS_LDK_UserConfig_set_accept_intercept_htlcs(int64_t this_ptr, jboolean val) { - LDKUserConfig this_ptr_conv; +void CS_LDK_ChannelHandshakeConfig_set_negotiate_anchors_zero_fee_htlc_tx(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; - UserConfig_set_accept_intercept_htlcs(&this_ptr_conv, val); + ChannelHandshakeConfig_set_negotiate_anchors_zero_fee_htlc_tx(&this_ptr_conv, val); } -jboolean CS_LDK_UserConfig_get_accept_mpp_keysend(int64_t this_ptr) { - LDKUserConfig this_ptr_conv; +int16_t CS_LDK_ChannelHandshakeConfig_get_our_max_accepted_htlcs(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 = UserConfig_get_accept_mpp_keysend(&this_ptr_conv); + int16_t ret_conv = ChannelHandshakeConfig_get_our_max_accepted_htlcs(&this_ptr_conv); return ret_conv; } -void CS_LDK_UserConfig_set_accept_mpp_keysend(int64_t this_ptr, jboolean val) { - LDKUserConfig this_ptr_conv; +void CS_LDK_ChannelHandshakeConfig_set_our_max_accepted_htlcs(int64_t this_ptr, int16_t val) { + LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - UserConfig_set_accept_mpp_keysend(&this_ptr_conv, val); + ChannelHandshakeConfig_set_our_max_accepted_htlcs(&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) { - LDKChannelHandshakeConfig channel_handshake_config_arg_conv; - channel_handshake_config_arg_conv.inner = untag_ptr(channel_handshake_config_arg); - channel_handshake_config_arg_conv.is_owned = ptr_is_owned(channel_handshake_config_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_handshake_config_arg_conv); - channel_handshake_config_arg_conv = ChannelHandshakeConfig_clone(&channel_handshake_config_arg_conv); - LDKChannelHandshakeLimits channel_handshake_limits_arg_conv; - channel_handshake_limits_arg_conv.inner = untag_ptr(channel_handshake_limits_arg); - channel_handshake_limits_arg_conv.is_owned = ptr_is_owned(channel_handshake_limits_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_handshake_limits_arg_conv); - channel_handshake_limits_arg_conv = ChannelHandshakeLimits_clone(&channel_handshake_limits_arg_conv); - LDKChannelConfig channel_config_arg_conv; - channel_config_arg_conv.inner = untag_ptr(channel_config_arg); - channel_config_arg_conv.is_owned = ptr_is_owned(channel_config_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_config_arg_conv); - channel_config_arg_conv = ChannelConfig_clone(&channel_config_arg_conv); - LDKUserConfig ret_var = UserConfig_new(channel_handshake_config_arg_conv, channel_handshake_limits_arg_conv, channel_config_arg_conv, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg, manually_accept_inbound_channels_arg, accept_intercept_htlcs_arg, accept_mpp_keysend_arg); +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 ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t UserConfig_clone_ptr(LDKUserConfig *NONNULL_PTR arg) { - LDKUserConfig ret_var = UserConfig_clone(arg); +static inline uint64_t ChannelHandshakeConfig_clone_ptr(LDKChannelHandshakeConfig *NONNULL_PTR arg) { + LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_UserConfig_clone_ptr(int64_t arg) { - LDKUserConfig arg_conv; +int64_t CS_LDK_ChannelHandshakeConfig_clone_ptr(int64_t arg) { + LDKChannelHandshakeConfig arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = UserConfig_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelHandshakeConfig_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_UserConfig_clone(int64_t orig) { - LDKUserConfig orig_conv; +int64_t CS_LDK_ChannelHandshakeConfig_clone(int64_t orig) { + LDKChannelHandshakeConfig orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKUserConfig ret_var = UserConfig_clone(&orig_conv); + LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_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_UserConfig_default() { - LDKUserConfig ret_var = UserConfig_default(); +int64_t CS_LDK_ChannelHandshakeConfig_default() { + LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_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_BestBlock_free(int64_t this_obj) { - LDKBestBlock this_obj_conv; +void CS_LDK_ChannelHandshakeLimits_free(int64_t this_obj) { + LDKChannelHandshakeLimits this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BestBlock_free(this_obj_conv); + ChannelHandshakeLimits_free(this_obj_conv); } -int8_tArray CS_LDK_BestBlock_get_block_hash(int64_t this_ptr) { - LDKBestBlock this_ptr_conv; +int64_t CS_LDK_ChannelHandshakeLimits_get_min_funding_satoshis(int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *BestBlock_get_block_hash(&this_ptr_conv), 32); - return ret_arr; + int64_t ret_conv = ChannelHandshakeLimits_get_min_funding_satoshis(&this_ptr_conv); + return ret_conv; } -void CS_LDK_BestBlock_set_block_hash(int64_t this_ptr, int8_tArray val) { - LDKBestBlock this_ptr_conv; +void CS_LDK_ChannelHandshakeLimits_set_min_funding_satoshis(int64_t this_ptr, int64_t val) { + LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - BestBlock_set_block_hash(&this_ptr_conv, val_ref); + ChannelHandshakeLimits_set_min_funding_satoshis(&this_ptr_conv, val); } -int32_t CS_LDK_BestBlock_get_height(int64_t this_ptr) { - LDKBestBlock this_ptr_conv; +int64_t CS_LDK_ChannelHandshakeLimits_get_max_funding_satoshis(int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int32_t ret_conv = BestBlock_get_height(&this_ptr_conv); + int64_t ret_conv = ChannelHandshakeLimits_get_max_funding_satoshis(&this_ptr_conv); return ret_conv; } -void CS_LDK_BestBlock_set_height(int64_t this_ptr, int32_t val) { - LDKBestBlock this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); +void CS_LDK_ChannelHandshakeLimits_set_max_funding_satoshis(int64_t this_ptr, int64_t val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - BestBlock_set_height(&this_ptr_conv, val); + ChannelHandshakeLimits_set_max_funding_satoshis(&this_ptr_conv, val); } -int64_t CS_LDK_BestBlock_new(int8_tArray block_hash_arg, int32_t height_arg) { - LDKThirtyTwoBytes block_hash_arg_ref; - CHECK(block_hash_arg->arr_len == 32); - memcpy(block_hash_arg_ref.data, block_hash_arg->elems, 32); FREE(block_hash_arg); - LDKBestBlock ret_var = BestBlock_new(block_hash_arg_ref, height_arg); +int64_t CS_LDK_ChannelHandshakeLimits_get_max_htlc_minimum_msat(int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ChannelHandshakeLimits_get_max_htlc_minimum_msat(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_ChannelHandshakeLimits_set_max_htlc_minimum_msat(int64_t this_ptr, int64_t val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelHandshakeLimits_set_max_htlc_minimum_msat(&this_ptr_conv, val); +} + +int64_t CS_LDK_ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(int64_t this_ptr, int64_t val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(&this_ptr_conv, val); +} + +int64_t CS_LDK_ChannelHandshakeLimits_get_max_channel_reserve_satoshis(int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ChannelHandshakeLimits_get_max_channel_reserve_satoshis(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_ChannelHandshakeLimits_set_max_channel_reserve_satoshis(int64_t this_ptr, int64_t val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelHandshakeLimits_set_max_channel_reserve_satoshis(&this_ptr_conv, val); +} + +int16_t CS_LDK_ChannelHandshakeLimits_get_min_max_accepted_htlcs(int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int16_t ret_conv = ChannelHandshakeLimits_get_min_max_accepted_htlcs(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_ChannelHandshakeLimits_set_min_max_accepted_htlcs(int64_t this_ptr, int16_t val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelHandshakeLimits_set_min_max_accepted_htlcs(&this_ptr_conv, val); +} + +int32_t CS_LDK_ChannelHandshakeLimits_get_max_minimum_depth(int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = ChannelHandshakeLimits_get_max_minimum_depth(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_ChannelHandshakeLimits_set_max_minimum_depth(int64_t this_ptr, int32_t val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelHandshakeLimits_set_max_minimum_depth(&this_ptr_conv, val); +} + +jboolean CS_LDK_ChannelHandshakeLimits_get_trust_own_funding_0conf(int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + jboolean ret_conv = ChannelHandshakeLimits_get_trust_own_funding_0conf(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_ChannelHandshakeLimits_set_trust_own_funding_0conf(int64_t this_ptr, jboolean val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelHandshakeLimits_set_trust_own_funding_0conf(&this_ptr_conv, val); +} + +jboolean CS_LDK_ChannelHandshakeLimits_get_force_announced_channel_preference(int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + jboolean ret_conv = ChannelHandshakeLimits_get_force_announced_channel_preference(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_ChannelHandshakeLimits_set_force_announced_channel_preference(int64_t this_ptr, jboolean val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelHandshakeLimits_set_force_announced_channel_preference(&this_ptr_conv, val); +} + +int16_t CS_LDK_ChannelHandshakeLimits_get_their_to_self_delay(int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int16_t ret_conv = ChannelHandshakeLimits_get_their_to_self_delay(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_ChannelHandshakeLimits_set_their_to_self_delay(int64_t this_ptr, int16_t val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelHandshakeLimits_set_their_to_self_delay(&this_ptr_conv, val); +} + +int64_t CS_LDK_ChannelHandshakeLimits_new(int64_t min_funding_satoshis_arg, int64_t max_funding_satoshis_arg, int64_t max_htlc_minimum_msat_arg, int64_t min_max_htlc_value_in_flight_msat_arg, int64_t max_channel_reserve_satoshis_arg, int16_t min_max_accepted_htlcs_arg, int32_t max_minimum_depth_arg, jboolean trust_own_funding_0conf_arg, jboolean force_announced_channel_preference_arg, int16_t their_to_self_delay_arg) { + LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_new(min_funding_satoshis_arg, max_funding_satoshis_arg, max_htlc_minimum_msat_arg, min_max_htlc_value_in_flight_msat_arg, max_channel_reserve_satoshis_arg, min_max_accepted_htlcs_arg, max_minimum_depth_arg, trust_own_funding_0conf_arg, force_announced_channel_preference_arg, their_to_self_delay_arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t BestBlock_clone_ptr(LDKBestBlock *NONNULL_PTR arg) { - LDKBestBlock ret_var = BestBlock_clone(arg); +static inline uint64_t ChannelHandshakeLimits_clone_ptr(LDKChannelHandshakeLimits *NONNULL_PTR arg) { + LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_BestBlock_clone_ptr(int64_t arg) { - LDKBestBlock arg_conv; +int64_t CS_LDK_ChannelHandshakeLimits_clone_ptr(int64_t arg) { + LDKChannelHandshakeLimits arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = BestBlock_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelHandshakeLimits_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_BestBlock_clone(int64_t orig) { - LDKBestBlock orig_conv; +int64_t CS_LDK_ChannelHandshakeLimits_clone(int64_t orig) { + LDKChannelHandshakeLimits orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBestBlock ret_var = BestBlock_clone(&orig_conv); + LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_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_BestBlock_hash(int64_t o) { - LDKBestBlock o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = BestBlock_hash(&o_conv); - return ret_conv; +int64_t CS_LDK_ChannelHandshakeLimits_default() { + LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_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_BestBlock_eq(int64_t a, int64_t b) { - LDKBestBlock a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKBestBlock b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = BestBlock_eq(&a_conv, &b_conv); +void CS_LDK_MaxDustHTLCExposure_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); + LDKMaxDustHTLCExposure this_ptr_conv = *(LDKMaxDustHTLCExposure*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + MaxDustHTLCExposure_free(this_ptr_conv); +} + +static inline uint64_t MaxDustHTLCExposure_clone_ptr(LDKMaxDustHTLCExposure *NONNULL_PTR arg) { + LDKMaxDustHTLCExposure *ret_copy = MALLOC(sizeof(LDKMaxDustHTLCExposure), "LDKMaxDustHTLCExposure"); + *ret_copy = MaxDustHTLCExposure_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_MaxDustHTLCExposure_clone_ptr(int64_t arg) { + LDKMaxDustHTLCExposure* arg_conv = (LDKMaxDustHTLCExposure*)untag_ptr(arg); + int64_t ret_conv = MaxDustHTLCExposure_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_BestBlock_from_network(int32_t network) { - LDKNetwork network_conv = LDKNetwork_from_cs(network); - LDKBestBlock ret_var = BestBlock_from_network(network_conv); - 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_MaxDustHTLCExposure_clone(int64_t orig) { + LDKMaxDustHTLCExposure* orig_conv = (LDKMaxDustHTLCExposure*)untag_ptr(orig); + LDKMaxDustHTLCExposure *ret_copy = MALLOC(sizeof(LDKMaxDustHTLCExposure), "LDKMaxDustHTLCExposure"); + *ret_copy = MaxDustHTLCExposure_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int8_tArray CS_LDK_BestBlock_write(int64_t obj) { - LDKBestBlock obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = BestBlock_write(&obj_conv); +int64_t CS_LDK_MaxDustHTLCExposure_fixed_limit_msat(int64_t a) { + LDKMaxDustHTLCExposure *ret_copy = MALLOC(sizeof(LDKMaxDustHTLCExposure), "LDKMaxDustHTLCExposure"); + *ret_copy = MaxDustHTLCExposure_fixed_limit_msat(a); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_MaxDustHTLCExposure_fee_rate_multiplier(int64_t a) { + LDKMaxDustHTLCExposure *ret_copy = MALLOC(sizeof(LDKMaxDustHTLCExposure), "LDKMaxDustHTLCExposure"); + *ret_copy = MaxDustHTLCExposure_fee_rate_multiplier(a); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +jboolean CS_LDK_MaxDustHTLCExposure_eq(int64_t a, int64_t b) { + LDKMaxDustHTLCExposure* a_conv = (LDKMaxDustHTLCExposure*)untag_ptr(a); + LDKMaxDustHTLCExposure* b_conv = (LDKMaxDustHTLCExposure*)untag_ptr(b); + jboolean ret_conv = MaxDustHTLCExposure_eq(a_conv, b_conv); + return ret_conv; +} + +int8_tArray CS_LDK_MaxDustHTLCExposure_write(int64_t obj) { + LDKMaxDustHTLCExposure* obj_conv = (LDKMaxDustHTLCExposure*)untag_ptr(obj); + LDKCVec_u8Z ret_var = MaxDustHTLCExposure_write(obj_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_BestBlock_read(int8_tArray ser) { +int64_t CS_LDK_MaxDustHTLCExposure_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_BestBlockDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BestBlockDecodeErrorZ), "LDKCResult_BestBlockDecodeErrorZ"); - *ret_conv = BestBlock_read(ser_ref); + LDKCResult_MaxDustHTLCExposureDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_MaxDustHTLCExposureDecodeErrorZ), "LDKCResult_MaxDustHTLCExposureDecodeErrorZ"); + *ret_conv = MaxDustHTLCExposure_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_Listen_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); - LDKListen this_ptr_conv = *(LDKListen*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Listen_free(this_ptr_conv); -} - -void CS_LDK_Confirm_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); - LDKConfirm this_ptr_conv = *(LDKConfirm*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Confirm_free(this_ptr_conv); +void CS_LDK_ChannelConfig_free(int64_t this_obj) { + LDKChannelConfig this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelConfig_free(this_obj_conv); } -int32_t CS_LDK_ChannelMonitorUpdateStatus_clone(int64_t orig) { - LDKChannelMonitorUpdateStatus* orig_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(orig); - int32_t ret_conv = LDKChannelMonitorUpdateStatus_to_cs(ChannelMonitorUpdateStatus_clone(orig_conv)); +int32_t CS_LDK_ChannelConfig_get_forwarding_fee_proportional_millionths(int64_t this_ptr) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = ChannelConfig_get_forwarding_fee_proportional_millionths(&this_ptr_conv); return ret_conv; } -int32_t CS_LDK_ChannelMonitorUpdateStatus_completed() { - int32_t ret_conv = LDKChannelMonitorUpdateStatus_to_cs(ChannelMonitorUpdateStatus_completed()); - return ret_conv; +void CS_LDK_ChannelConfig_set_forwarding_fee_proportional_millionths(int64_t this_ptr, int32_t val) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelConfig_set_forwarding_fee_proportional_millionths(&this_ptr_conv, val); } -int32_t CS_LDK_ChannelMonitorUpdateStatus_in_progress() { - int32_t ret_conv = LDKChannelMonitorUpdateStatus_to_cs(ChannelMonitorUpdateStatus_in_progress()); +int32_t CS_LDK_ChannelConfig_get_forwarding_fee_base_msat(int64_t this_ptr) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = ChannelConfig_get_forwarding_fee_base_msat(&this_ptr_conv); return ret_conv; } -int32_t CS_LDK_ChannelMonitorUpdateStatus_unrecoverable_error() { - int32_t ret_conv = LDKChannelMonitorUpdateStatus_to_cs(ChannelMonitorUpdateStatus_unrecoverable_error()); - return ret_conv; +void CS_LDK_ChannelConfig_set_forwarding_fee_base_msat(int64_t this_ptr, int32_t val) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelConfig_set_forwarding_fee_base_msat(&this_ptr_conv, val); } -jboolean CS_LDK_ChannelMonitorUpdateStatus_eq(int64_t a, int64_t b) { - LDKChannelMonitorUpdateStatus* a_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(a); - LDKChannelMonitorUpdateStatus* b_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(b); - jboolean ret_conv = ChannelMonitorUpdateStatus_eq(a_conv, b_conv); +int16_t CS_LDK_ChannelConfig_get_cltv_expiry_delta(int64_t this_ptr) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int16_t ret_conv = ChannelConfig_get_cltv_expiry_delta(&this_ptr_conv); return ret_conv; } -void CS_LDK_Watch_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); - LDKWatch this_ptr_conv = *(LDKWatch*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Watch_free(this_ptr_conv); -} - -void CS_LDK_Filter_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); - LDKFilter this_ptr_conv = *(LDKFilter*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Filter_free(this_ptr_conv); -} - -void CS_LDK_WatchedOutput_free(int64_t this_obj) { - LDKWatchedOutput this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - WatchedOutput_free(this_obj_conv); +void CS_LDK_ChannelConfig_set_cltv_expiry_delta(int64_t this_ptr, int16_t val) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelConfig_set_cltv_expiry_delta(&this_ptr_conv, val); } -int64_t CS_LDK_WatchedOutput_get_block_hash(int64_t this_ptr) { - LDKWatchedOutput this_ptr_conv; +int64_t CS_LDK_ChannelConfig_get_max_dust_htlc_exposure(int64_t this_ptr) { + LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); - *ret_copy = WatchedOutput_get_block_hash(&this_ptr_conv); + LDKMaxDustHTLCExposure *ret_copy = MALLOC(sizeof(LDKMaxDustHTLCExposure), "LDKMaxDustHTLCExposure"); + *ret_copy = ChannelConfig_get_max_dust_htlc_exposure(&this_ptr_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void CS_LDK_WatchedOutput_set_block_hash(int64_t this_ptr, int64_t val) { - LDKWatchedOutput this_ptr_conv; +void CS_LDK_ChannelConfig_set_max_dust_htlc_exposure(int64_t this_ptr, int64_t val) { + LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; void* val_ptr = untag_ptr(val); CHECK_ACCESS(val_ptr); - LDKCOption_ThirtyTwoBytesZ val_conv = *(LDKCOption_ThirtyTwoBytesZ*)(val_ptr); - val_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(val)); - WatchedOutput_set_block_hash(&this_ptr_conv, val_conv); + LDKMaxDustHTLCExposure val_conv = *(LDKMaxDustHTLCExposure*)(val_ptr); + val_conv = MaxDustHTLCExposure_clone((LDKMaxDustHTLCExposure*)untag_ptr(val)); + ChannelConfig_set_max_dust_htlc_exposure(&this_ptr_conv, val_conv); } -int64_t CS_LDK_WatchedOutput_get_outpoint(int64_t this_ptr) { - LDKWatchedOutput this_ptr_conv; +int64_t CS_LDK_ChannelConfig_get_force_close_avoidance_max_fee_satoshis(int64_t this_ptr) { + LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKOutPoint ret_var = WatchedOutput_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 ret_conv = ChannelConfig_get_force_close_avoidance_max_fee_satoshis(&this_ptr_conv); + return ret_conv; } -void CS_LDK_WatchedOutput_set_outpoint(int64_t this_ptr, int64_t val) { - LDKWatchedOutput this_ptr_conv; +void CS_LDK_ChannelConfig_set_force_close_avoidance_max_fee_satoshis(int64_t this_ptr, int64_t val) { + LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - 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); - WatchedOutput_set_outpoint(&this_ptr_conv, val_conv); + ChannelConfig_set_force_close_avoidance_max_fee_satoshis(&this_ptr_conv, val); } -int8_tArray CS_LDK_WatchedOutput_get_script_pubkey(int64_t this_ptr) { - LDKWatchedOutput this_ptr_conv; +jboolean CS_LDK_ChannelConfig_get_accept_underpaying_htlcs(int64_t this_ptr) { + LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u8Z ret_var = WatchedOutput_get_script_pubkey(&this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; + jboolean ret_conv = ChannelConfig_get_accept_underpaying_htlcs(&this_ptr_conv); + return ret_conv; } -void CS_LDK_WatchedOutput_set_script_pubkey(int64_t this_ptr, int8_tArray val) { - LDKWatchedOutput this_ptr_conv; +void CS_LDK_ChannelConfig_set_accept_underpaying_htlcs(int64_t this_ptr, jboolean val) { + LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u8Z val_ref; - val_ref.datalen = val->arr_len; - val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val); - WatchedOutput_set_script_pubkey(&this_ptr_conv, val_ref); + ChannelConfig_set_accept_underpaying_htlcs(&this_ptr_conv, val); } -int64_t CS_LDK_WatchedOutput_new(int64_t block_hash_arg, int64_t outpoint_arg, int8_tArray script_pubkey_arg) { - void* block_hash_arg_ptr = untag_ptr(block_hash_arg); - CHECK_ACCESS(block_hash_arg_ptr); - LDKCOption_ThirtyTwoBytesZ block_hash_arg_conv = *(LDKCOption_ThirtyTwoBytesZ*)(block_hash_arg_ptr); - block_hash_arg_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(block_hash_arg)); - LDKOutPoint outpoint_arg_conv; - outpoint_arg_conv.inner = untag_ptr(outpoint_arg); - outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); - outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); - LDKCVec_u8Z script_pubkey_arg_ref; - script_pubkey_arg_ref.datalen = script_pubkey_arg->arr_len; - script_pubkey_arg_ref.data = MALLOC(script_pubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(script_pubkey_arg_ref.data, script_pubkey_arg->elems, script_pubkey_arg_ref.datalen); FREE(script_pubkey_arg); - LDKWatchedOutput ret_var = WatchedOutput_new(block_hash_arg_conv, outpoint_arg_conv, script_pubkey_arg_ref); +int64_t CS_LDK_ChannelConfig_new(int32_t forwarding_fee_proportional_millionths_arg, int32_t forwarding_fee_base_msat_arg, int16_t cltv_expiry_delta_arg, int64_t max_dust_htlc_exposure_arg, int64_t force_close_avoidance_max_fee_satoshis_arg, jboolean accept_underpaying_htlcs_arg) { + void* max_dust_htlc_exposure_arg_ptr = untag_ptr(max_dust_htlc_exposure_arg); + CHECK_ACCESS(max_dust_htlc_exposure_arg_ptr); + LDKMaxDustHTLCExposure max_dust_htlc_exposure_arg_conv = *(LDKMaxDustHTLCExposure*)(max_dust_htlc_exposure_arg_ptr); + max_dust_htlc_exposure_arg_conv = MaxDustHTLCExposure_clone((LDKMaxDustHTLCExposure*)untag_ptr(max_dust_htlc_exposure_arg)); + LDKChannelConfig ret_var = ChannelConfig_new(forwarding_fee_proportional_millionths_arg, forwarding_fee_base_msat_arg, cltv_expiry_delta_arg, max_dust_htlc_exposure_arg_conv, force_close_avoidance_max_fee_satoshis_arg, accept_underpaying_htlcs_arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t WatchedOutput_clone_ptr(LDKWatchedOutput *NONNULL_PTR arg) { - LDKWatchedOutput ret_var = WatchedOutput_clone(arg); +static inline uint64_t ChannelConfig_clone_ptr(LDKChannelConfig *NONNULL_PTR arg) { + LDKChannelConfig ret_var = ChannelConfig_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_WatchedOutput_clone_ptr(int64_t arg) { - LDKWatchedOutput arg_conv; +int64_t CS_LDK_ChannelConfig_clone_ptr(int64_t arg) { + LDKChannelConfig arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = WatchedOutput_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelConfig_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_WatchedOutput_clone(int64_t orig) { - LDKWatchedOutput orig_conv; +int64_t CS_LDK_ChannelConfig_clone(int64_t orig) { + LDKChannelConfig orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKWatchedOutput ret_var = WatchedOutput_clone(&orig_conv); + LDKChannelConfig ret_var = ChannelConfig_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_WatchedOutput_eq(int64_t a, int64_t b) { - LDKWatchedOutput a_conv; +jboolean CS_LDK_ChannelConfig_eq(int64_t a, int64_t b) { + LDKChannelConfig a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKWatchedOutput b_conv; + LDKChannelConfig b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = WatchedOutput_eq(&a_conv, &b_conv); - return ret_conv; -} - -int64_t CS_LDK_WatchedOutput_hash(int64_t o) { - LDKWatchedOutput o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = WatchedOutput_hash(&o_conv); + jboolean ret_conv = ChannelConfig_eq(&a_conv, &b_conv); return ret_conv; } -void CS_LDK_BroadcasterInterface_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); - LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - BroadcasterInterface_free(this_ptr_conv); +void CS_LDK_ChannelConfig_apply(int64_t this_arg, int64_t update) { + LDKChannelConfig this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelConfigUpdate update_conv; + update_conv.inner = untag_ptr(update); + update_conv.is_owned = ptr_is_owned(update); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv); + update_conv.is_owned = false; + ChannelConfig_apply(&this_arg_conv, &update_conv); } -int32_t CS_LDK_ConfirmationTarget_clone(int64_t orig) { - LDKConfirmationTarget* orig_conv = (LDKConfirmationTarget*)untag_ptr(orig); - int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_clone(orig_conv)); - return ret_conv; +int64_t CS_LDK_ChannelConfig_default() { + LDKChannelConfig ret_var = ChannelConfig_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; } -int32_t CS_LDK_ConfirmationTarget_on_chain_sweep() { - int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_on_chain_sweep()); - return ret_conv; +int8_tArray CS_LDK_ChannelConfig_write(int64_t obj) { + LDKChannelConfig obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ChannelConfig_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -int32_t CS_LDK_ConfirmationTarget_min_allowed_anchor_channel_remote_fee() { - int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_min_allowed_anchor_channel_remote_fee()); - return ret_conv; +int64_t CS_LDK_ChannelConfig_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); + *ret_conv = ChannelConfig_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -int32_t CS_LDK_ConfirmationTarget_min_allowed_non_anchor_channel_remote_fee() { - int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_min_allowed_non_anchor_channel_remote_fee()); - return ret_conv; +void CS_LDK_ChannelConfigUpdate_free(int64_t this_obj) { + LDKChannelConfigUpdate this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelConfigUpdate_free(this_obj_conv); } -int32_t CS_LDK_ConfirmationTarget_anchor_channel_fee() { - int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_anchor_channel_fee()); - return ret_conv; +int64_t CS_LDK_ChannelConfigUpdate_get_forwarding_fee_proportional_millionths(int64_t this_ptr) { + LDKChannelConfigUpdate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = ChannelConfigUpdate_get_forwarding_fee_proportional_millionths(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int32_t CS_LDK_ConfirmationTarget_non_anchor_channel_fee() { - int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_non_anchor_channel_fee()); - return ret_conv; +void CS_LDK_ChannelConfigUpdate_set_forwarding_fee_proportional_millionths(int64_t this_ptr, int64_t val) { + LDKChannelConfigUpdate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); + val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val)); + ChannelConfigUpdate_set_forwarding_fee_proportional_millionths(&this_ptr_conv, val_conv); } -int32_t CS_LDK_ConfirmationTarget_channel_close_minimum() { - int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_channel_close_minimum()); - return ret_conv; +int64_t CS_LDK_ChannelConfigUpdate_get_forwarding_fee_base_msat(int64_t this_ptr) { + LDKChannelConfigUpdate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = ChannelConfigUpdate_get_forwarding_fee_base_msat(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int32_t CS_LDK_ConfirmationTarget_output_spending_fee() { - int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_output_spending_fee()); - return ret_conv; +void CS_LDK_ChannelConfigUpdate_set_forwarding_fee_base_msat(int64_t this_ptr, int64_t val) { + LDKChannelConfigUpdate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); + val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val)); + ChannelConfigUpdate_set_forwarding_fee_base_msat(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ConfirmationTarget_hash(int64_t o) { - LDKConfirmationTarget* o_conv = (LDKConfirmationTarget*)untag_ptr(o); - int64_t ret_conv = ConfirmationTarget_hash(o_conv); - return ret_conv; +int64_t CS_LDK_ChannelConfigUpdate_get_cltv_expiry_delta(int64_t this_ptr) { + LDKChannelConfigUpdate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); + *ret_copy = ChannelConfigUpdate_get_cltv_expiry_delta(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_ConfirmationTarget_eq(int64_t a, int64_t b) { - LDKConfirmationTarget* a_conv = (LDKConfirmationTarget*)untag_ptr(a); - LDKConfirmationTarget* b_conv = (LDKConfirmationTarget*)untag_ptr(b); - jboolean ret_conv = ConfirmationTarget_eq(a_conv, b_conv); - return ret_conv; +void CS_LDK_ChannelConfigUpdate_set_cltv_expiry_delta(int64_t this_ptr, int64_t val) { + LDKChannelConfigUpdate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr); + val_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(val)); + ChannelConfigUpdate_set_cltv_expiry_delta(&this_ptr_conv, val_conv); } -void CS_LDK_FeeEstimator_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); - LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - FeeEstimator_free(this_ptr_conv); +int64_t CS_LDK_ChannelConfigUpdate_get_max_dust_htlc_exposure_msat(int64_t this_ptr) { + LDKChannelConfigUpdate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_MaxDustHTLCExposureZ *ret_copy = MALLOC(sizeof(LDKCOption_MaxDustHTLCExposureZ), "LDKCOption_MaxDustHTLCExposureZ"); + *ret_copy = ChannelConfigUpdate_get_max_dust_htlc_exposure_msat(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -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); +void CS_LDK_ChannelConfigUpdate_set_max_dust_htlc_exposure_msat(int64_t this_ptr, int64_t val) { + LDKChannelConfigUpdate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_MaxDustHTLCExposureZ val_conv = *(LDKCOption_MaxDustHTLCExposureZ*)(val_ptr); + val_conv = COption_MaxDustHTLCExposureZ_clone((LDKCOption_MaxDustHTLCExposureZ*)untag_ptr(val)); + ChannelConfigUpdate_set_max_dust_htlc_exposure_msat(&this_ptr_conv, val_conv); } -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); +int64_t CS_LDK_ChannelConfigUpdate_get_force_close_avoidance_max_fee_satoshis(int64_t this_ptr) { + LDKChannelConfigUpdate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelConfigUpdate_get_force_close_avoidance_max_fee_satoshis(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); 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; + +void CS_LDK_ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis(int64_t this_ptr, int64_t val) { + LDKChannelConfigUpdate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis(&this_ptr_conv, val_conv); } -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 CS_LDK_ChannelConfigUpdate_new(int64_t forwarding_fee_proportional_millionths_arg, int64_t forwarding_fee_base_msat_arg, int64_t cltv_expiry_delta_arg, int64_t max_dust_htlc_exposure_msat_arg, int64_t force_close_avoidance_max_fee_satoshis_arg) { + void* forwarding_fee_proportional_millionths_arg_ptr = untag_ptr(forwarding_fee_proportional_millionths_arg); + CHECK_ACCESS(forwarding_fee_proportional_millionths_arg_ptr); + LDKCOption_u32Z forwarding_fee_proportional_millionths_arg_conv = *(LDKCOption_u32Z*)(forwarding_fee_proportional_millionths_arg_ptr); + forwarding_fee_proportional_millionths_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(forwarding_fee_proportional_millionths_arg)); + void* forwarding_fee_base_msat_arg_ptr = untag_ptr(forwarding_fee_base_msat_arg); + CHECK_ACCESS(forwarding_fee_base_msat_arg_ptr); + LDKCOption_u32Z forwarding_fee_base_msat_arg_conv = *(LDKCOption_u32Z*)(forwarding_fee_base_msat_arg_ptr); + forwarding_fee_base_msat_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(forwarding_fee_base_msat_arg)); + void* cltv_expiry_delta_arg_ptr = untag_ptr(cltv_expiry_delta_arg); + CHECK_ACCESS(cltv_expiry_delta_arg_ptr); + LDKCOption_u16Z cltv_expiry_delta_arg_conv = *(LDKCOption_u16Z*)(cltv_expiry_delta_arg_ptr); + cltv_expiry_delta_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(cltv_expiry_delta_arg)); + void* max_dust_htlc_exposure_msat_arg_ptr = untag_ptr(max_dust_htlc_exposure_msat_arg); + CHECK_ACCESS(max_dust_htlc_exposure_msat_arg_ptr); + LDKCOption_MaxDustHTLCExposureZ max_dust_htlc_exposure_msat_arg_conv = *(LDKCOption_MaxDustHTLCExposureZ*)(max_dust_htlc_exposure_msat_arg_ptr); + max_dust_htlc_exposure_msat_arg_conv = COption_MaxDustHTLCExposureZ_clone((LDKCOption_MaxDustHTLCExposureZ*)untag_ptr(max_dust_htlc_exposure_msat_arg)); + void* force_close_avoidance_max_fee_satoshis_arg_ptr = untag_ptr(force_close_avoidance_max_fee_satoshis_arg); + CHECK_ACCESS(force_close_avoidance_max_fee_satoshis_arg_ptr); + LDKCOption_u64Z force_close_avoidance_max_fee_satoshis_arg_conv = *(LDKCOption_u64Z*)(force_close_avoidance_max_fee_satoshis_arg_ptr); + force_close_avoidance_max_fee_satoshis_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(force_close_avoidance_max_fee_satoshis_arg)); + LDKChannelConfigUpdate ret_var = ChannelConfigUpdate_new(forwarding_fee_proportional_millionths_arg_conv, forwarding_fee_base_msat_arg_conv, cltv_expiry_delta_arg_conv, max_dust_htlc_exposure_msat_arg_conv, force_close_avoidance_max_fee_satoshis_arg_conv); int64_t ret_ref = 0; CHECK_INNER_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); - CHECK_ACCESS(this_ptr_ptr); - LDKPersist this_ptr_conv = *(LDKPersist*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Persist_free(this_ptr_conv); -} - -void CS_LDK_LockedChannelMonitor_free(int64_t this_obj) { - LDKLockedChannelMonitor this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - LockedChannelMonitor_free(this_obj_conv); +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_ChainMonitor_free(int64_t this_obj) { - LDKChainMonitor this_obj_conv; +void CS_LDK_UserConfig_free(int64_t this_obj) { + LDKUserConfig this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChainMonitor_free(this_obj_conv); + UserConfig_free(this_obj_conv); } -int64_t CS_LDK_ChainMonitor_new(int64_t chain_source, int64_t broadcaster, int64_t logger, int64_t feeest, int64_t persister) { - void* chain_source_ptr = untag_ptr(chain_source); - CHECK_ACCESS(chain_source_ptr); - LDKCOption_FilterZ chain_source_conv = *(LDKCOption_FilterZ*)(chain_source_ptr); - // WARNING: we may need a move here but no clone is available for LDKCOption_FilterZ - if (chain_source_conv.tag == LDKCOption_FilterZ_Some) { - // Manually implement clone for Java trait instances - if (chain_source_conv.some.free == LDKFilter_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFilter_JCalls_cloned(&chain_source_conv.some); - } - } - void* broadcaster_ptr = untag_ptr(broadcaster); - CHECK_ACCESS(broadcaster_ptr); - LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - void* feeest_ptr = untag_ptr(feeest); - CHECK_ACCESS(feeest_ptr); - LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)(feeest_ptr); - if (feeest_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&feeest_conv); - } - void* persister_ptr = untag_ptr(persister); - CHECK_ACCESS(persister_ptr); - LDKPersist persister_conv = *(LDKPersist*)(persister_ptr); - if (persister_conv.free == LDKPersist_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKPersist_JCalls_cloned(&persister_conv); - } - LDKChainMonitor ret_var = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv, persister_conv); +int64_t CS_LDK_UserConfig_get_channel_handshake_config(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; + LDKChannelHandshakeConfig ret_var = UserConfig_get_channel_handshake_config(&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_ChainMonitor_get_claimable_balances(int64_t this_arg, int64_tArray ignored_channels) { - LDKChainMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_ChannelDetailsZ ignored_channels_constr; - ignored_channels_constr.datalen = ignored_channels->arr_len; - if (ignored_channels_constr.datalen > 0) - ignored_channels_constr.data = MALLOC(ignored_channels_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); - else - ignored_channels_constr.data = NULL; - int64_t* ignored_channels_vals = ignored_channels->elems; - for (size_t q = 0; q < ignored_channels_constr.datalen; q++) { - int64_t ignored_channels_conv_16 = ignored_channels_vals[q]; - LDKChannelDetails ignored_channels_conv_16_conv; - ignored_channels_conv_16_conv.inner = untag_ptr(ignored_channels_conv_16); - ignored_channels_conv_16_conv.is_owned = ptr_is_owned(ignored_channels_conv_16); - CHECK_INNER_FIELD_ACCESS_OR_NULL(ignored_channels_conv_16_conv); - ignored_channels_conv_16_conv = ChannelDetails_clone(&ignored_channels_conv_16_conv); - ignored_channels_constr.data[q] = ignored_channels_conv_16_conv; - } - FREE(ignored_channels); - LDKCVec_BalanceZ ret_var = ChainMonitor_get_claimable_balances(&this_arg_conv, ignored_channels_constr); - 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 j = 0; j < ret_var.datalen; j++) { - LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_conv_9_copy = ret_var.data[j]; - int64_t ret_conv_9_ref = tag_ptr(ret_conv_9_copy, true); - ret_arr_ptr[j] = ret_conv_9_ref; - } - - FREE(ret_var.data); - return ret_arr; -} - -int64_t CS_LDK_ChainMonitor_get_monitor(int64_t this_arg, int64_t funding_txo) { - LDKChainMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOutPoint funding_txo_conv; - funding_txo_conv.inner = untag_ptr(funding_txo); - funding_txo_conv.is_owned = ptr_is_owned(funding_txo); - CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); - funding_txo_conv = OutPoint_clone(&funding_txo_conv); - LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); - *ret_conv = ChainMonitor_get_monitor(&this_arg_conv, funding_txo_conv); - return tag_ptr(ret_conv, true); -} - -int64_tArray CS_LDK_ChainMonitor_list_monitors(int64_t this_arg) { - LDKChainMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_C2Tuple_OutPointChannelIdZZ ret_var = ChainMonitor_list_monitors(&this_arg_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t d = 0; d < ret_var.datalen; d++) { - LDKC2Tuple_OutPointChannelIdZ* ret_conv_29_conv = MALLOC(sizeof(LDKC2Tuple_OutPointChannelIdZ), "LDKC2Tuple_OutPointChannelIdZ"); - *ret_conv_29_conv = ret_var.data[d]; - ret_arr_ptr[d] = tag_ptr(ret_conv_29_conv, true); - } - - FREE(ret_var.data); - return ret_arr; +void CS_LDK_UserConfig_set_channel_handshake_config(int64_t this_ptr, int64_t val) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelHandshakeConfig val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelHandshakeConfig_clone(&val_conv); + UserConfig_set_channel_handshake_config(&this_ptr_conv, val_conv); } -int64_tArray CS_LDK_ChainMonitor_list_pending_monitor_updates(int64_t this_arg) { - LDKChainMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ 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); - } - - FREE(ret_var.data); - return ret_arr; +int64_t CS_LDK_UserConfig_get_channel_handshake_limits(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; + LDKChannelHandshakeLimits ret_var = UserConfig_get_channel_handshake_limits(&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_ChainMonitor_channel_monitor_updated(int64_t this_arg, int64_t funding_txo, int64_t completed_update_id) { - LDKChainMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOutPoint funding_txo_conv; - funding_txo_conv.inner = untag_ptr(funding_txo); - funding_txo_conv.is_owned = ptr_is_owned(funding_txo); - CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); - funding_txo_conv = OutPoint_clone(&funding_txo_conv); - LDKMonitorUpdateId completed_update_id_conv; - completed_update_id_conv.inner = untag_ptr(completed_update_id); - completed_update_id_conv.is_owned = ptr_is_owned(completed_update_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(completed_update_id_conv); - completed_update_id_conv = MonitorUpdateId_clone(&completed_update_id_conv); - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id_conv); - return tag_ptr(ret_conv, true); +void CS_LDK_UserConfig_set_channel_handshake_limits(int64_t this_ptr, int64_t val) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelHandshakeLimits val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelHandshakeLimits_clone(&val_conv); + UserConfig_set_channel_handshake_limits(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChainMonitor_get_update_future(int64_t this_arg) { - LDKChainMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKFuture ret_var = ChainMonitor_get_update_future(&this_arg_conv); +int64_t CS_LDK_UserConfig_get_channel_config(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; + LDKChannelConfig ret_var = UserConfig_get_channel_config(&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_ChainMonitor_rebroadcast_pending_claims(int64_t this_arg) { - LDKChainMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - ChainMonitor_rebroadcast_pending_claims(&this_arg_conv); +void CS_LDK_UserConfig_set_channel_config(int64_t this_ptr, int64_t val) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelConfig val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelConfig_clone(&val_conv); + UserConfig_set_channel_config(&this_ptr_conv, val_conv); } -void CS_LDK_ChainMonitor_signer_unblocked(int64_t this_arg, int64_t monitor_opt) { - LDKChainMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOutPoint monitor_opt_conv; - monitor_opt_conv.inner = untag_ptr(monitor_opt); - monitor_opt_conv.is_owned = ptr_is_owned(monitor_opt); - CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_opt_conv); - monitor_opt_conv = OutPoint_clone(&monitor_opt_conv); - ChainMonitor_signer_unblocked(&this_arg_conv, monitor_opt_conv); -} - -void CS_LDK_ChainMonitor_archive_fully_resolved_channel_monitors(int64_t this_arg) { - LDKChainMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - ChainMonitor_archive_fully_resolved_channel_monitors(&this_arg_conv); +jboolean CS_LDK_UserConfig_get_accept_forwards_to_priv_channels(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_accept_forwards_to_priv_channels(&this_ptr_conv); + return ret_conv; } -int64_t CS_LDK_ChainMonitor_as_Listen(int64_t this_arg) { - LDKChainMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); - *ret_ret = ChainMonitor_as_Listen(&this_arg_conv); - return tag_ptr(ret_ret, true); +void CS_LDK_UserConfig_set_accept_forwards_to_priv_channels(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_accept_forwards_to_priv_channels(&this_ptr_conv, val); } -int64_t CS_LDK_ChainMonitor_as_Confirm(int64_t this_arg) { - LDKChainMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); - *ret_ret = ChainMonitor_as_Confirm(&this_arg_conv); - return tag_ptr(ret_ret, true); +jboolean CS_LDK_UserConfig_get_accept_inbound_channels(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_accept_inbound_channels(&this_ptr_conv); + return ret_conv; } -int64_t CS_LDK_ChainMonitor_as_Watch(int64_t this_arg) { - LDKChainMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKWatch* ret_ret = MALLOC(sizeof(LDKWatch), "LDKWatch"); - *ret_ret = ChainMonitor_as_Watch(&this_arg_conv); - return tag_ptr(ret_ret, true); +void CS_LDK_UserConfig_set_accept_inbound_channels(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_accept_inbound_channels(&this_ptr_conv, val); } -int64_t CS_LDK_ChainMonitor_as_EventsProvider(int64_t this_arg) { - LDKChainMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); - *ret_ret = ChainMonitor_as_EventsProvider(&this_arg_conv); - return tag_ptr(ret_ret, true); +jboolean CS_LDK_UserConfig_get_manually_accept_inbound_channels(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_accept_inbound_channels(&this_ptr_conv); + return ret_conv; } -void CS_LDK_ChannelMonitorUpdate_free(int64_t this_obj) { - LDKChannelMonitorUpdate this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelMonitorUpdate_free(this_obj_conv); +void CS_LDK_UserConfig_set_manually_accept_inbound_channels(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_accept_inbound_channels(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelMonitorUpdate_get_update_id(int64_t this_ptr) { - LDKChannelMonitorUpdate this_ptr_conv; +jboolean CS_LDK_UserConfig_get_accept_intercept_htlcs(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; - int64_t ret_conv = ChannelMonitorUpdate_get_update_id(&this_ptr_conv); + jboolean ret_conv = UserConfig_get_accept_intercept_htlcs(&this_ptr_conv); return ret_conv; } -void CS_LDK_ChannelMonitorUpdate_set_update_id(int64_t this_ptr, int64_t val) { - LDKChannelMonitorUpdate this_ptr_conv; +void CS_LDK_UserConfig_set_accept_intercept_htlcs(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; - ChannelMonitorUpdate_set_update_id(&this_ptr_conv, val); + UserConfig_set_accept_intercept_htlcs(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelMonitorUpdate_get_channel_id(int64_t this_ptr) { - LDKChannelMonitorUpdate this_ptr_conv; +jboolean CS_LDK_UserConfig_get_accept_mpp_keysend(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; - LDKChannelId ret_var = ChannelMonitorUpdate_get_channel_id(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + jboolean ret_conv = UserConfig_get_accept_mpp_keysend(&this_ptr_conv); + return ret_conv; } -void CS_LDK_ChannelMonitorUpdate_set_channel_id(int64_t this_ptr, int64_t val) { - LDKChannelMonitorUpdate this_ptr_conv; +void CS_LDK_UserConfig_set_accept_mpp_keysend(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; - LDKChannelId val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelId_clone(&val_conv); - ChannelMonitorUpdate_set_channel_id(&this_ptr_conv, val_conv); + UserConfig_set_accept_mpp_keysend(&this_ptr_conv, val); } -static inline uint64_t ChannelMonitorUpdate_clone_ptr(LDKChannelMonitorUpdate *NONNULL_PTR arg) { - LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(arg); +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) { + LDKChannelHandshakeConfig channel_handshake_config_arg_conv; + channel_handshake_config_arg_conv.inner = untag_ptr(channel_handshake_config_arg); + channel_handshake_config_arg_conv.is_owned = ptr_is_owned(channel_handshake_config_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_handshake_config_arg_conv); + channel_handshake_config_arg_conv = ChannelHandshakeConfig_clone(&channel_handshake_config_arg_conv); + LDKChannelHandshakeLimits channel_handshake_limits_arg_conv; + channel_handshake_limits_arg_conv.inner = untag_ptr(channel_handshake_limits_arg); + channel_handshake_limits_arg_conv.is_owned = ptr_is_owned(channel_handshake_limits_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_handshake_limits_arg_conv); + channel_handshake_limits_arg_conv = ChannelHandshakeLimits_clone(&channel_handshake_limits_arg_conv); + LDKChannelConfig channel_config_arg_conv; + channel_config_arg_conv.inner = untag_ptr(channel_config_arg); + channel_config_arg_conv.is_owned = ptr_is_owned(channel_config_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_config_arg_conv); + channel_config_arg_conv = ChannelConfig_clone(&channel_config_arg_conv); + LDKUserConfig ret_var = UserConfig_new(channel_handshake_config_arg_conv, channel_handshake_limits_arg_conv, channel_config_arg_conv, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg, manually_accept_inbound_channels_arg, accept_intercept_htlcs_arg, accept_mpp_keysend_arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_ChannelMonitorUpdate_clone_ptr(int64_t arg) { - LDKChannelMonitorUpdate arg_conv; + +static inline uint64_t UserConfig_clone_ptr(LDKUserConfig *NONNULL_PTR arg) { + LDKUserConfig ret_var = UserConfig_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_UserConfig_clone_ptr(int64_t arg) { + LDKUserConfig arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = ChannelMonitorUpdate_clone_ptr(&arg_conv); + int64_t ret_conv = UserConfig_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_ChannelMonitorUpdate_clone(int64_t orig) { - LDKChannelMonitorUpdate orig_conv; +int64_t CS_LDK_UserConfig_clone(int64_t orig) { + LDKUserConfig orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(&orig_conv); + LDKUserConfig ret_var = UserConfig_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_ChannelMonitorUpdate_eq(int64_t a, int64_t b) { - LDKChannelMonitorUpdate a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKChannelMonitorUpdate b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = ChannelMonitorUpdate_eq(&a_conv, &b_conv); - return ret_conv; -} - -int8_tArray CS_LDK_ChannelMonitorUpdate_write(int64_t obj) { - LDKChannelMonitorUpdate obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ChannelMonitorUpdate_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -int64_t CS_LDK_ChannelMonitorUpdate_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); - *ret_conv = ChannelMonitorUpdate_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -void CS_LDK_MonitorEvent_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); - LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - MonitorEvent_free(this_ptr_conv); -} - -static inline uint64_t MonitorEvent_clone_ptr(LDKMonitorEvent *NONNULL_PTR arg) { - LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_copy = MonitorEvent_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -int64_t CS_LDK_MonitorEvent_clone_ptr(int64_t arg) { - LDKMonitorEvent* arg_conv = (LDKMonitorEvent*)untag_ptr(arg); - int64_t ret_conv = MonitorEvent_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_MonitorEvent_clone(int64_t orig) { - LDKMonitorEvent* orig_conv = (LDKMonitorEvent*)untag_ptr(orig); - LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_copy = MonitorEvent_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_MonitorEvent_htlcevent(int64_t a) { - LDKHTLCUpdate a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = HTLCUpdate_clone(&a_conv); - LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_copy = MonitorEvent_htlcevent(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +int64_t CS_LDK_UserConfig_default() { + LDKUserConfig ret_var = UserConfig_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_MonitorEvent_holder_force_closed_with_info(int64_t reason, int64_t outpoint, int64_t channel_id) { - void* reason_ptr = untag_ptr(reason); - CHECK_ACCESS(reason_ptr); - LDKClosureReason reason_conv = *(LDKClosureReason*)(reason_ptr); - reason_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(reason)); - LDKOutPoint outpoint_conv; - outpoint_conv.inner = untag_ptr(outpoint); - outpoint_conv.is_owned = ptr_is_owned(outpoint); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv); - outpoint_conv = OutPoint_clone(&outpoint_conv); - LDKChannelId channel_id_conv; - channel_id_conv.inner = untag_ptr(channel_id); - channel_id_conv.is_owned = ptr_is_owned(channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); - channel_id_conv = ChannelId_clone(&channel_id_conv); - LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_copy = MonitorEvent_holder_force_closed_with_info(reason_conv, outpoint_conv, channel_id_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_BestBlock_free(int64_t this_obj) { + LDKBestBlock this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + BestBlock_free(this_obj_conv); } -int64_t CS_LDK_MonitorEvent_holder_force_closed(int64_t a) { - LDKOutPoint a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = OutPoint_clone(&a_conv); - LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_copy = MonitorEvent_holder_force_closed(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int8_tArray CS_LDK_BestBlock_get_block_hash(int64_t this_ptr) { + LDKBestBlock this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *BestBlock_get_block_hash(&this_ptr_conv), 32); + return ret_arr; } -int64_t CS_LDK_MonitorEvent_completed(int64_t funding_txo, int64_t channel_id, int64_t monitor_update_id) { - LDKOutPoint funding_txo_conv; - funding_txo_conv.inner = untag_ptr(funding_txo); - funding_txo_conv.is_owned = ptr_is_owned(funding_txo); - CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); - funding_txo_conv = OutPoint_clone(&funding_txo_conv); - LDKChannelId channel_id_conv; - channel_id_conv.inner = untag_ptr(channel_id); - channel_id_conv.is_owned = ptr_is_owned(channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); - channel_id_conv = ChannelId_clone(&channel_id_conv); - LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_copy = MonitorEvent_completed(funding_txo_conv, channel_id_conv, monitor_update_id); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_BestBlock_set_block_hash(int64_t this_ptr, int8_tArray val) { + LDKBestBlock this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + BestBlock_set_block_hash(&this_ptr_conv, val_ref); } -jboolean CS_LDK_MonitorEvent_eq(int64_t a, int64_t b) { - LDKMonitorEvent* a_conv = (LDKMonitorEvent*)untag_ptr(a); - LDKMonitorEvent* b_conv = (LDKMonitorEvent*)untag_ptr(b); - jboolean ret_conv = MonitorEvent_eq(a_conv, b_conv); +int32_t CS_LDK_BestBlock_get_height(int64_t this_ptr) { + LDKBestBlock this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = BestBlock_get_height(&this_ptr_conv); return ret_conv; } -int8_tArray CS_LDK_MonitorEvent_write(int64_t obj) { - LDKMonitorEvent* obj_conv = (LDKMonitorEvent*)untag_ptr(obj); - LDKCVec_u8Z ret_var = MonitorEvent_write(obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -int64_t CS_LDK_MonitorEvent_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); - *ret_conv = MonitorEvent_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void CS_LDK_BestBlock_set_height(int64_t this_ptr, int32_t val) { + LDKBestBlock this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + BestBlock_set_height(&this_ptr_conv, val); } -void CS_LDK_HTLCUpdate_free(int64_t this_obj) { - LDKHTLCUpdate this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - HTLCUpdate_free(this_obj_conv); +int64_t CS_LDK_BestBlock_new(int8_tArray block_hash_arg, int32_t height_arg) { + LDKThirtyTwoBytes block_hash_arg_ref; + CHECK(block_hash_arg->arr_len == 32); + memcpy(block_hash_arg_ref.data, block_hash_arg->elems, 32); FREE(block_hash_arg); + LDKBestBlock ret_var = BestBlock_new(block_hash_arg_ref, height_arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -static inline uint64_t HTLCUpdate_clone_ptr(LDKHTLCUpdate *NONNULL_PTR arg) { - LDKHTLCUpdate ret_var = HTLCUpdate_clone(arg); +static inline uint64_t BestBlock_clone_ptr(LDKBestBlock *NONNULL_PTR arg) { + LDKBestBlock ret_var = BestBlock_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_HTLCUpdate_clone_ptr(int64_t arg) { - LDKHTLCUpdate arg_conv; +int64_t CS_LDK_BestBlock_clone_ptr(int64_t arg) { + LDKBestBlock arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = HTLCUpdate_clone_ptr(&arg_conv); + int64_t ret_conv = BestBlock_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_HTLCUpdate_clone(int64_t orig) { - LDKHTLCUpdate orig_conv; +int64_t CS_LDK_BestBlock_clone(int64_t orig) { + LDKBestBlock orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKHTLCUpdate ret_var = HTLCUpdate_clone(&orig_conv); + LDKBestBlock ret_var = BestBlock_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_HTLCUpdate_eq(int64_t a, int64_t b) { - LDKHTLCUpdate a_conv; +int64_t CS_LDK_BestBlock_hash(int64_t o) { + LDKBestBlock o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = BestBlock_hash(&o_conv); + return ret_conv; +} + +jboolean CS_LDK_BestBlock_eq(int64_t a, int64_t b) { + LDKBestBlock a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKHTLCUpdate b_conv; + LDKBestBlock b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = HTLCUpdate_eq(&a_conv, &b_conv); + jboolean ret_conv = BestBlock_eq(&a_conv, &b_conv); return ret_conv; } -int8_tArray CS_LDK_HTLCUpdate_write(int64_t obj) { - LDKHTLCUpdate obj_conv; +int64_t CS_LDK_BestBlock_from_network(int32_t network) { + LDKNetwork network_conv = LDKNetwork_from_cs(network); + LDKBestBlock ret_var = BestBlock_from_network(network_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int8_tArray CS_LDK_BestBlock_write(int64_t obj) { + LDKBestBlock obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = HTLCUpdate_write(&obj_conv); + LDKCVec_u8Z ret_var = BestBlock_write(&obj_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_HTLCUpdate_read(int8_tArray ser) { +int64_t CS_LDK_BestBlock_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); - *ret_conv = HTLCUpdate_read(ser_ref); + LDKCResult_BestBlockDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BestBlockDecodeErrorZ), "LDKCResult_BestBlockDecodeErrorZ"); + *ret_conv = BestBlock_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_Balance_free(int64_t this_ptr) { +void CS_LDK_Listen_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); - LDKBalance this_ptr_conv = *(LDKBalance*)(this_ptr_ptr); + LDKListen this_ptr_conv = *(LDKListen*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - Balance_free(this_ptr_conv); + Listen_free(this_ptr_conv); } -static inline uint64_t Balance_clone_ptr(LDKBalance *NONNULL_PTR arg) { - LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_Confirm_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); + LDKConfirm this_ptr_conv = *(LDKConfirm*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Confirm_free(this_ptr_conv); } -int64_t CS_LDK_Balance_clone_ptr(int64_t arg) { - LDKBalance* arg_conv = (LDKBalance*)untag_ptr(arg); - int64_t ret_conv = Balance_clone_ptr(arg_conv); + +int32_t CS_LDK_ChannelMonitorUpdateStatus_clone(int64_t orig) { + LDKChannelMonitorUpdateStatus* orig_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(orig); + int32_t ret_conv = LDKChannelMonitorUpdateStatus_to_cs(ChannelMonitorUpdateStatus_clone(orig_conv)); return ret_conv; } -int64_t CS_LDK_Balance_clone(int64_t orig) { - LDKBalance* orig_conv = (LDKBalance*)untag_ptr(orig); - LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_ChannelMonitorUpdateStatus_completed() { + int32_t ret_conv = LDKChannelMonitorUpdateStatus_to_cs(ChannelMonitorUpdateStatus_completed()); + return ret_conv; } -int64_t CS_LDK_Balance_claimable_on_channel_close(int64_t amount_satoshis) { - LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_claimable_on_channel_close(amount_satoshis); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_ChannelMonitorUpdateStatus_in_progress() { + int32_t ret_conv = LDKChannelMonitorUpdateStatus_to_cs(ChannelMonitorUpdateStatus_in_progress()); + return ret_conv; } -int64_t CS_LDK_Balance_claimable_awaiting_confirmations(int64_t amount_satoshis, int32_t confirmation_height) { - LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_claimable_awaiting_confirmations(amount_satoshis, confirmation_height); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_ChannelMonitorUpdateStatus_unrecoverable_error() { + int32_t ret_conv = LDKChannelMonitorUpdateStatus_to_cs(ChannelMonitorUpdateStatus_unrecoverable_error()); + return ret_conv; } -int64_t CS_LDK_Balance_contentious_claimable(int64_t amount_satoshis, int32_t timeout_height, int8_tArray payment_hash, int8_tArray payment_preimage) { - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - LDKThirtyTwoBytes payment_preimage_ref; - CHECK(payment_preimage->arr_len == 32); - memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); - LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_contentious_claimable(amount_satoshis, timeout_height, payment_hash_ref, payment_preimage_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_ChannelMonitorUpdateStatus_eq(int64_t a, int64_t b) { + LDKChannelMonitorUpdateStatus* a_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(a); + LDKChannelMonitorUpdateStatus* b_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(b); + jboolean ret_conv = ChannelMonitorUpdateStatus_eq(a_conv, b_conv); + return ret_conv; } -int64_t CS_LDK_Balance_maybe_timeout_claimable_htlc(int64_t amount_satoshis, int32_t claimable_height, int8_tArray payment_hash) { - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_maybe_timeout_claimable_htlc(amount_satoshis, claimable_height, payment_hash_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_Watch_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); + LDKWatch this_ptr_conv = *(LDKWatch*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Watch_free(this_ptr_conv); } -int64_t CS_LDK_Balance_maybe_preimage_claimable_htlc(int64_t amount_satoshis, int32_t expiry_height, int8_tArray payment_hash) { - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_maybe_preimage_claimable_htlc(amount_satoshis, expiry_height, payment_hash_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_Filter_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); + LDKFilter this_ptr_conv = *(LDKFilter*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Filter_free(this_ptr_conv); } -int64_t CS_LDK_Balance_counterparty_revoked_output_claimable(int64_t amount_satoshis) { - LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_counterparty_revoked_output_claimable(amount_satoshis); +void CS_LDK_WatchedOutput_free(int64_t this_obj) { + LDKWatchedOutput this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + WatchedOutput_free(this_obj_conv); +} + +int64_t CS_LDK_WatchedOutput_get_block_hash(int64_t this_ptr) { + LDKWatchedOutput this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); + *ret_copy = WatchedOutput_get_block_hash(&this_ptr_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -jboolean CS_LDK_Balance_eq(int64_t a, int64_t b) { - LDKBalance* a_conv = (LDKBalance*)untag_ptr(a); - LDKBalance* b_conv = (LDKBalance*)untag_ptr(b); - jboolean ret_conv = Balance_eq(a_conv, b_conv); +void CS_LDK_WatchedOutput_set_block_hash(int64_t this_ptr, int64_t val) { + LDKWatchedOutput this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_ThirtyTwoBytesZ val_conv = *(LDKCOption_ThirtyTwoBytesZ*)(val_ptr); + val_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(val)); + WatchedOutput_set_block_hash(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_WatchedOutput_get_outpoint(int64_t this_ptr) { + LDKWatchedOutput this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKOutPoint ret_var = WatchedOutput_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_WatchedOutput_set_outpoint(int64_t this_ptr, int64_t val) { + LDKWatchedOutput this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + 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); + WatchedOutput_set_outpoint(&this_ptr_conv, val_conv); +} + +int8_tArray CS_LDK_WatchedOutput_get_script_pubkey(int64_t this_ptr) { + LDKWatchedOutput this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u8Z ret_var = WatchedOutput_get_script_pubkey(&this_ptr_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +void CS_LDK_WatchedOutput_set_script_pubkey(int64_t this_ptr, int8_tArray val) { + LDKWatchedOutput this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u8Z val_ref; + val_ref.datalen = val->arr_len; + val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val); + WatchedOutput_set_script_pubkey(&this_ptr_conv, val_ref); +} + +int64_t CS_LDK_WatchedOutput_new(int64_t block_hash_arg, int64_t outpoint_arg, int8_tArray script_pubkey_arg) { + void* block_hash_arg_ptr = untag_ptr(block_hash_arg); + CHECK_ACCESS(block_hash_arg_ptr); + LDKCOption_ThirtyTwoBytesZ block_hash_arg_conv = *(LDKCOption_ThirtyTwoBytesZ*)(block_hash_arg_ptr); + block_hash_arg_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(block_hash_arg)); + LDKOutPoint outpoint_arg_conv; + outpoint_arg_conv.inner = untag_ptr(outpoint_arg); + outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); + outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); + LDKCVec_u8Z script_pubkey_arg_ref; + script_pubkey_arg_ref.datalen = script_pubkey_arg->arr_len; + script_pubkey_arg_ref.data = MALLOC(script_pubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(script_pubkey_arg_ref.data, script_pubkey_arg->elems, script_pubkey_arg_ref.datalen); FREE(script_pubkey_arg); + LDKWatchedOutput ret_var = WatchedOutput_new(block_hash_arg_conv, outpoint_arg_conv, script_pubkey_arg_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t WatchedOutput_clone_ptr(LDKWatchedOutput *NONNULL_PTR arg) { + LDKWatchedOutput ret_var = WatchedOutput_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_WatchedOutput_clone_ptr(int64_t arg) { + LDKWatchedOutput arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = WatchedOutput_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_Balance_claimable_amount_satoshis(int64_t this_arg) { - LDKBalance* this_arg_conv = (LDKBalance*)untag_ptr(this_arg); - int64_t ret_conv = Balance_claimable_amount_satoshis(this_arg_conv); +int64_t CS_LDK_WatchedOutput_clone(int64_t orig) { + LDKWatchedOutput orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKWatchedOutput ret_var = WatchedOutput_clone(&orig_conv); + int64_t ret_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_WatchedOutput_eq(int64_t a, int64_t b) { + LDKWatchedOutput a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKWatchedOutput b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = WatchedOutput_eq(&a_conv, &b_conv); return ret_conv; } -void CS_LDK_ChannelMonitor_free(int64_t this_obj) { - LDKChannelMonitor this_obj_conv; +int64_t CS_LDK_WatchedOutput_hash(int64_t o) { + LDKWatchedOutput o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = WatchedOutput_hash(&o_conv); + return ret_conv; +} + +void CS_LDK_BroadcasterInterface_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); + LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + BroadcasterInterface_free(this_ptr_conv); +} + +int32_t CS_LDK_ConfirmationTarget_clone(int64_t orig) { + LDKConfirmationTarget* orig_conv = (LDKConfirmationTarget*)untag_ptr(orig); + int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_clone(orig_conv)); + return ret_conv; +} + +int32_t CS_LDK_ConfirmationTarget_on_chain_sweep() { + int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_on_chain_sweep()); + return ret_conv; +} + +int32_t CS_LDK_ConfirmationTarget_min_allowed_anchor_channel_remote_fee() { + int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_min_allowed_anchor_channel_remote_fee()); + return ret_conv; +} + +int32_t CS_LDK_ConfirmationTarget_min_allowed_non_anchor_channel_remote_fee() { + int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_min_allowed_non_anchor_channel_remote_fee()); + return ret_conv; +} + +int32_t CS_LDK_ConfirmationTarget_anchor_channel_fee() { + int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_anchor_channel_fee()); + return ret_conv; +} + +int32_t CS_LDK_ConfirmationTarget_non_anchor_channel_fee() { + int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_non_anchor_channel_fee()); + return ret_conv; +} + +int32_t CS_LDK_ConfirmationTarget_channel_close_minimum() { + int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_channel_close_minimum()); + return ret_conv; +} + +int32_t CS_LDK_ConfirmationTarget_output_spending_fee() { + int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_output_spending_fee()); + return ret_conv; +} + +int64_t CS_LDK_ConfirmationTarget_hash(int64_t o) { + LDKConfirmationTarget* o_conv = (LDKConfirmationTarget*)untag_ptr(o); + int64_t ret_conv = ConfirmationTarget_hash(o_conv); + return ret_conv; +} + +jboolean CS_LDK_ConfirmationTarget_eq(int64_t a, int64_t b) { + LDKConfirmationTarget* a_conv = (LDKConfirmationTarget*)untag_ptr(a); + LDKConfirmationTarget* b_conv = (LDKConfirmationTarget*)untag_ptr(b); + jboolean ret_conv = ConfirmationTarget_eq(a_conv, b_conv); + return ret_conv; +} + +void CS_LDK_FeeEstimator_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); + LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)(this_ptr_ptr); + FREE(untag_ptr(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); - ChannelMonitor_free(this_obj_conv); + MonitorUpdateId_free(this_obj_conv); } -static inline uint64_t ChannelMonitor_clone_ptr(LDKChannelMonitor *NONNULL_PTR arg) { - LDKChannelMonitor ret_var = ChannelMonitor_clone(arg); +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_ChannelMonitor_clone_ptr(int64_t arg) { - LDKChannelMonitor arg_conv; +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 = ChannelMonitor_clone_ptr(&arg_conv); + int64_t ret_conv = MonitorUpdateId_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_ChannelMonitor_clone(int64_t orig) { - LDKChannelMonitor orig_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; - LDKChannelMonitor ret_var = ChannelMonitor_clone(&orig_conv); + 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; } -int8_tArray CS_LDK_ChannelMonitor_write(int64_t obj) { - LDKChannelMonitor obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ChannelMonitor_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +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; } -int64_t CS_LDK_ChannelMonitor_update_monitor(int64_t this_arg, int64_t updates, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelMonitorUpdate updates_conv; - updates_conv.inner = untag_ptr(updates); - updates_conv.is_owned = ptr_is_owned(updates); - CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv); - updates_conv.is_owned = false; - void* broadcaster_ptr = untag_ptr(broadcaster); - if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); } - LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; - void* fee_estimator_ptr = untag_ptr(fee_estimator); - if (ptr_is_owned(fee_estimator)) { CHECK_ACCESS(fee_estimator_ptr); } - LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; - void* logger_ptr = untag_ptr(logger); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = ChannelMonitor_update_monitor(&this_arg_conv, &updates_conv, broadcaster_conv, fee_estimator_conv, logger_conv); - return tag_ptr(ret_conv, true); +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; } -int64_t CS_LDK_ChannelMonitor_get_latest_update_id(int64_t this_arg) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = ChannelMonitor_get_latest_update_id(&this_arg_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); + CHECK_ACCESS(this_ptr_ptr); + LDKPersist this_ptr_conv = *(LDKPersist*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Persist_free(this_ptr_conv); } -int64_t CS_LDK_ChannelMonitor_get_funding_txo(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; - LDKC2Tuple_OutPointCVec_u8ZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_u8ZZ), "LDKC2Tuple_OutPointCVec_u8ZZ"); - *ret_conv = ChannelMonitor_get_funding_txo(&this_arg_conv); - return tag_ptr(ret_conv, true); +void CS_LDK_LockedChannelMonitor_free(int64_t this_obj) { + LDKLockedChannelMonitor this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + LockedChannelMonitor_free(this_obj_conv); } -int64_t CS_LDK_ChannelMonitor_channel_id(int64_t this_arg) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelId ret_var = ChannelMonitor_channel_id(&this_arg_conv); +void CS_LDK_ChainMonitor_free(int64_t this_obj) { + LDKChainMonitor this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChainMonitor_free(this_obj_conv); +} + +int64_t CS_LDK_ChainMonitor_new(int64_t chain_source, int64_t broadcaster, int64_t logger, int64_t feeest, int64_t persister) { + void* chain_source_ptr = untag_ptr(chain_source); + CHECK_ACCESS(chain_source_ptr); + LDKCOption_FilterZ chain_source_conv = *(LDKCOption_FilterZ*)(chain_source_ptr); + // WARNING: we may need a move here but no clone is available for LDKCOption_FilterZ + if (chain_source_conv.tag == LDKCOption_FilterZ_Some) { + // Manually implement clone for Java trait instances + if (chain_source_conv.some.free == LDKFilter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFilter_JCalls_cloned(&chain_source_conv.some); + } + } + void* broadcaster_ptr = untag_ptr(broadcaster); + CHECK_ACCESS(broadcaster_ptr); + LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); + if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + void* feeest_ptr = untag_ptr(feeest); + CHECK_ACCESS(feeest_ptr); + LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)(feeest_ptr); + if (feeest_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&feeest_conv); + } + void* persister_ptr = untag_ptr(persister); + CHECK_ACCESS(persister_ptr); + LDKPersist persister_conv = *(LDKPersist*)(persister_ptr); + if (persister_conv.free == LDKPersist_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKPersist_JCalls_cloned(&persister_conv); + } + LDKChainMonitor ret_var = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv, persister_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_tArray CS_LDK_ChannelMonitor_get_outputs_to_watch(int64_t this_arg) { - LDKChannelMonitor this_arg_conv; +int64_tArray CS_LDK_ChainMonitor_get_claimable_balances(int64_t this_arg, int64_tArray ignored_channels) { + LDKChainMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ ret_var = ChannelMonitor_get_outputs_to_watch(&this_arg_conv); + LDKCVec_ChannelDetailsZ ignored_channels_constr; + ignored_channels_constr.datalen = ignored_channels->arr_len; + if (ignored_channels_constr.datalen > 0) + ignored_channels_constr.data = MALLOC(ignored_channels_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); + else + ignored_channels_constr.data = NULL; + int64_t* ignored_channels_vals = ignored_channels->elems; + for (size_t q = 0; q < ignored_channels_constr.datalen; q++) { + int64_t ignored_channels_conv_16 = ignored_channels_vals[q]; + LDKChannelDetails ignored_channels_conv_16_conv; + ignored_channels_conv_16_conv.inner = untag_ptr(ignored_channels_conv_16); + ignored_channels_conv_16_conv.is_owned = ptr_is_owned(ignored_channels_conv_16); + CHECK_INNER_FIELD_ACCESS_OR_NULL(ignored_channels_conv_16_conv); + ignored_channels_conv_16_conv = ChannelDetails_clone(&ignored_channels_conv_16_conv); + ignored_channels_constr.data[q] = ignored_channels_conv_16_conv; + } + FREE(ignored_channels); + LDKCVec_BalanceZ ret_var = ChainMonitor_get_claimable_balances(&this_arg_conv, ignored_channels_constr); 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 a = 0; a < ret_var.datalen; a++) { - LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ* ret_conv_52_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ), "LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ"); - *ret_conv_52_conv = ret_var.data[a]; - ret_arr_ptr[a] = tag_ptr(ret_conv_52_conv, true); + for (size_t j = 0; j < ret_var.datalen; j++) { + LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_conv_9_copy = ret_var.data[j]; + int64_t ret_conv_9_ref = tag_ptr(ret_conv_9_copy, true); + ret_arr_ptr[j] = ret_conv_9_ref; } FREE(ret_var.data); return ret_arr; } -void CS_LDK_ChannelMonitor_load_outputs_to_watch(int64_t this_arg, int64_t filter, int64_t logger) { - LDKChannelMonitor this_arg_conv; +int64_t CS_LDK_ChainMonitor_get_monitor(int64_t this_arg, int64_t funding_txo) { + LDKChainMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - void* filter_ptr = untag_ptr(filter); - if (ptr_is_owned(filter)) { CHECK_ACCESS(filter_ptr); } - LDKFilter* filter_conv = (LDKFilter*)filter_ptr; - void* logger_ptr = untag_ptr(logger); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - ChannelMonitor_load_outputs_to_watch(&this_arg_conv, filter_conv, logger_conv); + LDKOutPoint funding_txo_conv; + funding_txo_conv.inner = untag_ptr(funding_txo); + funding_txo_conv.is_owned = ptr_is_owned(funding_txo); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); + funding_txo_conv = OutPoint_clone(&funding_txo_conv); + LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); + *ret_conv = ChainMonitor_get_monitor(&this_arg_conv, funding_txo_conv); + return tag_ptr(ret_conv, true); } -int64_tArray CS_LDK_ChannelMonitor_get_and_clear_pending_monitor_events(int64_t this_arg) { - LDKChannelMonitor this_arg_conv; +int64_tArray CS_LDK_ChainMonitor_list_monitors(int64_t this_arg) { + LDKChainMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_MonitorEventZ ret_var = ChannelMonitor_get_and_clear_pending_monitor_events(&this_arg_conv); + LDKCVec_C2Tuple_OutPointChannelIdZZ ret_var = ChainMonitor_list_monitors(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t o = 0; o < ret_var.datalen; o++) { - LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_conv_14_copy = ret_var.data[o]; - int64_t ret_conv_14_ref = tag_ptr(ret_conv_14_copy, true); - ret_arr_ptr[o] = ret_conv_14_ref; + for (size_t d = 0; d < ret_var.datalen; d++) { + LDKC2Tuple_OutPointChannelIdZ* ret_conv_29_conv = MALLOC(sizeof(LDKC2Tuple_OutPointChannelIdZ), "LDKC2Tuple_OutPointChannelIdZ"); + *ret_conv_29_conv = ret_var.data[d]; + ret_arr_ptr[d] = tag_ptr(ret_conv_29_conv, true); } FREE(ret_var.data); return ret_arr; } -void 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); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - void* handler_ptr = untag_ptr(handler); - if (ptr_is_owned(handler)) { CHECK_ACCESS(handler_ptr); } - LDKEventHandler* handler_conv = (LDKEventHandler*)handler_ptr; - ChannelMonitor_process_pending_events(&this_arg_conv, handler_conv); -} - -int64_t CS_LDK_ChannelMonitor_initial_counterparty_commitment_tx(int64_t this_arg) { - LDKChannelMonitor this_arg_conv; +int64_tArray CS_LDK_ChainMonitor_list_pending_monitor_updates(int64_t this_arg) { + LDKChainMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCommitmentTransaction ret_var = ChannelMonitor_initial_counterparty_commitment_tx(&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_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ 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); + } + + FREE(ret_var.data); + return ret_arr; } -int64_tArray CS_LDK_ChannelMonitor_counterparty_commitment_txs_from_update(int64_t this_arg, int64_t update) { - LDKChannelMonitor this_arg_conv; +int64_t CS_LDK_ChainMonitor_channel_monitor_updated(int64_t this_arg, int64_t funding_txo, int64_t completed_update_id) { + LDKChainMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKChannelMonitorUpdate update_conv; - update_conv.inner = untag_ptr(update); - update_conv.is_owned = ptr_is_owned(update); - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv); - update_conv.is_owned = false; - LDKCVec_CommitmentTransactionZ ret_var = ChannelMonitor_counterparty_commitment_txs_from_update(&this_arg_conv, &update_conv); - 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++) { - LDKCommitmentTransaction ret_conv_23_var = ret_var.data[x]; - int64_t ret_conv_23_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_23_var); - ret_conv_23_ref = tag_ptr(ret_conv_23_var.inner, ret_conv_23_var.is_owned); - ret_arr_ptr[x] = ret_conv_23_ref; - } - - FREE(ret_var.data); - return ret_arr; -} - -int64_t CS_LDK_ChannelMonitor_sign_to_local_justice_tx(int64_t this_arg, int8_tArray justice_tx, int64_t input_idx, int64_t value, int64_t commitment_number) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKTransaction justice_tx_ref; - justice_tx_ref.datalen = justice_tx->arr_len; - justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes"); - memcpy(justice_tx_ref.data, justice_tx->elems, justice_tx_ref.datalen); FREE(justice_tx); - justice_tx_ref.data_is_owned = true; - LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); - *ret_conv = ChannelMonitor_sign_to_local_justice_tx(&this_arg_conv, justice_tx_ref, input_idx, value, commitment_number); + LDKOutPoint funding_txo_conv; + funding_txo_conv.inner = untag_ptr(funding_txo); + funding_txo_conv.is_owned = ptr_is_owned(funding_txo); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); + funding_txo_conv = OutPoint_clone(&funding_txo_conv); + LDKMonitorUpdateId completed_update_id_conv; + completed_update_id_conv.inner = untag_ptr(completed_update_id); + completed_update_id_conv.is_owned = ptr_is_owned(completed_update_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(completed_update_id_conv); + completed_update_id_conv = MonitorUpdateId_clone(&completed_update_id_conv); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id_conv); return tag_ptr(ret_conv, true); } -int8_tArray CS_LDK_ChannelMonitor_get_counterparty_node_id(int64_t this_arg) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, ChannelMonitor_get_counterparty_node_id(&this_arg_conv).compressed_form, 33); - return ret_arr; -} - -void CS_LDK_ChannelMonitor_broadcast_latest_holder_commitment_txn(int64_t this_arg, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - void* broadcaster_ptr = untag_ptr(broadcaster); - if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); } - LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; - void* fee_estimator_ptr = untag_ptr(fee_estimator); - if (ptr_is_owned(fee_estimator)) { CHECK_ACCESS(fee_estimator_ptr); } - LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; - void* logger_ptr = untag_ptr(logger); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - ChannelMonitor_broadcast_latest_holder_commitment_txn(&this_arg_conv, broadcaster_conv, fee_estimator_conv, logger_conv); -} - -int64_tArray CS_LDK_ChannelMonitor_block_connected(int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - uint8_t header_arr[80]; - CHECK(header->arr_len == 80); - memcpy(header_arr, header->elems, 80); FREE(header); - uint8_t (*header_ref)[80] = &header_arr; - LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr; - txdata_constr.datalen = txdata->arr_len; - if (txdata_constr.datalen > 0) - txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); - else - txdata_constr.data = NULL; - int64_t* txdata_vals = txdata->elems; - for (size_t c = 0; c < txdata_constr.datalen; c++) { - int64_t txdata_conv_28 = txdata_vals[c]; - void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28); - CHECK_ACCESS(txdata_conv_28_ptr); - LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr); - txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28)); - txdata_constr.data[c] = txdata_conv_28_conv; - } - FREE(txdata); - void* broadcaster_ptr = untag_ptr(broadcaster); - CHECK_ACCESS(broadcaster_ptr); - LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); - } - void* fee_estimator_ptr = untag_ptr(fee_estimator); - CHECK_ACCESS(fee_estimator_ptr); - LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); - } - void* logger_ptr = untag_ptr(logger); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_block_connected(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t x = 0; x < ret_var.datalen; x++) { - LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ* ret_conv_49_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ"); - *ret_conv_49_conv = ret_var.data[x]; - ret_arr_ptr[x] = tag_ptr(ret_conv_49_conv, true); - } - - FREE(ret_var.data); - return ret_arr; -} - -void CS_LDK_ChannelMonitor_block_disconnected(int64_t this_arg, int8_tArray header, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - uint8_t header_arr[80]; - CHECK(header->arr_len == 80); - memcpy(header_arr, header->elems, 80); FREE(header); - uint8_t (*header_ref)[80] = &header_arr; - void* broadcaster_ptr = untag_ptr(broadcaster); - CHECK_ACCESS(broadcaster_ptr); - LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); - } - void* fee_estimator_ptr = untag_ptr(fee_estimator); - CHECK_ACCESS(fee_estimator_ptr); - LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); - } - void* logger_ptr = untag_ptr(logger); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - ChannelMonitor_block_disconnected(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv); -} - -int64_tArray CS_LDK_ChannelMonitor_transactions_confirmed(int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - uint8_t header_arr[80]; - CHECK(header->arr_len == 80); - memcpy(header_arr, header->elems, 80); FREE(header); - uint8_t (*header_ref)[80] = &header_arr; - LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr; - txdata_constr.datalen = txdata->arr_len; - if (txdata_constr.datalen > 0) - txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); - else - txdata_constr.data = NULL; - int64_t* txdata_vals = txdata->elems; - for (size_t c = 0; c < txdata_constr.datalen; c++) { - int64_t txdata_conv_28 = txdata_vals[c]; - void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28); - CHECK_ACCESS(txdata_conv_28_ptr); - LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr); - txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28)); - txdata_constr.data[c] = txdata_conv_28_conv; - } - FREE(txdata); - void* broadcaster_ptr = untag_ptr(broadcaster); - CHECK_ACCESS(broadcaster_ptr); - LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); - } - void* fee_estimator_ptr = untag_ptr(fee_estimator); - CHECK_ACCESS(fee_estimator_ptr); - LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); - } - void* logger_ptr = untag_ptr(logger); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_transactions_confirmed(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t x = 0; x < ret_var.datalen; x++) { - LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ* ret_conv_49_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ"); - *ret_conv_49_conv = ret_var.data[x]; - ret_arr_ptr[x] = tag_ptr(ret_conv_49_conv, true); - } - - FREE(ret_var.data); - return ret_arr; -} - -void CS_LDK_ChannelMonitor_transaction_unconfirmed(int64_t this_arg, int8_tArray txid, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - uint8_t txid_arr[32]; - CHECK(txid->arr_len == 32); - memcpy(txid_arr, txid->elems, 32); FREE(txid); - uint8_t (*txid_ref)[32] = &txid_arr; - void* broadcaster_ptr = untag_ptr(broadcaster); - CHECK_ACCESS(broadcaster_ptr); - LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); - } - void* fee_estimator_ptr = untag_ptr(fee_estimator); - CHECK_ACCESS(fee_estimator_ptr); - LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); - } - void* logger_ptr = untag_ptr(logger); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - ChannelMonitor_transaction_unconfirmed(&this_arg_conv, txid_ref, broadcaster_conv, fee_estimator_conv, logger_conv); -} - -int64_tArray CS_LDK_ChannelMonitor_best_block_updated(int64_t this_arg, int8_tArray header, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { - LDKChannelMonitor this_arg_conv; +int64_t CS_LDK_ChainMonitor_get_update_future(int64_t this_arg) { + LDKChainMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - uint8_t header_arr[80]; - CHECK(header->arr_len == 80); - memcpy(header_arr, header->elems, 80); FREE(header); - uint8_t (*header_ref)[80] = &header_arr; - void* broadcaster_ptr = untag_ptr(broadcaster); - CHECK_ACCESS(broadcaster_ptr); - LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); - } - void* fee_estimator_ptr = untag_ptr(fee_estimator); - CHECK_ACCESS(fee_estimator_ptr); - LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); - } - void* logger_ptr = untag_ptr(logger); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_best_block_updated(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t x = 0; x < ret_var.datalen; x++) { - LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ* ret_conv_49_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ"); - *ret_conv_49_conv = ret_var.data[x]; - ret_arr_ptr[x] = tag_ptr(ret_conv_49_conv, true); - } - - FREE(ret_var.data); - return ret_arr; + LDKFuture ret_var = ChainMonitor_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_tArray CS_LDK_ChannelMonitor_get_relevant_txids(int64_t this_arg) { - LDKChannelMonitor this_arg_conv; +void CS_LDK_ChainMonitor_rebroadcast_pending_claims(int64_t this_arg) { + LDKChainMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ ret_var = ChannelMonitor_get_relevant_txids(&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 c = 0; c < ret_var.datalen; c++) { - LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ* ret_conv_54_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ), "LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ"); - *ret_conv_54_conv = ret_var.data[c]; - ret_arr_ptr[c] = tag_ptr(ret_conv_54_conv, true); - } - - FREE(ret_var.data); - return ret_arr; + ChainMonitor_rebroadcast_pending_claims(&this_arg_conv); } -int64_t CS_LDK_ChannelMonitor_current_best_block(int64_t this_arg) { - LDKChannelMonitor this_arg_conv; +void CS_LDK_ChainMonitor_signer_unblocked(int64_t this_arg, int64_t monitor_opt) { + LDKChainMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKBestBlock ret_var = ChannelMonitor_current_best_block(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + LDKOutPoint monitor_opt_conv; + monitor_opt_conv.inner = untag_ptr(monitor_opt); + monitor_opt_conv.is_owned = ptr_is_owned(monitor_opt); + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_opt_conv); + monitor_opt_conv = OutPoint_clone(&monitor_opt_conv); + ChainMonitor_signer_unblocked(&this_arg_conv, monitor_opt_conv); } -void CS_LDK_ChannelMonitor_rebroadcast_pending_claims(int64_t this_arg, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { - LDKChannelMonitor this_arg_conv; +void CS_LDK_ChainMonitor_archive_fully_resolved_channel_monitors(int64_t this_arg) { + LDKChainMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - void* broadcaster_ptr = untag_ptr(broadcaster); - CHECK_ACCESS(broadcaster_ptr); - LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); - } - void* fee_estimator_ptr = untag_ptr(fee_estimator); - CHECK_ACCESS(fee_estimator_ptr); - LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); - } - void* logger_ptr = untag_ptr(logger); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - ChannelMonitor_rebroadcast_pending_claims(&this_arg_conv, broadcaster_conv, fee_estimator_conv, logger_conv); + ChainMonitor_archive_fully_resolved_channel_monitors(&this_arg_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; +int64_t CS_LDK_ChainMonitor_as_Listen(int64_t this_arg) { + LDKChainMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - void* broadcaster_ptr = untag_ptr(broadcaster); - CHECK_ACCESS(broadcaster_ptr); - LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); - } - void* fee_estimator_ptr = untag_ptr(fee_estimator); - CHECK_ACCESS(fee_estimator_ptr); - LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); - } - void* logger_ptr = untag_ptr(logger); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - ChannelMonitor_signer_unblocked(&this_arg_conv, broadcaster_conv, fee_estimator_conv, logger_conv); + LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); + *ret_ret = ChainMonitor_as_Listen(&this_arg_conv); + return tag_ptr(ret_ret, true); } -int64_tArray CS_LDK_ChannelMonitor_get_spendable_outputs(int64_t this_arg, int8_tArray tx, int32_t confirmation_height) { - LDKChannelMonitor this_arg_conv; +int64_t CS_LDK_ChainMonitor_as_Confirm(int64_t this_arg) { + LDKChainMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKTransaction tx_ref; - tx_ref.datalen = tx->arr_len; - tx_ref.data = MALLOC(tx_ref.datalen, "LDKTransaction Bytes"); - memcpy(tx_ref.data, tx->elems, tx_ref.datalen); FREE(tx); - tx_ref.data_is_owned = true; - LDKCVec_SpendableOutputDescriptorZ ret_var = ChannelMonitor_get_spendable_outputs(&this_arg_conv, tx_ref, confirmation_height); - 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 b = 0; b < ret_var.datalen; b++) { - LDKSpendableOutputDescriptor *ret_conv_27_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_conv_27_copy = ret_var.data[b]; - int64_t ret_conv_27_ref = tag_ptr(ret_conv_27_copy, true); - ret_arr_ptr[b] = ret_conv_27_ref; - } - - FREE(ret_var.data); - return ret_arr; + LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); + *ret_ret = ChainMonitor_as_Confirm(&this_arg_conv); + return tag_ptr(ret_ret, true); } -jboolean CS_LDK_ChannelMonitor_is_fully_resolved(int64_t this_arg, int64_t logger) { - LDKChannelMonitor this_arg_conv; +int64_t CS_LDK_ChainMonitor_as_Watch(int64_t this_arg) { + LDKChainMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - void* logger_ptr = untag_ptr(logger); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - jboolean ret_conv = ChannelMonitor_is_fully_resolved(&this_arg_conv, logger_conv); - return ret_conv; + LDKWatch* ret_ret = MALLOC(sizeof(LDKWatch), "LDKWatch"); + *ret_ret = ChainMonitor_as_Watch(&this_arg_conv); + return tag_ptr(ret_ret, true); } -int64_tArray CS_LDK_ChannelMonitor_get_claimable_balances(int64_t this_arg) { - LDKChannelMonitor this_arg_conv; +int64_t CS_LDK_ChainMonitor_as_EventsProvider(int64_t this_arg) { + LDKChainMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_BalanceZ ret_var = ChannelMonitor_get_claimable_balances(&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 j = 0; j < ret_var.datalen; j++) { - LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_conv_9_copy = ret_var.data[j]; - int64_t ret_conv_9_ref = tag_ptr(ret_conv_9_copy, true); - ret_arr_ptr[j] = ret_conv_9_ref; - } - - FREE(ret_var.data); - return ret_arr; -} - -int64_t CS_LDK_C2Tuple_ThirtyTwoBytesChannelMonitorZ_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_a_ptr = untag_ptr(arg_a); - if (ptr_is_owned(arg_a)) { CHECK_ACCESS(arg_a_ptr); } - LDKEntropySource* arg_a_conv = (LDKEntropySource*)arg_a_ptr; - void* arg_b_ptr = untag_ptr(arg_b); - if (ptr_is_owned(arg_b)) { CHECK_ACCESS(arg_b_ptr); } - LDKSignerProvider* arg_b_conv = (LDKSignerProvider*)arg_b_ptr; - LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ"); - *ret_conv = C2Tuple_ThirtyTwoBytesChannelMonitorZ_read(ser_ref, arg_a_conv, arg_b_conv); - FREE(ser); - return tag_ptr(ret_conv, true); + LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); + *ret_ret = ChainMonitor_as_EventsProvider(&this_arg_conv); + return tag_ptr(ret_ret, true); } -void CS_LDK_OutPoint_free(int64_t this_obj) { - LDKOutPoint this_obj_conv; +void CS_LDK_ChannelMonitorUpdate_free(int64_t this_obj) { + LDKChannelMonitorUpdate this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - OutPoint_free(this_obj_conv); + ChannelMonitorUpdate_free(this_obj_conv); } -int8_tArray CS_LDK_OutPoint_get_txid(int64_t this_ptr) { - LDKOutPoint this_ptr_conv; +int64_t CS_LDK_ChannelMonitorUpdate_get_update_id(int64_t this_ptr) { + LDKChannelMonitorUpdate this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *OutPoint_get_txid(&this_ptr_conv), 32); - return ret_arr; + int64_t ret_conv = ChannelMonitorUpdate_get_update_id(&this_ptr_conv); + return ret_conv; } -void CS_LDK_OutPoint_set_txid(int64_t this_ptr, int8_tArray val) { - LDKOutPoint this_ptr_conv; +void CS_LDK_ChannelMonitorUpdate_set_update_id(int64_t this_ptr, int64_t val) { + LDKChannelMonitorUpdate this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - OutPoint_set_txid(&this_ptr_conv, val_ref); + ChannelMonitorUpdate_set_update_id(&this_ptr_conv, val); } -int16_t CS_LDK_OutPoint_get_index(int64_t this_ptr) { - LDKOutPoint this_ptr_conv; +int64_t CS_LDK_ChannelMonitorUpdate_get_channel_id(int64_t this_ptr) { + LDKChannelMonitorUpdate this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int16_t ret_conv = OutPoint_get_index(&this_ptr_conv); - return ret_conv; + LDKChannelId ret_var = ChannelMonitorUpdate_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_OutPoint_set_index(int64_t this_ptr, int16_t val) { - LDKOutPoint this_ptr_conv; +void CS_LDK_ChannelMonitorUpdate_set_channel_id(int64_t this_ptr, int64_t val) { + LDKChannelMonitorUpdate this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - OutPoint_set_index(&this_ptr_conv, val); -} - -int64_t CS_LDK_OutPoint_new(int8_tArray txid_arg, int16_t index_arg) { - LDKThirtyTwoBytes txid_arg_ref; - CHECK(txid_arg->arr_len == 32); - memcpy(txid_arg_ref.data, txid_arg->elems, 32); FREE(txid_arg); - LDKOutPoint ret_var = OutPoint_new(txid_arg_ref, index_arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + LDKChannelId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelId_clone(&val_conv); + ChannelMonitorUpdate_set_channel_id(&this_ptr_conv, val_conv); } -static inline uint64_t OutPoint_clone_ptr(LDKOutPoint *NONNULL_PTR arg) { - LDKOutPoint ret_var = OutPoint_clone(arg); +static inline uint64_t ChannelMonitorUpdate_clone_ptr(LDKChannelMonitorUpdate *NONNULL_PTR arg) { + LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_OutPoint_clone_ptr(int64_t arg) { - LDKOutPoint arg_conv; +int64_t CS_LDK_ChannelMonitorUpdate_clone_ptr(int64_t arg) { + LDKChannelMonitorUpdate arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = OutPoint_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelMonitorUpdate_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_OutPoint_clone(int64_t orig) { - LDKOutPoint orig_conv; +int64_t CS_LDK_ChannelMonitorUpdate_clone(int64_t orig) { + LDKChannelMonitorUpdate orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKOutPoint ret_var = OutPoint_clone(&orig_conv); + LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_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_OutPoint_eq(int64_t a, int64_t b) { - LDKOutPoint a_conv; +jboolean CS_LDK_ChannelMonitorUpdate_eq(int64_t a, int64_t b) { + LDKChannelMonitorUpdate a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKOutPoint b_conv; + LDKChannelMonitorUpdate b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = OutPoint_eq(&a_conv, &b_conv); - return ret_conv; -} - -int64_t CS_LDK_OutPoint_hash(int64_t o) { - LDKOutPoint o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = OutPoint_hash(&o_conv); + jboolean ret_conv = ChannelMonitorUpdate_eq(&a_conv, &b_conv); return ret_conv; } -int8_tArray CS_LDK_OutPoint_write(int64_t obj) { - LDKOutPoint obj_conv; +int8_tArray CS_LDK_ChannelMonitorUpdate_write(int64_t obj) { + LDKChannelMonitorUpdate obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = OutPoint_write(&obj_conv); + LDKCVec_u8Z ret_var = ChannelMonitorUpdate_write(&obj_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_OutPoint_read(int8_tArray ser) { +int64_t CS_LDK_ChannelMonitorUpdate_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); - *ret_conv = OutPoint_read(ser_ref); + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); + *ret_conv = ChannelMonitorUpdate_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_InboundHTLCErr_free(int64_t this_obj) { - LDKInboundHTLCErr this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InboundHTLCErr_free(this_obj_conv); +void CS_LDK_MonitorEvent_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); + LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + MonitorEvent_free(this_ptr_conv); } -int16_t CS_LDK_InboundHTLCErr_get_err_code(int64_t this_ptr) { - LDKInboundHTLCErr this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int16_t ret_conv = InboundHTLCErr_get_err_code(&this_ptr_conv); +static inline uint64_t MonitorEvent_clone_ptr(LDKMonitorEvent *NONNULL_PTR arg) { + LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_copy = MonitorEvent_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_MonitorEvent_clone_ptr(int64_t arg) { + LDKMonitorEvent* arg_conv = (LDKMonitorEvent*)untag_ptr(arg); + int64_t ret_conv = MonitorEvent_clone_ptr(arg_conv); return ret_conv; } -void CS_LDK_InboundHTLCErr_set_err_code(int64_t this_ptr, int16_t val) { - LDKInboundHTLCErr this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - InboundHTLCErr_set_err_code(&this_ptr_conv, val); +int64_t CS_LDK_MonitorEvent_clone(int64_t orig) { + LDKMonitorEvent* orig_conv = (LDKMonitorEvent*)untag_ptr(orig); + LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_copy = MonitorEvent_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int8_tArray CS_LDK_InboundHTLCErr_get_err_data(int64_t this_ptr) { - LDKInboundHTLCErr this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_u8Z ret_var = InboundHTLCErr_get_err_data(&this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +int64_t CS_LDK_MonitorEvent_htlcevent(int64_t a) { + LDKHTLCUpdate a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = HTLCUpdate_clone(&a_conv); + LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_copy = MonitorEvent_htlcevent(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_InboundHTLCErr_set_err_data(int64_t this_ptr, int8_tArray val) { - LDKInboundHTLCErr this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_u8Z val_ref; - val_ref.datalen = val->arr_len; - val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val); - InboundHTLCErr_set_err_data(&this_ptr_conv, val_ref); +int64_t CS_LDK_MonitorEvent_holder_force_closed_with_info(int64_t reason, int64_t outpoint, int64_t channel_id) { + void* reason_ptr = untag_ptr(reason); + CHECK_ACCESS(reason_ptr); + LDKClosureReason reason_conv = *(LDKClosureReason*)(reason_ptr); + reason_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(reason)); + LDKOutPoint outpoint_conv; + outpoint_conv.inner = untag_ptr(outpoint); + outpoint_conv.is_owned = ptr_is_owned(outpoint); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv); + outpoint_conv = OutPoint_clone(&outpoint_conv); + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); + LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_copy = MonitorEvent_holder_force_closed_with_info(reason_conv, outpoint_conv, channel_id_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jstring CS_LDK_InboundHTLCErr_get_msg(int64_t this_ptr) { - LDKInboundHTLCErr this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKStr ret_str = InboundHTLCErr_get_msg(&this_ptr_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); +int64_t CS_LDK_MonitorEvent_holder_force_closed(int64_t a) { + LDKOutPoint a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = OutPoint_clone(&a_conv); + LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_copy = MonitorEvent_holder_force_closed(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_MonitorEvent_completed(int64_t funding_txo, int64_t channel_id, int64_t monitor_update_id) { + LDKOutPoint funding_txo_conv; + funding_txo_conv.inner = untag_ptr(funding_txo); + funding_txo_conv.is_owned = ptr_is_owned(funding_txo); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); + funding_txo_conv = OutPoint_clone(&funding_txo_conv); + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); + LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_copy = MonitorEvent_completed(funding_txo_conv, channel_id_conv, monitor_update_id); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +jboolean CS_LDK_MonitorEvent_eq(int64_t a, int64_t b) { + LDKMonitorEvent* a_conv = (LDKMonitorEvent*)untag_ptr(a); + LDKMonitorEvent* b_conv = (LDKMonitorEvent*)untag_ptr(b); + jboolean ret_conv = MonitorEvent_eq(a_conv, b_conv); return ret_conv; } -void CS_LDK_InboundHTLCErr_set_msg(int64_t this_ptr, jstring val) { - LDKInboundHTLCErr this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKStr val_conv = str_ref_to_owned_c(val); - InboundHTLCErr_set_msg(&this_ptr_conv, val_conv); +int8_tArray CS_LDK_MonitorEvent_write(int64_t obj) { + LDKMonitorEvent* obj_conv = (LDKMonitorEvent*)untag_ptr(obj); + LDKCVec_u8Z ret_var = MonitorEvent_write(obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -int64_t CS_LDK_InboundHTLCErr_new(int16_t err_code_arg, int8_tArray err_data_arg, jstring msg_arg) { - LDKCVec_u8Z err_data_arg_ref; - err_data_arg_ref.datalen = err_data_arg->arr_len; - err_data_arg_ref.data = MALLOC(err_data_arg_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(err_data_arg_ref.data, err_data_arg->elems, err_data_arg_ref.datalen); FREE(err_data_arg); - LDKStr msg_arg_conv = str_ref_to_owned_c(msg_arg); - LDKInboundHTLCErr ret_var = InboundHTLCErr_new(err_code_arg, err_data_arg_ref, msg_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +int64_t CS_LDK_MonitorEvent_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = MonitorEvent_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -static inline uint64_t InboundHTLCErr_clone_ptr(LDKInboundHTLCErr *NONNULL_PTR arg) { - LDKInboundHTLCErr ret_var = InboundHTLCErr_clone(arg); +void CS_LDK_HTLCUpdate_free(int64_t this_obj) { + LDKHTLCUpdate this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + HTLCUpdate_free(this_obj_conv); +} + +static inline uint64_t HTLCUpdate_clone_ptr(LDKHTLCUpdate *NONNULL_PTR arg) { + LDKHTLCUpdate ret_var = HTLCUpdate_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_InboundHTLCErr_clone_ptr(int64_t arg) { - LDKInboundHTLCErr arg_conv; +int64_t CS_LDK_HTLCUpdate_clone_ptr(int64_t arg) { + LDKHTLCUpdate arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = InboundHTLCErr_clone_ptr(&arg_conv); + int64_t ret_conv = HTLCUpdate_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_InboundHTLCErr_clone(int64_t orig) { - LDKInboundHTLCErr orig_conv; +int64_t CS_LDK_HTLCUpdate_clone(int64_t orig) { + LDKHTLCUpdate orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKInboundHTLCErr ret_var = InboundHTLCErr_clone(&orig_conv); + LDKHTLCUpdate ret_var = HTLCUpdate_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_InboundHTLCErr_hash(int64_t o) { - LDKInboundHTLCErr o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = InboundHTLCErr_hash(&o_conv); - return ret_conv; -} - -jboolean CS_LDK_InboundHTLCErr_eq(int64_t a, int64_t b) { - LDKInboundHTLCErr a_conv; +jboolean CS_LDK_HTLCUpdate_eq(int64_t a, int64_t b) { + LDKHTLCUpdate a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKInboundHTLCErr b_conv; + LDKHTLCUpdate b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = InboundHTLCErr_eq(&a_conv, &b_conv); + jboolean ret_conv = HTLCUpdate_eq(&a_conv, &b_conv); return ret_conv; } -int64_t CS_LDK_peel_payment_onion(int64_t msg, int64_t node_signer, int64_t logger, int32_t cur_height, jboolean accept_mpp_keysend, jboolean allow_skimmed_fees) { - LDKUpdateAddHTLC msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - void* node_signer_ptr = untag_ptr(node_signer); - if (ptr_is_owned(node_signer)) { CHECK_ACCESS(node_signer_ptr); } - LDKNodeSigner* node_signer_conv = (LDKNodeSigner*)node_signer_ptr; - void* logger_ptr = untag_ptr(logger); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - LDKCResult_PendingHTLCInfoInboundHTLCErrZ* ret_conv = MALLOC(sizeof(LDKCResult_PendingHTLCInfoInboundHTLCErrZ), "LDKCResult_PendingHTLCInfoInboundHTLCErrZ"); - *ret_conv = peel_payment_onion(&msg_conv, node_signer_conv, logger_conv, cur_height, accept_mpp_keysend, allow_skimmed_fees); +int8_tArray CS_LDK_HTLCUpdate_write(int64_t obj) { + LDKHTLCUpdate obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = HTLCUpdate_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_HTLCUpdate_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); + *ret_conv = HTLCUpdate_read(ser_ref); + FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_PendingHTLCRouting_free(int64_t this_ptr) { +void CS_LDK_Balance_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); - LDKPendingHTLCRouting this_ptr_conv = *(LDKPendingHTLCRouting*)(this_ptr_ptr); + LDKBalance this_ptr_conv = *(LDKBalance*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - PendingHTLCRouting_free(this_ptr_conv); + Balance_free(this_ptr_conv); } -static inline uint64_t PendingHTLCRouting_clone_ptr(LDKPendingHTLCRouting *NONNULL_PTR arg) { - LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); - *ret_copy = PendingHTLCRouting_clone(arg); +static inline uint64_t Balance_clone_ptr(LDKBalance *NONNULL_PTR arg) { + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_PendingHTLCRouting_clone_ptr(int64_t arg) { - LDKPendingHTLCRouting* arg_conv = (LDKPendingHTLCRouting*)untag_ptr(arg); - int64_t ret_conv = PendingHTLCRouting_clone_ptr(arg_conv); +int64_t CS_LDK_Balance_clone_ptr(int64_t arg) { + LDKBalance* arg_conv = (LDKBalance*)untag_ptr(arg); + int64_t ret_conv = Balance_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_PendingHTLCRouting_clone(int64_t orig) { - LDKPendingHTLCRouting* orig_conv = (LDKPendingHTLCRouting*)untag_ptr(orig); - LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); - *ret_copy = PendingHTLCRouting_clone(orig_conv); +int64_t CS_LDK_Balance_clone(int64_t orig) { + LDKBalance* orig_conv = (LDKBalance*)untag_ptr(orig); + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_clone(orig_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_PendingHTLCRouting_forward(int64_t onion_packet, int64_t short_channel_id, int64_t blinded) { - LDKOnionPacket onion_packet_conv; - onion_packet_conv.inner = untag_ptr(onion_packet); - onion_packet_conv.is_owned = ptr_is_owned(onion_packet); - CHECK_INNER_FIELD_ACCESS_OR_NULL(onion_packet_conv); - onion_packet_conv = OnionPacket_clone(&onion_packet_conv); - LDKBlindedForward blinded_conv; - blinded_conv.inner = untag_ptr(blinded); - blinded_conv.is_owned = ptr_is_owned(blinded); - CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_conv); - blinded_conv = BlindedForward_clone(&blinded_conv); - LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); - *ret_copy = PendingHTLCRouting_forward(onion_packet_conv, short_channel_id, blinded_conv); +int64_t CS_LDK_Balance_claimable_on_channel_close(int64_t amount_satoshis) { + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_claimable_on_channel_close(amount_satoshis); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_PendingHTLCRouting_receive(int64_t payment_data, int64_t payment_metadata, int64_t payment_context, int32_t incoming_cltv_expiry, int8_tArray phantom_shared_secret, int64_tArray custom_tlvs, jboolean requires_blinded_error) { - LDKFinalOnionHopData payment_data_conv; - payment_data_conv.inner = untag_ptr(payment_data); - payment_data_conv.is_owned = ptr_is_owned(payment_data); - CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_data_conv); - payment_data_conv = FinalOnionHopData_clone(&payment_data_conv); - void* payment_metadata_ptr = untag_ptr(payment_metadata); - CHECK_ACCESS(payment_metadata_ptr); - LDKCOption_CVec_u8ZZ payment_metadata_conv = *(LDKCOption_CVec_u8ZZ*)(payment_metadata_ptr); - payment_metadata_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(payment_metadata)); - void* payment_context_ptr = untag_ptr(payment_context); - CHECK_ACCESS(payment_context_ptr); - LDKCOption_PaymentContextZ payment_context_conv = *(LDKCOption_PaymentContextZ*)(payment_context_ptr); - payment_context_conv = COption_PaymentContextZ_clone((LDKCOption_PaymentContextZ*)untag_ptr(payment_context)); - LDKThirtyTwoBytes phantom_shared_secret_ref; - CHECK(phantom_shared_secret->arr_len == 32); - memcpy(phantom_shared_secret_ref.data, phantom_shared_secret->elems, 32); FREE(phantom_shared_secret); - LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs_constr; - custom_tlvs_constr.datalen = custom_tlvs->arr_len; - if (custom_tlvs_constr.datalen > 0) - custom_tlvs_constr.data = MALLOC(custom_tlvs_constr.datalen * sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKCVec_C2Tuple_u64CVec_u8ZZZ Elements"); - else - custom_tlvs_constr.data = NULL; - 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); - LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); - *ret_copy = PendingHTLCRouting_receive(payment_data_conv, payment_metadata_conv, payment_context_conv, incoming_cltv_expiry, phantom_shared_secret_ref, custom_tlvs_constr, requires_blinded_error); +int64_t CS_LDK_Balance_claimable_awaiting_confirmations(int64_t amount_satoshis, int32_t confirmation_height) { + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_claimable_awaiting_confirmations(amount_satoshis, confirmation_height); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_PendingHTLCRouting_receive_keysend(int64_t payment_data, int8_tArray payment_preimage, int64_t payment_metadata, int32_t incoming_cltv_expiry, int64_tArray custom_tlvs, jboolean requires_blinded_error) { - LDKFinalOnionHopData payment_data_conv; - payment_data_conv.inner = untag_ptr(payment_data); - payment_data_conv.is_owned = ptr_is_owned(payment_data); - CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_data_conv); - payment_data_conv = FinalOnionHopData_clone(&payment_data_conv); +int64_t CS_LDK_Balance_contentious_claimable(int64_t amount_satoshis, int32_t timeout_height, int8_tArray payment_hash, int8_tArray payment_preimage) { + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); LDKThirtyTwoBytes payment_preimage_ref; CHECK(payment_preimage->arr_len == 32); memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); - void* payment_metadata_ptr = untag_ptr(payment_metadata); - CHECK_ACCESS(payment_metadata_ptr); - LDKCOption_CVec_u8ZZ payment_metadata_conv = *(LDKCOption_CVec_u8ZZ*)(payment_metadata_ptr); - payment_metadata_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(payment_metadata)); - LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs_constr; - custom_tlvs_constr.datalen = custom_tlvs->arr_len; - if (custom_tlvs_constr.datalen > 0) - custom_tlvs_constr.data = MALLOC(custom_tlvs_constr.datalen * sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKCVec_C2Tuple_u64CVec_u8ZZZ Elements"); - else - custom_tlvs_constr.data = NULL; - 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); - LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); - *ret_copy = PendingHTLCRouting_receive_keysend(payment_data_conv, payment_preimage_ref, payment_metadata_conv, incoming_cltv_expiry, custom_tlvs_constr, requires_blinded_error); + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_contentious_claimable(amount_satoshis, timeout_height, payment_hash_ref, payment_preimage_ref); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void CS_LDK_BlindedForward_free(int64_t this_obj) { - LDKBlindedForward this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BlindedForward_free(this_obj_conv); +int64_t CS_LDK_Balance_maybe_timeout_claimable_htlc(int64_t amount_satoshis, int32_t claimable_height, int8_tArray payment_hash) { + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_maybe_timeout_claimable_htlc(amount_satoshis, claimable_height, payment_hash_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int8_tArray CS_LDK_BlindedForward_get_inbound_blinding_point(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_inbound_blinding_point(&this_ptr_conv).compressed_form, 33); - return ret_arr; +int64_t CS_LDK_Balance_maybe_preimage_claimable_htlc(int64_t amount_satoshis, int32_t expiry_height, int8_tArray payment_hash) { + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_maybe_preimage_claimable_htlc(amount_satoshis, expiry_height, payment_hash_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_BlindedForward_set_inbound_blinding_point(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_inbound_blinding_point(&this_ptr_conv, val_ref); +int64_t CS_LDK_Balance_counterparty_revoked_output_claimable(int64_t amount_satoshis) { + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_counterparty_revoked_output_claimable(amount_satoshis); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int32_t CS_LDK_BlindedForward_get_failure(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; - int32_t ret_conv = LDKBlindedFailure_to_cs(BlindedForward_get_failure(&this_ptr_conv)); +jboolean CS_LDK_Balance_eq(int64_t a, int64_t b) { + LDKBalance* a_conv = (LDKBalance*)untag_ptr(a); + LDKBalance* b_conv = (LDKBalance*)untag_ptr(b); + jboolean ret_conv = Balance_eq(a_conv, b_conv); return ret_conv; } -void CS_LDK_BlindedForward_set_failure(int64_t this_ptr, int32_t val) { - LDKBlindedForward this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKBlindedFailure val_conv = LDKBlindedFailure_from_cs(val); - BlindedForward_set_failure(&this_ptr_conv, val_conv); +int64_t CS_LDK_Balance_claimable_amount_satoshis(int64_t this_arg) { + LDKBalance* this_arg_conv = (LDKBalance*)untag_ptr(this_arg); + int64_t ret_conv = Balance_claimable_amount_satoshis(this_arg_conv); + return ret_conv; } -int64_t CS_LDK_BlindedForward_new(int8_tArray inbound_blinding_point_arg, int32_t failure_arg) { - LDKPublicKey inbound_blinding_point_arg_ref; - CHECK(inbound_blinding_point_arg->arr_len == 33); - memcpy(inbound_blinding_point_arg_ref.compressed_form, inbound_blinding_point_arg->elems, 33); FREE(inbound_blinding_point_arg); - LDKBlindedFailure failure_arg_conv = LDKBlindedFailure_from_cs(failure_arg); - LDKBlindedForward ret_var = BlindedForward_new(inbound_blinding_point_arg_ref, failure_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +void CS_LDK_ChannelMonitor_free(int64_t this_obj) { + LDKChannelMonitor this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelMonitor_free(this_obj_conv); } -static inline uint64_t BlindedForward_clone_ptr(LDKBlindedForward *NONNULL_PTR arg) { - LDKBlindedForward ret_var = BlindedForward_clone(arg); +static inline uint64_t ChannelMonitor_clone_ptr(LDKChannelMonitor *NONNULL_PTR arg) { + LDKChannelMonitor ret_var = ChannelMonitor_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_BlindedForward_clone_ptr(int64_t arg) { - LDKBlindedForward arg_conv; +int64_t CS_LDK_ChannelMonitor_clone_ptr(int64_t arg) { + LDKChannelMonitor arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = BlindedForward_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelMonitor_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_BlindedForward_clone(int64_t orig) { - LDKBlindedForward orig_conv; +int64_t CS_LDK_ChannelMonitor_clone(int64_t orig) { + LDKChannelMonitor orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBlindedForward ret_var = BlindedForward_clone(&orig_conv); + LDKChannelMonitor ret_var = ChannelMonitor_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_BlindedForward_hash(int64_t o) { - LDKBlindedForward o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = BlindedForward_hash(&o_conv); - return ret_conv; +int8_tArray CS_LDK_ChannelMonitor_write(int64_t obj) { + LDKChannelMonitor obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ChannelMonitor_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -jboolean CS_LDK_BlindedForward_eq(int64_t a, int64_t b) { - LDKBlindedForward a_conv; +int64_t CS_LDK_ChannelMonitor_update_monitor(int64_t this_arg, int64_t updates, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelMonitorUpdate updates_conv; + updates_conv.inner = untag_ptr(updates); + updates_conv.is_owned = ptr_is_owned(updates); + CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv); + updates_conv.is_owned = false; + void* broadcaster_ptr = untag_ptr(broadcaster); + if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); } + LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; + void* fee_estimator_ptr = untag_ptr(fee_estimator); + if (ptr_is_owned(fee_estimator)) { CHECK_ACCESS(fee_estimator_ptr); } + LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; + void* logger_ptr = untag_ptr(logger); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelMonitor_update_monitor(&this_arg_conv, &updates_conv, broadcaster_conv, fee_estimator_conv, logger_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_ChannelMonitor_get_latest_update_id(int64_t this_arg) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int64_t ret_conv = ChannelMonitor_get_latest_update_id(&this_arg_conv); + return ret_conv; +} + +int64_t CS_LDK_ChannelMonitor_get_funding_txo(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; + LDKC2Tuple_OutPointCVec_u8ZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_u8ZZ), "LDKC2Tuple_OutPointCVec_u8ZZ"); + *ret_conv = ChannelMonitor_get_funding_txo(&this_arg_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_ChannelMonitor_channel_id(int64_t this_arg) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelId ret_var = ChannelMonitor_channel_id(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int64_tArray CS_LDK_ChannelMonitor_get_outputs_to_watch(int64_t this_arg) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ ret_var = ChannelMonitor_get_outputs_to_watch(&this_arg_conv); + 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 a = 0; a < ret_var.datalen; a++) { + LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ* ret_conv_52_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ), "LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ"); + *ret_conv_52_conv = ret_var.data[a]; + ret_arr_ptr[a] = tag_ptr(ret_conv_52_conv, true); + } + + FREE(ret_var.data); + return ret_arr; +} + +void CS_LDK_ChannelMonitor_load_outputs_to_watch(int64_t this_arg, int64_t filter, int64_t logger) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + void* filter_ptr = untag_ptr(filter); + if (ptr_is_owned(filter)) { CHECK_ACCESS(filter_ptr); } + LDKFilter* filter_conv = (LDKFilter*)filter_ptr; + void* logger_ptr = untag_ptr(logger); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + ChannelMonitor_load_outputs_to_watch(&this_arg_conv, filter_conv, logger_conv); +} + +int64_tArray CS_LDK_ChannelMonitor_get_and_clear_pending_monitor_events(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; + LDKCVec_MonitorEventZ ret_var = ChannelMonitor_get_and_clear_pending_monitor_events(&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 o = 0; o < ret_var.datalen; o++) { + LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_conv_14_copy = ret_var.data[o]; + int64_t ret_conv_14_ref = tag_ptr(ret_conv_14_copy, true); + ret_arr_ptr[o] = ret_conv_14_ref; + } + + FREE(ret_var.data); + return ret_arr; +} + +void 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); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + void* handler_ptr = untag_ptr(handler); + if (ptr_is_owned(handler)) { CHECK_ACCESS(handler_ptr); } + LDKEventHandler* handler_conv = (LDKEventHandler*)handler_ptr; + ChannelMonitor_process_pending_events(&this_arg_conv, handler_conv); +} + +int64_t CS_LDK_ChannelMonitor_initial_counterparty_commitment_tx(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; + LDKCommitmentTransaction ret_var = ChannelMonitor_initial_counterparty_commitment_tx(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int64_tArray CS_LDK_ChannelMonitor_counterparty_commitment_txs_from_update(int64_t this_arg, int64_t update) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelMonitorUpdate update_conv; + update_conv.inner = untag_ptr(update); + update_conv.is_owned = ptr_is_owned(update); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv); + update_conv.is_owned = false; + LDKCVec_CommitmentTransactionZ ret_var = ChannelMonitor_counterparty_commitment_txs_from_update(&this_arg_conv, &update_conv); + 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++) { + LDKCommitmentTransaction ret_conv_23_var = ret_var.data[x]; + int64_t ret_conv_23_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_23_var); + ret_conv_23_ref = tag_ptr(ret_conv_23_var.inner, ret_conv_23_var.is_owned); + ret_arr_ptr[x] = ret_conv_23_ref; + } + + FREE(ret_var.data); + return ret_arr; +} + +int64_t CS_LDK_ChannelMonitor_sign_to_local_justice_tx(int64_t this_arg, int8_tArray justice_tx, int64_t input_idx, int64_t value, int64_t commitment_number) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKTransaction justice_tx_ref; + justice_tx_ref.datalen = justice_tx->arr_len; + justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes"); + memcpy(justice_tx_ref.data, justice_tx->elems, justice_tx_ref.datalen); FREE(justice_tx); + justice_tx_ref.data_is_owned = true; + LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); + *ret_conv = ChannelMonitor_sign_to_local_justice_tx(&this_arg_conv, justice_tx_ref, input_idx, value, commitment_number); + return tag_ptr(ret_conv, true); +} + +int8_tArray CS_LDK_ChannelMonitor_get_counterparty_node_id(int64_t this_arg) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, ChannelMonitor_get_counterparty_node_id(&this_arg_conv).compressed_form, 33); + return ret_arr; +} + +void CS_LDK_ChannelMonitor_broadcast_latest_holder_commitment_txn(int64_t this_arg, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + void* broadcaster_ptr = untag_ptr(broadcaster); + if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); } + LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; + void* fee_estimator_ptr = untag_ptr(fee_estimator); + if (ptr_is_owned(fee_estimator)) { CHECK_ACCESS(fee_estimator_ptr); } + LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; + void* logger_ptr = untag_ptr(logger); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + ChannelMonitor_broadcast_latest_holder_commitment_txn(&this_arg_conv, broadcaster_conv, fee_estimator_conv, logger_conv); +} + +int64_tArray CS_LDK_ChannelMonitor_block_connected(int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + uint8_t header_arr[80]; + CHECK(header->arr_len == 80); + memcpy(header_arr, header->elems, 80); FREE(header); + uint8_t (*header_ref)[80] = &header_arr; + LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr; + txdata_constr.datalen = txdata->arr_len; + if (txdata_constr.datalen > 0) + txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); + else + txdata_constr.data = NULL; + int64_t* txdata_vals = txdata->elems; + for (size_t c = 0; c < txdata_constr.datalen; c++) { + int64_t txdata_conv_28 = txdata_vals[c]; + void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28); + CHECK_ACCESS(txdata_conv_28_ptr); + LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr); + txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28)); + txdata_constr.data[c] = txdata_conv_28_conv; + } + FREE(txdata); + void* broadcaster_ptr = untag_ptr(broadcaster); + CHECK_ACCESS(broadcaster_ptr); + LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); + if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); + } + void* fee_estimator_ptr = untag_ptr(fee_estimator); + CHECK_ACCESS(fee_estimator_ptr); + LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); + if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); + } + void* logger_ptr = untag_ptr(logger); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_block_connected(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t x = 0; x < ret_var.datalen; x++) { + LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ* ret_conv_49_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ"); + *ret_conv_49_conv = ret_var.data[x]; + ret_arr_ptr[x] = tag_ptr(ret_conv_49_conv, true); + } + + FREE(ret_var.data); + return ret_arr; +} + +void CS_LDK_ChannelMonitor_block_disconnected(int64_t this_arg, int8_tArray header, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + uint8_t header_arr[80]; + CHECK(header->arr_len == 80); + memcpy(header_arr, header->elems, 80); FREE(header); + uint8_t (*header_ref)[80] = &header_arr; + void* broadcaster_ptr = untag_ptr(broadcaster); + CHECK_ACCESS(broadcaster_ptr); + LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); + if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); + } + void* fee_estimator_ptr = untag_ptr(fee_estimator); + CHECK_ACCESS(fee_estimator_ptr); + LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); + if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); + } + void* logger_ptr = untag_ptr(logger); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + ChannelMonitor_block_disconnected(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv); +} + +int64_tArray CS_LDK_ChannelMonitor_transactions_confirmed(int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + uint8_t header_arr[80]; + CHECK(header->arr_len == 80); + memcpy(header_arr, header->elems, 80); FREE(header); + uint8_t (*header_ref)[80] = &header_arr; + LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr; + txdata_constr.datalen = txdata->arr_len; + if (txdata_constr.datalen > 0) + txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); + else + txdata_constr.data = NULL; + int64_t* txdata_vals = txdata->elems; + for (size_t c = 0; c < txdata_constr.datalen; c++) { + int64_t txdata_conv_28 = txdata_vals[c]; + void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28); + CHECK_ACCESS(txdata_conv_28_ptr); + LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr); + txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28)); + txdata_constr.data[c] = txdata_conv_28_conv; + } + FREE(txdata); + void* broadcaster_ptr = untag_ptr(broadcaster); + CHECK_ACCESS(broadcaster_ptr); + LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); + if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); + } + void* fee_estimator_ptr = untag_ptr(fee_estimator); + CHECK_ACCESS(fee_estimator_ptr); + LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); + if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); + } + void* logger_ptr = untag_ptr(logger); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_transactions_confirmed(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t x = 0; x < ret_var.datalen; x++) { + LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ* ret_conv_49_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ"); + *ret_conv_49_conv = ret_var.data[x]; + ret_arr_ptr[x] = tag_ptr(ret_conv_49_conv, true); + } + + FREE(ret_var.data); + return ret_arr; +} + +void CS_LDK_ChannelMonitor_transaction_unconfirmed(int64_t this_arg, int8_tArray txid, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + uint8_t txid_arr[32]; + CHECK(txid->arr_len == 32); + memcpy(txid_arr, txid->elems, 32); FREE(txid); + uint8_t (*txid_ref)[32] = &txid_arr; + void* broadcaster_ptr = untag_ptr(broadcaster); + CHECK_ACCESS(broadcaster_ptr); + LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); + if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); + } + void* fee_estimator_ptr = untag_ptr(fee_estimator); + CHECK_ACCESS(fee_estimator_ptr); + LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); + if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); + } + void* logger_ptr = untag_ptr(logger); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + ChannelMonitor_transaction_unconfirmed(&this_arg_conv, txid_ref, broadcaster_conv, fee_estimator_conv, logger_conv); +} + +int64_tArray CS_LDK_ChannelMonitor_best_block_updated(int64_t this_arg, int8_tArray header, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + uint8_t header_arr[80]; + CHECK(header->arr_len == 80); + memcpy(header_arr, header->elems, 80); FREE(header); + uint8_t (*header_ref)[80] = &header_arr; + void* broadcaster_ptr = untag_ptr(broadcaster); + CHECK_ACCESS(broadcaster_ptr); + LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); + if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); + } + void* fee_estimator_ptr = untag_ptr(fee_estimator); + CHECK_ACCESS(fee_estimator_ptr); + LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); + if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); + } + void* logger_ptr = untag_ptr(logger); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_best_block_updated(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t x = 0; x < ret_var.datalen; x++) { + LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ* ret_conv_49_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ"); + *ret_conv_49_conv = ret_var.data[x]; + ret_arr_ptr[x] = tag_ptr(ret_conv_49_conv, true); + } + + FREE(ret_var.data); + return ret_arr; +} + +int64_tArray CS_LDK_ChannelMonitor_get_relevant_txids(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; + LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ ret_var = ChannelMonitor_get_relevant_txids(&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 c = 0; c < ret_var.datalen; c++) { + LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ* ret_conv_54_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ), "LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ"); + *ret_conv_54_conv = ret_var.data[c]; + ret_arr_ptr[c] = tag_ptr(ret_conv_54_conv, true); + } + + FREE(ret_var.data); + return ret_arr; +} + +int64_t CS_LDK_ChannelMonitor_current_best_block(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; + LDKBestBlock ret_var = ChannelMonitor_current_best_block(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +void CS_LDK_ChannelMonitor_rebroadcast_pending_claims(int64_t this_arg, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + void* broadcaster_ptr = untag_ptr(broadcaster); + CHECK_ACCESS(broadcaster_ptr); + LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); + if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); + } + void* fee_estimator_ptr = untag_ptr(fee_estimator); + CHECK_ACCESS(fee_estimator_ptr); + LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); + if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); + } + void* logger_ptr = untag_ptr(logger); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + ChannelMonitor_rebroadcast_pending_claims(&this_arg_conv, broadcaster_conv, fee_estimator_conv, logger_conv); +} + +void CS_LDK_ChannelMonitor_signer_unblocked(int64_t this_arg, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + void* broadcaster_ptr = untag_ptr(broadcaster); + CHECK_ACCESS(broadcaster_ptr); + LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); + if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); + } + void* fee_estimator_ptr = untag_ptr(fee_estimator); + CHECK_ACCESS(fee_estimator_ptr); + LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); + if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); + } + void* logger_ptr = untag_ptr(logger); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + ChannelMonitor_signer_unblocked(&this_arg_conv, broadcaster_conv, fee_estimator_conv, logger_conv); +} + +int64_tArray CS_LDK_ChannelMonitor_get_spendable_outputs(int64_t this_arg, int8_tArray tx, int32_t confirmation_height) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKTransaction tx_ref; + tx_ref.datalen = tx->arr_len; + tx_ref.data = MALLOC(tx_ref.datalen, "LDKTransaction Bytes"); + memcpy(tx_ref.data, tx->elems, tx_ref.datalen); FREE(tx); + tx_ref.data_is_owned = true; + LDKCVec_SpendableOutputDescriptorZ ret_var = ChannelMonitor_get_spendable_outputs(&this_arg_conv, tx_ref, confirmation_height); + 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 b = 0; b < ret_var.datalen; b++) { + LDKSpendableOutputDescriptor *ret_conv_27_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_conv_27_copy = ret_var.data[b]; + int64_t ret_conv_27_ref = tag_ptr(ret_conv_27_copy, true); + ret_arr_ptr[b] = ret_conv_27_ref; + } + + FREE(ret_var.data); + return ret_arr; +} + +jboolean CS_LDK_ChannelMonitor_is_fully_resolved(int64_t this_arg, int64_t logger) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + void* logger_ptr = untag_ptr(logger); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + jboolean ret_conv = ChannelMonitor_is_fully_resolved(&this_arg_conv, logger_conv); + return ret_conv; +} + +int64_tArray CS_LDK_ChannelMonitor_get_claimable_balances(int64_t this_arg) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_BalanceZ ret_var = ChannelMonitor_get_claimable_balances(&this_arg_conv); + 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 j = 0; j < ret_var.datalen; j++) { + LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_conv_9_copy = ret_var.data[j]; + int64_t ret_conv_9_ref = tag_ptr(ret_conv_9_copy, true); + ret_arr_ptr[j] = ret_conv_9_ref; + } + + FREE(ret_var.data); + return ret_arr; +} + +int64_t CS_LDK_C2Tuple_ThirtyTwoBytesChannelMonitorZ_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_a_ptr = untag_ptr(arg_a); + if (ptr_is_owned(arg_a)) { CHECK_ACCESS(arg_a_ptr); } + LDKEntropySource* arg_a_conv = (LDKEntropySource*)arg_a_ptr; + void* arg_b_ptr = untag_ptr(arg_b); + if (ptr_is_owned(arg_b)) { CHECK_ACCESS(arg_b_ptr); } + LDKSignerProvider* arg_b_conv = (LDKSignerProvider*)arg_b_ptr; + LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ"); + *ret_conv = C2Tuple_ThirtyTwoBytesChannelMonitorZ_read(ser_ref, arg_a_conv, arg_b_conv); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_OutPoint_free(int64_t this_obj) { + LDKOutPoint this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OutPoint_free(this_obj_conv); +} + +int8_tArray CS_LDK_OutPoint_get_txid(int64_t this_ptr) { + LDKOutPoint this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *OutPoint_get_txid(&this_ptr_conv), 32); + return ret_arr; +} + +void CS_LDK_OutPoint_set_txid(int64_t this_ptr, int8_tArray val) { + LDKOutPoint this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + OutPoint_set_txid(&this_ptr_conv, val_ref); +} + +int16_t CS_LDK_OutPoint_get_index(int64_t this_ptr) { + LDKOutPoint this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int16_t ret_conv = OutPoint_get_index(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_OutPoint_set_index(int64_t this_ptr, int16_t val) { + LDKOutPoint this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + OutPoint_set_index(&this_ptr_conv, val); +} + +int64_t CS_LDK_OutPoint_new(int8_tArray txid_arg, int16_t index_arg) { + LDKThirtyTwoBytes txid_arg_ref; + CHECK(txid_arg->arr_len == 32); + memcpy(txid_arg_ref.data, txid_arg->elems, 32); FREE(txid_arg); + LDKOutPoint ret_var = OutPoint_new(txid_arg_ref, index_arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t OutPoint_clone_ptr(LDKOutPoint *NONNULL_PTR arg) { + LDKOutPoint ret_var = OutPoint_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_OutPoint_clone_ptr(int64_t arg) { + LDKOutPoint arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = OutPoint_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_OutPoint_clone(int64_t orig) { + LDKOutPoint orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKOutPoint ret_var = OutPoint_clone(&orig_conv); + int64_t ret_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_OutPoint_eq(int64_t a, int64_t b) { + LDKOutPoint a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKOutPoint b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = OutPoint_eq(&a_conv, &b_conv); + return ret_conv; +} + +int64_t CS_LDK_OutPoint_hash(int64_t o) { + LDKOutPoint o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = OutPoint_hash(&o_conv); + return ret_conv; +} + +jstring CS_LDK_OutPoint_to_str(int64_t o) { + LDKOutPoint o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = OutPoint_to_str(&o_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +int8_tArray CS_LDK_OutPoint_write(int64_t obj) { + LDKOutPoint obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = OutPoint_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_OutPoint_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); + *ret_conv = OutPoint_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_InboundHTLCErr_free(int64_t this_obj) { + LDKInboundHTLCErr this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InboundHTLCErr_free(this_obj_conv); +} + +int16_t CS_LDK_InboundHTLCErr_get_err_code(int64_t this_ptr) { + LDKInboundHTLCErr this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int16_t ret_conv = InboundHTLCErr_get_err_code(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_InboundHTLCErr_set_err_code(int64_t this_ptr, int16_t val) { + LDKInboundHTLCErr this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + InboundHTLCErr_set_err_code(&this_ptr_conv, val); +} + +int8_tArray CS_LDK_InboundHTLCErr_get_err_data(int64_t this_ptr) { + LDKInboundHTLCErr this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u8Z ret_var = InboundHTLCErr_get_err_data(&this_ptr_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +void CS_LDK_InboundHTLCErr_set_err_data(int64_t this_ptr, int8_tArray val) { + LDKInboundHTLCErr this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u8Z val_ref; + val_ref.datalen = val->arr_len; + val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val); + InboundHTLCErr_set_err_data(&this_ptr_conv, val_ref); +} + +jstring CS_LDK_InboundHTLCErr_get_msg(int64_t this_ptr) { + LDKInboundHTLCErr this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKStr ret_str = InboundHTLCErr_get_msg(&this_ptr_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +void CS_LDK_InboundHTLCErr_set_msg(int64_t this_ptr, jstring val) { + LDKInboundHTLCErr this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKStr val_conv = str_ref_to_owned_c(val); + InboundHTLCErr_set_msg(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_InboundHTLCErr_new(int16_t err_code_arg, int8_tArray err_data_arg, jstring msg_arg) { + LDKCVec_u8Z err_data_arg_ref; + err_data_arg_ref.datalen = err_data_arg->arr_len; + err_data_arg_ref.data = MALLOC(err_data_arg_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(err_data_arg_ref.data, err_data_arg->elems, err_data_arg_ref.datalen); FREE(err_data_arg); + LDKStr msg_arg_conv = str_ref_to_owned_c(msg_arg); + LDKInboundHTLCErr ret_var = InboundHTLCErr_new(err_code_arg, err_data_arg_ref, msg_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t InboundHTLCErr_clone_ptr(LDKInboundHTLCErr *NONNULL_PTR arg) { + LDKInboundHTLCErr ret_var = InboundHTLCErr_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_InboundHTLCErr_clone_ptr(int64_t arg) { + LDKInboundHTLCErr arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = InboundHTLCErr_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_InboundHTLCErr_clone(int64_t orig) { + LDKInboundHTLCErr orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKInboundHTLCErr ret_var = InboundHTLCErr_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int64_t CS_LDK_InboundHTLCErr_hash(int64_t o) { + LDKInboundHTLCErr o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = InboundHTLCErr_hash(&o_conv); + return ret_conv; +} + +jboolean CS_LDK_InboundHTLCErr_eq(int64_t a, int64_t b) { + LDKInboundHTLCErr a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKInboundHTLCErr b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = InboundHTLCErr_eq(&a_conv, &b_conv); + return ret_conv; +} + +int64_t CS_LDK_peel_payment_onion(int64_t msg, int64_t node_signer, int64_t logger, int32_t cur_height, jboolean accept_mpp_keysend, jboolean allow_skimmed_fees) { + LDKUpdateAddHTLC msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + void* node_signer_ptr = untag_ptr(node_signer); + if (ptr_is_owned(node_signer)) { CHECK_ACCESS(node_signer_ptr); } + LDKNodeSigner* node_signer_conv = (LDKNodeSigner*)node_signer_ptr; + void* logger_ptr = untag_ptr(logger); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + LDKCResult_PendingHTLCInfoInboundHTLCErrZ* ret_conv = MALLOC(sizeof(LDKCResult_PendingHTLCInfoInboundHTLCErrZ), "LDKCResult_PendingHTLCInfoInboundHTLCErrZ"); + *ret_conv = peel_payment_onion(&msg_conv, node_signer_conv, logger_conv, cur_height, accept_mpp_keysend, allow_skimmed_fees); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_PendingHTLCRouting_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); + LDKPendingHTLCRouting this_ptr_conv = *(LDKPendingHTLCRouting*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + PendingHTLCRouting_free(this_ptr_conv); +} + +static inline uint64_t PendingHTLCRouting_clone_ptr(LDKPendingHTLCRouting *NONNULL_PTR arg) { + LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); + *ret_copy = PendingHTLCRouting_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_PendingHTLCRouting_clone_ptr(int64_t arg) { + LDKPendingHTLCRouting* arg_conv = (LDKPendingHTLCRouting*)untag_ptr(arg); + int64_t ret_conv = PendingHTLCRouting_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_PendingHTLCRouting_clone(int64_t orig) { + LDKPendingHTLCRouting* orig_conv = (LDKPendingHTLCRouting*)untag_ptr(orig); + LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); + *ret_copy = PendingHTLCRouting_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_PendingHTLCRouting_forward(int64_t onion_packet, int64_t short_channel_id, int64_t blinded) { + LDKOnionPacket onion_packet_conv; + onion_packet_conv.inner = untag_ptr(onion_packet); + onion_packet_conv.is_owned = ptr_is_owned(onion_packet); + CHECK_INNER_FIELD_ACCESS_OR_NULL(onion_packet_conv); + onion_packet_conv = OnionPacket_clone(&onion_packet_conv); + LDKBlindedForward blinded_conv; + blinded_conv.inner = untag_ptr(blinded); + blinded_conv.is_owned = ptr_is_owned(blinded); + CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_conv); + blinded_conv = BlindedForward_clone(&blinded_conv); + LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); + *ret_copy = PendingHTLCRouting_forward(onion_packet_conv, short_channel_id, blinded_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_PendingHTLCRouting_receive(int64_t payment_data, int64_t payment_metadata, int64_t payment_context, int32_t incoming_cltv_expiry, int8_tArray phantom_shared_secret, int64_tArray custom_tlvs, jboolean requires_blinded_error) { + LDKFinalOnionHopData payment_data_conv; + payment_data_conv.inner = untag_ptr(payment_data); + payment_data_conv.is_owned = ptr_is_owned(payment_data); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_data_conv); + payment_data_conv = FinalOnionHopData_clone(&payment_data_conv); + void* payment_metadata_ptr = untag_ptr(payment_metadata); + CHECK_ACCESS(payment_metadata_ptr); + LDKCOption_CVec_u8ZZ payment_metadata_conv = *(LDKCOption_CVec_u8ZZ*)(payment_metadata_ptr); + payment_metadata_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(payment_metadata)); + void* payment_context_ptr = untag_ptr(payment_context); + CHECK_ACCESS(payment_context_ptr); + LDKCOption_PaymentContextZ payment_context_conv = *(LDKCOption_PaymentContextZ*)(payment_context_ptr); + payment_context_conv = COption_PaymentContextZ_clone((LDKCOption_PaymentContextZ*)untag_ptr(payment_context)); + LDKThirtyTwoBytes phantom_shared_secret_ref; + CHECK(phantom_shared_secret->arr_len == 32); + memcpy(phantom_shared_secret_ref.data, phantom_shared_secret->elems, 32); FREE(phantom_shared_secret); + LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs_constr; + custom_tlvs_constr.datalen = custom_tlvs->arr_len; + if (custom_tlvs_constr.datalen > 0) + custom_tlvs_constr.data = MALLOC(custom_tlvs_constr.datalen * sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKCVec_C2Tuple_u64CVec_u8ZZZ Elements"); + else + custom_tlvs_constr.data = NULL; + 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); + LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); + *ret_copy = PendingHTLCRouting_receive(payment_data_conv, payment_metadata_conv, payment_context_conv, incoming_cltv_expiry, phantom_shared_secret_ref, custom_tlvs_constr, requires_blinded_error); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_PendingHTLCRouting_receive_keysend(int64_t payment_data, int8_tArray payment_preimage, int64_t payment_metadata, int32_t incoming_cltv_expiry, int64_tArray custom_tlvs, jboolean requires_blinded_error) { + LDKFinalOnionHopData payment_data_conv; + payment_data_conv.inner = untag_ptr(payment_data); + payment_data_conv.is_owned = ptr_is_owned(payment_data); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_data_conv); + payment_data_conv = FinalOnionHopData_clone(&payment_data_conv); + LDKThirtyTwoBytes payment_preimage_ref; + CHECK(payment_preimage->arr_len == 32); + memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); + void* payment_metadata_ptr = untag_ptr(payment_metadata); + CHECK_ACCESS(payment_metadata_ptr); + LDKCOption_CVec_u8ZZ payment_metadata_conv = *(LDKCOption_CVec_u8ZZ*)(payment_metadata_ptr); + payment_metadata_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(payment_metadata)); + LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs_constr; + custom_tlvs_constr.datalen = custom_tlvs->arr_len; + if (custom_tlvs_constr.datalen > 0) + custom_tlvs_constr.data = MALLOC(custom_tlvs_constr.datalen * sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKCVec_C2Tuple_u64CVec_u8ZZZ Elements"); + else + custom_tlvs_constr.data = NULL; + 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); + LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); + *ret_copy = PendingHTLCRouting_receive_keysend(payment_data_conv, payment_preimage_ref, payment_metadata_conv, incoming_cltv_expiry, custom_tlvs_constr, requires_blinded_error); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_BlindedForward_free(int64_t this_obj) { + LDKBlindedForward this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + BlindedForward_free(this_obj_conv); +} + +int8_tArray CS_LDK_BlindedForward_get_inbound_blinding_point(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_inbound_blinding_point(&this_ptr_conv).compressed_form, 33); + return ret_arr; +} + +void CS_LDK_BlindedForward_set_inbound_blinding_point(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_inbound_blinding_point(&this_ptr_conv, val_ref); +} + +int32_t CS_LDK_BlindedForward_get_failure(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; + int32_t ret_conv = LDKBlindedFailure_to_cs(BlindedForward_get_failure(&this_ptr_conv)); + return ret_conv; +} + +void CS_LDK_BlindedForward_set_failure(int64_t this_ptr, int32_t val) { + LDKBlindedForward this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBlindedFailure val_conv = LDKBlindedFailure_from_cs(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) { + 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); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t BlindedForward_clone_ptr(LDKBlindedForward *NONNULL_PTR arg) { + LDKBlindedForward ret_var = BlindedForward_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_BlindedForward_clone_ptr(int64_t arg) { + LDKBlindedForward arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = BlindedForward_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_BlindedForward_clone(int64_t orig) { + LDKBlindedForward orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKBlindedForward ret_var = BlindedForward_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int64_t CS_LDK_BlindedForward_hash(int64_t o) { + LDKBlindedForward o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = BlindedForward_hash(&o_conv); + return ret_conv; +} + +jboolean CS_LDK_BlindedForward_eq(int64_t a, int64_t b) { + LDKBlindedForward a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); @@ -40559,1632 +41136,2908 @@ jboolean CS_LDK_BlindedForward_eq(int64_t a, int64_t b) { return ret_conv; } -void CS_LDK_PendingHTLCInfo_free(int64_t this_obj) { - LDKPendingHTLCInfo this_obj_conv; +void CS_LDK_PendingHTLCInfo_free(int64_t this_obj) { + LDKPendingHTLCInfo this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + PendingHTLCInfo_free(this_obj_conv); +} + +int64_t CS_LDK_PendingHTLCInfo_get_routing(int64_t this_ptr) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); + *ret_copy = PendingHTLCInfo_get_routing(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_PendingHTLCInfo_set_routing(int64_t this_ptr, int64_t val) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKPendingHTLCRouting val_conv = *(LDKPendingHTLCRouting*)(val_ptr); + val_conv = PendingHTLCRouting_clone((LDKPendingHTLCRouting*)untag_ptr(val)); + PendingHTLCInfo_set_routing(&this_ptr_conv, val_conv); +} + +int8_tArray CS_LDK_PendingHTLCInfo_get_incoming_shared_secret(int64_t this_ptr) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *PendingHTLCInfo_get_incoming_shared_secret(&this_ptr_conv), 32); + return ret_arr; +} + +void CS_LDK_PendingHTLCInfo_set_incoming_shared_secret(int64_t this_ptr, int8_tArray val) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + PendingHTLCInfo_set_incoming_shared_secret(&this_ptr_conv, val_ref); +} + +int8_tArray CS_LDK_PendingHTLCInfo_get_payment_hash(int64_t this_ptr) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *PendingHTLCInfo_get_payment_hash(&this_ptr_conv), 32); + return ret_arr; +} + +void CS_LDK_PendingHTLCInfo_set_payment_hash(int64_t this_ptr, int8_tArray val) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + PendingHTLCInfo_set_payment_hash(&this_ptr_conv, val_ref); +} + +int64_t CS_LDK_PendingHTLCInfo_get_incoming_amt_msat(int64_t this_ptr) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = PendingHTLCInfo_get_incoming_amt_msat(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_PendingHTLCInfo_set_incoming_amt_msat(int64_t this_ptr, int64_t val) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + PendingHTLCInfo_set_incoming_amt_msat(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_PendingHTLCInfo_get_outgoing_amt_msat(int64_t this_ptr) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = PendingHTLCInfo_get_outgoing_amt_msat(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_PendingHTLCInfo_set_outgoing_amt_msat(int64_t this_ptr, int64_t val) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + PendingHTLCInfo_set_outgoing_amt_msat(&this_ptr_conv, val); +} + +int32_t CS_LDK_PendingHTLCInfo_get_outgoing_cltv_value(int64_t this_ptr) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = PendingHTLCInfo_get_outgoing_cltv_value(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_PendingHTLCInfo_set_outgoing_cltv_value(int64_t this_ptr, int32_t val) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + PendingHTLCInfo_set_outgoing_cltv_value(&this_ptr_conv, val); +} + +int64_t CS_LDK_PendingHTLCInfo_get_skimmed_fee_msat(int64_t this_ptr) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = PendingHTLCInfo_get_skimmed_fee_msat(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_PendingHTLCInfo_set_skimmed_fee_msat(int64_t this_ptr, int64_t val) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + PendingHTLCInfo_set_skimmed_fee_msat(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_PendingHTLCInfo_new(int64_t routing_arg, int8_tArray incoming_shared_secret_arg, int8_tArray payment_hash_arg, int64_t incoming_amt_msat_arg, int64_t outgoing_amt_msat_arg, int32_t outgoing_cltv_value_arg, int64_t skimmed_fee_msat_arg) { + void* routing_arg_ptr = untag_ptr(routing_arg); + CHECK_ACCESS(routing_arg_ptr); + LDKPendingHTLCRouting routing_arg_conv = *(LDKPendingHTLCRouting*)(routing_arg_ptr); + routing_arg_conv = PendingHTLCRouting_clone((LDKPendingHTLCRouting*)untag_ptr(routing_arg)); + LDKThirtyTwoBytes incoming_shared_secret_arg_ref; + CHECK(incoming_shared_secret_arg->arr_len == 32); + memcpy(incoming_shared_secret_arg_ref.data, incoming_shared_secret_arg->elems, 32); FREE(incoming_shared_secret_arg); + LDKThirtyTwoBytes payment_hash_arg_ref; + CHECK(payment_hash_arg->arr_len == 32); + memcpy(payment_hash_arg_ref.data, payment_hash_arg->elems, 32); FREE(payment_hash_arg); + void* incoming_amt_msat_arg_ptr = untag_ptr(incoming_amt_msat_arg); + CHECK_ACCESS(incoming_amt_msat_arg_ptr); + LDKCOption_u64Z incoming_amt_msat_arg_conv = *(LDKCOption_u64Z*)(incoming_amt_msat_arg_ptr); + incoming_amt_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(incoming_amt_msat_arg)); + void* skimmed_fee_msat_arg_ptr = untag_ptr(skimmed_fee_msat_arg); + CHECK_ACCESS(skimmed_fee_msat_arg_ptr); + LDKCOption_u64Z skimmed_fee_msat_arg_conv = *(LDKCOption_u64Z*)(skimmed_fee_msat_arg_ptr); + skimmed_fee_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(skimmed_fee_msat_arg)); + LDKPendingHTLCInfo ret_var = PendingHTLCInfo_new(routing_arg_conv, incoming_shared_secret_arg_ref, payment_hash_arg_ref, incoming_amt_msat_arg_conv, outgoing_amt_msat_arg, outgoing_cltv_value_arg, skimmed_fee_msat_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t PendingHTLCInfo_clone_ptr(LDKPendingHTLCInfo *NONNULL_PTR arg) { + LDKPendingHTLCInfo ret_var = PendingHTLCInfo_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_PendingHTLCInfo_clone_ptr(int64_t arg) { + LDKPendingHTLCInfo arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = PendingHTLCInfo_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_PendingHTLCInfo_clone(int64_t orig) { + LDKPendingHTLCInfo orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKPendingHTLCInfo ret_var = PendingHTLCInfo_clone(&orig_conv); + int64_t ret_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_BlindedFailure_clone(int64_t orig) { + LDKBlindedFailure* orig_conv = (LDKBlindedFailure*)untag_ptr(orig); + int32_t ret_conv = LDKBlindedFailure_to_cs(BlindedFailure_clone(orig_conv)); + return ret_conv; +} + +int32_t CS_LDK_BlindedFailure_from_introduction_node() { + int32_t ret_conv = LDKBlindedFailure_to_cs(BlindedFailure_from_introduction_node()); + return ret_conv; +} + +int32_t CS_LDK_BlindedFailure_from_blinded_node() { + int32_t ret_conv = LDKBlindedFailure_to_cs(BlindedFailure_from_blinded_node()); + return ret_conv; +} + +int64_t CS_LDK_BlindedFailure_hash(int64_t o) { + LDKBlindedFailure* o_conv = (LDKBlindedFailure*)untag_ptr(o); + int64_t ret_conv = BlindedFailure_hash(o_conv); + return ret_conv; +} + +jboolean CS_LDK_BlindedFailure_eq(int64_t a, int64_t b) { + LDKBlindedFailure* a_conv = (LDKBlindedFailure*)untag_ptr(a); + LDKBlindedFailure* b_conv = (LDKBlindedFailure*)untag_ptr(b); + jboolean ret_conv = BlindedFailure_eq(a_conv, b_conv); + return ret_conv; +} + +void CS_LDK_FailureCode_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); + LDKFailureCode this_ptr_conv = *(LDKFailureCode*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + FailureCode_free(this_ptr_conv); +} + +static inline uint64_t FailureCode_clone_ptr(LDKFailureCode *NONNULL_PTR arg) { + LDKFailureCode *ret_copy = MALLOC(sizeof(LDKFailureCode), "LDKFailureCode"); + *ret_copy = FailureCode_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_FailureCode_clone_ptr(int64_t arg) { + LDKFailureCode* arg_conv = (LDKFailureCode*)untag_ptr(arg); + int64_t ret_conv = FailureCode_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_FailureCode_clone(int64_t orig) { + LDKFailureCode* orig_conv = (LDKFailureCode*)untag_ptr(orig); + LDKFailureCode *ret_copy = MALLOC(sizeof(LDKFailureCode), "LDKFailureCode"); + *ret_copy = FailureCode_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_FailureCode_temporary_node_failure() { + LDKFailureCode *ret_copy = MALLOC(sizeof(LDKFailureCode), "LDKFailureCode"); + *ret_copy = FailureCode_temporary_node_failure(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_FailureCode_required_node_feature_missing() { + LDKFailureCode *ret_copy = MALLOC(sizeof(LDKFailureCode), "LDKFailureCode"); + *ret_copy = FailureCode_required_node_feature_missing(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_FailureCode_incorrect_or_unknown_payment_details() { + LDKFailureCode *ret_copy = MALLOC(sizeof(LDKFailureCode), "LDKFailureCode"); + *ret_copy = FailureCode_incorrect_or_unknown_payment_details(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_FailureCode_invalid_onion_payload(int64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKCOption_C2Tuple_u64u16ZZ a_conv = *(LDKCOption_C2Tuple_u64u16ZZ*)(a_ptr); + a_conv = COption_C2Tuple_u64u16ZZ_clone((LDKCOption_C2Tuple_u64u16ZZ*)untag_ptr(a)); + LDKFailureCode *ret_copy = MALLOC(sizeof(LDKFailureCode), "LDKFailureCode"); + *ret_copy = FailureCode_invalid_onion_payload(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_ChannelManager_free(int64_t this_obj) { + LDKChannelManager this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PendingHTLCInfo_free(this_obj_conv); + ChannelManager_free(this_obj_conv); } -int64_t CS_LDK_PendingHTLCInfo_get_routing(int64_t this_ptr) { - LDKPendingHTLCInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); - *ret_copy = PendingHTLCInfo_get_routing(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_ChainParameters_free(int64_t this_obj) { + LDKChainParameters this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChainParameters_free(this_obj_conv); } -void CS_LDK_PendingHTLCInfo_set_routing(int64_t this_ptr, int64_t val) { - LDKPendingHTLCInfo this_ptr_conv; +int32_t CS_LDK_ChainParameters_get_network(int64_t this_ptr) { + LDKChainParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKPendingHTLCRouting val_conv = *(LDKPendingHTLCRouting*)(val_ptr); - val_conv = PendingHTLCRouting_clone((LDKPendingHTLCRouting*)untag_ptr(val)); - PendingHTLCInfo_set_routing(&this_ptr_conv, val_conv); + int32_t ret_conv = LDKNetwork_to_cs(ChainParameters_get_network(&this_ptr_conv)); + return ret_conv; } -int8_tArray CS_LDK_PendingHTLCInfo_get_incoming_shared_secret(int64_t this_ptr) { - LDKPendingHTLCInfo this_ptr_conv; +void CS_LDK_ChainParameters_set_network(int64_t this_ptr, int32_t val) { + LDKChainParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *PendingHTLCInfo_get_incoming_shared_secret(&this_ptr_conv), 32); - return ret_arr; + LDKNetwork val_conv = LDKNetwork_from_cs(val); + ChainParameters_set_network(&this_ptr_conv, val_conv); } -void CS_LDK_PendingHTLCInfo_set_incoming_shared_secret(int64_t this_ptr, int8_tArray val) { - LDKPendingHTLCInfo this_ptr_conv; +int64_t CS_LDK_ChainParameters_get_best_block(int64_t this_ptr) { + LDKChainParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - PendingHTLCInfo_set_incoming_shared_secret(&this_ptr_conv, val_ref); + LDKBestBlock ret_var = ChainParameters_get_best_block(&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_PendingHTLCInfo_get_payment_hash(int64_t this_ptr) { - LDKPendingHTLCInfo this_ptr_conv; +void CS_LDK_ChainParameters_set_best_block(int64_t this_ptr, int64_t val) { + LDKChainParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *PendingHTLCInfo_get_payment_hash(&this_ptr_conv), 32); - return ret_arr; + LDKBestBlock val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = BestBlock_clone(&val_conv); + ChainParameters_set_best_block(&this_ptr_conv, val_conv); } -void CS_LDK_PendingHTLCInfo_set_payment_hash(int64_t this_ptr, int8_tArray val) { - LDKPendingHTLCInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - PendingHTLCInfo_set_payment_hash(&this_ptr_conv, val_ref); +int64_t CS_LDK_ChainParameters_new(int32_t network_arg, int64_t best_block_arg) { + LDKNetwork network_arg_conv = LDKNetwork_from_cs(network_arg); + LDKBestBlock best_block_arg_conv; + best_block_arg_conv.inner = untag_ptr(best_block_arg); + best_block_arg_conv.is_owned = ptr_is_owned(best_block_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(best_block_arg_conv); + best_block_arg_conv = BestBlock_clone(&best_block_arg_conv); + LDKChainParameters ret_var = ChainParameters_new(network_arg_conv, best_block_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -int64_t CS_LDK_PendingHTLCInfo_get_incoming_amt_msat(int64_t this_ptr) { - LDKPendingHTLCInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = PendingHTLCInfo_get_incoming_amt_msat(&this_ptr_conv); +static inline uint64_t ChainParameters_clone_ptr(LDKChainParameters *NONNULL_PTR arg) { + LDKChainParameters ret_var = ChainParameters_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_ChainParameters_clone_ptr(int64_t arg) { + LDKChainParameters arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = ChainParameters_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_ChainParameters_clone(int64_t orig) { + LDKChainParameters orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKChainParameters ret_var = ChainParameters_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +void CS_LDK_RecentPaymentDetails_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); + LDKRecentPaymentDetails this_ptr_conv = *(LDKRecentPaymentDetails*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + RecentPaymentDetails_free(this_ptr_conv); +} + +static inline uint64_t RecentPaymentDetails_clone_ptr(LDKRecentPaymentDetails *NONNULL_PTR arg) { + LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); + *ret_copy = RecentPaymentDetails_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } +int64_t CS_LDK_RecentPaymentDetails_clone_ptr(int64_t arg) { + LDKRecentPaymentDetails* arg_conv = (LDKRecentPaymentDetails*)untag_ptr(arg); + int64_t ret_conv = RecentPaymentDetails_clone_ptr(arg_conv); + return ret_conv; +} -void CS_LDK_PendingHTLCInfo_set_incoming_amt_msat(int64_t this_ptr, int64_t val) { - LDKPendingHTLCInfo this_ptr_conv; +int64_t CS_LDK_RecentPaymentDetails_clone(int64_t orig) { + LDKRecentPaymentDetails* orig_conv = (LDKRecentPaymentDetails*)untag_ptr(orig); + LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); + *ret_copy = RecentPaymentDetails_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_RecentPaymentDetails_awaiting_invoice(int8_tArray payment_id) { + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); + *ret_copy = RecentPaymentDetails_awaiting_invoice(payment_id_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_RecentPaymentDetails_pending(int8_tArray payment_id, int8_tArray payment_hash, int64_t total_msat) { + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); + *ret_copy = RecentPaymentDetails_pending(payment_id_ref, payment_hash_ref, total_msat); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_RecentPaymentDetails_fulfilled(int8_tArray payment_id, int64_t payment_hash) { + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + void* payment_hash_ptr = untag_ptr(payment_hash); + CHECK_ACCESS(payment_hash_ptr); + LDKCOption_ThirtyTwoBytesZ payment_hash_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_ptr); + payment_hash_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash)); + LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); + *ret_copy = RecentPaymentDetails_fulfilled(payment_id_ref, payment_hash_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_RecentPaymentDetails_abandoned(int8_tArray payment_id, int8_tArray payment_hash) { + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); + *ret_copy = RecentPaymentDetails_abandoned(payment_id_ref, payment_hash_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_PhantomRouteHints_free(int64_t this_obj) { + LDKPhantomRouteHints this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + PhantomRouteHints_free(this_obj_conv); +} + +int64_tArray CS_LDK_PhantomRouteHints_get_channels(int64_t this_ptr) { + LDKPhantomRouteHints this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - PendingHTLCInfo_set_incoming_amt_msat(&this_ptr_conv, val_conv); + LDKCVec_ChannelDetailsZ ret_var = PhantomRouteHints_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 q = 0; q < ret_var.datalen; q++) { + LDKChannelDetails ret_conv_16_var = ret_var.data[q]; + int64_t ret_conv_16_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); + ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned); + ret_arr_ptr[q] = ret_conv_16_ref; + } + + FREE(ret_var.data); + return ret_arr; } -int64_t CS_LDK_PendingHTLCInfo_get_outgoing_amt_msat(int64_t this_ptr) { - LDKPendingHTLCInfo this_ptr_conv; +void CS_LDK_PhantomRouteHints_set_channels(int64_t this_ptr, int64_tArray val) { + LDKPhantomRouteHints this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = PendingHTLCInfo_get_outgoing_amt_msat(&this_ptr_conv); - return ret_conv; + LDKCVec_ChannelDetailsZ val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = val->elems; + for (size_t q = 0; q < val_constr.datalen; q++) { + int64_t val_conv_16 = val_vals[q]; + LDKChannelDetails val_conv_16_conv; + val_conv_16_conv.inner = untag_ptr(val_conv_16); + val_conv_16_conv.is_owned = ptr_is_owned(val_conv_16); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv); + val_conv_16_conv = ChannelDetails_clone(&val_conv_16_conv); + val_constr.data[q] = val_conv_16_conv; + } + FREE(val); + PhantomRouteHints_set_channels(&this_ptr_conv, val_constr); } -void CS_LDK_PendingHTLCInfo_set_outgoing_amt_msat(int64_t this_ptr, int64_t val) { - LDKPendingHTLCInfo this_ptr_conv; +int64_t CS_LDK_PhantomRouteHints_get_phantom_scid(int64_t this_ptr) { + LDKPhantomRouteHints this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - PendingHTLCInfo_set_outgoing_amt_msat(&this_ptr_conv, val); + int64_t ret_conv = PhantomRouteHints_get_phantom_scid(&this_ptr_conv); + return ret_conv; } -int32_t CS_LDK_PendingHTLCInfo_get_outgoing_cltv_value(int64_t this_ptr) { - LDKPendingHTLCInfo this_ptr_conv; +void CS_LDK_PhantomRouteHints_set_phantom_scid(int64_t this_ptr, int64_t val) { + LDKPhantomRouteHints this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int32_t ret_conv = PendingHTLCInfo_get_outgoing_cltv_value(&this_ptr_conv); - return ret_conv; + PhantomRouteHints_set_phantom_scid(&this_ptr_conv, val); } -void CS_LDK_PendingHTLCInfo_set_outgoing_cltv_value(int64_t this_ptr, int32_t val) { - LDKPendingHTLCInfo this_ptr_conv; +int8_tArray CS_LDK_PhantomRouteHints_get_real_node_pubkey(int64_t this_ptr) { + LDKPhantomRouteHints this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - PendingHTLCInfo_set_outgoing_cltv_value(&this_ptr_conv, val); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, PhantomRouteHints_get_real_node_pubkey(&this_ptr_conv).compressed_form, 33); + return ret_arr; } -int64_t CS_LDK_PendingHTLCInfo_get_skimmed_fee_msat(int64_t this_ptr) { - LDKPendingHTLCInfo this_ptr_conv; +void CS_LDK_PhantomRouteHints_set_real_node_pubkey(int64_t this_ptr, int8_tArray val) { + LDKPhantomRouteHints this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = PendingHTLCInfo_get_skimmed_fee_msat(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + PhantomRouteHints_set_real_node_pubkey(&this_ptr_conv, val_ref); +} + +int64_t CS_LDK_PhantomRouteHints_new(int64_tArray channels_arg, int64_t phantom_scid_arg, int8_tArray real_node_pubkey_arg) { + LDKCVec_ChannelDetailsZ channels_arg_constr; + channels_arg_constr.datalen = channels_arg->arr_len; + if (channels_arg_constr.datalen > 0) + channels_arg_constr.data = MALLOC(channels_arg_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); + else + channels_arg_constr.data = NULL; + int64_t* channels_arg_vals = channels_arg->elems; + for (size_t q = 0; q < channels_arg_constr.datalen; q++) { + int64_t channels_arg_conv_16 = channels_arg_vals[q]; + LDKChannelDetails channels_arg_conv_16_conv; + channels_arg_conv_16_conv.inner = untag_ptr(channels_arg_conv_16); + channels_arg_conv_16_conv.is_owned = ptr_is_owned(channels_arg_conv_16); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channels_arg_conv_16_conv); + channels_arg_conv_16_conv = ChannelDetails_clone(&channels_arg_conv_16_conv); + channels_arg_constr.data[q] = channels_arg_conv_16_conv; + } + FREE(channels_arg); + LDKPublicKey real_node_pubkey_arg_ref; + CHECK(real_node_pubkey_arg->arr_len == 33); + memcpy(real_node_pubkey_arg_ref.compressed_form, real_node_pubkey_arg->elems, 33); FREE(real_node_pubkey_arg); + LDKPhantomRouteHints ret_var = PhantomRouteHints_new(channels_arg_constr, phantom_scid_arg, real_node_pubkey_arg_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t PhantomRouteHints_clone_ptr(LDKPhantomRouteHints *NONNULL_PTR arg) { + LDKPhantomRouteHints ret_var = PhantomRouteHints_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_PhantomRouteHints_clone_ptr(int64_t arg) { + LDKPhantomRouteHints arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = PhantomRouteHints_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_PhantomRouteHints_clone(int64_t orig) { + LDKPhantomRouteHints orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKPhantomRouteHints ret_var = PhantomRouteHints_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int64_t CS_LDK_ChannelManager_new(int64_t fee_est, int64_t chain_monitor, int64_t tx_broadcaster, int64_t router, int64_t logger, int64_t entropy_source, int64_t node_signer, int64_t signer_provider, int64_t config, int64_t params, int32_t current_timestamp) { + void* fee_est_ptr = untag_ptr(fee_est); + CHECK_ACCESS(fee_est_ptr); + LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)(fee_est_ptr); + if (fee_est_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_est_conv); + } + void* chain_monitor_ptr = untag_ptr(chain_monitor); + CHECK_ACCESS(chain_monitor_ptr); + LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr); + if (chain_monitor_conv.free == LDKWatch_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKWatch_JCalls_cloned(&chain_monitor_conv); + } + void* tx_broadcaster_ptr = untag_ptr(tx_broadcaster); + CHECK_ACCESS(tx_broadcaster_ptr); + LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr); + if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv); + } + void* router_ptr = untag_ptr(router); + CHECK_ACCESS(router_ptr); + LDKRouter router_conv = *(LDKRouter*)(router_ptr); + if (router_conv.free == LDKRouter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKRouter_JCalls_cloned(&router_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* signer_provider_ptr = untag_ptr(signer_provider); + CHECK_ACCESS(signer_provider_ptr); + LDKSignerProvider signer_provider_conv = *(LDKSignerProvider*)(signer_provider_ptr); + if (signer_provider_conv.free == LDKSignerProvider_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKSignerProvider_JCalls_cloned(&signer_provider_conv); + } + LDKUserConfig config_conv; + config_conv.inner = untag_ptr(config); + config_conv.is_owned = ptr_is_owned(config); + CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv); + config_conv = UserConfig_clone(&config_conv); + LDKChainParameters params_conv; + params_conv.inner = untag_ptr(params); + params_conv.is_owned = ptr_is_owned(params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); + params_conv = ChainParameters_clone(¶ms_conv); + LDKChannelManager ret_var = ChannelManager_new(fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, router_conv, logger_conv, entropy_source_conv, node_signer_conv, signer_provider_conv, config_conv, params_conv, current_timestamp); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int64_t CS_LDK_ChannelManager_get_current_default_configuration(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; + LDKUserConfig ret_var = ChannelManager_get_current_default_configuration(&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_PendingHTLCInfo_set_skimmed_fee_msat(int64_t this_ptr, int64_t val) { - LDKPendingHTLCInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - PendingHTLCInfo_set_skimmed_fee_msat(&this_ptr_conv, val_conv); +int64_t CS_LDK_ChannelManager_create_channel(int64_t this_arg, int8_tArray their_network_key, int64_t channel_value_satoshis, int64_t push_msat, int8_tArray user_channel_id, int64_t temporary_channel_id, int64_t override_config) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKPublicKey their_network_key_ref; + CHECK(their_network_key->arr_len == 33); + memcpy(their_network_key_ref.compressed_form, their_network_key->elems, 33); FREE(their_network_key); + LDKU128 user_channel_id_ref; + CHECK(user_channel_id->arr_len == 16); + memcpy(user_channel_id_ref.le_bytes, user_channel_id->elems, 16); FREE(user_channel_id); + LDKChannelId temporary_channel_id_conv; + temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); + temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); + temporary_channel_id_conv = ChannelId_clone(&temporary_channel_id_conv); + LDKUserConfig override_config_conv; + override_config_conv.inner = untag_ptr(override_config); + override_config_conv.is_owned = ptr_is_owned(override_config); + CHECK_INNER_FIELD_ACCESS_OR_NULL(override_config_conv); + override_config_conv = UserConfig_clone(&override_config_conv); + LDKCResult_ChannelIdAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdAPIErrorZ), "LDKCResult_ChannelIdAPIErrorZ"); + *ret_conv = ChannelManager_create_channel(&this_arg_conv, their_network_key_ref, channel_value_satoshis, push_msat, user_channel_id_ref, temporary_channel_id_conv, override_config_conv); + return tag_ptr(ret_conv, true); +} + +int64_tArray CS_LDK_ChannelManager_list_channels(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; + LDKCVec_ChannelDetailsZ ret_var = ChannelManager_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 q = 0; q < ret_var.datalen; q++) { + LDKChannelDetails ret_conv_16_var = ret_var.data[q]; + int64_t ret_conv_16_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); + ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned); + ret_arr_ptr[q] = ret_conv_16_ref; + } + + FREE(ret_var.data); + return ret_arr; +} + +int64_tArray CS_LDK_ChannelManager_list_usable_channels(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; + LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_usable_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 q = 0; q < ret_var.datalen; q++) { + LDKChannelDetails ret_conv_16_var = ret_var.data[q]; + int64_t ret_conv_16_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); + ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned); + ret_arr_ptr[q] = ret_conv_16_ref; + } + + FREE(ret_var.data); + return ret_arr; } -int64_t CS_LDK_PendingHTLCInfo_new(int64_t routing_arg, int8_tArray incoming_shared_secret_arg, int8_tArray payment_hash_arg, int64_t incoming_amt_msat_arg, int64_t outgoing_amt_msat_arg, int32_t outgoing_cltv_value_arg, int64_t skimmed_fee_msat_arg) { - void* routing_arg_ptr = untag_ptr(routing_arg); - CHECK_ACCESS(routing_arg_ptr); - LDKPendingHTLCRouting routing_arg_conv = *(LDKPendingHTLCRouting*)(routing_arg_ptr); - routing_arg_conv = PendingHTLCRouting_clone((LDKPendingHTLCRouting*)untag_ptr(routing_arg)); - LDKThirtyTwoBytes incoming_shared_secret_arg_ref; - CHECK(incoming_shared_secret_arg->arr_len == 32); - memcpy(incoming_shared_secret_arg_ref.data, incoming_shared_secret_arg->elems, 32); FREE(incoming_shared_secret_arg); - LDKThirtyTwoBytes payment_hash_arg_ref; - CHECK(payment_hash_arg->arr_len == 32); - memcpy(payment_hash_arg_ref.data, payment_hash_arg->elems, 32); FREE(payment_hash_arg); - void* incoming_amt_msat_arg_ptr = untag_ptr(incoming_amt_msat_arg); - CHECK_ACCESS(incoming_amt_msat_arg_ptr); - LDKCOption_u64Z incoming_amt_msat_arg_conv = *(LDKCOption_u64Z*)(incoming_amt_msat_arg_ptr); - incoming_amt_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(incoming_amt_msat_arg)); - void* skimmed_fee_msat_arg_ptr = untag_ptr(skimmed_fee_msat_arg); - CHECK_ACCESS(skimmed_fee_msat_arg_ptr); - LDKCOption_u64Z skimmed_fee_msat_arg_conv = *(LDKCOption_u64Z*)(skimmed_fee_msat_arg_ptr); - skimmed_fee_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(skimmed_fee_msat_arg)); - LDKPendingHTLCInfo ret_var = PendingHTLCInfo_new(routing_arg_conv, incoming_shared_secret_arg_ref, payment_hash_arg_ref, incoming_amt_msat_arg_conv, outgoing_amt_msat_arg, outgoing_cltv_value_arg, skimmed_fee_msat_arg_conv); - int64_t ret_ref = 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_ChannelManager_list_channels_with_counterparty(int64_t this_arg, int8_tArray counterparty_node_id) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKPublicKey counterparty_node_id_ref; + CHECK(counterparty_node_id->arr_len == 33); + memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); + LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_channels_with_counterparty(&this_arg_conv, counterparty_node_id_ref); + 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 q = 0; q < ret_var.datalen; q++) { + LDKChannelDetails ret_conv_16_var = ret_var.data[q]; + int64_t ret_conv_16_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); + ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned); + ret_arr_ptr[q] = ret_conv_16_ref; + } + + FREE(ret_var.data); + return ret_arr; } -static inline uint64_t PendingHTLCInfo_clone_ptr(LDKPendingHTLCInfo *NONNULL_PTR arg) { - LDKPendingHTLCInfo ret_var = PendingHTLCInfo_clone(arg); - int64_t ret_ref = 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_ChannelManager_list_recent_payments(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; + LDKCVec_RecentPaymentDetailsZ ret_var = ChannelManager_list_recent_payments(&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 w = 0; w < ret_var.datalen; w++) { + LDKRecentPaymentDetails *ret_conv_22_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); + *ret_conv_22_copy = ret_var.data[w]; + int64_t ret_conv_22_ref = tag_ptr(ret_conv_22_copy, true); + ret_arr_ptr[w] = ret_conv_22_ref; + } + + FREE(ret_var.data); + return ret_arr; } -int64_t CS_LDK_PendingHTLCInfo_clone_ptr(int64_t arg) { - LDKPendingHTLCInfo arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = PendingHTLCInfo_clone_ptr(&arg_conv); - return ret_conv; + +int64_t CS_LDK_ChannelManager_close_channel(int64_t this_arg, int64_t channel_id, int8_tArray counterparty_node_id) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv.is_owned = false; + LDKPublicKey counterparty_node_id_ref; + CHECK(counterparty_node_id->arr_len == 33); + memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_close_channel(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_PendingHTLCInfo_clone(int64_t orig) { - LDKPendingHTLCInfo orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKPendingHTLCInfo ret_var = PendingHTLCInfo_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +int64_t CS_LDK_ChannelManager_close_channel_with_feerate_and_script(int64_t this_arg, int64_t channel_id, int8_tArray counterparty_node_id, int64_t target_feerate_sats_per_1000_weight, int64_t shutdown_script) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv.is_owned = false; + LDKPublicKey counterparty_node_id_ref; + CHECK(counterparty_node_id->arr_len == 33); + memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); + void* target_feerate_sats_per_1000_weight_ptr = untag_ptr(target_feerate_sats_per_1000_weight); + CHECK_ACCESS(target_feerate_sats_per_1000_weight_ptr); + LDKCOption_u32Z target_feerate_sats_per_1000_weight_conv = *(LDKCOption_u32Z*)(target_feerate_sats_per_1000_weight_ptr); + target_feerate_sats_per_1000_weight_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(target_feerate_sats_per_1000_weight)); + LDKShutdownScript shutdown_script_conv; + shutdown_script_conv.inner = untag_ptr(shutdown_script); + shutdown_script_conv.is_owned = ptr_is_owned(shutdown_script); + CHECK_INNER_FIELD_ACCESS_OR_NULL(shutdown_script_conv); + shutdown_script_conv = ShutdownScript_clone(&shutdown_script_conv); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_close_channel_with_feerate_and_script(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref, target_feerate_sats_per_1000_weight_conv, shutdown_script_conv); + return tag_ptr(ret_conv, true); } -int32_t CS_LDK_BlindedFailure_clone(int64_t orig) { - LDKBlindedFailure* orig_conv = (LDKBlindedFailure*)untag_ptr(orig); - int32_t ret_conv = LDKBlindedFailure_to_cs(BlindedFailure_clone(orig_conv)); - return ret_conv; +int64_t CS_LDK_ChannelManager_force_close_broadcasting_latest_txn(int64_t this_arg, int64_t channel_id, int8_tArray counterparty_node_id) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv.is_owned = false; + LDKPublicKey counterparty_node_id_ref; + CHECK(counterparty_node_id->arr_len == 33); + memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_force_close_broadcasting_latest_txn(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref); + return tag_ptr(ret_conv, true); } -int32_t CS_LDK_BlindedFailure_from_introduction_node() { - int32_t ret_conv = LDKBlindedFailure_to_cs(BlindedFailure_from_introduction_node()); - return ret_conv; +int64_t CS_LDK_ChannelManager_force_close_without_broadcasting_txn(int64_t this_arg, int64_t channel_id, int8_tArray counterparty_node_id) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv.is_owned = false; + LDKPublicKey counterparty_node_id_ref; + CHECK(counterparty_node_id->arr_len == 33); + memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_force_close_without_broadcasting_txn(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref); + return tag_ptr(ret_conv, true); } -int32_t CS_LDK_BlindedFailure_from_blinded_node() { - int32_t ret_conv = LDKBlindedFailure_to_cs(BlindedFailure_from_blinded_node()); - return ret_conv; +void CS_LDK_ChannelManager_force_close_all_channels_broadcasting_latest_txn(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; + ChannelManager_force_close_all_channels_broadcasting_latest_txn(&this_arg_conv); } -int64_t CS_LDK_BlindedFailure_hash(int64_t o) { - LDKBlindedFailure* o_conv = (LDKBlindedFailure*)untag_ptr(o); - int64_t ret_conv = BlindedFailure_hash(o_conv); - return ret_conv; +void CS_LDK_ChannelManager_force_close_all_channels_without_broadcasting_txn(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; + ChannelManager_force_close_all_channels_without_broadcasting_txn(&this_arg_conv); } -jboolean CS_LDK_BlindedFailure_eq(int64_t a, int64_t b) { - LDKBlindedFailure* a_conv = (LDKBlindedFailure*)untag_ptr(a); - LDKBlindedFailure* b_conv = (LDKBlindedFailure*)untag_ptr(b); - jboolean ret_conv = BlindedFailure_eq(a_conv, b_conv); - return ret_conv; +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) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKRoute route_conv; + route_conv.inner = untag_ptr(route); + route_conv.is_owned = ptr_is_owned(route); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); + route_conv.is_owned = false; + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKRecipientOnionFields recipient_onion_conv; + recipient_onion_conv.inner = untag_ptr(recipient_onion); + recipient_onion_conv.is_owned = ptr_is_owned(recipient_onion); + CHECK_INNER_FIELD_ACCESS_OR_NULL(recipient_onion_conv); + recipient_onion_conv = RecipientOnionFields_clone(&recipient_onion_conv); + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); + *ret_conv = ChannelManager_send_payment_with_route(&this_arg_conv, &route_conv, payment_hash_ref, recipient_onion_conv, payment_id_ref); + return tag_ptr(ret_conv, true); } -void CS_LDK_FailureCode_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); - LDKFailureCode this_ptr_conv = *(LDKFailureCode*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - FailureCode_free(this_ptr_conv); +int64_t CS_LDK_ChannelManager_send_payment(int64_t this_arg, int8_tArray payment_hash, int64_t recipient_onion, int8_tArray payment_id, int64_t route_params, int64_t retry_strategy) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKRecipientOnionFields recipient_onion_conv; + recipient_onion_conv.inner = untag_ptr(recipient_onion); + recipient_onion_conv.is_owned = ptr_is_owned(recipient_onion); + CHECK_INNER_FIELD_ACCESS_OR_NULL(recipient_onion_conv); + recipient_onion_conv = RecipientOnionFields_clone(&recipient_onion_conv); + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + LDKRouteParameters route_params_conv; + route_params_conv.inner = untag_ptr(route_params); + route_params_conv.is_owned = ptr_is_owned(route_params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); + route_params_conv = RouteParameters_clone(&route_params_conv); + void* retry_strategy_ptr = untag_ptr(retry_strategy); + CHECK_ACCESS(retry_strategy_ptr); + LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr); + retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy)); + LDKCResult_NoneRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneRetryableSendFailureZ), "LDKCResult_NoneRetryableSendFailureZ"); + *ret_conv = ChannelManager_send_payment(&this_arg_conv, payment_hash_ref, recipient_onion_conv, payment_id_ref, route_params_conv, retry_strategy_conv); + return tag_ptr(ret_conv, true); } -static inline uint64_t FailureCode_clone_ptr(LDKFailureCode *NONNULL_PTR arg) { - LDKFailureCode *ret_copy = MALLOC(sizeof(LDKFailureCode), "LDKFailureCode"); - *ret_copy = FailureCode_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_ChannelManager_abandon_payment(int64_t this_arg, int8_tArray payment_id) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + ChannelManager_abandon_payment(&this_arg_conv, payment_id_ref); } -int64_t CS_LDK_FailureCode_clone_ptr(int64_t arg) { - LDKFailureCode* arg_conv = (LDKFailureCode*)untag_ptr(arg); - int64_t ret_conv = FailureCode_clone_ptr(arg_conv); - return ret_conv; + +int64_t CS_LDK_ChannelManager_send_spontaneous_payment(int64_t this_arg, int64_t route, int64_t payment_preimage, int64_t recipient_onion, int8_tArray payment_id) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKRoute route_conv; + route_conv.inner = untag_ptr(route); + route_conv.is_owned = ptr_is_owned(route); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); + route_conv.is_owned = false; + void* payment_preimage_ptr = untag_ptr(payment_preimage); + CHECK_ACCESS(payment_preimage_ptr); + LDKCOption_ThirtyTwoBytesZ payment_preimage_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_preimage_ptr); + payment_preimage_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_preimage)); + LDKRecipientOnionFields recipient_onion_conv; + recipient_onion_conv.inner = untag_ptr(recipient_onion); + recipient_onion_conv.is_owned = ptr_is_owned(recipient_onion); + CHECK_INNER_FIELD_ACCESS_OR_NULL(recipient_onion_conv); + recipient_onion_conv = RecipientOnionFields_clone(&recipient_onion_conv); + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + LDKCResult_ThirtyTwoBytesPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesPaymentSendFailureZ), "LDKCResult_ThirtyTwoBytesPaymentSendFailureZ"); + *ret_conv = ChannelManager_send_spontaneous_payment(&this_arg_conv, &route_conv, payment_preimage_conv, recipient_onion_conv, payment_id_ref); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_FailureCode_clone(int64_t orig) { - LDKFailureCode* orig_conv = (LDKFailureCode*)untag_ptr(orig); - LDKFailureCode *ret_copy = MALLOC(sizeof(LDKFailureCode), "LDKFailureCode"); - *ret_copy = FailureCode_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_ChannelManager_send_spontaneous_payment_with_retry(int64_t this_arg, int64_t payment_preimage, int64_t recipient_onion, int8_tArray payment_id, int64_t route_params, int64_t retry_strategy) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + void* payment_preimage_ptr = untag_ptr(payment_preimage); + CHECK_ACCESS(payment_preimage_ptr); + LDKCOption_ThirtyTwoBytesZ payment_preimage_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_preimage_ptr); + payment_preimage_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_preimage)); + LDKRecipientOnionFields recipient_onion_conv; + recipient_onion_conv.inner = untag_ptr(recipient_onion); + recipient_onion_conv.is_owned = ptr_is_owned(recipient_onion); + CHECK_INNER_FIELD_ACCESS_OR_NULL(recipient_onion_conv); + recipient_onion_conv = RecipientOnionFields_clone(&recipient_onion_conv); + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + LDKRouteParameters route_params_conv; + route_params_conv.inner = untag_ptr(route_params); + route_params_conv.is_owned = ptr_is_owned(route_params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); + route_params_conv = RouteParameters_clone(&route_params_conv); + void* retry_strategy_ptr = untag_ptr(retry_strategy); + CHECK_ACCESS(retry_strategy_ptr); + LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr); + retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy)); + LDKCResult_ThirtyTwoBytesRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesRetryableSendFailureZ), "LDKCResult_ThirtyTwoBytesRetryableSendFailureZ"); + *ret_conv = ChannelManager_send_spontaneous_payment_with_retry(&this_arg_conv, payment_preimage_conv, recipient_onion_conv, payment_id_ref, route_params_conv, retry_strategy_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_FailureCode_temporary_node_failure() { - LDKFailureCode *ret_copy = MALLOC(sizeof(LDKFailureCode), "LDKFailureCode"); - *ret_copy = FailureCode_temporary_node_failure(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_ChannelManager_send_probe(int64_t this_arg, int64_t path) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKPath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv = Path_clone(&path_conv); + LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ), "LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ"); + *ret_conv = ChannelManager_send_probe(&this_arg_conv, path_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_FailureCode_required_node_feature_missing() { - LDKFailureCode *ret_copy = MALLOC(sizeof(LDKFailureCode), "LDKFailureCode"); - *ret_copy = FailureCode_required_node_feature_missing(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_ChannelManager_send_spontaneous_preflight_probes(int64_t this_arg, int8_tArray node_id, int64_t amount_msat, int32_t final_cltv_expiry_delta, int64_t liquidity_limit_multiplier) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + void* liquidity_limit_multiplier_ptr = untag_ptr(liquidity_limit_multiplier); + CHECK_ACCESS(liquidity_limit_multiplier_ptr); + LDKCOption_u64Z liquidity_limit_multiplier_conv = *(LDKCOption_u64Z*)(liquidity_limit_multiplier_ptr); + liquidity_limit_multiplier_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(liquidity_limit_multiplier)); + LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ), "LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ"); + *ret_conv = ChannelManager_send_spontaneous_preflight_probes(&this_arg_conv, node_id_ref, amount_msat, final_cltv_expiry_delta, liquidity_limit_multiplier_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_FailureCode_incorrect_or_unknown_payment_details() { - LDKFailureCode *ret_copy = MALLOC(sizeof(LDKFailureCode), "LDKFailureCode"); - *ret_copy = FailureCode_incorrect_or_unknown_payment_details(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_ChannelManager_send_preflight_probes(int64_t this_arg, int64_t route_params, int64_t liquidity_limit_multiplier) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKRouteParameters route_params_conv; + route_params_conv.inner = untag_ptr(route_params); + route_params_conv.is_owned = ptr_is_owned(route_params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); + route_params_conv = RouteParameters_clone(&route_params_conv); + void* liquidity_limit_multiplier_ptr = untag_ptr(liquidity_limit_multiplier); + CHECK_ACCESS(liquidity_limit_multiplier_ptr); + LDKCOption_u64Z liquidity_limit_multiplier_conv = *(LDKCOption_u64Z*)(liquidity_limit_multiplier_ptr); + liquidity_limit_multiplier_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(liquidity_limit_multiplier)); + LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ), "LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ"); + *ret_conv = ChannelManager_send_preflight_probes(&this_arg_conv, route_params_conv, liquidity_limit_multiplier_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_FailureCode_invalid_onion_payload(int64_t a) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKCOption_C2Tuple_u64u16ZZ a_conv = *(LDKCOption_C2Tuple_u64u16ZZ*)(a_ptr); - a_conv = COption_C2Tuple_u64u16ZZ_clone((LDKCOption_C2Tuple_u64u16ZZ*)untag_ptr(a)); - LDKFailureCode *ret_copy = MALLOC(sizeof(LDKFailureCode), "LDKFailureCode"); - *ret_copy = FailureCode_invalid_onion_payload(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_ChannelManager_funding_transaction_generated(int64_t this_arg, int64_t temporary_channel_id, int8_tArray counterparty_node_id, int8_tArray funding_transaction) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelId temporary_channel_id_conv; + temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); + temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); + temporary_channel_id_conv.is_owned = false; + LDKPublicKey counterparty_node_id_ref; + CHECK(counterparty_node_id->arr_len == 33); + memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); + LDKTransaction funding_transaction_ref; + funding_transaction_ref.datalen = funding_transaction->arr_len; + funding_transaction_ref.data = MALLOC(funding_transaction_ref.datalen, "LDKTransaction Bytes"); + memcpy(funding_transaction_ref.data, funding_transaction->elems, funding_transaction_ref.datalen); FREE(funding_transaction); + funding_transaction_ref.data_is_owned = true; + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_funding_transaction_generated(&this_arg_conv, &temporary_channel_id_conv, counterparty_node_id_ref, funding_transaction_ref); + return tag_ptr(ret_conv, true); } -void CS_LDK_ChannelManager_free(int64_t this_obj) { - LDKChannelManager this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelManager_free(this_obj_conv); +int64_t CS_LDK_ChannelManager_batch_funding_transaction_generated(int64_t this_arg, int64_tArray temporary_channels, int8_tArray funding_transaction) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_C2Tuple_ChannelIdPublicKeyZZ temporary_channels_constr; + temporary_channels_constr.datalen = temporary_channels->arr_len; + if (temporary_channels_constr.datalen > 0) + temporary_channels_constr.data = MALLOC(temporary_channels_constr.datalen * sizeof(LDKC2Tuple_ChannelIdPublicKeyZ), "LDKCVec_C2Tuple_ChannelIdPublicKeyZZ Elements"); + else + temporary_channels_constr.data = NULL; + int64_t* temporary_channels_vals = temporary_channels->elems; + for (size_t e = 0; e < temporary_channels_constr.datalen; e++) { + int64_t temporary_channels_conv_30 = temporary_channels_vals[e]; + void* temporary_channels_conv_30_ptr = untag_ptr(temporary_channels_conv_30); + CHECK_ACCESS(temporary_channels_conv_30_ptr); + LDKC2Tuple_ChannelIdPublicKeyZ temporary_channels_conv_30_conv = *(LDKC2Tuple_ChannelIdPublicKeyZ*)(temporary_channels_conv_30_ptr); + temporary_channels_conv_30_conv = C2Tuple_ChannelIdPublicKeyZ_clone((LDKC2Tuple_ChannelIdPublicKeyZ*)untag_ptr(temporary_channels_conv_30)); + temporary_channels_constr.data[e] = temporary_channels_conv_30_conv; + } + FREE(temporary_channels); + LDKTransaction funding_transaction_ref; + funding_transaction_ref.datalen = funding_transaction->arr_len; + funding_transaction_ref.data = MALLOC(funding_transaction_ref.datalen, "LDKTransaction Bytes"); + memcpy(funding_transaction_ref.data, funding_transaction->elems, funding_transaction_ref.datalen); FREE(funding_transaction); + funding_transaction_ref.data_is_owned = true; + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_batch_funding_transaction_generated(&this_arg_conv, temporary_channels_constr, funding_transaction_ref); + return tag_ptr(ret_conv, true); } -void CS_LDK_ChainParameters_free(int64_t this_obj) { - LDKChainParameters this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChainParameters_free(this_obj_conv); +int64_t CS_LDK_ChannelManager_update_partial_channel_config(int64_t this_arg, int8_tArray counterparty_node_id, int64_tArray channel_ids, int64_t config_update) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKPublicKey counterparty_node_id_ref; + CHECK(counterparty_node_id->arr_len == 33); + memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); + LDKCVec_ChannelIdZ channel_ids_constr; + channel_ids_constr.datalen = channel_ids->arr_len; + if (channel_ids_constr.datalen > 0) + channel_ids_constr.data = MALLOC(channel_ids_constr.datalen * sizeof(LDKChannelId), "LDKCVec_ChannelIdZ Elements"); + else + channel_ids_constr.data = NULL; + int64_t* channel_ids_vals = channel_ids->elems; + for (size_t l = 0; l < channel_ids_constr.datalen; l++) { + int64_t channel_ids_conv_11 = channel_ids_vals[l]; + LDKChannelId channel_ids_conv_11_conv; + channel_ids_conv_11_conv.inner = untag_ptr(channel_ids_conv_11); + channel_ids_conv_11_conv.is_owned = ptr_is_owned(channel_ids_conv_11); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_ids_conv_11_conv); + channel_ids_conv_11_conv = ChannelId_clone(&channel_ids_conv_11_conv); + channel_ids_constr.data[l] = channel_ids_conv_11_conv; + } + FREE(channel_ids); + LDKChannelConfigUpdate config_update_conv; + config_update_conv.inner = untag_ptr(config_update); + config_update_conv.is_owned = ptr_is_owned(config_update); + CHECK_INNER_FIELD_ACCESS_OR_NULL(config_update_conv); + config_update_conv.is_owned = false; + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_update_partial_channel_config(&this_arg_conv, counterparty_node_id_ref, channel_ids_constr, &config_update_conv); + return tag_ptr(ret_conv, true); } -int32_t CS_LDK_ChainParameters_get_network(int64_t this_ptr) { - LDKChainParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int32_t ret_conv = LDKNetwork_to_cs(ChainParameters_get_network(&this_ptr_conv)); - return ret_conv; +int64_t CS_LDK_ChannelManager_update_channel_config(int64_t this_arg, int8_tArray counterparty_node_id, int64_tArray channel_ids, int64_t config) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKPublicKey counterparty_node_id_ref; + CHECK(counterparty_node_id->arr_len == 33); + memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); + LDKCVec_ChannelIdZ channel_ids_constr; + channel_ids_constr.datalen = channel_ids->arr_len; + if (channel_ids_constr.datalen > 0) + channel_ids_constr.data = MALLOC(channel_ids_constr.datalen * sizeof(LDKChannelId), "LDKCVec_ChannelIdZ Elements"); + else + channel_ids_constr.data = NULL; + int64_t* channel_ids_vals = channel_ids->elems; + for (size_t l = 0; l < channel_ids_constr.datalen; l++) { + int64_t channel_ids_conv_11 = channel_ids_vals[l]; + LDKChannelId channel_ids_conv_11_conv; + channel_ids_conv_11_conv.inner = untag_ptr(channel_ids_conv_11); + channel_ids_conv_11_conv.is_owned = ptr_is_owned(channel_ids_conv_11); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_ids_conv_11_conv); + channel_ids_conv_11_conv = ChannelId_clone(&channel_ids_conv_11_conv); + channel_ids_constr.data[l] = channel_ids_conv_11_conv; + } + FREE(channel_ids); + LDKChannelConfig config_conv; + config_conv.inner = untag_ptr(config); + config_conv.is_owned = ptr_is_owned(config); + CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv); + config_conv.is_owned = false; + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_update_channel_config(&this_arg_conv, counterparty_node_id_ref, channel_ids_constr, &config_conv); + return tag_ptr(ret_conv, true); } -void CS_LDK_ChainParameters_set_network(int64_t this_ptr, int32_t val) { - LDKChainParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKNetwork val_conv = LDKNetwork_from_cs(val); - ChainParameters_set_network(&this_ptr_conv, val_conv); +int64_t CS_LDK_ChannelManager_forward_intercepted_htlc(int64_t this_arg, int8_tArray intercept_id, int64_t next_hop_channel_id, int8_tArray next_node_id, int64_t amt_to_forward_msat) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKThirtyTwoBytes intercept_id_ref; + CHECK(intercept_id->arr_len == 32); + memcpy(intercept_id_ref.data, intercept_id->elems, 32); FREE(intercept_id); + LDKChannelId next_hop_channel_id_conv; + next_hop_channel_id_conv.inner = untag_ptr(next_hop_channel_id); + next_hop_channel_id_conv.is_owned = ptr_is_owned(next_hop_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(next_hop_channel_id_conv); + next_hop_channel_id_conv.is_owned = false; + LDKPublicKey next_node_id_ref; + CHECK(next_node_id->arr_len == 33); + memcpy(next_node_id_ref.compressed_form, next_node_id->elems, 33); FREE(next_node_id); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_forward_intercepted_htlc(&this_arg_conv, intercept_id_ref, &next_hop_channel_id_conv, next_node_id_ref, amt_to_forward_msat); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChainParameters_get_best_block(int64_t this_ptr) { - LDKChainParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKBestBlock ret_var = ChainParameters_get_best_block(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +int64_t CS_LDK_ChannelManager_fail_intercepted_htlc(int64_t this_arg, int8_tArray intercept_id) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKThirtyTwoBytes intercept_id_ref; + CHECK(intercept_id->arr_len == 32); + memcpy(intercept_id_ref.data, intercept_id->elems, 32); FREE(intercept_id); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_fail_intercepted_htlc(&this_arg_conv, intercept_id_ref); + return tag_ptr(ret_conv, true); } -void CS_LDK_ChainParameters_set_best_block(int64_t this_ptr, int64_t val) { - LDKChainParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKBestBlock val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = BestBlock_clone(&val_conv); - ChainParameters_set_best_block(&this_ptr_conv, val_conv); +void CS_LDK_ChannelManager_process_pending_htlc_forwards(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; + ChannelManager_process_pending_htlc_forwards(&this_arg_conv); } -int64_t CS_LDK_ChainParameters_new(int32_t network_arg, int64_t best_block_arg) { - LDKNetwork network_arg_conv = LDKNetwork_from_cs(network_arg); - LDKBestBlock best_block_arg_conv; - best_block_arg_conv.inner = untag_ptr(best_block_arg); - best_block_arg_conv.is_owned = ptr_is_owned(best_block_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(best_block_arg_conv); - best_block_arg_conv = BestBlock_clone(&best_block_arg_conv); - LDKChainParameters ret_var = ChainParameters_new(network_arg_conv, best_block_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +void CS_LDK_ChannelManager_timer_tick_occurred(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; + ChannelManager_timer_tick_occurred(&this_arg_conv); } -static inline uint64_t ChainParameters_clone_ptr(LDKChainParameters *NONNULL_PTR arg) { - LDKChainParameters ret_var = ChainParameters_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -int64_t CS_LDK_ChainParameters_clone_ptr(int64_t arg) { - LDKChainParameters arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = ChainParameters_clone_ptr(&arg_conv); - return ret_conv; +void CS_LDK_ChannelManager_fail_htlc_backwards(int64_t this_arg, int8_tArray payment_hash) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + uint8_t payment_hash_arr[32]; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_arr, payment_hash->elems, 32); FREE(payment_hash); + uint8_t (*payment_hash_ref)[32] = &payment_hash_arr; + ChannelManager_fail_htlc_backwards(&this_arg_conv, payment_hash_ref); } -int64_t CS_LDK_ChainParameters_clone(int64_t orig) { - LDKChainParameters orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKChainParameters ret_var = ChainParameters_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +void CS_LDK_ChannelManager_fail_htlc_backwards_with_reason(int64_t this_arg, int8_tArray payment_hash, int64_t failure_code) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + uint8_t payment_hash_arr[32]; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_arr, payment_hash->elems, 32); FREE(payment_hash); + uint8_t (*payment_hash_ref)[32] = &payment_hash_arr; + void* failure_code_ptr = untag_ptr(failure_code); + CHECK_ACCESS(failure_code_ptr); + LDKFailureCode failure_code_conv = *(LDKFailureCode*)(failure_code_ptr); + failure_code_conv = FailureCode_clone((LDKFailureCode*)untag_ptr(failure_code)); + ChannelManager_fail_htlc_backwards_with_reason(&this_arg_conv, payment_hash_ref, failure_code_conv); } -void CS_LDK_CounterpartyForwardingInfo_free(int64_t this_obj) { - LDKCounterpartyForwardingInfo this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - CounterpartyForwardingInfo_free(this_obj_conv); +void CS_LDK_ChannelManager_claim_funds(int64_t this_arg, int8_tArray payment_preimage) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKThirtyTwoBytes payment_preimage_ref; + CHECK(payment_preimage->arr_len == 32); + memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); + ChannelManager_claim_funds(&this_arg_conv, payment_preimage_ref); } -int32_t CS_LDK_CounterpartyForwardingInfo_get_fee_base_msat(int64_t this_ptr) { - LDKCounterpartyForwardingInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int32_t ret_conv = CounterpartyForwardingInfo_get_fee_base_msat(&this_ptr_conv); - return ret_conv; +void CS_LDK_ChannelManager_claim_funds_with_known_custom_tlvs(int64_t this_arg, int8_tArray payment_preimage) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKThirtyTwoBytes payment_preimage_ref; + CHECK(payment_preimage->arr_len == 32); + memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); + ChannelManager_claim_funds_with_known_custom_tlvs(&this_arg_conv, payment_preimage_ref); } -void CS_LDK_CounterpartyForwardingInfo_set_fee_base_msat(int64_t this_ptr, int32_t val) { - LDKCounterpartyForwardingInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - CounterpartyForwardingInfo_set_fee_base_msat(&this_ptr_conv, val); +int8_tArray CS_LDK_ChannelManager_get_our_node_id(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; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, ChannelManager_get_our_node_id(&this_arg_conv).compressed_form, 33); + return ret_arr; } -int32_t CS_LDK_CounterpartyForwardingInfo_get_fee_proportional_millionths(int64_t this_ptr) { - LDKCounterpartyForwardingInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int32_t ret_conv = CounterpartyForwardingInfo_get_fee_proportional_millionths(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_ChannelManager_accept_inbound_channel(int64_t this_arg, int64_t temporary_channel_id, int8_tArray counterparty_node_id, int8_tArray user_channel_id) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelId temporary_channel_id_conv; + temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); + temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); + temporary_channel_id_conv.is_owned = false; + LDKPublicKey counterparty_node_id_ref; + CHECK(counterparty_node_id->arr_len == 33); + memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); + LDKU128 user_channel_id_ref; + CHECK(user_channel_id->arr_len == 16); + memcpy(user_channel_id_ref.le_bytes, user_channel_id->elems, 16); FREE(user_channel_id); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_accept_inbound_channel(&this_arg_conv, &temporary_channel_id_conv, counterparty_node_id_ref, user_channel_id_ref); + return tag_ptr(ret_conv, true); } -void CS_LDK_CounterpartyForwardingInfo_set_fee_proportional_millionths(int64_t this_ptr, int32_t val) { - LDKCounterpartyForwardingInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - CounterpartyForwardingInfo_set_fee_proportional_millionths(&this_ptr_conv, val); +int64_t CS_LDK_ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(int64_t this_arg, int64_t temporary_channel_id, int8_tArray counterparty_node_id, int8_tArray user_channel_id) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelId temporary_channel_id_conv; + temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); + temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); + temporary_channel_id_conv.is_owned = false; + LDKPublicKey counterparty_node_id_ref; + CHECK(counterparty_node_id->arr_len == 33); + memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); + LDKU128 user_channel_id_ref; + CHECK(user_channel_id->arr_len == 16); + memcpy(user_channel_id_ref.le_bytes, user_channel_id->elems, 16); FREE(user_channel_id); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(&this_arg_conv, &temporary_channel_id_conv, counterparty_node_id_ref, user_channel_id_ref); + return tag_ptr(ret_conv, true); } -int16_t CS_LDK_CounterpartyForwardingInfo_get_cltv_expiry_delta(int64_t this_ptr) { - LDKCounterpartyForwardingInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int16_t ret_conv = CounterpartyForwardingInfo_get_cltv_expiry_delta(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_ChannelManager_create_offer_builder(int64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ"); + *ret_conv = ChannelManager_create_offer_builder(&this_arg_conv); + return tag_ptr(ret_conv, true); } -void CS_LDK_CounterpartyForwardingInfo_set_cltv_expiry_delta(int64_t this_ptr, int16_t val) { - LDKCounterpartyForwardingInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - CounterpartyForwardingInfo_set_cltv_expiry_delta(&this_ptr_conv, val); +int64_t CS_LDK_ChannelManager_create_refund_builder(int64_t this_arg, int64_t amount_msats, int64_t absolute_expiry, int8_tArray payment_id, int64_t retry_strategy, int64_t max_total_routing_fee_msat) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + void* retry_strategy_ptr = untag_ptr(retry_strategy); + CHECK_ACCESS(retry_strategy_ptr); + LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr); + retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy)); + void* max_total_routing_fee_msat_ptr = untag_ptr(max_total_routing_fee_msat); + CHECK_ACCESS(max_total_routing_fee_msat_ptr); + LDKCOption_u64Z max_total_routing_fee_msat_conv = *(LDKCOption_u64Z*)(max_total_routing_fee_msat_ptr); + max_total_routing_fee_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(max_total_routing_fee_msat)); + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ"); + *ret_conv = ChannelManager_create_refund_builder(&this_arg_conv, amount_msats, absolute_expiry, payment_id_ref, retry_strategy_conv, max_total_routing_fee_msat_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CounterpartyForwardingInfo_new(int32_t fee_base_msat_arg, int32_t fee_proportional_millionths_arg, int16_t cltv_expiry_delta_arg) { - LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +int64_t CS_LDK_ChannelManager_pay_for_offer(int64_t this_arg, int64_t offer, int64_t quantity, int64_t amount_msats, int64_t payer_note, int8_tArray payment_id, int64_t retry_strategy, int64_t max_total_routing_fee_msat) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKOffer offer_conv; + offer_conv.inner = untag_ptr(offer); + offer_conv.is_owned = ptr_is_owned(offer); + CHECK_INNER_FIELD_ACCESS_OR_NULL(offer_conv); + offer_conv.is_owned = false; + void* quantity_ptr = untag_ptr(quantity); + CHECK_ACCESS(quantity_ptr); + LDKCOption_u64Z quantity_conv = *(LDKCOption_u64Z*)(quantity_ptr); + quantity_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(quantity)); + void* amount_msats_ptr = untag_ptr(amount_msats); + CHECK_ACCESS(amount_msats_ptr); + LDKCOption_u64Z amount_msats_conv = *(LDKCOption_u64Z*)(amount_msats_ptr); + amount_msats_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amount_msats)); + void* payer_note_ptr = untag_ptr(payer_note); + CHECK_ACCESS(payer_note_ptr); + LDKCOption_StrZ payer_note_conv = *(LDKCOption_StrZ*)(payer_note_ptr); + payer_note_conv = COption_StrZ_clone((LDKCOption_StrZ*)untag_ptr(payer_note)); + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + void* retry_strategy_ptr = untag_ptr(retry_strategy); + CHECK_ACCESS(retry_strategy_ptr); + LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr); + retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy)); + void* max_total_routing_fee_msat_ptr = untag_ptr(max_total_routing_fee_msat); + CHECK_ACCESS(max_total_routing_fee_msat_ptr); + LDKCOption_u64Z max_total_routing_fee_msat_conv = *(LDKCOption_u64Z*)(max_total_routing_fee_msat_ptr); + max_total_routing_fee_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(max_total_routing_fee_msat)); + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = ChannelManager_pay_for_offer(&this_arg_conv, &offer_conv, quantity_conv, amount_msats_conv, payer_note_conv, payment_id_ref, retry_strategy_conv, max_total_routing_fee_msat_conv); + return tag_ptr(ret_conv, true); } -static inline uint64_t CounterpartyForwardingInfo_clone_ptr(LDKCounterpartyForwardingInfo *NONNULL_PTR arg) { - LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -int64_t CS_LDK_CounterpartyForwardingInfo_clone_ptr(int64_t arg) { - LDKCounterpartyForwardingInfo arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = CounterpartyForwardingInfo_clone_ptr(&arg_conv); - return ret_conv; +int64_t CS_LDK_ChannelManager_request_refund_payment(int64_t this_arg, int64_t refund) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKRefund refund_conv; + refund_conv.inner = untag_ptr(refund); + refund_conv.is_owned = ptr_is_owned(refund); + CHECK_INNER_FIELD_ACCESS_OR_NULL(refund_conv); + refund_conv.is_owned = false; + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ), "LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ"); + *ret_conv = ChannelManager_request_refund_payment(&this_arg_conv, &refund_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CounterpartyForwardingInfo_clone(int64_t orig) { - LDKCounterpartyForwardingInfo orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_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_ChannelManager_create_inbound_payment(int64_t this_arg, int64_t min_value_msat, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + void* min_value_msat_ptr = untag_ptr(min_value_msat); + CHECK_ACCESS(min_value_msat_ptr); + LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); + min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat)); + void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); + CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); + LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); + min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); + LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ), "LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ"); + *ret_conv = ChannelManager_create_inbound_payment(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); + return tag_ptr(ret_conv, true); } -void CS_LDK_ChannelCounterparty_free(int64_t this_obj) { - LDKChannelCounterparty this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelCounterparty_free(this_obj_conv); +int64_t CS_LDK_ChannelManager_create_inbound_payment_for_hash(int64_t this_arg, int8_tArray payment_hash, int64_t min_value_msat, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + void* min_value_msat_ptr = untag_ptr(min_value_msat); + CHECK_ACCESS(min_value_msat_ptr); + LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); + min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat)); + void* min_final_cltv_expiry_ptr = untag_ptr(min_final_cltv_expiry); + CHECK_ACCESS(min_final_cltv_expiry_ptr); + LDKCOption_u16Z min_final_cltv_expiry_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_ptr); + min_final_cltv_expiry_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry)); + LDKCResult_ThirtyTwoBytesNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesNoneZ), "LDKCResult_ThirtyTwoBytesNoneZ"); + *ret_conv = ChannelManager_create_inbound_payment_for_hash(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs, min_final_cltv_expiry_conv); + return tag_ptr(ret_conv, true); } -int8_tArray CS_LDK_ChannelCounterparty_get_node_id(int64_t this_ptr) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, ChannelCounterparty_get_node_id(&this_ptr_conv).compressed_form, 33); - return ret_arr; +int64_t CS_LDK_ChannelManager_get_payment_preimage(int64_t this_arg, int8_tArray payment_hash, int8_tArray payment_secret) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKThirtyTwoBytes payment_secret_ref; + CHECK(payment_secret->arr_len == 32); + memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret); + LDKCResult_ThirtyTwoBytesAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesAPIErrorZ), "LDKCResult_ThirtyTwoBytesAPIErrorZ"); + *ret_conv = ChannelManager_get_payment_preimage(&this_arg_conv, payment_hash_ref, payment_secret_ref); + return tag_ptr(ret_conv, true); } -void CS_LDK_ChannelCounterparty_set_node_id(int64_t this_ptr, int8_tArray val) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - ChannelCounterparty_set_node_id(&this_ptr_conv, val_ref); +int64_t CS_LDK_ChannelManager_get_phantom_scid(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; + int64_t ret_conv = ChannelManager_get_phantom_scid(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_ChannelCounterparty_get_features(int64_t this_ptr) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKInitFeatures ret_var = ChannelCounterparty_get_features(&this_ptr_conv); +int64_t CS_LDK_ChannelManager_get_phantom_route_hints(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; + LDKPhantomRouteHints ret_var = ChannelManager_get_phantom_route_hints(&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_ChannelCounterparty_set_features(int64_t this_ptr, int64_t val) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKInitFeatures val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = InitFeatures_clone(&val_conv); - ChannelCounterparty_set_features(&this_ptr_conv, val_conv); -} - -int64_t CS_LDK_ChannelCounterparty_get_unspendable_punishment_reserve(int64_t this_ptr) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelCounterparty_get_unspendable_punishment_reserve(&this_ptr_conv); +int64_t CS_LDK_ChannelManager_get_intercept_scid(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; + int64_t ret_conv = ChannelManager_get_intercept_scid(&this_arg_conv); return ret_conv; } -void CS_LDK_ChannelCounterparty_set_unspendable_punishment_reserve(int64_t this_ptr, int64_t val) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelCounterparty_set_unspendable_punishment_reserve(&this_ptr_conv, val); -} - -int64_t CS_LDK_ChannelCounterparty_get_forwarding_info(int64_t this_ptr) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCounterpartyForwardingInfo ret_var = ChannelCounterparty_get_forwarding_info(&this_ptr_conv); +int64_t CS_LDK_ChannelManager_compute_inflight_htlcs(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; + LDKInFlightHtlcs ret_var = ChannelManager_compute_inflight_htlcs(&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_ChannelCounterparty_set_forwarding_info(int64_t this_ptr, int64_t val) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCounterpartyForwardingInfo val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = CounterpartyForwardingInfo_clone(&val_conv); - ChannelCounterparty_set_forwarding_info(&this_ptr_conv, val_conv); +int64_t CS_LDK_ChannelManager_as_MessageSendEventsProvider(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; + LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); + *ret_ret = ChannelManager_as_MessageSendEventsProvider(&this_arg_conv); + return tag_ptr(ret_ret, true); } -int64_t CS_LDK_ChannelCounterparty_get_outbound_htlc_minimum_msat(int64_t this_ptr) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelCounterparty_get_outbound_htlc_minimum_msat(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_ChannelManager_as_EventsProvider(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; + LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); + *ret_ret = ChannelManager_as_EventsProvider(&this_arg_conv); + return tag_ptr(ret_ret, true); } -void CS_LDK_ChannelCounterparty_set_outbound_htlc_minimum_msat(int64_t this_ptr, int64_t val) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - ChannelCounterparty_set_outbound_htlc_minimum_msat(&this_ptr_conv, val_conv); +int64_t CS_LDK_ChannelManager_as_Listen(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; + LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); + *ret_ret = ChannelManager_as_Listen(&this_arg_conv); + return tag_ptr(ret_ret, true); } -int64_t CS_LDK_ChannelCounterparty_get_outbound_htlc_maximum_msat(int64_t this_ptr) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelCounterparty_get_outbound_htlc_maximum_msat(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +int64_t CS_LDK_ChannelManager_as_Confirm(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; + LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); + *ret_ret = ChannelManager_as_Confirm(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +int64_t CS_LDK_ChannelManager_get_event_or_persistence_needed_future(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; + LDKFuture ret_var = ChannelManager_get_event_or_persistence_needed_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; } -void CS_LDK_ChannelCounterparty_set_outbound_htlc_maximum_msat(int64_t this_ptr, int64_t val) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - ChannelCounterparty_set_outbound_htlc_maximum_msat(&this_ptr_conv, val_conv); +jboolean CS_LDK_ChannelManager_get_and_clear_needs_persistence(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; + jboolean ret_conv = ChannelManager_get_and_clear_needs_persistence(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_ChannelCounterparty_new(int8_tArray node_id_arg, int64_t features_arg, int64_t unspendable_punishment_reserve_arg, int64_t forwarding_info_arg, int64_t outbound_htlc_minimum_msat_arg, int64_t outbound_htlc_maximum_msat_arg) { - LDKPublicKey node_id_arg_ref; - CHECK(node_id_arg->arr_len == 33); - memcpy(node_id_arg_ref.compressed_form, node_id_arg->elems, 33); FREE(node_id_arg); - LDKInitFeatures features_arg_conv; - features_arg_conv.inner = untag_ptr(features_arg); - features_arg_conv.is_owned = ptr_is_owned(features_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); - features_arg_conv = InitFeatures_clone(&features_arg_conv); - LDKCounterpartyForwardingInfo forwarding_info_arg_conv; - forwarding_info_arg_conv.inner = untag_ptr(forwarding_info_arg); - forwarding_info_arg_conv.is_owned = ptr_is_owned(forwarding_info_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(forwarding_info_arg_conv); - forwarding_info_arg_conv = CounterpartyForwardingInfo_clone(&forwarding_info_arg_conv); - void* outbound_htlc_minimum_msat_arg_ptr = untag_ptr(outbound_htlc_minimum_msat_arg); - CHECK_ACCESS(outbound_htlc_minimum_msat_arg_ptr); - LDKCOption_u64Z outbound_htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(outbound_htlc_minimum_msat_arg_ptr); - outbound_htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_htlc_minimum_msat_arg)); - void* outbound_htlc_maximum_msat_arg_ptr = untag_ptr(outbound_htlc_maximum_msat_arg); - CHECK_ACCESS(outbound_htlc_maximum_msat_arg_ptr); - LDKCOption_u64Z outbound_htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(outbound_htlc_maximum_msat_arg_ptr); - outbound_htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_htlc_maximum_msat_arg)); - LDKChannelCounterparty ret_var = ChannelCounterparty_new(node_id_arg_ref, features_arg_conv, unspendable_punishment_reserve_arg, forwarding_info_arg_conv, outbound_htlc_minimum_msat_arg_conv, outbound_htlc_maximum_msat_arg_conv); +int64_t CS_LDK_ChannelManager_current_best_block(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; + LDKBestBlock ret_var = ChannelManager_current_best_block(&this_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t ChannelCounterparty_clone_ptr(LDKChannelCounterparty *NONNULL_PTR arg) { - LDKChannelCounterparty ret_var = ChannelCounterparty_clone(arg); +int64_t CS_LDK_ChannelManager_node_features(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; + LDKNodeFeatures ret_var = ChannelManager_node_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_ChannelCounterparty_clone_ptr(int64_t arg) { - LDKChannelCounterparty arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = ChannelCounterparty_clone_ptr(&arg_conv); - return ret_conv; -} -int64_t CS_LDK_ChannelCounterparty_clone(int64_t orig) { - LDKChannelCounterparty orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKChannelCounterparty ret_var = ChannelCounterparty_clone(&orig_conv); +int64_t CS_LDK_ChannelManager_channel_features(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; + LDKChannelFeatures ret_var = ChannelManager_channel_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_ChannelDetails_free(int64_t this_obj) { - LDKChannelDetails this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelDetails_free(this_obj_conv); -} - -int64_t CS_LDK_ChannelDetails_get_channel_id(int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelId ret_var = ChannelDetails_get_channel_id(&this_ptr_conv); +int64_t CS_LDK_ChannelManager_channel_type_features(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; + LDKChannelTypeFeatures ret_var = ChannelManager_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; } -void CS_LDK_ChannelDetails_set_channel_id(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelId val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelId_clone(&val_conv); - ChannelDetails_set_channel_id(&this_ptr_conv, val_conv); -} - -int64_t CS_LDK_ChannelDetails_get_counterparty(int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelCounterparty ret_var = ChannelDetails_get_counterparty(&this_ptr_conv); +int64_t CS_LDK_ChannelManager_init_features(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; + LDKInitFeatures ret_var = ChannelManager_init_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_ChannelDetails_set_counterparty(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelCounterparty val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelCounterparty_clone(&val_conv); - ChannelDetails_set_counterparty(&this_ptr_conv, val_conv); +int64_t CS_LDK_ChannelManager_as_ChannelMessageHandler(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; + LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler"); + *ret_ret = ChannelManager_as_ChannelMessageHandler(&this_arg_conv); + return tag_ptr(ret_ret, true); } -int64_t CS_LDK_ChannelDetails_get_funding_txo(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; - LDKOutPoint ret_var = ChannelDetails_get_funding_txo(&this_ptr_conv); +int64_t CS_LDK_ChannelManager_as_OffersMessageHandler(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; + LDKOffersMessageHandler* ret_ret = MALLOC(sizeof(LDKOffersMessageHandler), "LDKOffersMessageHandler"); + *ret_ret = ChannelManager_as_OffersMessageHandler(&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); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeIdLookUp* ret_ret = MALLOC(sizeof(LDKNodeIdLookUp), "LDKNodeIdLookUp"); + *ret_ret = ChannelManager_as_NodeIdLookUp(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +int64_t CS_LDK_provided_init_features(int64_t config) { + LDKUserConfig config_conv; + config_conv.inner = untag_ptr(config); + config_conv.is_owned = ptr_is_owned(config); + CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv); + config_conv.is_owned = false; + LDKInitFeatures ret_var = provided_init_features(&config_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -void CS_LDK_ChannelDetails_set_funding_txo(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKOutPoint val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = OutPoint_clone(&val_conv); - ChannelDetails_set_funding_txo(&this_ptr_conv, val_conv); +int8_tArray CS_LDK_PhantomRouteHints_write(int64_t obj) { + LDKPhantomRouteHints obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = PhantomRouteHints_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_PhantomRouteHints_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ"); + *ret_conv = PhantomRouteHints_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray CS_LDK_BlindedForward_write(int64_t obj) { + LDKBlindedForward obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = BlindedForward_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_BlindedForward_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_BlindedForwardDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedForwardDecodeErrorZ), "LDKCResult_BlindedForwardDecodeErrorZ"); + *ret_conv = BlindedForward_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray CS_LDK_PendingHTLCRouting_write(int64_t obj) { + LDKPendingHTLCRouting* obj_conv = (LDKPendingHTLCRouting*)untag_ptr(obj); + LDKCVec_u8Z ret_var = PendingHTLCRouting_write(obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_PendingHTLCRouting_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_PendingHTLCRoutingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PendingHTLCRoutingDecodeErrorZ), "LDKCResult_PendingHTLCRoutingDecodeErrorZ"); + *ret_conv = PendingHTLCRouting_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray CS_LDK_PendingHTLCInfo_write(int64_t obj) { + LDKPendingHTLCInfo obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = PendingHTLCInfo_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_PendingHTLCInfo_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_PendingHTLCInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PendingHTLCInfoDecodeErrorZ), "LDKCResult_PendingHTLCInfoDecodeErrorZ"); + *ret_conv = PendingHTLCInfo_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray CS_LDK_BlindedFailure_write(int64_t obj) { + LDKBlindedFailure* obj_conv = (LDKBlindedFailure*)untag_ptr(obj); + LDKCVec_u8Z ret_var = BlindedFailure_write(obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_BlindedFailure_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_BlindedFailureDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedFailureDecodeErrorZ), "LDKCResult_BlindedFailureDecodeErrorZ"); + *ret_conv = BlindedFailure_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray CS_LDK_ChannelManager_write(int64_t obj) { + LDKChannelManager obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ChannelManager_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +void CS_LDK_ChannelManagerReadArgs_free(int64_t this_obj) { + LDKChannelManagerReadArgs this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelManagerReadArgs_free(this_obj_conv); } -int64_t CS_LDK_ChannelDetails_get_channel_type(int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +int64_t CS_LDK_ChannelManagerReadArgs_get_entropy_source(int64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelTypeFeatures ret_var = ChannelDetails_get_channel_type(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + // WARNING: This object doesn't live past this scope, needs clone! + int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_entropy_source(&this_ptr_conv), false); + return ret_ret; } -void CS_LDK_ChannelDetails_set_channel_type(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; +void CS_LDK_ChannelManagerReadArgs_set_entropy_source(int64_t this_ptr, int64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelTypeFeatures val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelTypeFeatures_clone(&val_conv); - ChannelDetails_set_channel_type(&this_ptr_conv, val_conv); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKEntropySource val_conv = *(LDKEntropySource*)(val_ptr); + if (val_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&val_conv); + } + ChannelManagerReadArgs_set_entropy_source(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelDetails_get_short_channel_id(int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +int64_t CS_LDK_ChannelManagerReadArgs_get_node_signer(int64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelDetails_get_short_channel_id(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + // WARNING: This object doesn't live past this scope, needs clone! + int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_node_signer(&this_ptr_conv), false); + return ret_ret; } -void CS_LDK_ChannelDetails_set_short_channel_id(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; +void CS_LDK_ChannelManagerReadArgs_set_node_signer(int64_t this_ptr, int64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; void* val_ptr = untag_ptr(val); CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - ChannelDetails_set_short_channel_id(&this_ptr_conv, val_conv); + LDKNodeSigner val_conv = *(LDKNodeSigner*)(val_ptr); + if (val_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&val_conv); + } + ChannelManagerReadArgs_set_node_signer(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelDetails_get_outbound_scid_alias(int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +int64_t CS_LDK_ChannelManagerReadArgs_get_signer_provider(int64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelDetails_get_outbound_scid_alias(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + // WARNING: This object doesn't live past this scope, needs clone! + int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_signer_provider(&this_ptr_conv), false); + return ret_ret; } -void CS_LDK_ChannelDetails_set_outbound_scid_alias(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; +void CS_LDK_ChannelManagerReadArgs_set_signer_provider(int64_t this_ptr, int64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; void* val_ptr = untag_ptr(val); CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - ChannelDetails_set_outbound_scid_alias(&this_ptr_conv, val_conv); + LDKSignerProvider val_conv = *(LDKSignerProvider*)(val_ptr); + if (val_conv.free == LDKSignerProvider_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKSignerProvider_JCalls_cloned(&val_conv); + } + ChannelManagerReadArgs_set_signer_provider(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelDetails_get_inbound_scid_alias(int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +int64_t CS_LDK_ChannelManagerReadArgs_get_fee_estimator(int64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelDetails_get_inbound_scid_alias(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + // WARNING: This object doesn't live past this scope, needs clone! + int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_fee_estimator(&this_ptr_conv), false); + return ret_ret; } -void CS_LDK_ChannelDetails_set_inbound_scid_alias(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; +void CS_LDK_ChannelManagerReadArgs_set_fee_estimator(int64_t this_ptr, int64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; void* val_ptr = untag_ptr(val); CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - ChannelDetails_set_inbound_scid_alias(&this_ptr_conv, val_conv); + LDKFeeEstimator val_conv = *(LDKFeeEstimator*)(val_ptr); + if (val_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&val_conv); + } + ChannelManagerReadArgs_set_fee_estimator(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelDetails_get_channel_value_satoshis(int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +int64_t CS_LDK_ChannelManagerReadArgs_get_chain_monitor(int64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelDetails_get_channel_value_satoshis(&this_ptr_conv); - return ret_conv; + // WARNING: This object doesn't live past this scope, needs clone! + int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_chain_monitor(&this_ptr_conv), false); + return ret_ret; } -void CS_LDK_ChannelDetails_set_channel_value_satoshis(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; +void CS_LDK_ChannelManagerReadArgs_set_chain_monitor(int64_t this_ptr, int64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelDetails_set_channel_value_satoshis(&this_ptr_conv, val); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKWatch val_conv = *(LDKWatch*)(val_ptr); + if (val_conv.free == LDKWatch_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKWatch_JCalls_cloned(&val_conv); + } + ChannelManagerReadArgs_set_chain_monitor(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelDetails_get_unspendable_punishment_reserve(int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +int64_t CS_LDK_ChannelManagerReadArgs_get_tx_broadcaster(int64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelDetails_get_unspendable_punishment_reserve(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + // WARNING: This object doesn't live past this scope, needs clone! + int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv), false); + return ret_ret; } -void CS_LDK_ChannelDetails_set_unspendable_punishment_reserve(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; +void CS_LDK_ChannelManagerReadArgs_set_tx_broadcaster(int64_t this_ptr, int64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; void* val_ptr = untag_ptr(val); CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - ChannelDetails_set_unspendable_punishment_reserve(&this_ptr_conv, val_conv); + LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)(val_ptr); + if (val_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&val_conv); + } + ChannelManagerReadArgs_set_tx_broadcaster(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_ChannelDetails_get_user_channel_id(int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +int64_t CS_LDK_ChannelManagerReadArgs_get_router(int64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(16, __LINE__); - memcpy(ret_arr->elems, ChannelDetails_get_user_channel_id(&this_ptr_conv).le_bytes, 16); - return ret_arr; + // WARNING: This object doesn't live past this scope, needs clone! + int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_router(&this_ptr_conv), false); + return ret_ret; } -void CS_LDK_ChannelDetails_set_user_channel_id(int64_t this_ptr, int8_tArray val) { - LDKChannelDetails this_ptr_conv; +void CS_LDK_ChannelManagerReadArgs_set_router(int64_t this_ptr, int64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKU128 val_ref; - CHECK(val->arr_len == 16); - memcpy(val_ref.le_bytes, val->elems, 16); FREE(val); - ChannelDetails_set_user_channel_id(&this_ptr_conv, val_ref); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKRouter val_conv = *(LDKRouter*)(val_ptr); + if (val_conv.free == LDKRouter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKRouter_JCalls_cloned(&val_conv); + } + ChannelManagerReadArgs_set_router(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelDetails_get_feerate_sat_per_1000_weight(int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +int64_t CS_LDK_ChannelManagerReadArgs_get_logger(int64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); - *ret_copy = ChannelDetails_get_feerate_sat_per_1000_weight(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + // WARNING: This object doesn't live past this scope, needs clone! + int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_logger(&this_ptr_conv), false); + return ret_ret; } -void CS_LDK_ChannelDetails_set_feerate_sat_per_1000_weight(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; +void CS_LDK_ChannelManagerReadArgs_set_logger(int64_t this_ptr, int64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; void* val_ptr = untag_ptr(val); CHECK_ACCESS(val_ptr); - LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); - val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val)); - ChannelDetails_set_feerate_sat_per_1000_weight(&this_ptr_conv, val_conv); + LDKLogger val_conv = *(LDKLogger*)(val_ptr); + if (val_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&val_conv); + } + ChannelManagerReadArgs_set_logger(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelDetails_get_balance_msat(int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +int64_t CS_LDK_ChannelManagerReadArgs_get_default_config(int64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelDetails_get_balance_msat(&this_ptr_conv); - return ret_conv; + LDKUserConfig ret_var = ChannelManagerReadArgs_get_default_config(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_ChannelDetails_set_balance_msat(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; +void CS_LDK_ChannelManagerReadArgs_set_default_config(int64_t this_ptr, int64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelDetails_set_balance_msat(&this_ptr_conv, val); + LDKUserConfig val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = UserConfig_clone(&val_conv); + ChannelManagerReadArgs_set_default_config(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelDetails_get_outbound_capacity_msat(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; - int64_t ret_conv = ChannelDetails_get_outbound_capacity_msat(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_ChannelManagerReadArgs_new(int64_t entropy_source, int64_t node_signer, int64_t signer_provider, int64_t fee_estimator, int64_t chain_monitor, int64_t tx_broadcaster, int64_t router, int64_t logger, int64_t default_config, int64_tArray channel_monitors) { + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* signer_provider_ptr = untag_ptr(signer_provider); + CHECK_ACCESS(signer_provider_ptr); + LDKSignerProvider signer_provider_conv = *(LDKSignerProvider*)(signer_provider_ptr); + if (signer_provider_conv.free == LDKSignerProvider_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKSignerProvider_JCalls_cloned(&signer_provider_conv); + } + void* fee_estimator_ptr = untag_ptr(fee_estimator); + CHECK_ACCESS(fee_estimator_ptr); + LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); + if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); + } + void* chain_monitor_ptr = untag_ptr(chain_monitor); + CHECK_ACCESS(chain_monitor_ptr); + LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr); + if (chain_monitor_conv.free == LDKWatch_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKWatch_JCalls_cloned(&chain_monitor_conv); + } + void* tx_broadcaster_ptr = untag_ptr(tx_broadcaster); + CHECK_ACCESS(tx_broadcaster_ptr); + LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr); + if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv); + } + void* router_ptr = untag_ptr(router); + CHECK_ACCESS(router_ptr); + LDKRouter router_conv = *(LDKRouter*)(router_ptr); + if (router_conv.free == LDKRouter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKRouter_JCalls_cloned(&router_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKUserConfig default_config_conv; + default_config_conv.inner = untag_ptr(default_config); + default_config_conv.is_owned = ptr_is_owned(default_config); + CHECK_INNER_FIELD_ACCESS_OR_NULL(default_config_conv); + default_config_conv = UserConfig_clone(&default_config_conv); + LDKCVec_ChannelMonitorZ channel_monitors_constr; + channel_monitors_constr.datalen = channel_monitors->arr_len; + if (channel_monitors_constr.datalen > 0) + channel_monitors_constr.data = MALLOC(channel_monitors_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements"); + else + channel_monitors_constr.data = NULL; + int64_t* channel_monitors_vals = channel_monitors->elems; + for (size_t q = 0; q < channel_monitors_constr.datalen; q++) { + int64_t channel_monitors_conv_16 = channel_monitors_vals[q]; + LDKChannelMonitor channel_monitors_conv_16_conv; + channel_monitors_conv_16_conv.inner = untag_ptr(channel_monitors_conv_16); + channel_monitors_conv_16_conv.is_owned = ptr_is_owned(channel_monitors_conv_16); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_monitors_conv_16_conv); + channel_monitors_conv_16_conv.is_owned = false; + channel_monitors_constr.data[q] = channel_monitors_conv_16_conv; + } + FREE(channel_monitors); + LDKChannelManagerReadArgs ret_var = ChannelManagerReadArgs_new(entropy_source_conv, node_signer_conv, signer_provider_conv, fee_estimator_conv, chain_monitor_conv, tx_broadcaster_conv, router_conv, logger_conv, default_config_conv, channel_monitors_constr); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_ChannelDetails_set_outbound_capacity_msat(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelDetails_set_outbound_capacity_msat(&this_ptr_conv, val); +int64_t CS_LDK_C2Tuple_ThirtyTwoBytesChannelManagerZ_read(int8_tArray ser, int64_t arg) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKChannelManagerReadArgs arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + // WARNING: we need a move here but no clone is available for LDKChannelManagerReadArgs + + LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ"); + *ret_conv = C2Tuple_ThirtyTwoBytesChannelManagerZ_read(ser_ref, arg_conv); + FREE(ser); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelDetails_get_next_outbound_htlc_limit_msat(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; - int64_t ret_conv = ChannelDetails_get_next_outbound_htlc_limit_msat(&this_ptr_conv); - return ret_conv; +void CS_LDK_DelayedPaymentBasepoint_free(int64_t this_obj) { + LDKDelayedPaymentBasepoint this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + DelayedPaymentBasepoint_free(this_obj_conv); } -void CS_LDK_ChannelDetails_set_next_outbound_htlc_limit_msat(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; +int8_tArray CS_LDK_DelayedPaymentBasepoint_get_a(int64_t this_ptr) { + LDKDelayedPaymentBasepoint this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelDetails_set_next_outbound_htlc_limit_msat(&this_ptr_conv, val); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, DelayedPaymentBasepoint_get_a(&this_ptr_conv).compressed_form, 33); + return ret_arr; } -int64_t CS_LDK_ChannelDetails_get_next_outbound_htlc_minimum_msat(int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +void CS_LDK_DelayedPaymentBasepoint_set_a(int64_t this_ptr, int8_tArray val) { + LDKDelayedPaymentBasepoint this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelDetails_get_next_outbound_htlc_minimum_msat(&this_ptr_conv); - return ret_conv; + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + DelayedPaymentBasepoint_set_a(&this_ptr_conv, val_ref); } -void CS_LDK_ChannelDetails_set_next_outbound_htlc_minimum_msat(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelDetails_set_next_outbound_htlc_minimum_msat(&this_ptr_conv, val); +int64_t CS_LDK_DelayedPaymentBasepoint_new(int8_tArray a_arg) { + LDKPublicKey a_arg_ref; + CHECK(a_arg->arr_len == 33); + memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg); + LDKDelayedPaymentBasepoint ret_var = DelayedPaymentBasepoint_new(a_arg_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -int64_t CS_LDK_ChannelDetails_get_inbound_capacity_msat(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; - int64_t ret_conv = ChannelDetails_get_inbound_capacity_msat(&this_ptr_conv); +jboolean CS_LDK_DelayedPaymentBasepoint_eq(int64_t a, int64_t b) { + LDKDelayedPaymentBasepoint a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKDelayedPaymentBasepoint b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = DelayedPaymentBasepoint_eq(&a_conv, &b_conv); return ret_conv; } -void CS_LDK_ChannelDetails_set_inbound_capacity_msat(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelDetails_set_inbound_capacity_msat(&this_ptr_conv, val); +static inline uint64_t DelayedPaymentBasepoint_clone_ptr(LDKDelayedPaymentBasepoint *NONNULL_PTR arg) { + LDKDelayedPaymentBasepoint ret_var = DelayedPaymentBasepoint_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_DelayedPaymentBasepoint_clone_ptr(int64_t arg) { + LDKDelayedPaymentBasepoint arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = DelayedPaymentBasepoint_clone_ptr(&arg_conv); + return ret_conv; } -int64_t CS_LDK_ChannelDetails_get_confirmations_required(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; - LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); - *ret_copy = ChannelDetails_get_confirmations_required(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +int64_t CS_LDK_DelayedPaymentBasepoint_clone(int64_t orig) { + LDKDelayedPaymentBasepoint orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKDelayedPaymentBasepoint ret_var = DelayedPaymentBasepoint_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -void CS_LDK_ChannelDetails_set_confirmations_required(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); - val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val)); - ChannelDetails_set_confirmations_required(&this_ptr_conv, val_conv); +int64_t CS_LDK_DelayedPaymentBasepoint_hash(int64_t o) { + LDKDelayedPaymentBasepoint o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = DelayedPaymentBasepoint_hash(&o_conv); + return ret_conv; } -int64_t CS_LDK_ChannelDetails_get_confirmations(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; - LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); - *ret_copy = ChannelDetails_get_confirmations(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int8_tArray CS_LDK_DelayedPaymentBasepoint_to_public_key(int64_t this_arg) { + LDKDelayedPaymentBasepoint this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, DelayedPaymentBasepoint_to_public_key(&this_arg_conv).compressed_form, 33); + return ret_arr; } -void CS_LDK_ChannelDetails_set_confirmations(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); - val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val)); - ChannelDetails_set_confirmations(&this_ptr_conv, val_conv); +int8_tArray CS_LDK_DelayedPaymentBasepoint_derive_add_tweak(int64_t this_arg, int8_tArray per_commitment_point) { + LDKDelayedPaymentBasepoint this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKPublicKey per_commitment_point_ref; + CHECK(per_commitment_point->arr_len == 33); + memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, DelayedPaymentBasepoint_derive_add_tweak(&this_arg_conv, per_commitment_point_ref).data, 32); + return ret_arr; +} + +int8_tArray CS_LDK_DelayedPaymentBasepoint_write(int64_t obj) { + LDKDelayedPaymentBasepoint obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = DelayedPaymentBasepoint_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -int64_t CS_LDK_ChannelDetails_get_force_close_spend_delay(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; - LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); - *ret_copy = ChannelDetails_get_force_close_spend_delay(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_DelayedPaymentBasepoint_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_DelayedPaymentBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentBasepointDecodeErrorZ), "LDKCResult_DelayedPaymentBasepointDecodeErrorZ"); + *ret_conv = DelayedPaymentBasepoint_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -void CS_LDK_ChannelDetails_set_force_close_spend_delay(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr); - val_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(val)); - ChannelDetails_set_force_close_spend_delay(&this_ptr_conv, val_conv); +void CS_LDK_DelayedPaymentKey_free(int64_t this_obj) { + LDKDelayedPaymentKey this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + DelayedPaymentKey_free(this_obj_conv); } -jboolean CS_LDK_ChannelDetails_get_is_outbound(int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +int8_tArray CS_LDK_DelayedPaymentKey_get_a(int64_t this_ptr) { + LDKDelayedPaymentKey this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - jboolean ret_conv = ChannelDetails_get_is_outbound(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, DelayedPaymentKey_get_a(&this_ptr_conv).compressed_form, 33); + return ret_arr; } -void CS_LDK_ChannelDetails_set_is_outbound(int64_t this_ptr, jboolean val) { - LDKChannelDetails this_ptr_conv; +void CS_LDK_DelayedPaymentKey_set_a(int64_t this_ptr, int8_tArray val) { + LDKDelayedPaymentKey this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelDetails_set_is_outbound(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + DelayedPaymentKey_set_a(&this_ptr_conv, val_ref); } -jboolean CS_LDK_ChannelDetails_get_is_channel_ready(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_channel_ready(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_DelayedPaymentKey_new(int8_tArray a_arg) { + LDKPublicKey a_arg_ref; + CHECK(a_arg->arr_len == 33); + memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg); + LDKDelayedPaymentKey ret_var = DelayedPaymentKey_new(a_arg_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_ChannelDetails_set_is_channel_ready(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_channel_ready(&this_ptr_conv, val); +jboolean CS_LDK_DelayedPaymentKey_eq(int64_t a, int64_t b) { + LDKDelayedPaymentKey a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKDelayedPaymentKey b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = DelayedPaymentKey_eq(&a_conv, &b_conv); + return ret_conv; } -int64_t CS_LDK_ChannelDetails_get_channel_shutdown_state(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; - LDKCOption_ChannelShutdownStateZ *ret_copy = MALLOC(sizeof(LDKCOption_ChannelShutdownStateZ), "LDKCOption_ChannelShutdownStateZ"); - *ret_copy = ChannelDetails_get_channel_shutdown_state(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +static inline uint64_t DelayedPaymentKey_clone_ptr(LDKDelayedPaymentKey *NONNULL_PTR arg) { + LDKDelayedPaymentKey ret_var = DelayedPaymentKey_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } +int64_t CS_LDK_DelayedPaymentKey_clone_ptr(int64_t arg) { + LDKDelayedPaymentKey arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = DelayedPaymentKey_clone_ptr(&arg_conv); + return ret_conv; +} -void CS_LDK_ChannelDetails_set_channel_shutdown_state(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_ChannelShutdownStateZ val_conv = *(LDKCOption_ChannelShutdownStateZ*)(val_ptr); - val_conv = COption_ChannelShutdownStateZ_clone((LDKCOption_ChannelShutdownStateZ*)untag_ptr(val)); - ChannelDetails_set_channel_shutdown_state(&this_ptr_conv, val_conv); +int64_t CS_LDK_DelayedPaymentKey_clone(int64_t orig) { + LDKDelayedPaymentKey orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKDelayedPaymentKey ret_var = DelayedPaymentKey_clone(&orig_conv); + int64_t ret_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_ChannelDetails_get_is_usable(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_usable(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_DelayedPaymentKey_from_basepoint(int64_t countersignatory_basepoint, int8_tArray per_commitment_point) { + LDKDelayedPaymentBasepoint countersignatory_basepoint_conv; + countersignatory_basepoint_conv.inner = untag_ptr(countersignatory_basepoint); + countersignatory_basepoint_conv.is_owned = ptr_is_owned(countersignatory_basepoint); + CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_basepoint_conv); + countersignatory_basepoint_conv.is_owned = false; + LDKPublicKey per_commitment_point_ref; + CHECK(per_commitment_point->arr_len == 33); + memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point); + LDKDelayedPaymentKey ret_var = DelayedPaymentKey_from_basepoint(&countersignatory_basepoint_conv, per_commitment_point_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_ChannelDetails_set_is_usable(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_usable(&this_ptr_conv, val); +int64_t CS_LDK_DelayedPaymentKey_from_secret_key(int8_tArray sk) { + uint8_t sk_arr[32]; + CHECK(sk->arr_len == 32); + memcpy(sk_arr, sk->elems, 32); FREE(sk); + uint8_t (*sk_ref)[32] = &sk_arr; + LDKDelayedPaymentKey ret_var = DelayedPaymentKey_from_secret_key(sk_ref); + int64_t ret_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_ChannelDetails_get_is_public(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); - return ret_conv; +int8_tArray CS_LDK_DelayedPaymentKey_to_public_key(int64_t this_arg) { + LDKDelayedPaymentKey this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, DelayedPaymentKey_to_public_key(&this_arg_conv).compressed_form, 33); + return ret_arr; } -void CS_LDK_ChannelDetails_set_is_public(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); +int8_tArray CS_LDK_DelayedPaymentKey_write(int64_t obj) { + LDKDelayedPaymentKey obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = DelayedPaymentKey_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -int64_t CS_LDK_ChannelDetails_get_inbound_htlc_minimum_msat(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; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelDetails_get_inbound_htlc_minimum_msat(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_DelayedPaymentKey_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_DelayedPaymentKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentKeyDecodeErrorZ), "LDKCResult_DelayedPaymentKeyDecodeErrorZ"); + *ret_conv = DelayedPaymentKey_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -void CS_LDK_ChannelDetails_set_inbound_htlc_minimum_msat(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - ChannelDetails_set_inbound_htlc_minimum_msat(&this_ptr_conv, val_conv); +void CS_LDK_HtlcBasepoint_free(int64_t this_obj) { + LDKHtlcBasepoint this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + HtlcBasepoint_free(this_obj_conv); } -int64_t CS_LDK_ChannelDetails_get_inbound_htlc_maximum_msat(int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +int8_tArray CS_LDK_HtlcBasepoint_get_a(int64_t this_ptr) { + LDKHtlcBasepoint this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelDetails_get_inbound_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(33, __LINE__); + memcpy(ret_arr->elems, HtlcBasepoint_get_a(&this_ptr_conv).compressed_form, 33); + return ret_arr; } -void CS_LDK_ChannelDetails_set_inbound_htlc_maximum_msat(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; +void CS_LDK_HtlcBasepoint_set_a(int64_t this_ptr, int8_tArray val) { + LDKHtlcBasepoint this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - ChannelDetails_set_inbound_htlc_maximum_msat(&this_ptr_conv, val_conv); + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + HtlcBasepoint_set_a(&this_ptr_conv, val_ref); } -int64_t CS_LDK_ChannelDetails_get_config(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; - LDKChannelConfig ret_var = ChannelDetails_get_config(&this_ptr_conv); +int64_t CS_LDK_HtlcBasepoint_new(int8_tArray a_arg) { + LDKPublicKey a_arg_ref; + CHECK(a_arg->arr_len == 33); + memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg); + LDKHtlcBasepoint ret_var = HtlcBasepoint_new(a_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -void CS_LDK_ChannelDetails_set_config(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelConfig val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelConfig_clone(&val_conv); - ChannelDetails_set_config(&this_ptr_conv, val_conv); +jboolean CS_LDK_HtlcBasepoint_eq(int64_t a, int64_t b) { + LDKHtlcBasepoint a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKHtlcBasepoint b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = HtlcBasepoint_eq(&a_conv, &b_conv); + return ret_conv; } -static inline uint64_t ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg) { - LDKChannelDetails ret_var = ChannelDetails_clone(arg); +static inline uint64_t HtlcBasepoint_clone_ptr(LDKHtlcBasepoint *NONNULL_PTR arg) { + LDKHtlcBasepoint ret_var = HtlcBasepoint_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_ChannelDetails_clone_ptr(int64_t arg) { - LDKChannelDetails arg_conv; +int64_t CS_LDK_HtlcBasepoint_clone_ptr(int64_t arg) { + LDKHtlcBasepoint arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = ChannelDetails_clone_ptr(&arg_conv); + int64_t ret_conv = HtlcBasepoint_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_ChannelDetails_clone(int64_t orig) { - LDKChannelDetails orig_conv; +int64_t CS_LDK_HtlcBasepoint_clone(int64_t orig) { + LDKHtlcBasepoint orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKChannelDetails ret_var = ChannelDetails_clone(&orig_conv); + LDKHtlcBasepoint ret_var = HtlcBasepoint_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_ChannelDetails_get_inbound_payment_scid(int64_t this_arg) { - LDKChannelDetails this_arg_conv; +int64_t CS_LDK_HtlcBasepoint_hash(int64_t o) { + LDKHtlcBasepoint o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = HtlcBasepoint_hash(&o_conv); + return ret_conv; +} + +int8_tArray CS_LDK_HtlcBasepoint_to_public_key(int64_t this_arg) { + LDKHtlcBasepoint this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelDetails_get_inbound_payment_scid(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, HtlcBasepoint_to_public_key(&this_arg_conv).compressed_form, 33); + return ret_arr; } -int64_t CS_LDK_ChannelDetails_get_outbound_payment_scid(int64_t this_arg) { - LDKChannelDetails this_arg_conv; +int8_tArray CS_LDK_HtlcBasepoint_derive_add_tweak(int64_t this_arg, int8_tArray per_commitment_point) { + LDKHtlcBasepoint this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelDetails_get_outbound_payment_scid(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKPublicKey per_commitment_point_ref; + CHECK(per_commitment_point->arr_len == 33); + memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, HtlcBasepoint_derive_add_tweak(&this_arg_conv, per_commitment_point_ref).data, 32); + return ret_arr; } -int32_t CS_LDK_ChannelShutdownState_clone(int64_t orig) { - LDKChannelShutdownState* orig_conv = (LDKChannelShutdownState*)untag_ptr(orig); - int32_t ret_conv = LDKChannelShutdownState_to_cs(ChannelShutdownState_clone(orig_conv)); - return ret_conv; +int8_tArray CS_LDK_HtlcBasepoint_write(int64_t obj) { + LDKHtlcBasepoint obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = HtlcBasepoint_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -int32_t CS_LDK_ChannelShutdownState_not_shutting_down() { - int32_t ret_conv = LDKChannelShutdownState_to_cs(ChannelShutdownState_not_shutting_down()); - return ret_conv; +int64_t CS_LDK_HtlcBasepoint_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_HtlcBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcBasepointDecodeErrorZ), "LDKCResult_HtlcBasepointDecodeErrorZ"); + *ret_conv = HtlcBasepoint_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -int32_t CS_LDK_ChannelShutdownState_shutdown_initiated() { - int32_t ret_conv = LDKChannelShutdownState_to_cs(ChannelShutdownState_shutdown_initiated()); - return ret_conv; +void CS_LDK_HtlcKey_free(int64_t this_obj) { + LDKHtlcKey this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + HtlcKey_free(this_obj_conv); } -int32_t CS_LDK_ChannelShutdownState_resolving_htlcs() { - int32_t ret_conv = LDKChannelShutdownState_to_cs(ChannelShutdownState_resolving_htlcs()); - return ret_conv; +int8_tArray CS_LDK_HtlcKey_get_a(int64_t this_ptr) { + LDKHtlcKey this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, HtlcKey_get_a(&this_ptr_conv).compressed_form, 33); + return ret_arr; } -int32_t CS_LDK_ChannelShutdownState_negotiating_closing_fee() { - int32_t ret_conv = LDKChannelShutdownState_to_cs(ChannelShutdownState_negotiating_closing_fee()); - return ret_conv; +void CS_LDK_HtlcKey_set_a(int64_t this_ptr, int8_tArray val) { + LDKHtlcKey this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + HtlcKey_set_a(&this_ptr_conv, val_ref); } -int32_t CS_LDK_ChannelShutdownState_shutdown_complete() { - int32_t ret_conv = LDKChannelShutdownState_to_cs(ChannelShutdownState_shutdown_complete()); - return ret_conv; +int64_t CS_LDK_HtlcKey_new(int8_tArray a_arg) { + LDKPublicKey a_arg_ref; + CHECK(a_arg->arr_len == 33); + memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg); + LDKHtlcKey ret_var = HtlcKey_new(a_arg_ref); + int64_t ret_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_ChannelShutdownState_eq(int64_t a, int64_t b) { - LDKChannelShutdownState* a_conv = (LDKChannelShutdownState*)untag_ptr(a); - LDKChannelShutdownState* b_conv = (LDKChannelShutdownState*)untag_ptr(b); - jboolean ret_conv = ChannelShutdownState_eq(a_conv, b_conv); +jboolean CS_LDK_HtlcKey_eq(int64_t a, int64_t b) { + LDKHtlcKey a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKHtlcKey b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = HtlcKey_eq(&a_conv, &b_conv); return ret_conv; } -void CS_LDK_RecentPaymentDetails_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); - LDKRecentPaymentDetails this_ptr_conv = *(LDKRecentPaymentDetails*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - RecentPaymentDetails_free(this_ptr_conv); -} - -static inline uint64_t RecentPaymentDetails_clone_ptr(LDKRecentPaymentDetails *NONNULL_PTR arg) { - LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); - *ret_copy = RecentPaymentDetails_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); +static inline uint64_t HtlcKey_clone_ptr(LDKHtlcKey *NONNULL_PTR arg) { + LDKHtlcKey ret_var = HtlcKey_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_RecentPaymentDetails_clone_ptr(int64_t arg) { - LDKRecentPaymentDetails* arg_conv = (LDKRecentPaymentDetails*)untag_ptr(arg); - int64_t ret_conv = RecentPaymentDetails_clone_ptr(arg_conv); +int64_t CS_LDK_HtlcKey_clone_ptr(int64_t arg) { + LDKHtlcKey arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = HtlcKey_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_RecentPaymentDetails_clone(int64_t orig) { - LDKRecentPaymentDetails* orig_conv = (LDKRecentPaymentDetails*)untag_ptr(orig); - LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); - *ret_copy = RecentPaymentDetails_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_RecentPaymentDetails_awaiting_invoice(int8_tArray payment_id) { - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); - *ret_copy = RecentPaymentDetails_awaiting_invoice(payment_id_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_RecentPaymentDetails_pending(int8_tArray payment_id, int8_tArray payment_hash, int64_t total_msat) { - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); - *ret_copy = RecentPaymentDetails_pending(payment_id_ref, payment_hash_ref, total_msat); - int64_t ret_ref = tag_ptr(ret_copy, true); +int64_t CS_LDK_HtlcKey_clone(int64_t orig) { + LDKHtlcKey orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKHtlcKey ret_var = HtlcKey_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_RecentPaymentDetails_fulfilled(int8_tArray payment_id, int64_t payment_hash) { - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - void* payment_hash_ptr = untag_ptr(payment_hash); - CHECK_ACCESS(payment_hash_ptr); - LDKCOption_ThirtyTwoBytesZ payment_hash_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_ptr); - payment_hash_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash)); - LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); - *ret_copy = RecentPaymentDetails_fulfilled(payment_id_ref, payment_hash_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +int64_t CS_LDK_HtlcKey_from_basepoint(int64_t countersignatory_basepoint, int8_tArray per_commitment_point) { + LDKHtlcBasepoint countersignatory_basepoint_conv; + countersignatory_basepoint_conv.inner = untag_ptr(countersignatory_basepoint); + countersignatory_basepoint_conv.is_owned = ptr_is_owned(countersignatory_basepoint); + CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_basepoint_conv); + countersignatory_basepoint_conv.is_owned = false; + LDKPublicKey per_commitment_point_ref; + CHECK(per_commitment_point->arr_len == 33); + memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point); + LDKHtlcKey ret_var = HtlcKey_from_basepoint(&countersignatory_basepoint_conv, per_commitment_point_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_RecentPaymentDetails_abandoned(int8_tArray payment_id, int8_tArray payment_hash) { - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); - *ret_copy = RecentPaymentDetails_abandoned(payment_id_ref, payment_hash_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); +int64_t CS_LDK_HtlcKey_from_secret_key(int8_tArray sk) { + uint8_t sk_arr[32]; + CHECK(sk->arr_len == 32); + memcpy(sk_arr, sk->elems, 32); FREE(sk); + uint8_t (*sk_ref)[32] = &sk_arr; + LDKHtlcKey ret_var = HtlcKey_from_secret_key(sk_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -void CS_LDK_PhantomRouteHints_free(int64_t this_obj) { - LDKPhantomRouteHints this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PhantomRouteHints_free(this_obj_conv); +int8_tArray CS_LDK_HtlcKey_to_public_key(int64_t this_arg) { + LDKHtlcKey this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, HtlcKey_to_public_key(&this_arg_conv).compressed_form, 33); + return ret_arr; } -int64_tArray CS_LDK_PhantomRouteHints_get_channels(int64_t this_ptr) { - LDKPhantomRouteHints this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_ChannelDetailsZ ret_var = PhantomRouteHints_get_channels(&this_ptr_conv); - 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 q = 0; q < ret_var.datalen; q++) { - LDKChannelDetails ret_conv_16_var = ret_var.data[q]; - int64_t ret_conv_16_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); - ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned); - ret_arr_ptr[q] = ret_conv_16_ref; - } - - FREE(ret_var.data); +int8_tArray CS_LDK_HtlcKey_write(int64_t obj) { + LDKHtlcKey obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = HtlcKey_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); return ret_arr; } -void CS_LDK_PhantomRouteHints_set_channels(int64_t this_ptr, int64_tArray val) { - LDKPhantomRouteHints this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_ChannelDetailsZ val_constr; - val_constr.datalen = val->arr_len; - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = val->elems; - for (size_t q = 0; q < val_constr.datalen; q++) { - int64_t val_conv_16 = val_vals[q]; - LDKChannelDetails val_conv_16_conv; - val_conv_16_conv.inner = untag_ptr(val_conv_16); - val_conv_16_conv.is_owned = ptr_is_owned(val_conv_16); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv); - val_conv_16_conv = ChannelDetails_clone(&val_conv_16_conv); - val_constr.data[q] = val_conv_16_conv; - } - FREE(val); - PhantomRouteHints_set_channels(&this_ptr_conv, val_constr); +int64_t CS_LDK_HtlcKey_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_HtlcKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcKeyDecodeErrorZ), "LDKCResult_HtlcKeyDecodeErrorZ"); + *ret_conv = HtlcKey_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_PhantomRouteHints_get_phantom_scid(int64_t this_ptr) { - LDKPhantomRouteHints this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = PhantomRouteHints_get_phantom_scid(&this_ptr_conv); - return ret_conv; +int8_tArray CS_LDK_add_public_key_tweak(int8_tArray base_point, int8_tArray tweak) { + LDKPublicKey base_point_ref; + CHECK(base_point->arr_len == 33); + memcpy(base_point_ref.compressed_form, base_point->elems, 33); FREE(base_point); + uint8_t tweak_arr[32]; + CHECK(tweak->arr_len == 32); + memcpy(tweak_arr, tweak->elems, 32); FREE(tweak); + uint8_t (*tweak_ref)[32] = &tweak_arr; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, add_public_key_tweak(base_point_ref, tweak_ref).compressed_form, 33); + return ret_arr; } -void CS_LDK_PhantomRouteHints_set_phantom_scid(int64_t this_ptr, int64_t val) { - LDKPhantomRouteHints this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - PhantomRouteHints_set_phantom_scid(&this_ptr_conv, val); +void CS_LDK_RevocationBasepoint_free(int64_t this_obj) { + LDKRevocationBasepoint this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + RevocationBasepoint_free(this_obj_conv); } -int8_tArray CS_LDK_PhantomRouteHints_get_real_node_pubkey(int64_t this_ptr) { - LDKPhantomRouteHints this_ptr_conv; +int8_tArray CS_LDK_RevocationBasepoint_get_a(int64_t this_ptr) { + LDKRevocationBasepoint this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, PhantomRouteHints_get_real_node_pubkey(&this_ptr_conv).compressed_form, 33); + memcpy(ret_arr->elems, RevocationBasepoint_get_a(&this_ptr_conv).compressed_form, 33); return ret_arr; } -void CS_LDK_PhantomRouteHints_set_real_node_pubkey(int64_t this_ptr, int8_tArray val) { - LDKPhantomRouteHints this_ptr_conv; +void CS_LDK_RevocationBasepoint_set_a(int64_t this_ptr, int8_tArray val) { + LDKRevocationBasepoint this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -42192,1213 +44045,882 @@ void CS_LDK_PhantomRouteHints_set_real_node_pubkey(int64_t this_ptr, int8_tArra LDKPublicKey val_ref; CHECK(val->arr_len == 33); memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - PhantomRouteHints_set_real_node_pubkey(&this_ptr_conv, val_ref); + RevocationBasepoint_set_a(&this_ptr_conv, val_ref); } -int64_t CS_LDK_PhantomRouteHints_new(int64_tArray channels_arg, int64_t phantom_scid_arg, int8_tArray real_node_pubkey_arg) { - LDKCVec_ChannelDetailsZ channels_arg_constr; - channels_arg_constr.datalen = channels_arg->arr_len; - if (channels_arg_constr.datalen > 0) - channels_arg_constr.data = MALLOC(channels_arg_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); - else - channels_arg_constr.data = NULL; - int64_t* channels_arg_vals = channels_arg->elems; - for (size_t q = 0; q < channels_arg_constr.datalen; q++) { - int64_t channels_arg_conv_16 = channels_arg_vals[q]; - LDKChannelDetails channels_arg_conv_16_conv; - channels_arg_conv_16_conv.inner = untag_ptr(channels_arg_conv_16); - channels_arg_conv_16_conv.is_owned = ptr_is_owned(channels_arg_conv_16); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channels_arg_conv_16_conv); - channels_arg_conv_16_conv = ChannelDetails_clone(&channels_arg_conv_16_conv); - channels_arg_constr.data[q] = channels_arg_conv_16_conv; - } - FREE(channels_arg); - LDKPublicKey real_node_pubkey_arg_ref; - CHECK(real_node_pubkey_arg->arr_len == 33); - memcpy(real_node_pubkey_arg_ref.compressed_form, real_node_pubkey_arg->elems, 33); FREE(real_node_pubkey_arg); - LDKPhantomRouteHints ret_var = PhantomRouteHints_new(channels_arg_constr, phantom_scid_arg, real_node_pubkey_arg_ref); +int64_t CS_LDK_RevocationBasepoint_new(int8_tArray a_arg) { + LDKPublicKey a_arg_ref; + CHECK(a_arg->arr_len == 33); + memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg); + LDKRevocationBasepoint ret_var = RevocationBasepoint_new(a_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t PhantomRouteHints_clone_ptr(LDKPhantomRouteHints *NONNULL_PTR arg) { - LDKPhantomRouteHints ret_var = PhantomRouteHints_clone(arg); +jboolean CS_LDK_RevocationBasepoint_eq(int64_t a, int64_t b) { + LDKRevocationBasepoint a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKRevocationBasepoint b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = RevocationBasepoint_eq(&a_conv, &b_conv); + return ret_conv; +} + +static inline uint64_t RevocationBasepoint_clone_ptr(LDKRevocationBasepoint *NONNULL_PTR arg) { + LDKRevocationBasepoint ret_var = RevocationBasepoint_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_PhantomRouteHints_clone_ptr(int64_t arg) { - LDKPhantomRouteHints arg_conv; +int64_t CS_LDK_RevocationBasepoint_clone_ptr(int64_t arg) { + LDKRevocationBasepoint arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = PhantomRouteHints_clone_ptr(&arg_conv); + int64_t ret_conv = RevocationBasepoint_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_PhantomRouteHints_clone(int64_t orig) { - LDKPhantomRouteHints orig_conv; +int64_t CS_LDK_RevocationBasepoint_clone(int64_t orig) { + LDKRevocationBasepoint orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKPhantomRouteHints ret_var = PhantomRouteHints_clone(&orig_conv); + LDKRevocationBasepoint ret_var = RevocationBasepoint_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_ChannelManager_new(int64_t fee_est, int64_t chain_monitor, int64_t tx_broadcaster, int64_t router, int64_t logger, int64_t entropy_source, int64_t node_signer, int64_t signer_provider, int64_t config, int64_t params, int32_t current_timestamp) { - void* fee_est_ptr = untag_ptr(fee_est); - CHECK_ACCESS(fee_est_ptr); - LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)(fee_est_ptr); - if (fee_est_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&fee_est_conv); - } - void* chain_monitor_ptr = untag_ptr(chain_monitor); - CHECK_ACCESS(chain_monitor_ptr); - LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr); - if (chain_monitor_conv.free == LDKWatch_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKWatch_JCalls_cloned(&chain_monitor_conv); - } - void* tx_broadcaster_ptr = untag_ptr(tx_broadcaster); - CHECK_ACCESS(tx_broadcaster_ptr); - LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr); - if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv); - } - void* router_ptr = untag_ptr(router); - CHECK_ACCESS(router_ptr); - LDKRouter router_conv = *(LDKRouter*)(router_ptr); - if (router_conv.free == LDKRouter_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKRouter_JCalls_cloned(&router_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* signer_provider_ptr = untag_ptr(signer_provider); - CHECK_ACCESS(signer_provider_ptr); - LDKSignerProvider signer_provider_conv = *(LDKSignerProvider*)(signer_provider_ptr); - if (signer_provider_conv.free == LDKSignerProvider_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKSignerProvider_JCalls_cloned(&signer_provider_conv); - } - LDKUserConfig config_conv; - config_conv.inner = untag_ptr(config); - config_conv.is_owned = ptr_is_owned(config); - CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv); - config_conv = UserConfig_clone(&config_conv); - LDKChainParameters params_conv; - params_conv.inner = untag_ptr(params); - params_conv.is_owned = ptr_is_owned(params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); - params_conv = ChainParameters_clone(¶ms_conv); - LDKChannelManager ret_var = ChannelManager_new(fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, router_conv, logger_conv, entropy_source_conv, node_signer_conv, signer_provider_conv, config_conv, params_conv, current_timestamp); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +int64_t CS_LDK_RevocationBasepoint_hash(int64_t o) { + LDKRevocationBasepoint o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = RevocationBasepoint_hash(&o_conv); + return ret_conv; } -int64_t CS_LDK_ChannelManager_get_current_default_configuration(int64_t this_arg) { - LDKChannelManager this_arg_conv; +int8_tArray CS_LDK_RevocationBasepoint_to_public_key(int64_t this_arg) { + LDKRevocationBasepoint this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKUserConfig ret_var = ChannelManager_get_current_default_configuration(&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 ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, RevocationBasepoint_to_public_key(&this_arg_conv).compressed_form, 33); + return ret_arr; } -int64_t CS_LDK_ChannelManager_create_channel(int64_t this_arg, int8_tArray their_network_key, int64_t channel_value_satoshis, int64_t push_msat, int8_tArray user_channel_id, int64_t temporary_channel_id, int64_t override_config) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPublicKey their_network_key_ref; - CHECK(their_network_key->arr_len == 33); - memcpy(their_network_key_ref.compressed_form, their_network_key->elems, 33); FREE(their_network_key); - LDKU128 user_channel_id_ref; - CHECK(user_channel_id->arr_len == 16); - memcpy(user_channel_id_ref.le_bytes, user_channel_id->elems, 16); FREE(user_channel_id); - LDKChannelId temporary_channel_id_conv; - temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); - temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); - temporary_channel_id_conv = ChannelId_clone(&temporary_channel_id_conv); - LDKUserConfig override_config_conv; - override_config_conv.inner = untag_ptr(override_config); - override_config_conv.is_owned = ptr_is_owned(override_config); - CHECK_INNER_FIELD_ACCESS_OR_NULL(override_config_conv); - override_config_conv = UserConfig_clone(&override_config_conv); - LDKCResult_ChannelIdAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdAPIErrorZ), "LDKCResult_ChannelIdAPIErrorZ"); - *ret_conv = ChannelManager_create_channel(&this_arg_conv, their_network_key_ref, channel_value_satoshis, push_msat, user_channel_id_ref, temporary_channel_id_conv, override_config_conv); +int8_tArray CS_LDK_RevocationBasepoint_write(int64_t obj) { + LDKRevocationBasepoint obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = RevocationBasepoint_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_RevocationBasepoint_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_RevocationBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationBasepointDecodeErrorZ), "LDKCResult_RevocationBasepointDecodeErrorZ"); + *ret_conv = RevocationBasepoint_read(ser_ref); + FREE(ser); return tag_ptr(ret_conv, true); } -int64_tArray CS_LDK_ChannelManager_list_channels(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; - LDKCVec_ChannelDetailsZ ret_var = ChannelManager_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 q = 0; q < ret_var.datalen; q++) { - LDKChannelDetails ret_conv_16_var = ret_var.data[q]; - int64_t ret_conv_16_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); - ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned); - ret_arr_ptr[q] = ret_conv_16_ref; - } - - FREE(ret_var.data); - return ret_arr; +void CS_LDK_RevocationKey_free(int64_t this_obj) { + LDKRevocationKey this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + RevocationKey_free(this_obj_conv); } -int64_tArray CS_LDK_ChannelManager_list_usable_channels(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; - LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_usable_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 q = 0; q < ret_var.datalen; q++) { - LDKChannelDetails ret_conv_16_var = ret_var.data[q]; - int64_t ret_conv_16_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); - ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned); - ret_arr_ptr[q] = ret_conv_16_ref; - } - - FREE(ret_var.data); +int8_tArray CS_LDK_RevocationKey_get_a(int64_t this_ptr) { + LDKRevocationKey this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, RevocationKey_get_a(&this_ptr_conv).compressed_form, 33); return ret_arr; } -int64_tArray CS_LDK_ChannelManager_list_channels_with_counterparty(int64_t this_arg, int8_tArray counterparty_node_id) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPublicKey counterparty_node_id_ref; - CHECK(counterparty_node_id->arr_len == 33); - memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); - LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_channels_with_counterparty(&this_arg_conv, counterparty_node_id_ref); - 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 q = 0; q < ret_var.datalen; q++) { - LDKChannelDetails ret_conv_16_var = ret_var.data[q]; - int64_t ret_conv_16_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); - ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned); - ret_arr_ptr[q] = ret_conv_16_ref; - } - - FREE(ret_var.data); - return ret_arr; +void CS_LDK_RevocationKey_set_a(int64_t this_ptr, int8_tArray val) { + LDKRevocationKey this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + RevocationKey_set_a(&this_ptr_conv, val_ref); } -int64_tArray CS_LDK_ChannelManager_list_recent_payments(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; - LDKCVec_RecentPaymentDetailsZ ret_var = ChannelManager_list_recent_payments(&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 w = 0; w < ret_var.datalen; w++) { - LDKRecentPaymentDetails *ret_conv_22_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); - *ret_conv_22_copy = ret_var.data[w]; - int64_t ret_conv_22_ref = tag_ptr(ret_conv_22_copy, true); - ret_arr_ptr[w] = ret_conv_22_ref; - } - - FREE(ret_var.data); - return ret_arr; +int64_t CS_LDK_RevocationKey_new(int8_tArray a_arg) { + LDKPublicKey a_arg_ref; + CHECK(a_arg->arr_len == 33); + memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg); + LDKRevocationKey ret_var = RevocationKey_new(a_arg_ref); + int64_t ret_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_RevocationKey_eq(int64_t a, int64_t b) { + LDKRevocationKey a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKRevocationKey b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = RevocationKey_eq(&a_conv, &b_conv); + return ret_conv; +} + +static inline uint64_t RevocationKey_clone_ptr(LDKRevocationKey *NONNULL_PTR arg) { + LDKRevocationKey ret_var = RevocationKey_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_RevocationKey_clone_ptr(int64_t arg) { + LDKRevocationKey arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = RevocationKey_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_RevocationKey_clone(int64_t orig) { + LDKRevocationKey orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKRevocationKey ret_var = RevocationKey_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -int64_t CS_LDK_ChannelManager_close_channel(int64_t this_arg, int64_t channel_id, int8_tArray counterparty_node_id) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelId channel_id_conv; - channel_id_conv.inner = untag_ptr(channel_id); - channel_id_conv.is_owned = ptr_is_owned(channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); - channel_id_conv.is_owned = false; - LDKPublicKey counterparty_node_id_ref; - CHECK(counterparty_node_id->arr_len == 33); - memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_close_channel(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_RevocationKey_hash(int64_t o) { + LDKRevocationKey o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = RevocationKey_hash(&o_conv); + return ret_conv; } -int64_t CS_LDK_ChannelManager_close_channel_with_feerate_and_script(int64_t this_arg, int64_t channel_id, int8_tArray counterparty_node_id, int64_t target_feerate_sats_per_1000_weight, int64_t shutdown_script) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelId channel_id_conv; - channel_id_conv.inner = untag_ptr(channel_id); - channel_id_conv.is_owned = ptr_is_owned(channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); - channel_id_conv.is_owned = false; - LDKPublicKey counterparty_node_id_ref; - CHECK(counterparty_node_id->arr_len == 33); - memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); - void* target_feerate_sats_per_1000_weight_ptr = untag_ptr(target_feerate_sats_per_1000_weight); - CHECK_ACCESS(target_feerate_sats_per_1000_weight_ptr); - LDKCOption_u32Z target_feerate_sats_per_1000_weight_conv = *(LDKCOption_u32Z*)(target_feerate_sats_per_1000_weight_ptr); - target_feerate_sats_per_1000_weight_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(target_feerate_sats_per_1000_weight)); - LDKShutdownScript shutdown_script_conv; - shutdown_script_conv.inner = untag_ptr(shutdown_script); - shutdown_script_conv.is_owned = ptr_is_owned(shutdown_script); - CHECK_INNER_FIELD_ACCESS_OR_NULL(shutdown_script_conv); - shutdown_script_conv = ShutdownScript_clone(&shutdown_script_conv); - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_close_channel_with_feerate_and_script(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref, target_feerate_sats_per_1000_weight_conv, shutdown_script_conv); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_RevocationKey_from_basepoint(int64_t countersignatory_basepoint, int8_tArray per_commitment_point) { + LDKRevocationBasepoint countersignatory_basepoint_conv; + countersignatory_basepoint_conv.inner = untag_ptr(countersignatory_basepoint); + countersignatory_basepoint_conv.is_owned = ptr_is_owned(countersignatory_basepoint); + CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_basepoint_conv); + countersignatory_basepoint_conv.is_owned = false; + LDKPublicKey per_commitment_point_ref; + CHECK(per_commitment_point->arr_len == 33); + memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point); + LDKRevocationKey ret_var = RevocationKey_from_basepoint(&countersignatory_basepoint_conv, per_commitment_point_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -int64_t CS_LDK_ChannelManager_force_close_broadcasting_latest_txn(int64_t this_arg, int64_t channel_id, int8_tArray counterparty_node_id) { - LDKChannelManager this_arg_conv; +int8_tArray CS_LDK_RevocationKey_to_public_key(int64_t this_arg) { + LDKRevocationKey this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKChannelId channel_id_conv; - channel_id_conv.inner = untag_ptr(channel_id); - channel_id_conv.is_owned = ptr_is_owned(channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); - channel_id_conv.is_owned = false; - LDKPublicKey counterparty_node_id_ref; - CHECK(counterparty_node_id->arr_len == 33); - memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_force_close_broadcasting_latest_txn(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref); - return tag_ptr(ret_conv, true); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, RevocationKey_to_public_key(&this_arg_conv).compressed_form, 33); + return ret_arr; } -int64_t CS_LDK_ChannelManager_force_close_without_broadcasting_txn(int64_t this_arg, int64_t channel_id, int8_tArray counterparty_node_id) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelId channel_id_conv; - channel_id_conv.inner = untag_ptr(channel_id); - channel_id_conv.is_owned = ptr_is_owned(channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); - channel_id_conv.is_owned = false; - LDKPublicKey counterparty_node_id_ref; - CHECK(counterparty_node_id->arr_len == 33); - memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_force_close_without_broadcasting_txn(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref); +int8_tArray CS_LDK_RevocationKey_write(int64_t obj) { + LDKRevocationKey obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = RevocationKey_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_RevocationKey_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_RevocationKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationKeyDecodeErrorZ), "LDKCResult_RevocationKeyDecodeErrorZ"); + *ret_conv = RevocationKey_read(ser_ref); + FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_ChannelManager_force_close_all_channels_broadcasting_latest_txn(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; - ChannelManager_force_close_all_channels_broadcasting_latest_txn(&this_arg_conv); +int32_t CS_LDK_InboundHTLCStateDetails_clone(int64_t orig) { + LDKInboundHTLCStateDetails* orig_conv = (LDKInboundHTLCStateDetails*)untag_ptr(orig); + int32_t ret_conv = LDKInboundHTLCStateDetails_to_cs(InboundHTLCStateDetails_clone(orig_conv)); + return ret_conv; } -void CS_LDK_ChannelManager_force_close_all_channels_without_broadcasting_txn(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; - ChannelManager_force_close_all_channels_without_broadcasting_txn(&this_arg_conv); +int32_t CS_LDK_InboundHTLCStateDetails_awaiting_remote_revoke_to_add() { + int32_t ret_conv = LDKInboundHTLCStateDetails_to_cs(InboundHTLCStateDetails_awaiting_remote_revoke_to_add()); + return ret_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) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKRoute route_conv; - route_conv.inner = untag_ptr(route); - route_conv.is_owned = ptr_is_owned(route); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); - route_conv.is_owned = false; - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - LDKRecipientOnionFields recipient_onion_conv; - recipient_onion_conv.inner = untag_ptr(recipient_onion); - recipient_onion_conv.is_owned = ptr_is_owned(recipient_onion); - CHECK_INNER_FIELD_ACCESS_OR_NULL(recipient_onion_conv); - recipient_onion_conv = RecipientOnionFields_clone(&recipient_onion_conv); - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); - *ret_conv = ChannelManager_send_payment_with_route(&this_arg_conv, &route_conv, payment_hash_ref, recipient_onion_conv, payment_id_ref); - return tag_ptr(ret_conv, true); +int32_t CS_LDK_InboundHTLCStateDetails_committed() { + int32_t ret_conv = LDKInboundHTLCStateDetails_to_cs(InboundHTLCStateDetails_committed()); + return ret_conv; } -int64_t CS_LDK_ChannelManager_send_payment(int64_t this_arg, int8_tArray payment_hash, int64_t recipient_onion, int8_tArray payment_id, int64_t route_params, int64_t retry_strategy) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - LDKRecipientOnionFields recipient_onion_conv; - recipient_onion_conv.inner = untag_ptr(recipient_onion); - recipient_onion_conv.is_owned = ptr_is_owned(recipient_onion); - CHECK_INNER_FIELD_ACCESS_OR_NULL(recipient_onion_conv); - recipient_onion_conv = RecipientOnionFields_clone(&recipient_onion_conv); - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - LDKRouteParameters route_params_conv; - route_params_conv.inner = untag_ptr(route_params); - route_params_conv.is_owned = ptr_is_owned(route_params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); - route_params_conv = RouteParameters_clone(&route_params_conv); - void* retry_strategy_ptr = untag_ptr(retry_strategy); - CHECK_ACCESS(retry_strategy_ptr); - LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr); - retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy)); - LDKCResult_NoneRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneRetryableSendFailureZ), "LDKCResult_NoneRetryableSendFailureZ"); - *ret_conv = ChannelManager_send_payment(&this_arg_conv, payment_hash_ref, recipient_onion_conv, payment_id_ref, route_params_conv, retry_strategy_conv); - return tag_ptr(ret_conv, true); +int32_t CS_LDK_InboundHTLCStateDetails_awaiting_remote_revoke_to_remove_fulfill() { + int32_t ret_conv = LDKInboundHTLCStateDetails_to_cs(InboundHTLCStateDetails_awaiting_remote_revoke_to_remove_fulfill()); + return ret_conv; } -void CS_LDK_ChannelManager_abandon_payment(int64_t this_arg, int8_tArray payment_id) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - ChannelManager_abandon_payment(&this_arg_conv, payment_id_ref); +int32_t CS_LDK_InboundHTLCStateDetails_awaiting_remote_revoke_to_remove_fail() { + int32_t ret_conv = LDKInboundHTLCStateDetails_to_cs(InboundHTLCStateDetails_awaiting_remote_revoke_to_remove_fail()); + return ret_conv; } -int64_t CS_LDK_ChannelManager_send_spontaneous_payment(int64_t this_arg, int64_t route, int64_t payment_preimage, int64_t recipient_onion, int8_tArray payment_id) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKRoute route_conv; - route_conv.inner = untag_ptr(route); - route_conv.is_owned = ptr_is_owned(route); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); - route_conv.is_owned = false; - void* payment_preimage_ptr = untag_ptr(payment_preimage); - CHECK_ACCESS(payment_preimage_ptr); - LDKCOption_ThirtyTwoBytesZ payment_preimage_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_preimage_ptr); - payment_preimage_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_preimage)); - LDKRecipientOnionFields recipient_onion_conv; - recipient_onion_conv.inner = untag_ptr(recipient_onion); - recipient_onion_conv.is_owned = ptr_is_owned(recipient_onion); - CHECK_INNER_FIELD_ACCESS_OR_NULL(recipient_onion_conv); - recipient_onion_conv = RecipientOnionFields_clone(&recipient_onion_conv); - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - LDKCResult_ThirtyTwoBytesPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesPaymentSendFailureZ), "LDKCResult_ThirtyTwoBytesPaymentSendFailureZ"); - *ret_conv = ChannelManager_send_spontaneous_payment(&this_arg_conv, &route_conv, payment_preimage_conv, recipient_onion_conv, payment_id_ref); - return tag_ptr(ret_conv, true); +int8_tArray CS_LDK_InboundHTLCStateDetails_write(int64_t obj) { + LDKInboundHTLCStateDetails* obj_conv = (LDKInboundHTLCStateDetails*)untag_ptr(obj); + LDKCVec_u8Z ret_var = InboundHTLCStateDetails_write(obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -int64_t CS_LDK_ChannelManager_send_spontaneous_payment_with_retry(int64_t this_arg, int64_t payment_preimage, int64_t recipient_onion, int8_tArray payment_id, int64_t route_params, int64_t retry_strategy) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - void* payment_preimage_ptr = untag_ptr(payment_preimage); - CHECK_ACCESS(payment_preimage_ptr); - LDKCOption_ThirtyTwoBytesZ payment_preimage_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_preimage_ptr); - payment_preimage_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_preimage)); - LDKRecipientOnionFields recipient_onion_conv; - recipient_onion_conv.inner = untag_ptr(recipient_onion); - recipient_onion_conv.is_owned = ptr_is_owned(recipient_onion); - CHECK_INNER_FIELD_ACCESS_OR_NULL(recipient_onion_conv); - recipient_onion_conv = RecipientOnionFields_clone(&recipient_onion_conv); - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - LDKRouteParameters route_params_conv; - route_params_conv.inner = untag_ptr(route_params); - route_params_conv.is_owned = ptr_is_owned(route_params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); - route_params_conv = RouteParameters_clone(&route_params_conv); - void* retry_strategy_ptr = untag_ptr(retry_strategy); - CHECK_ACCESS(retry_strategy_ptr); - LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr); - retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy)); - LDKCResult_ThirtyTwoBytesRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesRetryableSendFailureZ), "LDKCResult_ThirtyTwoBytesRetryableSendFailureZ"); - *ret_conv = ChannelManager_send_spontaneous_payment_with_retry(&this_arg_conv, payment_preimage_conv, recipient_onion_conv, payment_id_ref, route_params_conv, retry_strategy_conv); +int64_t CS_LDK_InboundHTLCStateDetails_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ), "LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ"); + *ret_conv = InboundHTLCStateDetails_read(ser_ref); + FREE(ser); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelManager_send_probe(int64_t this_arg, int64_t path) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPath path_conv; - path_conv.inner = untag_ptr(path); - path_conv.is_owned = ptr_is_owned(path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); - path_conv = Path_clone(&path_conv); - LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ), "LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ"); - *ret_conv = ChannelManager_send_probe(&this_arg_conv, path_conv); - return tag_ptr(ret_conv, true); +void CS_LDK_InboundHTLCDetails_free(int64_t this_obj) { + LDKInboundHTLCDetails this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InboundHTLCDetails_free(this_obj_conv); } -int64_t CS_LDK_ChannelManager_send_spontaneous_preflight_probes(int64_t this_arg, int8_tArray node_id, int64_t amount_msat, int32_t final_cltv_expiry_delta, int64_t liquidity_limit_multiplier) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - void* liquidity_limit_multiplier_ptr = untag_ptr(liquidity_limit_multiplier); - CHECK_ACCESS(liquidity_limit_multiplier_ptr); - LDKCOption_u64Z liquidity_limit_multiplier_conv = *(LDKCOption_u64Z*)(liquidity_limit_multiplier_ptr); - liquidity_limit_multiplier_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(liquidity_limit_multiplier)); - LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ), "LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ"); - *ret_conv = ChannelManager_send_spontaneous_preflight_probes(&this_arg_conv, node_id_ref, amount_msat, final_cltv_expiry_delta, liquidity_limit_multiplier_conv); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_InboundHTLCDetails_get_htlc_id(int64_t this_ptr) { + LDKInboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = InboundHTLCDetails_get_htlc_id(&this_ptr_conv); + return ret_conv; } -int64_t CS_LDK_ChannelManager_send_preflight_probes(int64_t this_arg, int64_t route_params, int64_t liquidity_limit_multiplier) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKRouteParameters route_params_conv; - route_params_conv.inner = untag_ptr(route_params); - route_params_conv.is_owned = ptr_is_owned(route_params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); - route_params_conv = RouteParameters_clone(&route_params_conv); - void* liquidity_limit_multiplier_ptr = untag_ptr(liquidity_limit_multiplier); - CHECK_ACCESS(liquidity_limit_multiplier_ptr); - LDKCOption_u64Z liquidity_limit_multiplier_conv = *(LDKCOption_u64Z*)(liquidity_limit_multiplier_ptr); - liquidity_limit_multiplier_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(liquidity_limit_multiplier)); - LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ), "LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ"); - *ret_conv = ChannelManager_send_preflight_probes(&this_arg_conv, route_params_conv, liquidity_limit_multiplier_conv); - return tag_ptr(ret_conv, true); +void CS_LDK_InboundHTLCDetails_set_htlc_id(int64_t this_ptr, int64_t val) { + LDKInboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + InboundHTLCDetails_set_htlc_id(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelManager_funding_transaction_generated(int64_t this_arg, int64_t temporary_channel_id, int8_tArray counterparty_node_id, int8_tArray funding_transaction) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelId temporary_channel_id_conv; - temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); - temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); - temporary_channel_id_conv.is_owned = false; - LDKPublicKey counterparty_node_id_ref; - CHECK(counterparty_node_id->arr_len == 33); - memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); - LDKTransaction funding_transaction_ref; - funding_transaction_ref.datalen = funding_transaction->arr_len; - funding_transaction_ref.data = MALLOC(funding_transaction_ref.datalen, "LDKTransaction Bytes"); - memcpy(funding_transaction_ref.data, funding_transaction->elems, funding_transaction_ref.datalen); FREE(funding_transaction); - funding_transaction_ref.data_is_owned = true; - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_funding_transaction_generated(&this_arg_conv, &temporary_channel_id_conv, counterparty_node_id_ref, funding_transaction_ref); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_InboundHTLCDetails_get_amount_msat(int64_t this_ptr) { + LDKInboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = InboundHTLCDetails_get_amount_msat(&this_ptr_conv); + return ret_conv; } -int64_t CS_LDK_ChannelManager_batch_funding_transaction_generated(int64_t this_arg, int64_tArray temporary_channels, int8_tArray funding_transaction) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_C2Tuple_ChannelIdPublicKeyZZ temporary_channels_constr; - temporary_channels_constr.datalen = temporary_channels->arr_len; - if (temporary_channels_constr.datalen > 0) - temporary_channels_constr.data = MALLOC(temporary_channels_constr.datalen * sizeof(LDKC2Tuple_ChannelIdPublicKeyZ), "LDKCVec_C2Tuple_ChannelIdPublicKeyZZ Elements"); - else - temporary_channels_constr.data = NULL; - int64_t* temporary_channels_vals = temporary_channels->elems; - for (size_t e = 0; e < temporary_channels_constr.datalen; e++) { - int64_t temporary_channels_conv_30 = temporary_channels_vals[e]; - void* temporary_channels_conv_30_ptr = untag_ptr(temporary_channels_conv_30); - CHECK_ACCESS(temporary_channels_conv_30_ptr); - LDKC2Tuple_ChannelIdPublicKeyZ temporary_channels_conv_30_conv = *(LDKC2Tuple_ChannelIdPublicKeyZ*)(temporary_channels_conv_30_ptr); - temporary_channels_conv_30_conv = C2Tuple_ChannelIdPublicKeyZ_clone((LDKC2Tuple_ChannelIdPublicKeyZ*)untag_ptr(temporary_channels_conv_30)); - temporary_channels_constr.data[e] = temporary_channels_conv_30_conv; - } - FREE(temporary_channels); - LDKTransaction funding_transaction_ref; - funding_transaction_ref.datalen = funding_transaction->arr_len; - funding_transaction_ref.data = MALLOC(funding_transaction_ref.datalen, "LDKTransaction Bytes"); - memcpy(funding_transaction_ref.data, funding_transaction->elems, funding_transaction_ref.datalen); FREE(funding_transaction); - funding_transaction_ref.data_is_owned = true; - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_batch_funding_transaction_generated(&this_arg_conv, temporary_channels_constr, funding_transaction_ref); - return tag_ptr(ret_conv, true); +void CS_LDK_InboundHTLCDetails_set_amount_msat(int64_t this_ptr, int64_t val) { + LDKInboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + InboundHTLCDetails_set_amount_msat(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelManager_update_partial_channel_config(int64_t this_arg, int8_tArray counterparty_node_id, int64_tArray channel_ids, int64_t config_update) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPublicKey counterparty_node_id_ref; - CHECK(counterparty_node_id->arr_len == 33); - memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); - LDKCVec_ChannelIdZ channel_ids_constr; - channel_ids_constr.datalen = channel_ids->arr_len; - if (channel_ids_constr.datalen > 0) - channel_ids_constr.data = MALLOC(channel_ids_constr.datalen * sizeof(LDKChannelId), "LDKCVec_ChannelIdZ Elements"); - else - channel_ids_constr.data = NULL; - int64_t* channel_ids_vals = channel_ids->elems; - for (size_t l = 0; l < channel_ids_constr.datalen; l++) { - int64_t channel_ids_conv_11 = channel_ids_vals[l]; - LDKChannelId channel_ids_conv_11_conv; - channel_ids_conv_11_conv.inner = untag_ptr(channel_ids_conv_11); - channel_ids_conv_11_conv.is_owned = ptr_is_owned(channel_ids_conv_11); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_ids_conv_11_conv); - channel_ids_conv_11_conv = ChannelId_clone(&channel_ids_conv_11_conv); - channel_ids_constr.data[l] = channel_ids_conv_11_conv; - } - FREE(channel_ids); - LDKChannelConfigUpdate config_update_conv; - config_update_conv.inner = untag_ptr(config_update); - config_update_conv.is_owned = ptr_is_owned(config_update); - CHECK_INNER_FIELD_ACCESS_OR_NULL(config_update_conv); - config_update_conv.is_owned = false; - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_update_partial_channel_config(&this_arg_conv, counterparty_node_id_ref, channel_ids_constr, &config_update_conv); - return tag_ptr(ret_conv, true); +int32_t CS_LDK_InboundHTLCDetails_get_cltv_expiry(int64_t this_ptr) { + LDKInboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = InboundHTLCDetails_get_cltv_expiry(&this_ptr_conv); + return ret_conv; } -int64_t CS_LDK_ChannelManager_update_channel_config(int64_t this_arg, int8_tArray counterparty_node_id, int64_tArray channel_ids, int64_t config) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPublicKey counterparty_node_id_ref; - CHECK(counterparty_node_id->arr_len == 33); - memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); - LDKCVec_ChannelIdZ channel_ids_constr; - channel_ids_constr.datalen = channel_ids->arr_len; - if (channel_ids_constr.datalen > 0) - channel_ids_constr.data = MALLOC(channel_ids_constr.datalen * sizeof(LDKChannelId), "LDKCVec_ChannelIdZ Elements"); - else - channel_ids_constr.data = NULL; - int64_t* channel_ids_vals = channel_ids->elems; - for (size_t l = 0; l < channel_ids_constr.datalen; l++) { - int64_t channel_ids_conv_11 = channel_ids_vals[l]; - LDKChannelId channel_ids_conv_11_conv; - channel_ids_conv_11_conv.inner = untag_ptr(channel_ids_conv_11); - channel_ids_conv_11_conv.is_owned = ptr_is_owned(channel_ids_conv_11); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_ids_conv_11_conv); - channel_ids_conv_11_conv = ChannelId_clone(&channel_ids_conv_11_conv); - channel_ids_constr.data[l] = channel_ids_conv_11_conv; - } - FREE(channel_ids); - LDKChannelConfig config_conv; - config_conv.inner = untag_ptr(config); - config_conv.is_owned = ptr_is_owned(config); - CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv); - config_conv.is_owned = false; - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_update_channel_config(&this_arg_conv, counterparty_node_id_ref, channel_ids_constr, &config_conv); - return tag_ptr(ret_conv, true); +void CS_LDK_InboundHTLCDetails_set_cltv_expiry(int64_t this_ptr, int32_t val) { + LDKInboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + InboundHTLCDetails_set_cltv_expiry(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelManager_forward_intercepted_htlc(int64_t this_arg, int8_tArray intercept_id, int64_t next_hop_channel_id, int8_tArray next_node_id, int64_t amt_to_forward_msat) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKThirtyTwoBytes intercept_id_ref; - CHECK(intercept_id->arr_len == 32); - memcpy(intercept_id_ref.data, intercept_id->elems, 32); FREE(intercept_id); - LDKChannelId next_hop_channel_id_conv; - next_hop_channel_id_conv.inner = untag_ptr(next_hop_channel_id); - next_hop_channel_id_conv.is_owned = ptr_is_owned(next_hop_channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(next_hop_channel_id_conv); - next_hop_channel_id_conv.is_owned = false; - LDKPublicKey next_node_id_ref; - CHECK(next_node_id->arr_len == 33); - memcpy(next_node_id_ref.compressed_form, next_node_id->elems, 33); FREE(next_node_id); - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_forward_intercepted_htlc(&this_arg_conv, intercept_id_ref, &next_hop_channel_id_conv, next_node_id_ref, amt_to_forward_msat); - return tag_ptr(ret_conv, true); +int8_tArray CS_LDK_InboundHTLCDetails_get_payment_hash(int64_t this_ptr) { + LDKInboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *InboundHTLCDetails_get_payment_hash(&this_ptr_conv), 32); + return ret_arr; } -int64_t CS_LDK_ChannelManager_fail_intercepted_htlc(int64_t this_arg, int8_tArray intercept_id) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKThirtyTwoBytes intercept_id_ref; - CHECK(intercept_id->arr_len == 32); - memcpy(intercept_id_ref.data, intercept_id->elems, 32); FREE(intercept_id); - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_fail_intercepted_htlc(&this_arg_conv, intercept_id_ref); - return tag_ptr(ret_conv, true); +void CS_LDK_InboundHTLCDetails_set_payment_hash(int64_t this_ptr, int8_tArray val) { + LDKInboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + InboundHTLCDetails_set_payment_hash(&this_ptr_conv, val_ref); } -void CS_LDK_ChannelManager_process_pending_htlc_forwards(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; - ChannelManager_process_pending_htlc_forwards(&this_arg_conv); +int64_t CS_LDK_InboundHTLCDetails_get_state(int64_t this_ptr) { + LDKInboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_InboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_InboundHTLCStateDetailsZ), "LDKCOption_InboundHTLCStateDetailsZ"); + *ret_copy = InboundHTLCDetails_get_state(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_ChannelManager_timer_tick_occurred(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; - ChannelManager_timer_tick_occurred(&this_arg_conv); +void CS_LDK_InboundHTLCDetails_set_state(int64_t this_ptr, int64_t val) { + LDKInboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_InboundHTLCStateDetailsZ val_conv = *(LDKCOption_InboundHTLCStateDetailsZ*)(val_ptr); + val_conv = COption_InboundHTLCStateDetailsZ_clone((LDKCOption_InboundHTLCStateDetailsZ*)untag_ptr(val)); + InboundHTLCDetails_set_state(&this_ptr_conv, val_conv); } -void CS_LDK_ChannelManager_fail_htlc_backwards(int64_t this_arg, int8_tArray payment_hash) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - uint8_t payment_hash_arr[32]; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_arr, payment_hash->elems, 32); FREE(payment_hash); - uint8_t (*payment_hash_ref)[32] = &payment_hash_arr; - ChannelManager_fail_htlc_backwards(&this_arg_conv, payment_hash_ref); +jboolean CS_LDK_InboundHTLCDetails_get_is_dust(int64_t this_ptr) { + LDKInboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + jboolean ret_conv = InboundHTLCDetails_get_is_dust(&this_ptr_conv); + return ret_conv; } -void CS_LDK_ChannelManager_fail_htlc_backwards_with_reason(int64_t this_arg, int8_tArray payment_hash, int64_t failure_code) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - uint8_t payment_hash_arr[32]; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_arr, payment_hash->elems, 32); FREE(payment_hash); - uint8_t (*payment_hash_ref)[32] = &payment_hash_arr; - void* failure_code_ptr = untag_ptr(failure_code); - CHECK_ACCESS(failure_code_ptr); - LDKFailureCode failure_code_conv = *(LDKFailureCode*)(failure_code_ptr); - failure_code_conv = FailureCode_clone((LDKFailureCode*)untag_ptr(failure_code)); - ChannelManager_fail_htlc_backwards_with_reason(&this_arg_conv, payment_hash_ref, failure_code_conv); +void CS_LDK_InboundHTLCDetails_set_is_dust(int64_t this_ptr, jboolean val) { + LDKInboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + InboundHTLCDetails_set_is_dust(&this_ptr_conv, val); } -void CS_LDK_ChannelManager_claim_funds(int64_t this_arg, int8_tArray payment_preimage) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKThirtyTwoBytes payment_preimage_ref; - CHECK(payment_preimage->arr_len == 32); - memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); - ChannelManager_claim_funds(&this_arg_conv, payment_preimage_ref); +int64_t CS_LDK_InboundHTLCDetails_new(int64_t htlc_id_arg, int64_t amount_msat_arg, int32_t cltv_expiry_arg, int8_tArray payment_hash_arg, int64_t state_arg, jboolean is_dust_arg) { + LDKThirtyTwoBytes payment_hash_arg_ref; + CHECK(payment_hash_arg->arr_len == 32); + memcpy(payment_hash_arg_ref.data, payment_hash_arg->elems, 32); FREE(payment_hash_arg); + void* state_arg_ptr = untag_ptr(state_arg); + CHECK_ACCESS(state_arg_ptr); + LDKCOption_InboundHTLCStateDetailsZ state_arg_conv = *(LDKCOption_InboundHTLCStateDetailsZ*)(state_arg_ptr); + state_arg_conv = COption_InboundHTLCStateDetailsZ_clone((LDKCOption_InboundHTLCStateDetailsZ*)untag_ptr(state_arg)); + LDKInboundHTLCDetails ret_var = InboundHTLCDetails_new(htlc_id_arg, amount_msat_arg, cltv_expiry_arg, payment_hash_arg_ref, state_arg_conv, is_dust_arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_ChannelManager_claim_funds_with_known_custom_tlvs(int64_t this_arg, int8_tArray payment_preimage) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKThirtyTwoBytes payment_preimage_ref; - CHECK(payment_preimage->arr_len == 32); - memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); - ChannelManager_claim_funds_with_known_custom_tlvs(&this_arg_conv, payment_preimage_ref); +static inline uint64_t InboundHTLCDetails_clone_ptr(LDKInboundHTLCDetails *NONNULL_PTR arg) { + LDKInboundHTLCDetails ret_var = InboundHTLCDetails_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_InboundHTLCDetails_clone_ptr(int64_t arg) { + LDKInboundHTLCDetails arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = InboundHTLCDetails_clone_ptr(&arg_conv); + return ret_conv; } -int8_tArray CS_LDK_ChannelManager_get_our_node_id(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; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, ChannelManager_get_our_node_id(&this_arg_conv).compressed_form, 33); +int64_t CS_LDK_InboundHTLCDetails_clone(int64_t orig) { + LDKInboundHTLCDetails orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKInboundHTLCDetails ret_var = InboundHTLCDetails_clone(&orig_conv); + int64_t ret_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_InboundHTLCDetails_write(int64_t obj) { + LDKInboundHTLCDetails obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = InboundHTLCDetails_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_ChannelManager_accept_inbound_channel(int64_t this_arg, int64_t temporary_channel_id, int8_tArray counterparty_node_id, int8_tArray user_channel_id) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelId temporary_channel_id_conv; - temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); - temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); - temporary_channel_id_conv.is_owned = false; - LDKPublicKey counterparty_node_id_ref; - CHECK(counterparty_node_id->arr_len == 33); - memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); - LDKU128 user_channel_id_ref; - CHECK(user_channel_id->arr_len == 16); - memcpy(user_channel_id_ref.le_bytes, user_channel_id->elems, 16); FREE(user_channel_id); - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_accept_inbound_channel(&this_arg_conv, &temporary_channel_id_conv, counterparty_node_id_ref, user_channel_id_ref); +int64_t CS_LDK_InboundHTLCDetails_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_InboundHTLCDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InboundHTLCDetailsDecodeErrorZ), "LDKCResult_InboundHTLCDetailsDecodeErrorZ"); + *ret_conv = InboundHTLCDetails_read(ser_ref); + FREE(ser); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(int64_t this_arg, int64_t temporary_channel_id, int8_tArray counterparty_node_id, int8_tArray user_channel_id) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelId temporary_channel_id_conv; - temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); - temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); - temporary_channel_id_conv.is_owned = false; - LDKPublicKey counterparty_node_id_ref; - CHECK(counterparty_node_id->arr_len == 33); - memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); - LDKU128 user_channel_id_ref; - CHECK(user_channel_id->arr_len == 16); - memcpy(user_channel_id_ref.le_bytes, user_channel_id->elems, 16); FREE(user_channel_id); - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(&this_arg_conv, &temporary_channel_id_conv, counterparty_node_id_ref, user_channel_id_ref); - return tag_ptr(ret_conv, true); +int32_t CS_LDK_OutboundHTLCStateDetails_clone(int64_t orig) { + LDKOutboundHTLCStateDetails* orig_conv = (LDKOutboundHTLCStateDetails*)untag_ptr(orig); + int32_t ret_conv = LDKOutboundHTLCStateDetails_to_cs(OutboundHTLCStateDetails_clone(orig_conv)); + return ret_conv; } -int64_t CS_LDK_ChannelManager_create_offer_builder(int64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ"); - *ret_conv = ChannelManager_create_offer_builder(&this_arg_conv); - return tag_ptr(ret_conv, true); +int32_t CS_LDK_OutboundHTLCStateDetails_awaiting_remote_revoke_to_add() { + int32_t ret_conv = LDKOutboundHTLCStateDetails_to_cs(OutboundHTLCStateDetails_awaiting_remote_revoke_to_add()); + return ret_conv; } -int64_t CS_LDK_ChannelManager_create_refund_builder(int64_t this_arg, int64_t amount_msats, int64_t absolute_expiry, int8_tArray payment_id, int64_t retry_strategy, int64_t max_total_routing_fee_msat) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - void* retry_strategy_ptr = untag_ptr(retry_strategy); - CHECK_ACCESS(retry_strategy_ptr); - LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr); - retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy)); - void* max_total_routing_fee_msat_ptr = untag_ptr(max_total_routing_fee_msat); - CHECK_ACCESS(max_total_routing_fee_msat_ptr); - LDKCOption_u64Z max_total_routing_fee_msat_conv = *(LDKCOption_u64Z*)(max_total_routing_fee_msat_ptr); - max_total_routing_fee_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(max_total_routing_fee_msat)); - LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ"); - *ret_conv = ChannelManager_create_refund_builder(&this_arg_conv, amount_msats, absolute_expiry, payment_id_ref, retry_strategy_conv, max_total_routing_fee_msat_conv); - return tag_ptr(ret_conv, true); +int32_t CS_LDK_OutboundHTLCStateDetails_committed() { + int32_t ret_conv = LDKOutboundHTLCStateDetails_to_cs(OutboundHTLCStateDetails_committed()); + return ret_conv; } -int64_t CS_LDK_ChannelManager_pay_for_offer(int64_t this_arg, int64_t offer, int64_t quantity, int64_t amount_msats, int64_t payer_note, int8_tArray payment_id, int64_t retry_strategy, int64_t max_total_routing_fee_msat) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOffer offer_conv; - offer_conv.inner = untag_ptr(offer); - offer_conv.is_owned = ptr_is_owned(offer); - CHECK_INNER_FIELD_ACCESS_OR_NULL(offer_conv); - offer_conv.is_owned = false; - void* quantity_ptr = untag_ptr(quantity); - CHECK_ACCESS(quantity_ptr); - LDKCOption_u64Z quantity_conv = *(LDKCOption_u64Z*)(quantity_ptr); - quantity_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(quantity)); - void* amount_msats_ptr = untag_ptr(amount_msats); - CHECK_ACCESS(amount_msats_ptr); - LDKCOption_u64Z amount_msats_conv = *(LDKCOption_u64Z*)(amount_msats_ptr); - amount_msats_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amount_msats)); - void* payer_note_ptr = untag_ptr(payer_note); - CHECK_ACCESS(payer_note_ptr); - LDKCOption_StrZ payer_note_conv = *(LDKCOption_StrZ*)(payer_note_ptr); - payer_note_conv = COption_StrZ_clone((LDKCOption_StrZ*)untag_ptr(payer_note)); - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - void* retry_strategy_ptr = untag_ptr(retry_strategy); - CHECK_ACCESS(retry_strategy_ptr); - LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr); - retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy)); - void* max_total_routing_fee_msat_ptr = untag_ptr(max_total_routing_fee_msat); - CHECK_ACCESS(max_total_routing_fee_msat_ptr); - LDKCOption_u64Z max_total_routing_fee_msat_conv = *(LDKCOption_u64Z*)(max_total_routing_fee_msat_ptr); - max_total_routing_fee_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(max_total_routing_fee_msat)); - LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); - *ret_conv = ChannelManager_pay_for_offer(&this_arg_conv, &offer_conv, quantity_conv, amount_msats_conv, payer_note_conv, payment_id_ref, retry_strategy_conv, max_total_routing_fee_msat_conv); - return tag_ptr(ret_conv, true); +int32_t CS_LDK_OutboundHTLCStateDetails_awaiting_remote_revoke_to_remove_success() { + int32_t ret_conv = LDKOutboundHTLCStateDetails_to_cs(OutboundHTLCStateDetails_awaiting_remote_revoke_to_remove_success()); + return ret_conv; } -int64_t CS_LDK_ChannelManager_request_refund_payment(int64_t this_arg, int64_t refund) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKRefund refund_conv; - refund_conv.inner = untag_ptr(refund); - refund_conv.is_owned = ptr_is_owned(refund); - CHECK_INNER_FIELD_ACCESS_OR_NULL(refund_conv); - refund_conv.is_owned = false; - LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ), "LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ"); - *ret_conv = ChannelManager_request_refund_payment(&this_arg_conv, &refund_conv); - return tag_ptr(ret_conv, true); +int32_t CS_LDK_OutboundHTLCStateDetails_awaiting_remote_revoke_to_remove_failure() { + int32_t ret_conv = LDKOutboundHTLCStateDetails_to_cs(OutboundHTLCStateDetails_awaiting_remote_revoke_to_remove_failure()); + return ret_conv; } -int64_t CS_LDK_ChannelManager_create_inbound_payment(int64_t this_arg, int64_t min_value_msat, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - void* min_value_msat_ptr = untag_ptr(min_value_msat); - CHECK_ACCESS(min_value_msat_ptr); - LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); - min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat)); - void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); - CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); - LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); - min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); - LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ), "LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ"); - *ret_conv = ChannelManager_create_inbound_payment(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); - return tag_ptr(ret_conv, true); +int8_tArray CS_LDK_OutboundHTLCStateDetails_write(int64_t obj) { + LDKOutboundHTLCStateDetails* obj_conv = (LDKOutboundHTLCStateDetails*)untag_ptr(obj); + LDKCVec_u8Z ret_var = OutboundHTLCStateDetails_write(obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -int64_t CS_LDK_ChannelManager_create_inbound_payment_for_hash(int64_t this_arg, int8_tArray payment_hash, int64_t min_value_msat, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - void* min_value_msat_ptr = untag_ptr(min_value_msat); - CHECK_ACCESS(min_value_msat_ptr); - LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); - min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat)); - void* min_final_cltv_expiry_ptr = untag_ptr(min_final_cltv_expiry); - CHECK_ACCESS(min_final_cltv_expiry_ptr); - LDKCOption_u16Z min_final_cltv_expiry_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_ptr); - min_final_cltv_expiry_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry)); - LDKCResult_ThirtyTwoBytesNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesNoneZ), "LDKCResult_ThirtyTwoBytesNoneZ"); - *ret_conv = ChannelManager_create_inbound_payment_for_hash(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs, min_final_cltv_expiry_conv); +int64_t CS_LDK_OutboundHTLCStateDetails_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ), "LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ"); + *ret_conv = OutboundHTLCStateDetails_read(ser_ref); + FREE(ser); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelManager_get_payment_preimage(int64_t this_arg, int8_tArray payment_hash, int8_tArray payment_secret) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - LDKThirtyTwoBytes payment_secret_ref; - CHECK(payment_secret->arr_len == 32); - memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret); - LDKCResult_ThirtyTwoBytesAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesAPIErrorZ), "LDKCResult_ThirtyTwoBytesAPIErrorZ"); - *ret_conv = ChannelManager_get_payment_preimage(&this_arg_conv, payment_hash_ref, payment_secret_ref); - return tag_ptr(ret_conv, true); +void CS_LDK_OutboundHTLCDetails_free(int64_t this_obj) { + LDKOutboundHTLCDetails this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OutboundHTLCDetails_free(this_obj_conv); } -int64_t CS_LDK_ChannelManager_get_phantom_scid(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; - int64_t ret_conv = ChannelManager_get_phantom_scid(&this_arg_conv); +int64_t CS_LDK_OutboundHTLCDetails_get_htlc_id(int64_t this_ptr) { + LDKOutboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = OutboundHTLCDetails_get_htlc_id(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_OutboundHTLCDetails_set_htlc_id(int64_t this_ptr, int64_t val) { + LDKOutboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + OutboundHTLCDetails_set_htlc_id(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_OutboundHTLCDetails_get_amount_msat(int64_t this_ptr) { + LDKOutboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = OutboundHTLCDetails_get_amount_msat(&this_ptr_conv); return ret_conv; } -int64_t CS_LDK_ChannelManager_get_phantom_route_hints(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; - LDKPhantomRouteHints ret_var = ChannelManager_get_phantom_route_hints(&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_OutboundHTLCDetails_set_amount_msat(int64_t this_ptr, int64_t val) { + LDKOutboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + OutboundHTLCDetails_set_amount_msat(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelManager_get_intercept_scid(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; - int64_t ret_conv = ChannelManager_get_intercept_scid(&this_arg_conv); +int32_t CS_LDK_OutboundHTLCDetails_get_cltv_expiry(int64_t this_ptr) { + LDKOutboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = OutboundHTLCDetails_get_cltv_expiry(&this_ptr_conv); return ret_conv; } -int64_t CS_LDK_ChannelManager_compute_inflight_htlcs(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; - LDKInFlightHtlcs ret_var = ChannelManager_compute_inflight_htlcs(&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_OutboundHTLCDetails_set_cltv_expiry(int64_t this_ptr, int32_t val) { + LDKOutboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + OutboundHTLCDetails_set_cltv_expiry(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelManager_as_MessageSendEventsProvider(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; - LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); - *ret_ret = ChannelManager_as_MessageSendEventsProvider(&this_arg_conv); - return tag_ptr(ret_ret, true); +int8_tArray CS_LDK_OutboundHTLCDetails_get_payment_hash(int64_t this_ptr) { + LDKOutboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *OutboundHTLCDetails_get_payment_hash(&this_ptr_conv), 32); + return ret_arr; } -int64_t CS_LDK_ChannelManager_as_EventsProvider(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; - LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); - *ret_ret = ChannelManager_as_EventsProvider(&this_arg_conv); - return tag_ptr(ret_ret, true); +void CS_LDK_OutboundHTLCDetails_set_payment_hash(int64_t this_ptr, int8_tArray val) { + LDKOutboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + OutboundHTLCDetails_set_payment_hash(&this_ptr_conv, val_ref); } -int64_t CS_LDK_ChannelManager_as_Listen(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; - LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); - *ret_ret = ChannelManager_as_Listen(&this_arg_conv); - return tag_ptr(ret_ret, true); +int64_t CS_LDK_OutboundHTLCDetails_get_state(int64_t this_ptr) { + LDKOutboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_OutboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_OutboundHTLCStateDetailsZ), "LDKCOption_OutboundHTLCStateDetailsZ"); + *ret_copy = OutboundHTLCDetails_get_state(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_ChannelManager_as_Confirm(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; - LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); - *ret_ret = ChannelManager_as_Confirm(&this_arg_conv); - return tag_ptr(ret_ret, true); +void CS_LDK_OutboundHTLCDetails_set_state(int64_t this_ptr, int64_t val) { + LDKOutboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_OutboundHTLCStateDetailsZ val_conv = *(LDKCOption_OutboundHTLCStateDetailsZ*)(val_ptr); + val_conv = COption_OutboundHTLCStateDetailsZ_clone((LDKCOption_OutboundHTLCStateDetailsZ*)untag_ptr(val)); + OutboundHTLCDetails_set_state(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelManager_get_event_or_persistence_needed_future(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; - LDKFuture ret_var = ChannelManager_get_event_or_persistence_needed_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); +int64_t CS_LDK_OutboundHTLCDetails_get_skimmed_fee_msat(int64_t this_ptr) { + LDKOutboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = OutboundHTLCDetails_get_skimmed_fee_msat(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -jboolean CS_LDK_ChannelManager_get_and_clear_needs_persistence(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; - jboolean ret_conv = ChannelManager_get_and_clear_needs_persistence(&this_arg_conv); +void CS_LDK_OutboundHTLCDetails_set_skimmed_fee_msat(int64_t this_ptr, int64_t val) { + LDKOutboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + OutboundHTLCDetails_set_skimmed_fee_msat(&this_ptr_conv, val_conv); +} + +jboolean CS_LDK_OutboundHTLCDetails_get_is_dust(int64_t this_ptr) { + LDKOutboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + jboolean ret_conv = OutboundHTLCDetails_get_is_dust(&this_ptr_conv); return ret_conv; } -int64_t CS_LDK_ChannelManager_current_best_block(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; - LDKBestBlock ret_var = ChannelManager_current_best_block(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +void CS_LDK_OutboundHTLCDetails_set_is_dust(int64_t this_ptr, jboolean val) { + LDKOutboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + OutboundHTLCDetails_set_is_dust(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelManager_node_features(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; - LDKNodeFeatures ret_var = ChannelManager_node_features(&this_arg_conv); +int64_t CS_LDK_OutboundHTLCDetails_new(int64_t htlc_id_arg, int64_t amount_msat_arg, int32_t cltv_expiry_arg, int8_tArray payment_hash_arg, int64_t state_arg, int64_t skimmed_fee_msat_arg, jboolean is_dust_arg) { + void* htlc_id_arg_ptr = untag_ptr(htlc_id_arg); + CHECK_ACCESS(htlc_id_arg_ptr); + LDKCOption_u64Z htlc_id_arg_conv = *(LDKCOption_u64Z*)(htlc_id_arg_ptr); + htlc_id_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_id_arg)); + LDKThirtyTwoBytes payment_hash_arg_ref; + CHECK(payment_hash_arg->arr_len == 32); + memcpy(payment_hash_arg_ref.data, payment_hash_arg->elems, 32); FREE(payment_hash_arg); + void* state_arg_ptr = untag_ptr(state_arg); + CHECK_ACCESS(state_arg_ptr); + LDKCOption_OutboundHTLCStateDetailsZ state_arg_conv = *(LDKCOption_OutboundHTLCStateDetailsZ*)(state_arg_ptr); + state_arg_conv = COption_OutboundHTLCStateDetailsZ_clone((LDKCOption_OutboundHTLCStateDetailsZ*)untag_ptr(state_arg)); + void* skimmed_fee_msat_arg_ptr = untag_ptr(skimmed_fee_msat_arg); + CHECK_ACCESS(skimmed_fee_msat_arg_ptr); + LDKCOption_u64Z skimmed_fee_msat_arg_conv = *(LDKCOption_u64Z*)(skimmed_fee_msat_arg_ptr); + skimmed_fee_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(skimmed_fee_msat_arg)); + LDKOutboundHTLCDetails ret_var = OutboundHTLCDetails_new(htlc_id_arg_conv, amount_msat_arg, cltv_expiry_arg, payment_hash_arg_ref, state_arg_conv, skimmed_fee_msat_arg_conv, is_dust_arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_ChannelManager_channel_features(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; - LDKChannelFeatures ret_var = ChannelManager_channel_features(&this_arg_conv); +static inline uint64_t OutboundHTLCDetails_clone_ptr(LDKOutboundHTLCDetails *NONNULL_PTR arg) { + LDKOutboundHTLCDetails ret_var = OutboundHTLCDetails_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } +int64_t CS_LDK_OutboundHTLCDetails_clone_ptr(int64_t arg) { + LDKOutboundHTLCDetails arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = OutboundHTLCDetails_clone_ptr(&arg_conv); + return ret_conv; +} -int64_t CS_LDK_ChannelManager_channel_type_features(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; - LDKChannelTypeFeatures ret_var = ChannelManager_channel_type_features(&this_arg_conv); +int64_t CS_LDK_OutboundHTLCDetails_clone(int64_t orig) { + LDKOutboundHTLCDetails orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKOutboundHTLCDetails ret_var = OutboundHTLCDetails_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_ChannelManager_init_features(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; - LDKInitFeatures ret_var = ChannelManager_init_features(&this_arg_conv); +int8_tArray CS_LDK_OutboundHTLCDetails_write(int64_t obj) { + LDKOutboundHTLCDetails obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = OutboundHTLCDetails_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_OutboundHTLCDetails_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_OutboundHTLCDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutboundHTLCDetailsDecodeErrorZ), "LDKCResult_OutboundHTLCDetailsDecodeErrorZ"); + *ret_conv = OutboundHTLCDetails_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_CounterpartyForwardingInfo_free(int64_t this_obj) { + LDKCounterpartyForwardingInfo this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + CounterpartyForwardingInfo_free(this_obj_conv); +} + +int32_t CS_LDK_CounterpartyForwardingInfo_get_fee_base_msat(int64_t this_ptr) { + LDKCounterpartyForwardingInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = CounterpartyForwardingInfo_get_fee_base_msat(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_CounterpartyForwardingInfo_set_fee_base_msat(int64_t this_ptr, int32_t val) { + LDKCounterpartyForwardingInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + CounterpartyForwardingInfo_set_fee_base_msat(&this_ptr_conv, val); +} + +int32_t CS_LDK_CounterpartyForwardingInfo_get_fee_proportional_millionths(int64_t this_ptr) { + LDKCounterpartyForwardingInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = CounterpartyForwardingInfo_get_fee_proportional_millionths(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_CounterpartyForwardingInfo_set_fee_proportional_millionths(int64_t this_ptr, int32_t val) { + LDKCounterpartyForwardingInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + CounterpartyForwardingInfo_set_fee_proportional_millionths(&this_ptr_conv, val); +} + +int16_t CS_LDK_CounterpartyForwardingInfo_get_cltv_expiry_delta(int64_t this_ptr) { + LDKCounterpartyForwardingInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int16_t ret_conv = CounterpartyForwardingInfo_get_cltv_expiry_delta(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_CounterpartyForwardingInfo_set_cltv_expiry_delta(int64_t this_ptr, int16_t val) { + LDKCounterpartyForwardingInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + CounterpartyForwardingInfo_set_cltv_expiry_delta(&this_ptr_conv, val); +} + +int64_t CS_LDK_CounterpartyForwardingInfo_new(int32_t fee_base_msat_arg, int32_t fee_proportional_millionths_arg, int16_t cltv_expiry_delta_arg) { + LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_ChannelManager_as_ChannelMessageHandler(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; - LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler"); - *ret_ret = ChannelManager_as_ChannelMessageHandler(&this_arg_conv); - return tag_ptr(ret_ret, true); -} - -int64_t CS_LDK_ChannelManager_as_OffersMessageHandler(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; - LDKOffersMessageHandler* ret_ret = MALLOC(sizeof(LDKOffersMessageHandler), "LDKOffersMessageHandler"); - *ret_ret = ChannelManager_as_OffersMessageHandler(&this_arg_conv); - return tag_ptr(ret_ret, true); +static inline uint64_t CounterpartyForwardingInfo_clone_ptr(LDKCounterpartyForwardingInfo *NONNULL_PTR arg) { + LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } - -int64_t CS_LDK_ChannelManager_as_NodeIdLookUp(int64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeIdLookUp* ret_ret = MALLOC(sizeof(LDKNodeIdLookUp), "LDKNodeIdLookUp"); - *ret_ret = ChannelManager_as_NodeIdLookUp(&this_arg_conv); - return tag_ptr(ret_ret, true); +int64_t CS_LDK_CounterpartyForwardingInfo_clone_ptr(int64_t arg) { + LDKCounterpartyForwardingInfo arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = CounterpartyForwardingInfo_clone_ptr(&arg_conv); + return ret_conv; } -int64_t CS_LDK_provided_init_features(int64_t config) { - LDKUserConfig config_conv; - config_conv.inner = untag_ptr(config); - config_conv.is_owned = ptr_is_owned(config); - CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv); - config_conv.is_owned = false; - LDKInitFeatures ret_var = provided_init_features(&config_conv); +int64_t CS_LDK_CounterpartyForwardingInfo_clone(int64_t orig) { + LDKCounterpartyForwardingInfo orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_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); @@ -43428,1419 +44950,1212 @@ int64_t CS_LDK_CounterpartyForwardingInfo_read(int8_tArray ser) { return tag_ptr(ret_conv, true); } -int8_tArray CS_LDK_ChannelCounterparty_write(int64_t obj) { - LDKChannelCounterparty obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ChannelCounterparty_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); +void CS_LDK_ChannelCounterparty_free(int64_t this_obj) { + LDKChannelCounterparty this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelCounterparty_free(this_obj_conv); +} + +int8_tArray CS_LDK_ChannelCounterparty_get_node_id(int64_t this_ptr) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, ChannelCounterparty_get_node_id(&this_ptr_conv).compressed_form, 33); return ret_arr; } -int64_t CS_LDK_ChannelCounterparty_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); - *ret_conv = ChannelCounterparty_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void CS_LDK_ChannelCounterparty_set_node_id(int64_t this_ptr, int8_tArray val) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + ChannelCounterparty_set_node_id(&this_ptr_conv, val_ref); } -int8_tArray CS_LDK_ChannelDetails_write(int64_t obj) { - LDKChannelDetails obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ChannelDetails_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +int64_t CS_LDK_ChannelCounterparty_get_features(int64_t this_ptr) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKInitFeatures ret_var = ChannelCounterparty_get_features(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -int64_t CS_LDK_ChannelDetails_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); - *ret_conv = ChannelDetails_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void CS_LDK_ChannelCounterparty_set_features(int64_t this_ptr, int64_t val) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKInitFeatures val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = InitFeatures_clone(&val_conv); + ChannelCounterparty_set_features(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_PhantomRouteHints_write(int64_t obj) { - LDKPhantomRouteHints obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = PhantomRouteHints_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +int64_t CS_LDK_ChannelCounterparty_get_unspendable_punishment_reserve(int64_t this_ptr) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ChannelCounterparty_get_unspendable_punishment_reserve(&this_ptr_conv); + return ret_conv; } -int64_t CS_LDK_PhantomRouteHints_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ"); - *ret_conv = PhantomRouteHints_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void CS_LDK_ChannelCounterparty_set_unspendable_punishment_reserve(int64_t this_ptr, int64_t val) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelCounterparty_set_unspendable_punishment_reserve(&this_ptr_conv, val); } -int8_tArray CS_LDK_BlindedForward_write(int64_t obj) { - LDKBlindedForward obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = BlindedForward_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +int64_t CS_LDK_ChannelCounterparty_get_forwarding_info(int64_t this_ptr) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCounterpartyForwardingInfo ret_var = ChannelCounterparty_get_forwarding_info(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -int64_t CS_LDK_BlindedForward_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_BlindedForwardDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedForwardDecodeErrorZ), "LDKCResult_BlindedForwardDecodeErrorZ"); - *ret_conv = BlindedForward_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void CS_LDK_ChannelCounterparty_set_forwarding_info(int64_t this_ptr, int64_t val) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCounterpartyForwardingInfo val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = CounterpartyForwardingInfo_clone(&val_conv); + ChannelCounterparty_set_forwarding_info(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_PendingHTLCRouting_write(int64_t obj) { - LDKPendingHTLCRouting* obj_conv = (LDKPendingHTLCRouting*)untag_ptr(obj); - LDKCVec_u8Z ret_var = PendingHTLCRouting_write(obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +int64_t CS_LDK_ChannelCounterparty_get_outbound_htlc_minimum_msat(int64_t this_ptr) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelCounterparty_get_outbound_htlc_minimum_msat(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_PendingHTLCRouting_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_PendingHTLCRoutingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PendingHTLCRoutingDecodeErrorZ), "LDKCResult_PendingHTLCRoutingDecodeErrorZ"); - *ret_conv = PendingHTLCRouting_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void CS_LDK_ChannelCounterparty_set_outbound_htlc_minimum_msat(int64_t this_ptr, int64_t val) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + ChannelCounterparty_set_outbound_htlc_minimum_msat(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_PendingHTLCInfo_write(int64_t obj) { - LDKPendingHTLCInfo obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = PendingHTLCInfo_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +int64_t CS_LDK_ChannelCounterparty_get_outbound_htlc_maximum_msat(int64_t this_ptr) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelCounterparty_get_outbound_htlc_maximum_msat(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_PendingHTLCInfo_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_PendingHTLCInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PendingHTLCInfoDecodeErrorZ), "LDKCResult_PendingHTLCInfoDecodeErrorZ"); - *ret_conv = PendingHTLCInfo_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void CS_LDK_ChannelCounterparty_set_outbound_htlc_maximum_msat(int64_t this_ptr, int64_t val) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + ChannelCounterparty_set_outbound_htlc_maximum_msat(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_BlindedFailure_write(int64_t obj) { - LDKBlindedFailure* obj_conv = (LDKBlindedFailure*)untag_ptr(obj); - LDKCVec_u8Z ret_var = BlindedFailure_write(obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +int64_t CS_LDK_ChannelCounterparty_new(int8_tArray node_id_arg, int64_t features_arg, int64_t unspendable_punishment_reserve_arg, int64_t forwarding_info_arg, int64_t outbound_htlc_minimum_msat_arg, int64_t outbound_htlc_maximum_msat_arg) { + LDKPublicKey node_id_arg_ref; + CHECK(node_id_arg->arr_len == 33); + memcpy(node_id_arg_ref.compressed_form, node_id_arg->elems, 33); FREE(node_id_arg); + LDKInitFeatures features_arg_conv; + features_arg_conv.inner = untag_ptr(features_arg); + features_arg_conv.is_owned = ptr_is_owned(features_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); + features_arg_conv = InitFeatures_clone(&features_arg_conv); + LDKCounterpartyForwardingInfo forwarding_info_arg_conv; + forwarding_info_arg_conv.inner = untag_ptr(forwarding_info_arg); + forwarding_info_arg_conv.is_owned = ptr_is_owned(forwarding_info_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(forwarding_info_arg_conv); + forwarding_info_arg_conv = CounterpartyForwardingInfo_clone(&forwarding_info_arg_conv); + void* outbound_htlc_minimum_msat_arg_ptr = untag_ptr(outbound_htlc_minimum_msat_arg); + CHECK_ACCESS(outbound_htlc_minimum_msat_arg_ptr); + LDKCOption_u64Z outbound_htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(outbound_htlc_minimum_msat_arg_ptr); + outbound_htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_htlc_minimum_msat_arg)); + void* outbound_htlc_maximum_msat_arg_ptr = untag_ptr(outbound_htlc_maximum_msat_arg); + CHECK_ACCESS(outbound_htlc_maximum_msat_arg_ptr); + LDKCOption_u64Z outbound_htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(outbound_htlc_maximum_msat_arg_ptr); + outbound_htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_htlc_maximum_msat_arg)); + LDKChannelCounterparty ret_var = ChannelCounterparty_new(node_id_arg_ref, features_arg_conv, unspendable_punishment_reserve_arg, forwarding_info_arg_conv, outbound_htlc_minimum_msat_arg_conv, outbound_htlc_maximum_msat_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -int64_t CS_LDK_BlindedFailure_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_BlindedFailureDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedFailureDecodeErrorZ), "LDKCResult_BlindedFailureDecodeErrorZ"); - *ret_conv = BlindedFailure_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +static inline uint64_t ChannelCounterparty_clone_ptr(LDKChannelCounterparty *NONNULL_PTR arg) { + LDKChannelCounterparty ret_var = ChannelCounterparty_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_ChannelCounterparty_clone_ptr(int64_t arg) { + LDKChannelCounterparty arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = ChannelCounterparty_clone_ptr(&arg_conv); + return ret_conv; } -int8_tArray CS_LDK_ChannelManager_write(int64_t obj) { - LDKChannelManager obj_conv; +int64_t CS_LDK_ChannelCounterparty_clone(int64_t orig) { + LDKChannelCounterparty orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKChannelCounterparty ret_var = ChannelCounterparty_clone(&orig_conv); + int64_t ret_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_ChannelCounterparty_write(int64_t obj) { + LDKChannelCounterparty obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ChannelManager_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -int8_tArray CS_LDK_ChannelShutdownState_write(int64_t obj) { - LDKChannelShutdownState* obj_conv = (LDKChannelShutdownState*)untag_ptr(obj); - LDKCVec_u8Z ret_var = ChannelShutdownState_write(obj_conv); + LDKCVec_u8Z ret_var = ChannelCounterparty_write(&obj_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_ChannelShutdownState_read(int8_tArray ser) { +int64_t CS_LDK_ChannelCounterparty_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_ChannelShutdownStateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelShutdownStateDecodeErrorZ), "LDKCResult_ChannelShutdownStateDecodeErrorZ"); - *ret_conv = ChannelShutdownState_read(ser_ref); + LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); + *ret_conv = ChannelCounterparty_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_ChannelManagerReadArgs_free(int64_t this_obj) { - LDKChannelManagerReadArgs this_obj_conv; +void CS_LDK_ChannelDetails_free(int64_t this_obj) { + LDKChannelDetails this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelManagerReadArgs_free(this_obj_conv); + ChannelDetails_free(this_obj_conv); } -int64_t CS_LDK_ChannelManagerReadArgs_get_entropy_source(int64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +int64_t CS_LDK_ChannelDetails_get_channel_id(int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - // WARNING: This object doesn't live past this scope, needs clone! - int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_entropy_source(&this_ptr_conv), false); - return ret_ret; + LDKChannelId ret_var = ChannelDetails_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_ChannelManagerReadArgs_set_entropy_source(int64_t this_ptr, int64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +void CS_LDK_ChannelDetails_set_channel_id(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKEntropySource val_conv = *(LDKEntropySource*)(val_ptr); - if (val_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&val_conv); - } - ChannelManagerReadArgs_set_entropy_source(&this_ptr_conv, val_conv); + LDKChannelId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelId_clone(&val_conv); + ChannelDetails_set_channel_id(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelManagerReadArgs_get_node_signer(int64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +int64_t CS_LDK_ChannelDetails_get_counterparty(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; - // WARNING: This object doesn't live past this scope, needs clone! - int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_node_signer(&this_ptr_conv), false); - return ret_ret; + LDKChannelCounterparty ret_var = ChannelDetails_get_counterparty(&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_ChannelManagerReadArgs_set_node_signer(int64_t this_ptr, int64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +void CS_LDK_ChannelDetails_set_counterparty(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKNodeSigner val_conv = *(LDKNodeSigner*)(val_ptr); - if (val_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&val_conv); - } - ChannelManagerReadArgs_set_node_signer(&this_ptr_conv, val_conv); + LDKChannelCounterparty val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelCounterparty_clone(&val_conv); + ChannelDetails_set_counterparty(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelManagerReadArgs_get_signer_provider(int64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +int64_t CS_LDK_ChannelDetails_get_funding_txo(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; - // WARNING: This object doesn't live past this scope, needs clone! - int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_signer_provider(&this_ptr_conv), false); - return ret_ret; + LDKOutPoint ret_var = ChannelDetails_get_funding_txo(&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_ChannelManagerReadArgs_set_signer_provider(int64_t this_ptr, int64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +void CS_LDK_ChannelDetails_set_funding_txo(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKSignerProvider val_conv = *(LDKSignerProvider*)(val_ptr); - if (val_conv.free == LDKSignerProvider_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKSignerProvider_JCalls_cloned(&val_conv); - } - ChannelManagerReadArgs_set_signer_provider(&this_ptr_conv, val_conv); + LDKOutPoint val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = OutPoint_clone(&val_conv); + ChannelDetails_set_funding_txo(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelManagerReadArgs_get_fee_estimator(int64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +int64_t CS_LDK_ChannelDetails_get_channel_type(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; - // WARNING: This object doesn't live past this scope, needs clone! - int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_fee_estimator(&this_ptr_conv), false); - return ret_ret; + LDKChannelTypeFeatures ret_var = ChannelDetails_get_channel_type(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_ChannelManagerReadArgs_set_fee_estimator(int64_t this_ptr, int64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +void CS_LDK_ChannelDetails_set_channel_type(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKFeeEstimator val_conv = *(LDKFeeEstimator*)(val_ptr); - if (val_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&val_conv); - } - ChannelManagerReadArgs_set_fee_estimator(&this_ptr_conv, val_conv); + LDKChannelTypeFeatures val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelTypeFeatures_clone(&val_conv); + ChannelDetails_set_channel_type(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelManagerReadArgs_get_chain_monitor(int64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +int64_t CS_LDK_ChannelDetails_get_short_channel_id(int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - // WARNING: This object doesn't live past this scope, needs clone! - int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_chain_monitor(&this_ptr_conv), false); - return ret_ret; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_short_channel_id(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_ChannelManagerReadArgs_set_chain_monitor(int64_t this_ptr, int64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +void CS_LDK_ChannelDetails_set_short_channel_id(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; void* val_ptr = untag_ptr(val); CHECK_ACCESS(val_ptr); - LDKWatch val_conv = *(LDKWatch*)(val_ptr); - if (val_conv.free == LDKWatch_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKWatch_JCalls_cloned(&val_conv); - } - ChannelManagerReadArgs_set_chain_monitor(&this_ptr_conv, val_conv); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + ChannelDetails_set_short_channel_id(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelManagerReadArgs_get_tx_broadcaster(int64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +int64_t CS_LDK_ChannelDetails_get_outbound_scid_alias(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; - // WARNING: This object doesn't live past this scope, needs clone! - int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv), false); - return ret_ret; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_outbound_scid_alias(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_ChannelManagerReadArgs_set_tx_broadcaster(int64_t this_ptr, int64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +void CS_LDK_ChannelDetails_set_outbound_scid_alias(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; void* val_ptr = untag_ptr(val); CHECK_ACCESS(val_ptr); - LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)(val_ptr); - if (val_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&val_conv); - } - ChannelManagerReadArgs_set_tx_broadcaster(&this_ptr_conv, val_conv); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + ChannelDetails_set_outbound_scid_alias(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelManagerReadArgs_get_router(int64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +int64_t CS_LDK_ChannelDetails_get_inbound_scid_alias(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; - // WARNING: This object doesn't live past this scope, needs clone! - int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_router(&this_ptr_conv), false); - return ret_ret; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_inbound_scid_alias(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_ChannelManagerReadArgs_set_router(int64_t this_ptr, int64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +void CS_LDK_ChannelDetails_set_inbound_scid_alias(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; void* val_ptr = untag_ptr(val); CHECK_ACCESS(val_ptr); - LDKRouter val_conv = *(LDKRouter*)(val_ptr); - if (val_conv.free == LDKRouter_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKRouter_JCalls_cloned(&val_conv); - } - ChannelManagerReadArgs_set_router(&this_ptr_conv, val_conv); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + ChannelDetails_set_inbound_scid_alias(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelManagerReadArgs_get_logger(int64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +int64_t CS_LDK_ChannelDetails_get_channel_value_satoshis(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; - // WARNING: This object doesn't live past this scope, needs clone! - int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_logger(&this_ptr_conv), false); - return ret_ret; + int64_t ret_conv = ChannelDetails_get_channel_value_satoshis(&this_ptr_conv); + return ret_conv; } -void CS_LDK_ChannelManagerReadArgs_set_logger(int64_t this_ptr, int64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +void CS_LDK_ChannelDetails_set_channel_value_satoshis(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKLogger val_conv = *(LDKLogger*)(val_ptr); - if (val_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&val_conv); - } - ChannelManagerReadArgs_set_logger(&this_ptr_conv, val_conv); + ChannelDetails_set_channel_value_satoshis(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelManagerReadArgs_get_default_config(int64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +int64_t CS_LDK_ChannelDetails_get_unspendable_punishment_reserve(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; - LDKUserConfig ret_var = ChannelManagerReadArgs_get_default_config(&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); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_unspendable_punishment_reserve(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void CS_LDK_ChannelManagerReadArgs_set_default_config(int64_t this_ptr, int64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +void CS_LDK_ChannelDetails_set_unspendable_punishment_reserve(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKUserConfig val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = UserConfig_clone(&val_conv); - ChannelManagerReadArgs_set_default_config(&this_ptr_conv, val_conv); -} - -int64_t CS_LDK_ChannelManagerReadArgs_new(int64_t entropy_source, int64_t node_signer, int64_t signer_provider, int64_t fee_estimator, int64_t chain_monitor, int64_t tx_broadcaster, int64_t router, int64_t logger, int64_t default_config, int64_tArray channel_monitors) { - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* signer_provider_ptr = untag_ptr(signer_provider); - CHECK_ACCESS(signer_provider_ptr); - LDKSignerProvider signer_provider_conv = *(LDKSignerProvider*)(signer_provider_ptr); - if (signer_provider_conv.free == LDKSignerProvider_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKSignerProvider_JCalls_cloned(&signer_provider_conv); - } - void* fee_estimator_ptr = untag_ptr(fee_estimator); - CHECK_ACCESS(fee_estimator_ptr); - LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); - } - void* chain_monitor_ptr = untag_ptr(chain_monitor); - CHECK_ACCESS(chain_monitor_ptr); - LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr); - if (chain_monitor_conv.free == LDKWatch_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKWatch_JCalls_cloned(&chain_monitor_conv); - } - void* tx_broadcaster_ptr = untag_ptr(tx_broadcaster); - CHECK_ACCESS(tx_broadcaster_ptr); - LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr); - if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv); - } - void* router_ptr = untag_ptr(router); - CHECK_ACCESS(router_ptr); - LDKRouter router_conv = *(LDKRouter*)(router_ptr); - if (router_conv.free == LDKRouter_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKRouter_JCalls_cloned(&router_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKUserConfig default_config_conv; - default_config_conv.inner = untag_ptr(default_config); - default_config_conv.is_owned = ptr_is_owned(default_config); - CHECK_INNER_FIELD_ACCESS_OR_NULL(default_config_conv); - default_config_conv = UserConfig_clone(&default_config_conv); - LDKCVec_ChannelMonitorZ channel_monitors_constr; - channel_monitors_constr.datalen = channel_monitors->arr_len; - if (channel_monitors_constr.datalen > 0) - channel_monitors_constr.data = MALLOC(channel_monitors_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements"); - else - channel_monitors_constr.data = NULL; - int64_t* channel_monitors_vals = channel_monitors->elems; - for (size_t q = 0; q < channel_monitors_constr.datalen; q++) { - int64_t channel_monitors_conv_16 = channel_monitors_vals[q]; - LDKChannelMonitor channel_monitors_conv_16_conv; - channel_monitors_conv_16_conv.inner = untag_ptr(channel_monitors_conv_16); - channel_monitors_conv_16_conv.is_owned = ptr_is_owned(channel_monitors_conv_16); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_monitors_conv_16_conv); - channel_monitors_conv_16_conv.is_owned = false; - channel_monitors_constr.data[q] = channel_monitors_conv_16_conv; - } - FREE(channel_monitors); - LDKChannelManagerReadArgs ret_var = ChannelManagerReadArgs_new(entropy_source_conv, node_signer_conv, signer_provider_conv, fee_estimator_conv, chain_monitor_conv, tx_broadcaster_conv, router_conv, logger_conv, default_config_conv, channel_monitors_constr); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -int64_t CS_LDK_C2Tuple_ThirtyTwoBytesChannelManagerZ_read(int8_tArray ser, int64_t arg) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKChannelManagerReadArgs arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - // WARNING: we need a move here but no clone is available for LDKChannelManagerReadArgs - - LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ"); - *ret_conv = C2Tuple_ThirtyTwoBytesChannelManagerZ_read(ser_ref, arg_conv); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -void CS_LDK_DelayedPaymentBasepoint_free(int64_t this_obj) { - LDKDelayedPaymentBasepoint this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - DelayedPaymentBasepoint_free(this_obj_conv); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + ChannelDetails_set_unspendable_punishment_reserve(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_DelayedPaymentBasepoint_get_a(int64_t this_ptr) { - LDKDelayedPaymentBasepoint this_ptr_conv; +int8_tArray CS_LDK_ChannelDetails_get_user_channel_id(int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, DelayedPaymentBasepoint_get_a(&this_ptr_conv).compressed_form, 33); + int8_tArray ret_arr = init_int8_tArray(16, __LINE__); + memcpy(ret_arr->elems, ChannelDetails_get_user_channel_id(&this_ptr_conv).le_bytes, 16); return ret_arr; } -void CS_LDK_DelayedPaymentBasepoint_set_a(int64_t this_ptr, int8_tArray val) { - LDKDelayedPaymentBasepoint this_ptr_conv; +void CS_LDK_ChannelDetails_set_user_channel_id(int64_t this_ptr, int8_tArray val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - DelayedPaymentBasepoint_set_a(&this_ptr_conv, val_ref); -} - -int64_t CS_LDK_DelayedPaymentBasepoint_new(int8_tArray a_arg) { - LDKPublicKey a_arg_ref; - CHECK(a_arg->arr_len == 33); - memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg); - LDKDelayedPaymentBasepoint ret_var = DelayedPaymentBasepoint_new(a_arg_ref); - int64_t ret_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_DelayedPaymentBasepoint_eq(int64_t a, int64_t b) { - LDKDelayedPaymentBasepoint a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKDelayedPaymentBasepoint b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = DelayedPaymentBasepoint_eq(&a_conv, &b_conv); - return ret_conv; + LDKU128 val_ref; + CHECK(val->arr_len == 16); + memcpy(val_ref.le_bytes, val->elems, 16); FREE(val); + ChannelDetails_set_user_channel_id(&this_ptr_conv, val_ref); } -static inline uint64_t DelayedPaymentBasepoint_clone_ptr(LDKDelayedPaymentBasepoint *NONNULL_PTR arg) { - LDKDelayedPaymentBasepoint ret_var = DelayedPaymentBasepoint_clone(arg); - 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_ChannelDetails_get_feerate_sat_per_1000_weight(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; + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = ChannelDetails_get_feerate_sat_per_1000_weight(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_DelayedPaymentBasepoint_clone_ptr(int64_t arg) { - LDKDelayedPaymentBasepoint arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = DelayedPaymentBasepoint_clone_ptr(&arg_conv); - return ret_conv; -} -int64_t CS_LDK_DelayedPaymentBasepoint_clone(int64_t orig) { - LDKDelayedPaymentBasepoint orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKDelayedPaymentBasepoint ret_var = DelayedPaymentBasepoint_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +void CS_LDK_ChannelDetails_set_feerate_sat_per_1000_weight(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); + val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val)); + ChannelDetails_set_feerate_sat_per_1000_weight(&this_ptr_conv, val_conv); } -int64_t CS_LDK_DelayedPaymentBasepoint_hash(int64_t o) { - LDKDelayedPaymentBasepoint o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = DelayedPaymentBasepoint_hash(&o_conv); +int64_t CS_LDK_ChannelDetails_get_balance_msat(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; + int64_t ret_conv = ChannelDetails_get_balance_msat(&this_ptr_conv); return ret_conv; } -int8_tArray CS_LDK_DelayedPaymentBasepoint_to_public_key(int64_t this_arg) { - LDKDelayedPaymentBasepoint this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, DelayedPaymentBasepoint_to_public_key(&this_arg_conv).compressed_form, 33); - return ret_arr; -} - -int8_tArray CS_LDK_DelayedPaymentBasepoint_derive_add_tweak(int64_t this_arg, int8_tArray per_commitment_point) { - LDKDelayedPaymentBasepoint this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPublicKey per_commitment_point_ref; - CHECK(per_commitment_point->arr_len == 33); - memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point); - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, DelayedPaymentBasepoint_derive_add_tweak(&this_arg_conv, per_commitment_point_ref).data, 32); - return ret_arr; -} - -int8_tArray CS_LDK_DelayedPaymentBasepoint_write(int64_t obj) { - LDKDelayedPaymentBasepoint obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = DelayedPaymentBasepoint_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -int64_t CS_LDK_DelayedPaymentBasepoint_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_DelayedPaymentBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentBasepointDecodeErrorZ), "LDKCResult_DelayedPaymentBasepointDecodeErrorZ"); - *ret_conv = DelayedPaymentBasepoint_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -void CS_LDK_DelayedPaymentKey_free(int64_t this_obj) { - LDKDelayedPaymentKey this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - DelayedPaymentKey_free(this_obj_conv); +void CS_LDK_ChannelDetails_set_balance_msat(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelDetails_set_balance_msat(&this_ptr_conv, val); } -int8_tArray CS_LDK_DelayedPaymentKey_get_a(int64_t this_ptr) { - LDKDelayedPaymentKey this_ptr_conv; +int64_t CS_LDK_ChannelDetails_get_outbound_capacity_msat(int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, DelayedPaymentKey_get_a(&this_ptr_conv).compressed_form, 33); - return ret_arr; + int64_t ret_conv = ChannelDetails_get_outbound_capacity_msat(&this_ptr_conv); + return ret_conv; } -void CS_LDK_DelayedPaymentKey_set_a(int64_t this_ptr, int8_tArray val) { - LDKDelayedPaymentKey this_ptr_conv; +void CS_LDK_ChannelDetails_set_outbound_capacity_msat(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - DelayedPaymentKey_set_a(&this_ptr_conv, val_ref); -} - -int64_t CS_LDK_DelayedPaymentKey_new(int8_tArray a_arg) { - LDKPublicKey a_arg_ref; - CHECK(a_arg->arr_len == 33); - memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg); - LDKDelayedPaymentKey ret_var = DelayedPaymentKey_new(a_arg_ref); - int64_t ret_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_DelayedPaymentKey_eq(int64_t a, int64_t b) { - LDKDelayedPaymentKey a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKDelayedPaymentKey b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = DelayedPaymentKey_eq(&a_conv, &b_conv); - return ret_conv; + ChannelDetails_set_outbound_capacity_msat(&this_ptr_conv, val); } -static inline uint64_t DelayedPaymentKey_clone_ptr(LDKDelayedPaymentKey *NONNULL_PTR arg) { - LDKDelayedPaymentKey ret_var = DelayedPaymentKey_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -int64_t CS_LDK_DelayedPaymentKey_clone_ptr(int64_t arg) { - LDKDelayedPaymentKey arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = DelayedPaymentKey_clone_ptr(&arg_conv); +int64_t CS_LDK_ChannelDetails_get_next_outbound_htlc_limit_msat(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; + int64_t ret_conv = ChannelDetails_get_next_outbound_htlc_limit_msat(&this_ptr_conv); return ret_conv; } -int64_t CS_LDK_DelayedPaymentKey_clone(int64_t orig) { - LDKDelayedPaymentKey orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKDelayedPaymentKey ret_var = DelayedPaymentKey_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +void CS_LDK_ChannelDetails_set_next_outbound_htlc_limit_msat(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelDetails_set_next_outbound_htlc_limit_msat(&this_ptr_conv, val); } -int64_t CS_LDK_DelayedPaymentKey_from_basepoint(int64_t countersignatory_basepoint, int8_tArray per_commitment_point) { - LDKDelayedPaymentBasepoint countersignatory_basepoint_conv; - countersignatory_basepoint_conv.inner = untag_ptr(countersignatory_basepoint); - countersignatory_basepoint_conv.is_owned = ptr_is_owned(countersignatory_basepoint); - CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_basepoint_conv); - countersignatory_basepoint_conv.is_owned = false; - LDKPublicKey per_commitment_point_ref; - CHECK(per_commitment_point->arr_len == 33); - memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point); - LDKDelayedPaymentKey ret_var = DelayedPaymentKey_from_basepoint(&countersignatory_basepoint_conv, per_commitment_point_ref); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +int64_t CS_LDK_ChannelDetails_get_next_outbound_htlc_minimum_msat(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; + int64_t ret_conv = ChannelDetails_get_next_outbound_htlc_minimum_msat(&this_ptr_conv); + return ret_conv; } -int64_t CS_LDK_DelayedPaymentKey_from_secret_key(int8_tArray sk) { - uint8_t sk_arr[32]; - CHECK(sk->arr_len == 32); - memcpy(sk_arr, sk->elems, 32); FREE(sk); - uint8_t (*sk_ref)[32] = &sk_arr; - LDKDelayedPaymentKey ret_var = DelayedPaymentKey_from_secret_key(sk_ref); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +void CS_LDK_ChannelDetails_set_next_outbound_htlc_minimum_msat(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelDetails_set_next_outbound_htlc_minimum_msat(&this_ptr_conv, val); } -int8_tArray CS_LDK_DelayedPaymentKey_to_public_key(int64_t this_arg) { - LDKDelayedPaymentKey this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, DelayedPaymentKey_to_public_key(&this_arg_conv).compressed_form, 33); - return ret_arr; +int64_t CS_LDK_ChannelDetails_get_inbound_capacity_msat(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; + int64_t ret_conv = ChannelDetails_get_inbound_capacity_msat(&this_ptr_conv); + return ret_conv; } -int8_tArray CS_LDK_DelayedPaymentKey_write(int64_t obj) { - LDKDelayedPaymentKey obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = DelayedPaymentKey_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +void CS_LDK_ChannelDetails_set_inbound_capacity_msat(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelDetails_set_inbound_capacity_msat(&this_ptr_conv, val); } -int64_t CS_LDK_DelayedPaymentKey_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_DelayedPaymentKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentKeyDecodeErrorZ), "LDKCResult_DelayedPaymentKeyDecodeErrorZ"); - *ret_conv = DelayedPaymentKey_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_ChannelDetails_get_confirmations_required(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; + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = ChannelDetails_get_confirmations_required(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_HtlcBasepoint_free(int64_t this_obj) { - LDKHtlcBasepoint this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - HtlcBasepoint_free(this_obj_conv); +void CS_LDK_ChannelDetails_set_confirmations_required(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); + val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val)); + ChannelDetails_set_confirmations_required(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_HtlcBasepoint_get_a(int64_t this_ptr) { - LDKHtlcBasepoint this_ptr_conv; +int64_t CS_LDK_ChannelDetails_get_confirmations(int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, HtlcBasepoint_get_a(&this_ptr_conv).compressed_form, 33); - return ret_arr; + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = ChannelDetails_get_confirmations(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_HtlcBasepoint_set_a(int64_t this_ptr, int8_tArray val) { - LDKHtlcBasepoint this_ptr_conv; +void CS_LDK_ChannelDetails_set_confirmations(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - HtlcBasepoint_set_a(&this_ptr_conv, val_ref); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); + val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val)); + ChannelDetails_set_confirmations(&this_ptr_conv, val_conv); } -int64_t CS_LDK_HtlcBasepoint_new(int8_tArray a_arg) { - LDKPublicKey a_arg_ref; - CHECK(a_arg->arr_len == 33); - memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg); - LDKHtlcBasepoint ret_var = HtlcBasepoint_new(a_arg_ref); - 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_ChannelDetails_get_force_close_spend_delay(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; + LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); + *ret_copy = ChannelDetails_get_force_close_spend_delay(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -jboolean CS_LDK_HtlcBasepoint_eq(int64_t a, int64_t b) { - LDKHtlcBasepoint a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKHtlcBasepoint b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = HtlcBasepoint_eq(&a_conv, &b_conv); - return ret_conv; +void CS_LDK_ChannelDetails_set_force_close_spend_delay(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr); + val_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(val)); + ChannelDetails_set_force_close_spend_delay(&this_ptr_conv, val_conv); } -static inline uint64_t HtlcBasepoint_clone_ptr(LDKHtlcBasepoint *NONNULL_PTR arg) { - LDKHtlcBasepoint ret_var = HtlcBasepoint_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -int64_t CS_LDK_HtlcBasepoint_clone_ptr(int64_t arg) { - LDKHtlcBasepoint arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = HtlcBasepoint_clone_ptr(&arg_conv); +jboolean CS_LDK_ChannelDetails_get_is_outbound(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_outbound(&this_ptr_conv); return ret_conv; } -int64_t CS_LDK_HtlcBasepoint_clone(int64_t orig) { - LDKHtlcBasepoint orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKHtlcBasepoint ret_var = HtlcBasepoint_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +void CS_LDK_ChannelDetails_set_is_outbound(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_outbound(&this_ptr_conv, val); } -int64_t CS_LDK_HtlcBasepoint_hash(int64_t o) { - LDKHtlcBasepoint o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = HtlcBasepoint_hash(&o_conv); +jboolean CS_LDK_ChannelDetails_get_is_channel_ready(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_channel_ready(&this_ptr_conv); return ret_conv; } -int8_tArray CS_LDK_HtlcBasepoint_to_public_key(int64_t this_arg) { - LDKHtlcBasepoint this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, HtlcBasepoint_to_public_key(&this_arg_conv).compressed_form, 33); - return ret_arr; +void CS_LDK_ChannelDetails_set_is_channel_ready(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_channel_ready(&this_ptr_conv, val); } -int8_tArray CS_LDK_HtlcBasepoint_derive_add_tweak(int64_t this_arg, int8_tArray per_commitment_point) { - LDKHtlcBasepoint this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPublicKey per_commitment_point_ref; - CHECK(per_commitment_point->arr_len == 33); - memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point); - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, HtlcBasepoint_derive_add_tweak(&this_arg_conv, per_commitment_point_ref).data, 32); - return ret_arr; +int64_t CS_LDK_ChannelDetails_get_channel_shutdown_state(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; + LDKCOption_ChannelShutdownStateZ *ret_copy = MALLOC(sizeof(LDKCOption_ChannelShutdownStateZ), "LDKCOption_ChannelShutdownStateZ"); + *ret_copy = ChannelDetails_get_channel_shutdown_state(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int8_tArray CS_LDK_HtlcBasepoint_write(int64_t obj) { - LDKHtlcBasepoint obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = HtlcBasepoint_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +void CS_LDK_ChannelDetails_set_channel_shutdown_state(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_ChannelShutdownStateZ val_conv = *(LDKCOption_ChannelShutdownStateZ*)(val_ptr); + val_conv = COption_ChannelShutdownStateZ_clone((LDKCOption_ChannelShutdownStateZ*)untag_ptr(val)); + ChannelDetails_set_channel_shutdown_state(&this_ptr_conv, val_conv); } -int64_t CS_LDK_HtlcBasepoint_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_HtlcBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcBasepointDecodeErrorZ), "LDKCResult_HtlcBasepointDecodeErrorZ"); - *ret_conv = HtlcBasepoint_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +jboolean CS_LDK_ChannelDetails_get_is_usable(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_usable(&this_ptr_conv); + return ret_conv; } -void CS_LDK_HtlcKey_free(int64_t this_obj) { - LDKHtlcKey this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - HtlcKey_free(this_obj_conv); +void CS_LDK_ChannelDetails_set_is_usable(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_usable(&this_ptr_conv, val); } -int8_tArray CS_LDK_HtlcKey_get_a(int64_t this_ptr) { - LDKHtlcKey this_ptr_conv; +jboolean CS_LDK_ChannelDetails_get_is_public(int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, HtlcKey_get_a(&this_ptr_conv).compressed_form, 33); - return ret_arr; + jboolean ret_conv = ChannelDetails_get_is_public(&this_ptr_conv); + return ret_conv; } -void CS_LDK_HtlcKey_set_a(int64_t this_ptr, int8_tArray val) { - LDKHtlcKey this_ptr_conv; +void CS_LDK_ChannelDetails_set_is_public(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; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - HtlcKey_set_a(&this_ptr_conv, val_ref); + ChannelDetails_set_is_public(&this_ptr_conv, val); } -int64_t CS_LDK_HtlcKey_new(int8_tArray a_arg) { - LDKPublicKey a_arg_ref; - CHECK(a_arg->arr_len == 33); - memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg); - LDKHtlcKey ret_var = HtlcKey_new(a_arg_ref); - 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_ChannelDetails_get_inbound_htlc_minimum_msat(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; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_inbound_htlc_minimum_msat(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -jboolean CS_LDK_HtlcKey_eq(int64_t a, int64_t b) { - LDKHtlcKey a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKHtlcKey b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = HtlcKey_eq(&a_conv, &b_conv); - return ret_conv; -} - -static inline uint64_t HtlcKey_clone_ptr(LDKHtlcKey *NONNULL_PTR arg) { - LDKHtlcKey ret_var = HtlcKey_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -int64_t CS_LDK_HtlcKey_clone_ptr(int64_t arg) { - LDKHtlcKey arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = HtlcKey_clone_ptr(&arg_conv); - return ret_conv; +void CS_LDK_ChannelDetails_set_inbound_htlc_minimum_msat(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + ChannelDetails_set_inbound_htlc_minimum_msat(&this_ptr_conv, val_conv); } -int64_t CS_LDK_HtlcKey_clone(int64_t orig) { - LDKHtlcKey orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKHtlcKey ret_var = HtlcKey_clone(&orig_conv); - 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_ChannelDetails_get_inbound_htlc_maximum_msat(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; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_inbound_htlc_maximum_msat(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_HtlcKey_from_basepoint(int64_t countersignatory_basepoint, int8_tArray per_commitment_point) { - LDKHtlcBasepoint countersignatory_basepoint_conv; - countersignatory_basepoint_conv.inner = untag_ptr(countersignatory_basepoint); - countersignatory_basepoint_conv.is_owned = ptr_is_owned(countersignatory_basepoint); - CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_basepoint_conv); - countersignatory_basepoint_conv.is_owned = false; - LDKPublicKey per_commitment_point_ref; - CHECK(per_commitment_point->arr_len == 33); - memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point); - LDKHtlcKey ret_var = HtlcKey_from_basepoint(&countersignatory_basepoint_conv, per_commitment_point_ref); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +void CS_LDK_ChannelDetails_set_inbound_htlc_maximum_msat(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + ChannelDetails_set_inbound_htlc_maximum_msat(&this_ptr_conv, val_conv); } -int64_t CS_LDK_HtlcKey_from_secret_key(int8_tArray sk) { - uint8_t sk_arr[32]; - CHECK(sk->arr_len == 32); - memcpy(sk_arr, sk->elems, 32); FREE(sk); - uint8_t (*sk_ref)[32] = &sk_arr; - LDKHtlcKey ret_var = HtlcKey_from_secret_key(sk_ref); +int64_t CS_LDK_ChannelDetails_get_config(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; + LDKChannelConfig ret_var = ChannelDetails_get_config(&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_HtlcKey_to_public_key(int64_t this_arg) { - LDKHtlcKey this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, HtlcKey_to_public_key(&this_arg_conv).compressed_form, 33); - return ret_arr; -} - -int8_tArray CS_LDK_HtlcKey_write(int64_t obj) { - LDKHtlcKey obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = HtlcKey_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -int64_t CS_LDK_HtlcKey_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_HtlcKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcKeyDecodeErrorZ), "LDKCResult_HtlcKeyDecodeErrorZ"); - *ret_conv = HtlcKey_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void CS_LDK_ChannelDetails_set_config(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelConfig val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelConfig_clone(&val_conv); + ChannelDetails_set_config(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_add_public_key_tweak(int8_tArray base_point, int8_tArray tweak) { - LDKPublicKey base_point_ref; - CHECK(base_point->arr_len == 33); - memcpy(base_point_ref.compressed_form, base_point->elems, 33); FREE(base_point); - uint8_t tweak_arr[32]; - CHECK(tweak->arr_len == 32); - memcpy(tweak_arr, tweak->elems, 32); FREE(tweak); - uint8_t (*tweak_ref)[32] = &tweak_arr; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, add_public_key_tweak(base_point_ref, tweak_ref).compressed_form, 33); +int64_tArray CS_LDK_ChannelDetails_get_pending_inbound_htlcs(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; + LDKCVec_InboundHTLCDetailsZ ret_var = ChannelDetails_get_pending_inbound_htlcs(&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 u = 0; u < ret_var.datalen; u++) { + LDKInboundHTLCDetails 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_RevocationBasepoint_free(int64_t this_obj) { - LDKRevocationBasepoint this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - RevocationBasepoint_free(this_obj_conv); +void CS_LDK_ChannelDetails_set_pending_inbound_htlcs(int64_t this_ptr, int64_tArray val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_InboundHTLCDetailsZ val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKInboundHTLCDetails), "LDKCVec_InboundHTLCDetailsZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = val->elems; + for (size_t u = 0; u < val_constr.datalen; u++) { + int64_t val_conv_20 = val_vals[u]; + LDKInboundHTLCDetails val_conv_20_conv; + val_conv_20_conv.inner = untag_ptr(val_conv_20); + val_conv_20_conv.is_owned = ptr_is_owned(val_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_20_conv); + val_conv_20_conv = InboundHTLCDetails_clone(&val_conv_20_conv); + val_constr.data[u] = val_conv_20_conv; + } + FREE(val); + ChannelDetails_set_pending_inbound_htlcs(&this_ptr_conv, val_constr); } -int8_tArray CS_LDK_RevocationBasepoint_get_a(int64_t this_ptr) { - LDKRevocationBasepoint this_ptr_conv; +int64_tArray CS_LDK_ChannelDetails_get_pending_outbound_htlcs(int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, RevocationBasepoint_get_a(&this_ptr_conv).compressed_form, 33); + LDKCVec_OutboundHTLCDetailsZ ret_var = ChannelDetails_get_pending_outbound_htlcs(&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 v = 0; v < ret_var.datalen; v++) { + LDKOutboundHTLCDetails ret_conv_21_var = ret_var.data[v]; + int64_t ret_conv_21_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_21_var); + ret_conv_21_ref = tag_ptr(ret_conv_21_var.inner, ret_conv_21_var.is_owned); + ret_arr_ptr[v] = ret_conv_21_ref; + } + + FREE(ret_var.data); return ret_arr; } -void CS_LDK_RevocationBasepoint_set_a(int64_t this_ptr, int8_tArray val) { - LDKRevocationBasepoint this_ptr_conv; +void CS_LDK_ChannelDetails_set_pending_outbound_htlcs(int64_t this_ptr, int64_tArray val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - RevocationBasepoint_set_a(&this_ptr_conv, val_ref); + LDKCVec_OutboundHTLCDetailsZ val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKOutboundHTLCDetails), "LDKCVec_OutboundHTLCDetailsZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = val->elems; + for (size_t v = 0; v < val_constr.datalen; v++) { + int64_t val_conv_21 = val_vals[v]; + LDKOutboundHTLCDetails val_conv_21_conv; + val_conv_21_conv.inner = untag_ptr(val_conv_21); + val_conv_21_conv.is_owned = ptr_is_owned(val_conv_21); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_21_conv); + val_conv_21_conv = OutboundHTLCDetails_clone(&val_conv_21_conv); + val_constr.data[v] = val_conv_21_conv; + } + FREE(val); + ChannelDetails_set_pending_outbound_htlcs(&this_ptr_conv, val_constr); } -int64_t CS_LDK_RevocationBasepoint_new(int8_tArray a_arg) { - LDKPublicKey a_arg_ref; - CHECK(a_arg->arr_len == 33); - memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg); - LDKRevocationBasepoint ret_var = RevocationBasepoint_new(a_arg_ref); +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) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); + LDKChannelCounterparty counterparty_arg_conv; + counterparty_arg_conv.inner = untag_ptr(counterparty_arg); + counterparty_arg_conv.is_owned = ptr_is_owned(counterparty_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_arg_conv); + counterparty_arg_conv = ChannelCounterparty_clone(&counterparty_arg_conv); + LDKOutPoint funding_txo_arg_conv; + funding_txo_arg_conv.inner = untag_ptr(funding_txo_arg); + funding_txo_arg_conv.is_owned = ptr_is_owned(funding_txo_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_arg_conv); + funding_txo_arg_conv = OutPoint_clone(&funding_txo_arg_conv); + LDKChannelTypeFeatures channel_type_arg_conv; + channel_type_arg_conv.inner = untag_ptr(channel_type_arg); + channel_type_arg_conv.is_owned = ptr_is_owned(channel_type_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_arg_conv); + channel_type_arg_conv = ChannelTypeFeatures_clone(&channel_type_arg_conv); + void* short_channel_id_arg_ptr = untag_ptr(short_channel_id_arg); + CHECK_ACCESS(short_channel_id_arg_ptr); + LDKCOption_u64Z short_channel_id_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_arg_ptr); + short_channel_id_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id_arg)); + void* outbound_scid_alias_arg_ptr = untag_ptr(outbound_scid_alias_arg); + CHECK_ACCESS(outbound_scid_alias_arg_ptr); + LDKCOption_u64Z outbound_scid_alias_arg_conv = *(LDKCOption_u64Z*)(outbound_scid_alias_arg_ptr); + outbound_scid_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_scid_alias_arg)); + void* inbound_scid_alias_arg_ptr = untag_ptr(inbound_scid_alias_arg); + CHECK_ACCESS(inbound_scid_alias_arg_ptr); + LDKCOption_u64Z inbound_scid_alias_arg_conv = *(LDKCOption_u64Z*)(inbound_scid_alias_arg_ptr); + inbound_scid_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_scid_alias_arg)); + void* unspendable_punishment_reserve_arg_ptr = untag_ptr(unspendable_punishment_reserve_arg); + CHECK_ACCESS(unspendable_punishment_reserve_arg_ptr); + LDKCOption_u64Z unspendable_punishment_reserve_arg_conv = *(LDKCOption_u64Z*)(unspendable_punishment_reserve_arg_ptr); + LDKU128 user_channel_id_arg_ref; + CHECK(user_channel_id_arg->arr_len == 16); + memcpy(user_channel_id_arg_ref.le_bytes, user_channel_id_arg->elems, 16); FREE(user_channel_id_arg); + void* feerate_sat_per_1000_weight_arg_ptr = untag_ptr(feerate_sat_per_1000_weight_arg); + CHECK_ACCESS(feerate_sat_per_1000_weight_arg_ptr); + LDKCOption_u32Z feerate_sat_per_1000_weight_arg_conv = *(LDKCOption_u32Z*)(feerate_sat_per_1000_weight_arg_ptr); + feerate_sat_per_1000_weight_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(feerate_sat_per_1000_weight_arg)); + void* confirmations_required_arg_ptr = untag_ptr(confirmations_required_arg); + CHECK_ACCESS(confirmations_required_arg_ptr); + LDKCOption_u32Z confirmations_required_arg_conv = *(LDKCOption_u32Z*)(confirmations_required_arg_ptr); + confirmations_required_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(confirmations_required_arg)); + void* confirmations_arg_ptr = untag_ptr(confirmations_arg); + CHECK_ACCESS(confirmations_arg_ptr); + LDKCOption_u32Z confirmations_arg_conv = *(LDKCOption_u32Z*)(confirmations_arg_ptr); + confirmations_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(confirmations_arg)); + void* force_close_spend_delay_arg_ptr = untag_ptr(force_close_spend_delay_arg); + CHECK_ACCESS(force_close_spend_delay_arg_ptr); + LDKCOption_u16Z force_close_spend_delay_arg_conv = *(LDKCOption_u16Z*)(force_close_spend_delay_arg_ptr); + force_close_spend_delay_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(force_close_spend_delay_arg)); + void* channel_shutdown_state_arg_ptr = untag_ptr(channel_shutdown_state_arg); + CHECK_ACCESS(channel_shutdown_state_arg_ptr); + LDKCOption_ChannelShutdownStateZ channel_shutdown_state_arg_conv = *(LDKCOption_ChannelShutdownStateZ*)(channel_shutdown_state_arg_ptr); + channel_shutdown_state_arg_conv = COption_ChannelShutdownStateZ_clone((LDKCOption_ChannelShutdownStateZ*)untag_ptr(channel_shutdown_state_arg)); + void* inbound_htlc_minimum_msat_arg_ptr = untag_ptr(inbound_htlc_minimum_msat_arg); + CHECK_ACCESS(inbound_htlc_minimum_msat_arg_ptr); + LDKCOption_u64Z inbound_htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(inbound_htlc_minimum_msat_arg_ptr); + inbound_htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_htlc_minimum_msat_arg)); + void* inbound_htlc_maximum_msat_arg_ptr = untag_ptr(inbound_htlc_maximum_msat_arg); + CHECK_ACCESS(inbound_htlc_maximum_msat_arg_ptr); + LDKCOption_u64Z inbound_htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(inbound_htlc_maximum_msat_arg_ptr); + inbound_htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_htlc_maximum_msat_arg)); + LDKChannelConfig config_arg_conv; + config_arg_conv.inner = untag_ptr(config_arg); + config_arg_conv.is_owned = ptr_is_owned(config_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(config_arg_conv); + config_arg_conv = ChannelConfig_clone(&config_arg_conv); + LDKCVec_InboundHTLCDetailsZ pending_inbound_htlcs_arg_constr; + pending_inbound_htlcs_arg_constr.datalen = pending_inbound_htlcs_arg->arr_len; + if (pending_inbound_htlcs_arg_constr.datalen > 0) + pending_inbound_htlcs_arg_constr.data = MALLOC(pending_inbound_htlcs_arg_constr.datalen * sizeof(LDKInboundHTLCDetails), "LDKCVec_InboundHTLCDetailsZ Elements"); + else + pending_inbound_htlcs_arg_constr.data = NULL; + int64_t* pending_inbound_htlcs_arg_vals = pending_inbound_htlcs_arg->elems; + for (size_t u = 0; u < pending_inbound_htlcs_arg_constr.datalen; u++) { + int64_t pending_inbound_htlcs_arg_conv_20 = pending_inbound_htlcs_arg_vals[u]; + LDKInboundHTLCDetails pending_inbound_htlcs_arg_conv_20_conv; + pending_inbound_htlcs_arg_conv_20_conv.inner = untag_ptr(pending_inbound_htlcs_arg_conv_20); + pending_inbound_htlcs_arg_conv_20_conv.is_owned = ptr_is_owned(pending_inbound_htlcs_arg_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(pending_inbound_htlcs_arg_conv_20_conv); + pending_inbound_htlcs_arg_conv_20_conv = InboundHTLCDetails_clone(&pending_inbound_htlcs_arg_conv_20_conv); + pending_inbound_htlcs_arg_constr.data[u] = pending_inbound_htlcs_arg_conv_20_conv; + } + FREE(pending_inbound_htlcs_arg); + LDKCVec_OutboundHTLCDetailsZ pending_outbound_htlcs_arg_constr; + pending_outbound_htlcs_arg_constr.datalen = pending_outbound_htlcs_arg->arr_len; + if (pending_outbound_htlcs_arg_constr.datalen > 0) + pending_outbound_htlcs_arg_constr.data = MALLOC(pending_outbound_htlcs_arg_constr.datalen * sizeof(LDKOutboundHTLCDetails), "LDKCVec_OutboundHTLCDetailsZ Elements"); + else + pending_outbound_htlcs_arg_constr.data = NULL; + int64_t* pending_outbound_htlcs_arg_vals = pending_outbound_htlcs_arg->elems; + for (size_t v = 0; v < pending_outbound_htlcs_arg_constr.datalen; v++) { + int64_t pending_outbound_htlcs_arg_conv_21 = pending_outbound_htlcs_arg_vals[v]; + LDKOutboundHTLCDetails pending_outbound_htlcs_arg_conv_21_conv; + pending_outbound_htlcs_arg_conv_21_conv.inner = untag_ptr(pending_outbound_htlcs_arg_conv_21); + pending_outbound_htlcs_arg_conv_21_conv.is_owned = ptr_is_owned(pending_outbound_htlcs_arg_conv_21); + CHECK_INNER_FIELD_ACCESS_OR_NULL(pending_outbound_htlcs_arg_conv_21_conv); + pending_outbound_htlcs_arg_conv_21_conv = OutboundHTLCDetails_clone(&pending_outbound_htlcs_arg_conv_21_conv); + pending_outbound_htlcs_arg_constr.data[v] = pending_outbound_htlcs_arg_conv_21_conv; + } + FREE(pending_outbound_htlcs_arg); + LDKChannelDetails ret_var = ChannelDetails_new(channel_id_arg_conv, counterparty_arg_conv, funding_txo_arg_conv, channel_type_arg_conv, short_channel_id_arg_conv, outbound_scid_alias_arg_conv, inbound_scid_alias_arg_conv, channel_value_satoshis_arg, unspendable_punishment_reserve_arg_conv, user_channel_id_arg_ref, feerate_sat_per_1000_weight_arg_conv, balance_msat_arg, outbound_capacity_msat_arg, next_outbound_htlc_limit_msat_arg, next_outbound_htlc_minimum_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg_conv, confirmations_arg_conv, force_close_spend_delay_arg_conv, is_outbound_arg, is_channel_ready_arg, channel_shutdown_state_arg_conv, is_usable_arg, is_public_arg, inbound_htlc_minimum_msat_arg_conv, inbound_htlc_maximum_msat_arg_conv, config_arg_conv, pending_inbound_htlcs_arg_constr, pending_outbound_htlcs_arg_constr); int64_t ret_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_RevocationBasepoint_eq(int64_t a, int64_t b) { - LDKRevocationBasepoint a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKRevocationBasepoint b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = RevocationBasepoint_eq(&a_conv, &b_conv); - return ret_conv; -} - -static inline uint64_t RevocationBasepoint_clone_ptr(LDKRevocationBasepoint *NONNULL_PTR arg) { - LDKRevocationBasepoint ret_var = RevocationBasepoint_clone(arg); +static inline uint64_t ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg) { + LDKChannelDetails ret_var = ChannelDetails_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_RevocationBasepoint_clone_ptr(int64_t arg) { - LDKRevocationBasepoint arg_conv; +int64_t CS_LDK_ChannelDetails_clone_ptr(int64_t arg) { + LDKChannelDetails arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = RevocationBasepoint_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelDetails_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_RevocationBasepoint_clone(int64_t orig) { - LDKRevocationBasepoint orig_conv; +int64_t CS_LDK_ChannelDetails_clone(int64_t orig) { + LDKChannelDetails orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKRevocationBasepoint ret_var = RevocationBasepoint_clone(&orig_conv); + LDKChannelDetails ret_var = ChannelDetails_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_RevocationBasepoint_hash(int64_t o) { - LDKRevocationBasepoint o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = RevocationBasepoint_hash(&o_conv); - return ret_conv; +int64_t CS_LDK_ChannelDetails_get_inbound_payment_scid(int64_t this_arg) { + LDKChannelDetails this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_inbound_payment_scid(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int8_tArray CS_LDK_RevocationBasepoint_to_public_key(int64_t this_arg) { - LDKRevocationBasepoint this_arg_conv; +int64_t CS_LDK_ChannelDetails_get_outbound_payment_scid(int64_t this_arg) { + LDKChannelDetails this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, RevocationBasepoint_to_public_key(&this_arg_conv).compressed_form, 33); - return ret_arr; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_outbound_payment_scid(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int8_tArray CS_LDK_RevocationBasepoint_write(int64_t obj) { - LDKRevocationBasepoint obj_conv; +int8_tArray CS_LDK_ChannelDetails_write(int64_t obj) { + LDKChannelDetails obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = RevocationBasepoint_write(&obj_conv); + LDKCVec_u8Z ret_var = ChannelDetails_write(&obj_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_RevocationBasepoint_read(int8_tArray ser) { +int64_t CS_LDK_ChannelDetails_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_RevocationBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationBasepointDecodeErrorZ), "LDKCResult_RevocationBasepointDecodeErrorZ"); - *ret_conv = RevocationBasepoint_read(ser_ref); + LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); + *ret_conv = ChannelDetails_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_RevocationKey_free(int64_t this_obj) { - LDKRevocationKey this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - RevocationKey_free(this_obj_conv); -} - -int8_tArray CS_LDK_RevocationKey_get_a(int64_t this_ptr) { - LDKRevocationKey this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, RevocationKey_get_a(&this_ptr_conv).compressed_form, 33); - return ret_arr; -} - -void CS_LDK_RevocationKey_set_a(int64_t this_ptr, int8_tArray val) { - LDKRevocationKey this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - RevocationKey_set_a(&this_ptr_conv, val_ref); -} - -int64_t CS_LDK_RevocationKey_new(int8_tArray a_arg) { - LDKPublicKey a_arg_ref; - CHECK(a_arg->arr_len == 33); - memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg); - LDKRevocationKey ret_var = RevocationKey_new(a_arg_ref); - int64_t ret_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_ChannelShutdownState_clone(int64_t orig) { + LDKChannelShutdownState* orig_conv = (LDKChannelShutdownState*)untag_ptr(orig); + int32_t ret_conv = LDKChannelShutdownState_to_cs(ChannelShutdownState_clone(orig_conv)); + return ret_conv; } -jboolean CS_LDK_RevocationKey_eq(int64_t a, int64_t b) { - LDKRevocationKey a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKRevocationKey b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = RevocationKey_eq(&a_conv, &b_conv); +int32_t CS_LDK_ChannelShutdownState_not_shutting_down() { + int32_t ret_conv = LDKChannelShutdownState_to_cs(ChannelShutdownState_not_shutting_down()); return ret_conv; } -static inline uint64_t RevocationKey_clone_ptr(LDKRevocationKey *NONNULL_PTR arg) { - LDKRevocationKey ret_var = RevocationKey_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -int64_t CS_LDK_RevocationKey_clone_ptr(int64_t arg) { - LDKRevocationKey arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = RevocationKey_clone_ptr(&arg_conv); +int32_t CS_LDK_ChannelShutdownState_shutdown_initiated() { + int32_t ret_conv = LDKChannelShutdownState_to_cs(ChannelShutdownState_shutdown_initiated()); return ret_conv; } -int64_t CS_LDK_RevocationKey_clone(int64_t orig) { - LDKRevocationKey orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKRevocationKey ret_var = RevocationKey_clone(&orig_conv); - int64_t ret_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_ChannelShutdownState_resolving_htlcs() { + int32_t ret_conv = LDKChannelShutdownState_to_cs(ChannelShutdownState_resolving_htlcs()); + return ret_conv; } -int64_t CS_LDK_RevocationKey_hash(int64_t o) { - LDKRevocationKey o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = RevocationKey_hash(&o_conv); +int32_t CS_LDK_ChannelShutdownState_negotiating_closing_fee() { + int32_t ret_conv = LDKChannelShutdownState_to_cs(ChannelShutdownState_negotiating_closing_fee()); return ret_conv; } -int64_t CS_LDK_RevocationKey_from_basepoint(int64_t countersignatory_basepoint, int8_tArray per_commitment_point) { - LDKRevocationBasepoint countersignatory_basepoint_conv; - countersignatory_basepoint_conv.inner = untag_ptr(countersignatory_basepoint); - countersignatory_basepoint_conv.is_owned = ptr_is_owned(countersignatory_basepoint); - CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_basepoint_conv); - countersignatory_basepoint_conv.is_owned = false; - LDKPublicKey per_commitment_point_ref; - CHECK(per_commitment_point->arr_len == 33); - memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point); - LDKRevocationKey ret_var = RevocationKey_from_basepoint(&countersignatory_basepoint_conv, per_commitment_point_ref); - int64_t ret_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_ChannelShutdownState_shutdown_complete() { + int32_t ret_conv = LDKChannelShutdownState_to_cs(ChannelShutdownState_shutdown_complete()); + return ret_conv; } -int8_tArray CS_LDK_RevocationKey_to_public_key(int64_t this_arg) { - LDKRevocationKey this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, RevocationKey_to_public_key(&this_arg_conv).compressed_form, 33); - return ret_arr; +jboolean CS_LDK_ChannelShutdownState_eq(int64_t a, int64_t b) { + LDKChannelShutdownState* a_conv = (LDKChannelShutdownState*)untag_ptr(a); + LDKChannelShutdownState* b_conv = (LDKChannelShutdownState*)untag_ptr(b); + jboolean ret_conv = ChannelShutdownState_eq(a_conv, b_conv); + return ret_conv; } -int8_tArray CS_LDK_RevocationKey_write(int64_t obj) { - LDKRevocationKey obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = RevocationKey_write(&obj_conv); +int8_tArray CS_LDK_ChannelShutdownState_write(int64_t obj) { + LDKChannelShutdownState* obj_conv = (LDKChannelShutdownState*)untag_ptr(obj); + LDKCVec_u8Z ret_var = ChannelShutdownState_write(obj_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_RevocationKey_read(int8_tArray ser) { +int64_t CS_LDK_ChannelShutdownState_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_RevocationKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationKeyDecodeErrorZ), "LDKCResult_RevocationKeyDecodeErrorZ"); - *ret_conv = RevocationKey_read(ser_ref); + LDKCResult_ChannelShutdownStateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelShutdownStateDecodeErrorZ), "LDKCResult_ChannelShutdownStateDecodeErrorZ"); + *ret_conv = ChannelShutdownState_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } @@ -51793,6 +53108,14 @@ jboolean CS_LDK_SocketAddressParseError_eq(int64_t a, int64_t b) { return ret_conv; } +jstring CS_LDK_SocketAddressParseError_to_str(int64_t o) { + LDKSocketAddressParseError* o_conv = (LDKSocketAddressParseError*)untag_ptr(o); + LDKStr ret_str = SocketAddressParseError_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_parse_onion_address(jstring host, int16_t port) { LDKStr host_conv = str_ref_to_owned_c(host); LDKCResult_SocketAddressSocketAddressParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SocketAddressSocketAddressParseErrorZ), "LDKCResult_SocketAddressSocketAddressParseErrorZ"); @@ -55044,6 +56367,14 @@ int8_tArray CS_LDK_TrampolineOnionPacket_write(int64_t obj) { return ret_arr; } +jstring CS_LDK_DecodeError_to_str(int64_t o) { + LDKDecodeError* o_conv = (LDKDecodeError*)untag_ptr(o); + LDKStr ret_str = DecodeError_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_AcceptChannel_write(int64_t obj) { LDKAcceptChannel obj_conv; obj_conv.inner = untag_ptr(obj); @@ -56728,6 +58059,18 @@ int64_t CS_LDK_PeerHandleError_clone(int64_t orig) { return ret_ref; } +jstring CS_LDK_PeerHandleError_to_str(int64_t o) { + LDKPeerHandleError o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = PeerHandleError_to_str(&o_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + void CS_LDK_PeerManager_free(int64_t this_obj) { LDKPeerManager this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -62977,6 +64320,18 @@ jboolean CS_LDK_ShutdownScript_is_compatible(int64_t this_arg, int64_t features return ret_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); @@ -63193,6 +64548,18 @@ int64_t CS_LDK_ChannelId_read(int8_tArray 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_Retry_free(int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -64562,6 +65929,18 @@ int64_t CS_LDK_Offer_from_str(jstring s) { 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); @@ -65866,6 +67245,18 @@ int64_t CS_LDK_InvoiceError_from_string(jstring s) { return ret_ref; } +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; +} + int8_tArray CS_LDK_InvoiceError_write(int64_t obj) { LDKInvoiceError obj_conv; obj_conv.inner = untag_ptr(obj); @@ -67977,6 +69368,18 @@ int64_t CS_LDK_Refund_from_str(jstring s) { 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; +} + 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)); @@ -68232,6 +69635,18 @@ int64_t CS_LDK_NodeId_as_pubkey(int64_t this_arg) { 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); @@ -68709,6 +70124,18 @@ jboolean CS_LDK_ChannelUpdateInfo_eq(int64_t a, int64_t b) { return ret_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); + return ret_conv; +} + int8_tArray CS_LDK_ChannelUpdateInfo_write(int64_t obj) { LDKChannelUpdateInfo obj_conv; obj_conv.inner = untag_ptr(obj); @@ -68985,6 +70412,18 @@ int64_t CS_LDK_ChannelInfo_get_directional_info(int64_t this_arg, int8_t channe return ret_ref; } +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; +} + int8_tArray CS_LDK_ChannelInfo_write(int64_t obj) { LDKChannelInfo obj_conv; obj_conv.inner = untag_ptr(obj); @@ -69649,6 +71088,18 @@ jboolean CS_LDK_NodeAlias_eq(int64_t a, int64_t b) { 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); @@ -69827,6 +71278,18 @@ jboolean CS_LDK_NodeInfo_is_tor_only(int64_t this_arg) { 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); @@ -69880,6 +71343,18 @@ int64_t CS_LDK_NetworkGraph_read(int8_tArray ser, int64_t arg) { 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); @@ -71343,6 +72818,18 @@ int64_t CS_LDK_Route_get_total_amount(int64_t this_arg) { 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; obj_conv.inner = untag_ptr(obj); @@ -79272,6 +80759,14 @@ jboolean CS_LDK_ClosureReason_eq(int64_t a, int64_t b) { 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); + 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); diff --git a/c_sharp/bindings.c.body b/c_sharp/bindings.c.body index 172f27f3..e50bf7d1 100644 --- a/c_sharp/bindings.c.body +++ b/c_sharp/bindings.c.body @@ -77,7 +77,8 @@ static inline LDKStr str_ref_to_owned_c(const jstring str) { return res; } -typedef bool jboolean; +// The C# Bool marshalling is defined as 4 bytes, but the size of bool is platform-dependent +typedef int32_t jboolean; int64_t CS_LDK_allocate_buffer(int64_t len) { return (int64_t)MALLOC(len, "C#-requested buffer"); @@ -667,6 +668,24 @@ static inline int32_t LDKIOError_to_cs(LDKIOError val) { default: abort(); } } +static inline LDKInboundHTLCStateDetails LDKInboundHTLCStateDetails_from_cs(int32_t ord) { + switch (ord) { + case 0: return LDKInboundHTLCStateDetails_AwaitingRemoteRevokeToAdd; + case 1: return LDKInboundHTLCStateDetails_Committed; + case 2: return LDKInboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFulfill; + case 3: return LDKInboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFail; + default: abort(); + } +} +static inline int32_t LDKInboundHTLCStateDetails_to_cs(LDKInboundHTLCStateDetails val) { + switch (val) { + case LDKInboundHTLCStateDetails_AwaitingRemoteRevokeToAdd: return 0; + case LDKInboundHTLCStateDetails_Committed: return 1; + case LDKInboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFulfill: return 2; + case LDKInboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFail: return 3; + default: abort(); + } +} static inline LDKLevel LDKLevel_from_cs(int32_t ord) { switch (ord) { case 0: return LDKLevel_Gossip; @@ -707,6 +726,24 @@ static inline int32_t LDKNetwork_to_cs(LDKNetwork val) { default: abort(); } } +static inline LDKOutboundHTLCStateDetails LDKOutboundHTLCStateDetails_from_cs(int32_t ord) { + switch (ord) { + case 0: return LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToAdd; + case 1: return LDKOutboundHTLCStateDetails_Committed; + case 2: return LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveSuccess; + case 3: return LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFailure; + default: abort(); + } +} +static inline int32_t LDKOutboundHTLCStateDetails_to_cs(LDKOutboundHTLCStateDetails val) { + switch (val) { + case LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToAdd: return 0; + case LDKOutboundHTLCStateDetails_Committed: return 1; + case LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveSuccess: return 2; + case LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFailure: return 3; + default: abort(); + } +} static inline LDKPaymentFailureReason LDKPaymentFailureReason_from_cs(int32_t ord) { switch (ord) { case 0: return LDKPaymentFailureReason_RecipientRejected; @@ -5919,20 +5956,6 @@ int64_t CS_LDK_LDKCOption_C2Tuple_u64u16ZZ_Some_get_some(int64_t ptr) { *some_conv = C2Tuple_u64u16Z_clone(some_conv); return tag_ptr(some_conv, true); } -uint32_t CS_LDK_LDKCOption_ChannelShutdownStateZ_ty_from_ptr(int64_t ptr) { - LDKCOption_ChannelShutdownStateZ *obj = (LDKCOption_ChannelShutdownStateZ*)untag_ptr(ptr); - switch(obj->tag) { - case LDKCOption_ChannelShutdownStateZ_Some: return 0; - case LDKCOption_ChannelShutdownStateZ_None: return 1; - default: abort(); - } -} -int32_t CS_LDK_LDKCOption_ChannelShutdownStateZ_Some_get_some(int64_t ptr) { - LDKCOption_ChannelShutdownStateZ *obj = (LDKCOption_ChannelShutdownStateZ*)untag_ptr(ptr); - CHECK(obj->tag == LDKCOption_ChannelShutdownStateZ_Some); - int32_t some_conv = LDKChannelShutdownState_to_cs(obj->some); - return some_conv; -} static inline struct LDKChannelId CResult_ChannelIdAPIErrorZ_get_ok(LDKCResult_ChannelIdAPIErrorZ *NONNULL_PTR owner){ LDKChannelId ret = *owner->contents.result; ret.is_owned = false; @@ -6526,84 +6549,6 @@ static inline LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ CVec_C3Tuple } return ret; } -static inline struct LDKCounterpartyForwardingInfo CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner){ - LDKCounterpartyForwardingInfo ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -int64_t CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(int64_t owner) { - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(owner); - LDKCounterpartyForwardingInfo ret_var = CResult_CounterpartyForwardingInfoDecodeErrorZ_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_CounterpartyForwardingInfoDecodeErrorZ_get_err(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -int64_t CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(int64_t owner) { - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline struct LDKChannelCounterparty CResult_ChannelCounterpartyDecodeErrorZ_get_ok(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner){ - LDKChannelCounterparty ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -int64_t CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_get_ok(int64_t owner) { - LDKCResult_ChannelCounterpartyDecodeErrorZ* owner_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(owner); - LDKChannelCounterparty ret_var = CResult_ChannelCounterpartyDecodeErrorZ_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_ChannelCounterpartyDecodeErrorZ_get_err(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -int64_t CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_get_err(int64_t owner) { - LDKCResult_ChannelCounterpartyDecodeErrorZ* owner_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_ChannelCounterpartyDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline struct LDKChannelDetails CResult_ChannelDetailsDecodeErrorZ_get_ok(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner){ - LDKChannelDetails ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -int64_t CS_LDK_CResult_ChannelDetailsDecodeErrorZ_get_ok(int64_t owner) { - LDKCResult_ChannelDetailsDecodeErrorZ* owner_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(owner); - LDKChannelDetails ret_var = CResult_ChannelDetailsDecodeErrorZ_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_ChannelDetailsDecodeErrorZ_get_err(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -int64_t CS_LDK_CResult_ChannelDetailsDecodeErrorZ_get_err(int64_t owner) { - LDKCResult_ChannelDetailsDecodeErrorZ* owner_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_ChannelDetailsDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - static inline struct LDKPhantomRouteHints CResult_PhantomRouteHintsDecodeErrorZ_get_ok(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR owner){ LDKPhantomRouteHints ret = *owner->contents.result; ret.is_owned = false; @@ -6867,28 +6812,6 @@ int64_t CS_LDK_CResult_BlindedFailureDecodeErrorZ_get_err(int64_t owner) { return ret_ref; } -static inline enum LDKChannelShutdownState CResult_ChannelShutdownStateDecodeErrorZ_get_ok(LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return ChannelShutdownState_clone(&*owner->contents.result); -} -int32_t CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_get_ok(int64_t owner) { - LDKCResult_ChannelShutdownStateDecodeErrorZ* owner_conv = (LDKCResult_ChannelShutdownStateDecodeErrorZ*)untag_ptr(owner); - int32_t ret_conv = LDKChannelShutdownState_to_cs(CResult_ChannelShutdownStateDecodeErrorZ_get_ok(owner_conv)); - return ret_conv; -} - -static inline struct LDKDecodeError CResult_ChannelShutdownStateDecodeErrorZ_get_err(LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -int64_t CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_get_err(int64_t owner) { - LDKCResult_ChannelShutdownStateDecodeErrorZ* owner_conv = (LDKCResult_ChannelShutdownStateDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_ChannelShutdownStateDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - static inline LDKCVec_ChannelMonitorZ CVec_ChannelMonitorZ_clone(const LDKCVec_ChannelMonitorZ *orig) { LDKCVec_ChannelMonitorZ ret = { .data = MALLOC(sizeof(LDKChannelMonitor) * orig->datalen, "LDKCVec_ChannelMonitorZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -10834,6 +10757,262 @@ int64_t CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err(int64_t owner) 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) { + case LDKCOption_InboundHTLCStateDetailsZ_Some: return 0; + case LDKCOption_InboundHTLCStateDetailsZ_None: return 1; + default: abort(); + } +} +int32_t CS_LDK_LDKCOption_InboundHTLCStateDetailsZ_Some_get_some(int64_t ptr) { + LDKCOption_InboundHTLCStateDetailsZ *obj = (LDKCOption_InboundHTLCStateDetailsZ*)untag_ptr(ptr); + CHECK(obj->tag == LDKCOption_InboundHTLCStateDetailsZ_Some); + int32_t some_conv = LDKInboundHTLCStateDetails_to_cs(obj->some); + return some_conv; +} +static inline struct LDKCOption_InboundHTLCStateDetailsZ CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_get_ok(LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return COption_InboundHTLCStateDetailsZ_clone(&*owner->contents.result); +} +int64_t CS_LDK_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ* owner_conv = (LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ*)untag_ptr(owner); + LDKCOption_InboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_InboundHTLCStateDetailsZ), "LDKCOption_InboundHTLCStateDetailsZ"); + *ret_copy = CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_get_err(LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ* owner_conv = (LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKInboundHTLCDetails CResult_InboundHTLCDetailsDecodeErrorZ_get_ok(LDKCResult_InboundHTLCDetailsDecodeErrorZ *NONNULL_PTR owner){ + LDKInboundHTLCDetails ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_InboundHTLCDetailsDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_InboundHTLCDetailsDecodeErrorZ* owner_conv = (LDKCResult_InboundHTLCDetailsDecodeErrorZ*)untag_ptr(owner); + LDKInboundHTLCDetails ret_var = CResult_InboundHTLCDetailsDecodeErrorZ_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_InboundHTLCDetailsDecodeErrorZ_get_err(LDKCResult_InboundHTLCDetailsDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_InboundHTLCDetailsDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_InboundHTLCDetailsDecodeErrorZ* owner_conv = (LDKCResult_InboundHTLCDetailsDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_InboundHTLCDetailsDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint32_t CS_LDK_LDKCOption_OutboundHTLCStateDetailsZ_ty_from_ptr(int64_t ptr) { + LDKCOption_OutboundHTLCStateDetailsZ *obj = (LDKCOption_OutboundHTLCStateDetailsZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_OutboundHTLCStateDetailsZ_Some: return 0; + case LDKCOption_OutboundHTLCStateDetailsZ_None: return 1; + default: abort(); + } +} +int32_t CS_LDK_LDKCOption_OutboundHTLCStateDetailsZ_Some_get_some(int64_t ptr) { + LDKCOption_OutboundHTLCStateDetailsZ *obj = (LDKCOption_OutboundHTLCStateDetailsZ*)untag_ptr(ptr); + CHECK(obj->tag == LDKCOption_OutboundHTLCStateDetailsZ_Some); + int32_t some_conv = LDKOutboundHTLCStateDetails_to_cs(obj->some); + return some_conv; +} +static inline struct LDKCOption_OutboundHTLCStateDetailsZ CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_get_ok(LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return COption_OutboundHTLCStateDetailsZ_clone(&*owner->contents.result); +} +int64_t CS_LDK_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ* owner_conv = (LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ*)untag_ptr(owner); + LDKCOption_OutboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_OutboundHTLCStateDetailsZ), "LDKCOption_OutboundHTLCStateDetailsZ"); + *ret_copy = CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_get_err(LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ* owner_conv = (LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKOutboundHTLCDetails CResult_OutboundHTLCDetailsDecodeErrorZ_get_ok(LDKCResult_OutboundHTLCDetailsDecodeErrorZ *NONNULL_PTR owner){ + LDKOutboundHTLCDetails ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_OutboundHTLCDetailsDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_OutboundHTLCDetailsDecodeErrorZ* owner_conv = (LDKCResult_OutboundHTLCDetailsDecodeErrorZ*)untag_ptr(owner); + LDKOutboundHTLCDetails ret_var = CResult_OutboundHTLCDetailsDecodeErrorZ_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_OutboundHTLCDetailsDecodeErrorZ_get_err(LDKCResult_OutboundHTLCDetailsDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_OutboundHTLCDetailsDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_OutboundHTLCDetailsDecodeErrorZ* owner_conv = (LDKCResult_OutboundHTLCDetailsDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_OutboundHTLCDetailsDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKCounterpartyForwardingInfo CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner){ + LDKCounterpartyForwardingInfo ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(owner); + LDKCounterpartyForwardingInfo ret_var = CResult_CounterpartyForwardingInfoDecodeErrorZ_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_CounterpartyForwardingInfoDecodeErrorZ_get_err(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKChannelCounterparty CResult_ChannelCounterpartyDecodeErrorZ_get_ok(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner){ + LDKChannelCounterparty ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_ChannelCounterpartyDecodeErrorZ* owner_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(owner); + LDKChannelCounterparty ret_var = CResult_ChannelCounterpartyDecodeErrorZ_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_ChannelCounterpartyDecodeErrorZ_get_err(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_ChannelCounterpartyDecodeErrorZ* owner_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ChannelCounterpartyDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint32_t CS_LDK_LDKCOption_ChannelShutdownStateZ_ty_from_ptr(int64_t ptr) { + LDKCOption_ChannelShutdownStateZ *obj = (LDKCOption_ChannelShutdownStateZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_ChannelShutdownStateZ_Some: return 0; + case LDKCOption_ChannelShutdownStateZ_None: return 1; + default: abort(); + } +} +int32_t CS_LDK_LDKCOption_ChannelShutdownStateZ_Some_get_some(int64_t ptr) { + LDKCOption_ChannelShutdownStateZ *obj = (LDKCOption_ChannelShutdownStateZ*)untag_ptr(ptr); + CHECK(obj->tag == LDKCOption_ChannelShutdownStateZ_Some); + int32_t some_conv = LDKChannelShutdownState_to_cs(obj->some); + return some_conv; +} +static inline LDKCVec_InboundHTLCDetailsZ CVec_InboundHTLCDetailsZ_clone(const LDKCVec_InboundHTLCDetailsZ *orig) { + LDKCVec_InboundHTLCDetailsZ ret = { .data = MALLOC(sizeof(LDKInboundHTLCDetails) * orig->datalen, "LDKCVec_InboundHTLCDetailsZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = InboundHTLCDetails_clone(&orig->data[i]); + } + return ret; +} +static inline LDKCVec_OutboundHTLCDetailsZ CVec_OutboundHTLCDetailsZ_clone(const LDKCVec_OutboundHTLCDetailsZ *orig) { + LDKCVec_OutboundHTLCDetailsZ ret = { .data = MALLOC(sizeof(LDKOutboundHTLCDetails) * orig->datalen, "LDKCVec_OutboundHTLCDetailsZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = OutboundHTLCDetails_clone(&orig->data[i]); + } + return ret; +} +static inline struct LDKChannelDetails CResult_ChannelDetailsDecodeErrorZ_get_ok(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner){ + LDKChannelDetails ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_ChannelDetailsDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_ChannelDetailsDecodeErrorZ* owner_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(owner); + LDKChannelDetails ret_var = CResult_ChannelDetailsDecodeErrorZ_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_ChannelDetailsDecodeErrorZ_get_err(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_ChannelDetailsDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_ChannelDetailsDecodeErrorZ* owner_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ChannelDetailsDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline enum LDKChannelShutdownState CResult_ChannelShutdownStateDecodeErrorZ_get_ok(LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return ChannelShutdownState_clone(&*owner->contents.result); +} +int32_t CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_ChannelShutdownStateDecodeErrorZ* owner_conv = (LDKCResult_ChannelShutdownStateDecodeErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKChannelShutdownState_to_cs(CResult_ChannelShutdownStateDecodeErrorZ_get_ok(owner_conv)); + return ret_conv; +} + +static inline struct LDKDecodeError CResult_ChannelShutdownStateDecodeErrorZ_get_err(LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_ChannelShutdownStateDecodeErrorZ* owner_conv = (LDKCResult_ChannelShutdownStateDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ChannelShutdownStateDecodeErrorZ_get_err(owner_conv); + 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); @@ -24135,50 +24314,6 @@ int64_t CS_LDK_COption_C2Tuple_u64u16ZZ_clone(int64_t orig) { return ret_ref; } -int64_t CS_LDK_COption_ChannelShutdownStateZ_some(int32_t o) { - LDKChannelShutdownState o_conv = LDKChannelShutdownState_from_cs(o); - LDKCOption_ChannelShutdownStateZ *ret_copy = MALLOC(sizeof(LDKCOption_ChannelShutdownStateZ), "LDKCOption_ChannelShutdownStateZ"); - *ret_copy = COption_ChannelShutdownStateZ_some(o_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_COption_ChannelShutdownStateZ_none() { - LDKCOption_ChannelShutdownStateZ *ret_copy = MALLOC(sizeof(LDKCOption_ChannelShutdownStateZ), "LDKCOption_ChannelShutdownStateZ"); - *ret_copy = COption_ChannelShutdownStateZ_none(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -void CS_LDK_COption_ChannelShutdownStateZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCOption_ChannelShutdownStateZ _res_conv = *(LDKCOption_ChannelShutdownStateZ*)(_res_ptr); - FREE(untag_ptr(_res)); - COption_ChannelShutdownStateZ_free(_res_conv); -} - -static inline uint64_t COption_ChannelShutdownStateZ_clone_ptr(LDKCOption_ChannelShutdownStateZ *NONNULL_PTR arg) { - LDKCOption_ChannelShutdownStateZ *ret_copy = MALLOC(sizeof(LDKCOption_ChannelShutdownStateZ), "LDKCOption_ChannelShutdownStateZ"); - *ret_copy = COption_ChannelShutdownStateZ_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -int64_t CS_LDK_COption_ChannelShutdownStateZ_clone_ptr(int64_t arg) { - LDKCOption_ChannelShutdownStateZ* arg_conv = (LDKCOption_ChannelShutdownStateZ*)untag_ptr(arg); - int64_t ret_conv = COption_ChannelShutdownStateZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_COption_ChannelShutdownStateZ_clone(int64_t orig) { - LDKCOption_ChannelShutdownStateZ* orig_conv = (LDKCOption_ChannelShutdownStateZ*)untag_ptr(orig); - LDKCOption_ChannelShutdownStateZ *ret_copy = MALLOC(sizeof(LDKCOption_ChannelShutdownStateZ), "LDKCOption_ChannelShutdownStateZ"); - *ret_copy = COption_ChannelShutdownStateZ_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - int64_t CS_LDK_CResult_ChannelIdAPIErrorZ_ok(int64_t o) { LDKChannelId o_conv; o_conv.inner = untag_ptr(o); @@ -25016,168 +25151,6 @@ void CS_LDK_CVec_C3Tuple_OffersMessageDestinationBlindedPathZZ_free(int64_tArra CVec_C3Tuple_OffersMessageDestinationBlindedPathZZ_free(_res_constr); } -int64_t CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(int64_t o) { - LDKCounterpartyForwardingInfo o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = CounterpartyForwardingInfo_clone(&o_conv); - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); - *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_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_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); - *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -jboolean CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* o_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -void CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_CounterpartyForwardingInfoDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); - *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(int64_t orig) { - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(orig); - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); - *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_ok(int64_t o) { - LDKChannelCounterparty o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = ChannelCounterparty_clone(&o_conv); - LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); - *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_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_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); - *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -jboolean CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_ChannelCounterpartyDecodeErrorZ* o_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -void CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_ChannelCounterpartyDecodeErrorZ _res_conv = *(LDKCResult_ChannelCounterpartyDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_ChannelCounterpartyDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); - *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_ChannelCounterpartyDecodeErrorZ* arg_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_clone(int64_t orig) { - LDKCResult_ChannelCounterpartyDecodeErrorZ* orig_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(orig); - LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); - *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_ChannelDetailsDecodeErrorZ_ok(int64_t o) { - LDKChannelDetails o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = ChannelDetails_clone(&o_conv); - LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); - *ret_conv = CResult_ChannelDetailsDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_ChannelDetailsDecodeErrorZ_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_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); - *ret_conv = CResult_ChannelDetailsDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -jboolean CS_LDK_CResult_ChannelDetailsDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_ChannelDetailsDecodeErrorZ* o_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ChannelDetailsDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -void CS_LDK_CResult_ChannelDetailsDecodeErrorZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_ChannelDetailsDecodeErrorZ _res_conv = *(LDKCResult_ChannelDetailsDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_ChannelDetailsDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_ChannelDetailsDecodeErrorZ_clone_ptr(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); - *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t CS_LDK_CResult_ChannelDetailsDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_ChannelDetailsDecodeErrorZ* arg_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_CResult_ChannelDetailsDecodeErrorZ_clone(int64_t orig) { - LDKCResult_ChannelDetailsDecodeErrorZ* orig_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(orig); - LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); - *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - int64_t CS_LDK_CResult_PhantomRouteHintsDecodeErrorZ_ok(int64_t o) { LDKPhantomRouteHints o_conv; o_conv.inner = untag_ptr(o); @@ -25443,56 +25416,6 @@ int64_t CS_LDK_CResult_BlindedFailureDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_ok(int32_t o) { - LDKChannelShutdownState o_conv = LDKChannelShutdownState_from_cs(o); - LDKCResult_ChannelShutdownStateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelShutdownStateDecodeErrorZ), "LDKCResult_ChannelShutdownStateDecodeErrorZ"); - *ret_conv = CResult_ChannelShutdownStateDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_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_ChannelShutdownStateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelShutdownStateDecodeErrorZ), "LDKCResult_ChannelShutdownStateDecodeErrorZ"); - *ret_conv = CResult_ChannelShutdownStateDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -jboolean CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_ChannelShutdownStateDecodeErrorZ* o_conv = (LDKCResult_ChannelShutdownStateDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ChannelShutdownStateDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -void CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_ChannelShutdownStateDecodeErrorZ _res_conv = *(LDKCResult_ChannelShutdownStateDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_ChannelShutdownStateDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_ChannelShutdownStateDecodeErrorZ_clone_ptr(LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ChannelShutdownStateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelShutdownStateDecodeErrorZ), "LDKCResult_ChannelShutdownStateDecodeErrorZ"); - *ret_conv = CResult_ChannelShutdownStateDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_ChannelShutdownStateDecodeErrorZ* arg_conv = (LDKCResult_ChannelShutdownStateDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ChannelShutdownStateDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_clone(int64_t orig) { - LDKCResult_ChannelShutdownStateDecodeErrorZ* orig_conv = (LDKCResult_ChannelShutdownStateDecodeErrorZ*)untag_ptr(orig); - LDKCResult_ChannelShutdownStateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelShutdownStateDecodeErrorZ), "LDKCResult_ChannelShutdownStateDecodeErrorZ"); - *ret_conv = CResult_ChannelShutdownStateDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - void CS_LDK_CVec_ChannelMonitorZ_free(int64_tArray _res) { LDKCVec_ChannelMonitorZ _res_constr; _res_constr.datalen = _res->arr_len; @@ -30844,9704 +30767,10358 @@ int64_t CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -void CS_LDK_CVec_FutureZ_free(int64_tArray _res) { - LDKCVec_FutureZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKFuture), "LDKCVec_FutureZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = _res->elems; - for (size_t i = 0; i < _res_constr.datalen; i++) { - int64_t _res_conv_8 = _res_vals[i]; - LDKFuture _res_conv_8_conv; - _res_conv_8_conv.inner = untag_ptr(_res_conv_8); - _res_conv_8_conv.is_owned = ptr_is_owned(_res_conv_8); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_8_conv); - _res_constr.data[i] = _res_conv_8_conv; - } - FREE(_res); - CVec_FutureZ_free(_res_constr); -} - -int64_t CS_LDK_CResult_OffersMessageDecodeErrorZ_ok(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)); - LDKCResult_OffersMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersMessageDecodeErrorZ), "LDKCResult_OffersMessageDecodeErrorZ"); - *ret_conv = CResult_OffersMessageDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_OffersMessageDecodeErrorZ_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_OffersMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersMessageDecodeErrorZ), "LDKCResult_OffersMessageDecodeErrorZ"); - *ret_conv = CResult_OffersMessageDecodeErrorZ_err(e_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"); + *ret_copy = COption_InboundHTLCStateDetailsZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_CResult_OffersMessageDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_OffersMessageDecodeErrorZ* o_conv = (LDKCResult_OffersMessageDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_OffersMessageDecodeErrorZ_is_ok(o_conv); - return ret_conv; +int64_t CS_LDK_COption_InboundHTLCStateDetailsZ_none() { + LDKCOption_InboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_InboundHTLCStateDetailsZ), "LDKCOption_InboundHTLCStateDetailsZ"); + *ret_copy = COption_InboundHTLCStateDetailsZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_CResult_OffersMessageDecodeErrorZ_free(int64_t _res) { +void CS_LDK_COption_InboundHTLCStateDetailsZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_OffersMessageDecodeErrorZ _res_conv = *(LDKCResult_OffersMessageDecodeErrorZ*)(_res_ptr); + LDKCOption_InboundHTLCStateDetailsZ _res_conv = *(LDKCOption_InboundHTLCStateDetailsZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_OffersMessageDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_OffersMessageDecodeErrorZ_clone_ptr(LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_OffersMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersMessageDecodeErrorZ), "LDKCResult_OffersMessageDecodeErrorZ"); - *ret_conv = CResult_OffersMessageDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t CS_LDK_CResult_OffersMessageDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_OffersMessageDecodeErrorZ* arg_conv = (LDKCResult_OffersMessageDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_OffersMessageDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_CResult_OffersMessageDecodeErrorZ_clone(int64_t orig) { - LDKCResult_OffersMessageDecodeErrorZ* orig_conv = (LDKCResult_OffersMessageDecodeErrorZ*)untag_ptr(orig); - LDKCResult_OffersMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersMessageDecodeErrorZ), "LDKCResult_OffersMessageDecodeErrorZ"); - *ret_conv = CResult_OffersMessageDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); + COption_InboundHTLCStateDetailsZ_free(_res_conv); } -int64_t CS_LDK_COption_HTLCClaimZ_some(int32_t o) { - LDKHTLCClaim o_conv = LDKHTLCClaim_from_cs(o); - LDKCOption_HTLCClaimZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCClaimZ), "LDKCOption_HTLCClaimZ"); - *ret_copy = COption_HTLCClaimZ_some(o_conv); +static inline uint64_t COption_InboundHTLCStateDetailsZ_clone_ptr(LDKCOption_InboundHTLCStateDetailsZ *NONNULL_PTR arg) { + LDKCOption_InboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_InboundHTLCStateDetailsZ), "LDKCOption_InboundHTLCStateDetailsZ"); + *ret_copy = COption_InboundHTLCStateDetailsZ_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } +int64_t CS_LDK_COption_InboundHTLCStateDetailsZ_clone_ptr(int64_t arg) { + LDKCOption_InboundHTLCStateDetailsZ* arg_conv = (LDKCOption_InboundHTLCStateDetailsZ*)untag_ptr(arg); + int64_t ret_conv = COption_InboundHTLCStateDetailsZ_clone_ptr(arg_conv); + return ret_conv; +} -int64_t CS_LDK_COption_HTLCClaimZ_none() { - LDKCOption_HTLCClaimZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCClaimZ), "LDKCOption_HTLCClaimZ"); - *ret_copy = COption_HTLCClaimZ_none(); +int64_t CS_LDK_COption_InboundHTLCStateDetailsZ_clone(int64_t orig) { + LDKCOption_InboundHTLCStateDetailsZ* orig_conv = (LDKCOption_InboundHTLCStateDetailsZ*)untag_ptr(orig); + LDKCOption_InboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_InboundHTLCStateDetailsZ), "LDKCOption_InboundHTLCStateDetailsZ"); + *ret_copy = COption_InboundHTLCStateDetailsZ_clone(orig_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void CS_LDK_COption_HTLCClaimZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCOption_HTLCClaimZ _res_conv = *(LDKCOption_HTLCClaimZ*)(_res_ptr); - FREE(untag_ptr(_res)); - COption_HTLCClaimZ_free(_res_conv); -} - -int64_t CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(int64_t o) { - LDKCounterpartyCommitmentSecrets o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = CounterpartyCommitmentSecrets_clone(&o_conv); - LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ"); - *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKCOption_InboundHTLCStateDetailsZ o_conv = *(LDKCOption_InboundHTLCStateDetailsZ*)(o_ptr); + o_conv = COption_InboundHTLCStateDetailsZ_clone((LDKCOption_InboundHTLCStateDetailsZ*)untag_ptr(o)); + LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ), "LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ"); + *ret_conv = CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_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_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ"); - *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(e_conv); + LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ), "LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ"); + *ret_conv = CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* o_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ* o_conv = (LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)(_res_ptr); + LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ _res_conv = *(LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(_res_conv); + CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ"); - *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(arg); +static inline uint64_t CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_clone_ptr(LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ), "LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ"); + *ret_conv = CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ* arg_conv = (LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(int64_t orig) { - LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(orig); - LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ"); - *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_clone(int64_t orig) { + LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ* orig_conv = (LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ*)untag_ptr(orig); + LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ), "LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ"); + *ret_conv = CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_TxCreationKeysDecodeErrorZ_ok(int64_t o) { - LDKTxCreationKeys o_conv; +int64_t CS_LDK_CResult_InboundHTLCDetailsDecodeErrorZ_ok(int64_t o) { + LDKInboundHTLCDetails o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = TxCreationKeys_clone(&o_conv); - LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); - *ret_conv = CResult_TxCreationKeysDecodeErrorZ_ok(o_conv); + o_conv = InboundHTLCDetails_clone(&o_conv); + LDKCResult_InboundHTLCDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InboundHTLCDetailsDecodeErrorZ), "LDKCResult_InboundHTLCDetailsDecodeErrorZ"); + *ret_conv = CResult_InboundHTLCDetailsDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_TxCreationKeysDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_InboundHTLCDetailsDecodeErrorZ_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_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); - *ret_conv = CResult_TxCreationKeysDecodeErrorZ_err(e_conv); + LDKCResult_InboundHTLCDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InboundHTLCDetailsDecodeErrorZ), "LDKCResult_InboundHTLCDetailsDecodeErrorZ"); + *ret_conv = CResult_InboundHTLCDetailsDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_TxCreationKeysDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_TxCreationKeysDecodeErrorZ* o_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_TxCreationKeysDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_InboundHTLCDetailsDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_InboundHTLCDetailsDecodeErrorZ* o_conv = (LDKCResult_InboundHTLCDetailsDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InboundHTLCDetailsDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_TxCreationKeysDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_InboundHTLCDetailsDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_TxCreationKeysDecodeErrorZ _res_conv = *(LDKCResult_TxCreationKeysDecodeErrorZ*)(_res_ptr); + LDKCResult_InboundHTLCDetailsDecodeErrorZ _res_conv = *(LDKCResult_InboundHTLCDetailsDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_TxCreationKeysDecodeErrorZ_free(_res_conv); + CResult_InboundHTLCDetailsDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_TxCreationKeysDecodeErrorZ_clone_ptr(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); - *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(arg); +static inline uint64_t CResult_InboundHTLCDetailsDecodeErrorZ_clone_ptr(LDKCResult_InboundHTLCDetailsDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_InboundHTLCDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InboundHTLCDetailsDecodeErrorZ), "LDKCResult_InboundHTLCDetailsDecodeErrorZ"); + *ret_conv = CResult_InboundHTLCDetailsDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_TxCreationKeysDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_TxCreationKeysDecodeErrorZ* arg_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_InboundHTLCDetailsDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_InboundHTLCDetailsDecodeErrorZ* arg_conv = (LDKCResult_InboundHTLCDetailsDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_InboundHTLCDetailsDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_TxCreationKeysDecodeErrorZ_clone(int64_t orig) { - LDKCResult_TxCreationKeysDecodeErrorZ* orig_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(orig); - LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); - *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_ok(int64_t o) { - LDKChannelPublicKeys o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = ChannelPublicKeys_clone(&o_conv); - LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); - *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_InboundHTLCDetailsDecodeErrorZ_clone(int64_t orig) { + LDKCResult_InboundHTLCDetailsDecodeErrorZ* orig_conv = (LDKCResult_InboundHTLCDetailsDecodeErrorZ*)untag_ptr(orig); + LDKCResult_InboundHTLCDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InboundHTLCDetailsDecodeErrorZ), "LDKCResult_InboundHTLCDetailsDecodeErrorZ"); + *ret_conv = CResult_InboundHTLCDetailsDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_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_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); - *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_COption_OutboundHTLCStateDetailsZ_some(int32_t o) { + LDKOutboundHTLCStateDetails o_conv = LDKOutboundHTLCStateDetails_from_cs(o); + LDKCOption_OutboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_OutboundHTLCStateDetailsZ), "LDKCOption_OutboundHTLCStateDetailsZ"); + *ret_copy = COption_OutboundHTLCStateDetailsZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_ChannelPublicKeysDecodeErrorZ* o_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_is_ok(o_conv); - return ret_conv; +int64_t CS_LDK_COption_OutboundHTLCStateDetailsZ_none() { + LDKCOption_OutboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_OutboundHTLCStateDetailsZ), "LDKCOption_OutboundHTLCStateDetailsZ"); + *ret_copy = COption_OutboundHTLCStateDetailsZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_free(int64_t _res) { +void CS_LDK_COption_OutboundHTLCStateDetailsZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_ChannelPublicKeysDecodeErrorZ _res_conv = *(LDKCResult_ChannelPublicKeysDecodeErrorZ*)(_res_ptr); + LDKCOption_OutboundHTLCStateDetailsZ _res_conv = *(LDKCOption_OutboundHTLCStateDetailsZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_ChannelPublicKeysDecodeErrorZ_free(_res_conv); + COption_OutboundHTLCStateDetailsZ_free(_res_conv); } -static inline uint64_t CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); - *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); +static inline uint64_t COption_OutboundHTLCStateDetailsZ_clone_ptr(LDKCOption_OutboundHTLCStateDetailsZ *NONNULL_PTR arg) { + LDKCOption_OutboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_OutboundHTLCStateDetailsZ), "LDKCOption_OutboundHTLCStateDetailsZ"); + *ret_copy = COption_OutboundHTLCStateDetailsZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_ChannelPublicKeysDecodeErrorZ* arg_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_COption_OutboundHTLCStateDetailsZ_clone_ptr(int64_t arg) { + LDKCOption_OutboundHTLCStateDetailsZ* arg_conv = (LDKCOption_OutboundHTLCStateDetailsZ*)untag_ptr(arg); + int64_t ret_conv = COption_OutboundHTLCStateDetailsZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_clone(int64_t orig) { - LDKCResult_ChannelPublicKeysDecodeErrorZ* orig_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(orig); - LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); - *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_COption_OutboundHTLCStateDetailsZ_clone(int64_t orig) { + LDKCOption_OutboundHTLCStateDetailsZ* orig_conv = (LDKCOption_OutboundHTLCStateDetailsZ*)untag_ptr(orig); + LDKCOption_OutboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_OutboundHTLCStateDetailsZ), "LDKCOption_OutboundHTLCStateDetailsZ"); + *ret_copy = COption_OutboundHTLCStateDetailsZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(int64_t o) { - LDKHTLCOutputInCommitment o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = HTLCOutputInCommitment_clone(&o_conv); - LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); - *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKCOption_OutboundHTLCStateDetailsZ o_conv = *(LDKCOption_OutboundHTLCStateDetailsZ*)(o_ptr); + o_conv = COption_OutboundHTLCStateDetailsZ_clone((LDKCOption_OutboundHTLCStateDetailsZ*)untag_ptr(o)); + LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ), "LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ"); + *ret_conv = CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_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_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); - *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e_conv); + LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ), "LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ"); + *ret_conv = CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* o_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ* o_conv = (LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res_conv = *(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(_res_ptr); + LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ _res_conv = *(LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_HTLCOutputInCommitmentDecodeErrorZ_free(_res_conv); + CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); - *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(arg); +static inline uint64_t CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_clone_ptr(LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ), "LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ"); + *ret_conv = CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* arg_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ* arg_conv = (LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(int64_t orig) { - LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* orig_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(orig); - LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); - *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_clone(int64_t orig) { + LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ* orig_conv = (LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ*)untag_ptr(orig); + LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ), "LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ"); + *ret_conv = CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(int64_t o) { - LDKCounterpartyChannelTransactionParameters o_conv; +int64_t CS_LDK_CResult_OutboundHTLCDetailsDecodeErrorZ_ok(int64_t o) { + LDKOutboundHTLCDetails o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = CounterpartyChannelTransactionParameters_clone(&o_conv); - LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); - *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(o_conv); + o_conv = OutboundHTLCDetails_clone(&o_conv); + LDKCResult_OutboundHTLCDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutboundHTLCDetailsDecodeErrorZ), "LDKCResult_OutboundHTLCDetailsDecodeErrorZ"); + *ret_conv = CResult_OutboundHTLCDetailsDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_OutboundHTLCDetailsDecodeErrorZ_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_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); - *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e_conv); + LDKCResult_OutboundHTLCDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutboundHTLCDetailsDecodeErrorZ), "LDKCResult_OutboundHTLCDetailsDecodeErrorZ"); + *ret_conv = CResult_OutboundHTLCDetailsDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_OutboundHTLCDetailsDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_OutboundHTLCDetailsDecodeErrorZ* o_conv = (LDKCResult_OutboundHTLCDetailsDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OutboundHTLCDetailsDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_OutboundHTLCDetailsDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(_res_ptr); + LDKCResult_OutboundHTLCDetailsDecodeErrorZ _res_conv = *(LDKCResult_OutboundHTLCDetailsDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(_res_conv); + CResult_OutboundHTLCDetailsDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); - *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(arg); +static inline uint64_t CResult_OutboundHTLCDetailsDecodeErrorZ_clone_ptr(LDKCResult_OutboundHTLCDetailsDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OutboundHTLCDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutboundHTLCDetailsDecodeErrorZ), "LDKCResult_OutboundHTLCDetailsDecodeErrorZ"); + *ret_conv = CResult_OutboundHTLCDetailsDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_OutboundHTLCDetailsDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_OutboundHTLCDetailsDecodeErrorZ* arg_conv = (LDKCResult_OutboundHTLCDetailsDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OutboundHTLCDetailsDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(int64_t orig) { - LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(orig); - LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); - *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_OutboundHTLCDetailsDecodeErrorZ_clone(int64_t orig) { + LDKCResult_OutboundHTLCDetailsDecodeErrorZ* orig_conv = (LDKCResult_OutboundHTLCDetailsDecodeErrorZ*)untag_ptr(orig); + LDKCResult_OutboundHTLCDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutboundHTLCDetailsDecodeErrorZ), "LDKCResult_OutboundHTLCDetailsDecodeErrorZ"); + *ret_conv = CResult_OutboundHTLCDetailsDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_ok(int64_t o) { - LDKChannelTransactionParameters o_conv; +int64_t CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(int64_t o) { + LDKCounterpartyForwardingInfo o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = ChannelTransactionParameters_clone(&o_conv); - LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); - *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_ok(o_conv); + o_conv = CounterpartyForwardingInfo_clone(&o_conv); + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); + *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_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_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); - *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_err(e_conv); + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); + *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_ChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* o_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_ChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(_res_ptr); + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_ChannelTransactionParametersDecodeErrorZ_free(_res_conv); + CResult_CounterpartyForwardingInfoDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); - *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(arg); +static inline uint64_t CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); + *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_ChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_clone(int64_t orig) { - LDKCResult_ChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(orig); - LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); - *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(int64_t orig) { + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(orig); + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); + *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_ok(int64_t o) { - LDKHolderCommitmentTransaction o_conv; +int64_t CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_ok(int64_t o) { + LDKChannelCounterparty o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = HolderCommitmentTransaction_clone(&o_conv); - LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); - *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_ok(o_conv); + o_conv = ChannelCounterparty_clone(&o_conv); + LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); + *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_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_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); - *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_err(e_conv); + LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); + *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_HolderCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_ChannelCounterpartyDecodeErrorZ* o_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(_res_ptr); + LDKCResult_ChannelCounterpartyDecodeErrorZ _res_conv = *(LDKCResult_ChannelCounterpartyDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_HolderCommitmentTransactionDecodeErrorZ_free(_res_conv); + CResult_ChannelCounterpartyDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); - *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(arg); +static inline uint64_t CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); + *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_HolderCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_ChannelCounterpartyDecodeErrorZ* arg_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_clone(int64_t orig) { - LDKCResult_HolderCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(orig); - LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); - *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(int64_t o) { - LDKBuiltCommitmentTransaction o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = BuiltCommitmentTransaction_clone(&o_conv); - LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); - *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_clone(int64_t orig) { + LDKCResult_ChannelCounterpartyDecodeErrorZ* orig_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); + *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_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_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); - *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_COption_ChannelShutdownStateZ_some(int32_t o) { + LDKChannelShutdownState o_conv = LDKChannelShutdownState_from_cs(o); + LDKCOption_ChannelShutdownStateZ *ret_copy = MALLOC(sizeof(LDKCOption_ChannelShutdownStateZ), "LDKCOption_ChannelShutdownStateZ"); + *ret_copy = COption_ChannelShutdownStateZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(o_conv); - return ret_conv; +int64_t CS_LDK_COption_ChannelShutdownStateZ_none() { + LDKCOption_ChannelShutdownStateZ *ret_copy = MALLOC(sizeof(LDKCOption_ChannelShutdownStateZ), "LDKCOption_ChannelShutdownStateZ"); + *ret_copy = COption_ChannelShutdownStateZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_free(int64_t _res) { +void CS_LDK_COption_ChannelShutdownStateZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(_res_ptr); + LDKCOption_ChannelShutdownStateZ _res_conv = *(LDKCOption_ChannelShutdownStateZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_BuiltCommitmentTransactionDecodeErrorZ_free(_res_conv); + COption_ChannelShutdownStateZ_free(_res_conv); } -static inline uint64_t CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); - *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); +static inline uint64_t COption_ChannelShutdownStateZ_clone_ptr(LDKCOption_ChannelShutdownStateZ *NONNULL_PTR arg) { + LDKCOption_ChannelShutdownStateZ *ret_copy = MALLOC(sizeof(LDKCOption_ChannelShutdownStateZ), "LDKCOption_ChannelShutdownStateZ"); + *ret_copy = COption_ChannelShutdownStateZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_COption_ChannelShutdownStateZ_clone_ptr(int64_t arg) { + LDKCOption_ChannelShutdownStateZ* arg_conv = (LDKCOption_ChannelShutdownStateZ*)untag_ptr(arg); + int64_t ret_conv = COption_ChannelShutdownStateZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(int64_t orig) { - LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(orig); - LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); - *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_TrustedClosingTransactionNoneZ_ok(int64_t o) { - LDKTrustedClosingTransaction o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - // WARNING: we need a move here but no clone is available for LDKTrustedClosingTransaction - - LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ"); - *ret_conv = CResult_TrustedClosingTransactionNoneZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_TrustedClosingTransactionNoneZ_err() { - LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ"); - *ret_conv = CResult_TrustedClosingTransactionNoneZ_err(); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_COption_ChannelShutdownStateZ_clone(int64_t orig) { + LDKCOption_ChannelShutdownStateZ* orig_conv = (LDKCOption_ChannelShutdownStateZ*)untag_ptr(orig); + LDKCOption_ChannelShutdownStateZ *ret_copy = MALLOC(sizeof(LDKCOption_ChannelShutdownStateZ), "LDKCOption_ChannelShutdownStateZ"); + *ret_copy = COption_ChannelShutdownStateZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_CResult_TrustedClosingTransactionNoneZ_is_ok(int64_t o) { - LDKCResult_TrustedClosingTransactionNoneZ* o_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_TrustedClosingTransactionNoneZ_is_ok(o_conv); - return ret_conv; +void CS_LDK_CVec_InboundHTLCDetailsZ_free(int64_tArray _res) { + LDKCVec_InboundHTLCDetailsZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKInboundHTLCDetails), "LDKCVec_InboundHTLCDetailsZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = _res->elems; + for (size_t u = 0; u < _res_constr.datalen; u++) { + int64_t _res_conv_20 = _res_vals[u]; + LDKInboundHTLCDetails _res_conv_20_conv; + _res_conv_20_conv.inner = untag_ptr(_res_conv_20); + _res_conv_20_conv.is_owned = ptr_is_owned(_res_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_20_conv); + _res_constr.data[u] = _res_conv_20_conv; + } + FREE(_res); + CVec_InboundHTLCDetailsZ_free(_res_constr); } -void CS_LDK_CResult_TrustedClosingTransactionNoneZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_TrustedClosingTransactionNoneZ _res_conv = *(LDKCResult_TrustedClosingTransactionNoneZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_TrustedClosingTransactionNoneZ_free(_res_conv); +void CS_LDK_CVec_OutboundHTLCDetailsZ_free(int64_tArray _res) { + LDKCVec_OutboundHTLCDetailsZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKOutboundHTLCDetails), "LDKCVec_OutboundHTLCDetailsZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = _res->elems; + for (size_t v = 0; v < _res_constr.datalen; v++) { + int64_t _res_conv_21 = _res_vals[v]; + LDKOutboundHTLCDetails _res_conv_21_conv; + _res_conv_21_conv.inner = untag_ptr(_res_conv_21); + _res_conv_21_conv.is_owned = ptr_is_owned(_res_conv_21); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_21_conv); + _res_constr.data[v] = _res_conv_21_conv; + } + FREE(_res); + CVec_OutboundHTLCDetailsZ_free(_res_constr); } -int64_t CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_ok(int64_t o) { - LDKCommitmentTransaction o_conv; +int64_t CS_LDK_CResult_ChannelDetailsDecodeErrorZ_ok(int64_t o) { + LDKChannelDetails o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = CommitmentTransaction_clone(&o_conv); - LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); - *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_ok(o_conv); + o_conv = ChannelDetails_clone(&o_conv); + LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); + *ret_conv = CResult_ChannelDetailsDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_ChannelDetailsDecodeErrorZ_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_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); - *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_err(e_conv); + LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); + *ret_conv = CResult_ChannelDetailsDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_CommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_CommitmentTransactionDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_ChannelDetailsDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_ChannelDetailsDecodeErrorZ* o_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ChannelDetailsDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_ChannelDetailsDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_CommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_CommitmentTransactionDecodeErrorZ*)(_res_ptr); + LDKCResult_ChannelDetailsDecodeErrorZ _res_conv = *(LDKCResult_ChannelDetailsDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_CommitmentTransactionDecodeErrorZ_free(_res_conv); + CResult_ChannelDetailsDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); - *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(arg); +static inline uint64_t CResult_ChannelDetailsDecodeErrorZ_clone_ptr(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); + *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_CommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_ChannelDetailsDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_ChannelDetailsDecodeErrorZ* arg_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_clone(int64_t orig) { - LDKCResult_CommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(orig); - LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); - *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_ChannelDetailsDecodeErrorZ_clone(int64_t orig) { + LDKCResult_ChannelDetailsDecodeErrorZ* orig_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); + *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_TrustedCommitmentTransactionNoneZ_ok(int64_t o) { - LDKTrustedCommitmentTransaction o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - // WARNING: we need a move here but no clone is available for LDKTrustedCommitmentTransaction - - LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ"); - *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_ok(o_conv); +int64_t CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_ok(int32_t o) { + LDKChannelShutdownState o_conv = LDKChannelShutdownState_from_cs(o); + LDKCResult_ChannelShutdownStateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelShutdownStateDecodeErrorZ), "LDKCResult_ChannelShutdownStateDecodeErrorZ"); + *ret_conv = CResult_ChannelShutdownStateDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_TrustedCommitmentTransactionNoneZ_err() { - LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ"); - *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_err(); +int64_t CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_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_ChannelShutdownStateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelShutdownStateDecodeErrorZ), "LDKCResult_ChannelShutdownStateDecodeErrorZ"); + *ret_conv = CResult_ChannelShutdownStateDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_TrustedCommitmentTransactionNoneZ_is_ok(int64_t o) { - LDKCResult_TrustedCommitmentTransactionNoneZ* o_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_TrustedCommitmentTransactionNoneZ_is_ok(o_conv); +jboolean CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_ChannelShutdownStateDecodeErrorZ* o_conv = (LDKCResult_ChannelShutdownStateDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ChannelShutdownStateDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_TrustedCommitmentTransactionNoneZ_free(int64_t _res) { +void CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_TrustedCommitmentTransactionNoneZ _res_conv = *(LDKCResult_TrustedCommitmentTransactionNoneZ*)(_res_ptr); + LDKCResult_ChannelShutdownStateDecodeErrorZ _res_conv = *(LDKCResult_ChannelShutdownStateDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_TrustedCommitmentTransactionNoneZ_free(_res_conv); + CResult_ChannelShutdownStateDecodeErrorZ_free(_res_conv); } -int64_t CS_LDK_CResult_CVec_ECDSASignatureZNoneZ_ok(ptrArray o) { - LDKCVec_ECDSASignatureZ o_constr; - o_constr.datalen = o->arr_len; - if (o_constr.datalen > 0) - o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKECDSASignature), "LDKCVec_ECDSASignatureZ Elements"); +static inline uint64_t CResult_ChannelShutdownStateDecodeErrorZ_clone_ptr(LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelShutdownStateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelShutdownStateDecodeErrorZ), "LDKCResult_ChannelShutdownStateDecodeErrorZ"); + *ret_conv = CResult_ChannelShutdownStateDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_ChannelShutdownStateDecodeErrorZ* arg_conv = (LDKCResult_ChannelShutdownStateDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ChannelShutdownStateDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_clone(int64_t orig) { + LDKCResult_ChannelShutdownStateDecodeErrorZ* orig_conv = (LDKCResult_ChannelShutdownStateDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ChannelShutdownStateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelShutdownStateDecodeErrorZ), "LDKCResult_ChannelShutdownStateDecodeErrorZ"); + *ret_conv = CResult_ChannelShutdownStateDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_CVec_FutureZ_free(int64_tArray _res) { + LDKCVec_FutureZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKFuture), "LDKCVec_FutureZ Elements"); else - o_constr.data = NULL; - int8_tArray* o_vals = (void*) o->elems; - for (size_t i = 0; i < o_constr.datalen; i++) { - int8_tArray o_conv_8 = o_vals[i]; - LDKECDSASignature o_conv_8_ref; - CHECK(o_conv_8->arr_len == 64); - memcpy(o_conv_8_ref.compact_form, o_conv_8->elems, 64); FREE(o_conv_8); - o_constr.data[i] = o_conv_8_ref; + _res_constr.data = NULL; + int64_t* _res_vals = _res->elems; + for (size_t i = 0; i < _res_constr.datalen; i++) { + int64_t _res_conv_8 = _res_vals[i]; + LDKFuture _res_conv_8_conv; + _res_conv_8_conv.inner = untag_ptr(_res_conv_8); + _res_conv_8_conv.is_owned = ptr_is_owned(_res_conv_8); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_8_conv); + _res_constr.data[i] = _res_conv_8_conv; } - FREE(o); - LDKCResult_CVec_ECDSASignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_ECDSASignatureZNoneZ), "LDKCResult_CVec_ECDSASignatureZNoneZ"); - *ret_conv = CResult_CVec_ECDSASignatureZNoneZ_ok(o_constr); + FREE(_res); + CVec_FutureZ_free(_res_constr); +} + +int64_t CS_LDK_CResult_OffersMessageDecodeErrorZ_ok(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)); + LDKCResult_OffersMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersMessageDecodeErrorZ), "LDKCResult_OffersMessageDecodeErrorZ"); + *ret_conv = CResult_OffersMessageDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_CVec_ECDSASignatureZNoneZ_err() { - LDKCResult_CVec_ECDSASignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_ECDSASignatureZNoneZ), "LDKCResult_CVec_ECDSASignatureZNoneZ"); - *ret_conv = CResult_CVec_ECDSASignatureZNoneZ_err(); +int64_t CS_LDK_CResult_OffersMessageDecodeErrorZ_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_OffersMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersMessageDecodeErrorZ), "LDKCResult_OffersMessageDecodeErrorZ"); + *ret_conv = CResult_OffersMessageDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_CVec_ECDSASignatureZNoneZ_is_ok(int64_t o) { - LDKCResult_CVec_ECDSASignatureZNoneZ* o_conv = (LDKCResult_CVec_ECDSASignatureZNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_CVec_ECDSASignatureZNoneZ_is_ok(o_conv); +jboolean CS_LDK_CResult_OffersMessageDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_OffersMessageDecodeErrorZ* o_conv = (LDKCResult_OffersMessageDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OffersMessageDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_CVec_ECDSASignatureZNoneZ_free(int64_t _res) { +void CS_LDK_CResult_OffersMessageDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_CVec_ECDSASignatureZNoneZ _res_conv = *(LDKCResult_CVec_ECDSASignatureZNoneZ*)(_res_ptr); + LDKCResult_OffersMessageDecodeErrorZ _res_conv = *(LDKCResult_OffersMessageDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_CVec_ECDSASignatureZNoneZ_free(_res_conv); + CResult_OffersMessageDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_CVec_ECDSASignatureZNoneZ_clone_ptr(LDKCResult_CVec_ECDSASignatureZNoneZ *NONNULL_PTR arg) { - LDKCResult_CVec_ECDSASignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_ECDSASignatureZNoneZ), "LDKCResult_CVec_ECDSASignatureZNoneZ"); - *ret_conv = CResult_CVec_ECDSASignatureZNoneZ_clone(arg); +static inline uint64_t CResult_OffersMessageDecodeErrorZ_clone_ptr(LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OffersMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersMessageDecodeErrorZ), "LDKCResult_OffersMessageDecodeErrorZ"); + *ret_conv = CResult_OffersMessageDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_CVec_ECDSASignatureZNoneZ_clone_ptr(int64_t arg) { - LDKCResult_CVec_ECDSASignatureZNoneZ* arg_conv = (LDKCResult_CVec_ECDSASignatureZNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_CVec_ECDSASignatureZNoneZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_OffersMessageDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_OffersMessageDecodeErrorZ* arg_conv = (LDKCResult_OffersMessageDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OffersMessageDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_CVec_ECDSASignatureZNoneZ_clone(int64_t orig) { - LDKCResult_CVec_ECDSASignatureZNoneZ* orig_conv = (LDKCResult_CVec_ECDSASignatureZNoneZ*)untag_ptr(orig); - LDKCResult_CVec_ECDSASignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_ECDSASignatureZNoneZ), "LDKCResult_CVec_ECDSASignatureZNoneZ"); - *ret_conv = CResult_CVec_ECDSASignatureZNoneZ_clone(orig_conv); +int64_t CS_LDK_CResult_OffersMessageDecodeErrorZ_clone(int64_t orig) { + LDKCResult_OffersMessageDecodeErrorZ* orig_conv = (LDKCResult_OffersMessageDecodeErrorZ*)untag_ptr(orig); + LDKCResult_OffersMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersMessageDecodeErrorZ), "LDKCResult_OffersMessageDecodeErrorZ"); + *ret_conv = CResult_OffersMessageDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_COption_usizeZ_some(int64_t o) { - LDKCOption_usizeZ *ret_copy = MALLOC(sizeof(LDKCOption_usizeZ), "LDKCOption_usizeZ"); - *ret_copy = COption_usizeZ_some(o); +int64_t CS_LDK_COption_HTLCClaimZ_some(int32_t o) { + LDKHTLCClaim o_conv = LDKHTLCClaim_from_cs(o); + LDKCOption_HTLCClaimZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCClaimZ), "LDKCOption_HTLCClaimZ"); + *ret_copy = COption_HTLCClaimZ_some(o_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_COption_usizeZ_none() { - LDKCOption_usizeZ *ret_copy = MALLOC(sizeof(LDKCOption_usizeZ), "LDKCOption_usizeZ"); - *ret_copy = COption_usizeZ_none(); +int64_t CS_LDK_COption_HTLCClaimZ_none() { + LDKCOption_HTLCClaimZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCClaimZ), "LDKCOption_HTLCClaimZ"); + *ret_copy = COption_HTLCClaimZ_none(); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void CS_LDK_COption_usizeZ_free(int64_t _res) { +void CS_LDK_COption_HTLCClaimZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCOption_usizeZ _res_conv = *(LDKCOption_usizeZ*)(_res_ptr); + LDKCOption_HTLCClaimZ _res_conv = *(LDKCOption_HTLCClaimZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_usizeZ_free(_res_conv); -} - -static inline uint64_t COption_usizeZ_clone_ptr(LDKCOption_usizeZ *NONNULL_PTR arg) { - LDKCOption_usizeZ *ret_copy = MALLOC(sizeof(LDKCOption_usizeZ), "LDKCOption_usizeZ"); - *ret_copy = COption_usizeZ_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -int64_t CS_LDK_COption_usizeZ_clone_ptr(int64_t arg) { - LDKCOption_usizeZ* arg_conv = (LDKCOption_usizeZ*)untag_ptr(arg); - int64_t ret_conv = COption_usizeZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_COption_usizeZ_clone(int64_t orig) { - LDKCOption_usizeZ* orig_conv = (LDKCOption_usizeZ*)untag_ptr(orig); - LDKCOption_usizeZ *ret_copy = MALLOC(sizeof(LDKCOption_usizeZ), "LDKCOption_usizeZ"); - *ret_copy = COption_usizeZ_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + COption_HTLCClaimZ_free(_res_conv); } -int64_t CS_LDK_CResult_ShutdownScriptDecodeErrorZ_ok(int64_t o) { - LDKShutdownScript o_conv; +int64_t CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(int64_t o) { + LDKCounterpartyCommitmentSecrets o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = ShutdownScript_clone(&o_conv); - LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); - *ret_conv = CResult_ShutdownScriptDecodeErrorZ_ok(o_conv); + o_conv = CounterpartyCommitmentSecrets_clone(&o_conv); + LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ"); + *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ShutdownScriptDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_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_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); - *ret_conv = CResult_ShutdownScriptDecodeErrorZ_err(e_conv); + LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ"); + *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_ShutdownScriptDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_ShutdownScriptDecodeErrorZ* o_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ShutdownScriptDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* o_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_ShutdownScriptDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_ShutdownScriptDecodeErrorZ _res_conv = *(LDKCResult_ShutdownScriptDecodeErrorZ*)(_res_ptr); + LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_ShutdownScriptDecodeErrorZ_free(_res_conv); + CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_ShutdownScriptDecodeErrorZ_clone_ptr(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); - *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(arg); +static inline uint64_t CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ"); + *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ShutdownScriptDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_ShutdownScriptDecodeErrorZ* arg_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_ShutdownScriptDecodeErrorZ_clone(int64_t orig) { - LDKCResult_ShutdownScriptDecodeErrorZ* orig_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(orig); - LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); - *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(int64_t orig) { + LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(orig); + LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ"); + *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_ok(int64_t o) { - LDKShutdownScript o_conv; +int64_t CS_LDK_CResult_TxCreationKeysDecodeErrorZ_ok(int64_t o) { + LDKTxCreationKeys o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = ShutdownScript_clone(&o_conv); - LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); - *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_ok(o_conv); + o_conv = TxCreationKeys_clone(&o_conv); + LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); + *ret_conv = CResult_TxCreationKeysDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_err(int64_t e) { - LDKInvalidShutdownScript e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = InvalidShutdownScript_clone(&e_conv); - LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); - *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_err(e_conv); +int64_t CS_LDK_CResult_TxCreationKeysDecodeErrorZ_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_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); + *ret_conv = CResult_TxCreationKeysDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(int64_t o) { - LDKCResult_ShutdownScriptInvalidShutdownScriptZ* o_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(o); - jboolean ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(o_conv); +jboolean CS_LDK_CResult_TxCreationKeysDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_TxCreationKeysDecodeErrorZ* o_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_TxCreationKeysDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_free(int64_t _res) { +void CS_LDK_CResult_TxCreationKeysDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res_conv = *(LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(_res_ptr); + LDKCResult_TxCreationKeysDecodeErrorZ _res_conv = *(LDKCResult_TxCreationKeysDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_ShutdownScriptInvalidShutdownScriptZ_free(_res_conv); + CResult_TxCreationKeysDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR arg) { - LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); - *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(arg); +static inline uint64_t CResult_TxCreationKeysDecodeErrorZ_clone_ptr(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); + *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(int64_t arg) { - LDKCResult_ShutdownScriptInvalidShutdownScriptZ* arg_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_TxCreationKeysDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_TxCreationKeysDecodeErrorZ* arg_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_clone(int64_t orig) { - LDKCResult_ShutdownScriptInvalidShutdownScriptZ* orig_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(orig); - LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); - *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(orig_conv); +int64_t CS_LDK_CResult_TxCreationKeysDecodeErrorZ_clone(int64_t orig) { + LDKCResult_TxCreationKeysDecodeErrorZ* orig_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(orig); + LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); + *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -void CS_LDK_CVec_TransactionZ_free(ptrArray _res) { - LDKCVec_TransactionZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTransaction), "LDKCVec_TransactionZ Elements"); - else - _res_constr.data = NULL; - int8_tArray* _res_vals = (void*) _res->elems; - for (size_t i = 0; i < _res_constr.datalen; i++) { - int8_tArray _res_conv_8 = _res_vals[i]; - LDKTransaction _res_conv_8_ref; - _res_conv_8_ref.datalen = _res_conv_8->arr_len; - _res_conv_8_ref.data = MALLOC(_res_conv_8_ref.datalen, "LDKTransaction Bytes"); - memcpy(_res_conv_8_ref.data, _res_conv_8->elems, _res_conv_8_ref.datalen); FREE(_res_conv_8); - _res_conv_8_ref.data_is_owned = true; - _res_constr.data[i] = _res_conv_8_ref; - } - FREE(_res); - CVec_TransactionZ_free(_res_constr); -} - -int64_t CS_LDK_CResult_PaymentPurposeDecodeErrorZ_ok(int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKPaymentPurpose o_conv = *(LDKPaymentPurpose*)(o_ptr); - o_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(o)); - LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); - *ret_conv = CResult_PaymentPurposeDecodeErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_ok(int64_t o) { + LDKChannelPublicKeys o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = ChannelPublicKeys_clone(&o_conv); + LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); + *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PaymentPurposeDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_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_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); - *ret_conv = CResult_PaymentPurposeDecodeErrorZ_err(e_conv); + LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); + *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_PaymentPurposeDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_PaymentPurposeDecodeErrorZ* o_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_PaymentPurposeDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_ChannelPublicKeysDecodeErrorZ* o_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_PaymentPurposeDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_PaymentPurposeDecodeErrorZ _res_conv = *(LDKCResult_PaymentPurposeDecodeErrorZ*)(_res_ptr); + LDKCResult_ChannelPublicKeysDecodeErrorZ _res_conv = *(LDKCResult_ChannelPublicKeysDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_PaymentPurposeDecodeErrorZ_free(_res_conv); + CResult_ChannelPublicKeysDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_PaymentPurposeDecodeErrorZ_clone_ptr(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); - *ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone(arg); +static inline uint64_t CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); + *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PaymentPurposeDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_PaymentPurposeDecodeErrorZ* arg_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_ChannelPublicKeysDecodeErrorZ* arg_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_PaymentPurposeDecodeErrorZ_clone(int64_t orig) { - LDKCResult_PaymentPurposeDecodeErrorZ* orig_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(orig); - LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); - *ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_clone(int64_t orig) { + LDKCResult_ChannelPublicKeysDecodeErrorZ* orig_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); + *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ClaimedHTLCDecodeErrorZ_ok(int64_t o) { - LDKClaimedHTLC o_conv; +int64_t CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(int64_t o) { + LDKHTLCOutputInCommitment o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = ClaimedHTLC_clone(&o_conv); - LDKCResult_ClaimedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClaimedHTLCDecodeErrorZ), "LDKCResult_ClaimedHTLCDecodeErrorZ"); - *ret_conv = CResult_ClaimedHTLCDecodeErrorZ_ok(o_conv); + o_conv = HTLCOutputInCommitment_clone(&o_conv); + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); + *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ClaimedHTLCDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_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_ClaimedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClaimedHTLCDecodeErrorZ), "LDKCResult_ClaimedHTLCDecodeErrorZ"); - *ret_conv = CResult_ClaimedHTLCDecodeErrorZ_err(e_conv); + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); + *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_ClaimedHTLCDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_ClaimedHTLCDecodeErrorZ* o_conv = (LDKCResult_ClaimedHTLCDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ClaimedHTLCDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* o_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_ClaimedHTLCDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_ClaimedHTLCDecodeErrorZ _res_conv = *(LDKCResult_ClaimedHTLCDecodeErrorZ*)(_res_ptr); + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res_conv = *(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_ClaimedHTLCDecodeErrorZ_free(_res_conv); + CResult_HTLCOutputInCommitmentDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_ClaimedHTLCDecodeErrorZ_clone_ptr(LDKCResult_ClaimedHTLCDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ClaimedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClaimedHTLCDecodeErrorZ), "LDKCResult_ClaimedHTLCDecodeErrorZ"); - *ret_conv = CResult_ClaimedHTLCDecodeErrorZ_clone(arg); +static inline uint64_t CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); + *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ClaimedHTLCDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_ClaimedHTLCDecodeErrorZ* arg_conv = (LDKCResult_ClaimedHTLCDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ClaimedHTLCDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* arg_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_ClaimedHTLCDecodeErrorZ_clone(int64_t orig) { - LDKCResult_ClaimedHTLCDecodeErrorZ* orig_conv = (LDKCResult_ClaimedHTLCDecodeErrorZ*)untag_ptr(orig); - LDKCResult_ClaimedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClaimedHTLCDecodeErrorZ), "LDKCResult_ClaimedHTLCDecodeErrorZ"); - *ret_conv = CResult_ClaimedHTLCDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(int64_t orig) { + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* orig_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(orig); + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); + *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_COption_PathFailureZ_some(int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKPathFailure o_conv = *(LDKPathFailure*)(o_ptr); - o_conv = PathFailure_clone((LDKPathFailure*)untag_ptr(o)); - LDKCOption_PathFailureZ *ret_copy = MALLOC(sizeof(LDKCOption_PathFailureZ), "LDKCOption_PathFailureZ"); - *ret_copy = COption_PathFailureZ_some(o_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(int64_t o) { + LDKCounterpartyChannelTransactionParameters o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = CounterpartyChannelTransactionParameters_clone(&o_conv); + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); + *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_COption_PathFailureZ_none() { - LDKCOption_PathFailureZ *ret_copy = MALLOC(sizeof(LDKCOption_PathFailureZ), "LDKCOption_PathFailureZ"); - *ret_copy = COption_PathFailureZ_none(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_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_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); + *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -void CS_LDK_COption_PathFailureZ_free(int64_t _res) { +jboolean CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCOption_PathFailureZ _res_conv = *(LDKCOption_PathFailureZ*)(_res_ptr); + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_PathFailureZ_free(_res_conv); + CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(_res_conv); } -static inline uint64_t COption_PathFailureZ_clone_ptr(LDKCOption_PathFailureZ *NONNULL_PTR arg) { - LDKCOption_PathFailureZ *ret_copy = MALLOC(sizeof(LDKCOption_PathFailureZ), "LDKCOption_PathFailureZ"); - *ret_copy = COption_PathFailureZ_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +static inline uint64_t CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); + *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_COption_PathFailureZ_clone_ptr(int64_t arg) { - LDKCOption_PathFailureZ* arg_conv = (LDKCOption_PathFailureZ*)untag_ptr(arg); - int64_t ret_conv = COption_PathFailureZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_COption_PathFailureZ_clone(int64_t orig) { - LDKCOption_PathFailureZ* orig_conv = (LDKCOption_PathFailureZ*)untag_ptr(orig); - LDKCOption_PathFailureZ *ret_copy = MALLOC(sizeof(LDKCOption_PathFailureZ), "LDKCOption_PathFailureZ"); - *ret_copy = COption_PathFailureZ_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(int64_t orig) { + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(orig); + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); + *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_COption_PathFailureZDecodeErrorZ_ok(int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKCOption_PathFailureZ o_conv = *(LDKCOption_PathFailureZ*)(o_ptr); - o_conv = COption_PathFailureZ_clone((LDKCOption_PathFailureZ*)untag_ptr(o)); - LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ"); - *ret_conv = CResult_COption_PathFailureZDecodeErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_ok(int64_t o) { + LDKChannelTransactionParameters o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = ChannelTransactionParameters_clone(&o_conv); + LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); + *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_COption_PathFailureZDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_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_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ"); - *ret_conv = CResult_COption_PathFailureZDecodeErrorZ_err(e_conv); + LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); + *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_COption_PathFailureZDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_COption_PathFailureZDecodeErrorZ* o_conv = (LDKCResult_COption_PathFailureZDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_COption_PathFailureZDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_ChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_COption_PathFailureZDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_COption_PathFailureZDecodeErrorZ _res_conv = *(LDKCResult_COption_PathFailureZDecodeErrorZ*)(_res_ptr); + LDKCResult_ChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_COption_PathFailureZDecodeErrorZ_free(_res_conv); + CResult_ChannelTransactionParametersDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_COption_PathFailureZDecodeErrorZ_clone_ptr(LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ"); - *ret_conv = CResult_COption_PathFailureZDecodeErrorZ_clone(arg); +static inline uint64_t CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); + *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_COption_PathFailureZDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_COption_PathFailureZDecodeErrorZ* arg_conv = (LDKCResult_COption_PathFailureZDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_COption_PathFailureZDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_ChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_COption_PathFailureZDecodeErrorZ_clone(int64_t orig) { - LDKCResult_COption_PathFailureZDecodeErrorZ* orig_conv = (LDKCResult_COption_PathFailureZDecodeErrorZ*)untag_ptr(orig); - LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ"); - *ret_conv = CResult_COption_PathFailureZDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_clone(int64_t orig) { + LDKCResult_ChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); + *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_COption_ClosureReasonZ_some(int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKClosureReason o_conv = *(LDKClosureReason*)(o_ptr); - o_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(o)); - LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); - *ret_copy = COption_ClosureReasonZ_some(o_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_ok(int64_t o) { + LDKHolderCommitmentTransaction o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = HolderCommitmentTransaction_clone(&o_conv); + LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_COption_ClosureReasonZ_none() { - LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); - *ret_copy = COption_ClosureReasonZ_none(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_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_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -void CS_LDK_COption_ClosureReasonZ_free(int64_t _res) { +jboolean CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_HolderCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCOption_ClosureReasonZ _res_conv = *(LDKCOption_ClosureReasonZ*)(_res_ptr); + LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_ClosureReasonZ_free(_res_conv); + CResult_HolderCommitmentTransactionDecodeErrorZ_free(_res_conv); } -static inline uint64_t COption_ClosureReasonZ_clone_ptr(LDKCOption_ClosureReasonZ *NONNULL_PTR arg) { - LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); - *ret_copy = COption_ClosureReasonZ_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +static inline uint64_t CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_COption_ClosureReasonZ_clone_ptr(int64_t arg) { - LDKCOption_ClosureReasonZ* arg_conv = (LDKCOption_ClosureReasonZ*)untag_ptr(arg); - int64_t ret_conv = COption_ClosureReasonZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_HolderCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_COption_ClosureReasonZ_clone(int64_t orig) { - LDKCOption_ClosureReasonZ* orig_conv = (LDKCOption_ClosureReasonZ*)untag_ptr(orig); - LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); - *ret_copy = COption_ClosureReasonZ_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_clone(int64_t orig) { + LDKCResult_HolderCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(orig); + LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_ok(int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKCOption_ClosureReasonZ o_conv = *(LDKCOption_ClosureReasonZ*)(o_ptr); - o_conv = COption_ClosureReasonZ_clone((LDKCOption_ClosureReasonZ*)untag_ptr(o)); - LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); - *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(int64_t o) { + LDKBuiltCommitmentTransaction o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = BuiltCommitmentTransaction_clone(&o_conv); + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_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_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); - *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_err(e_conv); + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_COption_ClosureReasonZDecodeErrorZ* o_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_COption_ClosureReasonZDecodeErrorZ _res_conv = *(LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(_res_ptr); + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_COption_ClosureReasonZDecodeErrorZ_free(_res_conv); + CResult_BuiltCommitmentTransactionDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); - *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(arg); +static inline uint64_t CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_COption_ClosureReasonZDecodeErrorZ* arg_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_clone(int64_t orig) { - LDKCResult_COption_ClosureReasonZDecodeErrorZ* orig_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(orig); - LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); - *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(int64_t orig) { + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(orig); + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_COption_HTLCDestinationZ_some(int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKHTLCDestination o_conv = *(LDKHTLCDestination*)(o_ptr); - o_conv = HTLCDestination_clone((LDKHTLCDestination*)untag_ptr(o)); - LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ"); - *ret_copy = COption_HTLCDestinationZ_some(o_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_CResult_TrustedClosingTransactionNoneZ_ok(int64_t o) { + LDKTrustedClosingTransaction o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + // WARNING: we need a move here but no clone is available for LDKTrustedClosingTransaction + + LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ"); + *ret_conv = CResult_TrustedClosingTransactionNoneZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_COption_HTLCDestinationZ_none() { - LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ"); - *ret_copy = COption_HTLCDestinationZ_none(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_CResult_TrustedClosingTransactionNoneZ_err() { + LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ"); + *ret_conv = CResult_TrustedClosingTransactionNoneZ_err(); + return tag_ptr(ret_conv, true); } -void CS_LDK_COption_HTLCDestinationZ_free(int64_t _res) { +jboolean CS_LDK_CResult_TrustedClosingTransactionNoneZ_is_ok(int64_t o) { + LDKCResult_TrustedClosingTransactionNoneZ* o_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_TrustedClosingTransactionNoneZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_TrustedClosingTransactionNoneZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCOption_HTLCDestinationZ _res_conv = *(LDKCOption_HTLCDestinationZ*)(_res_ptr); + LDKCResult_TrustedClosingTransactionNoneZ _res_conv = *(LDKCResult_TrustedClosingTransactionNoneZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_HTLCDestinationZ_free(_res_conv); -} - -static inline uint64_t COption_HTLCDestinationZ_clone_ptr(LDKCOption_HTLCDestinationZ *NONNULL_PTR arg) { - LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ"); - *ret_copy = COption_HTLCDestinationZ_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -int64_t CS_LDK_COption_HTLCDestinationZ_clone_ptr(int64_t arg) { - LDKCOption_HTLCDestinationZ* arg_conv = (LDKCOption_HTLCDestinationZ*)untag_ptr(arg); - int64_t ret_conv = COption_HTLCDestinationZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_COption_HTLCDestinationZ_clone(int64_t orig) { - LDKCOption_HTLCDestinationZ* orig_conv = (LDKCOption_HTLCDestinationZ*)untag_ptr(orig); - LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ"); - *ret_copy = COption_HTLCDestinationZ_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + CResult_TrustedClosingTransactionNoneZ_free(_res_conv); } -int64_t CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_ok(int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKCOption_HTLCDestinationZ o_conv = *(LDKCOption_HTLCDestinationZ*)(o_ptr); - o_conv = COption_HTLCDestinationZ_clone((LDKCOption_HTLCDestinationZ*)untag_ptr(o)); - LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ"); - *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_ok(int64_t o) { + LDKCommitmentTransaction o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = CommitmentTransaction_clone(&o_conv); + LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_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_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ"); - *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_err(e_conv); + LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_COption_HTLCDestinationZDecodeErrorZ* o_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_CommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_CommitmentTransactionDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res_conv = *(LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)(_res_ptr); + LDKCResult_CommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_CommitmentTransactionDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_COption_HTLCDestinationZDecodeErrorZ_free(_res_conv); + CResult_CommitmentTransactionDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ"); - *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone(arg); +static inline uint64_t CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_COption_HTLCDestinationZDecodeErrorZ* arg_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_CommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_clone(int64_t orig) { - LDKCResult_COption_HTLCDestinationZDecodeErrorZ* orig_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(orig); - LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ"); - *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_clone(int64_t orig) { + LDKCResult_CommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(orig); + LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_ok(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); +int64_t CS_LDK_CResult_TrustedCommitmentTransactionNoneZ_ok(int64_t o) { + LDKTrustedCommitmentTransaction o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + // WARNING: we need a move here but no clone is available for LDKTrustedCommitmentTransaction + + LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ"); + *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_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); +int64_t CS_LDK_CResult_TrustedCommitmentTransactionNoneZ_err() { + LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ"); + *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_err(); return tag_ptr(ret_conv, true); } -jboolean 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); - return ret_conv; -} - -void CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_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); - FREE(untag_ptr(_res)); - CResult_PaymentFailureReasonDecodeErrorZ_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); - 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); +jboolean CS_LDK_CResult_TrustedCommitmentTransactionNoneZ_is_ok(int64_t o) { + LDKCResult_TrustedCommitmentTransactionNoneZ* o_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_TrustedCommitmentTransactionNoneZ_is_ok(o_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); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_COption_U128Z_some(int8_tArray o) { - LDKU128 o_ref; - CHECK(o->arr_len == 16); - memcpy(o_ref.le_bytes, o->elems, 16); FREE(o); - LDKCOption_U128Z *ret_copy = MALLOC(sizeof(LDKCOption_U128Z), "LDKCOption_U128Z"); - *ret_copy = COption_U128Z_some(o_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_COption_U128Z_none() { - LDKCOption_U128Z *ret_copy = MALLOC(sizeof(LDKCOption_U128Z), "LDKCOption_U128Z"); - *ret_copy = COption_U128Z_none(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -void CS_LDK_COption_U128Z_free(int64_t _res) { +void CS_LDK_CResult_TrustedCommitmentTransactionNoneZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCOption_U128Z _res_conv = *(LDKCOption_U128Z*)(_res_ptr); + LDKCResult_TrustedCommitmentTransactionNoneZ _res_conv = *(LDKCResult_TrustedCommitmentTransactionNoneZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_U128Z_free(_res_conv); -} - -static inline uint64_t COption_U128Z_clone_ptr(LDKCOption_U128Z *NONNULL_PTR arg) { - LDKCOption_U128Z *ret_copy = MALLOC(sizeof(LDKCOption_U128Z), "LDKCOption_U128Z"); - *ret_copy = COption_U128Z_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -int64_t CS_LDK_COption_U128Z_clone_ptr(int64_t arg) { - LDKCOption_U128Z* arg_conv = (LDKCOption_U128Z*)untag_ptr(arg); - int64_t ret_conv = COption_U128Z_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_COption_U128Z_clone(int64_t orig) { - LDKCOption_U128Z* orig_conv = (LDKCOption_U128Z*)untag_ptr(orig); - LDKCOption_U128Z *ret_copy = MALLOC(sizeof(LDKCOption_U128Z), "LDKCOption_U128Z"); - *ret_copy = COption_U128Z_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + CResult_TrustedCommitmentTransactionNoneZ_free(_res_conv); } -void CS_LDK_CVec_ClaimedHTLCZ_free(int64_tArray _res) { - LDKCVec_ClaimedHTLCZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKClaimedHTLC), "LDKCVec_ClaimedHTLCZ Elements"); +int64_t CS_LDK_CResult_CVec_ECDSASignatureZNoneZ_ok(ptrArray o) { + LDKCVec_ECDSASignatureZ o_constr; + o_constr.datalen = o->arr_len; + if (o_constr.datalen > 0) + o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKECDSASignature), "LDKCVec_ECDSASignatureZ Elements"); else - _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]; - LDKClaimedHTLC _res_conv_13_conv; - _res_conv_13_conv.inner = untag_ptr(_res_conv_13); - _res_conv_13_conv.is_owned = ptr_is_owned(_res_conv_13); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_13_conv); - _res_constr.data[n] = _res_conv_13_conv; + o_constr.data = NULL; + int8_tArray* o_vals = (void*) o->elems; + for (size_t i = 0; i < o_constr.datalen; i++) { + int8_tArray o_conv_8 = o_vals[i]; + LDKECDSASignature o_conv_8_ref; + CHECK(o_conv_8->arr_len == 64); + memcpy(o_conv_8_ref.compact_form, o_conv_8->elems, 64); FREE(o_conv_8); + o_constr.data[i] = o_conv_8_ref; } - FREE(_res); - CVec_ClaimedHTLCZ_free(_res_constr); + FREE(o); + LDKCResult_CVec_ECDSASignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_ECDSASignatureZNoneZ), "LDKCResult_CVec_ECDSASignatureZNoneZ"); + *ret_conv = CResult_CVec_ECDSASignatureZNoneZ_ok(o_constr); + return tag_ptr(ret_conv, true); } -int64_t 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_CResult_CVec_ECDSASignatureZNoneZ_err() { + LDKCResult_CVec_ECDSASignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_ECDSASignatureZNoneZ), "LDKCResult_CVec_ECDSASignatureZNoneZ"); + *ret_conv = CResult_CVec_ECDSASignatureZNoneZ_err(); + return tag_ptr(ret_conv, true); } -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; +jboolean CS_LDK_CResult_CVec_ECDSASignatureZNoneZ_is_ok(int64_t o) { + LDKCResult_CVec_ECDSASignatureZNoneZ* o_conv = (LDKCResult_CVec_ECDSASignatureZNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_CVec_ECDSASignatureZNoneZ_is_ok(o_conv); + return ret_conv; } -void CS_LDK_COption_PaymentFailureReasonZ_free(int64_t _res) { +void CS_LDK_CResult_CVec_ECDSASignatureZNoneZ_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); + LDKCResult_CVec_ECDSASignatureZNoneZ _res_conv = *(LDKCResult_CVec_ECDSASignatureZNoneZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_PaymentFailureReasonZ_free(_res_conv); + CResult_CVec_ECDSASignatureZNoneZ_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; +static inline uint64_t CResult_CVec_ECDSASignatureZNoneZ_clone_ptr(LDKCResult_CVec_ECDSASignatureZNoneZ *NONNULL_PTR arg) { + LDKCResult_CVec_ECDSASignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_ECDSASignatureZNoneZ), "LDKCResult_CVec_ECDSASignatureZNoneZ"); + *ret_conv = CResult_CVec_ECDSASignatureZNoneZ_clone(arg); + return tag_ptr(ret_conv, true); } -int64_t 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); +int64_t CS_LDK_CResult_CVec_ECDSASignatureZNoneZ_clone_ptr(int64_t arg) { + LDKCResult_CVec_ECDSASignatureZNoneZ* arg_conv = (LDKCResult_CVec_ECDSASignatureZNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_CVec_ECDSASignatureZNoneZ_clone_ptr(arg_conv); return ret_conv; } -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_CVec_ECDSASignatureZNoneZ_clone(int64_t orig) { + LDKCResult_CVec_ECDSASignatureZNoneZ* orig_conv = (LDKCResult_CVec_ECDSASignatureZNoneZ*)untag_ptr(orig); + LDKCResult_CVec_ECDSASignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_ECDSASignatureZNoneZ), "LDKCResult_CVec_ECDSASignatureZNoneZ"); + *ret_conv = CResult_CVec_ECDSASignatureZNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_COption_EventZ_some(int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKEvent o_conv = *(LDKEvent*)(o_ptr); - o_conv = Event_clone((LDKEvent*)untag_ptr(o)); - LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); - *ret_copy = COption_EventZ_some(o_conv); +int64_t CS_LDK_COption_usizeZ_some(int64_t o) { + LDKCOption_usizeZ *ret_copy = MALLOC(sizeof(LDKCOption_usizeZ), "LDKCOption_usizeZ"); + *ret_copy = COption_usizeZ_some(o); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_COption_EventZ_none() { - LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); - *ret_copy = COption_EventZ_none(); +int64_t CS_LDK_COption_usizeZ_none() { + LDKCOption_usizeZ *ret_copy = MALLOC(sizeof(LDKCOption_usizeZ), "LDKCOption_usizeZ"); + *ret_copy = COption_usizeZ_none(); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void CS_LDK_COption_EventZ_free(int64_t _res) { +void CS_LDK_COption_usizeZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCOption_EventZ _res_conv = *(LDKCOption_EventZ*)(_res_ptr); + LDKCOption_usizeZ _res_conv = *(LDKCOption_usizeZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_EventZ_free(_res_conv); + COption_usizeZ_free(_res_conv); } -static inline uint64_t COption_EventZ_clone_ptr(LDKCOption_EventZ *NONNULL_PTR arg) { - LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); - *ret_copy = COption_EventZ_clone(arg); +static inline uint64_t COption_usizeZ_clone_ptr(LDKCOption_usizeZ *NONNULL_PTR arg) { + LDKCOption_usizeZ *ret_copy = MALLOC(sizeof(LDKCOption_usizeZ), "LDKCOption_usizeZ"); + *ret_copy = COption_usizeZ_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_COption_EventZ_clone_ptr(int64_t arg) { - LDKCOption_EventZ* arg_conv = (LDKCOption_EventZ*)untag_ptr(arg); - int64_t ret_conv = COption_EventZ_clone_ptr(arg_conv); +int64_t CS_LDK_COption_usizeZ_clone_ptr(int64_t arg) { + LDKCOption_usizeZ* arg_conv = (LDKCOption_usizeZ*)untag_ptr(arg); + int64_t ret_conv = COption_usizeZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_COption_EventZ_clone(int64_t orig) { - LDKCOption_EventZ* orig_conv = (LDKCOption_EventZ*)untag_ptr(orig); - LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); - *ret_copy = COption_EventZ_clone(orig_conv); +int64_t CS_LDK_COption_usizeZ_clone(int64_t orig) { + LDKCOption_usizeZ* orig_conv = (LDKCOption_usizeZ*)untag_ptr(orig); + LDKCOption_usizeZ *ret_copy = MALLOC(sizeof(LDKCOption_usizeZ), "LDKCOption_usizeZ"); + *ret_copy = COption_usizeZ_clone(orig_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_CResult_COption_EventZDecodeErrorZ_ok(int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKCOption_EventZ o_conv = *(LDKCOption_EventZ*)(o_ptr); - o_conv = COption_EventZ_clone((LDKCOption_EventZ*)untag_ptr(o)); - LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); - *ret_conv = CResult_COption_EventZDecodeErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_ShutdownScriptDecodeErrorZ_ok(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 = ShutdownScript_clone(&o_conv); + LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); + *ret_conv = CResult_ShutdownScriptDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_COption_EventZDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_ShutdownScriptDecodeErrorZ_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_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); - *ret_conv = CResult_COption_EventZDecodeErrorZ_err(e_conv); + LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); + *ret_conv = CResult_ShutdownScriptDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_COption_EventZDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_COption_EventZDecodeErrorZ* o_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_COption_EventZDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_ShutdownScriptDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_ShutdownScriptDecodeErrorZ* o_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ShutdownScriptDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_COption_EventZDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_ShutdownScriptDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_COption_EventZDecodeErrorZ _res_conv = *(LDKCResult_COption_EventZDecodeErrorZ*)(_res_ptr); + LDKCResult_ShutdownScriptDecodeErrorZ _res_conv = *(LDKCResult_ShutdownScriptDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_COption_EventZDecodeErrorZ_free(_res_conv); + CResult_ShutdownScriptDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_COption_EventZDecodeErrorZ_clone_ptr(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); - *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(arg); +static inline uint64_t CResult_ShutdownScriptDecodeErrorZ_clone_ptr(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); + *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_COption_EventZDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_COption_EventZDecodeErrorZ* arg_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_COption_EventZDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_ShutdownScriptDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_ShutdownScriptDecodeErrorZ* arg_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_COption_EventZDecodeErrorZ_clone(int64_t orig) { - LDKCResult_COption_EventZDecodeErrorZ* orig_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(orig); - LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); - *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_ShutdownScriptDecodeErrorZ_clone(int64_t orig) { + LDKCResult_ShutdownScriptDecodeErrorZ* orig_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); + *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -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"); - *ret_conv = CResult_SiPrefixBolt11ParseErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_ok(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 = ShutdownScript_clone(&o_conv); + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); + *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_SiPrefixBolt11ParseErrorZ_err(int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKBolt11ParseError e_conv = *(LDKBolt11ParseError*)(e_ptr); - e_conv = Bolt11ParseError_clone((LDKBolt11ParseError*)untag_ptr(e)); - LDKCResult_SiPrefixBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixBolt11ParseErrorZ), "LDKCResult_SiPrefixBolt11ParseErrorZ"); - *ret_conv = CResult_SiPrefixBolt11ParseErrorZ_err(e_conv); +int64_t CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_err(int64_t e) { + LDKInvalidShutdownScript e_conv; + e_conv.inner = untag_ptr(e); + e_conv.is_owned = ptr_is_owned(e); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = InvalidShutdownScript_clone(&e_conv); + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); + *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_SiPrefixBolt11ParseErrorZ_is_ok(int64_t o) { - LDKCResult_SiPrefixBolt11ParseErrorZ* o_conv = (LDKCResult_SiPrefixBolt11ParseErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_SiPrefixBolt11ParseErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(int64_t o) { + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* o_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(o); + jboolean ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_SiPrefixBolt11ParseErrorZ_free(int64_t _res) { +void CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_SiPrefixBolt11ParseErrorZ _res_conv = *(LDKCResult_SiPrefixBolt11ParseErrorZ*)(_res_ptr); + LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res_conv = *(LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_SiPrefixBolt11ParseErrorZ_free(_res_conv); + CResult_ShutdownScriptInvalidShutdownScriptZ_free(_res_conv); } -static inline uint64_t CResult_SiPrefixBolt11ParseErrorZ_clone_ptr(LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR arg) { - LDKCResult_SiPrefixBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixBolt11ParseErrorZ), "LDKCResult_SiPrefixBolt11ParseErrorZ"); - *ret_conv = CResult_SiPrefixBolt11ParseErrorZ_clone(arg); +static inline uint64_t CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR arg) { + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); + *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_SiPrefixBolt11ParseErrorZ_clone_ptr(int64_t arg) { - LDKCResult_SiPrefixBolt11ParseErrorZ* arg_conv = (LDKCResult_SiPrefixBolt11ParseErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_SiPrefixBolt11ParseErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(int64_t arg) { + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* arg_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_SiPrefixBolt11ParseErrorZ_clone(int64_t orig) { - LDKCResult_SiPrefixBolt11ParseErrorZ* orig_conv = (LDKCResult_SiPrefixBolt11ParseErrorZ*)untag_ptr(orig); - LDKCResult_SiPrefixBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixBolt11ParseErrorZ), "LDKCResult_SiPrefixBolt11ParseErrorZ"); - *ret_conv = CResult_SiPrefixBolt11ParseErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_clone(int64_t orig) { + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* orig_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(orig); + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); + *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_Bolt11InvoiceParseOrSemanticErrorZ_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_Bolt11InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ), "LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ"); - *ret_conv = CResult_Bolt11InvoiceParseOrSemanticErrorZ_ok(o_conv); +void CS_LDK_CVec_TransactionZ_free(ptrArray _res) { + LDKCVec_TransactionZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTransaction), "LDKCVec_TransactionZ Elements"); + else + _res_constr.data = NULL; + int8_tArray* _res_vals = (void*) _res->elems; + for (size_t i = 0; i < _res_constr.datalen; i++) { + int8_tArray _res_conv_8 = _res_vals[i]; + LDKTransaction _res_conv_8_ref; + _res_conv_8_ref.datalen = _res_conv_8->arr_len; + _res_conv_8_ref.data = MALLOC(_res_conv_8_ref.datalen, "LDKTransaction Bytes"); + memcpy(_res_conv_8_ref.data, _res_conv_8->elems, _res_conv_8_ref.datalen); FREE(_res_conv_8); + _res_conv_8_ref.data_is_owned = true; + _res_constr.data[i] = _res_conv_8_ref; + } + FREE(_res); + CVec_TransactionZ_free(_res_constr); +} + +int64_t CS_LDK_CResult_PaymentPurposeDecodeErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKPaymentPurpose o_conv = *(LDKPaymentPurpose*)(o_ptr); + o_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(o)); + LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); + *ret_conv = CResult_PaymentPurposeDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_Bolt11InvoiceParseOrSemanticErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_PaymentPurposeDecodeErrorZ_err(int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); - LDKParseOrSemanticError e_conv = *(LDKParseOrSemanticError*)(e_ptr); - e_conv = ParseOrSemanticError_clone((LDKParseOrSemanticError*)untag_ptr(e)); - LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ), "LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ"); - *ret_conv = CResult_Bolt11InvoiceParseOrSemanticErrorZ_err(e_conv); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); + *ret_conv = CResult_PaymentPurposeDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_Bolt11InvoiceParseOrSemanticErrorZ_is_ok(int64_t o) { - LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* o_conv = (LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_Bolt11InvoiceParseOrSemanticErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_PaymentPurposeDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_PaymentPurposeDecodeErrorZ* o_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_PaymentPurposeDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_Bolt11InvoiceParseOrSemanticErrorZ_free(int64_t _res) { +void CS_LDK_CResult_PaymentPurposeDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ _res_conv = *(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ*)(_res_ptr); + LDKCResult_PaymentPurposeDecodeErrorZ _res_conv = *(LDKCResult_PaymentPurposeDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_Bolt11InvoiceParseOrSemanticErrorZ_free(_res_conv); + CResult_PaymentPurposeDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone_ptr(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ *NONNULL_PTR arg) { - LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ), "LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ"); - *ret_conv = CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone(arg); +static inline uint64_t CResult_PaymentPurposeDecodeErrorZ_clone_ptr(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); + *ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone_ptr(int64_t arg) { - LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* arg_conv = (LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_PaymentPurposeDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_PaymentPurposeDecodeErrorZ* arg_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone(int64_t orig) { - LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* orig_conv = (LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ*)untag_ptr(orig); - LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ), "LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ"); - *ret_conv = CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_PaymentPurposeDecodeErrorZ_clone(int64_t orig) { + LDKCResult_PaymentPurposeDecodeErrorZ* orig_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(orig); + LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); + *ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_ok(int64_t o) { - LDKSignedRawBolt11Invoice o_conv; +int64_t CS_LDK_CResult_ClaimedHTLCDecodeErrorZ_ok(int64_t o) { + LDKClaimedHTLC o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = SignedRawBolt11Invoice_clone(&o_conv); - LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ), "LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ"); - *ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_ok(o_conv); + o_conv = ClaimedHTLC_clone(&o_conv); + LDKCResult_ClaimedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClaimedHTLCDecodeErrorZ), "LDKCResult_ClaimedHTLCDecodeErrorZ"); + *ret_conv = CResult_ClaimedHTLCDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_ClaimedHTLCDecodeErrorZ_err(int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); - LDKBolt11ParseError e_conv = *(LDKBolt11ParseError*)(e_ptr); - e_conv = Bolt11ParseError_clone((LDKBolt11ParseError*)untag_ptr(e)); - LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ), "LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ"); - *ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_err(e_conv); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_ClaimedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClaimedHTLCDecodeErrorZ), "LDKCResult_ClaimedHTLCDecodeErrorZ"); + *ret_conv = CResult_ClaimedHTLCDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_is_ok(int64_t o) { - LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* o_conv = (LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_ClaimedHTLCDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_ClaimedHTLCDecodeErrorZ* o_conv = (LDKCResult_ClaimedHTLCDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ClaimedHTLCDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_free(int64_t _res) { +void CS_LDK_CResult_ClaimedHTLCDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ _res_conv = *(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ*)(_res_ptr); + LDKCResult_ClaimedHTLCDecodeErrorZ _res_conv = *(LDKCResult_ClaimedHTLCDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_free(_res_conv); + CResult_ClaimedHTLCDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone_ptr(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR arg) { - LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ), "LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ"); - *ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone(arg); +static inline uint64_t CResult_ClaimedHTLCDecodeErrorZ_clone_ptr(LDKCResult_ClaimedHTLCDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ClaimedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClaimedHTLCDecodeErrorZ), "LDKCResult_ClaimedHTLCDecodeErrorZ"); + *ret_conv = CResult_ClaimedHTLCDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone_ptr(int64_t arg) { - LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* arg_conv = (LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_ClaimedHTLCDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_ClaimedHTLCDecodeErrorZ* arg_conv = (LDKCResult_ClaimedHTLCDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ClaimedHTLCDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone(int64_t orig) { - LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* orig_conv = (LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ*)untag_ptr(orig); - LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ), "LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ"); - *ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -static inline uint64_t C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone_ptr(LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ *NONNULL_PTR arg) { - LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ), "LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ"); - *ret_conv = C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone(arg); +int64_t CS_LDK_CResult_ClaimedHTLCDecodeErrorZ_clone(int64_t orig) { + LDKCResult_ClaimedHTLCDecodeErrorZ* orig_conv = (LDKCResult_ClaimedHTLCDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ClaimedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClaimedHTLCDecodeErrorZ), "LDKCResult_ClaimedHTLCDecodeErrorZ"); + *ret_conv = CResult_ClaimedHTLCDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone_ptr(int64_t arg) { - LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ* arg_conv = (LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ*)untag_ptr(arg); - int64_t ret_conv = C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone_ptr(arg_conv); - return ret_conv; -} -int64_t CS_LDK_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone(int64_t orig) { - LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ* orig_conv = (LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ*)untag_ptr(orig); - LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ), "LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ"); - *ret_conv = C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone(orig_conv); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_COption_PathFailureZ_some(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKPathFailure o_conv = *(LDKPathFailure*)(o_ptr); + o_conv = PathFailure_clone((LDKPathFailure*)untag_ptr(o)); + LDKCOption_PathFailureZ *ret_copy = MALLOC(sizeof(LDKCOption_PathFailureZ), "LDKCOption_PathFailureZ"); + *ret_copy = COption_PathFailureZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_new(int64_t a, int8_tArray b, int64_t c) { - LDKRawBolt11Invoice a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = RawBolt11Invoice_clone(&a_conv); - LDKThirtyTwoBytes b_ref; - CHECK(b->arr_len == 32); - memcpy(b_ref.data, b->elems, 32); FREE(b); - LDKBolt11InvoiceSignature c_conv; - c_conv.inner = untag_ptr(c); - c_conv.is_owned = ptr_is_owned(c); - CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv); - c_conv = Bolt11InvoiceSignature_clone(&c_conv); - LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ), "LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ"); - *ret_conv = C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_new(a_conv, b_ref, c_conv); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_COption_PathFailureZ_none() { + LDKCOption_PathFailureZ *ret_copy = MALLOC(sizeof(LDKCOption_PathFailureZ), "LDKCOption_PathFailureZ"); + *ret_copy = COption_PathFailureZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_free(int64_t _res) { +void CS_LDK_COption_PathFailureZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ _res_conv = *(LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ*)(_res_ptr); + LDKCOption_PathFailureZ _res_conv = *(LDKCOption_PathFailureZ*)(_res_ptr); FREE(untag_ptr(_res)); - C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_free(_res_conv); + COption_PathFailureZ_free(_res_conv); } -int64_t CS_LDK_CResult_PayeePubKeySecp256k1ErrorZ_ok(int64_t o) { - LDKPayeePubKey o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = PayeePubKey_clone(&o_conv); - LDKCResult_PayeePubKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeySecp256k1ErrorZ), "LDKCResult_PayeePubKeySecp256k1ErrorZ"); - *ret_conv = CResult_PayeePubKeySecp256k1ErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); +static inline uint64_t COption_PathFailureZ_clone_ptr(LDKCOption_PathFailureZ *NONNULL_PTR arg) { + LDKCOption_PathFailureZ *ret_copy = MALLOC(sizeof(LDKCOption_PathFailureZ), "LDKCOption_PathFailureZ"); + *ret_copy = COption_PathFailureZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_COption_PathFailureZ_clone_ptr(int64_t arg) { + LDKCOption_PathFailureZ* arg_conv = (LDKCOption_PathFailureZ*)untag_ptr(arg); + int64_t ret_conv = COption_PathFailureZ_clone_ptr(arg_conv); + return ret_conv; } -int64_t CS_LDK_CResult_PayeePubKeySecp256k1ErrorZ_err(int32_t e) { - LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_cs(e); - LDKCResult_PayeePubKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeySecp256k1ErrorZ), "LDKCResult_PayeePubKeySecp256k1ErrorZ"); - *ret_conv = CResult_PayeePubKeySecp256k1ErrorZ_err(e_conv); +int64_t CS_LDK_COption_PathFailureZ_clone(int64_t orig) { + LDKCOption_PathFailureZ* orig_conv = (LDKCOption_PathFailureZ*)untag_ptr(orig); + LDKCOption_PathFailureZ *ret_copy = MALLOC(sizeof(LDKCOption_PathFailureZ), "LDKCOption_PathFailureZ"); + *ret_copy = COption_PathFailureZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_CResult_COption_PathFailureZDecodeErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKCOption_PathFailureZ o_conv = *(LDKCOption_PathFailureZ*)(o_ptr); + o_conv = COption_PathFailureZ_clone((LDKCOption_PathFailureZ*)untag_ptr(o)); + LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ"); + *ret_conv = CResult_COption_PathFailureZDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_PayeePubKeySecp256k1ErrorZ_is_ok(int64_t o) { - LDKCResult_PayeePubKeySecp256k1ErrorZ* o_conv = (LDKCResult_PayeePubKeySecp256k1ErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_PayeePubKeySecp256k1ErrorZ_is_ok(o_conv); +int64_t CS_LDK_CResult_COption_PathFailureZDecodeErrorZ_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_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ"); + *ret_conv = CResult_COption_PathFailureZDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_COption_PathFailureZDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_COption_PathFailureZDecodeErrorZ* o_conv = (LDKCResult_COption_PathFailureZDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_COption_PathFailureZDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_PayeePubKeySecp256k1ErrorZ_free(int64_t _res) { +void CS_LDK_CResult_COption_PathFailureZDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_PayeePubKeySecp256k1ErrorZ _res_conv = *(LDKCResult_PayeePubKeySecp256k1ErrorZ*)(_res_ptr); + LDKCResult_COption_PathFailureZDecodeErrorZ _res_conv = *(LDKCResult_COption_PathFailureZDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_PayeePubKeySecp256k1ErrorZ_free(_res_conv); + CResult_COption_PathFailureZDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_PayeePubKeySecp256k1ErrorZ_clone_ptr(LDKCResult_PayeePubKeySecp256k1ErrorZ *NONNULL_PTR arg) { - LDKCResult_PayeePubKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeySecp256k1ErrorZ), "LDKCResult_PayeePubKeySecp256k1ErrorZ"); - *ret_conv = CResult_PayeePubKeySecp256k1ErrorZ_clone(arg); +static inline uint64_t CResult_COption_PathFailureZDecodeErrorZ_clone_ptr(LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ"); + *ret_conv = CResult_COption_PathFailureZDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PayeePubKeySecp256k1ErrorZ_clone_ptr(int64_t arg) { - LDKCResult_PayeePubKeySecp256k1ErrorZ* arg_conv = (LDKCResult_PayeePubKeySecp256k1ErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_PayeePubKeySecp256k1ErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_COption_PathFailureZDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_COption_PathFailureZDecodeErrorZ* arg_conv = (LDKCResult_COption_PathFailureZDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_COption_PathFailureZDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_PayeePubKeySecp256k1ErrorZ_clone(int64_t orig) { - LDKCResult_PayeePubKeySecp256k1ErrorZ* orig_conv = (LDKCResult_PayeePubKeySecp256k1ErrorZ*)untag_ptr(orig); - LDKCResult_PayeePubKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeySecp256k1ErrorZ), "LDKCResult_PayeePubKeySecp256k1ErrorZ"); - *ret_conv = CResult_PayeePubKeySecp256k1ErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -void CS_LDK_CVec_PrivateRouteZ_free(int64_tArray _res) { - LDKCVec_PrivateRouteZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPrivateRoute), "LDKCVec_PrivateRouteZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = _res->elems; - for (size_t o = 0; o < _res_constr.datalen; o++) { - int64_t _res_conv_14 = _res_vals[o]; - LDKPrivateRoute _res_conv_14_conv; - _res_conv_14_conv.inner = untag_ptr(_res_conv_14); - _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv); - _res_constr.data[o] = _res_conv_14_conv; - } - FREE(_res); - CVec_PrivateRouteZ_free(_res_constr); -} - -int64_t CS_LDK_CResult_PositiveTimestampCreationErrorZ_ok(int64_t o) { - LDKPositiveTimestamp o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = PositiveTimestamp_clone(&o_conv); - LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); - *ret_conv = CResult_PositiveTimestampCreationErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_COption_PathFailureZDecodeErrorZ_clone(int64_t orig) { + LDKCResult_COption_PathFailureZDecodeErrorZ* orig_conv = (LDKCResult_COption_PathFailureZDecodeErrorZ*)untag_ptr(orig); + LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ"); + *ret_conv = CResult_COption_PathFailureZDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PositiveTimestampCreationErrorZ_err(int32_t e) { - LDKCreationError e_conv = LDKCreationError_from_cs(e); - LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); - *ret_conv = CResult_PositiveTimestampCreationErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_COption_ClosureReasonZ_some(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKClosureReason o_conv = *(LDKClosureReason*)(o_ptr); + o_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(o)); + LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); + *ret_copy = COption_ClosureReasonZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_CResult_PositiveTimestampCreationErrorZ_is_ok(int64_t o) { - LDKCResult_PositiveTimestampCreationErrorZ* o_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_PositiveTimestampCreationErrorZ_is_ok(o_conv); - return ret_conv; +int64_t CS_LDK_COption_ClosureReasonZ_none() { + LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); + *ret_copy = COption_ClosureReasonZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_CResult_PositiveTimestampCreationErrorZ_free(int64_t _res) { +void CS_LDK_COption_ClosureReasonZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_PositiveTimestampCreationErrorZ _res_conv = *(LDKCResult_PositiveTimestampCreationErrorZ*)(_res_ptr); + LDKCOption_ClosureReasonZ _res_conv = *(LDKCOption_ClosureReasonZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_PositiveTimestampCreationErrorZ_free(_res_conv); + COption_ClosureReasonZ_free(_res_conv); } -static inline uint64_t CResult_PositiveTimestampCreationErrorZ_clone_ptr(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR arg) { - LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); - *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(arg); - return tag_ptr(ret_conv, true); +static inline uint64_t COption_ClosureReasonZ_clone_ptr(LDKCOption_ClosureReasonZ *NONNULL_PTR arg) { + LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); + *ret_copy = COption_ClosureReasonZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_CResult_PositiveTimestampCreationErrorZ_clone_ptr(int64_t arg) { - LDKCResult_PositiveTimestampCreationErrorZ* arg_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_PositiveTimestampCreationErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_COption_ClosureReasonZ_clone_ptr(int64_t arg) { + LDKCOption_ClosureReasonZ* arg_conv = (LDKCOption_ClosureReasonZ*)untag_ptr(arg); + int64_t ret_conv = COption_ClosureReasonZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_PositiveTimestampCreationErrorZ_clone(int64_t orig) { - LDKCResult_PositiveTimestampCreationErrorZ* orig_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(orig); - LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); - *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_COption_ClosureReasonZ_clone(int64_t orig) { + LDKCOption_ClosureReasonZ* orig_conv = (LDKCOption_ClosureReasonZ*)untag_ptr(orig); + LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); + *ret_copy = COption_ClosureReasonZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_CResult_NoneBolt11SemanticErrorZ_ok() { - LDKCResult_NoneBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt11SemanticErrorZ), "LDKCResult_NoneBolt11SemanticErrorZ"); - *ret_conv = CResult_NoneBolt11SemanticErrorZ_ok(); +int64_t CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKCOption_ClosureReasonZ o_conv = *(LDKCOption_ClosureReasonZ*)(o_ptr); + o_conv = COption_ClosureReasonZ_clone((LDKCOption_ClosureReasonZ*)untag_ptr(o)); + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_NoneBolt11SemanticErrorZ_err(int32_t e) { - LDKBolt11SemanticError e_conv = LDKBolt11SemanticError_from_cs(e); - LDKCResult_NoneBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt11SemanticErrorZ), "LDKCResult_NoneBolt11SemanticErrorZ"); - *ret_conv = CResult_NoneBolt11SemanticErrorZ_err(e_conv); +int64_t CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_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_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_NoneBolt11SemanticErrorZ_is_ok(int64_t o) { - LDKCResult_NoneBolt11SemanticErrorZ* o_conv = (LDKCResult_NoneBolt11SemanticErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_NoneBolt11SemanticErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ* o_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_NoneBolt11SemanticErrorZ_free(int64_t _res) { +void CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_NoneBolt11SemanticErrorZ _res_conv = *(LDKCResult_NoneBolt11SemanticErrorZ*)(_res_ptr); + LDKCResult_COption_ClosureReasonZDecodeErrorZ _res_conv = *(LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_NoneBolt11SemanticErrorZ_free(_res_conv); + CResult_COption_ClosureReasonZDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_NoneBolt11SemanticErrorZ_clone_ptr(LDKCResult_NoneBolt11SemanticErrorZ *NONNULL_PTR arg) { - LDKCResult_NoneBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt11SemanticErrorZ), "LDKCResult_NoneBolt11SemanticErrorZ"); - *ret_conv = CResult_NoneBolt11SemanticErrorZ_clone(arg); +static inline uint64_t CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_NoneBolt11SemanticErrorZ_clone_ptr(int64_t arg) { - LDKCResult_NoneBolt11SemanticErrorZ* arg_conv = (LDKCResult_NoneBolt11SemanticErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_NoneBolt11SemanticErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ* arg_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_NoneBolt11SemanticErrorZ_clone(int64_t orig) { - LDKCResult_NoneBolt11SemanticErrorZ* orig_conv = (LDKCResult_NoneBolt11SemanticErrorZ*)untag_ptr(orig); - LDKCResult_NoneBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt11SemanticErrorZ), "LDKCResult_NoneBolt11SemanticErrorZ"); - *ret_conv = CResult_NoneBolt11SemanticErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_Bolt11InvoiceBolt11SemanticErrorZ_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_Bolt11InvoiceBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ), "LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ"); - *ret_conv = CResult_Bolt11InvoiceBolt11SemanticErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_clone(int64_t orig) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ* orig_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(orig); + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_Bolt11InvoiceBolt11SemanticErrorZ_err(int32_t e) { - LDKBolt11SemanticError e_conv = LDKBolt11SemanticError_from_cs(e); - LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ), "LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ"); - *ret_conv = CResult_Bolt11InvoiceBolt11SemanticErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_COption_HTLCDestinationZ_some(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKHTLCDestination o_conv = *(LDKHTLCDestination*)(o_ptr); + o_conv = HTLCDestination_clone((LDKHTLCDestination*)untag_ptr(o)); + LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ"); + *ret_copy = COption_HTLCDestinationZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_CResult_Bolt11InvoiceBolt11SemanticErrorZ_is_ok(int64_t o) { - LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* o_conv = (LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_Bolt11InvoiceBolt11SemanticErrorZ_is_ok(o_conv); - return ret_conv; +int64_t CS_LDK_COption_HTLCDestinationZ_none() { + LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ"); + *ret_copy = COption_HTLCDestinationZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_CResult_Bolt11InvoiceBolt11SemanticErrorZ_free(int64_t _res) { +void CS_LDK_COption_HTLCDestinationZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ _res_conv = *(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ*)(_res_ptr); + LDKCOption_HTLCDestinationZ _res_conv = *(LDKCOption_HTLCDestinationZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_Bolt11InvoiceBolt11SemanticErrorZ_free(_res_conv); + COption_HTLCDestinationZ_free(_res_conv); } -static inline uint64_t CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone_ptr(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ *NONNULL_PTR arg) { - LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ), "LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ"); - *ret_conv = CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone(arg); - return tag_ptr(ret_conv, true); +static inline uint64_t COption_HTLCDestinationZ_clone_ptr(LDKCOption_HTLCDestinationZ *NONNULL_PTR arg) { + LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ"); + *ret_copy = COption_HTLCDestinationZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone_ptr(int64_t arg) { - LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* arg_conv = (LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_COption_HTLCDestinationZ_clone_ptr(int64_t arg) { + LDKCOption_HTLCDestinationZ* arg_conv = (LDKCOption_HTLCDestinationZ*)untag_ptr(arg); + int64_t ret_conv = COption_HTLCDestinationZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone(int64_t orig) { - LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* orig_conv = (LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ*)untag_ptr(orig); - LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ), "LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ"); - *ret_conv = CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_COption_HTLCDestinationZ_clone(int64_t orig) { + LDKCOption_HTLCDestinationZ* orig_conv = (LDKCOption_HTLCDestinationZ*)untag_ptr(orig); + LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ"); + *ret_copy = COption_HTLCDestinationZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_CResult_DescriptionCreationErrorZ_ok(int64_t o) { - LDKDescription o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = Description_clone(&o_conv); - LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); - *ret_conv = CResult_DescriptionCreationErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKCOption_HTLCDestinationZ o_conv = *(LDKCOption_HTLCDestinationZ*)(o_ptr); + o_conv = COption_HTLCDestinationZ_clone((LDKCOption_HTLCDestinationZ*)untag_ptr(o)); + LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ"); + *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_DescriptionCreationErrorZ_err(int32_t e) { - LDKCreationError e_conv = LDKCreationError_from_cs(e); - LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); - *ret_conv = CResult_DescriptionCreationErrorZ_err(e_conv); +int64_t CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_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_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ"); + *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_DescriptionCreationErrorZ_is_ok(int64_t o) { - LDKCResult_DescriptionCreationErrorZ* o_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_DescriptionCreationErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_COption_HTLCDestinationZDecodeErrorZ* o_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_DescriptionCreationErrorZ_free(int64_t _res) { +void CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_DescriptionCreationErrorZ _res_conv = *(LDKCResult_DescriptionCreationErrorZ*)(_res_ptr); + LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res_conv = *(LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_DescriptionCreationErrorZ_free(_res_conv); + CResult_COption_HTLCDestinationZDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_DescriptionCreationErrorZ_clone_ptr(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR arg) { - LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); - *ret_conv = CResult_DescriptionCreationErrorZ_clone(arg); +static inline uint64_t CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ"); + *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_DescriptionCreationErrorZ_clone_ptr(int64_t arg) { - LDKCResult_DescriptionCreationErrorZ* arg_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_DescriptionCreationErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_COption_HTLCDestinationZDecodeErrorZ* arg_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_DescriptionCreationErrorZ_clone(int64_t orig) { - LDKCResult_DescriptionCreationErrorZ* orig_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(orig); - LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); - *ret_conv = CResult_DescriptionCreationErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_clone(int64_t orig) { + LDKCResult_COption_HTLCDestinationZDecodeErrorZ* orig_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(orig); + LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ"); + *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PrivateRouteCreationErrorZ_ok(int64_t o) { - LDKPrivateRoute o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = PrivateRoute_clone(&o_conv); - LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); - *ret_conv = CResult_PrivateRouteCreationErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_ok(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); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PrivateRouteCreationErrorZ_err(int32_t e) { - LDKCreationError e_conv = LDKCreationError_from_cs(e); - LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); - *ret_conv = CResult_PrivateRouteCreationErrorZ_err(e_conv); +int64_t CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_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); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_PrivateRouteCreationErrorZ_is_ok(int64_t o) { - LDKCResult_PrivateRouteCreationErrorZ* o_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_PrivateRouteCreationErrorZ_is_ok(o_conv); +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); return ret_conv; } -void CS_LDK_CResult_PrivateRouteCreationErrorZ_free(int64_t _res) { +void CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_PrivateRouteCreationErrorZ _res_conv = *(LDKCResult_PrivateRouteCreationErrorZ*)(_res_ptr); + LDKCResult_PaymentFailureReasonDecodeErrorZ _res_conv = *(LDKCResult_PaymentFailureReasonDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_PrivateRouteCreationErrorZ_free(_res_conv); + CResult_PaymentFailureReasonDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_PrivateRouteCreationErrorZ_clone_ptr(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR arg) { - LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); - *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(arg); +static inline uint64_t CResult_PaymentFailureReasonDecodeErrorZ_clone_ptr(LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_PaymentFailureReasonDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentFailureReasonDecodeErrorZ), "LDKCResult_PaymentFailureReasonDecodeErrorZ"); + *ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PrivateRouteCreationErrorZ_clone_ptr(int64_t arg) { - LDKCResult_PrivateRouteCreationErrorZ* arg_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_PrivateRouteCreationErrorZ_clone_ptr(arg_conv); +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); return ret_conv; } -int64_t CS_LDK_CResult_PrivateRouteCreationErrorZ_clone(int64_t orig) { - LDKCResult_PrivateRouteCreationErrorZ* orig_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(orig); - LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); - *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_OutPointDecodeErrorZ_ok(int64_t o) { - LDKOutPoint o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = OutPoint_clone(&o_conv); - LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); - *ret_conv = CResult_OutPointDecodeErrorZ_ok(o_conv); +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); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_OutPointDecodeErrorZ_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_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); - *ret_conv = CResult_OutPointDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_COption_U128Z_some(int8_tArray o) { + LDKU128 o_ref; + CHECK(o->arr_len == 16); + memcpy(o_ref.le_bytes, o->elems, 16); FREE(o); + LDKCOption_U128Z *ret_copy = MALLOC(sizeof(LDKCOption_U128Z), "LDKCOption_U128Z"); + *ret_copy = COption_U128Z_some(o_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_CResult_OutPointDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_OutPointDecodeErrorZ* o_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_OutPointDecodeErrorZ_is_ok(o_conv); - return ret_conv; +int64_t CS_LDK_COption_U128Z_none() { + LDKCOption_U128Z *ret_copy = MALLOC(sizeof(LDKCOption_U128Z), "LDKCOption_U128Z"); + *ret_copy = COption_U128Z_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_CResult_OutPointDecodeErrorZ_free(int64_t _res) { +void CS_LDK_COption_U128Z_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_OutPointDecodeErrorZ _res_conv = *(LDKCResult_OutPointDecodeErrorZ*)(_res_ptr); + LDKCOption_U128Z _res_conv = *(LDKCOption_U128Z*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_OutPointDecodeErrorZ_free(_res_conv); + COption_U128Z_free(_res_conv); } -static inline uint64_t CResult_OutPointDecodeErrorZ_clone_ptr(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); - *ret_conv = CResult_OutPointDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); +static inline uint64_t COption_U128Z_clone_ptr(LDKCOption_U128Z *NONNULL_PTR arg) { + LDKCOption_U128Z *ret_copy = MALLOC(sizeof(LDKCOption_U128Z), "LDKCOption_U128Z"); + *ret_copy = COption_U128Z_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_CResult_OutPointDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_OutPointDecodeErrorZ* arg_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_OutPointDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_COption_U128Z_clone_ptr(int64_t arg) { + LDKCOption_U128Z* arg_conv = (LDKCOption_U128Z*)untag_ptr(arg); + int64_t ret_conv = COption_U128Z_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_OutPointDecodeErrorZ_clone(int64_t orig) { - LDKCResult_OutPointDecodeErrorZ* orig_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(orig); - LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); - *ret_conv = CResult_OutPointDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_COption_U128Z_clone(int64_t orig) { + LDKCOption_U128Z* orig_conv = (LDKCOption_U128Z*)untag_ptr(orig); + LDKCOption_U128Z *ret_copy = MALLOC(sizeof(LDKCOption_U128Z), "LDKCOption_U128Z"); + *ret_copy = COption_U128Z_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_CResult_BigSizeDecodeErrorZ_ok(int64_t o) { - LDKBigSize o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = BigSize_clone(&o_conv); - LDKCResult_BigSizeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BigSizeDecodeErrorZ), "LDKCResult_BigSizeDecodeErrorZ"); - *ret_conv = CResult_BigSizeDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); +void CS_LDK_CVec_ClaimedHTLCZ_free(int64_tArray _res) { + LDKCVec_ClaimedHTLCZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKClaimedHTLC), "LDKCVec_ClaimedHTLCZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = _res->elems; + for (size_t n = 0; n < _res_constr.datalen; n++) { + int64_t _res_conv_13 = _res_vals[n]; + LDKClaimedHTLC _res_conv_13_conv; + _res_conv_13_conv.inner = untag_ptr(_res_conv_13); + _res_conv_13_conv.is_owned = ptr_is_owned(_res_conv_13); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_13_conv); + _res_constr.data[n] = _res_conv_13_conv; + } + FREE(_res); + CVec_ClaimedHTLCZ_free(_res_constr); } -int64_t CS_LDK_CResult_BigSizeDecodeErrorZ_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_BigSizeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BigSizeDecodeErrorZ), "LDKCResult_BigSizeDecodeErrorZ"); - *ret_conv = CResult_BigSizeDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); +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; } -jboolean CS_LDK_CResult_BigSizeDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_BigSizeDecodeErrorZ* o_conv = (LDKCResult_BigSizeDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_BigSizeDecodeErrorZ_is_ok(o_conv); - return ret_conv; +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_CResult_BigSizeDecodeErrorZ_free(int64_t _res) { +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); - LDKCResult_BigSizeDecodeErrorZ _res_conv = *(LDKCResult_BigSizeDecodeErrorZ*)(_res_ptr); + LDKCOption_PaymentFailureReasonZ _res_conv = *(LDKCOption_PaymentFailureReasonZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_BigSizeDecodeErrorZ_free(_res_conv); + COption_PaymentFailureReasonZ_free(_res_conv); } -static inline uint64_t CResult_BigSizeDecodeErrorZ_clone_ptr(LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_BigSizeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BigSizeDecodeErrorZ), "LDKCResult_BigSizeDecodeErrorZ"); - *ret_conv = CResult_BigSizeDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); +static inline uint64_t COption_PaymentFailureReasonZ_clone_ptr(LDKCOption_PaymentFailureReasonZ *NONNULL_PTR arg) { + LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); + *ret_copy = COption_PaymentFailureReasonZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_CResult_BigSizeDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_BigSizeDecodeErrorZ* arg_conv = (LDKCResult_BigSizeDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_BigSizeDecodeErrorZ_clone_ptr(arg_conv); +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_CResult_BigSizeDecodeErrorZ_clone(int64_t orig) { - LDKCResult_BigSizeDecodeErrorZ* orig_conv = (LDKCResult_BigSizeDecodeErrorZ*)untag_ptr(orig); - LDKCResult_BigSizeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BigSizeDecodeErrorZ), "LDKCResult_BigSizeDecodeErrorZ"); - *ret_conv = CResult_BigSizeDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_HostnameDecodeErrorZ_ok(int64_t o) { - LDKHostname o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = Hostname_clone(&o_conv); - LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); - *ret_conv = CResult_HostnameDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); +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_HostnameDecodeErrorZ_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_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); - *ret_conv = CResult_HostnameDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_COption_EventZ_some(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKEvent o_conv = *(LDKEvent*)(o_ptr); + o_conv = Event_clone((LDKEvent*)untag_ptr(o)); + LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); + *ret_copy = COption_EventZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_CResult_HostnameDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_HostnameDecodeErrorZ* o_conv = (LDKCResult_HostnameDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_HostnameDecodeErrorZ_is_ok(o_conv); - return ret_conv; +int64_t CS_LDK_COption_EventZ_none() { + LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); + *ret_copy = COption_EventZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_CResult_HostnameDecodeErrorZ_free(int64_t _res) { +void CS_LDK_COption_EventZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_HostnameDecodeErrorZ _res_conv = *(LDKCResult_HostnameDecodeErrorZ*)(_res_ptr); + LDKCOption_EventZ _res_conv = *(LDKCOption_EventZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_HostnameDecodeErrorZ_free(_res_conv); + COption_EventZ_free(_res_conv); } -static inline uint64_t CResult_HostnameDecodeErrorZ_clone_ptr(LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); - *ret_conv = CResult_HostnameDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); +static inline uint64_t COption_EventZ_clone_ptr(LDKCOption_EventZ *NONNULL_PTR arg) { + LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); + *ret_copy = COption_EventZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_CResult_HostnameDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_HostnameDecodeErrorZ* arg_conv = (LDKCResult_HostnameDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_HostnameDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_COption_EventZ_clone_ptr(int64_t arg) { + LDKCOption_EventZ* arg_conv = (LDKCOption_EventZ*)untag_ptr(arg); + int64_t ret_conv = COption_EventZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_HostnameDecodeErrorZ_clone(int64_t orig) { - LDKCResult_HostnameDecodeErrorZ* orig_conv = (LDKCResult_HostnameDecodeErrorZ*)untag_ptr(orig); - LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); - *ret_conv = CResult_HostnameDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_COption_EventZ_clone(int64_t orig) { + LDKCOption_EventZ* orig_conv = (LDKCOption_EventZ*)untag_ptr(orig); + LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); + *ret_copy = COption_EventZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_CResult_TransactionU16LenLimitedNoneZ_ok(int64_t o) { - LDKTransactionU16LenLimited o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = TransactionU16LenLimited_clone(&o_conv); - LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); - *ret_conv = CResult_TransactionU16LenLimitedNoneZ_ok(o_conv); +int64_t CS_LDK_CResult_COption_EventZDecodeErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKCOption_EventZ o_conv = *(LDKCOption_EventZ*)(o_ptr); + o_conv = COption_EventZ_clone((LDKCOption_EventZ*)untag_ptr(o)); + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = CResult_COption_EventZDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_TransactionU16LenLimitedNoneZ_err() { - LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); - *ret_conv = CResult_TransactionU16LenLimitedNoneZ_err(); +int64_t CS_LDK_CResult_COption_EventZDecodeErrorZ_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_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = CResult_COption_EventZDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_TransactionU16LenLimitedNoneZ_is_ok(int64_t o) { - LDKCResult_TransactionU16LenLimitedNoneZ* o_conv = (LDKCResult_TransactionU16LenLimitedNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_TransactionU16LenLimitedNoneZ_is_ok(o_conv); +jboolean CS_LDK_CResult_COption_EventZDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_COption_EventZDecodeErrorZ* o_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_COption_EventZDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_TransactionU16LenLimitedNoneZ_free(int64_t _res) { +void CS_LDK_CResult_COption_EventZDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_TransactionU16LenLimitedNoneZ _res_conv = *(LDKCResult_TransactionU16LenLimitedNoneZ*)(_res_ptr); + LDKCResult_COption_EventZDecodeErrorZ _res_conv = *(LDKCResult_COption_EventZDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_TransactionU16LenLimitedNoneZ_free(_res_conv); + CResult_COption_EventZDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_TransactionU16LenLimitedNoneZ_clone_ptr(LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR arg) { - LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); - *ret_conv = CResult_TransactionU16LenLimitedNoneZ_clone(arg); +static inline uint64_t CResult_COption_EventZDecodeErrorZ_clone_ptr(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_TransactionU16LenLimitedNoneZ_clone_ptr(int64_t arg) { - LDKCResult_TransactionU16LenLimitedNoneZ* arg_conv = (LDKCResult_TransactionU16LenLimitedNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_TransactionU16LenLimitedNoneZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_COption_EventZDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_COption_EventZDecodeErrorZ* arg_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_COption_EventZDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_TransactionU16LenLimitedNoneZ_clone(int64_t orig) { - LDKCResult_TransactionU16LenLimitedNoneZ* orig_conv = (LDKCResult_TransactionU16LenLimitedNoneZ*)untag_ptr(orig); - LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); - *ret_conv = CResult_TransactionU16LenLimitedNoneZ_clone(orig_conv); +int64_t CS_LDK_CResult_COption_EventZDecodeErrorZ_clone(int64_t orig) { + LDKCResult_COption_EventZDecodeErrorZ* orig_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(orig); + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_ok(int64_t o) { - LDKTransactionU16LenLimited o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = TransactionU16LenLimited_clone(&o_conv); - LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); - *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_ok(o_conv); +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"); + *ret_conv = CResult_SiPrefixBolt11ParseErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_SiPrefixBolt11ParseErrorZ_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_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); - *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_err(e_conv); + LDKBolt11ParseError e_conv = *(LDKBolt11ParseError*)(e_ptr); + e_conv = Bolt11ParseError_clone((LDKBolt11ParseError*)untag_ptr(e)); + LDKCResult_SiPrefixBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixBolt11ParseErrorZ), "LDKCResult_SiPrefixBolt11ParseErrorZ"); + *ret_conv = CResult_SiPrefixBolt11ParseErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_TransactionU16LenLimitedDecodeErrorZ* o_conv = (LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_SiPrefixBolt11ParseErrorZ_is_ok(int64_t o) { + LDKCResult_SiPrefixBolt11ParseErrorZ* o_conv = (LDKCResult_SiPrefixBolt11ParseErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_SiPrefixBolt11ParseErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_SiPrefixBolt11ParseErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_TransactionU16LenLimitedDecodeErrorZ _res_conv = *(LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)(_res_ptr); + LDKCResult_SiPrefixBolt11ParseErrorZ _res_conv = *(LDKCResult_SiPrefixBolt11ParseErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_TransactionU16LenLimitedDecodeErrorZ_free(_res_conv); + CResult_SiPrefixBolt11ParseErrorZ_free(_res_conv); } -static inline uint64_t CResult_TransactionU16LenLimitedDecodeErrorZ_clone_ptr(LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); - *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_clone(arg); +static inline uint64_t CResult_SiPrefixBolt11ParseErrorZ_clone_ptr(LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR arg) { + LDKCResult_SiPrefixBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixBolt11ParseErrorZ), "LDKCResult_SiPrefixBolt11ParseErrorZ"); + *ret_conv = CResult_SiPrefixBolt11ParseErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_TransactionU16LenLimitedDecodeErrorZ* arg_conv = (LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_SiPrefixBolt11ParseErrorZ_clone_ptr(int64_t arg) { + LDKCResult_SiPrefixBolt11ParseErrorZ* arg_conv = (LDKCResult_SiPrefixBolt11ParseErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_SiPrefixBolt11ParseErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_clone(int64_t orig) { - LDKCResult_TransactionU16LenLimitedDecodeErrorZ* orig_conv = (LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)untag_ptr(orig); - LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); - *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_SiPrefixBolt11ParseErrorZ_clone(int64_t orig) { + LDKCResult_SiPrefixBolt11ParseErrorZ* orig_conv = (LDKCResult_SiPrefixBolt11ParseErrorZ*)untag_ptr(orig); + LDKCResult_SiPrefixBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixBolt11ParseErrorZ), "LDKCResult_SiPrefixBolt11ParseErrorZ"); + *ret_conv = CResult_SiPrefixBolt11ParseErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_UntrustedStringDecodeErrorZ_ok(int64_t o) { - LDKUntrustedString o_conv; +int64_t CS_LDK_CResult_Bolt11InvoiceParseOrSemanticErrorZ_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 = UntrustedString_clone(&o_conv); - LDKCResult_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ"); - *ret_conv = CResult_UntrustedStringDecodeErrorZ_ok(o_conv); + o_conv = Bolt11Invoice_clone(&o_conv); + LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ), "LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ"); + *ret_conv = CResult_Bolt11InvoiceParseOrSemanticErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_UntrustedStringDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_Bolt11InvoiceParseOrSemanticErrorZ_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); + LDKParseOrSemanticError e_conv = *(LDKParseOrSemanticError*)(e_ptr); + e_conv = ParseOrSemanticError_clone((LDKParseOrSemanticError*)untag_ptr(e)); + LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ), "LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ"); + *ret_conv = CResult_Bolt11InvoiceParseOrSemanticErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean 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); +jboolean CS_LDK_CResult_Bolt11InvoiceParseOrSemanticErrorZ_is_ok(int64_t o) { + LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* o_conv = (LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_Bolt11InvoiceParseOrSemanticErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_UntrustedStringDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_Bolt11InvoiceParseOrSemanticErrorZ_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); + LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ _res_conv = *(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_UntrustedStringDecodeErrorZ_free(_res_conv); + CResult_Bolt11InvoiceParseOrSemanticErrorZ_free(_res_conv); } -static inline uint64_t CResult_UntrustedStringDecodeErrorZ_clone_ptr(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ"); - *ret_conv = CResult_UntrustedStringDecodeErrorZ_clone(arg); +static inline uint64_t CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone_ptr(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ), "LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ"); + *ret_conv = CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t 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); +int64_t CS_LDK_CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone_ptr(int64_t arg) { + LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* arg_conv = (LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_Bolt11InvoiceParseOrSemanticErrorZ_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); +int64_t CS_LDK_CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone(int64_t orig) { + LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* orig_conv = (LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ*)untag_ptr(orig); + LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ), "LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ"); + *ret_conv = CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ChannelIdDecodeErrorZ_ok(int64_t o) { - LDKChannelId o_conv; +int64_t CS_LDK_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_ok(int64_t o) { + LDKSignedRawBolt11Invoice o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = ChannelId_clone(&o_conv); - LDKCResult_ChannelIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdDecodeErrorZ), "LDKCResult_ChannelIdDecodeErrorZ"); - *ret_conv = CResult_ChannelIdDecodeErrorZ_ok(o_conv); + o_conv = SignedRawBolt11Invoice_clone(&o_conv); + LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ), "LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ"); + *ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ChannelIdDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_err(int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); - LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); - e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_ChannelIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdDecodeErrorZ), "LDKCResult_ChannelIdDecodeErrorZ"); - *ret_conv = CResult_ChannelIdDecodeErrorZ_err(e_conv); + LDKBolt11ParseError e_conv = *(LDKBolt11ParseError*)(e_ptr); + e_conv = Bolt11ParseError_clone((LDKBolt11ParseError*)untag_ptr(e)); + LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ), "LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ"); + *ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_ChannelIdDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_ChannelIdDecodeErrorZ* o_conv = (LDKCResult_ChannelIdDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ChannelIdDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_is_ok(int64_t o) { + LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* o_conv = (LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_ChannelIdDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_ChannelIdDecodeErrorZ _res_conv = *(LDKCResult_ChannelIdDecodeErrorZ*)(_res_ptr); + LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ _res_conv = *(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_ChannelIdDecodeErrorZ_free(_res_conv); + CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_free(_res_conv); } -static inline uint64_t CResult_ChannelIdDecodeErrorZ_clone_ptr(LDKCResult_ChannelIdDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ChannelIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdDecodeErrorZ), "LDKCResult_ChannelIdDecodeErrorZ"); - *ret_conv = CResult_ChannelIdDecodeErrorZ_clone(arg); +static inline uint64_t CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone_ptr(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR arg) { + LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ), "LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ"); + *ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ChannelIdDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_ChannelIdDecodeErrorZ* arg_conv = (LDKCResult_ChannelIdDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ChannelIdDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone_ptr(int64_t arg) { + LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* arg_conv = (LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_ChannelIdDecodeErrorZ_clone(int64_t orig) { - LDKCResult_ChannelIdDecodeErrorZ* orig_conv = (LDKCResult_ChannelIdDecodeErrorZ*)untag_ptr(orig); - LDKCResult_ChannelIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdDecodeErrorZ), "LDKCResult_ChannelIdDecodeErrorZ"); - *ret_conv = CResult_ChannelIdDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone(int64_t orig) { + LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* orig_conv = (LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ*)untag_ptr(orig); + LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ), "LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ"); + *ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -static inline uint64_t C2Tuple__u832u16Z_clone_ptr(LDKC2Tuple__u832u16Z *NONNULL_PTR arg) { - LDKC2Tuple__u832u16Z* ret_conv = MALLOC(sizeof(LDKC2Tuple__u832u16Z), "LDKC2Tuple__u832u16Z"); - *ret_conv = C2Tuple__u832u16Z_clone(arg); +static inline uint64_t C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone_ptr(LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ *NONNULL_PTR arg) { + LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ), "LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ"); + *ret_conv = C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C2Tuple__u832u16Z_clone_ptr(int64_t arg) { - LDKC2Tuple__u832u16Z* arg_conv = (LDKC2Tuple__u832u16Z*)untag_ptr(arg); - int64_t ret_conv = C2Tuple__u832u16Z_clone_ptr(arg_conv); +int64_t CS_LDK_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone_ptr(int64_t arg) { + LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ* arg_conv = (LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ*)untag_ptr(arg); + int64_t ret_conv = C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_C2Tuple__u832u16Z_clone(int64_t orig) { - LDKC2Tuple__u832u16Z* orig_conv = (LDKC2Tuple__u832u16Z*)untag_ptr(orig); - LDKC2Tuple__u832u16Z* ret_conv = MALLOC(sizeof(LDKC2Tuple__u832u16Z), "LDKC2Tuple__u832u16Z"); - *ret_conv = C2Tuple__u832u16Z_clone(orig_conv); +int64_t CS_LDK_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone(int64_t orig) { + LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ* orig_conv = (LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ*)untag_ptr(orig); + LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ), "LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ"); + *ret_conv = C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C2Tuple__u832u16Z_new(int8_tArray a, int16_t b) { - LDKThirtyTwoBytes a_ref; - CHECK(a->arr_len == 32); - memcpy(a_ref.data, a->elems, 32); FREE(a); - LDKC2Tuple__u832u16Z* ret_conv = MALLOC(sizeof(LDKC2Tuple__u832u16Z), "LDKC2Tuple__u832u16Z"); - *ret_conv = C2Tuple__u832u16Z_new(a_ref, b); +int64_t CS_LDK_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_new(int64_t a, int8_tArray b, int64_t c) { + LDKRawBolt11Invoice a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = RawBolt11Invoice_clone(&a_conv); + LDKThirtyTwoBytes b_ref; + CHECK(b->arr_len == 32); + memcpy(b_ref.data, b->elems, 32); FREE(b); + LDKBolt11InvoiceSignature c_conv; + c_conv.inner = untag_ptr(c); + c_conv.is_owned = ptr_is_owned(c); + CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv); + c_conv = Bolt11InvoiceSignature_clone(&c_conv); + LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ), "LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ"); + *ret_conv = C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_new(a_conv, b_ref, c_conv); return tag_ptr(ret_conv, true); } -void CS_LDK_C2Tuple__u832u16Z_free(int64_t _res) { +void CS_LDK_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKC2Tuple__u832u16Z _res_conv = *(LDKC2Tuple__u832u16Z*)(_res_ptr); + LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ _res_conv = *(LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ*)(_res_ptr); FREE(untag_ptr(_res)); - C2Tuple__u832u16Z_free(_res_conv); + C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_free(_res_conv); } -int64_t CS_LDK_CResult_PaymentRelayDecodeErrorZ_ok(int64_t o) { - LDKPaymentRelay o_conv; +int64_t CS_LDK_CResult_PayeePubKeySecp256k1ErrorZ_ok(int64_t o) { + LDKPayeePubKey o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = PaymentRelay_clone(&o_conv); - LDKCResult_PaymentRelayDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentRelayDecodeErrorZ), "LDKCResult_PaymentRelayDecodeErrorZ"); - *ret_conv = CResult_PaymentRelayDecodeErrorZ_ok(o_conv); + o_conv = PayeePubKey_clone(&o_conv); + LDKCResult_PayeePubKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeySecp256k1ErrorZ), "LDKCResult_PayeePubKeySecp256k1ErrorZ"); + *ret_conv = CResult_PayeePubKeySecp256k1ErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PaymentRelayDecodeErrorZ_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_PaymentRelayDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentRelayDecodeErrorZ), "LDKCResult_PaymentRelayDecodeErrorZ"); - *ret_conv = CResult_PaymentRelayDecodeErrorZ_err(e_conv); +int64_t CS_LDK_CResult_PayeePubKeySecp256k1ErrorZ_err(int32_t e) { + LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_cs(e); + LDKCResult_PayeePubKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeySecp256k1ErrorZ), "LDKCResult_PayeePubKeySecp256k1ErrorZ"); + *ret_conv = CResult_PayeePubKeySecp256k1ErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_PaymentRelayDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_PaymentRelayDecodeErrorZ* o_conv = (LDKCResult_PaymentRelayDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_PaymentRelayDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_PayeePubKeySecp256k1ErrorZ_is_ok(int64_t o) { + LDKCResult_PayeePubKeySecp256k1ErrorZ* o_conv = (LDKCResult_PayeePubKeySecp256k1ErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_PayeePubKeySecp256k1ErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_PaymentRelayDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_PayeePubKeySecp256k1ErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_PaymentRelayDecodeErrorZ _res_conv = *(LDKCResult_PaymentRelayDecodeErrorZ*)(_res_ptr); + LDKCResult_PayeePubKeySecp256k1ErrorZ _res_conv = *(LDKCResult_PayeePubKeySecp256k1ErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_PaymentRelayDecodeErrorZ_free(_res_conv); + CResult_PayeePubKeySecp256k1ErrorZ_free(_res_conv); } -static inline uint64_t CResult_PaymentRelayDecodeErrorZ_clone_ptr(LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_PaymentRelayDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentRelayDecodeErrorZ), "LDKCResult_PaymentRelayDecodeErrorZ"); - *ret_conv = CResult_PaymentRelayDecodeErrorZ_clone(arg); +static inline uint64_t CResult_PayeePubKeySecp256k1ErrorZ_clone_ptr(LDKCResult_PayeePubKeySecp256k1ErrorZ *NONNULL_PTR arg) { + LDKCResult_PayeePubKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeySecp256k1ErrorZ), "LDKCResult_PayeePubKeySecp256k1ErrorZ"); + *ret_conv = CResult_PayeePubKeySecp256k1ErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PaymentRelayDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_PaymentRelayDecodeErrorZ* arg_conv = (LDKCResult_PaymentRelayDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_PaymentRelayDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_PayeePubKeySecp256k1ErrorZ_clone_ptr(int64_t arg) { + LDKCResult_PayeePubKeySecp256k1ErrorZ* arg_conv = (LDKCResult_PayeePubKeySecp256k1ErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PayeePubKeySecp256k1ErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_PaymentRelayDecodeErrorZ_clone(int64_t orig) { - LDKCResult_PaymentRelayDecodeErrorZ* orig_conv = (LDKCResult_PaymentRelayDecodeErrorZ*)untag_ptr(orig); - LDKCResult_PaymentRelayDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentRelayDecodeErrorZ), "LDKCResult_PaymentRelayDecodeErrorZ"); - *ret_conv = CResult_PaymentRelayDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_PayeePubKeySecp256k1ErrorZ_clone(int64_t orig) { + LDKCResult_PayeePubKeySecp256k1ErrorZ* orig_conv = (LDKCResult_PayeePubKeySecp256k1ErrorZ*)untag_ptr(orig); + LDKCResult_PayeePubKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeySecp256k1ErrorZ), "LDKCResult_PayeePubKeySecp256k1ErrorZ"); + *ret_conv = CResult_PayeePubKeySecp256k1ErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PaymentConstraintsDecodeErrorZ_ok(int64_t o) { - LDKPaymentConstraints o_conv; +void CS_LDK_CVec_PrivateRouteZ_free(int64_tArray _res) { + LDKCVec_PrivateRouteZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPrivateRoute), "LDKCVec_PrivateRouteZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = _res->elems; + for (size_t o = 0; o < _res_constr.datalen; o++) { + int64_t _res_conv_14 = _res_vals[o]; + LDKPrivateRoute _res_conv_14_conv; + _res_conv_14_conv.inner = untag_ptr(_res_conv_14); + _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv); + _res_constr.data[o] = _res_conv_14_conv; + } + FREE(_res); + CVec_PrivateRouteZ_free(_res_constr); +} + +int64_t CS_LDK_CResult_PositiveTimestampCreationErrorZ_ok(int64_t o) { + LDKPositiveTimestamp o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = PaymentConstraints_clone(&o_conv); - LDKCResult_PaymentConstraintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentConstraintsDecodeErrorZ), "LDKCResult_PaymentConstraintsDecodeErrorZ"); - *ret_conv = CResult_PaymentConstraintsDecodeErrorZ_ok(o_conv); + o_conv = PositiveTimestamp_clone(&o_conv); + LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); + *ret_conv = CResult_PositiveTimestampCreationErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PaymentConstraintsDecodeErrorZ_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_PaymentConstraintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentConstraintsDecodeErrorZ), "LDKCResult_PaymentConstraintsDecodeErrorZ"); - *ret_conv = CResult_PaymentConstraintsDecodeErrorZ_err(e_conv); +int64_t CS_LDK_CResult_PositiveTimestampCreationErrorZ_err(int32_t e) { + LDKCreationError e_conv = LDKCreationError_from_cs(e); + LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); + *ret_conv = CResult_PositiveTimestampCreationErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_PaymentConstraintsDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_PaymentConstraintsDecodeErrorZ* o_conv = (LDKCResult_PaymentConstraintsDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_PaymentConstraintsDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_PositiveTimestampCreationErrorZ_is_ok(int64_t o) { + LDKCResult_PositiveTimestampCreationErrorZ* o_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_PositiveTimestampCreationErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_PaymentConstraintsDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_PositiveTimestampCreationErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_PaymentConstraintsDecodeErrorZ _res_conv = *(LDKCResult_PaymentConstraintsDecodeErrorZ*)(_res_ptr); + LDKCResult_PositiveTimestampCreationErrorZ _res_conv = *(LDKCResult_PositiveTimestampCreationErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_PaymentConstraintsDecodeErrorZ_free(_res_conv); + CResult_PositiveTimestampCreationErrorZ_free(_res_conv); } -static inline uint64_t CResult_PaymentConstraintsDecodeErrorZ_clone_ptr(LDKCResult_PaymentConstraintsDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_PaymentConstraintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentConstraintsDecodeErrorZ), "LDKCResult_PaymentConstraintsDecodeErrorZ"); - *ret_conv = CResult_PaymentConstraintsDecodeErrorZ_clone(arg); +static inline uint64_t CResult_PositiveTimestampCreationErrorZ_clone_ptr(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); + *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PaymentConstraintsDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_PaymentConstraintsDecodeErrorZ* arg_conv = (LDKCResult_PaymentConstraintsDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_PaymentConstraintsDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_PositiveTimestampCreationErrorZ_clone_ptr(int64_t arg) { + LDKCResult_PositiveTimestampCreationErrorZ* arg_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PositiveTimestampCreationErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_PaymentConstraintsDecodeErrorZ_clone(int64_t orig) { - LDKCResult_PaymentConstraintsDecodeErrorZ* orig_conv = (LDKCResult_PaymentConstraintsDecodeErrorZ*)untag_ptr(orig); - LDKCResult_PaymentConstraintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentConstraintsDecodeErrorZ), "LDKCResult_PaymentConstraintsDecodeErrorZ"); - *ret_conv = CResult_PaymentConstraintsDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_PositiveTimestampCreationErrorZ_clone(int64_t orig) { + LDKCResult_PositiveTimestampCreationErrorZ* orig_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(orig); + LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); + *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PaymentContextDecodeErrorZ_ok(int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKPaymentContext o_conv = *(LDKPaymentContext*)(o_ptr); - o_conv = PaymentContext_clone((LDKPaymentContext*)untag_ptr(o)); - LDKCResult_PaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentContextDecodeErrorZ), "LDKCResult_PaymentContextDecodeErrorZ"); - *ret_conv = CResult_PaymentContextDecodeErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_NoneBolt11SemanticErrorZ_ok() { + LDKCResult_NoneBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt11SemanticErrorZ), "LDKCResult_NoneBolt11SemanticErrorZ"); + *ret_conv = CResult_NoneBolt11SemanticErrorZ_ok(); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PaymentContextDecodeErrorZ_err(int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); - e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_PaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentContextDecodeErrorZ), "LDKCResult_PaymentContextDecodeErrorZ"); - *ret_conv = CResult_PaymentContextDecodeErrorZ_err(e_conv); +int64_t CS_LDK_CResult_NoneBolt11SemanticErrorZ_err(int32_t e) { + LDKBolt11SemanticError e_conv = LDKBolt11SemanticError_from_cs(e); + LDKCResult_NoneBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt11SemanticErrorZ), "LDKCResult_NoneBolt11SemanticErrorZ"); + *ret_conv = CResult_NoneBolt11SemanticErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_PaymentContextDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_PaymentContextDecodeErrorZ* o_conv = (LDKCResult_PaymentContextDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_PaymentContextDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_NoneBolt11SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_NoneBolt11SemanticErrorZ* o_conv = (LDKCResult_NoneBolt11SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_NoneBolt11SemanticErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_PaymentContextDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_NoneBolt11SemanticErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_PaymentContextDecodeErrorZ _res_conv = *(LDKCResult_PaymentContextDecodeErrorZ*)(_res_ptr); + LDKCResult_NoneBolt11SemanticErrorZ _res_conv = *(LDKCResult_NoneBolt11SemanticErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_PaymentContextDecodeErrorZ_free(_res_conv); + CResult_NoneBolt11SemanticErrorZ_free(_res_conv); } -static inline uint64_t CResult_PaymentContextDecodeErrorZ_clone_ptr(LDKCResult_PaymentContextDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_PaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentContextDecodeErrorZ), "LDKCResult_PaymentContextDecodeErrorZ"); - *ret_conv = CResult_PaymentContextDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t CS_LDK_CResult_PaymentContextDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_PaymentContextDecodeErrorZ* arg_conv = (LDKCResult_PaymentContextDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_PaymentContextDecodeErrorZ_clone_ptr(arg_conv); +static inline uint64_t CResult_NoneBolt11SemanticErrorZ_clone_ptr(LDKCResult_NoneBolt11SemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt11SemanticErrorZ), "LDKCResult_NoneBolt11SemanticErrorZ"); + *ret_conv = CResult_NoneBolt11SemanticErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_NoneBolt11SemanticErrorZ_clone_ptr(int64_t arg) { + LDKCResult_NoneBolt11SemanticErrorZ* arg_conv = (LDKCResult_NoneBolt11SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_NoneBolt11SemanticErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_PaymentContextDecodeErrorZ_clone(int64_t orig) { - LDKCResult_PaymentContextDecodeErrorZ* orig_conv = (LDKCResult_PaymentContextDecodeErrorZ*)untag_ptr(orig); - LDKCResult_PaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentContextDecodeErrorZ), "LDKCResult_PaymentContextDecodeErrorZ"); - *ret_conv = CResult_PaymentContextDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_NoneBolt11SemanticErrorZ_clone(int64_t orig) { + LDKCResult_NoneBolt11SemanticErrorZ* orig_conv = (LDKCResult_NoneBolt11SemanticErrorZ*)untag_ptr(orig); + LDKCResult_NoneBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt11SemanticErrorZ), "LDKCResult_NoneBolt11SemanticErrorZ"); + *ret_conv = CResult_NoneBolt11SemanticErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_ok(int64_t o) { - LDKUnknownPaymentContext o_conv; +int64_t CS_LDK_CResult_Bolt11InvoiceBolt11SemanticErrorZ_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 = UnknownPaymentContext_clone(&o_conv); - LDKCResult_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); - *ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_ok(o_conv); + o_conv = Bolt11Invoice_clone(&o_conv); + LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ), "LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ"); + *ret_conv = CResult_Bolt11InvoiceBolt11SemanticErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_err(int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); - e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); - *ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_err(e_conv); +int64_t CS_LDK_CResult_Bolt11InvoiceBolt11SemanticErrorZ_err(int32_t e) { + LDKBolt11SemanticError e_conv = LDKBolt11SemanticError_from_cs(e); + LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ), "LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ"); + *ret_conv = CResult_Bolt11InvoiceBolt11SemanticErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_UnknownPaymentContextDecodeErrorZ* o_conv = (LDKCResult_UnknownPaymentContextDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_Bolt11InvoiceBolt11SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* o_conv = (LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_Bolt11InvoiceBolt11SemanticErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_Bolt11InvoiceBolt11SemanticErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_UnknownPaymentContextDecodeErrorZ _res_conv = *(LDKCResult_UnknownPaymentContextDecodeErrorZ*)(_res_ptr); + LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ _res_conv = *(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_UnknownPaymentContextDecodeErrorZ_free(_res_conv); + CResult_Bolt11InvoiceBolt11SemanticErrorZ_free(_res_conv); } -static inline uint64_t CResult_UnknownPaymentContextDecodeErrorZ_clone_ptr(LDKCResult_UnknownPaymentContextDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); - *ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_clone(arg); +static inline uint64_t CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone_ptr(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ), "LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ"); + *ret_conv = CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_UnknownPaymentContextDecodeErrorZ* arg_conv = (LDKCResult_UnknownPaymentContextDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone_ptr(int64_t arg) { + LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* arg_conv = (LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_clone(int64_t orig) { - LDKCResult_UnknownPaymentContextDecodeErrorZ* orig_conv = (LDKCResult_UnknownPaymentContextDecodeErrorZ*)untag_ptr(orig); - LDKCResult_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); - *ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone(int64_t orig) { + LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* orig_conv = (LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ*)untag_ptr(orig); + LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ), "LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ"); + *ret_conv = CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_ok(int64_t o) { - LDKBolt12OfferContext o_conv; +int64_t CS_LDK_CResult_DescriptionCreationErrorZ_ok(int64_t o) { + LDKDescription o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = Bolt12OfferContext_clone(&o_conv); - LDKCResult_Bolt12OfferContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12OfferContextDecodeErrorZ), "LDKCResult_Bolt12OfferContextDecodeErrorZ"); - *ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_ok(o_conv); + o_conv = Description_clone(&o_conv); + LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); + *ret_conv = CResult_DescriptionCreationErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_err(int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); - e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_Bolt12OfferContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12OfferContextDecodeErrorZ), "LDKCResult_Bolt12OfferContextDecodeErrorZ"); - *ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_err(e_conv); +int64_t CS_LDK_CResult_DescriptionCreationErrorZ_err(int32_t e) { + LDKCreationError e_conv = LDKCreationError_from_cs(e); + LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); + *ret_conv = CResult_DescriptionCreationErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_Bolt12OfferContextDecodeErrorZ* o_conv = (LDKCResult_Bolt12OfferContextDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_DescriptionCreationErrorZ_is_ok(int64_t o) { + LDKCResult_DescriptionCreationErrorZ* o_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_DescriptionCreationErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_DescriptionCreationErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_Bolt12OfferContextDecodeErrorZ _res_conv = *(LDKCResult_Bolt12OfferContextDecodeErrorZ*)(_res_ptr); + LDKCResult_DescriptionCreationErrorZ _res_conv = *(LDKCResult_DescriptionCreationErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_Bolt12OfferContextDecodeErrorZ_free(_res_conv); + CResult_DescriptionCreationErrorZ_free(_res_conv); } -static inline uint64_t CResult_Bolt12OfferContextDecodeErrorZ_clone_ptr(LDKCResult_Bolt12OfferContextDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_Bolt12OfferContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12OfferContextDecodeErrorZ), "LDKCResult_Bolt12OfferContextDecodeErrorZ"); - *ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_clone(arg); +static inline uint64_t CResult_DescriptionCreationErrorZ_clone_ptr(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); + *ret_conv = CResult_DescriptionCreationErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_Bolt12OfferContextDecodeErrorZ* arg_conv = (LDKCResult_Bolt12OfferContextDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_DescriptionCreationErrorZ_clone_ptr(int64_t arg) { + LDKCResult_DescriptionCreationErrorZ* arg_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_DescriptionCreationErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_clone(int64_t orig) { - LDKCResult_Bolt12OfferContextDecodeErrorZ* orig_conv = (LDKCResult_Bolt12OfferContextDecodeErrorZ*)untag_ptr(orig); - LDKCResult_Bolt12OfferContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12OfferContextDecodeErrorZ), "LDKCResult_Bolt12OfferContextDecodeErrorZ"); - *ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_DescriptionCreationErrorZ_clone(int64_t orig) { + LDKCResult_DescriptionCreationErrorZ* orig_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(orig); + LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); + *ret_conv = CResult_DescriptionCreationErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_ok(int64_t o) { - LDKBolt12RefundContext o_conv; +int64_t CS_LDK_CResult_PrivateRouteCreationErrorZ_ok(int64_t o) { + LDKPrivateRoute o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = Bolt12RefundContext_clone(&o_conv); - LDKCResult_Bolt12RefundContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12RefundContextDecodeErrorZ), "LDKCResult_Bolt12RefundContextDecodeErrorZ"); - *ret_conv = CResult_Bolt12RefundContextDecodeErrorZ_ok(o_conv); + o_conv = PrivateRoute_clone(&o_conv); + LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); + *ret_conv = CResult_PrivateRouteCreationErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_err(int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); - e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_Bolt12RefundContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12RefundContextDecodeErrorZ), "LDKCResult_Bolt12RefundContextDecodeErrorZ"); - *ret_conv = CResult_Bolt12RefundContextDecodeErrorZ_err(e_conv); +int64_t CS_LDK_CResult_PrivateRouteCreationErrorZ_err(int32_t e) { + LDKCreationError e_conv = LDKCreationError_from_cs(e); + LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); + *ret_conv = CResult_PrivateRouteCreationErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_Bolt12RefundContextDecodeErrorZ* o_conv = (LDKCResult_Bolt12RefundContextDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_Bolt12RefundContextDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_PrivateRouteCreationErrorZ_is_ok(int64_t o) { + LDKCResult_PrivateRouteCreationErrorZ* o_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_PrivateRouteCreationErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_PrivateRouteCreationErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_Bolt12RefundContextDecodeErrorZ _res_conv = *(LDKCResult_Bolt12RefundContextDecodeErrorZ*)(_res_ptr); + LDKCResult_PrivateRouteCreationErrorZ _res_conv = *(LDKCResult_PrivateRouteCreationErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_Bolt12RefundContextDecodeErrorZ_free(_res_conv); + CResult_PrivateRouteCreationErrorZ_free(_res_conv); } -static inline uint64_t CResult_Bolt12RefundContextDecodeErrorZ_clone_ptr(LDKCResult_Bolt12RefundContextDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_Bolt12RefundContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12RefundContextDecodeErrorZ), "LDKCResult_Bolt12RefundContextDecodeErrorZ"); - *ret_conv = CResult_Bolt12RefundContextDecodeErrorZ_clone(arg); +static inline uint64_t CResult_PrivateRouteCreationErrorZ_clone_ptr(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); + *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_Bolt12RefundContextDecodeErrorZ* arg_conv = (LDKCResult_Bolt12RefundContextDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_Bolt12RefundContextDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_PrivateRouteCreationErrorZ_clone_ptr(int64_t arg) { + LDKCResult_PrivateRouteCreationErrorZ* arg_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PrivateRouteCreationErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_clone(int64_t orig) { - LDKCResult_Bolt12RefundContextDecodeErrorZ* orig_conv = (LDKCResult_Bolt12RefundContextDecodeErrorZ*)untag_ptr(orig); - LDKCResult_Bolt12RefundContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12RefundContextDecodeErrorZ), "LDKCResult_Bolt12RefundContextDecodeErrorZ"); - *ret_conv = CResult_Bolt12RefundContextDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_PrivateRouteCreationErrorZ_clone(int64_t orig) { + LDKCResult_PrivateRouteCreationErrorZ* orig_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(orig); + LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); + *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -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_OutPointDecodeErrorZ_ok(int64_t o) { + LDKOutPoint o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = OutPoint_clone(&o_conv); + LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); + *ret_conv = CResult_OutPointDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t 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_OutPointDecodeErrorZ_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_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); + *ret_conv = CResult_OutPointDecodeErrorZ_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_OutPointDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_OutPointDecodeErrorZ* o_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OutPointDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_StrSecp256k1ErrorZ_free(int64_t _res) { +void CS_LDK_CResult_OutPointDecodeErrorZ_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_OutPointDecodeErrorZ _res_conv = *(LDKCResult_OutPointDecodeErrorZ*)(_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_OutPointDecodeErrorZ_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_OutPointDecodeErrorZ_clone_ptr(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); + *ret_conv = CResult_OutPointDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -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_OutPointDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_OutPointDecodeErrorZ* arg_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OutPointDecodeErrorZ_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_OutPointDecodeErrorZ_clone(int64_t orig) { + LDKCResult_OutPointDecodeErrorZ* orig_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(orig); + LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); + *ret_conv = CResult_OutPointDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -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_BigSizeDecodeErrorZ_ok(int64_t o) { + LDKBigSize o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = BigSize_clone(&o_conv); + LDKCResult_BigSizeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BigSizeDecodeErrorZ), "LDKCResult_BigSizeDecodeErrorZ"); + *ret_conv = CResult_BigSizeDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -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_BigSizeDecodeErrorZ_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_BigSizeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BigSizeDecodeErrorZ), "LDKCResult_BigSizeDecodeErrorZ"); + *ret_conv = CResult_BigSizeDecodeErrorZ_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_BigSizeDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_BigSizeDecodeErrorZ* o_conv = (LDKCResult_BigSizeDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_BigSizeDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(int64_t _res) { +void CS_LDK_CResult_BigSizeDecodeErrorZ_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_BigSizeDecodeErrorZ _res_conv = *(LDKCResult_BigSizeDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(_res_conv); + CResult_BigSizeDecodeErrorZ_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_BigSizeDecodeErrorZ_clone_ptr(LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_BigSizeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BigSizeDecodeErrorZ), "LDKCResult_BigSizeDecodeErrorZ"); + *ret_conv = CResult_BigSizeDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -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_BigSizeDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_BigSizeDecodeErrorZ* arg_conv = (LDKCResult_BigSizeDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BigSizeDecodeErrorZ_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_BigSizeDecodeErrorZ_clone(int64_t orig) { + LDKCResult_BigSizeDecodeErrorZ* orig_conv = (LDKCResult_BigSizeDecodeErrorZ*)untag_ptr(orig); + LDKCResult_BigSizeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BigSizeDecodeErrorZ), "LDKCResult_BigSizeDecodeErrorZ"); + *ret_conv = CResult_BigSizeDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -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); +int64_t CS_LDK_CResult_HostnameDecodeErrorZ_ok(int64_t o) { + LDKHostname o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = Hostname_clone(&o_conv); + LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); + *ret_conv = CResult_HostnameDecodeErrorZ_ok(o_conv); 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); +int64_t CS_LDK_CResult_HostnameDecodeErrorZ_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_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); + *ret_conv = CResult_HostnameDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -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); +jboolean CS_LDK_CResult_HostnameDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_HostnameDecodeErrorZ* o_conv = (LDKCResult_HostnameDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_HostnameDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_TxOutUtxoLookupErrorZ_free(int64_t _res) { +void CS_LDK_CResult_HostnameDecodeErrorZ_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); + LDKCResult_HostnameDecodeErrorZ _res_conv = *(LDKCResult_HostnameDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_TxOutUtxoLookupErrorZ_free(_res_conv); + CResult_HostnameDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_TxOutUtxoLookupErrorZ_clone_ptr(LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR arg) { - LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); - *ret_conv = CResult_TxOutUtxoLookupErrorZ_clone(arg); +static inline uint64_t CResult_HostnameDecodeErrorZ_clone_ptr(LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); + *ret_conv = CResult_HostnameDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t 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_CResult_HostnameDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_HostnameDecodeErrorZ* arg_conv = (LDKCResult_HostnameDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_HostnameDecodeErrorZ_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); +int64_t CS_LDK_CResult_HostnameDecodeErrorZ_clone(int64_t orig) { + LDKCResult_HostnameDecodeErrorZ* orig_conv = (LDKCResult_HostnameDecodeErrorZ*)untag_ptr(orig); + LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); + *ret_conv = CResult_HostnameDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -static inline uint64_t C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone_ptr(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *NONNULL_PTR arg) { - LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ), "LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ"); - *ret_conv = C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone(arg); +int64_t CS_LDK_CResult_TransactionU16LenLimitedNoneZ_ok(int64_t o) { + LDKTransactionU16LenLimited o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = TransactionU16LenLimited_clone(&o_conv); + LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); + *ret_conv = CResult_TransactionU16LenLimitedNoneZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone_ptr(int64_t arg) { - LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ* arg_conv = (LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ*)untag_ptr(arg); - int64_t ret_conv = C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone_ptr(arg_conv); - return ret_conv; -} -int64_t CS_LDK_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone(int64_t orig) { - LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ* orig_conv = (LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ*)untag_ptr(orig); - LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ), "LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ"); - *ret_conv = C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone(orig_conv); +int64_t CS_LDK_CResult_TransactionU16LenLimitedNoneZ_err() { + LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); + *ret_conv = CResult_TransactionU16LenLimitedNoneZ_err(); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_new(int8_tArray a, int64_t b, int64_t c) { - LDKPublicKey a_ref; - CHECK(a->arr_len == 33); - memcpy(a_ref.compressed_form, a->elems, 33); FREE(a); - LDKOnionMessage b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv = OnionMessage_clone(&b_conv); - void* c_ptr = untag_ptr(c); - CHECK_ACCESS(c_ptr); - LDKCOption_CVec_SocketAddressZZ c_conv = *(LDKCOption_CVec_SocketAddressZZ*)(c_ptr); - c_conv = COption_CVec_SocketAddressZZ_clone((LDKCOption_CVec_SocketAddressZZ*)untag_ptr(c)); - LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ), "LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ"); - *ret_conv = C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_new(a_ref, b_conv, c_conv); - return tag_ptr(ret_conv, true); +jboolean CS_LDK_CResult_TransactionU16LenLimitedNoneZ_is_ok(int64_t o) { + LDKCResult_TransactionU16LenLimitedNoneZ* o_conv = (LDKCResult_TransactionU16LenLimitedNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_TransactionU16LenLimitedNoneZ_is_ok(o_conv); + return ret_conv; } -void CS_LDK_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_free(int64_t _res) { +void CS_LDK_CResult_TransactionU16LenLimitedNoneZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ _res_conv = *(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ*)(_res_ptr); + LDKCResult_TransactionU16LenLimitedNoneZ _res_conv = *(LDKCResult_TransactionU16LenLimitedNoneZ*)(_res_ptr); FREE(untag_ptr(_res)); - C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_free(_res_conv); + CResult_TransactionU16LenLimitedNoneZ_free(_res_conv); } -int64_t CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_ok(int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ o_conv = *(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ*)(o_ptr); - o_conv = C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone((LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ*)untag_ptr(o)); - LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ), "LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ"); - *ret_conv = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_ok(o_conv); +static inline uint64_t CResult_TransactionU16LenLimitedNoneZ_clone_ptr(LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR arg) { + LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); + *ret_conv = CResult_TransactionU16LenLimitedNoneZ_clone(arg); return tag_ptr(ret_conv, true); } +int64_t CS_LDK_CResult_TransactionU16LenLimitedNoneZ_clone_ptr(int64_t arg) { + LDKCResult_TransactionU16LenLimitedNoneZ* arg_conv = (LDKCResult_TransactionU16LenLimitedNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_TransactionU16LenLimitedNoneZ_clone_ptr(arg_conv); + return ret_conv; +} -int64_t CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_TransactionU16LenLimitedNoneZ_clone(int64_t orig) { + LDKCResult_TransactionU16LenLimitedNoneZ* orig_conv = (LDKCResult_TransactionU16LenLimitedNoneZ*)untag_ptr(orig); + LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); + *ret_conv = CResult_TransactionU16LenLimitedNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_ok(int64_t o) { + LDKTransactionU16LenLimited o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = TransactionU16LenLimited_clone(&o_conv); + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); + *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_err(int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); - LDKSendError e_conv = *(LDKSendError*)(e_ptr); - e_conv = SendError_clone((LDKSendError*)untag_ptr(e)); - LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ), "LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ"); - *ret_conv = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_err(e_conv); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); + *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_is_ok(int64_t o) { - LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* o_conv = (LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* o_conv = (LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_free(int64_t _res) { +void CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ _res_conv = *(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ*)(_res_ptr); + LDKCResult_TransactionU16LenLimitedDecodeErrorZ _res_conv = *(LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_free(_res_conv); + CResult_TransactionU16LenLimitedDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone_ptr(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ *NONNULL_PTR arg) { - LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ), "LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ"); - *ret_conv = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone(arg); +static inline uint64_t CResult_TransactionU16LenLimitedDecodeErrorZ_clone_ptr(LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); + *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone_ptr(int64_t arg) { - LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* arg_conv = (LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* arg_conv = (LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone(int64_t orig) { - LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* orig_conv = (LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ*)untag_ptr(orig); - LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ), "LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ"); - *ret_conv = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_clone(int64_t orig) { + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* orig_conv = (LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)untag_ptr(orig); + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); + *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PeeledOnionNoneZ_ok(int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKPeeledOnion o_conv = *(LDKPeeledOnion*)(o_ptr); - o_conv = PeeledOnion_clone((LDKPeeledOnion*)untag_ptr(o)); - LDKCResult_PeeledOnionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PeeledOnionNoneZ), "LDKCResult_PeeledOnionNoneZ"); - *ret_conv = CResult_PeeledOnionNoneZ_ok(o_conv); +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_PeeledOnionNoneZ_err() { - LDKCResult_PeeledOnionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PeeledOnionNoneZ), "LDKCResult_PeeledOnionNoneZ"); - *ret_conv = CResult_PeeledOnionNoneZ_err(); +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_PeeledOnionNoneZ_is_ok(int64_t o) { - LDKCResult_PeeledOnionNoneZ* o_conv = (LDKCResult_PeeledOnionNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_PeeledOnionNoneZ_is_ok(o_conv); +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_PeeledOnionNoneZ_free(int64_t _res) { +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_PeeledOnionNoneZ _res_conv = *(LDKCResult_PeeledOnionNoneZ*)(_res_ptr); + LDKCResult_UntrustedStringDecodeErrorZ _res_conv = *(LDKCResult_UntrustedStringDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_PeeledOnionNoneZ_free(_res_conv); + CResult_UntrustedStringDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_PeeledOnionNoneZ_clone_ptr(LDKCResult_PeeledOnionNoneZ *NONNULL_PTR arg) { - LDKCResult_PeeledOnionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PeeledOnionNoneZ), "LDKCResult_PeeledOnionNoneZ"); - *ret_conv = CResult_PeeledOnionNoneZ_clone(arg); +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_PeeledOnionNoneZ_clone_ptr(int64_t arg) { - LDKCResult_PeeledOnionNoneZ* arg_conv = (LDKCResult_PeeledOnionNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_PeeledOnionNoneZ_clone_ptr(arg_conv); +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_PeeledOnionNoneZ_clone(int64_t orig) { - LDKCResult_PeeledOnionNoneZ* orig_conv = (LDKCResult_PeeledOnionNoneZ*)untag_ptr(orig); - LDKCResult_PeeledOnionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PeeledOnionNoneZ), "LDKCResult_PeeledOnionNoneZ"); - *ret_conv = CResult_PeeledOnionNoneZ_clone(orig_conv); +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_SendSuccessSendErrorZ_ok(int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKSendSuccess o_conv = *(LDKSendSuccess*)(o_ptr); - o_conv = SendSuccess_clone((LDKSendSuccess*)untag_ptr(o)); - LDKCResult_SendSuccessSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SendSuccessSendErrorZ), "LDKCResult_SendSuccessSendErrorZ"); - *ret_conv = CResult_SendSuccessSendErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_ChannelIdDecodeErrorZ_ok(int64_t o) { + LDKChannelId o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = ChannelId_clone(&o_conv); + LDKCResult_ChannelIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdDecodeErrorZ), "LDKCResult_ChannelIdDecodeErrorZ"); + *ret_conv = CResult_ChannelIdDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_SendSuccessSendErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_ChannelIdDecodeErrorZ_err(int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); - LDKSendError e_conv = *(LDKSendError*)(e_ptr); - e_conv = SendError_clone((LDKSendError*)untag_ptr(e)); - LDKCResult_SendSuccessSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SendSuccessSendErrorZ), "LDKCResult_SendSuccessSendErrorZ"); - *ret_conv = CResult_SendSuccessSendErrorZ_err(e_conv); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_ChannelIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdDecodeErrorZ), "LDKCResult_ChannelIdDecodeErrorZ"); + *ret_conv = CResult_ChannelIdDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_SendSuccessSendErrorZ_is_ok(int64_t o) { - LDKCResult_SendSuccessSendErrorZ* o_conv = (LDKCResult_SendSuccessSendErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_SendSuccessSendErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_ChannelIdDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_ChannelIdDecodeErrorZ* o_conv = (LDKCResult_ChannelIdDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ChannelIdDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_SendSuccessSendErrorZ_free(int64_t _res) { +void CS_LDK_CResult_ChannelIdDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_SendSuccessSendErrorZ _res_conv = *(LDKCResult_SendSuccessSendErrorZ*)(_res_ptr); + LDKCResult_ChannelIdDecodeErrorZ _res_conv = *(LDKCResult_ChannelIdDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_SendSuccessSendErrorZ_free(_res_conv); + CResult_ChannelIdDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_SendSuccessSendErrorZ_clone_ptr(LDKCResult_SendSuccessSendErrorZ *NONNULL_PTR arg) { - LDKCResult_SendSuccessSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SendSuccessSendErrorZ), "LDKCResult_SendSuccessSendErrorZ"); - *ret_conv = CResult_SendSuccessSendErrorZ_clone(arg); +static inline uint64_t CResult_ChannelIdDecodeErrorZ_clone_ptr(LDKCResult_ChannelIdDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdDecodeErrorZ), "LDKCResult_ChannelIdDecodeErrorZ"); + *ret_conv = CResult_ChannelIdDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_SendSuccessSendErrorZ_clone_ptr(int64_t arg) { - LDKCResult_SendSuccessSendErrorZ* arg_conv = (LDKCResult_SendSuccessSendErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_SendSuccessSendErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_ChannelIdDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_ChannelIdDecodeErrorZ* arg_conv = (LDKCResult_ChannelIdDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ChannelIdDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_SendSuccessSendErrorZ_clone(int64_t orig) { - LDKCResult_SendSuccessSendErrorZ* orig_conv = (LDKCResult_SendSuccessSendErrorZ*)untag_ptr(orig); - LDKCResult_SendSuccessSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SendSuccessSendErrorZ), "LDKCResult_SendSuccessSendErrorZ"); - *ret_conv = CResult_SendSuccessSendErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_ChannelIdDecodeErrorZ_clone(int64_t orig) { + LDKCResult_ChannelIdDecodeErrorZ* orig_conv = (LDKCResult_ChannelIdDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ChannelIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdDecodeErrorZ), "LDKCResult_ChannelIdDecodeErrorZ"); + *ret_conv = CResult_ChannelIdDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -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); +static inline uint64_t C2Tuple__u832u16Z_clone_ptr(LDKC2Tuple__u832u16Z *NONNULL_PTR arg) { + LDKC2Tuple__u832u16Z* ret_conv = MALLOC(sizeof(LDKC2Tuple__u832u16Z), "LDKC2Tuple__u832u16Z"); + *ret_conv = C2Tuple__u832u16Z_clone(arg); return tag_ptr(ret_conv, true); } +int64_t CS_LDK_C2Tuple__u832u16Z_clone_ptr(int64_t arg) { + LDKC2Tuple__u832u16Z* arg_conv = (LDKC2Tuple__u832u16Z*)untag_ptr(arg); + int64_t ret_conv = C2Tuple__u832u16Z_clone_ptr(arg_conv); + return ret_conv; +} -int64_t CS_LDK_CResult_BlindedPathNoneZ_err() { - LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); - *ret_conv = CResult_BlindedPathNoneZ_err(); +int64_t CS_LDK_C2Tuple__u832u16Z_clone(int64_t orig) { + LDKC2Tuple__u832u16Z* orig_conv = (LDKC2Tuple__u832u16Z*)untag_ptr(orig); + LDKC2Tuple__u832u16Z* ret_conv = MALLOC(sizeof(LDKC2Tuple__u832u16Z), "LDKC2Tuple__u832u16Z"); + *ret_conv = C2Tuple__u832u16Z_clone(orig_conv); return tag_ptr(ret_conv, true); } -jboolean 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; +int64_t CS_LDK_C2Tuple__u832u16Z_new(int8_tArray a, int16_t b) { + LDKThirtyTwoBytes a_ref; + CHECK(a->arr_len == 32); + memcpy(a_ref.data, a->elems, 32); FREE(a); + LDKC2Tuple__u832u16Z* ret_conv = MALLOC(sizeof(LDKC2Tuple__u832u16Z), "LDKC2Tuple__u832u16Z"); + *ret_conv = C2Tuple__u832u16Z_new(a_ref, b); + return tag_ptr(ret_conv, true); } -void CS_LDK_CResult_BlindedPathNoneZ_free(int64_t _res) { +void CS_LDK_C2Tuple__u832u16Z_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); + LDKC2Tuple__u832u16Z _res_conv = *(LDKC2Tuple__u832u16Z*)(_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); + C2Tuple__u832u16Z_free(_res_conv); } -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); +int64_t CS_LDK_CResult_PaymentRelayDecodeErrorZ_ok(int64_t o) { + LDKPaymentRelay o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = PaymentRelay_clone(&o_conv); + LDKCResult_PaymentRelayDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentRelayDecodeErrorZ), "LDKCResult_PaymentRelayDecodeErrorZ"); + *ret_conv = CResult_PaymentRelayDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -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_PaymentRelayDecodeErrorZ_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_PaymentRelayDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentRelayDecodeErrorZ), "LDKCResult_PaymentRelayDecodeErrorZ"); + *ret_conv = CResult_PaymentRelayDecodeErrorZ_err(e_conv); 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); +jboolean CS_LDK_CResult_PaymentRelayDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_PaymentRelayDecodeErrorZ* o_conv = (LDKCResult_PaymentRelayDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_PaymentRelayDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free(int64_t _res) { +void CS_LDK_CResult_PaymentRelayDecodeErrorZ_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); + LDKCResult_PaymentRelayDecodeErrorZ _res_conv = *(LDKCResult_PaymentRelayDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free(_res_conv); + CResult_PaymentRelayDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone_ptr(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR arg) { - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ), "LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ"); - *ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(arg); +static inline uint64_t CResult_PaymentRelayDecodeErrorZ_clone_ptr(LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_PaymentRelayDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentRelayDecodeErrorZ), "LDKCResult_PaymentRelayDecodeErrorZ"); + *ret_conv = CResult_PaymentRelayDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t 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); +int64_t CS_LDK_CResult_PaymentRelayDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_PaymentRelayDecodeErrorZ* arg_conv = (LDKCResult_PaymentRelayDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PaymentRelayDecodeErrorZ_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); +int64_t CS_LDK_CResult_PaymentRelayDecodeErrorZ_clone(int64_t orig) { + LDKCResult_PaymentRelayDecodeErrorZ* orig_conv = (LDKCResult_PaymentRelayDecodeErrorZ*)untag_ptr(orig); + LDKCResult_PaymentRelayDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentRelayDecodeErrorZ), "LDKCResult_PaymentRelayDecodeErrorZ"); + *ret_conv = CResult_PaymentRelayDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -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; +int64_t CS_LDK_CResult_PaymentConstraintsDecodeErrorZ_ok(int64_t o) { + LDKPaymentConstraints o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = BlindedPath_clone(&o_conv); - LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ"); - *ret_conv = CResult_BlindedPathDecodeErrorZ_ok(o_conv); + o_conv = PaymentConstraints_clone(&o_conv); + LDKCResult_PaymentConstraintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentConstraintsDecodeErrorZ), "LDKCResult_PaymentConstraintsDecodeErrorZ"); + *ret_conv = CResult_PaymentConstraintsDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_BlindedPathDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_PaymentConstraintsDecodeErrorZ_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); + LDKCResult_PaymentConstraintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentConstraintsDecodeErrorZ), "LDKCResult_PaymentConstraintsDecodeErrorZ"); + *ret_conv = CResult_PaymentConstraintsDecodeErrorZ_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_PaymentConstraintsDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_PaymentConstraintsDecodeErrorZ* o_conv = (LDKCResult_PaymentConstraintsDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_PaymentConstraintsDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_BlindedPathDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_PaymentConstraintsDecodeErrorZ_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_PaymentConstraintsDecodeErrorZ _res_conv = *(LDKCResult_PaymentConstraintsDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_BlindedPathDecodeErrorZ_free(_res_conv); + CResult_PaymentConstraintsDecodeErrorZ_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_PaymentConstraintsDecodeErrorZ_clone_ptr(LDKCResult_PaymentConstraintsDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_PaymentConstraintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentConstraintsDecodeErrorZ), "LDKCResult_PaymentConstraintsDecodeErrorZ"); + *ret_conv = CResult_PaymentConstraintsDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t 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_PaymentConstraintsDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_PaymentConstraintsDecodeErrorZ* arg_conv = (LDKCResult_PaymentConstraintsDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PaymentConstraintsDecodeErrorZ_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_PaymentConstraintsDecodeErrorZ_clone(int64_t orig) { + LDKCResult_PaymentConstraintsDecodeErrorZ* orig_conv = (LDKCResult_PaymentConstraintsDecodeErrorZ*)untag_ptr(orig); + LDKCResult_PaymentConstraintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentConstraintsDecodeErrorZ), "LDKCResult_PaymentConstraintsDecodeErrorZ"); + *ret_conv = CResult_PaymentConstraintsDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_BlindedHopDecodeErrorZ_ok(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 = BlindedHop_clone(&o_conv); - LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); - *ret_conv = CResult_BlindedHopDecodeErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_PaymentContextDecodeErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKPaymentContext o_conv = *(LDKPaymentContext*)(o_ptr); + o_conv = PaymentContext_clone((LDKPaymentContext*)untag_ptr(o)); + LDKCResult_PaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentContextDecodeErrorZ), "LDKCResult_PaymentContextDecodeErrorZ"); + *ret_conv = CResult_PaymentContextDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_BlindedHopDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_PaymentContextDecodeErrorZ_err(int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); - *ret_conv = CResult_BlindedHopDecodeErrorZ_err(e_conv); + LDKCResult_PaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentContextDecodeErrorZ), "LDKCResult_PaymentContextDecodeErrorZ"); + *ret_conv = CResult_PaymentContextDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_BlindedHopDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_BlindedHopDecodeErrorZ* o_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_BlindedHopDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_PaymentContextDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_PaymentContextDecodeErrorZ* o_conv = (LDKCResult_PaymentContextDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_PaymentContextDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_BlindedHopDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_PaymentContextDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_BlindedHopDecodeErrorZ _res_conv = *(LDKCResult_BlindedHopDecodeErrorZ*)(_res_ptr); + LDKCResult_PaymentContextDecodeErrorZ _res_conv = *(LDKCResult_PaymentContextDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_BlindedHopDecodeErrorZ_free(_res_conv); + CResult_PaymentContextDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_BlindedHopDecodeErrorZ_clone_ptr(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); - *ret_conv = CResult_BlindedHopDecodeErrorZ_clone(arg); +static inline uint64_t CResult_PaymentContextDecodeErrorZ_clone_ptr(LDKCResult_PaymentContextDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_PaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentContextDecodeErrorZ), "LDKCResult_PaymentContextDecodeErrorZ"); + *ret_conv = CResult_PaymentContextDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_BlindedHopDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_BlindedHopDecodeErrorZ* arg_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_BlindedHopDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_PaymentContextDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_PaymentContextDecodeErrorZ* arg_conv = (LDKCResult_PaymentContextDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PaymentContextDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_BlindedHopDecodeErrorZ_clone(int64_t orig) { - LDKCResult_BlindedHopDecodeErrorZ* orig_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(orig); - LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); - *ret_conv = CResult_BlindedHopDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_PaymentContextDecodeErrorZ_clone(int64_t orig) { + LDKCResult_PaymentContextDecodeErrorZ* orig_conv = (LDKCResult_PaymentContextDecodeErrorZ*)untag_ptr(orig); + LDKCResult_PaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentContextDecodeErrorZ), "LDKCResult_PaymentContextDecodeErrorZ"); + *ret_conv = CResult_PaymentContextDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_InvoiceErrorDecodeErrorZ_ok(int64_t o) { - LDKInvoiceError o_conv; +int64_t CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_ok(int64_t o) { + LDKUnknownPaymentContext o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = InvoiceError_clone(&o_conv); - LDKCResult_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); - *ret_conv = CResult_InvoiceErrorDecodeErrorZ_ok(o_conv); + o_conv = UnknownPaymentContext_clone(&o_conv); + LDKCResult_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); + *ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_InvoiceErrorDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_err(int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); - *ret_conv = CResult_InvoiceErrorDecodeErrorZ_err(e_conv); + LDKCResult_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); + *ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_InvoiceErrorDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_InvoiceErrorDecodeErrorZ* o_conv = (LDKCResult_InvoiceErrorDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_InvoiceErrorDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_UnknownPaymentContextDecodeErrorZ* o_conv = (LDKCResult_UnknownPaymentContextDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_InvoiceErrorDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_InvoiceErrorDecodeErrorZ _res_conv = *(LDKCResult_InvoiceErrorDecodeErrorZ*)(_res_ptr); + LDKCResult_UnknownPaymentContextDecodeErrorZ _res_conv = *(LDKCResult_UnknownPaymentContextDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_InvoiceErrorDecodeErrorZ_free(_res_conv); + CResult_UnknownPaymentContextDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_InvoiceErrorDecodeErrorZ_clone_ptr(LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); - *ret_conv = CResult_InvoiceErrorDecodeErrorZ_clone(arg); +static inline uint64_t CResult_UnknownPaymentContextDecodeErrorZ_clone_ptr(LDKCResult_UnknownPaymentContextDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); + *ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_InvoiceErrorDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_InvoiceErrorDecodeErrorZ* arg_conv = (LDKCResult_InvoiceErrorDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_InvoiceErrorDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_UnknownPaymentContextDecodeErrorZ* arg_conv = (LDKCResult_UnknownPaymentContextDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_InvoiceErrorDecodeErrorZ_clone(int64_t orig) { - LDKCResult_InvoiceErrorDecodeErrorZ* orig_conv = (LDKCResult_InvoiceErrorDecodeErrorZ*)untag_ptr(orig); - LDKCResult_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); - *ret_conv = CResult_InvoiceErrorDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_clone(int64_t orig) { + LDKCResult_UnknownPaymentContextDecodeErrorZ* orig_conv = (LDKCResult_UnknownPaymentContextDecodeErrorZ*)untag_ptr(orig); + LDKCResult_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); + *ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_ok(int64_t o) { - LDKTrackedSpendableOutput o_conv; +int64_t CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_ok(int64_t o) { + LDKBolt12OfferContext o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = TrackedSpendableOutput_clone(&o_conv); - LDKCResult_TrackedSpendableOutputDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TrackedSpendableOutputDecodeErrorZ), "LDKCResult_TrackedSpendableOutputDecodeErrorZ"); - *ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_ok(o_conv); + o_conv = Bolt12OfferContext_clone(&o_conv); + LDKCResult_Bolt12OfferContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12OfferContextDecodeErrorZ), "LDKCResult_Bolt12OfferContextDecodeErrorZ"); + *ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_err(int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_TrackedSpendableOutputDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TrackedSpendableOutputDecodeErrorZ), "LDKCResult_TrackedSpendableOutputDecodeErrorZ"); - *ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_err(e_conv); + LDKCResult_Bolt12OfferContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12OfferContextDecodeErrorZ), "LDKCResult_Bolt12OfferContextDecodeErrorZ"); + *ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_TrackedSpendableOutputDecodeErrorZ* o_conv = (LDKCResult_TrackedSpendableOutputDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_Bolt12OfferContextDecodeErrorZ* o_conv = (LDKCResult_Bolt12OfferContextDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_TrackedSpendableOutputDecodeErrorZ _res_conv = *(LDKCResult_TrackedSpendableOutputDecodeErrorZ*)(_res_ptr); + LDKCResult_Bolt12OfferContextDecodeErrorZ _res_conv = *(LDKCResult_Bolt12OfferContextDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_TrackedSpendableOutputDecodeErrorZ_free(_res_conv); + CResult_Bolt12OfferContextDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_TrackedSpendableOutputDecodeErrorZ_clone_ptr(LDKCResult_TrackedSpendableOutputDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_TrackedSpendableOutputDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TrackedSpendableOutputDecodeErrorZ), "LDKCResult_TrackedSpendableOutputDecodeErrorZ"); - *ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_clone(arg); +static inline uint64_t CResult_Bolt12OfferContextDecodeErrorZ_clone_ptr(LDKCResult_Bolt12OfferContextDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_Bolt12OfferContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12OfferContextDecodeErrorZ), "LDKCResult_Bolt12OfferContextDecodeErrorZ"); + *ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_TrackedSpendableOutputDecodeErrorZ* arg_conv = (LDKCResult_TrackedSpendableOutputDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_Bolt12OfferContextDecodeErrorZ* arg_conv = (LDKCResult_Bolt12OfferContextDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_clone(int64_t orig) { - LDKCResult_TrackedSpendableOutputDecodeErrorZ* orig_conv = (LDKCResult_TrackedSpendableOutputDecodeErrorZ*)untag_ptr(orig); - LDKCResult_TrackedSpendableOutputDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TrackedSpendableOutputDecodeErrorZ), "LDKCResult_TrackedSpendableOutputDecodeErrorZ"); - *ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_clone(int64_t orig) { + LDKCResult_Bolt12OfferContextDecodeErrorZ* orig_conv = (LDKCResult_Bolt12OfferContextDecodeErrorZ*)untag_ptr(orig); + LDKCResult_Bolt12OfferContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12OfferContextDecodeErrorZ), "LDKCResult_Bolt12OfferContextDecodeErrorZ"); + *ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_ok(int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKOutputSpendStatus o_conv = *(LDKOutputSpendStatus*)(o_ptr); - o_conv = OutputSpendStatus_clone((LDKOutputSpendStatus*)untag_ptr(o)); - LDKCResult_OutputSpendStatusDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSpendStatusDecodeErrorZ), "LDKCResult_OutputSpendStatusDecodeErrorZ"); - *ret_conv = CResult_OutputSpendStatusDecodeErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_ok(int64_t o) { + LDKBolt12RefundContext o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = Bolt12RefundContext_clone(&o_conv); + LDKCResult_Bolt12RefundContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12RefundContextDecodeErrorZ), "LDKCResult_Bolt12RefundContextDecodeErrorZ"); + *ret_conv = CResult_Bolt12RefundContextDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_err(int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_OutputSpendStatusDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSpendStatusDecodeErrorZ), "LDKCResult_OutputSpendStatusDecodeErrorZ"); - *ret_conv = CResult_OutputSpendStatusDecodeErrorZ_err(e_conv); + LDKCResult_Bolt12RefundContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12RefundContextDecodeErrorZ), "LDKCResult_Bolt12RefundContextDecodeErrorZ"); + *ret_conv = CResult_Bolt12RefundContextDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_OutputSpendStatusDecodeErrorZ* o_conv = (LDKCResult_OutputSpendStatusDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_OutputSpendStatusDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_Bolt12RefundContextDecodeErrorZ* o_conv = (LDKCResult_Bolt12RefundContextDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_Bolt12RefundContextDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_OutputSpendStatusDecodeErrorZ _res_conv = *(LDKCResult_OutputSpendStatusDecodeErrorZ*)(_res_ptr); + LDKCResult_Bolt12RefundContextDecodeErrorZ _res_conv = *(LDKCResult_Bolt12RefundContextDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_OutputSpendStatusDecodeErrorZ_free(_res_conv); + CResult_Bolt12RefundContextDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_OutputSpendStatusDecodeErrorZ_clone_ptr(LDKCResult_OutputSpendStatusDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_OutputSpendStatusDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSpendStatusDecodeErrorZ), "LDKCResult_OutputSpendStatusDecodeErrorZ"); - *ret_conv = CResult_OutputSpendStatusDecodeErrorZ_clone(arg); +static inline uint64_t CResult_Bolt12RefundContextDecodeErrorZ_clone_ptr(LDKCResult_Bolt12RefundContextDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_Bolt12RefundContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12RefundContextDecodeErrorZ), "LDKCResult_Bolt12RefundContextDecodeErrorZ"); + *ret_conv = CResult_Bolt12RefundContextDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_OutputSpendStatusDecodeErrorZ* arg_conv = (LDKCResult_OutputSpendStatusDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_OutputSpendStatusDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_Bolt12RefundContextDecodeErrorZ* arg_conv = (LDKCResult_Bolt12RefundContextDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_Bolt12RefundContextDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_clone(int64_t orig) { - LDKCResult_OutputSpendStatusDecodeErrorZ* orig_conv = (LDKCResult_OutputSpendStatusDecodeErrorZ*)untag_ptr(orig); - LDKCResult_OutputSpendStatusDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSpendStatusDecodeErrorZ), "LDKCResult_OutputSpendStatusDecodeErrorZ"); - *ret_conv = CResult_OutputSpendStatusDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_clone(int64_t orig) { + LDKCResult_Bolt12RefundContextDecodeErrorZ* orig_conv = (LDKCResult_Bolt12RefundContextDecodeErrorZ*)untag_ptr(orig); + LDKCResult_Bolt12RefundContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12RefundContextDecodeErrorZ), "LDKCResult_Bolt12RefundContextDecodeErrorZ"); + *ret_conv = CResult_Bolt12RefundContextDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_COption_FilterZ_some(int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKFilter o_conv = *(LDKFilter*)(o_ptr); - if (o_conv.free == LDKFilter_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFilter_JCalls_cloned(&o_conv); - } - LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ"); - *ret_copy = COption_FilterZ_some(o_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_CResult_StrSecp256k1ErrorZ_ok(jstring o) { + LDKStr o_conv = str_ref_to_owned_c(o); + LDKCResult_StrSecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StrSecp256k1ErrorZ), "LDKCResult_StrSecp256k1ErrorZ"); + *ret_conv = CResult_StrSecp256k1ErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_COption_FilterZ_none() { - LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ"); - *ret_copy = COption_FilterZ_none(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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); + return tag_ptr(ret_conv, true); } -void CS_LDK_COption_FilterZ_free(int64_t _res) { +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); + return ret_conv; +} + +void CS_LDK_CResult_StrSecp256k1ErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCOption_FilterZ _res_conv = *(LDKCOption_FilterZ*)(_res_ptr); + LDKCResult_StrSecp256k1ErrorZ _res_conv = *(LDKCResult_StrSecp256k1ErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_FilterZ_free(_res_conv); + CResult_StrSecp256k1ErrorZ_free(_res_conv); } -void CS_LDK_CVec_TrackedSpendableOutputZ_free(int64_tArray _res) { - LDKCVec_TrackedSpendableOutputZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTrackedSpendableOutput), "LDKCVec_TrackedSpendableOutputZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = _res->elems; - for (size_t y = 0; y < _res_constr.datalen; y++) { - int64_t _res_conv_24 = _res_vals[y]; - LDKTrackedSpendableOutput _res_conv_24_conv; - _res_conv_24_conv.inner = untag_ptr(_res_conv_24); - _res_conv_24_conv.is_owned = ptr_is_owned(_res_conv_24); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_24_conv); - _res_constr.data[y] = _res_conv_24_conv; - } - FREE(_res); - CVec_TrackedSpendableOutputZ_free(_res_constr); +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_OutputSweeperDecodeErrorZ_ok(int64_t o) { - LDKOutputSweeper o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - // WARNING: we need a move here but no clone is available for LDKOutputSweeper - - LDKCResult_OutputSweeperDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSweeperDecodeErrorZ), "LDKCResult_OutputSweeperDecodeErrorZ"); - *ret_conv = CResult_OutputSweeperDecodeErrorZ_ok(o_conv); +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); } -int64_t CS_LDK_CResult_OutputSweeperDecodeErrorZ_err(int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); - e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_OutputSweeperDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSweeperDecodeErrorZ), "LDKCResult_OutputSweeperDecodeErrorZ"); - *ret_conv = CResult_OutputSweeperDecodeErrorZ_err(e_conv); +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); } - -jboolean CS_LDK_CResult_OutputSweeperDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_OutputSweeperDecodeErrorZ* o_conv = (LDKCResult_OutputSweeperDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_OutputSweeperDecodeErrorZ_is_ok(o_conv); +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; } -void CS_LDK_CResult_OutputSweeperDecodeErrorZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_OutputSweeperDecodeErrorZ _res_conv = *(LDKCResult_OutputSweeperDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_OutputSweeperDecodeErrorZ_free(_res_conv); +int64_t CS_LDK_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_C2Tuple_BestBlockOutputSweeperZ_new(int64_t a, int64_t b) { - LDKBestBlock a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = BestBlock_clone(&a_conv); - LDKOutputSweeper b_conv; +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); - // WARNING: we need a move here but no clone is available for LDKOutputSweeper - - LDKC2Tuple_BestBlockOutputSweeperZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BestBlockOutputSweeperZ), "LDKC2Tuple_BestBlockOutputSweeperZ"); - *ret_conv = C2Tuple_BestBlockOutputSweeperZ_new(a_conv, b_conv); + 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_C2Tuple_BestBlockOutputSweeperZ_free(int64_t _res) { +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); - LDKC2Tuple_BestBlockOutputSweeperZ _res_conv = *(LDKC2Tuple_BestBlockOutputSweeperZ*)(_res_ptr); + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ _res_conv = *(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)(_res_ptr); FREE(untag_ptr(_res)); - C2Tuple_BestBlockOutputSweeperZ_free(_res_conv); + C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(_res_conv); } -int64_t CS_LDK_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_ok(int64_t o) { +int64_t CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); - LDKC2Tuple_BestBlockOutputSweeperZ o_conv = *(LDKC2Tuple_BestBlockOutputSweeperZ*)(o_ptr); - // WARNING: we may need a move here but no clone is available for LDKC2Tuple_BestBlockOutputSweeperZ - LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ), "LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ"); - *ret_conv = CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_ok(o_conv); + 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_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_err(int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); - e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ), "LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ"); - *ret_conv = CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_err(e_conv); +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_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_is_ok(o_conv); +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_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_free(int64_t _res) { +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_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ*)(_res_ptr); + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ _res_conv = *(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_free(_res_conv); + CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(_res_conv); } -int64_t CS_LDK_CResult_DelayedPaymentBasepointDecodeErrorZ_ok(int64_t o) { - LDKDelayedPaymentBasepoint o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = DelayedPaymentBasepoint_clone(&o_conv); - LDKCResult_DelayedPaymentBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentBasepointDecodeErrorZ), "LDKCResult_DelayedPaymentBasepointDecodeErrorZ"); - *ret_conv = CResult_DelayedPaymentBasepointDecodeErrorZ_ok(o_conv); +static inline uint64_t 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_DelayedPaymentBasepointDecodeErrorZ_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_DelayedPaymentBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentBasepointDecodeErrorZ), "LDKCResult_DelayedPaymentBasepointDecodeErrorZ"); - *ret_conv = CResult_DelayedPaymentBasepointDecodeErrorZ_err(e_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); } -jboolean CS_LDK_CResult_DelayedPaymentBasepointDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_DelayedPaymentBasepointDecodeErrorZ* o_conv = (LDKCResult_DelayedPaymentBasepointDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_DelayedPaymentBasepointDecodeErrorZ_is_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_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_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_DelayedPaymentBasepointDecodeErrorZ_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_DelayedPaymentBasepointDecodeErrorZ _res_conv = *(LDKCResult_DelayedPaymentBasepointDecodeErrorZ*)(_res_ptr); + LDKCResult_TxOutUtxoLookupErrorZ _res_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_DelayedPaymentBasepointDecodeErrorZ_free(_res_conv); + CResult_TxOutUtxoLookupErrorZ_free(_res_conv); } -static inline uint64_t CResult_DelayedPaymentBasepointDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentBasepointDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_DelayedPaymentBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentBasepointDecodeErrorZ), "LDKCResult_DelayedPaymentBasepointDecodeErrorZ"); - *ret_conv = CResult_DelayedPaymentBasepointDecodeErrorZ_clone(arg); +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_CResult_DelayedPaymentBasepointDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_DelayedPaymentBasepointDecodeErrorZ* arg_conv = (LDKCResult_DelayedPaymentBasepointDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_DelayedPaymentBasepointDecodeErrorZ_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_CResult_DelayedPaymentBasepointDecodeErrorZ_clone(int64_t orig) { - LDKCResult_DelayedPaymentBasepointDecodeErrorZ* orig_conv = (LDKCResult_DelayedPaymentBasepointDecodeErrorZ*)untag_ptr(orig); - LDKCResult_DelayedPaymentBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentBasepointDecodeErrorZ), "LDKCResult_DelayedPaymentBasepointDecodeErrorZ"); - *ret_conv = CResult_DelayedPaymentBasepointDecodeErrorZ_clone(orig_conv); +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_CResult_DelayedPaymentKeyDecodeErrorZ_ok(int64_t o) { - LDKDelayedPaymentKey o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = DelayedPaymentKey_clone(&o_conv); - LDKCResult_DelayedPaymentKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentKeyDecodeErrorZ), "LDKCResult_DelayedPaymentKeyDecodeErrorZ"); - *ret_conv = CResult_DelayedPaymentKeyDecodeErrorZ_ok(o_conv); +static inline uint64_t C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone_ptr(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *NONNULL_PTR arg) { + LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ), "LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ"); + *ret_conv = C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone(arg); return tag_ptr(ret_conv, true); } +int64_t CS_LDK_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone_ptr(int64_t arg) { + LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ* arg_conv = (LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ*)untag_ptr(arg); + int64_t ret_conv = C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone_ptr(arg_conv); + return ret_conv; +} -int64_t CS_LDK_CResult_DelayedPaymentKeyDecodeErrorZ_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_DelayedPaymentKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentKeyDecodeErrorZ), "LDKCResult_DelayedPaymentKeyDecodeErrorZ"); - *ret_conv = CResult_DelayedPaymentKeyDecodeErrorZ_err(e_conv); +int64_t CS_LDK_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone(int64_t orig) { + LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ* orig_conv = (LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ*)untag_ptr(orig); + LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ), "LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ"); + *ret_conv = C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_DelayedPaymentKeyDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_DelayedPaymentKeyDecodeErrorZ* o_conv = (LDKCResult_DelayedPaymentKeyDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_DelayedPaymentKeyDecodeErrorZ_is_ok(o_conv); - return ret_conv; +int64_t CS_LDK_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_new(int8_tArray a, int64_t b, int64_t c) { + LDKPublicKey a_ref; + CHECK(a->arr_len == 33); + memcpy(a_ref.compressed_form, a->elems, 33); FREE(a); + LDKOnionMessage b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv = OnionMessage_clone(&b_conv); + void* c_ptr = untag_ptr(c); + CHECK_ACCESS(c_ptr); + LDKCOption_CVec_SocketAddressZZ c_conv = *(LDKCOption_CVec_SocketAddressZZ*)(c_ptr); + c_conv = COption_CVec_SocketAddressZZ_clone((LDKCOption_CVec_SocketAddressZZ*)untag_ptr(c)); + LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ), "LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ"); + *ret_conv = C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_new(a_ref, b_conv, c_conv); + return tag_ptr(ret_conv, true); } -void CS_LDK_CResult_DelayedPaymentKeyDecodeErrorZ_free(int64_t _res) { +void CS_LDK_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_DelayedPaymentKeyDecodeErrorZ _res_conv = *(LDKCResult_DelayedPaymentKeyDecodeErrorZ*)(_res_ptr); + LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ _res_conv = *(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_DelayedPaymentKeyDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_DelayedPaymentKeyDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentKeyDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_DelayedPaymentKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentKeyDecodeErrorZ), "LDKCResult_DelayedPaymentKeyDecodeErrorZ"); - *ret_conv = CResult_DelayedPaymentKeyDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t CS_LDK_CResult_DelayedPaymentKeyDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_DelayedPaymentKeyDecodeErrorZ* arg_conv = (LDKCResult_DelayedPaymentKeyDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_DelayedPaymentKeyDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_CResult_DelayedPaymentKeyDecodeErrorZ_clone(int64_t orig) { - LDKCResult_DelayedPaymentKeyDecodeErrorZ* orig_conv = (LDKCResult_DelayedPaymentKeyDecodeErrorZ*)untag_ptr(orig); - LDKCResult_DelayedPaymentKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentKeyDecodeErrorZ), "LDKCResult_DelayedPaymentKeyDecodeErrorZ"); - *ret_conv = CResult_DelayedPaymentKeyDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); + C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_free(_res_conv); } -int64_t CS_LDK_CResult_HtlcBasepointDecodeErrorZ_ok(int64_t o) { - LDKHtlcBasepoint o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = HtlcBasepoint_clone(&o_conv); - LDKCResult_HtlcBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcBasepointDecodeErrorZ), "LDKCResult_HtlcBasepointDecodeErrorZ"); - *ret_conv = CResult_HtlcBasepointDecodeErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ o_conv = *(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ*)(o_ptr); + o_conv = C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone((LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ*)untag_ptr(o)); + LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ), "LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ"); + *ret_conv = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_HtlcBasepointDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_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_HtlcBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcBasepointDecodeErrorZ), "LDKCResult_HtlcBasepointDecodeErrorZ"); - *ret_conv = CResult_HtlcBasepointDecodeErrorZ_err(e_conv); + LDKSendError e_conv = *(LDKSendError*)(e_ptr); + e_conv = SendError_clone((LDKSendError*)untag_ptr(e)); + LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ), "LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ"); + *ret_conv = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_HtlcBasepointDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_HtlcBasepointDecodeErrorZ* o_conv = (LDKCResult_HtlcBasepointDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_HtlcBasepointDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_is_ok(int64_t o) { + LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* o_conv = (LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_HtlcBasepointDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_HtlcBasepointDecodeErrorZ _res_conv = *(LDKCResult_HtlcBasepointDecodeErrorZ*)(_res_ptr); + LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ _res_conv = *(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_HtlcBasepointDecodeErrorZ_free(_res_conv); + CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_free(_res_conv); } -static inline uint64_t CResult_HtlcBasepointDecodeErrorZ_clone_ptr(LDKCResult_HtlcBasepointDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_HtlcBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcBasepointDecodeErrorZ), "LDKCResult_HtlcBasepointDecodeErrorZ"); - *ret_conv = CResult_HtlcBasepointDecodeErrorZ_clone(arg); +static inline uint64_t CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone_ptr(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ *NONNULL_PTR arg) { + LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ), "LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ"); + *ret_conv = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_HtlcBasepointDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_HtlcBasepointDecodeErrorZ* arg_conv = (LDKCResult_HtlcBasepointDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_HtlcBasepointDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone_ptr(int64_t arg) { + LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* arg_conv = (LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_HtlcBasepointDecodeErrorZ_clone(int64_t orig) { - LDKCResult_HtlcBasepointDecodeErrorZ* orig_conv = (LDKCResult_HtlcBasepointDecodeErrorZ*)untag_ptr(orig); - LDKCResult_HtlcBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcBasepointDecodeErrorZ), "LDKCResult_HtlcBasepointDecodeErrorZ"); - *ret_conv = CResult_HtlcBasepointDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone(int64_t orig) { + LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* orig_conv = (LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ*)untag_ptr(orig); + LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ), "LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ"); + *ret_conv = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_HtlcKeyDecodeErrorZ_ok(int64_t o) { - LDKHtlcKey o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = HtlcKey_clone(&o_conv); - LDKCResult_HtlcKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcKeyDecodeErrorZ), "LDKCResult_HtlcKeyDecodeErrorZ"); - *ret_conv = CResult_HtlcKeyDecodeErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_PeeledOnionNoneZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKPeeledOnion o_conv = *(LDKPeeledOnion*)(o_ptr); + o_conv = PeeledOnion_clone((LDKPeeledOnion*)untag_ptr(o)); + LDKCResult_PeeledOnionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PeeledOnionNoneZ), "LDKCResult_PeeledOnionNoneZ"); + *ret_conv = CResult_PeeledOnionNoneZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_HtlcKeyDecodeErrorZ_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_HtlcKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcKeyDecodeErrorZ), "LDKCResult_HtlcKeyDecodeErrorZ"); - *ret_conv = CResult_HtlcKeyDecodeErrorZ_err(e_conv); +int64_t CS_LDK_CResult_PeeledOnionNoneZ_err() { + LDKCResult_PeeledOnionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PeeledOnionNoneZ), "LDKCResult_PeeledOnionNoneZ"); + *ret_conv = CResult_PeeledOnionNoneZ_err(); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_HtlcKeyDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_HtlcKeyDecodeErrorZ* o_conv = (LDKCResult_HtlcKeyDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_HtlcKeyDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_PeeledOnionNoneZ_is_ok(int64_t o) { + LDKCResult_PeeledOnionNoneZ* o_conv = (LDKCResult_PeeledOnionNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_PeeledOnionNoneZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_HtlcKeyDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_PeeledOnionNoneZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_HtlcKeyDecodeErrorZ _res_conv = *(LDKCResult_HtlcKeyDecodeErrorZ*)(_res_ptr); + LDKCResult_PeeledOnionNoneZ _res_conv = *(LDKCResult_PeeledOnionNoneZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_HtlcKeyDecodeErrorZ_free(_res_conv); + CResult_PeeledOnionNoneZ_free(_res_conv); } -static inline uint64_t CResult_HtlcKeyDecodeErrorZ_clone_ptr(LDKCResult_HtlcKeyDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_HtlcKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcKeyDecodeErrorZ), "LDKCResult_HtlcKeyDecodeErrorZ"); - *ret_conv = CResult_HtlcKeyDecodeErrorZ_clone(arg); +static inline uint64_t CResult_PeeledOnionNoneZ_clone_ptr(LDKCResult_PeeledOnionNoneZ *NONNULL_PTR arg) { + LDKCResult_PeeledOnionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PeeledOnionNoneZ), "LDKCResult_PeeledOnionNoneZ"); + *ret_conv = CResult_PeeledOnionNoneZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_HtlcKeyDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_HtlcKeyDecodeErrorZ* arg_conv = (LDKCResult_HtlcKeyDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_HtlcKeyDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_PeeledOnionNoneZ_clone_ptr(int64_t arg) { + LDKCResult_PeeledOnionNoneZ* arg_conv = (LDKCResult_PeeledOnionNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PeeledOnionNoneZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_HtlcKeyDecodeErrorZ_clone(int64_t orig) { - LDKCResult_HtlcKeyDecodeErrorZ* orig_conv = (LDKCResult_HtlcKeyDecodeErrorZ*)untag_ptr(orig); - LDKCResult_HtlcKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcKeyDecodeErrorZ), "LDKCResult_HtlcKeyDecodeErrorZ"); - *ret_conv = CResult_HtlcKeyDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_PeeledOnionNoneZ_clone(int64_t orig) { + LDKCResult_PeeledOnionNoneZ* orig_conv = (LDKCResult_PeeledOnionNoneZ*)untag_ptr(orig); + LDKCResult_PeeledOnionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PeeledOnionNoneZ), "LDKCResult_PeeledOnionNoneZ"); + *ret_conv = CResult_PeeledOnionNoneZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_RevocationBasepointDecodeErrorZ_ok(int64_t o) { - LDKRevocationBasepoint o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = RevocationBasepoint_clone(&o_conv); - LDKCResult_RevocationBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationBasepointDecodeErrorZ), "LDKCResult_RevocationBasepointDecodeErrorZ"); - *ret_conv = CResult_RevocationBasepointDecodeErrorZ_ok(o_conv); +int64_t CS_LDK_CResult_SendSuccessSendErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKSendSuccess o_conv = *(LDKSendSuccess*)(o_ptr); + o_conv = SendSuccess_clone((LDKSendSuccess*)untag_ptr(o)); + LDKCResult_SendSuccessSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SendSuccessSendErrorZ), "LDKCResult_SendSuccessSendErrorZ"); + *ret_conv = CResult_SendSuccessSendErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_RevocationBasepointDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_SendSuccessSendErrorZ_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_RevocationBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationBasepointDecodeErrorZ), "LDKCResult_RevocationBasepointDecodeErrorZ"); - *ret_conv = CResult_RevocationBasepointDecodeErrorZ_err(e_conv); + LDKSendError e_conv = *(LDKSendError*)(e_ptr); + e_conv = SendError_clone((LDKSendError*)untag_ptr(e)); + LDKCResult_SendSuccessSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SendSuccessSendErrorZ), "LDKCResult_SendSuccessSendErrorZ"); + *ret_conv = CResult_SendSuccessSendErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_RevocationBasepointDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_RevocationBasepointDecodeErrorZ* o_conv = (LDKCResult_RevocationBasepointDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_RevocationBasepointDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_SendSuccessSendErrorZ_is_ok(int64_t o) { + LDKCResult_SendSuccessSendErrorZ* o_conv = (LDKCResult_SendSuccessSendErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_SendSuccessSendErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_RevocationBasepointDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_SendSuccessSendErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_RevocationBasepointDecodeErrorZ _res_conv = *(LDKCResult_RevocationBasepointDecodeErrorZ*)(_res_ptr); + LDKCResult_SendSuccessSendErrorZ _res_conv = *(LDKCResult_SendSuccessSendErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_RevocationBasepointDecodeErrorZ_free(_res_conv); + CResult_SendSuccessSendErrorZ_free(_res_conv); } -static inline uint64_t CResult_RevocationBasepointDecodeErrorZ_clone_ptr(LDKCResult_RevocationBasepointDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_RevocationBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationBasepointDecodeErrorZ), "LDKCResult_RevocationBasepointDecodeErrorZ"); - *ret_conv = CResult_RevocationBasepointDecodeErrorZ_clone(arg); +static inline uint64_t CResult_SendSuccessSendErrorZ_clone_ptr(LDKCResult_SendSuccessSendErrorZ *NONNULL_PTR arg) { + LDKCResult_SendSuccessSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SendSuccessSendErrorZ), "LDKCResult_SendSuccessSendErrorZ"); + *ret_conv = CResult_SendSuccessSendErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_RevocationBasepointDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_RevocationBasepointDecodeErrorZ* arg_conv = (LDKCResult_RevocationBasepointDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_RevocationBasepointDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_SendSuccessSendErrorZ_clone_ptr(int64_t arg) { + LDKCResult_SendSuccessSendErrorZ* arg_conv = (LDKCResult_SendSuccessSendErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_SendSuccessSendErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_RevocationBasepointDecodeErrorZ_clone(int64_t orig) { - LDKCResult_RevocationBasepointDecodeErrorZ* orig_conv = (LDKCResult_RevocationBasepointDecodeErrorZ*)untag_ptr(orig); - LDKCResult_RevocationBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationBasepointDecodeErrorZ), "LDKCResult_RevocationBasepointDecodeErrorZ"); - *ret_conv = CResult_RevocationBasepointDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_SendSuccessSendErrorZ_clone(int64_t orig) { + LDKCResult_SendSuccessSendErrorZ* orig_conv = (LDKCResult_SendSuccessSendErrorZ*)untag_ptr(orig); + LDKCResult_SendSuccessSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SendSuccessSendErrorZ), "LDKCResult_SendSuccessSendErrorZ"); + *ret_conv = CResult_SendSuccessSendErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_RevocationKeyDecodeErrorZ_ok(int64_t o) { - LDKRevocationKey o_conv; +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 = RevocationKey_clone(&o_conv); - LDKCResult_RevocationKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationKeyDecodeErrorZ), "LDKCResult_RevocationKeyDecodeErrorZ"); - *ret_conv = CResult_RevocationKeyDecodeErrorZ_ok(o_conv); + o_conv = BlindedPath_clone(&o_conv); + LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); + *ret_conv = CResult_BlindedPathNoneZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_RevocationKeyDecodeErrorZ_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_RevocationKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationKeyDecodeErrorZ), "LDKCResult_RevocationKeyDecodeErrorZ"); - *ret_conv = CResult_RevocationKeyDecodeErrorZ_err(e_conv); +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_RevocationKeyDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_RevocationKeyDecodeErrorZ* o_conv = (LDKCResult_RevocationKeyDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_RevocationKeyDecodeErrorZ_is_ok(o_conv); +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_RevocationKeyDecodeErrorZ_free(int64_t _res) { +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_RevocationKeyDecodeErrorZ _res_conv = *(LDKCResult_RevocationKeyDecodeErrorZ*)(_res_ptr); + LDKCResult_BlindedPathNoneZ _res_conv = *(LDKCResult_BlindedPathNoneZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_RevocationKeyDecodeErrorZ_free(_res_conv); + CResult_BlindedPathNoneZ_free(_res_conv); } -static inline uint64_t CResult_RevocationKeyDecodeErrorZ_clone_ptr(LDKCResult_RevocationKeyDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_RevocationKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationKeyDecodeErrorZ), "LDKCResult_RevocationKeyDecodeErrorZ"); - *ret_conv = CResult_RevocationKeyDecodeErrorZ_clone(arg); +static inline uint64_t CResult_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_RevocationKeyDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_RevocationKeyDecodeErrorZ* arg_conv = (LDKCResult_RevocationKeyDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_RevocationKeyDecodeErrorZ_clone_ptr(arg_conv); +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_RevocationKeyDecodeErrorZ_clone(int64_t orig) { - LDKCResult_RevocationKeyDecodeErrorZ* orig_conv = (LDKCResult_RevocationKeyDecodeErrorZ*)untag_ptr(orig); - LDKCResult_RevocationKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationKeyDecodeErrorZ), "LDKCResult_RevocationKeyDecodeErrorZ"); - *ret_conv = CResult_RevocationKeyDecodeErrorZ_clone(orig_conv); +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_LockedChannelMonitorNoneZ_ok(int64_t o) { - LDKLockedChannelMonitor o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - // WARNING: we need a move here but no clone is available for LDKLockedChannelMonitor - - LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); - *ret_conv = CResult_LockedChannelMonitorNoneZ_ok(o_conv); +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_LockedChannelMonitorNoneZ_err() { - LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); - *ret_conv = CResult_LockedChannelMonitorNoneZ_err(); +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(); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_LockedChannelMonitorNoneZ_is_ok(int64_t o) { - LDKCResult_LockedChannelMonitorNoneZ* o_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_LockedChannelMonitorNoneZ_is_ok(o_conv); +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_LockedChannelMonitorNoneZ_free(int64_t _res) { +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_LockedChannelMonitorNoneZ _res_conv = *(LDKCResult_LockedChannelMonitorNoneZ*)(_res_ptr); + LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ _res_conv = *(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_LockedChannelMonitorNoneZ_free(_res_conv); + CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free(_res_conv); } -static inline uint64_t C2Tuple_OutPointChannelIdZ_clone_ptr(LDKC2Tuple_OutPointChannelIdZ *NONNULL_PTR arg) { - LDKC2Tuple_OutPointChannelIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointChannelIdZ), "LDKC2Tuple_OutPointChannelIdZ"); - *ret_conv = C2Tuple_OutPointChannelIdZ_clone(arg); +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_C2Tuple_OutPointChannelIdZ_clone_ptr(int64_t arg) { - LDKC2Tuple_OutPointChannelIdZ* arg_conv = (LDKC2Tuple_OutPointChannelIdZ*)untag_ptr(arg); - int64_t ret_conv = C2Tuple_OutPointChannelIdZ_clone_ptr(arg_conv); +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_C2Tuple_OutPointChannelIdZ_clone(int64_t orig) { - LDKC2Tuple_OutPointChannelIdZ* orig_conv = (LDKC2Tuple_OutPointChannelIdZ*)untag_ptr(orig); - LDKC2Tuple_OutPointChannelIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointChannelIdZ), "LDKC2Tuple_OutPointChannelIdZ"); - *ret_conv = C2Tuple_OutPointChannelIdZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_C2Tuple_OutPointChannelIdZ_new(int64_t a, int64_t b) { - LDKOutPoint a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = OutPoint_clone(&a_conv); - LDKChannelId b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv = ChannelId_clone(&b_conv); - LDKC2Tuple_OutPointChannelIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointChannelIdZ), "LDKC2Tuple_OutPointChannelIdZ"); - *ret_conv = C2Tuple_OutPointChannelIdZ_new(a_conv, b_conv); +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_C2Tuple_OutPointChannelIdZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKC2Tuple_OutPointChannelIdZ _res_conv = *(LDKC2Tuple_OutPointChannelIdZ*)(_res_ptr); - FREE(untag_ptr(_res)); - C2Tuple_OutPointChannelIdZ_free(_res_conv); -} - -void CS_LDK_CVec_C2Tuple_OutPointChannelIdZZ_free(int64_tArray _res) { - LDKCVec_C2Tuple_OutPointChannelIdZZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OutPointChannelIdZ), "LDKCVec_C2Tuple_OutPointChannelIdZZ 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_29 = _res_vals[d]; - void* _res_conv_29_ptr = untag_ptr(_res_conv_29); - CHECK_ACCESS(_res_conv_29_ptr); - LDKC2Tuple_OutPointChannelIdZ _res_conv_29_conv = *(LDKC2Tuple_OutPointChannelIdZ*)(_res_conv_29_ptr); - FREE(untag_ptr(_res_conv_29)); - _res_constr.data[d] = _res_conv_29_conv; - } - FREE(_res); - CVec_C2Tuple_OutPointChannelIdZZ_free(_res_constr); -} - -void CS_LDK_CVec_MonitorUpdateIdZ_free(int64_tArray _res) { - LDKCVec_MonitorUpdateIdZ _res_constr; +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(LDKMonitorUpdateId), "LDKCVec_MonitorUpdateIdZ Elements"); + _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 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; + 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_MonitorUpdateIdZ_free(_res_constr); + CVec_ForwardNodeZ_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); +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_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); - 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_CResult_BlindedPathDecodeErrorZ_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); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_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; - b_constr.datalen = b->arr_len; - if (b_constr.datalen > 0) - b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKMonitorUpdateId), "LDKCVec_MonitorUpdateIdZ Elements"); - else - b_constr.data = NULL; - 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; - } - FREE(b); - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ"); - *ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(a_conv, b_constr); - return tag_ptr(ret_conv, true); +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); + return ret_conv; } -void CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(int64_t _res) { +void CS_LDK_CResult_BlindedPathDecodeErrorZ_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); + LDKCResult_BlindedPathDecodeErrorZ _res_conv = *(LDKCResult_BlindedPathDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(_res_conv); -} - -void CS_LDK_CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(int64_tArray _res) { - LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ Elements"); - else - _res_constr.data = NULL; - 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; - } - FREE(_res); - CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(_res_constr); -} - -void CS_LDK_APIError_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); - LDKAPIError this_ptr_conv = *(LDKAPIError*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - APIError_free(this_ptr_conv); + CResult_BlindedPathDecodeErrorZ_free(_res_conv); } -static inline uint64_t APIError_clone_ptr(LDKAPIError *NONNULL_PTR arg) { - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +static inline uint64_t CResult_BlindedPathDecodeErrorZ_clone_ptr(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ"); + *ret_conv = CResult_BlindedPathDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_APIError_clone_ptr(int64_t arg) { - LDKAPIError* arg_conv = (LDKAPIError*)untag_ptr(arg); - int64_t ret_conv = APIError_clone_ptr(arg_conv); +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); return ret_conv; } -int64_t CS_LDK_APIError_clone(int64_t orig) { - LDKAPIError* orig_conv = (LDKAPIError*)untag_ptr(orig); - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_APIError_apimisuse_error(jstring err) { - LDKStr err_conv = str_ref_to_owned_c(err); - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_apimisuse_error(err_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_APIError_fee_rate_too_high(jstring err, int32_t feerate) { - LDKStr err_conv = str_ref_to_owned_c(err); - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_fee_rate_too_high(err_conv, feerate); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_CResult_BlindedHopDecodeErrorZ_ok(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 = BlindedHop_clone(&o_conv); + LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); + *ret_conv = CResult_BlindedHopDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_APIError_invalid_route(jstring err) { - LDKStr err_conv = str_ref_to_owned_c(err); - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_invalid_route(err_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_CResult_BlindedHopDecodeErrorZ_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_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); + *ret_conv = CResult_BlindedHopDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_APIError_channel_unavailable(jstring err) { - LDKStr err_conv = str_ref_to_owned_c(err); - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_channel_unavailable(err_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_CResult_BlindedHopDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_BlindedHopDecodeErrorZ* o_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_BlindedHopDecodeErrorZ_is_ok(o_conv); + return ret_conv; } -int64_t CS_LDK_APIError_monitor_update_in_progress() { - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_monitor_update_in_progress(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_CResult_BlindedHopDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_BlindedHopDecodeErrorZ _res_conv = *(LDKCResult_BlindedHopDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_BlindedHopDecodeErrorZ_free(_res_conv); } -int64_t CS_LDK_APIError_incompatible_shutdown_script(int64_t script) { - LDKShutdownScript script_conv; - script_conv.inner = untag_ptr(script); - script_conv.is_owned = ptr_is_owned(script); - CHECK_INNER_FIELD_ACCESS_OR_NULL(script_conv); - script_conv = ShutdownScript_clone(&script_conv); - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_incompatible_shutdown_script(script_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +static inline uint64_t CResult_BlindedHopDecodeErrorZ_clone_ptr(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); + *ret_conv = CResult_BlindedHopDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); } - -jboolean CS_LDK_APIError_eq(int64_t a, int64_t b) { - LDKAPIError* a_conv = (LDKAPIError*)untag_ptr(a); - LDKAPIError* b_conv = (LDKAPIError*)untag_ptr(b); - jboolean ret_conv = APIError_eq(a_conv, b_conv); +int64_t CS_LDK_CResult_BlindedHopDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_BlindedHopDecodeErrorZ* arg_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BlindedHopDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int8_tArray CS_LDK_APIError_write(int64_t obj) { - LDKAPIError* obj_conv = (LDKAPIError*)untag_ptr(obj); - LDKCVec_u8Z ret_var = APIError_write(obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +int64_t CS_LDK_CResult_BlindedHopDecodeErrorZ_clone(int64_t orig) { + LDKCResult_BlindedHopDecodeErrorZ* orig_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(orig); + LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); + *ret_conv = CResult_BlindedHopDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_APIError_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_COption_APIErrorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_APIErrorZDecodeErrorZ), "LDKCResult_COption_APIErrorZDecodeErrorZ"); - *ret_conv = APIError_read(ser_ref); - FREE(ser); +int64_t CS_LDK_CResult_InvoiceErrorDecodeErrorZ_ok(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 = InvoiceError_clone(&o_conv); + LDKCResult_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); + *ret_conv = CResult_InvoiceErrorDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -void CS_LDK_BigSize_free(int64_t this_obj) { - LDKBigSize this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BigSize_free(this_obj_conv); +int64_t CS_LDK_CResult_InvoiceErrorDecodeErrorZ_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_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); + *ret_conv = CResult_InvoiceErrorDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_BigSize_get_a(int64_t this_ptr) { - LDKBigSize this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = BigSize_get_a(&this_ptr_conv); +jboolean CS_LDK_CResult_InvoiceErrorDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_InvoiceErrorDecodeErrorZ* o_conv = (LDKCResult_InvoiceErrorDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceErrorDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_BigSize_set_a(int64_t this_ptr, int64_t val) { - LDKBigSize this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - BigSize_set_a(&this_ptr_conv, val); -} - -int64_t CS_LDK_BigSize_new(int64_t a_arg) { - LDKBigSize ret_var = BigSize_new(a_arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +void CS_LDK_CResult_InvoiceErrorDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_InvoiceErrorDecodeErrorZ _res_conv = *(LDKCResult_InvoiceErrorDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_InvoiceErrorDecodeErrorZ_free(_res_conv); } -static inline uint64_t BigSize_clone_ptr(LDKBigSize *NONNULL_PTR arg) { - LDKBigSize ret_var = BigSize_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +static inline uint64_t CResult_InvoiceErrorDecodeErrorZ_clone_ptr(LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); + *ret_conv = CResult_InvoiceErrorDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_BigSize_clone_ptr(int64_t arg) { - LDKBigSize arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = BigSize_clone_ptr(&arg_conv); +int64_t CS_LDK_CResult_InvoiceErrorDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_InvoiceErrorDecodeErrorZ* arg_conv = (LDKCResult_InvoiceErrorDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_InvoiceErrorDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_BigSize_clone(int64_t orig) { - LDKBigSize orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKBigSize ret_var = BigSize_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +int64_t CS_LDK_CResult_InvoiceErrorDecodeErrorZ_clone(int64_t orig) { + LDKCResult_InvoiceErrorDecodeErrorZ* orig_conv = (LDKCResult_InvoiceErrorDecodeErrorZ*)untag_ptr(orig); + LDKCResult_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); + *ret_conv = CResult_InvoiceErrorDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_BigSize_hash(int64_t o) { - LDKBigSize o_conv; +int64_t CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_ok(int64_t o) { + LDKTrackedSpendableOutput o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = BigSize_hash(&o_conv); - return ret_conv; + o_conv = TrackedSpendableOutput_clone(&o_conv); + LDKCResult_TrackedSpendableOutputDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TrackedSpendableOutputDecodeErrorZ), "LDKCResult_TrackedSpendableOutputDecodeErrorZ"); + *ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_BigSize_eq(int64_t a, int64_t b) { - LDKBigSize a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKBigSize b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = BigSize_eq(&a_conv, &b_conv); - return ret_conv; +int64_t CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_err(int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_TrackedSpendableOutputDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TrackedSpendableOutputDecodeErrorZ), "LDKCResult_TrackedSpendableOutputDecodeErrorZ"); + *ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -int8_tArray CS_LDK_BigSize_write(int64_t obj) { - LDKBigSize obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = BigSize_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +jboolean CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_TrackedSpendableOutputDecodeErrorZ* o_conv = (LDKCResult_TrackedSpendableOutputDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_is_ok(o_conv); + return ret_conv; } -int64_t CS_LDK_BigSize_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_BigSizeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BigSizeDecodeErrorZ), "LDKCResult_BigSizeDecodeErrorZ"); - *ret_conv = BigSize_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_TrackedSpendableOutputDecodeErrorZ _res_conv = *(LDKCResult_TrackedSpendableOutputDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_TrackedSpendableOutputDecodeErrorZ_free(_res_conv); } -void CS_LDK_Hostname_free(int64_t this_obj) { - LDKHostname this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Hostname_free(this_obj_conv); -} - -static inline uint64_t Hostname_clone_ptr(LDKHostname *NONNULL_PTR arg) { - LDKHostname ret_var = Hostname_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +static inline uint64_t CResult_TrackedSpendableOutputDecodeErrorZ_clone_ptr(LDKCResult_TrackedSpendableOutputDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_TrackedSpendableOutputDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TrackedSpendableOutputDecodeErrorZ), "LDKCResult_TrackedSpendableOutputDecodeErrorZ"); + *ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_Hostname_clone_ptr(int64_t arg) { - LDKHostname arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = Hostname_clone_ptr(&arg_conv); +int64_t CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_TrackedSpendableOutputDecodeErrorZ* arg_conv = (LDKCResult_TrackedSpendableOutputDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_Hostname_clone(int64_t orig) { - LDKHostname orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKHostname ret_var = Hostname_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +int64_t CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_clone(int64_t orig) { + LDKCResult_TrackedSpendableOutputDecodeErrorZ* orig_conv = (LDKCResult_TrackedSpendableOutputDecodeErrorZ*)untag_ptr(orig); + LDKCResult_TrackedSpendableOutputDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TrackedSpendableOutputDecodeErrorZ), "LDKCResult_TrackedSpendableOutputDecodeErrorZ"); + *ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_Hostname_hash(int64_t o) { - LDKHostname o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = Hostname_hash(&o_conv); - return ret_conv; +int64_t CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKOutputSpendStatus o_conv = *(LDKOutputSpendStatus*)(o_ptr); + o_conv = OutputSpendStatus_clone((LDKOutputSpendStatus*)untag_ptr(o)); + LDKCResult_OutputSpendStatusDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSpendStatusDecodeErrorZ), "LDKCResult_OutputSpendStatusDecodeErrorZ"); + *ret_conv = CResult_OutputSpendStatusDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_Hostname_eq(int64_t a, int64_t b) { - LDKHostname a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKHostname b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = Hostname_eq(&a_conv, &b_conv); - return ret_conv; +int64_t CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_err(int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_OutputSpendStatusDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSpendStatusDecodeErrorZ), "LDKCResult_OutputSpendStatusDecodeErrorZ"); + *ret_conv = CResult_OutputSpendStatusDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -int8_t CS_LDK_Hostname_len(int64_t this_arg) { - LDKHostname this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_t ret_conv = Hostname_len(&this_arg_conv); +jboolean CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_OutputSpendStatusDecodeErrorZ* o_conv = (LDKCResult_OutputSpendStatusDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OutputSpendStatusDecodeErrorZ_is_ok(o_conv); return ret_conv; } -int8_tArray CS_LDK_Hostname_write(int64_t obj) { - LDKHostname obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = Hostname_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +void CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_OutputSpendStatusDecodeErrorZ _res_conv = *(LDKCResult_OutputSpendStatusDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_OutputSpendStatusDecodeErrorZ_free(_res_conv); } -int64_t CS_LDK_Hostname_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); - *ret_conv = Hostname_read(ser_ref); - FREE(ser); +static inline uint64_t CResult_OutputSpendStatusDecodeErrorZ_clone_ptr(LDKCResult_OutputSpendStatusDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OutputSpendStatusDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSpendStatusDecodeErrorZ), "LDKCResult_OutputSpendStatusDecodeErrorZ"); + *ret_conv = CResult_OutputSpendStatusDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } +int64_t CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_OutputSpendStatusDecodeErrorZ* arg_conv = (LDKCResult_OutputSpendStatusDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OutputSpendStatusDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} -void CS_LDK_TransactionU16LenLimited_free(int64_t this_obj) { - LDKTransactionU16LenLimited this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - TransactionU16LenLimited_free(this_obj_conv); +int64_t CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_clone(int64_t orig) { + LDKCResult_OutputSpendStatusDecodeErrorZ* orig_conv = (LDKCResult_OutputSpendStatusDecodeErrorZ*)untag_ptr(orig); + LDKCResult_OutputSpendStatusDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSpendStatusDecodeErrorZ), "LDKCResult_OutputSpendStatusDecodeErrorZ"); + *ret_conv = CResult_OutputSpendStatusDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -static inline uint64_t TransactionU16LenLimited_clone_ptr(LDKTransactionU16LenLimited *NONNULL_PTR arg) { - LDKTransactionU16LenLimited ret_var = TransactionU16LenLimited_clone(arg); - 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_COption_FilterZ_some(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKFilter o_conv = *(LDKFilter*)(o_ptr); + if (o_conv.free == LDKFilter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFilter_JCalls_cloned(&o_conv); + } + LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ"); + *ret_copy = COption_FilterZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_TransactionU16LenLimited_clone_ptr(int64_t arg) { - LDKTransactionU16LenLimited arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = TransactionU16LenLimited_clone_ptr(&arg_conv); - return ret_conv; -} -int64_t CS_LDK_TransactionU16LenLimited_clone(int64_t orig) { - LDKTransactionU16LenLimited orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKTransactionU16LenLimited ret_var = TransactionU16LenLimited_clone(&orig_conv); - 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_COption_FilterZ_none() { + LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ"); + *ret_copy = COption_FilterZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_TransactionU16LenLimited_hash(int64_t o) { - LDKTransactionU16LenLimited o_conv; +void CS_LDK_COption_FilterZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_FilterZ _res_conv = *(LDKCOption_FilterZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_FilterZ_free(_res_conv); +} + +void CS_LDK_CVec_TrackedSpendableOutputZ_free(int64_tArray _res) { + LDKCVec_TrackedSpendableOutputZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTrackedSpendableOutput), "LDKCVec_TrackedSpendableOutputZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = _res->elems; + for (size_t y = 0; y < _res_constr.datalen; y++) { + int64_t _res_conv_24 = _res_vals[y]; + LDKTrackedSpendableOutput _res_conv_24_conv; + _res_conv_24_conv.inner = untag_ptr(_res_conv_24); + _res_conv_24_conv.is_owned = ptr_is_owned(_res_conv_24); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_24_conv); + _res_constr.data[y] = _res_conv_24_conv; + } + FREE(_res); + CVec_TrackedSpendableOutputZ_free(_res_constr); +} + +int64_t CS_LDK_CResult_OutputSweeperDecodeErrorZ_ok(int64_t o) { + LDKOutputSweeper o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = TransactionU16LenLimited_hash(&o_conv); + // WARNING: we need a move here but no clone is available for LDKOutputSweeper + + LDKCResult_OutputSweeperDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSweeperDecodeErrorZ), "LDKCResult_OutputSweeperDecodeErrorZ"); + *ret_conv = CResult_OutputSweeperDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_OutputSweeperDecodeErrorZ_err(int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_OutputSweeperDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSweeperDecodeErrorZ), "LDKCResult_OutputSweeperDecodeErrorZ"); + *ret_conv = CResult_OutputSweeperDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_OutputSweeperDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_OutputSweeperDecodeErrorZ* o_conv = (LDKCResult_OutputSweeperDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OutputSweeperDecodeErrorZ_is_ok(o_conv); return ret_conv; } -jboolean CS_LDK_TransactionU16LenLimited_eq(int64_t a, int64_t b) { - LDKTransactionU16LenLimited a_conv; +void CS_LDK_CResult_OutputSweeperDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_OutputSweeperDecodeErrorZ _res_conv = *(LDKCResult_OutputSweeperDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_OutputSweeperDecodeErrorZ_free(_res_conv); +} + +int64_t CS_LDK_C2Tuple_BestBlockOutputSweeperZ_new(int64_t a, int64_t b) { + LDKBestBlock a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKTransactionU16LenLimited b_conv; + a_conv = BestBlock_clone(&a_conv); + LDKOutputSweeper b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = TransactionU16LenLimited_eq(&a_conv, &b_conv); - return ret_conv; + // WARNING: we need a move here but no clone is available for LDKOutputSweeper + + LDKC2Tuple_BestBlockOutputSweeperZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BestBlockOutputSweeperZ), "LDKC2Tuple_BestBlockOutputSweeperZ"); + *ret_conv = C2Tuple_BestBlockOutputSweeperZ_new(a_conv, b_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_TransactionU16LenLimited_new(int8_tArray transaction) { - LDKTransaction transaction_ref; - transaction_ref.datalen = transaction->arr_len; - transaction_ref.data = MALLOC(transaction_ref.datalen, "LDKTransaction Bytes"); - memcpy(transaction_ref.data, transaction->elems, transaction_ref.datalen); FREE(transaction); - transaction_ref.data_is_owned = true; - LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); - *ret_conv = TransactionU16LenLimited_new(transaction_ref); - return tag_ptr(ret_conv, true); +void CS_LDK_C2Tuple_BestBlockOutputSweeperZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKC2Tuple_BestBlockOutputSweeperZ _res_conv = *(LDKC2Tuple_BestBlockOutputSweeperZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_BestBlockOutputSweeperZ_free(_res_conv); } -int8_tArray CS_LDK_TransactionU16LenLimited_into_transaction(int64_t this_arg) { - LDKTransactionU16LenLimited this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = TransactionU16LenLimited_clone(&this_arg_conv); - LDKTransaction ret_var = TransactionU16LenLimited_into_transaction(this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - Transaction_free(ret_var); - return ret_arr; +int64_t CS_LDK_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_BestBlockOutputSweeperZ o_conv = *(LDKC2Tuple_BestBlockOutputSweeperZ*)(o_ptr); + // WARNING: we may need a move here but no clone is available for LDKC2Tuple_BestBlockOutputSweeperZ + LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ), "LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ"); + *ret_conv = CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -int8_tArray CS_LDK_TransactionU16LenLimited_as_transaction(int64_t this_arg) { - LDKTransactionU16LenLimited this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKTransaction ret_var = TransactionU16LenLimited_as_transaction(&this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - Transaction_free(ret_var); - return ret_arr; +int64_t CS_LDK_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_err(int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ), "LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ"); + *ret_conv = CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -int8_tArray CS_LDK_TransactionU16LenLimited_write(int64_t obj) { - LDKTransactionU16LenLimited obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = TransactionU16LenLimited_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +jboolean CS_LDK_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_is_ok(o_conv); + return ret_conv; } -int64_t CS_LDK_TransactionU16LenLimited_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); - *ret_conv = TransactionU16LenLimited_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void CS_LDK_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_free(_res_conv); } -int64_t CS_LDK_sign(int8_tArray msg, int8_tArray sk) { - LDKu8slice msg_ref; - msg_ref.datalen = msg->arr_len; - msg_ref.data = msg->elems; - uint8_t sk_arr[32]; - CHECK(sk->arr_len == 32); - memcpy(sk_arr, sk->elems, 32); FREE(sk); - uint8_t (*sk_ref)[32] = &sk_arr; - LDKCResult_StrSecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StrSecp256k1ErrorZ), "LDKCResult_StrSecp256k1ErrorZ"); - *ret_conv = sign(msg_ref, sk_ref); - FREE(msg); +int64_t CS_LDK_CResult_DelayedPaymentBasepointDecodeErrorZ_ok(int64_t o) { + LDKDelayedPaymentBasepoint o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = DelayedPaymentBasepoint_clone(&o_conv); + LDKCResult_DelayedPaymentBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentBasepointDecodeErrorZ), "LDKCResult_DelayedPaymentBasepointDecodeErrorZ"); + *ret_conv = CResult_DelayedPaymentBasepointDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_recover_pk(int8_tArray msg, jstring sig) { - LDKu8slice msg_ref; - msg_ref.datalen = msg->arr_len; - msg_ref.data = msg->elems; - LDKStr sig_conv = str_ref_to_owned_c(sig); - LDKCResult_PublicKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecp256k1ErrorZ), "LDKCResult_PublicKeySecp256k1ErrorZ"); - *ret_conv = recover_pk(msg_ref, sig_conv); - FREE(msg); +int64_t CS_LDK_CResult_DelayedPaymentBasepointDecodeErrorZ_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_DelayedPaymentBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentBasepointDecodeErrorZ), "LDKCResult_DelayedPaymentBasepointDecodeErrorZ"); + *ret_conv = CResult_DelayedPaymentBasepointDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_verify(int8_tArray msg, jstring sig, int8_tArray pk) { - LDKu8slice msg_ref; - msg_ref.datalen = msg->arr_len; - msg_ref.data = msg->elems; - LDKStr sig_conv = str_ref_to_owned_c(sig); - LDKPublicKey pk_ref; - CHECK(pk->arr_len == 33); - memcpy(pk_ref.compressed_form, pk->elems, 33); FREE(pk); - jboolean ret_conv = verify(msg_ref, sig_conv, pk_ref); - FREE(msg); +jboolean CS_LDK_CResult_DelayedPaymentBasepointDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_DelayedPaymentBasepointDecodeErrorZ* o_conv = (LDKCResult_DelayedPaymentBasepointDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_DelayedPaymentBasepointDecodeErrorZ_is_ok(o_conv); 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_CResult_DelayedPaymentBasepointDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_DelayedPaymentBasepointDecodeErrorZ _res_conv = *(LDKCResult_DelayedPaymentBasepointDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_DelayedPaymentBasepointDecodeErrorZ_free(_res_conv); } -void CS_LDK_KVStore_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); - LDKKVStore this_ptr_conv = *(LDKKVStore*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - KVStore_free(this_ptr_conv); +static inline uint64_t CResult_DelayedPaymentBasepointDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentBasepointDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_DelayedPaymentBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentBasepointDecodeErrorZ), "LDKCResult_DelayedPaymentBasepointDecodeErrorZ"); + *ret_conv = CResult_DelayedPaymentBasepointDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_DelayedPaymentBasepointDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_DelayedPaymentBasepointDecodeErrorZ* arg_conv = (LDKCResult_DelayedPaymentBasepointDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_DelayedPaymentBasepointDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; } -void CS_LDK_Persister_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); - LDKPersister this_ptr_conv = *(LDKPersister*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Persister_free(this_ptr_conv); +int64_t CS_LDK_CResult_DelayedPaymentBasepointDecodeErrorZ_clone(int64_t orig) { + LDKCResult_DelayedPaymentBasepointDecodeErrorZ* orig_conv = (LDKCResult_DelayedPaymentBasepointDecodeErrorZ*)untag_ptr(orig); + LDKCResult_DelayedPaymentBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentBasepointDecodeErrorZ), "LDKCResult_DelayedPaymentBasepointDecodeErrorZ"); + *ret_conv = CResult_DelayedPaymentBasepointDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_read_channel_monitors(int64_t kv_store, int64_t entropy_source, int64_t signer_provider) { - void* kv_store_ptr = untag_ptr(kv_store); - CHECK_ACCESS(kv_store_ptr); - LDKKVStore kv_store_conv = *(LDKKVStore*)(kv_store_ptr); - if (kv_store_conv.free == LDKKVStore_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKKVStore_JCalls_cloned(&kv_store_conv); - } - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - void* signer_provider_ptr = untag_ptr(signer_provider); - CHECK_ACCESS(signer_provider_ptr); - LDKSignerProvider signer_provider_conv = *(LDKSignerProvider*)(signer_provider_ptr); - if (signer_provider_conv.free == LDKSignerProvider_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKSignerProvider_JCalls_cloned(&signer_provider_conv); - } - LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ), "LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ"); - *ret_conv = read_channel_monitors(kv_store_conv, entropy_source_conv, signer_provider_conv); +int64_t CS_LDK_CResult_DelayedPaymentKeyDecodeErrorZ_ok(int64_t o) { + LDKDelayedPaymentKey o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = DelayedPaymentKey_clone(&o_conv); + LDKCResult_DelayedPaymentKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentKeyDecodeErrorZ), "LDKCResult_DelayedPaymentKeyDecodeErrorZ"); + *ret_conv = CResult_DelayedPaymentKeyDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -void CS_LDK_MonitorUpdatingPersister_free(int64_t this_obj) { - LDKMonitorUpdatingPersister this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - MonitorUpdatingPersister_free(this_obj_conv); +int64_t CS_LDK_CResult_DelayedPaymentKeyDecodeErrorZ_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_DelayedPaymentKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentKeyDecodeErrorZ), "LDKCResult_DelayedPaymentKeyDecodeErrorZ"); + *ret_conv = CResult_DelayedPaymentKeyDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -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) { - void* kv_store_ptr = untag_ptr(kv_store); - CHECK_ACCESS(kv_store_ptr); - LDKKVStore kv_store_conv = *(LDKKVStore*)(kv_store_ptr); - if (kv_store_conv.free == LDKKVStore_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKKVStore_JCalls_cloned(&kv_store_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - void* signer_provider_ptr = untag_ptr(signer_provider); - CHECK_ACCESS(signer_provider_ptr); - LDKSignerProvider signer_provider_conv = *(LDKSignerProvider*)(signer_provider_ptr); - if (signer_provider_conv.free == LDKSignerProvider_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKSignerProvider_JCalls_cloned(&signer_provider_conv); - } - LDKMonitorUpdatingPersister ret_var = MonitorUpdatingPersister_new(kv_store_conv, logger_conv, maximum_pending_updates, entropy_source_conv, signer_provider_conv); - int64_t ret_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_CResult_DelayedPaymentKeyDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_DelayedPaymentKeyDecodeErrorZ* o_conv = (LDKCResult_DelayedPaymentKeyDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_DelayedPaymentKeyDecodeErrorZ_is_ok(o_conv); + return ret_conv; } -int64_t CS_LDK_MonitorUpdatingPersister_read_all_channel_monitors_with_updates(int64_t this_arg, int64_t broadcaster, int64_t fee_estimator) { - LDKMonitorUpdatingPersister this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - void* broadcaster_ptr = untag_ptr(broadcaster); - if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); } - LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; - void* fee_estimator_ptr = untag_ptr(fee_estimator); - if (ptr_is_owned(fee_estimator)) { CHECK_ACCESS(fee_estimator_ptr); } - LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; - LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ), "LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ"); - *ret_conv = MonitorUpdatingPersister_read_all_channel_monitors_with_updates(&this_arg_conv, broadcaster_conv, fee_estimator_conv); - return tag_ptr(ret_conv, true); +void CS_LDK_CResult_DelayedPaymentKeyDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_DelayedPaymentKeyDecodeErrorZ _res_conv = *(LDKCResult_DelayedPaymentKeyDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_DelayedPaymentKeyDecodeErrorZ_free(_res_conv); } -int64_t CS_LDK_MonitorUpdatingPersister_read_channel_monitor_with_updates(int64_t this_arg, int64_t broadcaster, int64_t fee_estimator, jstring monitor_key) { - LDKMonitorUpdatingPersister this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - void* broadcaster_ptr = untag_ptr(broadcaster); - if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); } - LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; - void* fee_estimator_ptr = untag_ptr(fee_estimator); - if (ptr_is_owned(fee_estimator)) { CHECK_ACCESS(fee_estimator_ptr); } - LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; - LDKStr monitor_key_conv = str_ref_to_owned_c(monitor_key); - LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ), "LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ"); - *ret_conv = MonitorUpdatingPersister_read_channel_monitor_with_updates(&this_arg_conv, broadcaster_conv, fee_estimator_conv, monitor_key_conv); +static inline uint64_t CResult_DelayedPaymentKeyDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentKeyDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_DelayedPaymentKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentKeyDecodeErrorZ), "LDKCResult_DelayedPaymentKeyDecodeErrorZ"); + *ret_conv = CResult_DelayedPaymentKeyDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } +int64_t CS_LDK_CResult_DelayedPaymentKeyDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_DelayedPaymentKeyDecodeErrorZ* arg_conv = (LDKCResult_DelayedPaymentKeyDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_DelayedPaymentKeyDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} -int64_t CS_LDK_MonitorUpdatingPersister_cleanup_stale_updates(int64_t this_arg, jboolean lazy) { - LDKMonitorUpdatingPersister this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneIOErrorZ), "LDKCResult_NoneIOErrorZ"); - *ret_conv = MonitorUpdatingPersister_cleanup_stale_updates(&this_arg_conv, lazy); +int64_t CS_LDK_CResult_DelayedPaymentKeyDecodeErrorZ_clone(int64_t orig) { + LDKCResult_DelayedPaymentKeyDecodeErrorZ* orig_conv = (LDKCResult_DelayedPaymentKeyDecodeErrorZ*)untag_ptr(orig); + LDKCResult_DelayedPaymentKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentKeyDecodeErrorZ), "LDKCResult_DelayedPaymentKeyDecodeErrorZ"); + *ret_conv = CResult_DelayedPaymentKeyDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_MonitorUpdatingPersister_as_Persist(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; - LDKPersist* ret_ret = MALLOC(sizeof(LDKPersist), "LDKPersist"); - *ret_ret = MonitorUpdatingPersister_as_Persist(&this_arg_conv); - return tag_ptr(ret_ret, true); +int64_t CS_LDK_CResult_HtlcBasepointDecodeErrorZ_ok(int64_t o) { + LDKHtlcBasepoint o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = HtlcBasepoint_clone(&o_conv); + LDKCResult_HtlcBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcBasepointDecodeErrorZ), "LDKCResult_HtlcBasepointDecodeErrorZ"); + *ret_conv = CResult_HtlcBasepointDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -int32_t CS_LDK_ShortChannelIdError_clone(int64_t orig) { - LDKShortChannelIdError* orig_conv = (LDKShortChannelIdError*)untag_ptr(orig); - int32_t ret_conv = LDKShortChannelIdError_to_cs(ShortChannelIdError_clone(orig_conv)); - return ret_conv; +int64_t CS_LDK_CResult_HtlcBasepointDecodeErrorZ_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_HtlcBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcBasepointDecodeErrorZ), "LDKCResult_HtlcBasepointDecodeErrorZ"); + *ret_conv = CResult_HtlcBasepointDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -int32_t CS_LDK_ShortChannelIdError_block_overflow() { - int32_t ret_conv = LDKShortChannelIdError_to_cs(ShortChannelIdError_block_overflow()); +jboolean CS_LDK_CResult_HtlcBasepointDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_HtlcBasepointDecodeErrorZ* o_conv = (LDKCResult_HtlcBasepointDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_HtlcBasepointDecodeErrorZ_is_ok(o_conv); return ret_conv; } -int32_t CS_LDK_ShortChannelIdError_tx_index_overflow() { - int32_t ret_conv = LDKShortChannelIdError_to_cs(ShortChannelIdError_tx_index_overflow()); - return ret_conv; +void CS_LDK_CResult_HtlcBasepointDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_HtlcBasepointDecodeErrorZ _res_conv = *(LDKCResult_HtlcBasepointDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_HtlcBasepointDecodeErrorZ_free(_res_conv); } -int32_t CS_LDK_ShortChannelIdError_vout_index_overflow() { - int32_t ret_conv = LDKShortChannelIdError_to_cs(ShortChannelIdError_vout_index_overflow()); +static inline uint64_t CResult_HtlcBasepointDecodeErrorZ_clone_ptr(LDKCResult_HtlcBasepointDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HtlcBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcBasepointDecodeErrorZ), "LDKCResult_HtlcBasepointDecodeErrorZ"); + *ret_conv = CResult_HtlcBasepointDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_HtlcBasepointDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_HtlcBasepointDecodeErrorZ* arg_conv = (LDKCResult_HtlcBasepointDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_HtlcBasepointDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -jboolean CS_LDK_ShortChannelIdError_eq(int64_t a, int64_t b) { - LDKShortChannelIdError* a_conv = (LDKShortChannelIdError*)untag_ptr(a); - LDKShortChannelIdError* b_conv = (LDKShortChannelIdError*)untag_ptr(b); - jboolean ret_conv = ShortChannelIdError_eq(a_conv, b_conv); - return ret_conv; +int64_t CS_LDK_CResult_HtlcBasepointDecodeErrorZ_clone(int64_t orig) { + LDKCResult_HtlcBasepointDecodeErrorZ* orig_conv = (LDKCResult_HtlcBasepointDecodeErrorZ*)untag_ptr(orig); + LDKCResult_HtlcBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcBasepointDecodeErrorZ), "LDKCResult_HtlcBasepointDecodeErrorZ"); + *ret_conv = CResult_HtlcBasepointDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -int32_t CS_LDK_block_from_scid(int64_t short_channel_id) { - int32_t ret_conv = block_from_scid(short_channel_id); - return ret_conv; +int64_t CS_LDK_CResult_HtlcKeyDecodeErrorZ_ok(int64_t o) { + LDKHtlcKey o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = HtlcKey_clone(&o_conv); + LDKCResult_HtlcKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcKeyDecodeErrorZ), "LDKCResult_HtlcKeyDecodeErrorZ"); + *ret_conv = CResult_HtlcKeyDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -int32_t CS_LDK_tx_index_from_scid(int64_t short_channel_id) { - int32_t ret_conv = tx_index_from_scid(short_channel_id); - return ret_conv; +int64_t CS_LDK_CResult_HtlcKeyDecodeErrorZ_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_HtlcKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcKeyDecodeErrorZ), "LDKCResult_HtlcKeyDecodeErrorZ"); + *ret_conv = CResult_HtlcKeyDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -int16_t CS_LDK_vout_from_scid(int64_t short_channel_id) { - int16_t ret_conv = vout_from_scid(short_channel_id); +jboolean CS_LDK_CResult_HtlcKeyDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_HtlcKeyDecodeErrorZ* o_conv = (LDKCResult_HtlcKeyDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_HtlcKeyDecodeErrorZ_is_ok(o_conv); return ret_conv; } -int64_t CS_LDK_scid_from_parts(int64_t block, int64_t tx_index, int64_t vout_index) { - LDKCResult_u64ShortChannelIdErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u64ShortChannelIdErrorZ), "LDKCResult_u64ShortChannelIdErrorZ"); - *ret_conv = scid_from_parts(block, tx_index, vout_index); - return tag_ptr(ret_conv, true); +void CS_LDK_CResult_HtlcKeyDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_HtlcKeyDecodeErrorZ _res_conv = *(LDKCResult_HtlcKeyDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_HtlcKeyDecodeErrorZ_free(_res_conv); } -void 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); +static inline uint64_t CResult_HtlcKeyDecodeErrorZ_clone_ptr(LDKCResult_HtlcKeyDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HtlcKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcKeyDecodeErrorZ), "LDKCResult_HtlcKeyDecodeErrorZ"); + *ret_conv = CResult_HtlcKeyDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); } - -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); +int64_t CS_LDK_CResult_HtlcKeyDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_HtlcKeyDecodeErrorZ* arg_conv = (LDKCResult_HtlcKeyDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_HtlcKeyDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -void 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_CResult_HtlcKeyDecodeErrorZ_clone(int64_t orig) { + LDKCResult_HtlcKeyDecodeErrorZ* orig_conv = (LDKCResult_HtlcKeyDecodeErrorZ*)untag_ptr(orig); + LDKCResult_HtlcKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcKeyDecodeErrorZ), "LDKCResult_HtlcKeyDecodeErrorZ"); + *ret_conv = CResult_HtlcKeyDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -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; +int64_t CS_LDK_CResult_RevocationBasepointDecodeErrorZ_ok(int64_t o) { + LDKRevocationBasepoint o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = RevocationBasepoint_clone(&o_conv); + LDKCResult_RevocationBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationBasepointDecodeErrorZ), "LDKCResult_RevocationBasepointDecodeErrorZ"); + *ret_conv = CResult_RevocationBasepointDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -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_CResult_RevocationBasepointDecodeErrorZ_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_RevocationBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationBasepointDecodeErrorZ), "LDKCResult_RevocationBasepointDecodeErrorZ"); + *ret_conv = CResult_RevocationBasepointDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -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); + +jboolean CS_LDK_CResult_RevocationBasepointDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_RevocationBasepointDecodeErrorZ* o_conv = (LDKCResult_RevocationBasepointDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_RevocationBasepointDecodeErrorZ_is_ok(o_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; +void CS_LDK_CResult_RevocationBasepointDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_RevocationBasepointDecodeErrorZ _res_conv = *(LDKCResult_RevocationBasepointDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_RevocationBasepointDecodeErrorZ_free(_res_conv); } -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); +static inline uint64_t CResult_RevocationBasepointDecodeErrorZ_clone_ptr(LDKCResult_RevocationBasepointDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RevocationBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationBasepointDecodeErrorZ), "LDKCResult_RevocationBasepointDecodeErrorZ"); + *ret_conv = CResult_RevocationBasepointDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_RevocationBasepointDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_RevocationBasepointDecodeErrorZ* arg_conv = (LDKCResult_RevocationBasepointDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_RevocationBasepointDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_UntrustedString_hash(int64_t o) { - LDKUntrustedString o_conv; +int64_t CS_LDK_CResult_RevocationBasepointDecodeErrorZ_clone(int64_t orig) { + LDKCResult_RevocationBasepointDecodeErrorZ* orig_conv = (LDKCResult_RevocationBasepointDecodeErrorZ*)untag_ptr(orig); + LDKCResult_RevocationBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationBasepointDecodeErrorZ), "LDKCResult_RevocationBasepointDecodeErrorZ"); + *ret_conv = CResult_RevocationBasepointDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_RevocationKeyDecodeErrorZ_ok(int64_t o) { + LDKRevocationKey o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = UntrustedString_hash(&o_conv); - return ret_conv; + o_conv = RevocationKey_clone(&o_conv); + LDKCResult_RevocationKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationKeyDecodeErrorZ), "LDKCResult_RevocationKeyDecodeErrorZ"); + *ret_conv = CResult_RevocationKeyDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -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_CResult_RevocationKeyDecodeErrorZ_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_RevocationKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationKeyDecodeErrorZ), "LDKCResult_RevocationKeyDecodeErrorZ"); + *ret_conv = CResult_RevocationKeyDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -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); +jboolean CS_LDK_CResult_RevocationKeyDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_RevocationKeyDecodeErrorZ* o_conv = (LDKCResult_RevocationKeyDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_RevocationKeyDecodeErrorZ_is_ok(o_conv); + 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); +void CS_LDK_CResult_RevocationKeyDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_RevocationKeyDecodeErrorZ _res_conv = *(LDKCResult_RevocationKeyDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_RevocationKeyDecodeErrorZ_free(_res_conv); } -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); +static inline uint64_t CResult_RevocationKeyDecodeErrorZ_clone_ptr(LDKCResult_RevocationKeyDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RevocationKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationKeyDecodeErrorZ), "LDKCResult_RevocationKeyDecodeErrorZ"); + *ret_conv = CResult_RevocationKeyDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_RevocationKeyDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_RevocationKeyDecodeErrorZ* arg_conv = (LDKCResult_RevocationKeyDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_RevocationKeyDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -void 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_CResult_RevocationKeyDecodeErrorZ_clone(int64_t orig) { + LDKCResult_RevocationKeyDecodeErrorZ* orig_conv = (LDKCResult_RevocationKeyDecodeErrorZ*)untag_ptr(orig); + LDKCResult_RevocationKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationKeyDecodeErrorZ), "LDKCResult_RevocationKeyDecodeErrorZ"); + *ret_conv = CResult_RevocationKeyDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -int64_t 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; +int64_t CS_LDK_CResult_LockedChannelMonitorNoneZ_ok(int64_t o) { + LDKLockedChannelMonitor o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + // WARNING: we need a move here but no clone is available for LDKLockedChannelMonitor + + LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); + *ret_conv = CResult_LockedChannelMonitorNoneZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -void CS_LDK_TrackedSpendableOutput_free(int64_t this_obj) { - LDKTrackedSpendableOutput this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - TrackedSpendableOutput_free(this_obj_conv); +int64_t CS_LDK_CResult_LockedChannelMonitorNoneZ_err() { + LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); + *ret_conv = CResult_LockedChannelMonitorNoneZ_err(); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_TrackedSpendableOutput_get_descriptor(int64_t this_ptr) { - LDKTrackedSpendableOutput this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_copy = TrackedSpendableOutput_get_descriptor(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_CResult_LockedChannelMonitorNoneZ_is_ok(int64_t o) { + LDKCResult_LockedChannelMonitorNoneZ* o_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_LockedChannelMonitorNoneZ_is_ok(o_conv); + return ret_conv; } -void CS_LDK_TrackedSpendableOutput_set_descriptor(int64_t this_ptr, int64_t val) { - LDKTrackedSpendableOutput this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKSpendableOutputDescriptor val_conv = *(LDKSpendableOutputDescriptor*)(val_ptr); - val_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(val)); - TrackedSpendableOutput_set_descriptor(&this_ptr_conv, val_conv); +void CS_LDK_CResult_LockedChannelMonitorNoneZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_LockedChannelMonitorNoneZ _res_conv = *(LDKCResult_LockedChannelMonitorNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_LockedChannelMonitorNoneZ_free(_res_conv); } -int64_t CS_LDK_TrackedSpendableOutput_get_channel_id(int64_t this_ptr) { - LDKTrackedSpendableOutput this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelId ret_var = TrackedSpendableOutput_get_channel_id(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +static inline uint64_t C2Tuple_OutPointChannelIdZ_clone_ptr(LDKC2Tuple_OutPointChannelIdZ *NONNULL_PTR arg) { + LDKC2Tuple_OutPointChannelIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointChannelIdZ), "LDKC2Tuple_OutPointChannelIdZ"); + *ret_conv = C2Tuple_OutPointChannelIdZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_C2Tuple_OutPointChannelIdZ_clone_ptr(int64_t arg) { + LDKC2Tuple_OutPointChannelIdZ* arg_conv = (LDKC2Tuple_OutPointChannelIdZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_OutPointChannelIdZ_clone_ptr(arg_conv); + return ret_conv; } -void CS_LDK_TrackedSpendableOutput_set_channel_id(int64_t this_ptr, int64_t val) { - LDKTrackedSpendableOutput this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelId val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelId_clone(&val_conv); - TrackedSpendableOutput_set_channel_id(&this_ptr_conv, val_conv); +int64_t CS_LDK_C2Tuple_OutPointChannelIdZ_clone(int64_t orig) { + LDKC2Tuple_OutPointChannelIdZ* orig_conv = (LDKC2Tuple_OutPointChannelIdZ*)untag_ptr(orig); + LDKC2Tuple_OutPointChannelIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointChannelIdZ), "LDKC2Tuple_OutPointChannelIdZ"); + *ret_conv = C2Tuple_OutPointChannelIdZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_TrackedSpendableOutput_get_status(int64_t this_ptr) { - LDKTrackedSpendableOutput this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); - *ret_copy = TrackedSpendableOutput_get_status(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_C2Tuple_OutPointChannelIdZ_new(int64_t a, int64_t b) { + LDKOutPoint a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = OutPoint_clone(&a_conv); + LDKChannelId b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv = ChannelId_clone(&b_conv); + LDKC2Tuple_OutPointChannelIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointChannelIdZ), "LDKC2Tuple_OutPointChannelIdZ"); + *ret_conv = C2Tuple_OutPointChannelIdZ_new(a_conv, b_conv); + return tag_ptr(ret_conv, true); } -void CS_LDK_TrackedSpendableOutput_set_status(int64_t this_ptr, int64_t val) { - LDKTrackedSpendableOutput this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKOutputSpendStatus val_conv = *(LDKOutputSpendStatus*)(val_ptr); - val_conv = OutputSpendStatus_clone((LDKOutputSpendStatus*)untag_ptr(val)); - TrackedSpendableOutput_set_status(&this_ptr_conv, val_conv); +void CS_LDK_C2Tuple_OutPointChannelIdZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKC2Tuple_OutPointChannelIdZ _res_conv = *(LDKC2Tuple_OutPointChannelIdZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_OutPointChannelIdZ_free(_res_conv); } -int64_t CS_LDK_TrackedSpendableOutput_new(int64_t descriptor_arg, int64_t channel_id_arg, int64_t status_arg) { - void* descriptor_arg_ptr = untag_ptr(descriptor_arg); - CHECK_ACCESS(descriptor_arg_ptr); - LDKSpendableOutputDescriptor descriptor_arg_conv = *(LDKSpendableOutputDescriptor*)(descriptor_arg_ptr); - descriptor_arg_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(descriptor_arg)); - LDKChannelId channel_id_arg_conv; - channel_id_arg_conv.inner = untag_ptr(channel_id_arg); - channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); - channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); - void* status_arg_ptr = untag_ptr(status_arg); - CHECK_ACCESS(status_arg_ptr); - LDKOutputSpendStatus status_arg_conv = *(LDKOutputSpendStatus*)(status_arg_ptr); - status_arg_conv = OutputSpendStatus_clone((LDKOutputSpendStatus*)untag_ptr(status_arg)); - LDKTrackedSpendableOutput ret_var = TrackedSpendableOutput_new(descriptor_arg_conv, channel_id_arg_conv, status_arg_conv); +void CS_LDK_CVec_C2Tuple_OutPointChannelIdZZ_free(int64_tArray _res) { + LDKCVec_C2Tuple_OutPointChannelIdZZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OutPointChannelIdZ), "LDKCVec_C2Tuple_OutPointChannelIdZZ 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_29 = _res_vals[d]; + void* _res_conv_29_ptr = untag_ptr(_res_conv_29); + CHECK_ACCESS(_res_conv_29_ptr); + LDKC2Tuple_OutPointChannelIdZ _res_conv_29_conv = *(LDKC2Tuple_OutPointChannelIdZ*)(_res_conv_29_ptr); + FREE(untag_ptr(_res_conv_29)); + _res_constr.data[d] = _res_conv_29_conv; + } + FREE(_res); + CVec_C2Tuple_OutPointChannelIdZZ_free(_res_constr); +} + +void 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); + 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); + 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); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_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; + b_constr.datalen = b->arr_len; + if (b_constr.datalen > 0) + b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKMonitorUpdateId), "LDKCVec_MonitorUpdateIdZ Elements"); + else + b_constr.data = NULL; + 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; + } + FREE(b); + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ"); + *ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(a_conv, b_constr); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_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); + FREE(untag_ptr(_res)); + C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(_res_conv); +} + +void CS_LDK_CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(int64_tArray _res) { + LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ Elements"); + else + _res_constr.data = NULL; + 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; + } + FREE(_res); + CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(_res_constr); +} + +void CS_LDK_APIError_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); + LDKAPIError this_ptr_conv = *(LDKAPIError*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + APIError_free(this_ptr_conv); +} + +static inline uint64_t APIError_clone_ptr(LDKAPIError *NONNULL_PTR arg) { + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_APIError_clone_ptr(int64_t arg) { + LDKAPIError* arg_conv = (LDKAPIError*)untag_ptr(arg); + int64_t ret_conv = APIError_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_APIError_clone(int64_t orig) { + LDKAPIError* orig_conv = (LDKAPIError*)untag_ptr(orig); + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_APIError_apimisuse_error(jstring err) { + LDKStr err_conv = str_ref_to_owned_c(err); + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_apimisuse_error(err_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_APIError_fee_rate_too_high(jstring err, int32_t feerate) { + LDKStr err_conv = str_ref_to_owned_c(err); + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_fee_rate_too_high(err_conv, feerate); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_APIError_invalid_route(jstring err) { + LDKStr err_conv = str_ref_to_owned_c(err); + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_invalid_route(err_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_APIError_channel_unavailable(jstring err) { + LDKStr err_conv = str_ref_to_owned_c(err); + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_channel_unavailable(err_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_APIError_monitor_update_in_progress() { + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_monitor_update_in_progress(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_APIError_incompatible_shutdown_script(int64_t script) { + LDKShutdownScript script_conv; + script_conv.inner = untag_ptr(script); + script_conv.is_owned = ptr_is_owned(script); + CHECK_INNER_FIELD_ACCESS_OR_NULL(script_conv); + script_conv = ShutdownScript_clone(&script_conv); + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_incompatible_shutdown_script(script_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +jboolean CS_LDK_APIError_eq(int64_t a, int64_t b) { + LDKAPIError* a_conv = (LDKAPIError*)untag_ptr(a); + LDKAPIError* b_conv = (LDKAPIError*)untag_ptr(b); + jboolean ret_conv = APIError_eq(a_conv, b_conv); + return ret_conv; +} + +int8_tArray CS_LDK_APIError_write(int64_t obj) { + LDKAPIError* obj_conv = (LDKAPIError*)untag_ptr(obj); + LDKCVec_u8Z ret_var = APIError_write(obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_APIError_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_COption_APIErrorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_APIErrorZDecodeErrorZ), "LDKCResult_COption_APIErrorZDecodeErrorZ"); + *ret_conv = APIError_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_BigSize_free(int64_t this_obj) { + LDKBigSize this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + BigSize_free(this_obj_conv); +} + +int64_t CS_LDK_BigSize_get_a(int64_t this_ptr) { + LDKBigSize this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = BigSize_get_a(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_BigSize_set_a(int64_t this_ptr, int64_t val) { + LDKBigSize this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + BigSize_set_a(&this_ptr_conv, val); +} + +int64_t CS_LDK_BigSize_new(int64_t a_arg) { + LDKBigSize ret_var = BigSize_new(a_arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t TrackedSpendableOutput_clone_ptr(LDKTrackedSpendableOutput *NONNULL_PTR arg) { - LDKTrackedSpendableOutput ret_var = TrackedSpendableOutput_clone(arg); +static inline uint64_t BigSize_clone_ptr(LDKBigSize *NONNULL_PTR arg) { + LDKBigSize ret_var = BigSize_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_TrackedSpendableOutput_clone_ptr(int64_t arg) { - LDKTrackedSpendableOutput arg_conv; +int64_t CS_LDK_BigSize_clone_ptr(int64_t arg) { + LDKBigSize arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = TrackedSpendableOutput_clone_ptr(&arg_conv); + int64_t ret_conv = BigSize_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_TrackedSpendableOutput_clone(int64_t orig) { - LDKTrackedSpendableOutput orig_conv; +int64_t CS_LDK_BigSize_clone(int64_t orig) { + LDKBigSize orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKTrackedSpendableOutput ret_var = TrackedSpendableOutput_clone(&orig_conv); + LDKBigSize ret_var = BigSize_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -jboolean CS_LDK_TrackedSpendableOutput_eq(int64_t a, int64_t b) { - LDKTrackedSpendableOutput a_conv; +int64_t CS_LDK_BigSize_hash(int64_t o) { + LDKBigSize o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = BigSize_hash(&o_conv); + return ret_conv; +} + +jboolean CS_LDK_BigSize_eq(int64_t a, int64_t b) { + LDKBigSize a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKTrackedSpendableOutput b_conv; + LDKBigSize b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = TrackedSpendableOutput_eq(&a_conv, &b_conv); - return ret_conv; -} - -jboolean CS_LDK_TrackedSpendableOutput_is_spent_in(int64_t this_arg, int8_tArray tx) { - LDKTrackedSpendableOutput this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKTransaction tx_ref; - tx_ref.datalen = tx->arr_len; - tx_ref.data = MALLOC(tx_ref.datalen, "LDKTransaction Bytes"); - memcpy(tx_ref.data, tx->elems, tx_ref.datalen); FREE(tx); - tx_ref.data_is_owned = true; - jboolean ret_conv = TrackedSpendableOutput_is_spent_in(&this_arg_conv, tx_ref); + jboolean ret_conv = BigSize_eq(&a_conv, &b_conv); return ret_conv; } -int8_tArray CS_LDK_TrackedSpendableOutput_write(int64_t obj) { - LDKTrackedSpendableOutput obj_conv; +int8_tArray CS_LDK_BigSize_write(int64_t obj) { + LDKBigSize obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = TrackedSpendableOutput_write(&obj_conv); + LDKCVec_u8Z ret_var = BigSize_write(&obj_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_TrackedSpendableOutput_read(int8_tArray ser) { +int64_t CS_LDK_BigSize_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_TrackedSpendableOutputDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TrackedSpendableOutputDecodeErrorZ), "LDKCResult_TrackedSpendableOutputDecodeErrorZ"); - *ret_conv = TrackedSpendableOutput_read(ser_ref); + LDKCResult_BigSizeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BigSizeDecodeErrorZ), "LDKCResult_BigSizeDecodeErrorZ"); + *ret_conv = BigSize_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_OutputSpendStatus_free(int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKOutputSpendStatus this_ptr_conv = *(LDKOutputSpendStatus*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - OutputSpendStatus_free(this_ptr_conv); +void CS_LDK_Hostname_free(int64_t this_obj) { + LDKHostname this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Hostname_free(this_obj_conv); } -static inline uint64_t OutputSpendStatus_clone_ptr(LDKOutputSpendStatus *NONNULL_PTR arg) { - LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); - *ret_copy = OutputSpendStatus_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); +static inline uint64_t Hostname_clone_ptr(LDKHostname *NONNULL_PTR arg) { + LDKHostname ret_var = Hostname_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_OutputSpendStatus_clone_ptr(int64_t arg) { - LDKOutputSpendStatus* arg_conv = (LDKOutputSpendStatus*)untag_ptr(arg); - int64_t ret_conv = OutputSpendStatus_clone_ptr(arg_conv); +int64_t CS_LDK_Hostname_clone_ptr(int64_t arg) { + LDKHostname arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = Hostname_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_OutputSpendStatus_clone(int64_t orig) { - LDKOutputSpendStatus* orig_conv = (LDKOutputSpendStatus*)untag_ptr(orig); - LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); - *ret_copy = OutputSpendStatus_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +int64_t CS_LDK_Hostname_clone(int64_t orig) { + LDKHostname orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKHostname ret_var = Hostname_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_OutputSpendStatus_pending_initial_broadcast(int64_t delayed_until_height) { - void* delayed_until_height_ptr = untag_ptr(delayed_until_height); - CHECK_ACCESS(delayed_until_height_ptr); - LDKCOption_u32Z delayed_until_height_conv = *(LDKCOption_u32Z*)(delayed_until_height_ptr); - delayed_until_height_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(delayed_until_height)); - LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); - *ret_copy = OutputSpendStatus_pending_initial_broadcast(delayed_until_height_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_Hostname_hash(int64_t o) { + LDKHostname o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = Hostname_hash(&o_conv); + return ret_conv; } -int64_t CS_LDK_OutputSpendStatus_pending_first_confirmation(int8_tArray first_broadcast_hash, int32_t latest_broadcast_height, int8_tArray latest_spending_tx) { - LDKThirtyTwoBytes first_broadcast_hash_ref; - CHECK(first_broadcast_hash->arr_len == 32); - memcpy(first_broadcast_hash_ref.data, first_broadcast_hash->elems, 32); FREE(first_broadcast_hash); - LDKTransaction latest_spending_tx_ref; - latest_spending_tx_ref.datalen = latest_spending_tx->arr_len; - latest_spending_tx_ref.data = MALLOC(latest_spending_tx_ref.datalen, "LDKTransaction Bytes"); - memcpy(latest_spending_tx_ref.data, latest_spending_tx->elems, latest_spending_tx_ref.datalen); FREE(latest_spending_tx); - latest_spending_tx_ref.data_is_owned = true; - LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); - *ret_copy = OutputSpendStatus_pending_first_confirmation(first_broadcast_hash_ref, latest_broadcast_height, latest_spending_tx_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_Hostname_eq(int64_t a, int64_t b) { + LDKHostname a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKHostname b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = Hostname_eq(&a_conv, &b_conv); + return ret_conv; } -int64_t CS_LDK_OutputSpendStatus_pending_threshold_confirmations(int8_tArray first_broadcast_hash, int32_t latest_broadcast_height, int8_tArray latest_spending_tx, int32_t confirmation_height, int8_tArray confirmation_hash) { - LDKThirtyTwoBytes first_broadcast_hash_ref; - CHECK(first_broadcast_hash->arr_len == 32); - memcpy(first_broadcast_hash_ref.data, first_broadcast_hash->elems, 32); FREE(first_broadcast_hash); - LDKTransaction latest_spending_tx_ref; - latest_spending_tx_ref.datalen = latest_spending_tx->arr_len; - latest_spending_tx_ref.data = MALLOC(latest_spending_tx_ref.datalen, "LDKTransaction Bytes"); - memcpy(latest_spending_tx_ref.data, latest_spending_tx->elems, latest_spending_tx_ref.datalen); FREE(latest_spending_tx); - latest_spending_tx_ref.data_is_owned = true; - LDKThirtyTwoBytes confirmation_hash_ref; - CHECK(confirmation_hash->arr_len == 32); - memcpy(confirmation_hash_ref.data, confirmation_hash->elems, 32); FREE(confirmation_hash); - LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); - *ret_copy = OutputSpendStatus_pending_threshold_confirmations(first_broadcast_hash_ref, latest_broadcast_height, latest_spending_tx_ref, confirmation_height, confirmation_hash_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int8_t CS_LDK_Hostname_len(int64_t this_arg) { + LDKHostname this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int8_t ret_conv = Hostname_len(&this_arg_conv); + return ret_conv; } -jboolean CS_LDK_OutputSpendStatus_eq(int64_t a, int64_t b) { - LDKOutputSpendStatus* a_conv = (LDKOutputSpendStatus*)untag_ptr(a); - LDKOutputSpendStatus* b_conv = (LDKOutputSpendStatus*)untag_ptr(b); - jboolean ret_conv = OutputSpendStatus_eq(a_conv, b_conv); +jstring CS_LDK_Hostname_to_str(int64_t o) { + LDKHostname o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = Hostname_to_str(&o_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); return ret_conv; } -int8_tArray CS_LDK_OutputSpendStatus_write(int64_t obj) { - LDKOutputSpendStatus* obj_conv = (LDKOutputSpendStatus*)untag_ptr(obj); - LDKCVec_u8Z ret_var = OutputSpendStatus_write(obj_conv); +int8_tArray CS_LDK_Hostname_write(int64_t obj) { + LDKHostname obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = Hostname_write(&obj_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_OutputSpendStatus_read(int8_tArray ser) { +int64_t CS_LDK_Hostname_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_OutputSpendStatusDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSpendStatusDecodeErrorZ), "LDKCResult_OutputSpendStatusDecodeErrorZ"); - *ret_conv = OutputSpendStatus_read(ser_ref); + LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); + *ret_conv = Hostname_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_OutputSweeper_free(int64_t this_obj) { - LDKOutputSweeper this_obj_conv; +void CS_LDK_TransactionU16LenLimited_free(int64_t this_obj) { + LDKTransactionU16LenLimited this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - OutputSweeper_free(this_obj_conv); + TransactionU16LenLimited_free(this_obj_conv); } -int64_t CS_LDK_OutputSweeper_new(int64_t best_block, int64_t broadcaster, int64_t fee_estimator, int64_t chain_data_source, int64_t output_spender, int64_t change_destination_source, int64_t kv_store, int64_t logger) { - LDKBestBlock best_block_conv; - best_block_conv.inner = untag_ptr(best_block); - best_block_conv.is_owned = ptr_is_owned(best_block); - CHECK_INNER_FIELD_ACCESS_OR_NULL(best_block_conv); - best_block_conv = BestBlock_clone(&best_block_conv); - void* broadcaster_ptr = untag_ptr(broadcaster); - CHECK_ACCESS(broadcaster_ptr); - LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); - } - void* fee_estimator_ptr = untag_ptr(fee_estimator); - CHECK_ACCESS(fee_estimator_ptr); - LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); - } - void* chain_data_source_ptr = untag_ptr(chain_data_source); - CHECK_ACCESS(chain_data_source_ptr); - LDKCOption_FilterZ chain_data_source_conv = *(LDKCOption_FilterZ*)(chain_data_source_ptr); - // WARNING: we may need a move here but no clone is available for LDKCOption_FilterZ - if (chain_data_source_conv.tag == LDKCOption_FilterZ_Some) { - // Manually implement clone for Java trait instances - if (chain_data_source_conv.some.free == LDKFilter_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFilter_JCalls_cloned(&chain_data_source_conv.some); - } - } - void* output_spender_ptr = untag_ptr(output_spender); - CHECK_ACCESS(output_spender_ptr); - LDKOutputSpender output_spender_conv = *(LDKOutputSpender*)(output_spender_ptr); - if (output_spender_conv.free == LDKOutputSpender_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKOutputSpender_JCalls_cloned(&output_spender_conv); - } - void* change_destination_source_ptr = untag_ptr(change_destination_source); - CHECK_ACCESS(change_destination_source_ptr); - LDKChangeDestinationSource change_destination_source_conv = *(LDKChangeDestinationSource*)(change_destination_source_ptr); - if (change_destination_source_conv.free == LDKChangeDestinationSource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKChangeDestinationSource_JCalls_cloned(&change_destination_source_conv); - } - void* kv_store_ptr = untag_ptr(kv_store); - CHECK_ACCESS(kv_store_ptr); - LDKKVStore kv_store_conv = *(LDKKVStore*)(kv_store_ptr); - if (kv_store_conv.free == LDKKVStore_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKKVStore_JCalls_cloned(&kv_store_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKOutputSweeper ret_var = OutputSweeper_new(best_block_conv, broadcaster_conv, fee_estimator_conv, chain_data_source_conv, output_spender_conv, change_destination_source_conv, kv_store_conv, logger_conv); +static inline uint64_t TransactionU16LenLimited_clone_ptr(LDKTransactionU16LenLimited *NONNULL_PTR arg) { + LDKTransactionU16LenLimited ret_var = TransactionU16LenLimited_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } +int64_t CS_LDK_TransactionU16LenLimited_clone_ptr(int64_t arg) { + LDKTransactionU16LenLimited arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = TransactionU16LenLimited_clone_ptr(&arg_conv); + return ret_conv; +} -int64_t CS_LDK_OutputSweeper_track_spendable_outputs(int64_t this_arg, int64_tArray output_descriptors, int64_t channel_id, jboolean exclude_static_outputs, int64_t delay_until_height) { - LDKOutputSweeper this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_SpendableOutputDescriptorZ output_descriptors_constr; - output_descriptors_constr.datalen = output_descriptors->arr_len; - if (output_descriptors_constr.datalen > 0) - output_descriptors_constr.data = MALLOC(output_descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); - else - output_descriptors_constr.data = NULL; - int64_t* output_descriptors_vals = output_descriptors->elems; - for (size_t b = 0; b < output_descriptors_constr.datalen; b++) { - int64_t output_descriptors_conv_27 = output_descriptors_vals[b]; - void* output_descriptors_conv_27_ptr = untag_ptr(output_descriptors_conv_27); - CHECK_ACCESS(output_descriptors_conv_27_ptr); - LDKSpendableOutputDescriptor output_descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(output_descriptors_conv_27_ptr); - output_descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(output_descriptors_conv_27)); - output_descriptors_constr.data[b] = output_descriptors_conv_27_conv; - } - FREE(output_descriptors); - LDKChannelId channel_id_conv; - channel_id_conv.inner = untag_ptr(channel_id); - channel_id_conv.is_owned = ptr_is_owned(channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); - channel_id_conv = ChannelId_clone(&channel_id_conv); - void* delay_until_height_ptr = untag_ptr(delay_until_height); - CHECK_ACCESS(delay_until_height_ptr); - LDKCOption_u32Z delay_until_height_conv = *(LDKCOption_u32Z*)(delay_until_height_ptr); - delay_until_height_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(delay_until_height)); - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = OutputSweeper_track_spendable_outputs(&this_arg_conv, output_descriptors_constr, channel_id_conv, exclude_static_outputs, delay_until_height_conv); +int64_t CS_LDK_TransactionU16LenLimited_clone(int64_t orig) { + LDKTransactionU16LenLimited orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKTransactionU16LenLimited ret_var = TransactionU16LenLimited_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int64_t CS_LDK_TransactionU16LenLimited_hash(int64_t o) { + LDKTransactionU16LenLimited o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = TransactionU16LenLimited_hash(&o_conv); + return ret_conv; +} + +jboolean CS_LDK_TransactionU16LenLimited_eq(int64_t a, int64_t b) { + LDKTransactionU16LenLimited a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKTransactionU16LenLimited b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = TransactionU16LenLimited_eq(&a_conv, &b_conv); + return ret_conv; +} + +int64_t CS_LDK_TransactionU16LenLimited_new(int8_tArray transaction) { + LDKTransaction transaction_ref; + transaction_ref.datalen = transaction->arr_len; + transaction_ref.data = MALLOC(transaction_ref.datalen, "LDKTransaction Bytes"); + memcpy(transaction_ref.data, transaction->elems, transaction_ref.datalen); FREE(transaction); + transaction_ref.data_is_owned = true; + LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); + *ret_conv = TransactionU16LenLimited_new(transaction_ref); return tag_ptr(ret_conv, true); } -int64_tArray CS_LDK_OutputSweeper_tracked_spendable_outputs(int64_t this_arg) { - LDKOutputSweeper this_arg_conv; +int8_tArray CS_LDK_TransactionU16LenLimited_into_transaction(int64_t this_arg) { + LDKTransactionU16LenLimited this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_TrackedSpendableOutputZ ret_var = OutputSweeper_tracked_spendable_outputs(&this_arg_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t y = 0; y < ret_var.datalen; y++) { - LDKTrackedSpendableOutput ret_conv_24_var = ret_var.data[y]; - int64_t ret_conv_24_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_24_var); - ret_conv_24_ref = tag_ptr(ret_conv_24_var.inner, ret_conv_24_var.is_owned); - ret_arr_ptr[y] = ret_conv_24_ref; - } - - FREE(ret_var.data); + this_arg_conv = TransactionU16LenLimited_clone(&this_arg_conv); + LDKTransaction ret_var = TransactionU16LenLimited_into_transaction(this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + Transaction_free(ret_var); return ret_arr; } -int64_t CS_LDK_OutputSweeper_current_best_block(int64_t this_arg) { - LDKOutputSweeper this_arg_conv; +int8_tArray CS_LDK_TransactionU16LenLimited_as_transaction(int64_t this_arg) { + LDKTransactionU16LenLimited this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKBestBlock ret_var = OutputSweeper_current_best_block(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + LDKTransaction ret_var = TransactionU16LenLimited_as_transaction(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + Transaction_free(ret_var); + return ret_arr; } -int64_t CS_LDK_OutputSweeper_as_Listen(int64_t this_arg) { - LDKOutputSweeper this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); - *ret_ret = OutputSweeper_as_Listen(&this_arg_conv); - return tag_ptr(ret_ret, true); +int8_tArray CS_LDK_TransactionU16LenLimited_write(int64_t obj) { + LDKTransactionU16LenLimited obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = TransactionU16LenLimited_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -int64_t CS_LDK_OutputSweeper_as_Confirm(int64_t this_arg) { - LDKOutputSweeper this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); - *ret_ret = OutputSweeper_as_Confirm(&this_arg_conv); - return tag_ptr(ret_ret, true); +int64_t CS_LDK_TransactionU16LenLimited_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); + *ret_conv = TransactionU16LenLimited_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -void CS_LDK_SpendingDelay_free(int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKSpendingDelay this_ptr_conv = *(LDKSpendingDelay*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - SpendingDelay_free(this_ptr_conv); +int64_t CS_LDK_sign(int8_tArray msg, int8_tArray sk) { + LDKu8slice msg_ref; + msg_ref.datalen = msg->arr_len; + msg_ref.data = msg->elems; + uint8_t sk_arr[32]; + CHECK(sk->arr_len == 32); + memcpy(sk_arr, sk->elems, 32); FREE(sk); + uint8_t (*sk_ref)[32] = &sk_arr; + LDKCResult_StrSecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StrSecp256k1ErrorZ), "LDKCResult_StrSecp256k1ErrorZ"); + *ret_conv = sign(msg_ref, sk_ref); + FREE(msg); + return tag_ptr(ret_conv, true); } -static inline uint64_t SpendingDelay_clone_ptr(LDKSpendingDelay *NONNULL_PTR arg) { - LDKSpendingDelay *ret_copy = MALLOC(sizeof(LDKSpendingDelay), "LDKSpendingDelay"); - *ret_copy = SpendingDelay_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_recover_pk(int8_tArray msg, jstring sig) { + LDKu8slice msg_ref; + msg_ref.datalen = msg->arr_len; + msg_ref.data = msg->elems; + LDKStr sig_conv = str_ref_to_owned_c(sig); + LDKCResult_PublicKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecp256k1ErrorZ), "LDKCResult_PublicKeySecp256k1ErrorZ"); + *ret_conv = recover_pk(msg_ref, sig_conv); + FREE(msg); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_SpendingDelay_clone_ptr(int64_t arg) { - LDKSpendingDelay* arg_conv = (LDKSpendingDelay*)untag_ptr(arg); - int64_t ret_conv = SpendingDelay_clone_ptr(arg_conv); + +jboolean CS_LDK_verify(int8_tArray msg, jstring sig, int8_tArray pk) { + LDKu8slice msg_ref; + msg_ref.datalen = msg->arr_len; + msg_ref.data = msg->elems; + LDKStr sig_conv = str_ref_to_owned_c(sig); + LDKPublicKey pk_ref; + CHECK(pk->arr_len == 33); + memcpy(pk_ref.compressed_form, pk->elems, 33); FREE(pk); + jboolean ret_conv = verify(msg_ref, sig_conv, pk_ref); + FREE(msg); return ret_conv; } -int64_t CS_LDK_SpendingDelay_clone(int64_t orig) { - LDKSpendingDelay* orig_conv = (LDKSpendingDelay*)untag_ptr(orig); - LDKSpendingDelay *ret_copy = MALLOC(sizeof(LDKSpendingDelay), "LDKSpendingDelay"); - *ret_copy = SpendingDelay_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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; } -int64_t CS_LDK_SpendingDelay_relative(int32_t num_blocks) { - LDKSpendingDelay *ret_copy = MALLOC(sizeof(LDKSpendingDelay), "LDKSpendingDelay"); - *ret_copy = SpendingDelay_relative(num_blocks); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_KVStore_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); + LDKKVStore this_ptr_conv = *(LDKKVStore*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + KVStore_free(this_ptr_conv); } -int64_t CS_LDK_SpendingDelay_absolute(int32_t height) { - LDKSpendingDelay *ret_copy = MALLOC(sizeof(LDKSpendingDelay), "LDKSpendingDelay"); - *ret_copy = SpendingDelay_absolute(height); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_Persister_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); + LDKPersister this_ptr_conv = *(LDKPersister*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Persister_free(this_ptr_conv); } -int64_t CS_LDK_OutputSweeper_read(int8_tArray ser, int64_t arg_a, int64_t arg_b, int64_t arg_c, int64_t arg_d, int64_t arg_e, int64_t arg_f, int64_t arg_g) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - void* arg_a_ptr = untag_ptr(arg_a); - CHECK_ACCESS(arg_a_ptr); - LDKBroadcasterInterface arg_a_conv = *(LDKBroadcasterInterface*)(arg_a_ptr); - if (arg_a_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&arg_a_conv); - } - void* arg_b_ptr = untag_ptr(arg_b); - CHECK_ACCESS(arg_b_ptr); - LDKFeeEstimator arg_b_conv = *(LDKFeeEstimator*)(arg_b_ptr); - if (arg_b_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&arg_b_conv); - } - void* arg_c_ptr = untag_ptr(arg_c); - CHECK_ACCESS(arg_c_ptr); - LDKCOption_FilterZ arg_c_conv = *(LDKCOption_FilterZ*)(arg_c_ptr); - // WARNING: we may need a move here but no clone is available for LDKCOption_FilterZ - if (arg_c_conv.tag == LDKCOption_FilterZ_Some) { - // Manually implement clone for Java trait instances - if (arg_c_conv.some.free == LDKFilter_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFilter_JCalls_cloned(&arg_c_conv.some); - } - } - void* arg_d_ptr = untag_ptr(arg_d); - CHECK_ACCESS(arg_d_ptr); - LDKOutputSpender arg_d_conv = *(LDKOutputSpender*)(arg_d_ptr); - if (arg_d_conv.free == LDKOutputSpender_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKOutputSpender_JCalls_cloned(&arg_d_conv); - } - void* arg_e_ptr = untag_ptr(arg_e); - CHECK_ACCESS(arg_e_ptr); - LDKChangeDestinationSource arg_e_conv = *(LDKChangeDestinationSource*)(arg_e_ptr); - if (arg_e_conv.free == LDKChangeDestinationSource_JCalls_free) { +int64_t CS_LDK_read_channel_monitors(int64_t kv_store, int64_t entropy_source, int64_t signer_provider) { + void* kv_store_ptr = untag_ptr(kv_store); + CHECK_ACCESS(kv_store_ptr); + LDKKVStore kv_store_conv = *(LDKKVStore*)(kv_store_ptr); + if (kv_store_conv.free == LDKKVStore_JCalls_free) { // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKChangeDestinationSource_JCalls_cloned(&arg_e_conv); + LDKKVStore_JCalls_cloned(&kv_store_conv); } - void* arg_f_ptr = untag_ptr(arg_f); - CHECK_ACCESS(arg_f_ptr); - LDKKVStore arg_f_conv = *(LDKKVStore*)(arg_f_ptr); - if (arg_f_conv.free == LDKKVStore_JCalls_free) { + 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. - LDKKVStore_JCalls_cloned(&arg_f_conv); + LDKEntropySource_JCalls_cloned(&entropy_source_conv); } - void* arg_g_ptr = untag_ptr(arg_g); - CHECK_ACCESS(arg_g_ptr); - LDKLogger arg_g_conv = *(LDKLogger*)(arg_g_ptr); - if (arg_g_conv.free == LDKLogger_JCalls_free) { + 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. - LDKLogger_JCalls_cloned(&arg_g_conv); + LDKSignerProvider_JCalls_cloned(&signer_provider_conv); } - LDKCResult_OutputSweeperDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSweeperDecodeErrorZ), "LDKCResult_OutputSweeperDecodeErrorZ"); - *ret_conv = OutputSweeper_read(ser_ref, arg_a_conv, arg_b_conv, arg_c_conv, arg_d_conv, arg_e_conv, arg_f_conv, arg_g_conv); - FREE(ser); + LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ), "LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ"); + *ret_conv = read_channel_monitors(kv_store_conv, entropy_source_conv, signer_provider_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C2Tuple_BestBlockOutputSweeperZ_read(int8_tArray ser, int64_t arg_a, int64_t arg_b, int64_t arg_c, int64_t arg_d, int64_t arg_e, int64_t arg_f, int64_t arg_g) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - void* arg_a_ptr = untag_ptr(arg_a); - CHECK_ACCESS(arg_a_ptr); - LDKBroadcasterInterface arg_a_conv = *(LDKBroadcasterInterface*)(arg_a_ptr); - if (arg_a_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&arg_a_conv); - } - void* arg_b_ptr = untag_ptr(arg_b); - CHECK_ACCESS(arg_b_ptr); - LDKFeeEstimator arg_b_conv = *(LDKFeeEstimator*)(arg_b_ptr); - if (arg_b_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&arg_b_conv); - } - void* arg_c_ptr = untag_ptr(arg_c); - CHECK_ACCESS(arg_c_ptr); - LDKCOption_FilterZ arg_c_conv = *(LDKCOption_FilterZ*)(arg_c_ptr); - // WARNING: we may need a move here but no clone is available for LDKCOption_FilterZ - if (arg_c_conv.tag == LDKCOption_FilterZ_Some) { - // Manually implement clone for Java trait instances - if (arg_c_conv.some.free == LDKFilter_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFilter_JCalls_cloned(&arg_c_conv.some); - } - } - void* arg_d_ptr = untag_ptr(arg_d); - CHECK_ACCESS(arg_d_ptr); - LDKOutputSpender arg_d_conv = *(LDKOutputSpender*)(arg_d_ptr); - if (arg_d_conv.free == LDKOutputSpender_JCalls_free) { +void CS_LDK_MonitorUpdatingPersister_free(int64_t this_obj) { + LDKMonitorUpdatingPersister this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + MonitorUpdatingPersister_free(this_obj_conv); +} + +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) { + void* kv_store_ptr = untag_ptr(kv_store); + CHECK_ACCESS(kv_store_ptr); + LDKKVStore kv_store_conv = *(LDKKVStore*)(kv_store_ptr); + if (kv_store_conv.free == LDKKVStore_JCalls_free) { // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKOutputSpender_JCalls_cloned(&arg_d_conv); + LDKKVStore_JCalls_cloned(&kv_store_conv); } - void* arg_e_ptr = untag_ptr(arg_e); - CHECK_ACCESS(arg_e_ptr); - LDKChangeDestinationSource arg_e_conv = *(LDKChangeDestinationSource*)(arg_e_ptr); - if (arg_e_conv.free == LDKChangeDestinationSource_JCalls_free) { + 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. - LDKChangeDestinationSource_JCalls_cloned(&arg_e_conv); + LDKLogger_JCalls_cloned(&logger_conv); } - void* arg_f_ptr = untag_ptr(arg_f); - CHECK_ACCESS(arg_f_ptr); - LDKKVStore arg_f_conv = *(LDKKVStore*)(arg_f_ptr); - if (arg_f_conv.free == LDKKVStore_JCalls_free) { + 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. - LDKKVStore_JCalls_cloned(&arg_f_conv); + LDKEntropySource_JCalls_cloned(&entropy_source_conv); } - void* arg_g_ptr = untag_ptr(arg_g); - CHECK_ACCESS(arg_g_ptr); - LDKLogger arg_g_conv = *(LDKLogger*)(arg_g_ptr); - if (arg_g_conv.free == LDKLogger_JCalls_free) { + 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. - LDKLogger_JCalls_cloned(&arg_g_conv); + LDKSignerProvider_JCalls_cloned(&signer_provider_conv); } - LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ), "LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ"); - *ret_conv = C2Tuple_BestBlockOutputSweeperZ_read(ser_ref, arg_a_conv, arg_b_conv, arg_c_conv, arg_d_conv, arg_e_conv, arg_f_conv, arg_g_conv); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -void CS_LDK_FutureCallback_free(int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKFutureCallback this_ptr_conv = *(LDKFutureCallback*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - FutureCallback_free(this_ptr_conv); -} - -void CS_LDK_Future_free(int64_t this_obj) { - LDKFuture this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Future_free(this_obj_conv); + LDKMonitorUpdatingPersister ret_var = MonitorUpdatingPersister_new(kv_store_conv, logger_conv, maximum_pending_updates, entropy_source_conv, signer_provider_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_Future_register_callback_fn(int64_t this_arg, int64_t callback) { - LDKFuture this_arg_conv; +int64_t CS_LDK_MonitorUpdatingPersister_read_all_channel_monitors_with_updates(int64_t this_arg, int64_t broadcaster, int64_t fee_estimator) { + LDKMonitorUpdatingPersister this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - void* callback_ptr = untag_ptr(callback); - CHECK_ACCESS(callback_ptr); - LDKFutureCallback callback_conv = *(LDKFutureCallback*)(callback_ptr); - if (callback_conv.free == LDKFutureCallback_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFutureCallback_JCalls_cloned(&callback_conv); - } - Future_register_callback_fn(&this_arg_conv, callback_conv); + void* broadcaster_ptr = untag_ptr(broadcaster); + if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); } + LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; + void* fee_estimator_ptr = untag_ptr(fee_estimator); + if (ptr_is_owned(fee_estimator)) { CHECK_ACCESS(fee_estimator_ptr); } + LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; + LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ), "LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ"); + *ret_conv = MonitorUpdatingPersister_read_all_channel_monitors_with_updates(&this_arg_conv, broadcaster_conv, fee_estimator_conv); + return tag_ptr(ret_conv, true); } -void CS_LDK_Future_wait(int64_t this_arg) { - LDKFuture this_arg_conv; +int64_t CS_LDK_MonitorUpdatingPersister_read_channel_monitor_with_updates(int64_t this_arg, int64_t broadcaster, int64_t fee_estimator, jstring monitor_key) { + LDKMonitorUpdatingPersister this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - Future_wait(&this_arg_conv); + void* broadcaster_ptr = untag_ptr(broadcaster); + if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); } + LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; + void* fee_estimator_ptr = untag_ptr(fee_estimator); + if (ptr_is_owned(fee_estimator)) { CHECK_ACCESS(fee_estimator_ptr); } + LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; + LDKStr monitor_key_conv = str_ref_to_owned_c(monitor_key); + LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ), "LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ"); + *ret_conv = MonitorUpdatingPersister_read_channel_monitor_with_updates(&this_arg_conv, broadcaster_conv, fee_estimator_conv, monitor_key_conv); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_Future_wait_timeout(int64_t this_arg, int64_t max_wait) { - LDKFuture this_arg_conv; +int64_t CS_LDK_MonitorUpdatingPersister_cleanup_stale_updates(int64_t this_arg, jboolean lazy) { + LDKMonitorUpdatingPersister this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = Future_wait_timeout(&this_arg_conv, max_wait); - return ret_conv; -} - -void CS_LDK_Sleeper_free(int64_t this_obj) { - LDKSleeper this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Sleeper_free(this_obj_conv); -} - -int64_t CS_LDK_Sleeper_from_single_future(int64_t future) { - LDKFuture future_conv; - future_conv.inner = untag_ptr(future); - future_conv.is_owned = ptr_is_owned(future); - CHECK_INNER_FIELD_ACCESS_OR_NULL(future_conv); - future_conv.is_owned = false; - LDKSleeper ret_var = Sleeper_from_single_future(&future_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -int64_t CS_LDK_Sleeper_from_two_futures(int64_t fut_a, int64_t fut_b) { - 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; - LDKSleeper ret_var = Sleeper_from_two_futures(&fut_a_conv, &fut_b_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -int64_t CS_LDK_Sleeper_new(int64_tArray futures) { - LDKCVec_FutureZ futures_constr; - futures_constr.datalen = futures->arr_len; - if (futures_constr.datalen > 0) - futures_constr.data = MALLOC(futures_constr.datalen * sizeof(LDKFuture), "LDKCVec_FutureZ Elements"); - else - futures_constr.data = NULL; - int64_t* futures_vals = futures->elems; - for (size_t i = 0; i < futures_constr.datalen; i++) { - int64_t futures_conv_8 = futures_vals[i]; - LDKFuture futures_conv_8_conv; - futures_conv_8_conv.inner = untag_ptr(futures_conv_8); - futures_conv_8_conv.is_owned = ptr_is_owned(futures_conv_8); - CHECK_INNER_FIELD_ACCESS_OR_NULL(futures_conv_8_conv); - // WARNING: we need a move here but no clone is available for LDKFuture - - futures_constr.data[i] = futures_conv_8_conv; - } - FREE(futures); - LDKSleeper ret_var = Sleeper_new(futures_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_Sleeper_wait(int64_t this_arg) { - LDKSleeper this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - Sleeper_wait(&this_arg_conv); + LDKCResult_NoneIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneIOErrorZ), "LDKCResult_NoneIOErrorZ"); + *ret_conv = MonitorUpdatingPersister_cleanup_stale_updates(&this_arg_conv, lazy); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_Sleeper_wait_timeout(int64_t this_arg, int64_t max_wait) { - LDKSleeper this_arg_conv; +int64_t CS_LDK_MonitorUpdatingPersister_as_Persist(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; - jboolean ret_conv = Sleeper_wait_timeout(&this_arg_conv, max_wait); - return ret_conv; -} - -int32_t CS_LDK_Level_clone(int64_t orig) { - LDKLevel* orig_conv = (LDKLevel*)untag_ptr(orig); - int32_t ret_conv = LDKLevel_to_cs(Level_clone(orig_conv)); - return ret_conv; + LDKPersist* ret_ret = MALLOC(sizeof(LDKPersist), "LDKPersist"); + *ret_ret = MonitorUpdatingPersister_as_Persist(&this_arg_conv); + return tag_ptr(ret_ret, true); } -int32_t CS_LDK_Level_gossip() { - int32_t ret_conv = LDKLevel_to_cs(Level_gossip()); +int32_t CS_LDK_ShortChannelIdError_clone(int64_t orig) { + LDKShortChannelIdError* orig_conv = (LDKShortChannelIdError*)untag_ptr(orig); + int32_t ret_conv = LDKShortChannelIdError_to_cs(ShortChannelIdError_clone(orig_conv)); return ret_conv; } -int32_t CS_LDK_Level_trace() { - int32_t ret_conv = LDKLevel_to_cs(Level_trace()); +int32_t CS_LDK_ShortChannelIdError_block_overflow() { + int32_t ret_conv = LDKShortChannelIdError_to_cs(ShortChannelIdError_block_overflow()); return ret_conv; } -int32_t CS_LDK_Level_debug() { - int32_t ret_conv = LDKLevel_to_cs(Level_debug()); +int32_t CS_LDK_ShortChannelIdError_tx_index_overflow() { + int32_t ret_conv = LDKShortChannelIdError_to_cs(ShortChannelIdError_tx_index_overflow()); return ret_conv; } -int32_t CS_LDK_Level_info() { - int32_t ret_conv = LDKLevel_to_cs(Level_info()); +int32_t CS_LDK_ShortChannelIdError_vout_index_overflow() { + int32_t ret_conv = LDKShortChannelIdError_to_cs(ShortChannelIdError_vout_index_overflow()); return ret_conv; } -int32_t CS_LDK_Level_warn() { - int32_t ret_conv = LDKLevel_to_cs(Level_warn()); +jboolean CS_LDK_ShortChannelIdError_eq(int64_t a, int64_t b) { + LDKShortChannelIdError* a_conv = (LDKShortChannelIdError*)untag_ptr(a); + LDKShortChannelIdError* b_conv = (LDKShortChannelIdError*)untag_ptr(b); + jboolean ret_conv = ShortChannelIdError_eq(a_conv, b_conv); return ret_conv; } -int32_t CS_LDK_Level_error() { - int32_t ret_conv = LDKLevel_to_cs(Level_error()); +int32_t CS_LDK_block_from_scid(int64_t short_channel_id) { + int32_t ret_conv = block_from_scid(short_channel_id); return ret_conv; } -jboolean CS_LDK_Level_eq(int64_t a, int64_t b) { - LDKLevel* a_conv = (LDKLevel*)untag_ptr(a); - LDKLevel* b_conv = (LDKLevel*)untag_ptr(b); - jboolean ret_conv = Level_eq(a_conv, b_conv); +int32_t CS_LDK_tx_index_from_scid(int64_t short_channel_id) { + int32_t ret_conv = tx_index_from_scid(short_channel_id); return ret_conv; } -int64_t CS_LDK_Level_hash(int64_t o) { - LDKLevel* o_conv = (LDKLevel*)untag_ptr(o); - int64_t ret_conv = Level_hash(o_conv); +int16_t CS_LDK_vout_from_scid(int64_t short_channel_id) { + int16_t ret_conv = vout_from_scid(short_channel_id); return ret_conv; } -int32_t CS_LDK_Level_max() { - int32_t ret_conv = LDKLevel_to_cs(Level_max()); - return ret_conv; +int64_t CS_LDK_scid_from_parts(int64_t block, int64_t tx_index, int64_t vout_index) { + LDKCResult_u64ShortChannelIdErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u64ShortChannelIdErrorZ), "LDKCResult_u64ShortChannelIdErrorZ"); + *ret_conv = scid_from_parts(block, tx_index, vout_index); + return tag_ptr(ret_conv, true); } -void CS_LDK_Record_free(int64_t this_obj) { - LDKRecord 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); - Record_free(this_obj_conv); + UntrustedString_free(this_obj_conv); } -int32_t CS_LDK_Record_get_level(int64_t this_ptr) { - LDKRecord 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; - int32_t ret_conv = LDKLevel_to_cs(Record_get_level(&this_ptr_conv)); + 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_Record_set_level(int64_t this_ptr, int32_t val) { - LDKRecord 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; - LDKLevel val_conv = LDKLevel_from_cs(val); - Record_set_level(&this_ptr_conv, val_conv); + LDKStr val_conv = str_ref_to_owned_c(val); + UntrustedString_set_a(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_Record_get_peer_id(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; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, Record_get_peer_id(&this_ptr_conv).compressed_form, 33); - return ret_arr; +int64_t 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; } -void CS_LDK_Record_set_peer_id(int64_t this_ptr, int8_tArray val) { - LDKRecord this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - Record_set_peer_id(&this_ptr_conv, val_ref); +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_Record_get_channel_id(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; - LDKChannelId ret_var = Record_get_channel_id(&this_ptr_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; } -void CS_LDK_Record_set_channel_id(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; - LDKChannelId val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelId_clone(&val_conv); - Record_set_channel_id(&this_ptr_conv, val_conv); +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; } -jstring CS_LDK_Record_get_args(int64_t this_ptr) { - LDKRecord 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; +} + +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 = Record_get_args(&this_ptr_conv); + 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_Record_set_args(int64_t this_ptr, jstring val) { - LDKRecord this_ptr_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); - Record_set_args(&this_ptr_conv, val_conv); + PrintableString_set_a(&this_ptr_conv, val_conv); } -jstring CS_LDK_Record_get_module_path(int64_t this_ptr) { - LDKRecord this_ptr_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); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + TrackedSpendableOutput_free(this_obj_conv); +} + +int64_t CS_LDK_TrackedSpendableOutput_get_descriptor(int64_t this_ptr) { + LDKTrackedSpendableOutput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKStr ret_str = Record_get_module_path(&this_ptr_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = TrackedSpendableOutput_get_descriptor(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_Record_set_module_path(int64_t this_ptr, jstring val) { - LDKRecord this_ptr_conv; +void CS_LDK_TrackedSpendableOutput_set_descriptor(int64_t this_ptr, int64_t val) { + LDKTrackedSpendableOutput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKStr val_conv = str_ref_to_owned_c(val); - Record_set_module_path(&this_ptr_conv, val_conv); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKSpendableOutputDescriptor val_conv = *(LDKSpendableOutputDescriptor*)(val_ptr); + val_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(val)); + TrackedSpendableOutput_set_descriptor(&this_ptr_conv, val_conv); } -jstring CS_LDK_Record_get_file(int64_t this_ptr) { - LDKRecord this_ptr_conv; +int64_t CS_LDK_TrackedSpendableOutput_get_channel_id(int64_t this_ptr) { + LDKTrackedSpendableOutput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKStr ret_str = Record_get_file(&this_ptr_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; + LDKChannelId ret_var = TrackedSpendableOutput_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_Record_set_file(int64_t this_ptr, jstring val) { - LDKRecord this_ptr_conv; +void CS_LDK_TrackedSpendableOutput_set_channel_id(int64_t this_ptr, int64_t val) { + LDKTrackedSpendableOutput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKStr val_conv = str_ref_to_owned_c(val); - Record_set_file(&this_ptr_conv, 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 = ChannelId_clone(&val_conv); + TrackedSpendableOutput_set_channel_id(&this_ptr_conv, val_conv); } -int32_t CS_LDK_Record_get_line(int64_t this_ptr) { - LDKRecord this_ptr_conv; +int64_t CS_LDK_TrackedSpendableOutput_get_status(int64_t this_ptr) { + LDKTrackedSpendableOutput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int32_t ret_conv = Record_get_line(&this_ptr_conv); - return ret_conv; + LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); + *ret_copy = TrackedSpendableOutput_get_status(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_Record_set_line(int64_t this_ptr, int32_t val) { - LDKRecord this_ptr_conv; +void CS_LDK_TrackedSpendableOutput_set_status(int64_t this_ptr, int64_t val) { + LDKTrackedSpendableOutput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - Record_set_line(&this_ptr_conv, val); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKOutputSpendStatus val_conv = *(LDKOutputSpendStatus*)(val_ptr); + val_conv = OutputSpendStatus_clone((LDKOutputSpendStatus*)untag_ptr(val)); + TrackedSpendableOutput_set_status(&this_ptr_conv, val_conv); } -int64_t CS_LDK_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) { - LDKLevel level_arg_conv = LDKLevel_from_cs(level_arg); - LDKPublicKey peer_id_arg_ref; - CHECK(peer_id_arg->arr_len == 33); - memcpy(peer_id_arg_ref.compressed_form, peer_id_arg->elems, 33); FREE(peer_id_arg); +int64_t CS_LDK_TrackedSpendableOutput_new(int64_t descriptor_arg, int64_t channel_id_arg, int64_t status_arg) { + void* descriptor_arg_ptr = untag_ptr(descriptor_arg); + CHECK_ACCESS(descriptor_arg_ptr); + LDKSpendableOutputDescriptor descriptor_arg_conv = *(LDKSpendableOutputDescriptor*)(descriptor_arg_ptr); + descriptor_arg_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(descriptor_arg)); LDKChannelId channel_id_arg_conv; channel_id_arg_conv.inner = untag_ptr(channel_id_arg); channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); - 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* status_arg_ptr = untag_ptr(status_arg); + CHECK_ACCESS(status_arg_ptr); + LDKOutputSpendStatus status_arg_conv = *(LDKOutputSpendStatus*)(status_arg_ptr); + status_arg_conv = OutputSpendStatus_clone((LDKOutputSpendStatus*)untag_ptr(status_arg)); + LDKTrackedSpendableOutput ret_var = TrackedSpendableOutput_new(descriptor_arg_conv, channel_id_arg_conv, status_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t Record_clone_ptr(LDKRecord *NONNULL_PTR arg) { - LDKRecord ret_var = Record_clone(arg); +static inline uint64_t TrackedSpendableOutput_clone_ptr(LDKTrackedSpendableOutput *NONNULL_PTR arg) { + LDKTrackedSpendableOutput ret_var = TrackedSpendableOutput_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_Record_clone_ptr(int64_t arg) { - LDKRecord arg_conv; +int64_t CS_LDK_TrackedSpendableOutput_clone_ptr(int64_t arg) { + LDKTrackedSpendableOutput arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Record_clone_ptr(&arg_conv); + int64_t ret_conv = TrackedSpendableOutput_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_Record_clone(int64_t orig) { - LDKRecord orig_conv; +int64_t CS_LDK_TrackedSpendableOutput_clone(int64_t orig) { + LDKTrackedSpendableOutput orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKRecord ret_var = Record_clone(&orig_conv); + LDKTrackedSpendableOutput ret_var = TrackedSpendableOutput_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -void CS_LDK_Logger_free(int64_t this_ptr) { +jboolean CS_LDK_TrackedSpendableOutput_eq(int64_t a, int64_t b) { + LDKTrackedSpendableOutput a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKTrackedSpendableOutput b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = TrackedSpendableOutput_eq(&a_conv, &b_conv); + return ret_conv; +} + +jboolean CS_LDK_TrackedSpendableOutput_is_spent_in(int64_t this_arg, int8_tArray tx) { + LDKTrackedSpendableOutput this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKTransaction tx_ref; + tx_ref.datalen = tx->arr_len; + tx_ref.data = MALLOC(tx_ref.datalen, "LDKTransaction Bytes"); + memcpy(tx_ref.data, tx->elems, tx_ref.datalen); FREE(tx); + tx_ref.data_is_owned = true; + jboolean ret_conv = TrackedSpendableOutput_is_spent_in(&this_arg_conv, tx_ref); + return ret_conv; +} + +int8_tArray CS_LDK_TrackedSpendableOutput_write(int64_t obj) { + LDKTrackedSpendableOutput obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = TrackedSpendableOutput_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_TrackedSpendableOutput_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_TrackedSpendableOutputDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TrackedSpendableOutputDecodeErrorZ), "LDKCResult_TrackedSpendableOutputDecodeErrorZ"); + *ret_conv = TrackedSpendableOutput_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_OutputSpendStatus_free(int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); CHECK_ACCESS(this_ptr_ptr); - LDKLogger this_ptr_conv = *(LDKLogger*)(this_ptr_ptr); + LDKOutputSpendStatus this_ptr_conv = *(LDKOutputSpendStatus*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - Logger_free(this_ptr_conv); + OutputSpendStatus_free(this_ptr_conv); } -void CS_LDK_ChannelHandshakeConfig_free(int64_t this_obj) { - LDKChannelHandshakeConfig this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelHandshakeConfig_free(this_obj_conv); +static inline uint64_t OutputSpendStatus_clone_ptr(LDKOutputSpendStatus *NONNULL_PTR arg) { + LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); + *ret_copy = OutputSpendStatus_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } - -int32_t CS_LDK_ChannelHandshakeConfig_get_minimum_depth(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; - int32_t ret_conv = ChannelHandshakeConfig_get_minimum_depth(&this_ptr_conv); +int64_t CS_LDK_OutputSpendStatus_clone_ptr(int64_t arg) { + LDKOutputSpendStatus* arg_conv = (LDKOutputSpendStatus*)untag_ptr(arg); + int64_t ret_conv = OutputSpendStatus_clone_ptr(arg_conv); return ret_conv; } -void CS_LDK_ChannelHandshakeConfig_set_minimum_depth(int64_t this_ptr, int32_t val) { - LDKChannelHandshakeConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeConfig_set_minimum_depth(&this_ptr_conv, val); -} - -int16_t CS_LDK_ChannelHandshakeConfig_get_our_to_self_delay(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; - int16_t ret_conv = ChannelHandshakeConfig_get_our_to_self_delay(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_ChannelHandshakeConfig_set_our_to_self_delay(int64_t this_ptr, int16_t val) { - LDKChannelHandshakeConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeConfig_set_our_to_self_delay(&this_ptr_conv, val); -} - -int64_t CS_LDK_ChannelHandshakeConfig_get_our_htlc_minimum_msat(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; - int64_t ret_conv = ChannelHandshakeConfig_get_our_htlc_minimum_msat(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_ChannelHandshakeConfig_set_our_htlc_minimum_msat(int64_t this_ptr, int64_t val) { - LDKChannelHandshakeConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeConfig_set_our_htlc_minimum_msat(&this_ptr_conv, val); -} - -int8_t CS_LDK_ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(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; - int8_t ret_conv = ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(int64_t this_ptr, int8_t val) { - LDKChannelHandshakeConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(&this_ptr_conv, val); -} - -jboolean CS_LDK_ChannelHandshakeConfig_get_negotiate_scid_privacy(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_negotiate_scid_privacy(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_ChannelHandshakeConfig_set_negotiate_scid_privacy(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_negotiate_scid_privacy(&this_ptr_conv, val); -} - -jboolean CS_LDK_ChannelHandshakeConfig_get_announced_channel(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); - return ret_conv; -} - -void CS_LDK_ChannelHandshakeConfig_set_announced_channel(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); -} - -jboolean CS_LDK_ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(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_commit_upfront_shutdown_pubkey(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_OutputSpendStatus_clone(int64_t orig) { + LDKOutputSpendStatus* orig_conv = (LDKOutputSpendStatus*)untag_ptr(orig); + LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); + *ret_copy = OutputSpendStatus_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(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_commit_upfront_shutdown_pubkey(&this_ptr_conv, val); +int64_t CS_LDK_OutputSpendStatus_pending_initial_broadcast(int64_t delayed_until_height) { + void* delayed_until_height_ptr = untag_ptr(delayed_until_height); + CHECK_ACCESS(delayed_until_height_ptr); + LDKCOption_u32Z delayed_until_height_conv = *(LDKCOption_u32Z*)(delayed_until_height_ptr); + delayed_until_height_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(delayed_until_height)); + LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); + *ret_copy = OutputSpendStatus_pending_initial_broadcast(delayed_until_height_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int32_t CS_LDK_ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(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; - int32_t ret_conv = ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_OutputSpendStatus_pending_first_confirmation(int8_tArray first_broadcast_hash, int32_t latest_broadcast_height, int8_tArray latest_spending_tx) { + LDKThirtyTwoBytes first_broadcast_hash_ref; + CHECK(first_broadcast_hash->arr_len == 32); + memcpy(first_broadcast_hash_ref.data, first_broadcast_hash->elems, 32); FREE(first_broadcast_hash); + LDKTransaction latest_spending_tx_ref; + latest_spending_tx_ref.datalen = latest_spending_tx->arr_len; + latest_spending_tx_ref.data = MALLOC(latest_spending_tx_ref.datalen, "LDKTransaction Bytes"); + memcpy(latest_spending_tx_ref.data, latest_spending_tx->elems, latest_spending_tx_ref.datalen); FREE(latest_spending_tx); + latest_spending_tx_ref.data_is_owned = true; + LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); + *ret_copy = OutputSpendStatus_pending_first_confirmation(first_broadcast_hash_ref, latest_broadcast_height, latest_spending_tx_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(int64_t this_ptr, int32_t val) { - LDKChannelHandshakeConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(&this_ptr_conv, val); +int64_t CS_LDK_OutputSpendStatus_pending_threshold_confirmations(int8_tArray first_broadcast_hash, int32_t latest_broadcast_height, int8_tArray latest_spending_tx, int32_t confirmation_height, int8_tArray confirmation_hash) { + LDKThirtyTwoBytes first_broadcast_hash_ref; + CHECK(first_broadcast_hash->arr_len == 32); + memcpy(first_broadcast_hash_ref.data, first_broadcast_hash->elems, 32); FREE(first_broadcast_hash); + LDKTransaction latest_spending_tx_ref; + latest_spending_tx_ref.datalen = latest_spending_tx->arr_len; + latest_spending_tx_ref.data = MALLOC(latest_spending_tx_ref.datalen, "LDKTransaction Bytes"); + memcpy(latest_spending_tx_ref.data, latest_spending_tx->elems, latest_spending_tx_ref.datalen); FREE(latest_spending_tx); + latest_spending_tx_ref.data_is_owned = true; + LDKThirtyTwoBytes confirmation_hash_ref; + CHECK(confirmation_hash->arr_len == 32); + memcpy(confirmation_hash_ref.data, confirmation_hash->elems, 32); FREE(confirmation_hash); + LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); + *ret_copy = OutputSpendStatus_pending_threshold_confirmations(first_broadcast_hash_ref, latest_broadcast_height, latest_spending_tx_ref, confirmation_height, confirmation_hash_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_ChannelHandshakeConfig_get_negotiate_anchors_zero_fee_htlc_tx(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_negotiate_anchors_zero_fee_htlc_tx(&this_ptr_conv); +jboolean CS_LDK_OutputSpendStatus_eq(int64_t a, int64_t b) { + LDKOutputSpendStatus* a_conv = (LDKOutputSpendStatus*)untag_ptr(a); + LDKOutputSpendStatus* b_conv = (LDKOutputSpendStatus*)untag_ptr(b); + jboolean ret_conv = OutputSpendStatus_eq(a_conv, b_conv); return ret_conv; } -void CS_LDK_ChannelHandshakeConfig_set_negotiate_anchors_zero_fee_htlc_tx(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_negotiate_anchors_zero_fee_htlc_tx(&this_ptr_conv, val); +int8_tArray CS_LDK_OutputSpendStatus_write(int64_t obj) { + LDKOutputSpendStatus* obj_conv = (LDKOutputSpendStatus*)untag_ptr(obj); + LDKCVec_u8Z ret_var = OutputSpendStatus_write(obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -int16_t CS_LDK_ChannelHandshakeConfig_get_our_max_accepted_htlcs(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; - int16_t ret_conv = ChannelHandshakeConfig_get_our_max_accepted_htlcs(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_OutputSpendStatus_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_OutputSpendStatusDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSpendStatusDecodeErrorZ), "LDKCResult_OutputSpendStatusDecodeErrorZ"); + *ret_conv = OutputSpendStatus_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -void CS_LDK_ChannelHandshakeConfig_set_our_max_accepted_htlcs(int64_t this_ptr, int16_t val) { - LDKChannelHandshakeConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeConfig_set_our_max_accepted_htlcs(&this_ptr_conv, val); +void CS_LDK_OutputSweeper_free(int64_t this_obj) { + LDKOutputSweeper this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OutputSweeper_free(this_obj_conv); } -int64_t CS_LDK_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_OutputSweeper_new(int64_t best_block, int64_t broadcaster, int64_t fee_estimator, int64_t chain_data_source, int64_t output_spender, int64_t change_destination_source, int64_t kv_store, int64_t logger) { + LDKBestBlock best_block_conv; + best_block_conv.inner = untag_ptr(best_block); + best_block_conv.is_owned = ptr_is_owned(best_block); + CHECK_INNER_FIELD_ACCESS_OR_NULL(best_block_conv); + best_block_conv = BestBlock_clone(&best_block_conv); + void* broadcaster_ptr = untag_ptr(broadcaster); + CHECK_ACCESS(broadcaster_ptr); + LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); + if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); + } + void* fee_estimator_ptr = untag_ptr(fee_estimator); + CHECK_ACCESS(fee_estimator_ptr); + LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); + if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); + } + void* chain_data_source_ptr = untag_ptr(chain_data_source); + CHECK_ACCESS(chain_data_source_ptr); + LDKCOption_FilterZ chain_data_source_conv = *(LDKCOption_FilterZ*)(chain_data_source_ptr); + // WARNING: we may need a move here but no clone is available for LDKCOption_FilterZ + if (chain_data_source_conv.tag == LDKCOption_FilterZ_Some) { + // Manually implement clone for Java trait instances + if (chain_data_source_conv.some.free == LDKFilter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFilter_JCalls_cloned(&chain_data_source_conv.some); + } + } + void* output_spender_ptr = untag_ptr(output_spender); + CHECK_ACCESS(output_spender_ptr); + LDKOutputSpender output_spender_conv = *(LDKOutputSpender*)(output_spender_ptr); + if (output_spender_conv.free == LDKOutputSpender_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOutputSpender_JCalls_cloned(&output_spender_conv); + } + void* change_destination_source_ptr = untag_ptr(change_destination_source); + CHECK_ACCESS(change_destination_source_ptr); + LDKChangeDestinationSource change_destination_source_conv = *(LDKChangeDestinationSource*)(change_destination_source_ptr); + if (change_destination_source_conv.free == LDKChangeDestinationSource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKChangeDestinationSource_JCalls_cloned(&change_destination_source_conv); + } + void* kv_store_ptr = untag_ptr(kv_store); + CHECK_ACCESS(kv_store_ptr); + LDKKVStore kv_store_conv = *(LDKKVStore*)(kv_store_ptr); + if (kv_store_conv.free == LDKKVStore_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKKVStore_JCalls_cloned(&kv_store_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKOutputSweeper ret_var = OutputSweeper_new(best_block_conv, broadcaster_conv, fee_estimator_conv, chain_data_source_conv, output_spender_conv, change_destination_source_conv, kv_store_conv, logger_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t ChannelHandshakeConfig_clone_ptr(LDKChannelHandshakeConfig *NONNULL_PTR arg) { - LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -int64_t CS_LDK_ChannelHandshakeConfig_clone_ptr(int64_t arg) { - LDKChannelHandshakeConfig arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = ChannelHandshakeConfig_clone_ptr(&arg_conv); - return ret_conv; +int64_t CS_LDK_OutputSweeper_track_spendable_outputs(int64_t this_arg, int64_tArray output_descriptors, int64_t channel_id, jboolean exclude_static_outputs, int64_t delay_until_height) { + LDKOutputSweeper this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_SpendableOutputDescriptorZ output_descriptors_constr; + output_descriptors_constr.datalen = output_descriptors->arr_len; + if (output_descriptors_constr.datalen > 0) + output_descriptors_constr.data = MALLOC(output_descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); + else + output_descriptors_constr.data = NULL; + int64_t* output_descriptors_vals = output_descriptors->elems; + for (size_t b = 0; b < output_descriptors_constr.datalen; b++) { + int64_t output_descriptors_conv_27 = output_descriptors_vals[b]; + void* output_descriptors_conv_27_ptr = untag_ptr(output_descriptors_conv_27); + CHECK_ACCESS(output_descriptors_conv_27_ptr); + LDKSpendableOutputDescriptor output_descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(output_descriptors_conv_27_ptr); + output_descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(output_descriptors_conv_27)); + output_descriptors_constr.data[b] = output_descriptors_conv_27_conv; + } + FREE(output_descriptors); + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); + void* delay_until_height_ptr = untag_ptr(delay_until_height); + CHECK_ACCESS(delay_until_height_ptr); + LDKCOption_u32Z delay_until_height_conv = *(LDKCOption_u32Z*)(delay_until_height_ptr); + delay_until_height_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(delay_until_height)); + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = OutputSweeper_track_spendable_outputs(&this_arg_conv, output_descriptors_constr, channel_id_conv, exclude_static_outputs, delay_until_height_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelHandshakeConfig_clone(int64_t orig) { - LDKChannelHandshakeConfig orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(&orig_conv); - int64_t ret_ref = 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_OutputSweeper_tracked_spendable_outputs(int64_t this_arg) { + LDKOutputSweeper this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_TrackedSpendableOutputZ ret_var = OutputSweeper_tracked_spendable_outputs(&this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t y = 0; y < ret_var.datalen; y++) { + LDKTrackedSpendableOutput ret_conv_24_var = ret_var.data[y]; + int64_t ret_conv_24_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_24_var); + ret_conv_24_ref = tag_ptr(ret_conv_24_var.inner, ret_conv_24_var.is_owned); + ret_arr_ptr[y] = ret_conv_24_ref; + } + + FREE(ret_var.data); + return ret_arr; } -int64_t CS_LDK_ChannelHandshakeConfig_default() { - LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_default(); +int64_t CS_LDK_OutputSweeper_current_best_block(int64_t this_arg) { + LDKOutputSweeper this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKBestBlock ret_var = OutputSweeper_current_best_block(&this_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -void CS_LDK_ChannelHandshakeLimits_free(int64_t this_obj) { - LDKChannelHandshakeLimits this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelHandshakeLimits_free(this_obj_conv); -} - -int64_t CS_LDK_ChannelHandshakeLimits_get_min_funding_satoshis(int64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelHandshakeLimits_get_min_funding_satoshis(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_OutputSweeper_as_Listen(int64_t this_arg) { + LDKOutputSweeper this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); + *ret_ret = OutputSweeper_as_Listen(&this_arg_conv); + return tag_ptr(ret_ret, true); } -void CS_LDK_ChannelHandshakeLimits_set_min_funding_satoshis(int64_t this_ptr, int64_t val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeLimits_set_min_funding_satoshis(&this_ptr_conv, val); +int64_t CS_LDK_OutputSweeper_as_Confirm(int64_t this_arg) { + LDKOutputSweeper this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); + *ret_ret = OutputSweeper_as_Confirm(&this_arg_conv); + return tag_ptr(ret_ret, true); } -int64_t CS_LDK_ChannelHandshakeLimits_get_max_funding_satoshis(int64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelHandshakeLimits_get_max_funding_satoshis(&this_ptr_conv); - return ret_conv; +void CS_LDK_SpendingDelay_free(int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKSpendingDelay this_ptr_conv = *(LDKSpendingDelay*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + SpendingDelay_free(this_ptr_conv); } -void CS_LDK_ChannelHandshakeLimits_set_max_funding_satoshis(int64_t this_ptr, int64_t val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeLimits_set_max_funding_satoshis(&this_ptr_conv, val); +static inline uint64_t SpendingDelay_clone_ptr(LDKSpendingDelay *NONNULL_PTR arg) { + LDKSpendingDelay *ret_copy = MALLOC(sizeof(LDKSpendingDelay), "LDKSpendingDelay"); + *ret_copy = SpendingDelay_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } - -int64_t CS_LDK_ChannelHandshakeLimits_get_max_htlc_minimum_msat(int64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelHandshakeLimits_get_max_htlc_minimum_msat(&this_ptr_conv); +int64_t CS_LDK_SpendingDelay_clone_ptr(int64_t arg) { + LDKSpendingDelay* arg_conv = (LDKSpendingDelay*)untag_ptr(arg); + int64_t ret_conv = SpendingDelay_clone_ptr(arg_conv); return ret_conv; } -void CS_LDK_ChannelHandshakeLimits_set_max_htlc_minimum_msat(int64_t this_ptr, int64_t val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeLimits_set_max_htlc_minimum_msat(&this_ptr_conv, val); -} - -int64_t CS_LDK_ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(int64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_SpendingDelay_clone(int64_t orig) { + LDKSpendingDelay* orig_conv = (LDKSpendingDelay*)untag_ptr(orig); + LDKSpendingDelay *ret_copy = MALLOC(sizeof(LDKSpendingDelay), "LDKSpendingDelay"); + *ret_copy = SpendingDelay_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(int64_t this_ptr, int64_t val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(&this_ptr_conv, val); +int64_t CS_LDK_SpendingDelay_relative(int32_t num_blocks) { + LDKSpendingDelay *ret_copy = MALLOC(sizeof(LDKSpendingDelay), "LDKSpendingDelay"); + *ret_copy = SpendingDelay_relative(num_blocks); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_ChannelHandshakeLimits_get_max_channel_reserve_satoshis(int64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelHandshakeLimits_get_max_channel_reserve_satoshis(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_SpendingDelay_absolute(int32_t height) { + LDKSpendingDelay *ret_copy = MALLOC(sizeof(LDKSpendingDelay), "LDKSpendingDelay"); + *ret_copy = SpendingDelay_absolute(height); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_ChannelHandshakeLimits_set_max_channel_reserve_satoshis(int64_t this_ptr, int64_t val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeLimits_set_max_channel_reserve_satoshis(&this_ptr_conv, val); -} - -int16_t CS_LDK_ChannelHandshakeLimits_get_min_max_accepted_htlcs(int64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int16_t ret_conv = ChannelHandshakeLimits_get_min_max_accepted_htlcs(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_ChannelHandshakeLimits_set_min_max_accepted_htlcs(int64_t this_ptr, int16_t val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeLimits_set_min_max_accepted_htlcs(&this_ptr_conv, val); -} - -int32_t CS_LDK_ChannelHandshakeLimits_get_max_minimum_depth(int64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int32_t ret_conv = ChannelHandshakeLimits_get_max_minimum_depth(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_OutputSweeper_read(int8_tArray ser, int64_t arg_a, int64_t arg_b, int64_t arg_c, int64_t arg_d, int64_t arg_e, int64_t arg_f, int64_t arg_g) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + void* arg_a_ptr = untag_ptr(arg_a); + CHECK_ACCESS(arg_a_ptr); + LDKBroadcasterInterface arg_a_conv = *(LDKBroadcasterInterface*)(arg_a_ptr); + if (arg_a_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&arg_a_conv); + } + void* arg_b_ptr = untag_ptr(arg_b); + CHECK_ACCESS(arg_b_ptr); + LDKFeeEstimator arg_b_conv = *(LDKFeeEstimator*)(arg_b_ptr); + if (arg_b_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&arg_b_conv); + } + void* arg_c_ptr = untag_ptr(arg_c); + CHECK_ACCESS(arg_c_ptr); + LDKCOption_FilterZ arg_c_conv = *(LDKCOption_FilterZ*)(arg_c_ptr); + // WARNING: we may need a move here but no clone is available for LDKCOption_FilterZ + if (arg_c_conv.tag == LDKCOption_FilterZ_Some) { + // Manually implement clone for Java trait instances + if (arg_c_conv.some.free == LDKFilter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFilter_JCalls_cloned(&arg_c_conv.some); + } + } + void* arg_d_ptr = untag_ptr(arg_d); + CHECK_ACCESS(arg_d_ptr); + LDKOutputSpender arg_d_conv = *(LDKOutputSpender*)(arg_d_ptr); + if (arg_d_conv.free == LDKOutputSpender_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOutputSpender_JCalls_cloned(&arg_d_conv); + } + void* arg_e_ptr = untag_ptr(arg_e); + CHECK_ACCESS(arg_e_ptr); + LDKChangeDestinationSource arg_e_conv = *(LDKChangeDestinationSource*)(arg_e_ptr); + if (arg_e_conv.free == LDKChangeDestinationSource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKChangeDestinationSource_JCalls_cloned(&arg_e_conv); + } + void* arg_f_ptr = untag_ptr(arg_f); + CHECK_ACCESS(arg_f_ptr); + LDKKVStore arg_f_conv = *(LDKKVStore*)(arg_f_ptr); + if (arg_f_conv.free == LDKKVStore_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKKVStore_JCalls_cloned(&arg_f_conv); + } + void* arg_g_ptr = untag_ptr(arg_g); + CHECK_ACCESS(arg_g_ptr); + LDKLogger arg_g_conv = *(LDKLogger*)(arg_g_ptr); + if (arg_g_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&arg_g_conv); + } + LDKCResult_OutputSweeperDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSweeperDecodeErrorZ), "LDKCResult_OutputSweeperDecodeErrorZ"); + *ret_conv = OutputSweeper_read(ser_ref, arg_a_conv, arg_b_conv, arg_c_conv, arg_d_conv, arg_e_conv, arg_f_conv, arg_g_conv); + FREE(ser); + return tag_ptr(ret_conv, true); } -void CS_LDK_ChannelHandshakeLimits_set_max_minimum_depth(int64_t this_ptr, int32_t val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeLimits_set_max_minimum_depth(&this_ptr_conv, val); +int64_t CS_LDK_C2Tuple_BestBlockOutputSweeperZ_read(int8_tArray ser, int64_t arg_a, int64_t arg_b, int64_t arg_c, int64_t arg_d, int64_t arg_e, int64_t arg_f, int64_t arg_g) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + void* arg_a_ptr = untag_ptr(arg_a); + CHECK_ACCESS(arg_a_ptr); + LDKBroadcasterInterface arg_a_conv = *(LDKBroadcasterInterface*)(arg_a_ptr); + if (arg_a_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&arg_a_conv); + } + void* arg_b_ptr = untag_ptr(arg_b); + CHECK_ACCESS(arg_b_ptr); + LDKFeeEstimator arg_b_conv = *(LDKFeeEstimator*)(arg_b_ptr); + if (arg_b_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&arg_b_conv); + } + void* arg_c_ptr = untag_ptr(arg_c); + CHECK_ACCESS(arg_c_ptr); + LDKCOption_FilterZ arg_c_conv = *(LDKCOption_FilterZ*)(arg_c_ptr); + // WARNING: we may need a move here but no clone is available for LDKCOption_FilterZ + if (arg_c_conv.tag == LDKCOption_FilterZ_Some) { + // Manually implement clone for Java trait instances + if (arg_c_conv.some.free == LDKFilter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFilter_JCalls_cloned(&arg_c_conv.some); + } + } + void* arg_d_ptr = untag_ptr(arg_d); + CHECK_ACCESS(arg_d_ptr); + LDKOutputSpender arg_d_conv = *(LDKOutputSpender*)(arg_d_ptr); + if (arg_d_conv.free == LDKOutputSpender_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOutputSpender_JCalls_cloned(&arg_d_conv); + } + void* arg_e_ptr = untag_ptr(arg_e); + CHECK_ACCESS(arg_e_ptr); + LDKChangeDestinationSource arg_e_conv = *(LDKChangeDestinationSource*)(arg_e_ptr); + if (arg_e_conv.free == LDKChangeDestinationSource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKChangeDestinationSource_JCalls_cloned(&arg_e_conv); + } + void* arg_f_ptr = untag_ptr(arg_f); + CHECK_ACCESS(arg_f_ptr); + LDKKVStore arg_f_conv = *(LDKKVStore*)(arg_f_ptr); + if (arg_f_conv.free == LDKKVStore_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKKVStore_JCalls_cloned(&arg_f_conv); + } + void* arg_g_ptr = untag_ptr(arg_g); + CHECK_ACCESS(arg_g_ptr); + LDKLogger arg_g_conv = *(LDKLogger*)(arg_g_ptr); + if (arg_g_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&arg_g_conv); + } + LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ), "LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ"); + *ret_conv = C2Tuple_BestBlockOutputSweeperZ_read(ser_ref, arg_a_conv, arg_b_conv, arg_c_conv, arg_d_conv, arg_e_conv, arg_f_conv, arg_g_conv); + FREE(ser); + return tag_ptr(ret_conv, true); } -jboolean CS_LDK_ChannelHandshakeLimits_get_trust_own_funding_0conf(int64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - jboolean ret_conv = ChannelHandshakeLimits_get_trust_own_funding_0conf(&this_ptr_conv); - return ret_conv; +void CS_LDK_FutureCallback_free(int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKFutureCallback this_ptr_conv = *(LDKFutureCallback*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + FutureCallback_free(this_ptr_conv); } -void CS_LDK_ChannelHandshakeLimits_set_trust_own_funding_0conf(int64_t this_ptr, jboolean val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeLimits_set_trust_own_funding_0conf(&this_ptr_conv, val); +void CS_LDK_Future_free(int64_t this_obj) { + LDKFuture this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Future_free(this_obj_conv); } -jboolean CS_LDK_ChannelHandshakeLimits_get_force_announced_channel_preference(int64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - jboolean ret_conv = ChannelHandshakeLimits_get_force_announced_channel_preference(&this_ptr_conv); - return ret_conv; +void CS_LDK_Future_register_callback_fn(int64_t this_arg, int64_t callback) { + LDKFuture this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + void* callback_ptr = untag_ptr(callback); + CHECK_ACCESS(callback_ptr); + LDKFutureCallback callback_conv = *(LDKFutureCallback*)(callback_ptr); + if (callback_conv.free == LDKFutureCallback_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFutureCallback_JCalls_cloned(&callback_conv); + } + Future_register_callback_fn(&this_arg_conv, callback_conv); } -void CS_LDK_ChannelHandshakeLimits_set_force_announced_channel_preference(int64_t this_ptr, jboolean val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeLimits_set_force_announced_channel_preference(&this_ptr_conv, val); +void CS_LDK_Future_wait(int64_t this_arg) { + LDKFuture this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + Future_wait(&this_arg_conv); } -int16_t CS_LDK_ChannelHandshakeLimits_get_their_to_self_delay(int64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int16_t ret_conv = ChannelHandshakeLimits_get_their_to_self_delay(&this_ptr_conv); +jboolean CS_LDK_Future_wait_timeout(int64_t this_arg, int64_t max_wait) { + LDKFuture this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Future_wait_timeout(&this_arg_conv, max_wait); return ret_conv; } -void CS_LDK_ChannelHandshakeLimits_set_their_to_self_delay(int64_t this_ptr, int16_t val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeLimits_set_their_to_self_delay(&this_ptr_conv, val); +void CS_LDK_Sleeper_free(int64_t this_obj) { + LDKSleeper this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Sleeper_free(this_obj_conv); } -int64_t CS_LDK_ChannelHandshakeLimits_new(int64_t min_funding_satoshis_arg, int64_t max_funding_satoshis_arg, int64_t max_htlc_minimum_msat_arg, int64_t min_max_htlc_value_in_flight_msat_arg, int64_t max_channel_reserve_satoshis_arg, int16_t min_max_accepted_htlcs_arg, int32_t max_minimum_depth_arg, jboolean trust_own_funding_0conf_arg, jboolean force_announced_channel_preference_arg, int16_t their_to_self_delay_arg) { - LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_new(min_funding_satoshis_arg, max_funding_satoshis_arg, max_htlc_minimum_msat_arg, min_max_htlc_value_in_flight_msat_arg, max_channel_reserve_satoshis_arg, min_max_accepted_htlcs_arg, max_minimum_depth_arg, trust_own_funding_0conf_arg, force_announced_channel_preference_arg, their_to_self_delay_arg); +int64_t CS_LDK_Sleeper_from_single_future(int64_t future) { + LDKFuture future_conv; + future_conv.inner = untag_ptr(future); + future_conv.is_owned = ptr_is_owned(future); + CHECK_INNER_FIELD_ACCESS_OR_NULL(future_conv); + future_conv.is_owned = false; + LDKSleeper ret_var = Sleeper_from_single_future(&future_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t ChannelHandshakeLimits_clone_ptr(LDKChannelHandshakeLimits *NONNULL_PTR arg) { - LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(arg); +int64_t CS_LDK_Sleeper_from_two_futures(int64_t fut_a, int64_t fut_b) { + 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; + LDKSleeper ret_var = Sleeper_from_two_futures(&fut_a_conv, &fut_b_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_ChannelHandshakeLimits_clone_ptr(int64_t arg) { - LDKChannelHandshakeLimits arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = ChannelHandshakeLimits_clone_ptr(&arg_conv); - return ret_conv; -} -int64_t CS_LDK_ChannelHandshakeLimits_clone(int64_t orig) { - LDKChannelHandshakeLimits orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(&orig_conv); +int64_t CS_LDK_Sleeper_new(int64_tArray futures) { + LDKCVec_FutureZ futures_constr; + futures_constr.datalen = futures->arr_len; + if (futures_constr.datalen > 0) + futures_constr.data = MALLOC(futures_constr.datalen * sizeof(LDKFuture), "LDKCVec_FutureZ Elements"); + else + futures_constr.data = NULL; + int64_t* futures_vals = futures->elems; + for (size_t i = 0; i < futures_constr.datalen; i++) { + int64_t futures_conv_8 = futures_vals[i]; + LDKFuture futures_conv_8_conv; + futures_conv_8_conv.inner = untag_ptr(futures_conv_8); + futures_conv_8_conv.is_owned = ptr_is_owned(futures_conv_8); + CHECK_INNER_FIELD_ACCESS_OR_NULL(futures_conv_8_conv); + // WARNING: we need a move here but no clone is available for LDKFuture + + futures_constr.data[i] = futures_conv_8_conv; + } + FREE(futures); + LDKSleeper ret_var = Sleeper_new(futures_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_ChannelHandshakeLimits_default() { - LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_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_Sleeper_wait(int64_t this_arg) { + LDKSleeper this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + Sleeper_wait(&this_arg_conv); } -void CS_LDK_MaxDustHTLCExposure_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); - LDKMaxDustHTLCExposure this_ptr_conv = *(LDKMaxDustHTLCExposure*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - MaxDustHTLCExposure_free(this_ptr_conv); +jboolean CS_LDK_Sleeper_wait_timeout(int64_t this_arg, int64_t max_wait) { + LDKSleeper this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Sleeper_wait_timeout(&this_arg_conv, max_wait); + return ret_conv; } -static inline uint64_t MaxDustHTLCExposure_clone_ptr(LDKMaxDustHTLCExposure *NONNULL_PTR arg) { - LDKMaxDustHTLCExposure *ret_copy = MALLOC(sizeof(LDKMaxDustHTLCExposure), "LDKMaxDustHTLCExposure"); - *ret_copy = MaxDustHTLCExposure_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_Level_clone(int64_t orig) { + LDKLevel* orig_conv = (LDKLevel*)untag_ptr(orig); + int32_t ret_conv = LDKLevel_to_cs(Level_clone(orig_conv)); + return ret_conv; } -int64_t CS_LDK_MaxDustHTLCExposure_clone_ptr(int64_t arg) { - LDKMaxDustHTLCExposure* arg_conv = (LDKMaxDustHTLCExposure*)untag_ptr(arg); - int64_t ret_conv = MaxDustHTLCExposure_clone_ptr(arg_conv); + +int32_t CS_LDK_Level_gossip() { + int32_t ret_conv = LDKLevel_to_cs(Level_gossip()); return ret_conv; } -int64_t CS_LDK_MaxDustHTLCExposure_clone(int64_t orig) { - LDKMaxDustHTLCExposure* orig_conv = (LDKMaxDustHTLCExposure*)untag_ptr(orig); - LDKMaxDustHTLCExposure *ret_copy = MALLOC(sizeof(LDKMaxDustHTLCExposure), "LDKMaxDustHTLCExposure"); - *ret_copy = MaxDustHTLCExposure_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_Level_trace() { + int32_t ret_conv = LDKLevel_to_cs(Level_trace()); + return ret_conv; } -int64_t CS_LDK_MaxDustHTLCExposure_fixed_limit_msat(int64_t a) { - LDKMaxDustHTLCExposure *ret_copy = MALLOC(sizeof(LDKMaxDustHTLCExposure), "LDKMaxDustHTLCExposure"); - *ret_copy = MaxDustHTLCExposure_fixed_limit_msat(a); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_Level_debug() { + int32_t ret_conv = LDKLevel_to_cs(Level_debug()); + return ret_conv; } -int64_t CS_LDK_MaxDustHTLCExposure_fee_rate_multiplier(int64_t a) { - LDKMaxDustHTLCExposure *ret_copy = MALLOC(sizeof(LDKMaxDustHTLCExposure), "LDKMaxDustHTLCExposure"); - *ret_copy = MaxDustHTLCExposure_fee_rate_multiplier(a); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_Level_info() { + int32_t ret_conv = LDKLevel_to_cs(Level_info()); + return ret_conv; } -jboolean CS_LDK_MaxDustHTLCExposure_eq(int64_t a, int64_t b) { - LDKMaxDustHTLCExposure* a_conv = (LDKMaxDustHTLCExposure*)untag_ptr(a); - LDKMaxDustHTLCExposure* b_conv = (LDKMaxDustHTLCExposure*)untag_ptr(b); - jboolean ret_conv = MaxDustHTLCExposure_eq(a_conv, b_conv); +int32_t CS_LDK_Level_warn() { + int32_t ret_conv = LDKLevel_to_cs(Level_warn()); return ret_conv; } -int8_tArray CS_LDK_MaxDustHTLCExposure_write(int64_t obj) { - LDKMaxDustHTLCExposure* obj_conv = (LDKMaxDustHTLCExposure*)untag_ptr(obj); - LDKCVec_u8Z ret_var = MaxDustHTLCExposure_write(obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +int32_t CS_LDK_Level_error() { + int32_t ret_conv = LDKLevel_to_cs(Level_error()); + return ret_conv; } -int64_t CS_LDK_MaxDustHTLCExposure_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_MaxDustHTLCExposureDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_MaxDustHTLCExposureDecodeErrorZ), "LDKCResult_MaxDustHTLCExposureDecodeErrorZ"); - *ret_conv = MaxDustHTLCExposure_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +jboolean CS_LDK_Level_eq(int64_t a, int64_t b) { + LDKLevel* a_conv = (LDKLevel*)untag_ptr(a); + LDKLevel* b_conv = (LDKLevel*)untag_ptr(b); + jboolean ret_conv = Level_eq(a_conv, b_conv); + return ret_conv; } -void CS_LDK_ChannelConfig_free(int64_t this_obj) { - LDKChannelConfig this_obj_conv; +int64_t CS_LDK_Level_hash(int64_t o) { + LDKLevel* o_conv = (LDKLevel*)untag_ptr(o); + int64_t ret_conv = Level_hash(o_conv); + return ret_conv; +} + +jstring CS_LDK_Level_to_str(int64_t o) { + LDKLevel* o_conv = (LDKLevel*)untag_ptr(o); + LDKStr ret_str = Level_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_Level_max() { + int32_t ret_conv = LDKLevel_to_cs(Level_max()); + return ret_conv; +} + +void CS_LDK_Record_free(int64_t this_obj) { + LDKRecord this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelConfig_free(this_obj_conv); + Record_free(this_obj_conv); } -int32_t CS_LDK_ChannelConfig_get_forwarding_fee_proportional_millionths(int64_t this_ptr) { - LDKChannelConfig this_ptr_conv; +int32_t CS_LDK_Record_get_level(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; - int32_t ret_conv = ChannelConfig_get_forwarding_fee_proportional_millionths(&this_ptr_conv); + int32_t ret_conv = LDKLevel_to_cs(Record_get_level(&this_ptr_conv)); return ret_conv; } -void CS_LDK_ChannelConfig_set_forwarding_fee_proportional_millionths(int64_t this_ptr, int32_t val) { - LDKChannelConfig this_ptr_conv; +void CS_LDK_Record_set_level(int64_t this_ptr, int32_t val) { + LDKRecord this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelConfig_set_forwarding_fee_proportional_millionths(&this_ptr_conv, val); + LDKLevel val_conv = LDKLevel_from_cs(val); + Record_set_level(&this_ptr_conv, val_conv); } -int32_t CS_LDK_ChannelConfig_get_forwarding_fee_base_msat(int64_t this_ptr) { - LDKChannelConfig this_ptr_conv; +int8_tArray CS_LDK_Record_get_peer_id(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; - int32_t ret_conv = ChannelConfig_get_forwarding_fee_base_msat(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, Record_get_peer_id(&this_ptr_conv).compressed_form, 33); + return ret_arr; } -void CS_LDK_ChannelConfig_set_forwarding_fee_base_msat(int64_t this_ptr, int32_t val) { - LDKChannelConfig this_ptr_conv; +void CS_LDK_Record_set_peer_id(int64_t this_ptr, int8_tArray val) { + LDKRecord this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelConfig_set_forwarding_fee_base_msat(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + Record_set_peer_id(&this_ptr_conv, val_ref); } -int16_t CS_LDK_ChannelConfig_get_cltv_expiry_delta(int64_t this_ptr) { - LDKChannelConfig this_ptr_conv; +int64_t CS_LDK_Record_get_channel_id(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; - int16_t ret_conv = ChannelConfig_get_cltv_expiry_delta(&this_ptr_conv); - return ret_conv; + LDKChannelId ret_var = Record_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_ChannelConfig_set_cltv_expiry_delta(int64_t this_ptr, int16_t val) { - LDKChannelConfig this_ptr_conv; +void CS_LDK_Record_set_channel_id(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; - ChannelConfig_set_cltv_expiry_delta(&this_ptr_conv, val); + LDKChannelId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelId_clone(&val_conv); + Record_set_channel_id(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelConfig_get_max_dust_htlc_exposure(int64_t this_ptr) { - LDKChannelConfig this_ptr_conv; +jstring CS_LDK_Record_get_args(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; - LDKMaxDustHTLCExposure *ret_copy = MALLOC(sizeof(LDKMaxDustHTLCExposure), "LDKMaxDustHTLCExposure"); - *ret_copy = ChannelConfig_get_max_dust_htlc_exposure(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKStr ret_str = Record_get_args(&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_ChannelConfig_set_max_dust_htlc_exposure(int64_t this_ptr, int64_t val) { - LDKChannelConfig this_ptr_conv; +void CS_LDK_Record_set_args(int64_t this_ptr, jstring val) { + LDKRecord this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKMaxDustHTLCExposure val_conv = *(LDKMaxDustHTLCExposure*)(val_ptr); - val_conv = MaxDustHTLCExposure_clone((LDKMaxDustHTLCExposure*)untag_ptr(val)); - ChannelConfig_set_max_dust_htlc_exposure(&this_ptr_conv, val_conv); + LDKStr val_conv = str_ref_to_owned_c(val); + Record_set_args(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelConfig_get_force_close_avoidance_max_fee_satoshis(int64_t this_ptr) { - LDKChannelConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); +jstring CS_LDK_Record_get_module_path(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; - int64_t ret_conv = ChannelConfig_get_force_close_avoidance_max_fee_satoshis(&this_ptr_conv); + LDKStr ret_str = Record_get_module_path(&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_ChannelConfig_set_force_close_avoidance_max_fee_satoshis(int64_t this_ptr, int64_t val) { - LDKChannelConfig this_ptr_conv; +void CS_LDK_Record_set_module_path(int64_t this_ptr, jstring val) { + LDKRecord this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelConfig_set_force_close_avoidance_max_fee_satoshis(&this_ptr_conv, val); + LDKStr val_conv = str_ref_to_owned_c(val); + Record_set_module_path(&this_ptr_conv, val_conv); } -jboolean CS_LDK_ChannelConfig_get_accept_underpaying_htlcs(int64_t this_ptr) { - LDKChannelConfig this_ptr_conv; +jstring CS_LDK_Record_get_file(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; - jboolean ret_conv = ChannelConfig_get_accept_underpaying_htlcs(&this_ptr_conv); + LDKStr ret_str = Record_get_file(&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_ChannelConfig_set_accept_underpaying_htlcs(int64_t this_ptr, jboolean val) { - LDKChannelConfig this_ptr_conv; +void CS_LDK_Record_set_file(int64_t this_ptr, jstring val) { + LDKRecord this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelConfig_set_accept_underpaying_htlcs(&this_ptr_conv, val); + LDKStr val_conv = str_ref_to_owned_c(val); + Record_set_file(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelConfig_new(int32_t forwarding_fee_proportional_millionths_arg, int32_t forwarding_fee_base_msat_arg, int16_t cltv_expiry_delta_arg, int64_t max_dust_htlc_exposure_arg, int64_t force_close_avoidance_max_fee_satoshis_arg, jboolean accept_underpaying_htlcs_arg) { - void* max_dust_htlc_exposure_arg_ptr = untag_ptr(max_dust_htlc_exposure_arg); - CHECK_ACCESS(max_dust_htlc_exposure_arg_ptr); - LDKMaxDustHTLCExposure max_dust_htlc_exposure_arg_conv = *(LDKMaxDustHTLCExposure*)(max_dust_htlc_exposure_arg_ptr); - max_dust_htlc_exposure_arg_conv = MaxDustHTLCExposure_clone((LDKMaxDustHTLCExposure*)untag_ptr(max_dust_htlc_exposure_arg)); - LDKChannelConfig ret_var = ChannelConfig_new(forwarding_fee_proportional_millionths_arg, forwarding_fee_base_msat_arg, cltv_expiry_delta_arg, max_dust_htlc_exposure_arg_conv, force_close_avoidance_max_fee_satoshis_arg, accept_underpaying_htlcs_arg); +int32_t CS_LDK_Record_get_line(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; + int32_t ret_conv = Record_get_line(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_Record_set_line(int64_t this_ptr, int32_t val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + Record_set_line(&this_ptr_conv, val); +} + +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) { + LDKLevel level_arg_conv = LDKLevel_from_cs(level_arg); + LDKPublicKey peer_id_arg_ref; + CHECK(peer_id_arg->arr_len == 33); + memcpy(peer_id_arg_ref.compressed_form, peer_id_arg->elems, 33); FREE(peer_id_arg); + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); + LDKStr args_arg_conv = str_ref_to_owned_c(args_arg); + LDKStr module_path_arg_conv = str_ref_to_owned_c(module_path_arg); + LDKStr file_arg_conv = str_ref_to_owned_c(file_arg); + LDKRecord ret_var = Record_new(level_arg_conv, peer_id_arg_ref, channel_id_arg_conv, args_arg_conv, module_path_arg_conv, file_arg_conv, line_arg); int64_t ret_ref = 0; 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 ChannelConfig_clone_ptr(LDKChannelConfig *NONNULL_PTR arg) { - LDKChannelConfig ret_var = ChannelConfig_clone(arg); +static inline uint64_t Record_clone_ptr(LDKRecord *NONNULL_PTR arg) { + LDKRecord ret_var = Record_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_ChannelConfig_clone_ptr(int64_t arg) { - LDKChannelConfig arg_conv; +int64_t CS_LDK_Record_clone_ptr(int64_t arg) { + LDKRecord arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = ChannelConfig_clone_ptr(&arg_conv); + int64_t ret_conv = Record_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_ChannelConfig_clone(int64_t orig) { - LDKChannelConfig orig_conv; +int64_t CS_LDK_Record_clone(int64_t orig) { + LDKRecord orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKChannelConfig ret_var = ChannelConfig_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_ChannelConfig_eq(int64_t a, int64_t b) { - LDKChannelConfig a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKChannelConfig b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = ChannelConfig_eq(&a_conv, &b_conv); - return ret_conv; -} - -void CS_LDK_ChannelConfig_apply(int64_t this_arg, int64_t update) { - LDKChannelConfig this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelConfigUpdate update_conv; - update_conv.inner = untag_ptr(update); - update_conv.is_owned = ptr_is_owned(update); - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv); - update_conv.is_owned = false; - ChannelConfig_apply(&this_arg_conv, &update_conv); -} - -int64_t CS_LDK_ChannelConfig_default() { - LDKChannelConfig ret_var = ChannelConfig_default(); + LDKRecord ret_var = Record_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_ChannelConfig_write(int64_t obj) { - LDKChannelConfig obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ChannelConfig_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -int64_t CS_LDK_ChannelConfig_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); - *ret_conv = ChannelConfig_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void CS_LDK_Logger_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); + LDKLogger this_ptr_conv = *(LDKLogger*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Logger_free(this_ptr_conv); } -void CS_LDK_ChannelConfigUpdate_free(int64_t this_obj) { - LDKChannelConfigUpdate this_obj_conv; +void CS_LDK_ChannelHandshakeConfig_free(int64_t this_obj) { + LDKChannelHandshakeConfig this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelConfigUpdate_free(this_obj_conv); -} - -int64_t CS_LDK_ChannelConfigUpdate_get_forwarding_fee_proportional_millionths(int64_t this_ptr) { - LDKChannelConfigUpdate this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); - *ret_copy = ChannelConfigUpdate_get_forwarding_fee_proportional_millionths(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -void CS_LDK_ChannelConfigUpdate_set_forwarding_fee_proportional_millionths(int64_t this_ptr, int64_t val) { - LDKChannelConfigUpdate this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); - val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val)); - ChannelConfigUpdate_set_forwarding_fee_proportional_millionths(&this_ptr_conv, val_conv); -} - -int64_t CS_LDK_ChannelConfigUpdate_get_forwarding_fee_base_msat(int64_t this_ptr) { - LDKChannelConfigUpdate this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); - *ret_copy = ChannelConfigUpdate_get_forwarding_fee_base_msat(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -void CS_LDK_ChannelConfigUpdate_set_forwarding_fee_base_msat(int64_t this_ptr, int64_t val) { - LDKChannelConfigUpdate this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); - val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val)); - ChannelConfigUpdate_set_forwarding_fee_base_msat(&this_ptr_conv, val_conv); -} - -int64_t CS_LDK_ChannelConfigUpdate_get_cltv_expiry_delta(int64_t this_ptr) { - LDKChannelConfigUpdate this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); - *ret_copy = ChannelConfigUpdate_get_cltv_expiry_delta(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -void CS_LDK_ChannelConfigUpdate_set_cltv_expiry_delta(int64_t this_ptr, int64_t val) { - LDKChannelConfigUpdate this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr); - val_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(val)); - ChannelConfigUpdate_set_cltv_expiry_delta(&this_ptr_conv, val_conv); + ChannelHandshakeConfig_free(this_obj_conv); } -int64_t CS_LDK_ChannelConfigUpdate_get_max_dust_htlc_exposure_msat(int64_t this_ptr) { - LDKChannelConfigUpdate this_ptr_conv; +int32_t CS_LDK_ChannelHandshakeConfig_get_minimum_depth(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; - LDKCOption_MaxDustHTLCExposureZ *ret_copy = MALLOC(sizeof(LDKCOption_MaxDustHTLCExposureZ), "LDKCOption_MaxDustHTLCExposureZ"); - *ret_copy = ChannelConfigUpdate_get_max_dust_htlc_exposure_msat(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + int32_t ret_conv = ChannelHandshakeConfig_get_minimum_depth(&this_ptr_conv); + return ret_conv; } -void CS_LDK_ChannelConfigUpdate_set_max_dust_htlc_exposure_msat(int64_t this_ptr, int64_t val) { - LDKChannelConfigUpdate this_ptr_conv; +void CS_LDK_ChannelHandshakeConfig_set_minimum_depth(int64_t this_ptr, int32_t val) { + LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_MaxDustHTLCExposureZ val_conv = *(LDKCOption_MaxDustHTLCExposureZ*)(val_ptr); - val_conv = COption_MaxDustHTLCExposureZ_clone((LDKCOption_MaxDustHTLCExposureZ*)untag_ptr(val)); - ChannelConfigUpdate_set_max_dust_htlc_exposure_msat(&this_ptr_conv, val_conv); + ChannelHandshakeConfig_set_minimum_depth(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelConfigUpdate_get_force_close_avoidance_max_fee_satoshis(int64_t this_ptr) { - LDKChannelConfigUpdate this_ptr_conv; +int16_t CS_LDK_ChannelHandshakeConfig_get_our_to_self_delay(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; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelConfigUpdate_get_force_close_avoidance_max_fee_satoshis(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + int16_t ret_conv = ChannelHandshakeConfig_get_our_to_self_delay(&this_ptr_conv); + return ret_conv; } -void CS_LDK_ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis(int64_t this_ptr, int64_t val) { - LDKChannelConfigUpdate this_ptr_conv; +void CS_LDK_ChannelHandshakeConfig_set_our_to_self_delay(int64_t this_ptr, int16_t val) { + LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis(&this_ptr_conv, val_conv); -} - -int64_t CS_LDK_ChannelConfigUpdate_new(int64_t forwarding_fee_proportional_millionths_arg, int64_t forwarding_fee_base_msat_arg, int64_t cltv_expiry_delta_arg, int64_t max_dust_htlc_exposure_msat_arg, int64_t force_close_avoidance_max_fee_satoshis_arg) { - void* forwarding_fee_proportional_millionths_arg_ptr = untag_ptr(forwarding_fee_proportional_millionths_arg); - CHECK_ACCESS(forwarding_fee_proportional_millionths_arg_ptr); - LDKCOption_u32Z forwarding_fee_proportional_millionths_arg_conv = *(LDKCOption_u32Z*)(forwarding_fee_proportional_millionths_arg_ptr); - forwarding_fee_proportional_millionths_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(forwarding_fee_proportional_millionths_arg)); - void* forwarding_fee_base_msat_arg_ptr = untag_ptr(forwarding_fee_base_msat_arg); - CHECK_ACCESS(forwarding_fee_base_msat_arg_ptr); - LDKCOption_u32Z forwarding_fee_base_msat_arg_conv = *(LDKCOption_u32Z*)(forwarding_fee_base_msat_arg_ptr); - forwarding_fee_base_msat_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(forwarding_fee_base_msat_arg)); - void* cltv_expiry_delta_arg_ptr = untag_ptr(cltv_expiry_delta_arg); - CHECK_ACCESS(cltv_expiry_delta_arg_ptr); - LDKCOption_u16Z cltv_expiry_delta_arg_conv = *(LDKCOption_u16Z*)(cltv_expiry_delta_arg_ptr); - cltv_expiry_delta_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(cltv_expiry_delta_arg)); - void* max_dust_htlc_exposure_msat_arg_ptr = untag_ptr(max_dust_htlc_exposure_msat_arg); - CHECK_ACCESS(max_dust_htlc_exposure_msat_arg_ptr); - LDKCOption_MaxDustHTLCExposureZ max_dust_htlc_exposure_msat_arg_conv = *(LDKCOption_MaxDustHTLCExposureZ*)(max_dust_htlc_exposure_msat_arg_ptr); - max_dust_htlc_exposure_msat_arg_conv = COption_MaxDustHTLCExposureZ_clone((LDKCOption_MaxDustHTLCExposureZ*)untag_ptr(max_dust_htlc_exposure_msat_arg)); - void* force_close_avoidance_max_fee_satoshis_arg_ptr = untag_ptr(force_close_avoidance_max_fee_satoshis_arg); - CHECK_ACCESS(force_close_avoidance_max_fee_satoshis_arg_ptr); - LDKCOption_u64Z force_close_avoidance_max_fee_satoshis_arg_conv = *(LDKCOption_u64Z*)(force_close_avoidance_max_fee_satoshis_arg_ptr); - force_close_avoidance_max_fee_satoshis_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(force_close_avoidance_max_fee_satoshis_arg)); - LDKChannelConfigUpdate ret_var = ChannelConfigUpdate_new(forwarding_fee_proportional_millionths_arg_conv, forwarding_fee_base_msat_arg_conv, cltv_expiry_delta_arg_conv, max_dust_htlc_exposure_msat_arg_conv, force_close_avoidance_max_fee_satoshis_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - 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); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - UserConfig_free(this_obj_conv); + ChannelHandshakeConfig_set_our_to_self_delay(&this_ptr_conv, val); } -int64_t CS_LDK_UserConfig_get_channel_handshake_config(int64_t this_ptr) { - LDKUserConfig this_ptr_conv; +int64_t CS_LDK_ChannelHandshakeConfig_get_our_htlc_minimum_msat(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; - LDKChannelHandshakeConfig ret_var = UserConfig_get_channel_handshake_config(&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 = ChannelHandshakeConfig_get_our_htlc_minimum_msat(&this_ptr_conv); + return ret_conv; } -void CS_LDK_UserConfig_set_channel_handshake_config(int64_t this_ptr, int64_t val) { - LDKUserConfig this_ptr_conv; +void CS_LDK_ChannelHandshakeConfig_set_our_htlc_minimum_msat(int64_t this_ptr, int64_t val) { + LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelHandshakeConfig val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelHandshakeConfig_clone(&val_conv); - UserConfig_set_channel_handshake_config(&this_ptr_conv, val_conv); + ChannelHandshakeConfig_set_our_htlc_minimum_msat(&this_ptr_conv, val); } -int64_t CS_LDK_UserConfig_get_channel_handshake_limits(int64_t this_ptr) { - LDKUserConfig this_ptr_conv; +int8_t CS_LDK_ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(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; - LDKChannelHandshakeLimits ret_var = UserConfig_get_channel_handshake_limits(&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_t ret_conv = ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(&this_ptr_conv); + return ret_conv; } -void CS_LDK_UserConfig_set_channel_handshake_limits(int64_t this_ptr, int64_t val) { - LDKUserConfig this_ptr_conv; +void CS_LDK_ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(int64_t this_ptr, int8_t val) { + LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelHandshakeLimits val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelHandshakeLimits_clone(&val_conv); - UserConfig_set_channel_handshake_limits(&this_ptr_conv, val_conv); + ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(&this_ptr_conv, val); } -int64_t CS_LDK_UserConfig_get_channel_config(int64_t this_ptr) { - LDKUserConfig this_ptr_conv; +jboolean CS_LDK_ChannelHandshakeConfig_get_negotiate_scid_privacy(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; - LDKChannelConfig ret_var = UserConfig_get_channel_config(&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 ret_conv = ChannelHandshakeConfig_get_negotiate_scid_privacy(&this_ptr_conv); + return ret_conv; } -void CS_LDK_UserConfig_set_channel_config(int64_t this_ptr, int64_t val) { - LDKUserConfig this_ptr_conv; +void CS_LDK_ChannelHandshakeConfig_set_negotiate_scid_privacy(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; - LDKChannelConfig val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelConfig_clone(&val_conv); - UserConfig_set_channel_config(&this_ptr_conv, val_conv); + ChannelHandshakeConfig_set_negotiate_scid_privacy(&this_ptr_conv, val); } -jboolean CS_LDK_UserConfig_get_accept_forwards_to_priv_channels(int64_t this_ptr) { - LDKUserConfig this_ptr_conv; +jboolean CS_LDK_ChannelHandshakeConfig_get_announced_channel(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 = UserConfig_get_accept_forwards_to_priv_channels(&this_ptr_conv); + jboolean ret_conv = ChannelHandshakeConfig_get_announced_channel(&this_ptr_conv); return ret_conv; } -void CS_LDK_UserConfig_set_accept_forwards_to_priv_channels(int64_t this_ptr, jboolean val) { - LDKUserConfig this_ptr_conv; +void CS_LDK_ChannelHandshakeConfig_set_announced_channel(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; - UserConfig_set_accept_forwards_to_priv_channels(&this_ptr_conv, val); + ChannelHandshakeConfig_set_announced_channel(&this_ptr_conv, val); } -jboolean CS_LDK_UserConfig_get_accept_inbound_channels(int64_t this_ptr) { - LDKUserConfig this_ptr_conv; +jboolean CS_LDK_ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(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 = UserConfig_get_accept_inbound_channels(&this_ptr_conv); + jboolean ret_conv = ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(&this_ptr_conv); return ret_conv; } -void CS_LDK_UserConfig_set_accept_inbound_channels(int64_t this_ptr, jboolean val) { - LDKUserConfig this_ptr_conv; +void CS_LDK_ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(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; - UserConfig_set_accept_inbound_channels(&this_ptr_conv, val); + ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(&this_ptr_conv, val); } -jboolean CS_LDK_UserConfig_get_manually_accept_inbound_channels(int64_t this_ptr) { - LDKUserConfig this_ptr_conv; +int32_t CS_LDK_ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(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 = UserConfig_get_manually_accept_inbound_channels(&this_ptr_conv); + int32_t ret_conv = ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(&this_ptr_conv); return ret_conv; } -void CS_LDK_UserConfig_set_manually_accept_inbound_channels(int64_t this_ptr, jboolean val) { - LDKUserConfig this_ptr_conv; +void CS_LDK_ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(int64_t this_ptr, int32_t val) { + LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - UserConfig_set_manually_accept_inbound_channels(&this_ptr_conv, val); + ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(&this_ptr_conv, val); } -jboolean CS_LDK_UserConfig_get_accept_intercept_htlcs(int64_t this_ptr) { - LDKUserConfig this_ptr_conv; +jboolean CS_LDK_ChannelHandshakeConfig_get_negotiate_anchors_zero_fee_htlc_tx(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 = UserConfig_get_accept_intercept_htlcs(&this_ptr_conv); + jboolean ret_conv = ChannelHandshakeConfig_get_negotiate_anchors_zero_fee_htlc_tx(&this_ptr_conv); return ret_conv; } -void CS_LDK_UserConfig_set_accept_intercept_htlcs(int64_t this_ptr, jboolean val) { - LDKUserConfig this_ptr_conv; +void CS_LDK_ChannelHandshakeConfig_set_negotiate_anchors_zero_fee_htlc_tx(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; - UserConfig_set_accept_intercept_htlcs(&this_ptr_conv, val); + ChannelHandshakeConfig_set_negotiate_anchors_zero_fee_htlc_tx(&this_ptr_conv, val); } -jboolean CS_LDK_UserConfig_get_accept_mpp_keysend(int64_t this_ptr) { - LDKUserConfig this_ptr_conv; +int16_t CS_LDK_ChannelHandshakeConfig_get_our_max_accepted_htlcs(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 = UserConfig_get_accept_mpp_keysend(&this_ptr_conv); + int16_t ret_conv = ChannelHandshakeConfig_get_our_max_accepted_htlcs(&this_ptr_conv); return ret_conv; } -void CS_LDK_UserConfig_set_accept_mpp_keysend(int64_t this_ptr, jboolean val) { - LDKUserConfig this_ptr_conv; +void CS_LDK_ChannelHandshakeConfig_set_our_max_accepted_htlcs(int64_t this_ptr, int16_t val) { + LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - UserConfig_set_accept_mpp_keysend(&this_ptr_conv, val); + ChannelHandshakeConfig_set_our_max_accepted_htlcs(&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) { - LDKChannelHandshakeConfig channel_handshake_config_arg_conv; - channel_handshake_config_arg_conv.inner = untag_ptr(channel_handshake_config_arg); - channel_handshake_config_arg_conv.is_owned = ptr_is_owned(channel_handshake_config_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_handshake_config_arg_conv); - channel_handshake_config_arg_conv = ChannelHandshakeConfig_clone(&channel_handshake_config_arg_conv); - LDKChannelHandshakeLimits channel_handshake_limits_arg_conv; - channel_handshake_limits_arg_conv.inner = untag_ptr(channel_handshake_limits_arg); - channel_handshake_limits_arg_conv.is_owned = ptr_is_owned(channel_handshake_limits_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_handshake_limits_arg_conv); - channel_handshake_limits_arg_conv = ChannelHandshakeLimits_clone(&channel_handshake_limits_arg_conv); - LDKChannelConfig channel_config_arg_conv; - channel_config_arg_conv.inner = untag_ptr(channel_config_arg); - channel_config_arg_conv.is_owned = ptr_is_owned(channel_config_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_config_arg_conv); - channel_config_arg_conv = ChannelConfig_clone(&channel_config_arg_conv); - LDKUserConfig ret_var = UserConfig_new(channel_handshake_config_arg_conv, channel_handshake_limits_arg_conv, channel_config_arg_conv, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg, manually_accept_inbound_channels_arg, accept_intercept_htlcs_arg, accept_mpp_keysend_arg); +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 ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t UserConfig_clone_ptr(LDKUserConfig *NONNULL_PTR arg) { - LDKUserConfig ret_var = UserConfig_clone(arg); +static inline uint64_t ChannelHandshakeConfig_clone_ptr(LDKChannelHandshakeConfig *NONNULL_PTR arg) { + LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_UserConfig_clone_ptr(int64_t arg) { - LDKUserConfig arg_conv; +int64_t CS_LDK_ChannelHandshakeConfig_clone_ptr(int64_t arg) { + LDKChannelHandshakeConfig arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = UserConfig_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelHandshakeConfig_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_UserConfig_clone(int64_t orig) { - LDKUserConfig orig_conv; +int64_t CS_LDK_ChannelHandshakeConfig_clone(int64_t orig) { + LDKChannelHandshakeConfig orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKUserConfig ret_var = UserConfig_clone(&orig_conv); + LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_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_UserConfig_default() { - LDKUserConfig ret_var = UserConfig_default(); +int64_t CS_LDK_ChannelHandshakeConfig_default() { + LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_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_BestBlock_free(int64_t this_obj) { - LDKBestBlock this_obj_conv; +void CS_LDK_ChannelHandshakeLimits_free(int64_t this_obj) { + LDKChannelHandshakeLimits this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BestBlock_free(this_obj_conv); + ChannelHandshakeLimits_free(this_obj_conv); } -int8_tArray CS_LDK_BestBlock_get_block_hash(int64_t this_ptr) { - LDKBestBlock this_ptr_conv; +int64_t CS_LDK_ChannelHandshakeLimits_get_min_funding_satoshis(int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *BestBlock_get_block_hash(&this_ptr_conv), 32); - return ret_arr; + int64_t ret_conv = ChannelHandshakeLimits_get_min_funding_satoshis(&this_ptr_conv); + return ret_conv; } -void CS_LDK_BestBlock_set_block_hash(int64_t this_ptr, int8_tArray val) { - LDKBestBlock this_ptr_conv; +void CS_LDK_ChannelHandshakeLimits_set_min_funding_satoshis(int64_t this_ptr, int64_t val) { + LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - BestBlock_set_block_hash(&this_ptr_conv, val_ref); + ChannelHandshakeLimits_set_min_funding_satoshis(&this_ptr_conv, val); } -int32_t CS_LDK_BestBlock_get_height(int64_t this_ptr) { - LDKBestBlock this_ptr_conv; +int64_t CS_LDK_ChannelHandshakeLimits_get_max_funding_satoshis(int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int32_t ret_conv = BestBlock_get_height(&this_ptr_conv); + int64_t ret_conv = ChannelHandshakeLimits_get_max_funding_satoshis(&this_ptr_conv); return ret_conv; } -void CS_LDK_BestBlock_set_height(int64_t this_ptr, int32_t val) { - LDKBestBlock this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); +void CS_LDK_ChannelHandshakeLimits_set_max_funding_satoshis(int64_t this_ptr, int64_t val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - BestBlock_set_height(&this_ptr_conv, val); + ChannelHandshakeLimits_set_max_funding_satoshis(&this_ptr_conv, val); } -int64_t CS_LDK_BestBlock_new(int8_tArray block_hash_arg, int32_t height_arg) { - LDKThirtyTwoBytes block_hash_arg_ref; - CHECK(block_hash_arg->arr_len == 32); - memcpy(block_hash_arg_ref.data, block_hash_arg->elems, 32); FREE(block_hash_arg); - LDKBestBlock ret_var = BestBlock_new(block_hash_arg_ref, height_arg); +int64_t CS_LDK_ChannelHandshakeLimits_get_max_htlc_minimum_msat(int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ChannelHandshakeLimits_get_max_htlc_minimum_msat(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_ChannelHandshakeLimits_set_max_htlc_minimum_msat(int64_t this_ptr, int64_t val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelHandshakeLimits_set_max_htlc_minimum_msat(&this_ptr_conv, val); +} + +int64_t CS_LDK_ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(int64_t this_ptr, int64_t val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(&this_ptr_conv, val); +} + +int64_t CS_LDK_ChannelHandshakeLimits_get_max_channel_reserve_satoshis(int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ChannelHandshakeLimits_get_max_channel_reserve_satoshis(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_ChannelHandshakeLimits_set_max_channel_reserve_satoshis(int64_t this_ptr, int64_t val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelHandshakeLimits_set_max_channel_reserve_satoshis(&this_ptr_conv, val); +} + +int16_t CS_LDK_ChannelHandshakeLimits_get_min_max_accepted_htlcs(int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int16_t ret_conv = ChannelHandshakeLimits_get_min_max_accepted_htlcs(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_ChannelHandshakeLimits_set_min_max_accepted_htlcs(int64_t this_ptr, int16_t val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelHandshakeLimits_set_min_max_accepted_htlcs(&this_ptr_conv, val); +} + +int32_t CS_LDK_ChannelHandshakeLimits_get_max_minimum_depth(int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = ChannelHandshakeLimits_get_max_minimum_depth(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_ChannelHandshakeLimits_set_max_minimum_depth(int64_t this_ptr, int32_t val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelHandshakeLimits_set_max_minimum_depth(&this_ptr_conv, val); +} + +jboolean CS_LDK_ChannelHandshakeLimits_get_trust_own_funding_0conf(int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + jboolean ret_conv = ChannelHandshakeLimits_get_trust_own_funding_0conf(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_ChannelHandshakeLimits_set_trust_own_funding_0conf(int64_t this_ptr, jboolean val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelHandshakeLimits_set_trust_own_funding_0conf(&this_ptr_conv, val); +} + +jboolean CS_LDK_ChannelHandshakeLimits_get_force_announced_channel_preference(int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + jboolean ret_conv = ChannelHandshakeLimits_get_force_announced_channel_preference(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_ChannelHandshakeLimits_set_force_announced_channel_preference(int64_t this_ptr, jboolean val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelHandshakeLimits_set_force_announced_channel_preference(&this_ptr_conv, val); +} + +int16_t CS_LDK_ChannelHandshakeLimits_get_their_to_self_delay(int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int16_t ret_conv = ChannelHandshakeLimits_get_their_to_self_delay(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_ChannelHandshakeLimits_set_their_to_self_delay(int64_t this_ptr, int16_t val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelHandshakeLimits_set_their_to_self_delay(&this_ptr_conv, val); +} + +int64_t CS_LDK_ChannelHandshakeLimits_new(int64_t min_funding_satoshis_arg, int64_t max_funding_satoshis_arg, int64_t max_htlc_minimum_msat_arg, int64_t min_max_htlc_value_in_flight_msat_arg, int64_t max_channel_reserve_satoshis_arg, int16_t min_max_accepted_htlcs_arg, int32_t max_minimum_depth_arg, jboolean trust_own_funding_0conf_arg, jboolean force_announced_channel_preference_arg, int16_t their_to_self_delay_arg) { + LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_new(min_funding_satoshis_arg, max_funding_satoshis_arg, max_htlc_minimum_msat_arg, min_max_htlc_value_in_flight_msat_arg, max_channel_reserve_satoshis_arg, min_max_accepted_htlcs_arg, max_minimum_depth_arg, trust_own_funding_0conf_arg, force_announced_channel_preference_arg, their_to_self_delay_arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t BestBlock_clone_ptr(LDKBestBlock *NONNULL_PTR arg) { - LDKBestBlock ret_var = BestBlock_clone(arg); +static inline uint64_t ChannelHandshakeLimits_clone_ptr(LDKChannelHandshakeLimits *NONNULL_PTR arg) { + LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_BestBlock_clone_ptr(int64_t arg) { - LDKBestBlock arg_conv; +int64_t CS_LDK_ChannelHandshakeLimits_clone_ptr(int64_t arg) { + LDKChannelHandshakeLimits arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = BestBlock_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelHandshakeLimits_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_BestBlock_clone(int64_t orig) { - LDKBestBlock orig_conv; +int64_t CS_LDK_ChannelHandshakeLimits_clone(int64_t orig) { + LDKChannelHandshakeLimits orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBestBlock ret_var = BestBlock_clone(&orig_conv); + LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_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_BestBlock_hash(int64_t o) { - LDKBestBlock o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = BestBlock_hash(&o_conv); - return ret_conv; +int64_t CS_LDK_ChannelHandshakeLimits_default() { + LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_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_BestBlock_eq(int64_t a, int64_t b) { - LDKBestBlock a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKBestBlock b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = BestBlock_eq(&a_conv, &b_conv); +void CS_LDK_MaxDustHTLCExposure_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); + LDKMaxDustHTLCExposure this_ptr_conv = *(LDKMaxDustHTLCExposure*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + MaxDustHTLCExposure_free(this_ptr_conv); +} + +static inline uint64_t MaxDustHTLCExposure_clone_ptr(LDKMaxDustHTLCExposure *NONNULL_PTR arg) { + LDKMaxDustHTLCExposure *ret_copy = MALLOC(sizeof(LDKMaxDustHTLCExposure), "LDKMaxDustHTLCExposure"); + *ret_copy = MaxDustHTLCExposure_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_MaxDustHTLCExposure_clone_ptr(int64_t arg) { + LDKMaxDustHTLCExposure* arg_conv = (LDKMaxDustHTLCExposure*)untag_ptr(arg); + int64_t ret_conv = MaxDustHTLCExposure_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_BestBlock_from_network(int32_t network) { - LDKNetwork network_conv = LDKNetwork_from_cs(network); - LDKBestBlock ret_var = BestBlock_from_network(network_conv); - 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_MaxDustHTLCExposure_clone(int64_t orig) { + LDKMaxDustHTLCExposure* orig_conv = (LDKMaxDustHTLCExposure*)untag_ptr(orig); + LDKMaxDustHTLCExposure *ret_copy = MALLOC(sizeof(LDKMaxDustHTLCExposure), "LDKMaxDustHTLCExposure"); + *ret_copy = MaxDustHTLCExposure_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int8_tArray CS_LDK_BestBlock_write(int64_t obj) { - LDKBestBlock obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = BestBlock_write(&obj_conv); +int64_t CS_LDK_MaxDustHTLCExposure_fixed_limit_msat(int64_t a) { + LDKMaxDustHTLCExposure *ret_copy = MALLOC(sizeof(LDKMaxDustHTLCExposure), "LDKMaxDustHTLCExposure"); + *ret_copy = MaxDustHTLCExposure_fixed_limit_msat(a); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_MaxDustHTLCExposure_fee_rate_multiplier(int64_t a) { + LDKMaxDustHTLCExposure *ret_copy = MALLOC(sizeof(LDKMaxDustHTLCExposure), "LDKMaxDustHTLCExposure"); + *ret_copy = MaxDustHTLCExposure_fee_rate_multiplier(a); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +jboolean CS_LDK_MaxDustHTLCExposure_eq(int64_t a, int64_t b) { + LDKMaxDustHTLCExposure* a_conv = (LDKMaxDustHTLCExposure*)untag_ptr(a); + LDKMaxDustHTLCExposure* b_conv = (LDKMaxDustHTLCExposure*)untag_ptr(b); + jboolean ret_conv = MaxDustHTLCExposure_eq(a_conv, b_conv); + return ret_conv; +} + +int8_tArray CS_LDK_MaxDustHTLCExposure_write(int64_t obj) { + LDKMaxDustHTLCExposure* obj_conv = (LDKMaxDustHTLCExposure*)untag_ptr(obj); + LDKCVec_u8Z ret_var = MaxDustHTLCExposure_write(obj_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_BestBlock_read(int8_tArray ser) { +int64_t CS_LDK_MaxDustHTLCExposure_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_BestBlockDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BestBlockDecodeErrorZ), "LDKCResult_BestBlockDecodeErrorZ"); - *ret_conv = BestBlock_read(ser_ref); + LDKCResult_MaxDustHTLCExposureDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_MaxDustHTLCExposureDecodeErrorZ), "LDKCResult_MaxDustHTLCExposureDecodeErrorZ"); + *ret_conv = MaxDustHTLCExposure_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_Listen_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); - LDKListen this_ptr_conv = *(LDKListen*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Listen_free(this_ptr_conv); -} - -void CS_LDK_Confirm_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); - LDKConfirm this_ptr_conv = *(LDKConfirm*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Confirm_free(this_ptr_conv); +void CS_LDK_ChannelConfig_free(int64_t this_obj) { + LDKChannelConfig this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelConfig_free(this_obj_conv); } -int32_t CS_LDK_ChannelMonitorUpdateStatus_clone(int64_t orig) { - LDKChannelMonitorUpdateStatus* orig_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(orig); - int32_t ret_conv = LDKChannelMonitorUpdateStatus_to_cs(ChannelMonitorUpdateStatus_clone(orig_conv)); +int32_t CS_LDK_ChannelConfig_get_forwarding_fee_proportional_millionths(int64_t this_ptr) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = ChannelConfig_get_forwarding_fee_proportional_millionths(&this_ptr_conv); return ret_conv; } -int32_t CS_LDK_ChannelMonitorUpdateStatus_completed() { - int32_t ret_conv = LDKChannelMonitorUpdateStatus_to_cs(ChannelMonitorUpdateStatus_completed()); - return ret_conv; +void CS_LDK_ChannelConfig_set_forwarding_fee_proportional_millionths(int64_t this_ptr, int32_t val) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelConfig_set_forwarding_fee_proportional_millionths(&this_ptr_conv, val); } -int32_t CS_LDK_ChannelMonitorUpdateStatus_in_progress() { - int32_t ret_conv = LDKChannelMonitorUpdateStatus_to_cs(ChannelMonitorUpdateStatus_in_progress()); +int32_t CS_LDK_ChannelConfig_get_forwarding_fee_base_msat(int64_t this_ptr) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = ChannelConfig_get_forwarding_fee_base_msat(&this_ptr_conv); return ret_conv; } -int32_t CS_LDK_ChannelMonitorUpdateStatus_unrecoverable_error() { - int32_t ret_conv = LDKChannelMonitorUpdateStatus_to_cs(ChannelMonitorUpdateStatus_unrecoverable_error()); - return ret_conv; +void CS_LDK_ChannelConfig_set_forwarding_fee_base_msat(int64_t this_ptr, int32_t val) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelConfig_set_forwarding_fee_base_msat(&this_ptr_conv, val); } -jboolean CS_LDK_ChannelMonitorUpdateStatus_eq(int64_t a, int64_t b) { - LDKChannelMonitorUpdateStatus* a_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(a); - LDKChannelMonitorUpdateStatus* b_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(b); - jboolean ret_conv = ChannelMonitorUpdateStatus_eq(a_conv, b_conv); +int16_t CS_LDK_ChannelConfig_get_cltv_expiry_delta(int64_t this_ptr) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int16_t ret_conv = ChannelConfig_get_cltv_expiry_delta(&this_ptr_conv); return ret_conv; } -void CS_LDK_Watch_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); - LDKWatch this_ptr_conv = *(LDKWatch*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Watch_free(this_ptr_conv); -} - -void CS_LDK_Filter_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); - LDKFilter this_ptr_conv = *(LDKFilter*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Filter_free(this_ptr_conv); -} - -void CS_LDK_WatchedOutput_free(int64_t this_obj) { - LDKWatchedOutput this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - WatchedOutput_free(this_obj_conv); +void CS_LDK_ChannelConfig_set_cltv_expiry_delta(int64_t this_ptr, int16_t val) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelConfig_set_cltv_expiry_delta(&this_ptr_conv, val); } -int64_t CS_LDK_WatchedOutput_get_block_hash(int64_t this_ptr) { - LDKWatchedOutput this_ptr_conv; +int64_t CS_LDK_ChannelConfig_get_max_dust_htlc_exposure(int64_t this_ptr) { + LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); - *ret_copy = WatchedOutput_get_block_hash(&this_ptr_conv); + LDKMaxDustHTLCExposure *ret_copy = MALLOC(sizeof(LDKMaxDustHTLCExposure), "LDKMaxDustHTLCExposure"); + *ret_copy = ChannelConfig_get_max_dust_htlc_exposure(&this_ptr_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void CS_LDK_WatchedOutput_set_block_hash(int64_t this_ptr, int64_t val) { - LDKWatchedOutput this_ptr_conv; +void CS_LDK_ChannelConfig_set_max_dust_htlc_exposure(int64_t this_ptr, int64_t val) { + LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; void* val_ptr = untag_ptr(val); CHECK_ACCESS(val_ptr); - LDKCOption_ThirtyTwoBytesZ val_conv = *(LDKCOption_ThirtyTwoBytesZ*)(val_ptr); - val_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(val)); - WatchedOutput_set_block_hash(&this_ptr_conv, val_conv); + LDKMaxDustHTLCExposure val_conv = *(LDKMaxDustHTLCExposure*)(val_ptr); + val_conv = MaxDustHTLCExposure_clone((LDKMaxDustHTLCExposure*)untag_ptr(val)); + ChannelConfig_set_max_dust_htlc_exposure(&this_ptr_conv, val_conv); } -int64_t CS_LDK_WatchedOutput_get_outpoint(int64_t this_ptr) { - LDKWatchedOutput this_ptr_conv; +int64_t CS_LDK_ChannelConfig_get_force_close_avoidance_max_fee_satoshis(int64_t this_ptr) { + LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKOutPoint ret_var = WatchedOutput_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 ret_conv = ChannelConfig_get_force_close_avoidance_max_fee_satoshis(&this_ptr_conv); + return ret_conv; } -void CS_LDK_WatchedOutput_set_outpoint(int64_t this_ptr, int64_t val) { - LDKWatchedOutput this_ptr_conv; +void CS_LDK_ChannelConfig_set_force_close_avoidance_max_fee_satoshis(int64_t this_ptr, int64_t val) { + LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - 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); - WatchedOutput_set_outpoint(&this_ptr_conv, val_conv); + ChannelConfig_set_force_close_avoidance_max_fee_satoshis(&this_ptr_conv, val); } -int8_tArray CS_LDK_WatchedOutput_get_script_pubkey(int64_t this_ptr) { - LDKWatchedOutput this_ptr_conv; +jboolean CS_LDK_ChannelConfig_get_accept_underpaying_htlcs(int64_t this_ptr) { + LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u8Z ret_var = WatchedOutput_get_script_pubkey(&this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; + jboolean ret_conv = ChannelConfig_get_accept_underpaying_htlcs(&this_ptr_conv); + return ret_conv; } -void CS_LDK_WatchedOutput_set_script_pubkey(int64_t this_ptr, int8_tArray val) { - LDKWatchedOutput this_ptr_conv; +void CS_LDK_ChannelConfig_set_accept_underpaying_htlcs(int64_t this_ptr, jboolean val) { + LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u8Z val_ref; - val_ref.datalen = val->arr_len; - val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val); - WatchedOutput_set_script_pubkey(&this_ptr_conv, val_ref); + ChannelConfig_set_accept_underpaying_htlcs(&this_ptr_conv, val); } -int64_t CS_LDK_WatchedOutput_new(int64_t block_hash_arg, int64_t outpoint_arg, int8_tArray script_pubkey_arg) { - void* block_hash_arg_ptr = untag_ptr(block_hash_arg); - CHECK_ACCESS(block_hash_arg_ptr); - LDKCOption_ThirtyTwoBytesZ block_hash_arg_conv = *(LDKCOption_ThirtyTwoBytesZ*)(block_hash_arg_ptr); - block_hash_arg_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(block_hash_arg)); - LDKOutPoint outpoint_arg_conv; - outpoint_arg_conv.inner = untag_ptr(outpoint_arg); - outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); - outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); - LDKCVec_u8Z script_pubkey_arg_ref; - script_pubkey_arg_ref.datalen = script_pubkey_arg->arr_len; - script_pubkey_arg_ref.data = MALLOC(script_pubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(script_pubkey_arg_ref.data, script_pubkey_arg->elems, script_pubkey_arg_ref.datalen); FREE(script_pubkey_arg); - LDKWatchedOutput ret_var = WatchedOutput_new(block_hash_arg_conv, outpoint_arg_conv, script_pubkey_arg_ref); +int64_t CS_LDK_ChannelConfig_new(int32_t forwarding_fee_proportional_millionths_arg, int32_t forwarding_fee_base_msat_arg, int16_t cltv_expiry_delta_arg, int64_t max_dust_htlc_exposure_arg, int64_t force_close_avoidance_max_fee_satoshis_arg, jboolean accept_underpaying_htlcs_arg) { + void* max_dust_htlc_exposure_arg_ptr = untag_ptr(max_dust_htlc_exposure_arg); + CHECK_ACCESS(max_dust_htlc_exposure_arg_ptr); + LDKMaxDustHTLCExposure max_dust_htlc_exposure_arg_conv = *(LDKMaxDustHTLCExposure*)(max_dust_htlc_exposure_arg_ptr); + max_dust_htlc_exposure_arg_conv = MaxDustHTLCExposure_clone((LDKMaxDustHTLCExposure*)untag_ptr(max_dust_htlc_exposure_arg)); + LDKChannelConfig ret_var = ChannelConfig_new(forwarding_fee_proportional_millionths_arg, forwarding_fee_base_msat_arg, cltv_expiry_delta_arg, max_dust_htlc_exposure_arg_conv, force_close_avoidance_max_fee_satoshis_arg, accept_underpaying_htlcs_arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t WatchedOutput_clone_ptr(LDKWatchedOutput *NONNULL_PTR arg) { - LDKWatchedOutput ret_var = WatchedOutput_clone(arg); +static inline uint64_t ChannelConfig_clone_ptr(LDKChannelConfig *NONNULL_PTR arg) { + LDKChannelConfig ret_var = ChannelConfig_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_WatchedOutput_clone_ptr(int64_t arg) { - LDKWatchedOutput arg_conv; +int64_t CS_LDK_ChannelConfig_clone_ptr(int64_t arg) { + LDKChannelConfig arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = WatchedOutput_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelConfig_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_WatchedOutput_clone(int64_t orig) { - LDKWatchedOutput orig_conv; +int64_t CS_LDK_ChannelConfig_clone(int64_t orig) { + LDKChannelConfig orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKWatchedOutput ret_var = WatchedOutput_clone(&orig_conv); + LDKChannelConfig ret_var = ChannelConfig_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_WatchedOutput_eq(int64_t a, int64_t b) { - LDKWatchedOutput a_conv; +jboolean CS_LDK_ChannelConfig_eq(int64_t a, int64_t b) { + LDKChannelConfig a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKWatchedOutput b_conv; + LDKChannelConfig b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = WatchedOutput_eq(&a_conv, &b_conv); - return ret_conv; -} - -int64_t CS_LDK_WatchedOutput_hash(int64_t o) { - LDKWatchedOutput o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = WatchedOutput_hash(&o_conv); + jboolean ret_conv = ChannelConfig_eq(&a_conv, &b_conv); return ret_conv; } -void CS_LDK_BroadcasterInterface_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); - LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - BroadcasterInterface_free(this_ptr_conv); +void CS_LDK_ChannelConfig_apply(int64_t this_arg, int64_t update) { + LDKChannelConfig this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelConfigUpdate update_conv; + update_conv.inner = untag_ptr(update); + update_conv.is_owned = ptr_is_owned(update); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv); + update_conv.is_owned = false; + ChannelConfig_apply(&this_arg_conv, &update_conv); } -int32_t CS_LDK_ConfirmationTarget_clone(int64_t orig) { - LDKConfirmationTarget* orig_conv = (LDKConfirmationTarget*)untag_ptr(orig); - int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_clone(orig_conv)); - return ret_conv; +int64_t CS_LDK_ChannelConfig_default() { + LDKChannelConfig ret_var = ChannelConfig_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; } -int32_t CS_LDK_ConfirmationTarget_on_chain_sweep() { - int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_on_chain_sweep()); - return ret_conv; +int8_tArray CS_LDK_ChannelConfig_write(int64_t obj) { + LDKChannelConfig obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ChannelConfig_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -int32_t CS_LDK_ConfirmationTarget_min_allowed_anchor_channel_remote_fee() { - int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_min_allowed_anchor_channel_remote_fee()); - return ret_conv; +int64_t CS_LDK_ChannelConfig_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); + *ret_conv = ChannelConfig_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -int32_t CS_LDK_ConfirmationTarget_min_allowed_non_anchor_channel_remote_fee() { - int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_min_allowed_non_anchor_channel_remote_fee()); - return ret_conv; +void CS_LDK_ChannelConfigUpdate_free(int64_t this_obj) { + LDKChannelConfigUpdate this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelConfigUpdate_free(this_obj_conv); } -int32_t CS_LDK_ConfirmationTarget_anchor_channel_fee() { - int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_anchor_channel_fee()); - return ret_conv; +int64_t CS_LDK_ChannelConfigUpdate_get_forwarding_fee_proportional_millionths(int64_t this_ptr) { + LDKChannelConfigUpdate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = ChannelConfigUpdate_get_forwarding_fee_proportional_millionths(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int32_t CS_LDK_ConfirmationTarget_non_anchor_channel_fee() { - int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_non_anchor_channel_fee()); - return ret_conv; +void CS_LDK_ChannelConfigUpdate_set_forwarding_fee_proportional_millionths(int64_t this_ptr, int64_t val) { + LDKChannelConfigUpdate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); + val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val)); + ChannelConfigUpdate_set_forwarding_fee_proportional_millionths(&this_ptr_conv, val_conv); } -int32_t CS_LDK_ConfirmationTarget_channel_close_minimum() { - int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_channel_close_minimum()); - return ret_conv; +int64_t CS_LDK_ChannelConfigUpdate_get_forwarding_fee_base_msat(int64_t this_ptr) { + LDKChannelConfigUpdate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = ChannelConfigUpdate_get_forwarding_fee_base_msat(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int32_t CS_LDK_ConfirmationTarget_output_spending_fee() { - int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_output_spending_fee()); - return ret_conv; +void CS_LDK_ChannelConfigUpdate_set_forwarding_fee_base_msat(int64_t this_ptr, int64_t val) { + LDKChannelConfigUpdate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); + val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val)); + ChannelConfigUpdate_set_forwarding_fee_base_msat(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ConfirmationTarget_hash(int64_t o) { - LDKConfirmationTarget* o_conv = (LDKConfirmationTarget*)untag_ptr(o); - int64_t ret_conv = ConfirmationTarget_hash(o_conv); - return ret_conv; +int64_t CS_LDK_ChannelConfigUpdate_get_cltv_expiry_delta(int64_t this_ptr) { + LDKChannelConfigUpdate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); + *ret_copy = ChannelConfigUpdate_get_cltv_expiry_delta(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean CS_LDK_ConfirmationTarget_eq(int64_t a, int64_t b) { - LDKConfirmationTarget* a_conv = (LDKConfirmationTarget*)untag_ptr(a); - LDKConfirmationTarget* b_conv = (LDKConfirmationTarget*)untag_ptr(b); - jboolean ret_conv = ConfirmationTarget_eq(a_conv, b_conv); - return ret_conv; +void CS_LDK_ChannelConfigUpdate_set_cltv_expiry_delta(int64_t this_ptr, int64_t val) { + LDKChannelConfigUpdate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr); + val_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(val)); + ChannelConfigUpdate_set_cltv_expiry_delta(&this_ptr_conv, val_conv); } -void CS_LDK_FeeEstimator_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); - LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - FeeEstimator_free(this_ptr_conv); +int64_t CS_LDK_ChannelConfigUpdate_get_max_dust_htlc_exposure_msat(int64_t this_ptr) { + LDKChannelConfigUpdate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_MaxDustHTLCExposureZ *ret_copy = MALLOC(sizeof(LDKCOption_MaxDustHTLCExposureZ), "LDKCOption_MaxDustHTLCExposureZ"); + *ret_copy = ChannelConfigUpdate_get_max_dust_htlc_exposure_msat(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -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); +void CS_LDK_ChannelConfigUpdate_set_max_dust_htlc_exposure_msat(int64_t this_ptr, int64_t val) { + LDKChannelConfigUpdate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_MaxDustHTLCExposureZ val_conv = *(LDKCOption_MaxDustHTLCExposureZ*)(val_ptr); + val_conv = COption_MaxDustHTLCExposureZ_clone((LDKCOption_MaxDustHTLCExposureZ*)untag_ptr(val)); + ChannelConfigUpdate_set_max_dust_htlc_exposure_msat(&this_ptr_conv, val_conv); } -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); +int64_t CS_LDK_ChannelConfigUpdate_get_force_close_avoidance_max_fee_satoshis(int64_t this_ptr) { + LDKChannelConfigUpdate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelConfigUpdate_get_force_close_avoidance_max_fee_satoshis(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); 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; + +void CS_LDK_ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis(int64_t this_ptr, int64_t val) { + LDKChannelConfigUpdate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis(&this_ptr_conv, val_conv); } -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 CS_LDK_ChannelConfigUpdate_new(int64_t forwarding_fee_proportional_millionths_arg, int64_t forwarding_fee_base_msat_arg, int64_t cltv_expiry_delta_arg, int64_t max_dust_htlc_exposure_msat_arg, int64_t force_close_avoidance_max_fee_satoshis_arg) { + void* forwarding_fee_proportional_millionths_arg_ptr = untag_ptr(forwarding_fee_proportional_millionths_arg); + CHECK_ACCESS(forwarding_fee_proportional_millionths_arg_ptr); + LDKCOption_u32Z forwarding_fee_proportional_millionths_arg_conv = *(LDKCOption_u32Z*)(forwarding_fee_proportional_millionths_arg_ptr); + forwarding_fee_proportional_millionths_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(forwarding_fee_proportional_millionths_arg)); + void* forwarding_fee_base_msat_arg_ptr = untag_ptr(forwarding_fee_base_msat_arg); + CHECK_ACCESS(forwarding_fee_base_msat_arg_ptr); + LDKCOption_u32Z forwarding_fee_base_msat_arg_conv = *(LDKCOption_u32Z*)(forwarding_fee_base_msat_arg_ptr); + forwarding_fee_base_msat_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(forwarding_fee_base_msat_arg)); + void* cltv_expiry_delta_arg_ptr = untag_ptr(cltv_expiry_delta_arg); + CHECK_ACCESS(cltv_expiry_delta_arg_ptr); + LDKCOption_u16Z cltv_expiry_delta_arg_conv = *(LDKCOption_u16Z*)(cltv_expiry_delta_arg_ptr); + cltv_expiry_delta_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(cltv_expiry_delta_arg)); + void* max_dust_htlc_exposure_msat_arg_ptr = untag_ptr(max_dust_htlc_exposure_msat_arg); + CHECK_ACCESS(max_dust_htlc_exposure_msat_arg_ptr); + LDKCOption_MaxDustHTLCExposureZ max_dust_htlc_exposure_msat_arg_conv = *(LDKCOption_MaxDustHTLCExposureZ*)(max_dust_htlc_exposure_msat_arg_ptr); + max_dust_htlc_exposure_msat_arg_conv = COption_MaxDustHTLCExposureZ_clone((LDKCOption_MaxDustHTLCExposureZ*)untag_ptr(max_dust_htlc_exposure_msat_arg)); + void* force_close_avoidance_max_fee_satoshis_arg_ptr = untag_ptr(force_close_avoidance_max_fee_satoshis_arg); + CHECK_ACCESS(force_close_avoidance_max_fee_satoshis_arg_ptr); + LDKCOption_u64Z force_close_avoidance_max_fee_satoshis_arg_conv = *(LDKCOption_u64Z*)(force_close_avoidance_max_fee_satoshis_arg_ptr); + force_close_avoidance_max_fee_satoshis_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(force_close_avoidance_max_fee_satoshis_arg)); + LDKChannelConfigUpdate ret_var = ChannelConfigUpdate_new(forwarding_fee_proportional_millionths_arg_conv, forwarding_fee_base_msat_arg_conv, cltv_expiry_delta_arg_conv, max_dust_htlc_exposure_msat_arg_conv, force_close_avoidance_max_fee_satoshis_arg_conv); int64_t ret_ref = 0; CHECK_INNER_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); - CHECK_ACCESS(this_ptr_ptr); - LDKPersist this_ptr_conv = *(LDKPersist*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Persist_free(this_ptr_conv); -} - -void CS_LDK_LockedChannelMonitor_free(int64_t this_obj) { - LDKLockedChannelMonitor this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - LockedChannelMonitor_free(this_obj_conv); +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_ChainMonitor_free(int64_t this_obj) { - LDKChainMonitor this_obj_conv; +void CS_LDK_UserConfig_free(int64_t this_obj) { + LDKUserConfig this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChainMonitor_free(this_obj_conv); + UserConfig_free(this_obj_conv); } -int64_t CS_LDK_ChainMonitor_new(int64_t chain_source, int64_t broadcaster, int64_t logger, int64_t feeest, int64_t persister) { - void* chain_source_ptr = untag_ptr(chain_source); - CHECK_ACCESS(chain_source_ptr); - LDKCOption_FilterZ chain_source_conv = *(LDKCOption_FilterZ*)(chain_source_ptr); - // WARNING: we may need a move here but no clone is available for LDKCOption_FilterZ - if (chain_source_conv.tag == LDKCOption_FilterZ_Some) { - // Manually implement clone for Java trait instances - if (chain_source_conv.some.free == LDKFilter_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFilter_JCalls_cloned(&chain_source_conv.some); - } - } - void* broadcaster_ptr = untag_ptr(broadcaster); - CHECK_ACCESS(broadcaster_ptr); - LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - void* feeest_ptr = untag_ptr(feeest); - CHECK_ACCESS(feeest_ptr); - LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)(feeest_ptr); - if (feeest_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&feeest_conv); - } - void* persister_ptr = untag_ptr(persister); - CHECK_ACCESS(persister_ptr); - LDKPersist persister_conv = *(LDKPersist*)(persister_ptr); - if (persister_conv.free == LDKPersist_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKPersist_JCalls_cloned(&persister_conv); - } - LDKChainMonitor ret_var = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv, persister_conv); +int64_t CS_LDK_UserConfig_get_channel_handshake_config(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; + LDKChannelHandshakeConfig ret_var = UserConfig_get_channel_handshake_config(&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_ChainMonitor_get_claimable_balances(int64_t this_arg, int64_tArray ignored_channels) { - LDKChainMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_ChannelDetailsZ ignored_channels_constr; - ignored_channels_constr.datalen = ignored_channels->arr_len; - if (ignored_channels_constr.datalen > 0) - ignored_channels_constr.data = MALLOC(ignored_channels_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); - else - ignored_channels_constr.data = NULL; - int64_t* ignored_channels_vals = ignored_channels->elems; - for (size_t q = 0; q < ignored_channels_constr.datalen; q++) { - int64_t ignored_channels_conv_16 = ignored_channels_vals[q]; - LDKChannelDetails ignored_channels_conv_16_conv; - ignored_channels_conv_16_conv.inner = untag_ptr(ignored_channels_conv_16); - ignored_channels_conv_16_conv.is_owned = ptr_is_owned(ignored_channels_conv_16); - CHECK_INNER_FIELD_ACCESS_OR_NULL(ignored_channels_conv_16_conv); - ignored_channels_conv_16_conv = ChannelDetails_clone(&ignored_channels_conv_16_conv); - ignored_channels_constr.data[q] = ignored_channels_conv_16_conv; - } - FREE(ignored_channels); - LDKCVec_BalanceZ ret_var = ChainMonitor_get_claimable_balances(&this_arg_conv, ignored_channels_constr); - 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 j = 0; j < ret_var.datalen; j++) { - LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_conv_9_copy = ret_var.data[j]; - int64_t ret_conv_9_ref = tag_ptr(ret_conv_9_copy, true); - ret_arr_ptr[j] = ret_conv_9_ref; - } - - FREE(ret_var.data); - return ret_arr; -} - -int64_t CS_LDK_ChainMonitor_get_monitor(int64_t this_arg, int64_t funding_txo) { - LDKChainMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOutPoint funding_txo_conv; - funding_txo_conv.inner = untag_ptr(funding_txo); - funding_txo_conv.is_owned = ptr_is_owned(funding_txo); - CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); - funding_txo_conv = OutPoint_clone(&funding_txo_conv); - LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); - *ret_conv = ChainMonitor_get_monitor(&this_arg_conv, funding_txo_conv); - return tag_ptr(ret_conv, true); -} - -int64_tArray CS_LDK_ChainMonitor_list_monitors(int64_t this_arg) { - LDKChainMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_C2Tuple_OutPointChannelIdZZ ret_var = ChainMonitor_list_monitors(&this_arg_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t d = 0; d < ret_var.datalen; d++) { - LDKC2Tuple_OutPointChannelIdZ* ret_conv_29_conv = MALLOC(sizeof(LDKC2Tuple_OutPointChannelIdZ), "LDKC2Tuple_OutPointChannelIdZ"); - *ret_conv_29_conv = ret_var.data[d]; - ret_arr_ptr[d] = tag_ptr(ret_conv_29_conv, true); - } - - FREE(ret_var.data); - return ret_arr; +void CS_LDK_UserConfig_set_channel_handshake_config(int64_t this_ptr, int64_t val) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelHandshakeConfig val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelHandshakeConfig_clone(&val_conv); + UserConfig_set_channel_handshake_config(&this_ptr_conv, val_conv); } -int64_tArray CS_LDK_ChainMonitor_list_pending_monitor_updates(int64_t this_arg) { - LDKChainMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ 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); - } - - FREE(ret_var.data); - return ret_arr; +int64_t CS_LDK_UserConfig_get_channel_handshake_limits(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; + LDKChannelHandshakeLimits ret_var = UserConfig_get_channel_handshake_limits(&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_ChainMonitor_channel_monitor_updated(int64_t this_arg, int64_t funding_txo, int64_t completed_update_id) { - LDKChainMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOutPoint funding_txo_conv; - funding_txo_conv.inner = untag_ptr(funding_txo); - funding_txo_conv.is_owned = ptr_is_owned(funding_txo); - CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); - funding_txo_conv = OutPoint_clone(&funding_txo_conv); - LDKMonitorUpdateId completed_update_id_conv; - completed_update_id_conv.inner = untag_ptr(completed_update_id); - completed_update_id_conv.is_owned = ptr_is_owned(completed_update_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(completed_update_id_conv); - completed_update_id_conv = MonitorUpdateId_clone(&completed_update_id_conv); - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id_conv); - return tag_ptr(ret_conv, true); +void CS_LDK_UserConfig_set_channel_handshake_limits(int64_t this_ptr, int64_t val) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelHandshakeLimits val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelHandshakeLimits_clone(&val_conv); + UserConfig_set_channel_handshake_limits(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChainMonitor_get_update_future(int64_t this_arg) { - LDKChainMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKFuture ret_var = ChainMonitor_get_update_future(&this_arg_conv); +int64_t CS_LDK_UserConfig_get_channel_config(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; + LDKChannelConfig ret_var = UserConfig_get_channel_config(&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_ChainMonitor_rebroadcast_pending_claims(int64_t this_arg) { - LDKChainMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - ChainMonitor_rebroadcast_pending_claims(&this_arg_conv); +void CS_LDK_UserConfig_set_channel_config(int64_t this_ptr, int64_t val) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelConfig val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelConfig_clone(&val_conv); + UserConfig_set_channel_config(&this_ptr_conv, val_conv); } -void CS_LDK_ChainMonitor_signer_unblocked(int64_t this_arg, int64_t monitor_opt) { - LDKChainMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOutPoint monitor_opt_conv; - monitor_opt_conv.inner = untag_ptr(monitor_opt); - monitor_opt_conv.is_owned = ptr_is_owned(monitor_opt); - CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_opt_conv); - monitor_opt_conv = OutPoint_clone(&monitor_opt_conv); - ChainMonitor_signer_unblocked(&this_arg_conv, monitor_opt_conv); -} - -void CS_LDK_ChainMonitor_archive_fully_resolved_channel_monitors(int64_t this_arg) { - LDKChainMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - ChainMonitor_archive_fully_resolved_channel_monitors(&this_arg_conv); +jboolean CS_LDK_UserConfig_get_accept_forwards_to_priv_channels(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_accept_forwards_to_priv_channels(&this_ptr_conv); + return ret_conv; } -int64_t CS_LDK_ChainMonitor_as_Listen(int64_t this_arg) { - LDKChainMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); - *ret_ret = ChainMonitor_as_Listen(&this_arg_conv); - return tag_ptr(ret_ret, true); +void CS_LDK_UserConfig_set_accept_forwards_to_priv_channels(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_accept_forwards_to_priv_channels(&this_ptr_conv, val); } -int64_t CS_LDK_ChainMonitor_as_Confirm(int64_t this_arg) { - LDKChainMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); - *ret_ret = ChainMonitor_as_Confirm(&this_arg_conv); - return tag_ptr(ret_ret, true); +jboolean CS_LDK_UserConfig_get_accept_inbound_channels(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_accept_inbound_channels(&this_ptr_conv); + return ret_conv; } -int64_t CS_LDK_ChainMonitor_as_Watch(int64_t this_arg) { - LDKChainMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKWatch* ret_ret = MALLOC(sizeof(LDKWatch), "LDKWatch"); - *ret_ret = ChainMonitor_as_Watch(&this_arg_conv); - return tag_ptr(ret_ret, true); +void CS_LDK_UserConfig_set_accept_inbound_channels(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_accept_inbound_channels(&this_ptr_conv, val); } -int64_t CS_LDK_ChainMonitor_as_EventsProvider(int64_t this_arg) { - LDKChainMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); - *ret_ret = ChainMonitor_as_EventsProvider(&this_arg_conv); - return tag_ptr(ret_ret, true); +jboolean CS_LDK_UserConfig_get_manually_accept_inbound_channels(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_accept_inbound_channels(&this_ptr_conv); + return ret_conv; } -void CS_LDK_ChannelMonitorUpdate_free(int64_t this_obj) { - LDKChannelMonitorUpdate this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelMonitorUpdate_free(this_obj_conv); +void CS_LDK_UserConfig_set_manually_accept_inbound_channels(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_accept_inbound_channels(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelMonitorUpdate_get_update_id(int64_t this_ptr) { - LDKChannelMonitorUpdate this_ptr_conv; +jboolean CS_LDK_UserConfig_get_accept_intercept_htlcs(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; - int64_t ret_conv = ChannelMonitorUpdate_get_update_id(&this_ptr_conv); + jboolean ret_conv = UserConfig_get_accept_intercept_htlcs(&this_ptr_conv); return ret_conv; } -void CS_LDK_ChannelMonitorUpdate_set_update_id(int64_t this_ptr, int64_t val) { - LDKChannelMonitorUpdate this_ptr_conv; +void CS_LDK_UserConfig_set_accept_intercept_htlcs(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; - ChannelMonitorUpdate_set_update_id(&this_ptr_conv, val); + UserConfig_set_accept_intercept_htlcs(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelMonitorUpdate_get_channel_id(int64_t this_ptr) { - LDKChannelMonitorUpdate this_ptr_conv; +jboolean CS_LDK_UserConfig_get_accept_mpp_keysend(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; - LDKChannelId ret_var = ChannelMonitorUpdate_get_channel_id(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + jboolean ret_conv = UserConfig_get_accept_mpp_keysend(&this_ptr_conv); + return ret_conv; } -void CS_LDK_ChannelMonitorUpdate_set_channel_id(int64_t this_ptr, int64_t val) { - LDKChannelMonitorUpdate this_ptr_conv; +void CS_LDK_UserConfig_set_accept_mpp_keysend(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; - LDKChannelId val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelId_clone(&val_conv); - ChannelMonitorUpdate_set_channel_id(&this_ptr_conv, val_conv); + UserConfig_set_accept_mpp_keysend(&this_ptr_conv, val); } -static inline uint64_t ChannelMonitorUpdate_clone_ptr(LDKChannelMonitorUpdate *NONNULL_PTR arg) { - LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(arg); +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) { + LDKChannelHandshakeConfig channel_handshake_config_arg_conv; + channel_handshake_config_arg_conv.inner = untag_ptr(channel_handshake_config_arg); + channel_handshake_config_arg_conv.is_owned = ptr_is_owned(channel_handshake_config_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_handshake_config_arg_conv); + channel_handshake_config_arg_conv = ChannelHandshakeConfig_clone(&channel_handshake_config_arg_conv); + LDKChannelHandshakeLimits channel_handshake_limits_arg_conv; + channel_handshake_limits_arg_conv.inner = untag_ptr(channel_handshake_limits_arg); + channel_handshake_limits_arg_conv.is_owned = ptr_is_owned(channel_handshake_limits_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_handshake_limits_arg_conv); + channel_handshake_limits_arg_conv = ChannelHandshakeLimits_clone(&channel_handshake_limits_arg_conv); + LDKChannelConfig channel_config_arg_conv; + channel_config_arg_conv.inner = untag_ptr(channel_config_arg); + channel_config_arg_conv.is_owned = ptr_is_owned(channel_config_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_config_arg_conv); + channel_config_arg_conv = ChannelConfig_clone(&channel_config_arg_conv); + LDKUserConfig ret_var = UserConfig_new(channel_handshake_config_arg_conv, channel_handshake_limits_arg_conv, channel_config_arg_conv, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg, manually_accept_inbound_channels_arg, accept_intercept_htlcs_arg, accept_mpp_keysend_arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_ChannelMonitorUpdate_clone_ptr(int64_t arg) { - LDKChannelMonitorUpdate arg_conv; + +static inline uint64_t UserConfig_clone_ptr(LDKUserConfig *NONNULL_PTR arg) { + LDKUserConfig ret_var = UserConfig_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_UserConfig_clone_ptr(int64_t arg) { + LDKUserConfig arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = ChannelMonitorUpdate_clone_ptr(&arg_conv); + int64_t ret_conv = UserConfig_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_ChannelMonitorUpdate_clone(int64_t orig) { - LDKChannelMonitorUpdate orig_conv; +int64_t CS_LDK_UserConfig_clone(int64_t orig) { + LDKUserConfig orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(&orig_conv); + LDKUserConfig ret_var = UserConfig_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_ChannelMonitorUpdate_eq(int64_t a, int64_t b) { - LDKChannelMonitorUpdate a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKChannelMonitorUpdate b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = ChannelMonitorUpdate_eq(&a_conv, &b_conv); - return ret_conv; -} - -int8_tArray CS_LDK_ChannelMonitorUpdate_write(int64_t obj) { - LDKChannelMonitorUpdate obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ChannelMonitorUpdate_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -int64_t CS_LDK_ChannelMonitorUpdate_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); - *ret_conv = ChannelMonitorUpdate_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -void CS_LDK_MonitorEvent_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); - LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - MonitorEvent_free(this_ptr_conv); -} - -static inline uint64_t MonitorEvent_clone_ptr(LDKMonitorEvent *NONNULL_PTR arg) { - LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_copy = MonitorEvent_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -int64_t CS_LDK_MonitorEvent_clone_ptr(int64_t arg) { - LDKMonitorEvent* arg_conv = (LDKMonitorEvent*)untag_ptr(arg); - int64_t ret_conv = MonitorEvent_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_MonitorEvent_clone(int64_t orig) { - LDKMonitorEvent* orig_conv = (LDKMonitorEvent*)untag_ptr(orig); - LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_copy = MonitorEvent_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_MonitorEvent_htlcevent(int64_t a) { - LDKHTLCUpdate a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = HTLCUpdate_clone(&a_conv); - LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_copy = MonitorEvent_htlcevent(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +int64_t CS_LDK_UserConfig_default() { + LDKUserConfig ret_var = UserConfig_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_MonitorEvent_holder_force_closed_with_info(int64_t reason, int64_t outpoint, int64_t channel_id) { - void* reason_ptr = untag_ptr(reason); - CHECK_ACCESS(reason_ptr); - LDKClosureReason reason_conv = *(LDKClosureReason*)(reason_ptr); - reason_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(reason)); - LDKOutPoint outpoint_conv; - outpoint_conv.inner = untag_ptr(outpoint); - outpoint_conv.is_owned = ptr_is_owned(outpoint); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv); - outpoint_conv = OutPoint_clone(&outpoint_conv); - LDKChannelId channel_id_conv; - channel_id_conv.inner = untag_ptr(channel_id); - channel_id_conv.is_owned = ptr_is_owned(channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); - channel_id_conv = ChannelId_clone(&channel_id_conv); - LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_copy = MonitorEvent_holder_force_closed_with_info(reason_conv, outpoint_conv, channel_id_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_BestBlock_free(int64_t this_obj) { + LDKBestBlock this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + BestBlock_free(this_obj_conv); } -int64_t CS_LDK_MonitorEvent_holder_force_closed(int64_t a) { - LDKOutPoint a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = OutPoint_clone(&a_conv); - LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_copy = MonitorEvent_holder_force_closed(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int8_tArray CS_LDK_BestBlock_get_block_hash(int64_t this_ptr) { + LDKBestBlock this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *BestBlock_get_block_hash(&this_ptr_conv), 32); + return ret_arr; } -int64_t CS_LDK_MonitorEvent_completed(int64_t funding_txo, int64_t channel_id, int64_t monitor_update_id) { - LDKOutPoint funding_txo_conv; - funding_txo_conv.inner = untag_ptr(funding_txo); - funding_txo_conv.is_owned = ptr_is_owned(funding_txo); - CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); - funding_txo_conv = OutPoint_clone(&funding_txo_conv); - LDKChannelId channel_id_conv; - channel_id_conv.inner = untag_ptr(channel_id); - channel_id_conv.is_owned = ptr_is_owned(channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); - channel_id_conv = ChannelId_clone(&channel_id_conv); - LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_copy = MonitorEvent_completed(funding_txo_conv, channel_id_conv, monitor_update_id); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_BestBlock_set_block_hash(int64_t this_ptr, int8_tArray val) { + LDKBestBlock this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + BestBlock_set_block_hash(&this_ptr_conv, val_ref); } -jboolean CS_LDK_MonitorEvent_eq(int64_t a, int64_t b) { - LDKMonitorEvent* a_conv = (LDKMonitorEvent*)untag_ptr(a); - LDKMonitorEvent* b_conv = (LDKMonitorEvent*)untag_ptr(b); - jboolean ret_conv = MonitorEvent_eq(a_conv, b_conv); +int32_t CS_LDK_BestBlock_get_height(int64_t this_ptr) { + LDKBestBlock this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = BestBlock_get_height(&this_ptr_conv); return ret_conv; } -int8_tArray CS_LDK_MonitorEvent_write(int64_t obj) { - LDKMonitorEvent* obj_conv = (LDKMonitorEvent*)untag_ptr(obj); - LDKCVec_u8Z ret_var = MonitorEvent_write(obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -int64_t CS_LDK_MonitorEvent_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); - *ret_conv = MonitorEvent_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void CS_LDK_BestBlock_set_height(int64_t this_ptr, int32_t val) { + LDKBestBlock this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + BestBlock_set_height(&this_ptr_conv, val); } -void CS_LDK_HTLCUpdate_free(int64_t this_obj) { - LDKHTLCUpdate this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - HTLCUpdate_free(this_obj_conv); +int64_t CS_LDK_BestBlock_new(int8_tArray block_hash_arg, int32_t height_arg) { + LDKThirtyTwoBytes block_hash_arg_ref; + CHECK(block_hash_arg->arr_len == 32); + memcpy(block_hash_arg_ref.data, block_hash_arg->elems, 32); FREE(block_hash_arg); + LDKBestBlock ret_var = BestBlock_new(block_hash_arg_ref, height_arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -static inline uint64_t HTLCUpdate_clone_ptr(LDKHTLCUpdate *NONNULL_PTR arg) { - LDKHTLCUpdate ret_var = HTLCUpdate_clone(arg); +static inline uint64_t BestBlock_clone_ptr(LDKBestBlock *NONNULL_PTR arg) { + LDKBestBlock ret_var = BestBlock_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_HTLCUpdate_clone_ptr(int64_t arg) { - LDKHTLCUpdate arg_conv; +int64_t CS_LDK_BestBlock_clone_ptr(int64_t arg) { + LDKBestBlock arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = HTLCUpdate_clone_ptr(&arg_conv); + int64_t ret_conv = BestBlock_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_HTLCUpdate_clone(int64_t orig) { - LDKHTLCUpdate orig_conv; +int64_t CS_LDK_BestBlock_clone(int64_t orig) { + LDKBestBlock orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKHTLCUpdate ret_var = HTLCUpdate_clone(&orig_conv); + LDKBestBlock ret_var = BestBlock_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_HTLCUpdate_eq(int64_t a, int64_t b) { - LDKHTLCUpdate a_conv; +int64_t CS_LDK_BestBlock_hash(int64_t o) { + LDKBestBlock o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = BestBlock_hash(&o_conv); + return ret_conv; +} + +jboolean CS_LDK_BestBlock_eq(int64_t a, int64_t b) { + LDKBestBlock a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKHTLCUpdate b_conv; + LDKBestBlock b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = HTLCUpdate_eq(&a_conv, &b_conv); + jboolean ret_conv = BestBlock_eq(&a_conv, &b_conv); return ret_conv; } -int8_tArray CS_LDK_HTLCUpdate_write(int64_t obj) { - LDKHTLCUpdate obj_conv; +int64_t CS_LDK_BestBlock_from_network(int32_t network) { + LDKNetwork network_conv = LDKNetwork_from_cs(network); + LDKBestBlock ret_var = BestBlock_from_network(network_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int8_tArray CS_LDK_BestBlock_write(int64_t obj) { + LDKBestBlock obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = HTLCUpdate_write(&obj_conv); + LDKCVec_u8Z ret_var = BestBlock_write(&obj_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_HTLCUpdate_read(int8_tArray ser) { +int64_t CS_LDK_BestBlock_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); - *ret_conv = HTLCUpdate_read(ser_ref); + LDKCResult_BestBlockDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BestBlockDecodeErrorZ), "LDKCResult_BestBlockDecodeErrorZ"); + *ret_conv = BestBlock_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_Balance_free(int64_t this_ptr) { +void CS_LDK_Listen_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); - LDKBalance this_ptr_conv = *(LDKBalance*)(this_ptr_ptr); + LDKListen this_ptr_conv = *(LDKListen*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - Balance_free(this_ptr_conv); + Listen_free(this_ptr_conv); } -static inline uint64_t Balance_clone_ptr(LDKBalance *NONNULL_PTR arg) { - LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_Confirm_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); + LDKConfirm this_ptr_conv = *(LDKConfirm*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Confirm_free(this_ptr_conv); } -int64_t CS_LDK_Balance_clone_ptr(int64_t arg) { - LDKBalance* arg_conv = (LDKBalance*)untag_ptr(arg); - int64_t ret_conv = Balance_clone_ptr(arg_conv); + +int32_t CS_LDK_ChannelMonitorUpdateStatus_clone(int64_t orig) { + LDKChannelMonitorUpdateStatus* orig_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(orig); + int32_t ret_conv = LDKChannelMonitorUpdateStatus_to_cs(ChannelMonitorUpdateStatus_clone(orig_conv)); return ret_conv; } -int64_t CS_LDK_Balance_clone(int64_t orig) { - LDKBalance* orig_conv = (LDKBalance*)untag_ptr(orig); - LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_ChannelMonitorUpdateStatus_completed() { + int32_t ret_conv = LDKChannelMonitorUpdateStatus_to_cs(ChannelMonitorUpdateStatus_completed()); + return ret_conv; } -int64_t CS_LDK_Balance_claimable_on_channel_close(int64_t amount_satoshis) { - LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_claimable_on_channel_close(amount_satoshis); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_ChannelMonitorUpdateStatus_in_progress() { + int32_t ret_conv = LDKChannelMonitorUpdateStatus_to_cs(ChannelMonitorUpdateStatus_in_progress()); + return ret_conv; } -int64_t CS_LDK_Balance_claimable_awaiting_confirmations(int64_t amount_satoshis, int32_t confirmation_height) { - LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_claimable_awaiting_confirmations(amount_satoshis, confirmation_height); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int32_t CS_LDK_ChannelMonitorUpdateStatus_unrecoverable_error() { + int32_t ret_conv = LDKChannelMonitorUpdateStatus_to_cs(ChannelMonitorUpdateStatus_unrecoverable_error()); + return ret_conv; } -int64_t CS_LDK_Balance_contentious_claimable(int64_t amount_satoshis, int32_t timeout_height, int8_tArray payment_hash, int8_tArray payment_preimage) { - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - LDKThirtyTwoBytes payment_preimage_ref; - CHECK(payment_preimage->arr_len == 32); - memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); - LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_contentious_claimable(amount_satoshis, timeout_height, payment_hash_ref, payment_preimage_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_ChannelMonitorUpdateStatus_eq(int64_t a, int64_t b) { + LDKChannelMonitorUpdateStatus* a_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(a); + LDKChannelMonitorUpdateStatus* b_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(b); + jboolean ret_conv = ChannelMonitorUpdateStatus_eq(a_conv, b_conv); + return ret_conv; } -int64_t CS_LDK_Balance_maybe_timeout_claimable_htlc(int64_t amount_satoshis, int32_t claimable_height, int8_tArray payment_hash) { - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_maybe_timeout_claimable_htlc(amount_satoshis, claimable_height, payment_hash_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_Watch_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); + LDKWatch this_ptr_conv = *(LDKWatch*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Watch_free(this_ptr_conv); } -int64_t CS_LDK_Balance_maybe_preimage_claimable_htlc(int64_t amount_satoshis, int32_t expiry_height, int8_tArray payment_hash) { - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_maybe_preimage_claimable_htlc(amount_satoshis, expiry_height, payment_hash_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_Filter_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); + LDKFilter this_ptr_conv = *(LDKFilter*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Filter_free(this_ptr_conv); } -int64_t CS_LDK_Balance_counterparty_revoked_output_claimable(int64_t amount_satoshis) { - LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_counterparty_revoked_output_claimable(amount_satoshis); +void CS_LDK_WatchedOutput_free(int64_t this_obj) { + LDKWatchedOutput this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + WatchedOutput_free(this_obj_conv); +} + +int64_t CS_LDK_WatchedOutput_get_block_hash(int64_t this_ptr) { + LDKWatchedOutput this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); + *ret_copy = WatchedOutput_get_block_hash(&this_ptr_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -jboolean CS_LDK_Balance_eq(int64_t a, int64_t b) { - LDKBalance* a_conv = (LDKBalance*)untag_ptr(a); - LDKBalance* b_conv = (LDKBalance*)untag_ptr(b); - jboolean ret_conv = Balance_eq(a_conv, b_conv); +void CS_LDK_WatchedOutput_set_block_hash(int64_t this_ptr, int64_t val) { + LDKWatchedOutput this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_ThirtyTwoBytesZ val_conv = *(LDKCOption_ThirtyTwoBytesZ*)(val_ptr); + val_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(val)); + WatchedOutput_set_block_hash(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_WatchedOutput_get_outpoint(int64_t this_ptr) { + LDKWatchedOutput this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKOutPoint ret_var = WatchedOutput_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_WatchedOutput_set_outpoint(int64_t this_ptr, int64_t val) { + LDKWatchedOutput this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + 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); + WatchedOutput_set_outpoint(&this_ptr_conv, val_conv); +} + +int8_tArray CS_LDK_WatchedOutput_get_script_pubkey(int64_t this_ptr) { + LDKWatchedOutput this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u8Z ret_var = WatchedOutput_get_script_pubkey(&this_ptr_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +void CS_LDK_WatchedOutput_set_script_pubkey(int64_t this_ptr, int8_tArray val) { + LDKWatchedOutput this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u8Z val_ref; + val_ref.datalen = val->arr_len; + val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val); + WatchedOutput_set_script_pubkey(&this_ptr_conv, val_ref); +} + +int64_t CS_LDK_WatchedOutput_new(int64_t block_hash_arg, int64_t outpoint_arg, int8_tArray script_pubkey_arg) { + void* block_hash_arg_ptr = untag_ptr(block_hash_arg); + CHECK_ACCESS(block_hash_arg_ptr); + LDKCOption_ThirtyTwoBytesZ block_hash_arg_conv = *(LDKCOption_ThirtyTwoBytesZ*)(block_hash_arg_ptr); + block_hash_arg_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(block_hash_arg)); + LDKOutPoint outpoint_arg_conv; + outpoint_arg_conv.inner = untag_ptr(outpoint_arg); + outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); + outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); + LDKCVec_u8Z script_pubkey_arg_ref; + script_pubkey_arg_ref.datalen = script_pubkey_arg->arr_len; + script_pubkey_arg_ref.data = MALLOC(script_pubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(script_pubkey_arg_ref.data, script_pubkey_arg->elems, script_pubkey_arg_ref.datalen); FREE(script_pubkey_arg); + LDKWatchedOutput ret_var = WatchedOutput_new(block_hash_arg_conv, outpoint_arg_conv, script_pubkey_arg_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t WatchedOutput_clone_ptr(LDKWatchedOutput *NONNULL_PTR arg) { + LDKWatchedOutput ret_var = WatchedOutput_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_WatchedOutput_clone_ptr(int64_t arg) { + LDKWatchedOutput arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = WatchedOutput_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_Balance_claimable_amount_satoshis(int64_t this_arg) { - LDKBalance* this_arg_conv = (LDKBalance*)untag_ptr(this_arg); - int64_t ret_conv = Balance_claimable_amount_satoshis(this_arg_conv); +int64_t CS_LDK_WatchedOutput_clone(int64_t orig) { + LDKWatchedOutput orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKWatchedOutput ret_var = WatchedOutput_clone(&orig_conv); + int64_t ret_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_WatchedOutput_eq(int64_t a, int64_t b) { + LDKWatchedOutput a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKWatchedOutput b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = WatchedOutput_eq(&a_conv, &b_conv); return ret_conv; } -void CS_LDK_ChannelMonitor_free(int64_t this_obj) { - LDKChannelMonitor this_obj_conv; +int64_t CS_LDK_WatchedOutput_hash(int64_t o) { + LDKWatchedOutput o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = WatchedOutput_hash(&o_conv); + return ret_conv; +} + +void CS_LDK_BroadcasterInterface_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); + LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + BroadcasterInterface_free(this_ptr_conv); +} + +int32_t CS_LDK_ConfirmationTarget_clone(int64_t orig) { + LDKConfirmationTarget* orig_conv = (LDKConfirmationTarget*)untag_ptr(orig); + int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_clone(orig_conv)); + return ret_conv; +} + +int32_t CS_LDK_ConfirmationTarget_on_chain_sweep() { + int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_on_chain_sweep()); + return ret_conv; +} + +int32_t CS_LDK_ConfirmationTarget_min_allowed_anchor_channel_remote_fee() { + int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_min_allowed_anchor_channel_remote_fee()); + return ret_conv; +} + +int32_t CS_LDK_ConfirmationTarget_min_allowed_non_anchor_channel_remote_fee() { + int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_min_allowed_non_anchor_channel_remote_fee()); + return ret_conv; +} + +int32_t CS_LDK_ConfirmationTarget_anchor_channel_fee() { + int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_anchor_channel_fee()); + return ret_conv; +} + +int32_t CS_LDK_ConfirmationTarget_non_anchor_channel_fee() { + int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_non_anchor_channel_fee()); + return ret_conv; +} + +int32_t CS_LDK_ConfirmationTarget_channel_close_minimum() { + int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_channel_close_minimum()); + return ret_conv; +} + +int32_t CS_LDK_ConfirmationTarget_output_spending_fee() { + int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_output_spending_fee()); + return ret_conv; +} + +int64_t CS_LDK_ConfirmationTarget_hash(int64_t o) { + LDKConfirmationTarget* o_conv = (LDKConfirmationTarget*)untag_ptr(o); + int64_t ret_conv = ConfirmationTarget_hash(o_conv); + return ret_conv; +} + +jboolean CS_LDK_ConfirmationTarget_eq(int64_t a, int64_t b) { + LDKConfirmationTarget* a_conv = (LDKConfirmationTarget*)untag_ptr(a); + LDKConfirmationTarget* b_conv = (LDKConfirmationTarget*)untag_ptr(b); + jboolean ret_conv = ConfirmationTarget_eq(a_conv, b_conv); + return ret_conv; +} + +void CS_LDK_FeeEstimator_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); + LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)(this_ptr_ptr); + FREE(untag_ptr(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); - ChannelMonitor_free(this_obj_conv); + MonitorUpdateId_free(this_obj_conv); } -static inline uint64_t ChannelMonitor_clone_ptr(LDKChannelMonitor *NONNULL_PTR arg) { - LDKChannelMonitor ret_var = ChannelMonitor_clone(arg); +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_ChannelMonitor_clone_ptr(int64_t arg) { - LDKChannelMonitor arg_conv; +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 = ChannelMonitor_clone_ptr(&arg_conv); + int64_t ret_conv = MonitorUpdateId_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_ChannelMonitor_clone(int64_t orig) { - LDKChannelMonitor orig_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; - LDKChannelMonitor ret_var = ChannelMonitor_clone(&orig_conv); + 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; } -int8_tArray CS_LDK_ChannelMonitor_write(int64_t obj) { - LDKChannelMonitor obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ChannelMonitor_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +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; } -int64_t CS_LDK_ChannelMonitor_update_monitor(int64_t this_arg, int64_t updates, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelMonitorUpdate updates_conv; - updates_conv.inner = untag_ptr(updates); - updates_conv.is_owned = ptr_is_owned(updates); - CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv); - updates_conv.is_owned = false; - void* broadcaster_ptr = untag_ptr(broadcaster); - if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); } - LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; - void* fee_estimator_ptr = untag_ptr(fee_estimator); - if (ptr_is_owned(fee_estimator)) { CHECK_ACCESS(fee_estimator_ptr); } - LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; - void* logger_ptr = untag_ptr(logger); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = ChannelMonitor_update_monitor(&this_arg_conv, &updates_conv, broadcaster_conv, fee_estimator_conv, logger_conv); - return tag_ptr(ret_conv, true); +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; } -int64_t CS_LDK_ChannelMonitor_get_latest_update_id(int64_t this_arg) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = ChannelMonitor_get_latest_update_id(&this_arg_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); + CHECK_ACCESS(this_ptr_ptr); + LDKPersist this_ptr_conv = *(LDKPersist*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Persist_free(this_ptr_conv); } -int64_t CS_LDK_ChannelMonitor_get_funding_txo(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; - LDKC2Tuple_OutPointCVec_u8ZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_u8ZZ), "LDKC2Tuple_OutPointCVec_u8ZZ"); - *ret_conv = ChannelMonitor_get_funding_txo(&this_arg_conv); - return tag_ptr(ret_conv, true); +void CS_LDK_LockedChannelMonitor_free(int64_t this_obj) { + LDKLockedChannelMonitor this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + LockedChannelMonitor_free(this_obj_conv); } -int64_t CS_LDK_ChannelMonitor_channel_id(int64_t this_arg) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelId ret_var = ChannelMonitor_channel_id(&this_arg_conv); +void CS_LDK_ChainMonitor_free(int64_t this_obj) { + LDKChainMonitor this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChainMonitor_free(this_obj_conv); +} + +int64_t CS_LDK_ChainMonitor_new(int64_t chain_source, int64_t broadcaster, int64_t logger, int64_t feeest, int64_t persister) { + void* chain_source_ptr = untag_ptr(chain_source); + CHECK_ACCESS(chain_source_ptr); + LDKCOption_FilterZ chain_source_conv = *(LDKCOption_FilterZ*)(chain_source_ptr); + // WARNING: we may need a move here but no clone is available for LDKCOption_FilterZ + if (chain_source_conv.tag == LDKCOption_FilterZ_Some) { + // Manually implement clone for Java trait instances + if (chain_source_conv.some.free == LDKFilter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFilter_JCalls_cloned(&chain_source_conv.some); + } + } + void* broadcaster_ptr = untag_ptr(broadcaster); + CHECK_ACCESS(broadcaster_ptr); + LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); + if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + void* feeest_ptr = untag_ptr(feeest); + CHECK_ACCESS(feeest_ptr); + LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)(feeest_ptr); + if (feeest_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&feeest_conv); + } + void* persister_ptr = untag_ptr(persister); + CHECK_ACCESS(persister_ptr); + LDKPersist persister_conv = *(LDKPersist*)(persister_ptr); + if (persister_conv.free == LDKPersist_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKPersist_JCalls_cloned(&persister_conv); + } + LDKChainMonitor ret_var = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv, persister_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_tArray CS_LDK_ChannelMonitor_get_outputs_to_watch(int64_t this_arg) { - LDKChannelMonitor this_arg_conv; +int64_tArray CS_LDK_ChainMonitor_get_claimable_balances(int64_t this_arg, int64_tArray ignored_channels) { + LDKChainMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ ret_var = ChannelMonitor_get_outputs_to_watch(&this_arg_conv); + LDKCVec_ChannelDetailsZ ignored_channels_constr; + ignored_channels_constr.datalen = ignored_channels->arr_len; + if (ignored_channels_constr.datalen > 0) + ignored_channels_constr.data = MALLOC(ignored_channels_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); + else + ignored_channels_constr.data = NULL; + int64_t* ignored_channels_vals = ignored_channels->elems; + for (size_t q = 0; q < ignored_channels_constr.datalen; q++) { + int64_t ignored_channels_conv_16 = ignored_channels_vals[q]; + LDKChannelDetails ignored_channels_conv_16_conv; + ignored_channels_conv_16_conv.inner = untag_ptr(ignored_channels_conv_16); + ignored_channels_conv_16_conv.is_owned = ptr_is_owned(ignored_channels_conv_16); + CHECK_INNER_FIELD_ACCESS_OR_NULL(ignored_channels_conv_16_conv); + ignored_channels_conv_16_conv = ChannelDetails_clone(&ignored_channels_conv_16_conv); + ignored_channels_constr.data[q] = ignored_channels_conv_16_conv; + } + FREE(ignored_channels); + LDKCVec_BalanceZ ret_var = ChainMonitor_get_claimable_balances(&this_arg_conv, ignored_channels_constr); 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 a = 0; a < ret_var.datalen; a++) { - LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ* ret_conv_52_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ), "LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ"); - *ret_conv_52_conv = ret_var.data[a]; - ret_arr_ptr[a] = tag_ptr(ret_conv_52_conv, true); + for (size_t j = 0; j < ret_var.datalen; j++) { + LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_conv_9_copy = ret_var.data[j]; + int64_t ret_conv_9_ref = tag_ptr(ret_conv_9_copy, true); + ret_arr_ptr[j] = ret_conv_9_ref; } FREE(ret_var.data); return ret_arr; } -void CS_LDK_ChannelMonitor_load_outputs_to_watch(int64_t this_arg, int64_t filter, int64_t logger) { - LDKChannelMonitor this_arg_conv; +int64_t CS_LDK_ChainMonitor_get_monitor(int64_t this_arg, int64_t funding_txo) { + LDKChainMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - void* filter_ptr = untag_ptr(filter); - if (ptr_is_owned(filter)) { CHECK_ACCESS(filter_ptr); } - LDKFilter* filter_conv = (LDKFilter*)filter_ptr; - void* logger_ptr = untag_ptr(logger); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - ChannelMonitor_load_outputs_to_watch(&this_arg_conv, filter_conv, logger_conv); + LDKOutPoint funding_txo_conv; + funding_txo_conv.inner = untag_ptr(funding_txo); + funding_txo_conv.is_owned = ptr_is_owned(funding_txo); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); + funding_txo_conv = OutPoint_clone(&funding_txo_conv); + LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); + *ret_conv = ChainMonitor_get_monitor(&this_arg_conv, funding_txo_conv); + return tag_ptr(ret_conv, true); } -int64_tArray CS_LDK_ChannelMonitor_get_and_clear_pending_monitor_events(int64_t this_arg) { - LDKChannelMonitor this_arg_conv; +int64_tArray CS_LDK_ChainMonitor_list_monitors(int64_t this_arg) { + LDKChainMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_MonitorEventZ ret_var = ChannelMonitor_get_and_clear_pending_monitor_events(&this_arg_conv); + LDKCVec_C2Tuple_OutPointChannelIdZZ ret_var = ChainMonitor_list_monitors(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t o = 0; o < ret_var.datalen; o++) { - LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_conv_14_copy = ret_var.data[o]; - int64_t ret_conv_14_ref = tag_ptr(ret_conv_14_copy, true); - ret_arr_ptr[o] = ret_conv_14_ref; + for (size_t d = 0; d < ret_var.datalen; d++) { + LDKC2Tuple_OutPointChannelIdZ* ret_conv_29_conv = MALLOC(sizeof(LDKC2Tuple_OutPointChannelIdZ), "LDKC2Tuple_OutPointChannelIdZ"); + *ret_conv_29_conv = ret_var.data[d]; + ret_arr_ptr[d] = tag_ptr(ret_conv_29_conv, true); } FREE(ret_var.data); return ret_arr; } -void 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); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - void* handler_ptr = untag_ptr(handler); - if (ptr_is_owned(handler)) { CHECK_ACCESS(handler_ptr); } - LDKEventHandler* handler_conv = (LDKEventHandler*)handler_ptr; - ChannelMonitor_process_pending_events(&this_arg_conv, handler_conv); -} - -int64_t CS_LDK_ChannelMonitor_initial_counterparty_commitment_tx(int64_t this_arg) { - LDKChannelMonitor this_arg_conv; +int64_tArray CS_LDK_ChainMonitor_list_pending_monitor_updates(int64_t this_arg) { + LDKChainMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCommitmentTransaction ret_var = ChannelMonitor_initial_counterparty_commitment_tx(&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_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ 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); + } + + FREE(ret_var.data); + return ret_arr; } -int64_tArray CS_LDK_ChannelMonitor_counterparty_commitment_txs_from_update(int64_t this_arg, int64_t update) { - LDKChannelMonitor this_arg_conv; +int64_t CS_LDK_ChainMonitor_channel_monitor_updated(int64_t this_arg, int64_t funding_txo, int64_t completed_update_id) { + LDKChainMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKChannelMonitorUpdate update_conv; - update_conv.inner = untag_ptr(update); - update_conv.is_owned = ptr_is_owned(update); - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv); - update_conv.is_owned = false; - LDKCVec_CommitmentTransactionZ ret_var = ChannelMonitor_counterparty_commitment_txs_from_update(&this_arg_conv, &update_conv); - 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++) { - LDKCommitmentTransaction ret_conv_23_var = ret_var.data[x]; - int64_t ret_conv_23_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_23_var); - ret_conv_23_ref = tag_ptr(ret_conv_23_var.inner, ret_conv_23_var.is_owned); - ret_arr_ptr[x] = ret_conv_23_ref; - } - - FREE(ret_var.data); - return ret_arr; -} - -int64_t CS_LDK_ChannelMonitor_sign_to_local_justice_tx(int64_t this_arg, int8_tArray justice_tx, int64_t input_idx, int64_t value, int64_t commitment_number) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKTransaction justice_tx_ref; - justice_tx_ref.datalen = justice_tx->arr_len; - justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes"); - memcpy(justice_tx_ref.data, justice_tx->elems, justice_tx_ref.datalen); FREE(justice_tx); - justice_tx_ref.data_is_owned = true; - LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); - *ret_conv = ChannelMonitor_sign_to_local_justice_tx(&this_arg_conv, justice_tx_ref, input_idx, value, commitment_number); + LDKOutPoint funding_txo_conv; + funding_txo_conv.inner = untag_ptr(funding_txo); + funding_txo_conv.is_owned = ptr_is_owned(funding_txo); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); + funding_txo_conv = OutPoint_clone(&funding_txo_conv); + LDKMonitorUpdateId completed_update_id_conv; + completed_update_id_conv.inner = untag_ptr(completed_update_id); + completed_update_id_conv.is_owned = ptr_is_owned(completed_update_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(completed_update_id_conv); + completed_update_id_conv = MonitorUpdateId_clone(&completed_update_id_conv); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id_conv); return tag_ptr(ret_conv, true); } -int8_tArray CS_LDK_ChannelMonitor_get_counterparty_node_id(int64_t this_arg) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, ChannelMonitor_get_counterparty_node_id(&this_arg_conv).compressed_form, 33); - return ret_arr; -} - -void CS_LDK_ChannelMonitor_broadcast_latest_holder_commitment_txn(int64_t this_arg, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - void* broadcaster_ptr = untag_ptr(broadcaster); - if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); } - LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; - void* fee_estimator_ptr = untag_ptr(fee_estimator); - if (ptr_is_owned(fee_estimator)) { CHECK_ACCESS(fee_estimator_ptr); } - LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; - void* logger_ptr = untag_ptr(logger); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - ChannelMonitor_broadcast_latest_holder_commitment_txn(&this_arg_conv, broadcaster_conv, fee_estimator_conv, logger_conv); -} - -int64_tArray CS_LDK_ChannelMonitor_block_connected(int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - uint8_t header_arr[80]; - CHECK(header->arr_len == 80); - memcpy(header_arr, header->elems, 80); FREE(header); - uint8_t (*header_ref)[80] = &header_arr; - LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr; - txdata_constr.datalen = txdata->arr_len; - if (txdata_constr.datalen > 0) - txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); - else - txdata_constr.data = NULL; - int64_t* txdata_vals = txdata->elems; - for (size_t c = 0; c < txdata_constr.datalen; c++) { - int64_t txdata_conv_28 = txdata_vals[c]; - void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28); - CHECK_ACCESS(txdata_conv_28_ptr); - LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr); - txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28)); - txdata_constr.data[c] = txdata_conv_28_conv; - } - FREE(txdata); - void* broadcaster_ptr = untag_ptr(broadcaster); - CHECK_ACCESS(broadcaster_ptr); - LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); - } - void* fee_estimator_ptr = untag_ptr(fee_estimator); - CHECK_ACCESS(fee_estimator_ptr); - LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); - } - void* logger_ptr = untag_ptr(logger); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_block_connected(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t x = 0; x < ret_var.datalen; x++) { - LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ* ret_conv_49_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ"); - *ret_conv_49_conv = ret_var.data[x]; - ret_arr_ptr[x] = tag_ptr(ret_conv_49_conv, true); - } - - FREE(ret_var.data); - return ret_arr; -} - -void CS_LDK_ChannelMonitor_block_disconnected(int64_t this_arg, int8_tArray header, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - uint8_t header_arr[80]; - CHECK(header->arr_len == 80); - memcpy(header_arr, header->elems, 80); FREE(header); - uint8_t (*header_ref)[80] = &header_arr; - void* broadcaster_ptr = untag_ptr(broadcaster); - CHECK_ACCESS(broadcaster_ptr); - LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); - } - void* fee_estimator_ptr = untag_ptr(fee_estimator); - CHECK_ACCESS(fee_estimator_ptr); - LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); - } - void* logger_ptr = untag_ptr(logger); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - ChannelMonitor_block_disconnected(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv); -} - -int64_tArray CS_LDK_ChannelMonitor_transactions_confirmed(int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - uint8_t header_arr[80]; - CHECK(header->arr_len == 80); - memcpy(header_arr, header->elems, 80); FREE(header); - uint8_t (*header_ref)[80] = &header_arr; - LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr; - txdata_constr.datalen = txdata->arr_len; - if (txdata_constr.datalen > 0) - txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); - else - txdata_constr.data = NULL; - int64_t* txdata_vals = txdata->elems; - for (size_t c = 0; c < txdata_constr.datalen; c++) { - int64_t txdata_conv_28 = txdata_vals[c]; - void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28); - CHECK_ACCESS(txdata_conv_28_ptr); - LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr); - txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28)); - txdata_constr.data[c] = txdata_conv_28_conv; - } - FREE(txdata); - void* broadcaster_ptr = untag_ptr(broadcaster); - CHECK_ACCESS(broadcaster_ptr); - LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); - } - void* fee_estimator_ptr = untag_ptr(fee_estimator); - CHECK_ACCESS(fee_estimator_ptr); - LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); - } - void* logger_ptr = untag_ptr(logger); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_transactions_confirmed(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t x = 0; x < ret_var.datalen; x++) { - LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ* ret_conv_49_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ"); - *ret_conv_49_conv = ret_var.data[x]; - ret_arr_ptr[x] = tag_ptr(ret_conv_49_conv, true); - } - - FREE(ret_var.data); - return ret_arr; -} - -void CS_LDK_ChannelMonitor_transaction_unconfirmed(int64_t this_arg, int8_tArray txid, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - uint8_t txid_arr[32]; - CHECK(txid->arr_len == 32); - memcpy(txid_arr, txid->elems, 32); FREE(txid); - uint8_t (*txid_ref)[32] = &txid_arr; - void* broadcaster_ptr = untag_ptr(broadcaster); - CHECK_ACCESS(broadcaster_ptr); - LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); - } - void* fee_estimator_ptr = untag_ptr(fee_estimator); - CHECK_ACCESS(fee_estimator_ptr); - LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); - } - void* logger_ptr = untag_ptr(logger); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - ChannelMonitor_transaction_unconfirmed(&this_arg_conv, txid_ref, broadcaster_conv, fee_estimator_conv, logger_conv); -} - -int64_tArray CS_LDK_ChannelMonitor_best_block_updated(int64_t this_arg, int8_tArray header, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { - LDKChannelMonitor this_arg_conv; +int64_t CS_LDK_ChainMonitor_get_update_future(int64_t this_arg) { + LDKChainMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - uint8_t header_arr[80]; - CHECK(header->arr_len == 80); - memcpy(header_arr, header->elems, 80); FREE(header); - uint8_t (*header_ref)[80] = &header_arr; - void* broadcaster_ptr = untag_ptr(broadcaster); - CHECK_ACCESS(broadcaster_ptr); - LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); - } - void* fee_estimator_ptr = untag_ptr(fee_estimator); - CHECK_ACCESS(fee_estimator_ptr); - LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); - } - void* logger_ptr = untag_ptr(logger); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_best_block_updated(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t x = 0; x < ret_var.datalen; x++) { - LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ* ret_conv_49_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ"); - *ret_conv_49_conv = ret_var.data[x]; - ret_arr_ptr[x] = tag_ptr(ret_conv_49_conv, true); - } - - FREE(ret_var.data); - return ret_arr; + LDKFuture ret_var = ChainMonitor_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_tArray CS_LDK_ChannelMonitor_get_relevant_txids(int64_t this_arg) { - LDKChannelMonitor this_arg_conv; +void CS_LDK_ChainMonitor_rebroadcast_pending_claims(int64_t this_arg) { + LDKChainMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ ret_var = ChannelMonitor_get_relevant_txids(&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 c = 0; c < ret_var.datalen; c++) { - LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ* ret_conv_54_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ), "LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ"); - *ret_conv_54_conv = ret_var.data[c]; - ret_arr_ptr[c] = tag_ptr(ret_conv_54_conv, true); - } - - FREE(ret_var.data); - return ret_arr; + ChainMonitor_rebroadcast_pending_claims(&this_arg_conv); } -int64_t CS_LDK_ChannelMonitor_current_best_block(int64_t this_arg) { - LDKChannelMonitor this_arg_conv; +void CS_LDK_ChainMonitor_signer_unblocked(int64_t this_arg, int64_t monitor_opt) { + LDKChainMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKBestBlock ret_var = ChannelMonitor_current_best_block(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + LDKOutPoint monitor_opt_conv; + monitor_opt_conv.inner = untag_ptr(monitor_opt); + monitor_opt_conv.is_owned = ptr_is_owned(monitor_opt); + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_opt_conv); + monitor_opt_conv = OutPoint_clone(&monitor_opt_conv); + ChainMonitor_signer_unblocked(&this_arg_conv, monitor_opt_conv); } -void CS_LDK_ChannelMonitor_rebroadcast_pending_claims(int64_t this_arg, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { - LDKChannelMonitor this_arg_conv; +void CS_LDK_ChainMonitor_archive_fully_resolved_channel_monitors(int64_t this_arg) { + LDKChainMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - void* broadcaster_ptr = untag_ptr(broadcaster); - CHECK_ACCESS(broadcaster_ptr); - LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); - } - void* fee_estimator_ptr = untag_ptr(fee_estimator); - CHECK_ACCESS(fee_estimator_ptr); - LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); - } - void* logger_ptr = untag_ptr(logger); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - ChannelMonitor_rebroadcast_pending_claims(&this_arg_conv, broadcaster_conv, fee_estimator_conv, logger_conv); + ChainMonitor_archive_fully_resolved_channel_monitors(&this_arg_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; +int64_t CS_LDK_ChainMonitor_as_Listen(int64_t this_arg) { + LDKChainMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - void* broadcaster_ptr = untag_ptr(broadcaster); - CHECK_ACCESS(broadcaster_ptr); - LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); - } - void* fee_estimator_ptr = untag_ptr(fee_estimator); - CHECK_ACCESS(fee_estimator_ptr); - LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); - } - void* logger_ptr = untag_ptr(logger); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - ChannelMonitor_signer_unblocked(&this_arg_conv, broadcaster_conv, fee_estimator_conv, logger_conv); + LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); + *ret_ret = ChainMonitor_as_Listen(&this_arg_conv); + return tag_ptr(ret_ret, true); } -int64_tArray CS_LDK_ChannelMonitor_get_spendable_outputs(int64_t this_arg, int8_tArray tx, int32_t confirmation_height) { - LDKChannelMonitor this_arg_conv; +int64_t CS_LDK_ChainMonitor_as_Confirm(int64_t this_arg) { + LDKChainMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKTransaction tx_ref; - tx_ref.datalen = tx->arr_len; - tx_ref.data = MALLOC(tx_ref.datalen, "LDKTransaction Bytes"); - memcpy(tx_ref.data, tx->elems, tx_ref.datalen); FREE(tx); - tx_ref.data_is_owned = true; - LDKCVec_SpendableOutputDescriptorZ ret_var = ChannelMonitor_get_spendable_outputs(&this_arg_conv, tx_ref, confirmation_height); - 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 b = 0; b < ret_var.datalen; b++) { - LDKSpendableOutputDescriptor *ret_conv_27_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_conv_27_copy = ret_var.data[b]; - int64_t ret_conv_27_ref = tag_ptr(ret_conv_27_copy, true); - ret_arr_ptr[b] = ret_conv_27_ref; - } - - FREE(ret_var.data); - return ret_arr; + LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); + *ret_ret = ChainMonitor_as_Confirm(&this_arg_conv); + return tag_ptr(ret_ret, true); } -jboolean CS_LDK_ChannelMonitor_is_fully_resolved(int64_t this_arg, int64_t logger) { - LDKChannelMonitor this_arg_conv; +int64_t CS_LDK_ChainMonitor_as_Watch(int64_t this_arg) { + LDKChainMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - void* logger_ptr = untag_ptr(logger); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - jboolean ret_conv = ChannelMonitor_is_fully_resolved(&this_arg_conv, logger_conv); - return ret_conv; + LDKWatch* ret_ret = MALLOC(sizeof(LDKWatch), "LDKWatch"); + *ret_ret = ChainMonitor_as_Watch(&this_arg_conv); + return tag_ptr(ret_ret, true); } -int64_tArray CS_LDK_ChannelMonitor_get_claimable_balances(int64_t this_arg) { - LDKChannelMonitor this_arg_conv; +int64_t CS_LDK_ChainMonitor_as_EventsProvider(int64_t this_arg) { + LDKChainMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_BalanceZ ret_var = ChannelMonitor_get_claimable_balances(&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 j = 0; j < ret_var.datalen; j++) { - LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_conv_9_copy = ret_var.data[j]; - int64_t ret_conv_9_ref = tag_ptr(ret_conv_9_copy, true); - ret_arr_ptr[j] = ret_conv_9_ref; - } - - FREE(ret_var.data); - return ret_arr; -} - -int64_t CS_LDK_C2Tuple_ThirtyTwoBytesChannelMonitorZ_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_a_ptr = untag_ptr(arg_a); - if (ptr_is_owned(arg_a)) { CHECK_ACCESS(arg_a_ptr); } - LDKEntropySource* arg_a_conv = (LDKEntropySource*)arg_a_ptr; - void* arg_b_ptr = untag_ptr(arg_b); - if (ptr_is_owned(arg_b)) { CHECK_ACCESS(arg_b_ptr); } - LDKSignerProvider* arg_b_conv = (LDKSignerProvider*)arg_b_ptr; - LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ"); - *ret_conv = C2Tuple_ThirtyTwoBytesChannelMonitorZ_read(ser_ref, arg_a_conv, arg_b_conv); - FREE(ser); - return tag_ptr(ret_conv, true); + LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); + *ret_ret = ChainMonitor_as_EventsProvider(&this_arg_conv); + return tag_ptr(ret_ret, true); } -void CS_LDK_OutPoint_free(int64_t this_obj) { - LDKOutPoint this_obj_conv; +void CS_LDK_ChannelMonitorUpdate_free(int64_t this_obj) { + LDKChannelMonitorUpdate this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - OutPoint_free(this_obj_conv); + ChannelMonitorUpdate_free(this_obj_conv); } -int8_tArray CS_LDK_OutPoint_get_txid(int64_t this_ptr) { - LDKOutPoint this_ptr_conv; +int64_t CS_LDK_ChannelMonitorUpdate_get_update_id(int64_t this_ptr) { + LDKChannelMonitorUpdate this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *OutPoint_get_txid(&this_ptr_conv), 32); - return ret_arr; + int64_t ret_conv = ChannelMonitorUpdate_get_update_id(&this_ptr_conv); + return ret_conv; } -void CS_LDK_OutPoint_set_txid(int64_t this_ptr, int8_tArray val) { - LDKOutPoint this_ptr_conv; +void CS_LDK_ChannelMonitorUpdate_set_update_id(int64_t this_ptr, int64_t val) { + LDKChannelMonitorUpdate this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - OutPoint_set_txid(&this_ptr_conv, val_ref); + ChannelMonitorUpdate_set_update_id(&this_ptr_conv, val); } -int16_t CS_LDK_OutPoint_get_index(int64_t this_ptr) { - LDKOutPoint this_ptr_conv; +int64_t CS_LDK_ChannelMonitorUpdate_get_channel_id(int64_t this_ptr) { + LDKChannelMonitorUpdate this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int16_t ret_conv = OutPoint_get_index(&this_ptr_conv); - return ret_conv; + LDKChannelId ret_var = ChannelMonitorUpdate_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_OutPoint_set_index(int64_t this_ptr, int16_t val) { - LDKOutPoint this_ptr_conv; +void CS_LDK_ChannelMonitorUpdate_set_channel_id(int64_t this_ptr, int64_t val) { + LDKChannelMonitorUpdate this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - OutPoint_set_index(&this_ptr_conv, val); -} - -int64_t CS_LDK_OutPoint_new(int8_tArray txid_arg, int16_t index_arg) { - LDKThirtyTwoBytes txid_arg_ref; - CHECK(txid_arg->arr_len == 32); - memcpy(txid_arg_ref.data, txid_arg->elems, 32); FREE(txid_arg); - LDKOutPoint ret_var = OutPoint_new(txid_arg_ref, index_arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + LDKChannelId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelId_clone(&val_conv); + ChannelMonitorUpdate_set_channel_id(&this_ptr_conv, val_conv); } -static inline uint64_t OutPoint_clone_ptr(LDKOutPoint *NONNULL_PTR arg) { - LDKOutPoint ret_var = OutPoint_clone(arg); +static inline uint64_t ChannelMonitorUpdate_clone_ptr(LDKChannelMonitorUpdate *NONNULL_PTR arg) { + LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_OutPoint_clone_ptr(int64_t arg) { - LDKOutPoint arg_conv; +int64_t CS_LDK_ChannelMonitorUpdate_clone_ptr(int64_t arg) { + LDKChannelMonitorUpdate arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = OutPoint_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelMonitorUpdate_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_OutPoint_clone(int64_t orig) { - LDKOutPoint orig_conv; +int64_t CS_LDK_ChannelMonitorUpdate_clone(int64_t orig) { + LDKChannelMonitorUpdate orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKOutPoint ret_var = OutPoint_clone(&orig_conv); + LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_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_OutPoint_eq(int64_t a, int64_t b) { - LDKOutPoint a_conv; +jboolean CS_LDK_ChannelMonitorUpdate_eq(int64_t a, int64_t b) { + LDKChannelMonitorUpdate a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKOutPoint b_conv; + LDKChannelMonitorUpdate b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = OutPoint_eq(&a_conv, &b_conv); - return ret_conv; -} - -int64_t CS_LDK_OutPoint_hash(int64_t o) { - LDKOutPoint o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = OutPoint_hash(&o_conv); + jboolean ret_conv = ChannelMonitorUpdate_eq(&a_conv, &b_conv); return ret_conv; } -int8_tArray CS_LDK_OutPoint_write(int64_t obj) { - LDKOutPoint obj_conv; +int8_tArray CS_LDK_ChannelMonitorUpdate_write(int64_t obj) { + LDKChannelMonitorUpdate obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = OutPoint_write(&obj_conv); + LDKCVec_u8Z ret_var = ChannelMonitorUpdate_write(&obj_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_OutPoint_read(int8_tArray ser) { +int64_t CS_LDK_ChannelMonitorUpdate_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); - *ret_conv = OutPoint_read(ser_ref); + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); + *ret_conv = ChannelMonitorUpdate_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_InboundHTLCErr_free(int64_t this_obj) { - LDKInboundHTLCErr this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InboundHTLCErr_free(this_obj_conv); +void CS_LDK_MonitorEvent_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); + LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + MonitorEvent_free(this_ptr_conv); } -int16_t CS_LDK_InboundHTLCErr_get_err_code(int64_t this_ptr) { - LDKInboundHTLCErr this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int16_t ret_conv = InboundHTLCErr_get_err_code(&this_ptr_conv); +static inline uint64_t MonitorEvent_clone_ptr(LDKMonitorEvent *NONNULL_PTR arg) { + LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_copy = MonitorEvent_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_MonitorEvent_clone_ptr(int64_t arg) { + LDKMonitorEvent* arg_conv = (LDKMonitorEvent*)untag_ptr(arg); + int64_t ret_conv = MonitorEvent_clone_ptr(arg_conv); return ret_conv; } -void CS_LDK_InboundHTLCErr_set_err_code(int64_t this_ptr, int16_t val) { - LDKInboundHTLCErr this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - InboundHTLCErr_set_err_code(&this_ptr_conv, val); +int64_t CS_LDK_MonitorEvent_clone(int64_t orig) { + LDKMonitorEvent* orig_conv = (LDKMonitorEvent*)untag_ptr(orig); + LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_copy = MonitorEvent_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int8_tArray CS_LDK_InboundHTLCErr_get_err_data(int64_t this_ptr) { - LDKInboundHTLCErr this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_u8Z ret_var = InboundHTLCErr_get_err_data(&this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +int64_t CS_LDK_MonitorEvent_htlcevent(int64_t a) { + LDKHTLCUpdate a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = HTLCUpdate_clone(&a_conv); + LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_copy = MonitorEvent_htlcevent(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_InboundHTLCErr_set_err_data(int64_t this_ptr, int8_tArray val) { - LDKInboundHTLCErr this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_u8Z val_ref; - val_ref.datalen = val->arr_len; - val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val); - InboundHTLCErr_set_err_data(&this_ptr_conv, val_ref); +int64_t CS_LDK_MonitorEvent_holder_force_closed_with_info(int64_t reason, int64_t outpoint, int64_t channel_id) { + void* reason_ptr = untag_ptr(reason); + CHECK_ACCESS(reason_ptr); + LDKClosureReason reason_conv = *(LDKClosureReason*)(reason_ptr); + reason_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(reason)); + LDKOutPoint outpoint_conv; + outpoint_conv.inner = untag_ptr(outpoint); + outpoint_conv.is_owned = ptr_is_owned(outpoint); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv); + outpoint_conv = OutPoint_clone(&outpoint_conv); + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); + LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_copy = MonitorEvent_holder_force_closed_with_info(reason_conv, outpoint_conv, channel_id_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jstring CS_LDK_InboundHTLCErr_get_msg(int64_t this_ptr) { - LDKInboundHTLCErr this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKStr ret_str = InboundHTLCErr_get_msg(&this_ptr_conv); - jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); - Str_free(ret_str); +int64_t CS_LDK_MonitorEvent_holder_force_closed(int64_t a) { + LDKOutPoint a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = OutPoint_clone(&a_conv); + LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_copy = MonitorEvent_holder_force_closed(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_MonitorEvent_completed(int64_t funding_txo, int64_t channel_id, int64_t monitor_update_id) { + LDKOutPoint funding_txo_conv; + funding_txo_conv.inner = untag_ptr(funding_txo); + funding_txo_conv.is_owned = ptr_is_owned(funding_txo); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); + funding_txo_conv = OutPoint_clone(&funding_txo_conv); + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); + LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_copy = MonitorEvent_completed(funding_txo_conv, channel_id_conv, monitor_update_id); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +jboolean CS_LDK_MonitorEvent_eq(int64_t a, int64_t b) { + LDKMonitorEvent* a_conv = (LDKMonitorEvent*)untag_ptr(a); + LDKMonitorEvent* b_conv = (LDKMonitorEvent*)untag_ptr(b); + jboolean ret_conv = MonitorEvent_eq(a_conv, b_conv); return ret_conv; } -void CS_LDK_InboundHTLCErr_set_msg(int64_t this_ptr, jstring val) { - LDKInboundHTLCErr this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKStr val_conv = str_ref_to_owned_c(val); - InboundHTLCErr_set_msg(&this_ptr_conv, val_conv); +int8_tArray CS_LDK_MonitorEvent_write(int64_t obj) { + LDKMonitorEvent* obj_conv = (LDKMonitorEvent*)untag_ptr(obj); + LDKCVec_u8Z ret_var = MonitorEvent_write(obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -int64_t CS_LDK_InboundHTLCErr_new(int16_t err_code_arg, int8_tArray err_data_arg, jstring msg_arg) { - LDKCVec_u8Z err_data_arg_ref; - err_data_arg_ref.datalen = err_data_arg->arr_len; - err_data_arg_ref.data = MALLOC(err_data_arg_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(err_data_arg_ref.data, err_data_arg->elems, err_data_arg_ref.datalen); FREE(err_data_arg); - LDKStr msg_arg_conv = str_ref_to_owned_c(msg_arg); - LDKInboundHTLCErr ret_var = InboundHTLCErr_new(err_code_arg, err_data_arg_ref, msg_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +int64_t CS_LDK_MonitorEvent_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = MonitorEvent_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -static inline uint64_t InboundHTLCErr_clone_ptr(LDKInboundHTLCErr *NONNULL_PTR arg) { - LDKInboundHTLCErr ret_var = InboundHTLCErr_clone(arg); +void CS_LDK_HTLCUpdate_free(int64_t this_obj) { + LDKHTLCUpdate this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + HTLCUpdate_free(this_obj_conv); +} + +static inline uint64_t HTLCUpdate_clone_ptr(LDKHTLCUpdate *NONNULL_PTR arg) { + LDKHTLCUpdate ret_var = HTLCUpdate_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_InboundHTLCErr_clone_ptr(int64_t arg) { - LDKInboundHTLCErr arg_conv; +int64_t CS_LDK_HTLCUpdate_clone_ptr(int64_t arg) { + LDKHTLCUpdate arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = InboundHTLCErr_clone_ptr(&arg_conv); + int64_t ret_conv = HTLCUpdate_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_InboundHTLCErr_clone(int64_t orig) { - LDKInboundHTLCErr orig_conv; +int64_t CS_LDK_HTLCUpdate_clone(int64_t orig) { + LDKHTLCUpdate orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKInboundHTLCErr ret_var = InboundHTLCErr_clone(&orig_conv); + LDKHTLCUpdate ret_var = HTLCUpdate_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_InboundHTLCErr_hash(int64_t o) { - LDKInboundHTLCErr o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = InboundHTLCErr_hash(&o_conv); - return ret_conv; -} - -jboolean CS_LDK_InboundHTLCErr_eq(int64_t a, int64_t b) { - LDKInboundHTLCErr a_conv; +jboolean CS_LDK_HTLCUpdate_eq(int64_t a, int64_t b) { + LDKHTLCUpdate a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKInboundHTLCErr b_conv; + LDKHTLCUpdate b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = InboundHTLCErr_eq(&a_conv, &b_conv); + jboolean ret_conv = HTLCUpdate_eq(&a_conv, &b_conv); return ret_conv; } -int64_t CS_LDK_peel_payment_onion(int64_t msg, int64_t node_signer, int64_t logger, int32_t cur_height, jboolean accept_mpp_keysend, jboolean allow_skimmed_fees) { - LDKUpdateAddHTLC msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - void* node_signer_ptr = untag_ptr(node_signer); - if (ptr_is_owned(node_signer)) { CHECK_ACCESS(node_signer_ptr); } - LDKNodeSigner* node_signer_conv = (LDKNodeSigner*)node_signer_ptr; - void* logger_ptr = untag_ptr(logger); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - LDKCResult_PendingHTLCInfoInboundHTLCErrZ* ret_conv = MALLOC(sizeof(LDKCResult_PendingHTLCInfoInboundHTLCErrZ), "LDKCResult_PendingHTLCInfoInboundHTLCErrZ"); - *ret_conv = peel_payment_onion(&msg_conv, node_signer_conv, logger_conv, cur_height, accept_mpp_keysend, allow_skimmed_fees); +int8_tArray CS_LDK_HTLCUpdate_write(int64_t obj) { + LDKHTLCUpdate obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = HTLCUpdate_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_HTLCUpdate_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); + *ret_conv = HTLCUpdate_read(ser_ref); + FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_PendingHTLCRouting_free(int64_t this_ptr) { +void CS_LDK_Balance_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); - LDKPendingHTLCRouting this_ptr_conv = *(LDKPendingHTLCRouting*)(this_ptr_ptr); + LDKBalance this_ptr_conv = *(LDKBalance*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - PendingHTLCRouting_free(this_ptr_conv); + Balance_free(this_ptr_conv); } -static inline uint64_t PendingHTLCRouting_clone_ptr(LDKPendingHTLCRouting *NONNULL_PTR arg) { - LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); - *ret_copy = PendingHTLCRouting_clone(arg); +static inline uint64_t Balance_clone_ptr(LDKBalance *NONNULL_PTR arg) { + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_PendingHTLCRouting_clone_ptr(int64_t arg) { - LDKPendingHTLCRouting* arg_conv = (LDKPendingHTLCRouting*)untag_ptr(arg); - int64_t ret_conv = PendingHTLCRouting_clone_ptr(arg_conv); +int64_t CS_LDK_Balance_clone_ptr(int64_t arg) { + LDKBalance* arg_conv = (LDKBalance*)untag_ptr(arg); + int64_t ret_conv = Balance_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_PendingHTLCRouting_clone(int64_t orig) { - LDKPendingHTLCRouting* orig_conv = (LDKPendingHTLCRouting*)untag_ptr(orig); - LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); - *ret_copy = PendingHTLCRouting_clone(orig_conv); +int64_t CS_LDK_Balance_clone(int64_t orig) { + LDKBalance* orig_conv = (LDKBalance*)untag_ptr(orig); + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_clone(orig_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_PendingHTLCRouting_forward(int64_t onion_packet, int64_t short_channel_id, int64_t blinded) { - LDKOnionPacket onion_packet_conv; - onion_packet_conv.inner = untag_ptr(onion_packet); - onion_packet_conv.is_owned = ptr_is_owned(onion_packet); - CHECK_INNER_FIELD_ACCESS_OR_NULL(onion_packet_conv); - onion_packet_conv = OnionPacket_clone(&onion_packet_conv); - LDKBlindedForward blinded_conv; - blinded_conv.inner = untag_ptr(blinded); - blinded_conv.is_owned = ptr_is_owned(blinded); - CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_conv); - blinded_conv = BlindedForward_clone(&blinded_conv); - LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); - *ret_copy = PendingHTLCRouting_forward(onion_packet_conv, short_channel_id, blinded_conv); +int64_t CS_LDK_Balance_claimable_on_channel_close(int64_t amount_satoshis) { + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_claimable_on_channel_close(amount_satoshis); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_PendingHTLCRouting_receive(int64_t payment_data, int64_t payment_metadata, int64_t payment_context, int32_t incoming_cltv_expiry, int8_tArray phantom_shared_secret, int64_tArray custom_tlvs, jboolean requires_blinded_error) { - LDKFinalOnionHopData payment_data_conv; - payment_data_conv.inner = untag_ptr(payment_data); - payment_data_conv.is_owned = ptr_is_owned(payment_data); - CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_data_conv); - payment_data_conv = FinalOnionHopData_clone(&payment_data_conv); - void* payment_metadata_ptr = untag_ptr(payment_metadata); - CHECK_ACCESS(payment_metadata_ptr); - LDKCOption_CVec_u8ZZ payment_metadata_conv = *(LDKCOption_CVec_u8ZZ*)(payment_metadata_ptr); - payment_metadata_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(payment_metadata)); - void* payment_context_ptr = untag_ptr(payment_context); - CHECK_ACCESS(payment_context_ptr); - LDKCOption_PaymentContextZ payment_context_conv = *(LDKCOption_PaymentContextZ*)(payment_context_ptr); - payment_context_conv = COption_PaymentContextZ_clone((LDKCOption_PaymentContextZ*)untag_ptr(payment_context)); - LDKThirtyTwoBytes phantom_shared_secret_ref; - CHECK(phantom_shared_secret->arr_len == 32); - memcpy(phantom_shared_secret_ref.data, phantom_shared_secret->elems, 32); FREE(phantom_shared_secret); - LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs_constr; - custom_tlvs_constr.datalen = custom_tlvs->arr_len; - if (custom_tlvs_constr.datalen > 0) - custom_tlvs_constr.data = MALLOC(custom_tlvs_constr.datalen * sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKCVec_C2Tuple_u64CVec_u8ZZZ Elements"); - else - custom_tlvs_constr.data = NULL; - 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); - LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); - *ret_copy = PendingHTLCRouting_receive(payment_data_conv, payment_metadata_conv, payment_context_conv, incoming_cltv_expiry, phantom_shared_secret_ref, custom_tlvs_constr, requires_blinded_error); +int64_t CS_LDK_Balance_claimable_awaiting_confirmations(int64_t amount_satoshis, int32_t confirmation_height) { + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_claimable_awaiting_confirmations(amount_satoshis, confirmation_height); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_PendingHTLCRouting_receive_keysend(int64_t payment_data, int8_tArray payment_preimage, int64_t payment_metadata, int32_t incoming_cltv_expiry, int64_tArray custom_tlvs, jboolean requires_blinded_error) { - LDKFinalOnionHopData payment_data_conv; - payment_data_conv.inner = untag_ptr(payment_data); - payment_data_conv.is_owned = ptr_is_owned(payment_data); - CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_data_conv); - payment_data_conv = FinalOnionHopData_clone(&payment_data_conv); +int64_t CS_LDK_Balance_contentious_claimable(int64_t amount_satoshis, int32_t timeout_height, int8_tArray payment_hash, int8_tArray payment_preimage) { + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); LDKThirtyTwoBytes payment_preimage_ref; CHECK(payment_preimage->arr_len == 32); memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); - void* payment_metadata_ptr = untag_ptr(payment_metadata); - CHECK_ACCESS(payment_metadata_ptr); - LDKCOption_CVec_u8ZZ payment_metadata_conv = *(LDKCOption_CVec_u8ZZ*)(payment_metadata_ptr); - payment_metadata_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(payment_metadata)); - LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs_constr; - custom_tlvs_constr.datalen = custom_tlvs->arr_len; - if (custom_tlvs_constr.datalen > 0) - custom_tlvs_constr.data = MALLOC(custom_tlvs_constr.datalen * sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKCVec_C2Tuple_u64CVec_u8ZZZ Elements"); - else - custom_tlvs_constr.data = NULL; - 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); - LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); - *ret_copy = PendingHTLCRouting_receive_keysend(payment_data_conv, payment_preimage_ref, payment_metadata_conv, incoming_cltv_expiry, custom_tlvs_constr, requires_blinded_error); + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_contentious_claimable(amount_satoshis, timeout_height, payment_hash_ref, payment_preimage_ref); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void CS_LDK_BlindedForward_free(int64_t this_obj) { - LDKBlindedForward this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BlindedForward_free(this_obj_conv); +int64_t CS_LDK_Balance_maybe_timeout_claimable_htlc(int64_t amount_satoshis, int32_t claimable_height, int8_tArray payment_hash) { + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_maybe_timeout_claimable_htlc(amount_satoshis, claimable_height, payment_hash_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int8_tArray CS_LDK_BlindedForward_get_inbound_blinding_point(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_inbound_blinding_point(&this_ptr_conv).compressed_form, 33); - return ret_arr; +int64_t CS_LDK_Balance_maybe_preimage_claimable_htlc(int64_t amount_satoshis, int32_t expiry_height, int8_tArray payment_hash) { + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_maybe_preimage_claimable_htlc(amount_satoshis, expiry_height, payment_hash_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_BlindedForward_set_inbound_blinding_point(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_inbound_blinding_point(&this_ptr_conv, val_ref); +int64_t CS_LDK_Balance_counterparty_revoked_output_claimable(int64_t amount_satoshis) { + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_counterparty_revoked_output_claimable(amount_satoshis); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int32_t CS_LDK_BlindedForward_get_failure(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; - int32_t ret_conv = LDKBlindedFailure_to_cs(BlindedForward_get_failure(&this_ptr_conv)); +jboolean CS_LDK_Balance_eq(int64_t a, int64_t b) { + LDKBalance* a_conv = (LDKBalance*)untag_ptr(a); + LDKBalance* b_conv = (LDKBalance*)untag_ptr(b); + jboolean ret_conv = Balance_eq(a_conv, b_conv); return ret_conv; } -void CS_LDK_BlindedForward_set_failure(int64_t this_ptr, int32_t val) { - LDKBlindedForward this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKBlindedFailure val_conv = LDKBlindedFailure_from_cs(val); - BlindedForward_set_failure(&this_ptr_conv, val_conv); +int64_t CS_LDK_Balance_claimable_amount_satoshis(int64_t this_arg) { + LDKBalance* this_arg_conv = (LDKBalance*)untag_ptr(this_arg); + int64_t ret_conv = Balance_claimable_amount_satoshis(this_arg_conv); + return ret_conv; } -int64_t CS_LDK_BlindedForward_new(int8_tArray inbound_blinding_point_arg, int32_t failure_arg) { - LDKPublicKey inbound_blinding_point_arg_ref; - CHECK(inbound_blinding_point_arg->arr_len == 33); - memcpy(inbound_blinding_point_arg_ref.compressed_form, inbound_blinding_point_arg->elems, 33); FREE(inbound_blinding_point_arg); - LDKBlindedFailure failure_arg_conv = LDKBlindedFailure_from_cs(failure_arg); - LDKBlindedForward ret_var = BlindedForward_new(inbound_blinding_point_arg_ref, failure_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +void CS_LDK_ChannelMonitor_free(int64_t this_obj) { + LDKChannelMonitor this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelMonitor_free(this_obj_conv); } -static inline uint64_t BlindedForward_clone_ptr(LDKBlindedForward *NONNULL_PTR arg) { - LDKBlindedForward ret_var = BlindedForward_clone(arg); +static inline uint64_t ChannelMonitor_clone_ptr(LDKChannelMonitor *NONNULL_PTR arg) { + LDKChannelMonitor ret_var = ChannelMonitor_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_BlindedForward_clone_ptr(int64_t arg) { - LDKBlindedForward arg_conv; +int64_t CS_LDK_ChannelMonitor_clone_ptr(int64_t arg) { + LDKChannelMonitor arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = BlindedForward_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelMonitor_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_BlindedForward_clone(int64_t orig) { - LDKBlindedForward orig_conv; +int64_t CS_LDK_ChannelMonitor_clone(int64_t orig) { + LDKChannelMonitor orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBlindedForward ret_var = BlindedForward_clone(&orig_conv); + LDKChannelMonitor ret_var = ChannelMonitor_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_BlindedForward_hash(int64_t o) { - LDKBlindedForward o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = BlindedForward_hash(&o_conv); - return ret_conv; +int8_tArray CS_LDK_ChannelMonitor_write(int64_t obj) { + LDKChannelMonitor obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ChannelMonitor_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -jboolean CS_LDK_BlindedForward_eq(int64_t a, int64_t b) { - LDKBlindedForward a_conv; +int64_t CS_LDK_ChannelMonitor_update_monitor(int64_t this_arg, int64_t updates, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelMonitorUpdate updates_conv; + updates_conv.inner = untag_ptr(updates); + updates_conv.is_owned = ptr_is_owned(updates); + CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv); + updates_conv.is_owned = false; + void* broadcaster_ptr = untag_ptr(broadcaster); + if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); } + LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; + void* fee_estimator_ptr = untag_ptr(fee_estimator); + if (ptr_is_owned(fee_estimator)) { CHECK_ACCESS(fee_estimator_ptr); } + LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; + void* logger_ptr = untag_ptr(logger); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelMonitor_update_monitor(&this_arg_conv, &updates_conv, broadcaster_conv, fee_estimator_conv, logger_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_ChannelMonitor_get_latest_update_id(int64_t this_arg) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int64_t ret_conv = ChannelMonitor_get_latest_update_id(&this_arg_conv); + return ret_conv; +} + +int64_t CS_LDK_ChannelMonitor_get_funding_txo(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; + LDKC2Tuple_OutPointCVec_u8ZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_u8ZZ), "LDKC2Tuple_OutPointCVec_u8ZZ"); + *ret_conv = ChannelMonitor_get_funding_txo(&this_arg_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_ChannelMonitor_channel_id(int64_t this_arg) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelId ret_var = ChannelMonitor_channel_id(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int64_tArray CS_LDK_ChannelMonitor_get_outputs_to_watch(int64_t this_arg) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ ret_var = ChannelMonitor_get_outputs_to_watch(&this_arg_conv); + 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 a = 0; a < ret_var.datalen; a++) { + LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ* ret_conv_52_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ), "LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ"); + *ret_conv_52_conv = ret_var.data[a]; + ret_arr_ptr[a] = tag_ptr(ret_conv_52_conv, true); + } + + FREE(ret_var.data); + return ret_arr; +} + +void CS_LDK_ChannelMonitor_load_outputs_to_watch(int64_t this_arg, int64_t filter, int64_t logger) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + void* filter_ptr = untag_ptr(filter); + if (ptr_is_owned(filter)) { CHECK_ACCESS(filter_ptr); } + LDKFilter* filter_conv = (LDKFilter*)filter_ptr; + void* logger_ptr = untag_ptr(logger); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + ChannelMonitor_load_outputs_to_watch(&this_arg_conv, filter_conv, logger_conv); +} + +int64_tArray CS_LDK_ChannelMonitor_get_and_clear_pending_monitor_events(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; + LDKCVec_MonitorEventZ ret_var = ChannelMonitor_get_and_clear_pending_monitor_events(&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 o = 0; o < ret_var.datalen; o++) { + LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_conv_14_copy = ret_var.data[o]; + int64_t ret_conv_14_ref = tag_ptr(ret_conv_14_copy, true); + ret_arr_ptr[o] = ret_conv_14_ref; + } + + FREE(ret_var.data); + return ret_arr; +} + +void 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); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + void* handler_ptr = untag_ptr(handler); + if (ptr_is_owned(handler)) { CHECK_ACCESS(handler_ptr); } + LDKEventHandler* handler_conv = (LDKEventHandler*)handler_ptr; + ChannelMonitor_process_pending_events(&this_arg_conv, handler_conv); +} + +int64_t CS_LDK_ChannelMonitor_initial_counterparty_commitment_tx(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; + LDKCommitmentTransaction ret_var = ChannelMonitor_initial_counterparty_commitment_tx(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int64_tArray CS_LDK_ChannelMonitor_counterparty_commitment_txs_from_update(int64_t this_arg, int64_t update) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelMonitorUpdate update_conv; + update_conv.inner = untag_ptr(update); + update_conv.is_owned = ptr_is_owned(update); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv); + update_conv.is_owned = false; + LDKCVec_CommitmentTransactionZ ret_var = ChannelMonitor_counterparty_commitment_txs_from_update(&this_arg_conv, &update_conv); + 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++) { + LDKCommitmentTransaction ret_conv_23_var = ret_var.data[x]; + int64_t ret_conv_23_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_23_var); + ret_conv_23_ref = tag_ptr(ret_conv_23_var.inner, ret_conv_23_var.is_owned); + ret_arr_ptr[x] = ret_conv_23_ref; + } + + FREE(ret_var.data); + return ret_arr; +} + +int64_t CS_LDK_ChannelMonitor_sign_to_local_justice_tx(int64_t this_arg, int8_tArray justice_tx, int64_t input_idx, int64_t value, int64_t commitment_number) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKTransaction justice_tx_ref; + justice_tx_ref.datalen = justice_tx->arr_len; + justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes"); + memcpy(justice_tx_ref.data, justice_tx->elems, justice_tx_ref.datalen); FREE(justice_tx); + justice_tx_ref.data_is_owned = true; + LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); + *ret_conv = ChannelMonitor_sign_to_local_justice_tx(&this_arg_conv, justice_tx_ref, input_idx, value, commitment_number); + return tag_ptr(ret_conv, true); +} + +int8_tArray CS_LDK_ChannelMonitor_get_counterparty_node_id(int64_t this_arg) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, ChannelMonitor_get_counterparty_node_id(&this_arg_conv).compressed_form, 33); + return ret_arr; +} + +void CS_LDK_ChannelMonitor_broadcast_latest_holder_commitment_txn(int64_t this_arg, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + void* broadcaster_ptr = untag_ptr(broadcaster); + if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); } + LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; + void* fee_estimator_ptr = untag_ptr(fee_estimator); + if (ptr_is_owned(fee_estimator)) { CHECK_ACCESS(fee_estimator_ptr); } + LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; + void* logger_ptr = untag_ptr(logger); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + ChannelMonitor_broadcast_latest_holder_commitment_txn(&this_arg_conv, broadcaster_conv, fee_estimator_conv, logger_conv); +} + +int64_tArray CS_LDK_ChannelMonitor_block_connected(int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + uint8_t header_arr[80]; + CHECK(header->arr_len == 80); + memcpy(header_arr, header->elems, 80); FREE(header); + uint8_t (*header_ref)[80] = &header_arr; + LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr; + txdata_constr.datalen = txdata->arr_len; + if (txdata_constr.datalen > 0) + txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); + else + txdata_constr.data = NULL; + int64_t* txdata_vals = txdata->elems; + for (size_t c = 0; c < txdata_constr.datalen; c++) { + int64_t txdata_conv_28 = txdata_vals[c]; + void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28); + CHECK_ACCESS(txdata_conv_28_ptr); + LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr); + txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28)); + txdata_constr.data[c] = txdata_conv_28_conv; + } + FREE(txdata); + void* broadcaster_ptr = untag_ptr(broadcaster); + CHECK_ACCESS(broadcaster_ptr); + LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); + if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); + } + void* fee_estimator_ptr = untag_ptr(fee_estimator); + CHECK_ACCESS(fee_estimator_ptr); + LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); + if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); + } + void* logger_ptr = untag_ptr(logger); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_block_connected(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t x = 0; x < ret_var.datalen; x++) { + LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ* ret_conv_49_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ"); + *ret_conv_49_conv = ret_var.data[x]; + ret_arr_ptr[x] = tag_ptr(ret_conv_49_conv, true); + } + + FREE(ret_var.data); + return ret_arr; +} + +void CS_LDK_ChannelMonitor_block_disconnected(int64_t this_arg, int8_tArray header, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + uint8_t header_arr[80]; + CHECK(header->arr_len == 80); + memcpy(header_arr, header->elems, 80); FREE(header); + uint8_t (*header_ref)[80] = &header_arr; + void* broadcaster_ptr = untag_ptr(broadcaster); + CHECK_ACCESS(broadcaster_ptr); + LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); + if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); + } + void* fee_estimator_ptr = untag_ptr(fee_estimator); + CHECK_ACCESS(fee_estimator_ptr); + LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); + if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); + } + void* logger_ptr = untag_ptr(logger); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + ChannelMonitor_block_disconnected(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv); +} + +int64_tArray CS_LDK_ChannelMonitor_transactions_confirmed(int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + uint8_t header_arr[80]; + CHECK(header->arr_len == 80); + memcpy(header_arr, header->elems, 80); FREE(header); + uint8_t (*header_ref)[80] = &header_arr; + LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr; + txdata_constr.datalen = txdata->arr_len; + if (txdata_constr.datalen > 0) + txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); + else + txdata_constr.data = NULL; + int64_t* txdata_vals = txdata->elems; + for (size_t c = 0; c < txdata_constr.datalen; c++) { + int64_t txdata_conv_28 = txdata_vals[c]; + void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28); + CHECK_ACCESS(txdata_conv_28_ptr); + LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr); + txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28)); + txdata_constr.data[c] = txdata_conv_28_conv; + } + FREE(txdata); + void* broadcaster_ptr = untag_ptr(broadcaster); + CHECK_ACCESS(broadcaster_ptr); + LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); + if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); + } + void* fee_estimator_ptr = untag_ptr(fee_estimator); + CHECK_ACCESS(fee_estimator_ptr); + LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); + if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); + } + void* logger_ptr = untag_ptr(logger); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_transactions_confirmed(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t x = 0; x < ret_var.datalen; x++) { + LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ* ret_conv_49_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ"); + *ret_conv_49_conv = ret_var.data[x]; + ret_arr_ptr[x] = tag_ptr(ret_conv_49_conv, true); + } + + FREE(ret_var.data); + return ret_arr; +} + +void CS_LDK_ChannelMonitor_transaction_unconfirmed(int64_t this_arg, int8_tArray txid, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + uint8_t txid_arr[32]; + CHECK(txid->arr_len == 32); + memcpy(txid_arr, txid->elems, 32); FREE(txid); + uint8_t (*txid_ref)[32] = &txid_arr; + void* broadcaster_ptr = untag_ptr(broadcaster); + CHECK_ACCESS(broadcaster_ptr); + LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); + if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); + } + void* fee_estimator_ptr = untag_ptr(fee_estimator); + CHECK_ACCESS(fee_estimator_ptr); + LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); + if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); + } + void* logger_ptr = untag_ptr(logger); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + ChannelMonitor_transaction_unconfirmed(&this_arg_conv, txid_ref, broadcaster_conv, fee_estimator_conv, logger_conv); +} + +int64_tArray CS_LDK_ChannelMonitor_best_block_updated(int64_t this_arg, int8_tArray header, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + uint8_t header_arr[80]; + CHECK(header->arr_len == 80); + memcpy(header_arr, header->elems, 80); FREE(header); + uint8_t (*header_ref)[80] = &header_arr; + void* broadcaster_ptr = untag_ptr(broadcaster); + CHECK_ACCESS(broadcaster_ptr); + LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); + if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); + } + void* fee_estimator_ptr = untag_ptr(fee_estimator); + CHECK_ACCESS(fee_estimator_ptr); + LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); + if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); + } + void* logger_ptr = untag_ptr(logger); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_best_block_updated(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t x = 0; x < ret_var.datalen; x++) { + LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ* ret_conv_49_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ"); + *ret_conv_49_conv = ret_var.data[x]; + ret_arr_ptr[x] = tag_ptr(ret_conv_49_conv, true); + } + + FREE(ret_var.data); + return ret_arr; +} + +int64_tArray CS_LDK_ChannelMonitor_get_relevant_txids(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; + LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ ret_var = ChannelMonitor_get_relevant_txids(&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 c = 0; c < ret_var.datalen; c++) { + LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ* ret_conv_54_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ), "LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ"); + *ret_conv_54_conv = ret_var.data[c]; + ret_arr_ptr[c] = tag_ptr(ret_conv_54_conv, true); + } + + FREE(ret_var.data); + return ret_arr; +} + +int64_t CS_LDK_ChannelMonitor_current_best_block(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; + LDKBestBlock ret_var = ChannelMonitor_current_best_block(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +void CS_LDK_ChannelMonitor_rebroadcast_pending_claims(int64_t this_arg, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + void* broadcaster_ptr = untag_ptr(broadcaster); + CHECK_ACCESS(broadcaster_ptr); + LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); + if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); + } + void* fee_estimator_ptr = untag_ptr(fee_estimator); + CHECK_ACCESS(fee_estimator_ptr); + LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); + if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); + } + void* logger_ptr = untag_ptr(logger); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + ChannelMonitor_rebroadcast_pending_claims(&this_arg_conv, broadcaster_conv, fee_estimator_conv, logger_conv); +} + +void CS_LDK_ChannelMonitor_signer_unblocked(int64_t this_arg, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + void* broadcaster_ptr = untag_ptr(broadcaster); + CHECK_ACCESS(broadcaster_ptr); + LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); + if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); + } + void* fee_estimator_ptr = untag_ptr(fee_estimator); + CHECK_ACCESS(fee_estimator_ptr); + LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); + if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); + } + void* logger_ptr = untag_ptr(logger); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + ChannelMonitor_signer_unblocked(&this_arg_conv, broadcaster_conv, fee_estimator_conv, logger_conv); +} + +int64_tArray CS_LDK_ChannelMonitor_get_spendable_outputs(int64_t this_arg, int8_tArray tx, int32_t confirmation_height) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKTransaction tx_ref; + tx_ref.datalen = tx->arr_len; + tx_ref.data = MALLOC(tx_ref.datalen, "LDKTransaction Bytes"); + memcpy(tx_ref.data, tx->elems, tx_ref.datalen); FREE(tx); + tx_ref.data_is_owned = true; + LDKCVec_SpendableOutputDescriptorZ ret_var = ChannelMonitor_get_spendable_outputs(&this_arg_conv, tx_ref, confirmation_height); + 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 b = 0; b < ret_var.datalen; b++) { + LDKSpendableOutputDescriptor *ret_conv_27_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_conv_27_copy = ret_var.data[b]; + int64_t ret_conv_27_ref = tag_ptr(ret_conv_27_copy, true); + ret_arr_ptr[b] = ret_conv_27_ref; + } + + FREE(ret_var.data); + return ret_arr; +} + +jboolean CS_LDK_ChannelMonitor_is_fully_resolved(int64_t this_arg, int64_t logger) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + void* logger_ptr = untag_ptr(logger); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + jboolean ret_conv = ChannelMonitor_is_fully_resolved(&this_arg_conv, logger_conv); + return ret_conv; +} + +int64_tArray CS_LDK_ChannelMonitor_get_claimable_balances(int64_t this_arg) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_BalanceZ ret_var = ChannelMonitor_get_claimable_balances(&this_arg_conv); + 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 j = 0; j < ret_var.datalen; j++) { + LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_conv_9_copy = ret_var.data[j]; + int64_t ret_conv_9_ref = tag_ptr(ret_conv_9_copy, true); + ret_arr_ptr[j] = ret_conv_9_ref; + } + + FREE(ret_var.data); + return ret_arr; +} + +int64_t CS_LDK_C2Tuple_ThirtyTwoBytesChannelMonitorZ_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_a_ptr = untag_ptr(arg_a); + if (ptr_is_owned(arg_a)) { CHECK_ACCESS(arg_a_ptr); } + LDKEntropySource* arg_a_conv = (LDKEntropySource*)arg_a_ptr; + void* arg_b_ptr = untag_ptr(arg_b); + if (ptr_is_owned(arg_b)) { CHECK_ACCESS(arg_b_ptr); } + LDKSignerProvider* arg_b_conv = (LDKSignerProvider*)arg_b_ptr; + LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ"); + *ret_conv = C2Tuple_ThirtyTwoBytesChannelMonitorZ_read(ser_ref, arg_a_conv, arg_b_conv); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_OutPoint_free(int64_t this_obj) { + LDKOutPoint this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OutPoint_free(this_obj_conv); +} + +int8_tArray CS_LDK_OutPoint_get_txid(int64_t this_ptr) { + LDKOutPoint this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *OutPoint_get_txid(&this_ptr_conv), 32); + return ret_arr; +} + +void CS_LDK_OutPoint_set_txid(int64_t this_ptr, int8_tArray val) { + LDKOutPoint this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + OutPoint_set_txid(&this_ptr_conv, val_ref); +} + +int16_t CS_LDK_OutPoint_get_index(int64_t this_ptr) { + LDKOutPoint this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int16_t ret_conv = OutPoint_get_index(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_OutPoint_set_index(int64_t this_ptr, int16_t val) { + LDKOutPoint this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + OutPoint_set_index(&this_ptr_conv, val); +} + +int64_t CS_LDK_OutPoint_new(int8_tArray txid_arg, int16_t index_arg) { + LDKThirtyTwoBytes txid_arg_ref; + CHECK(txid_arg->arr_len == 32); + memcpy(txid_arg_ref.data, txid_arg->elems, 32); FREE(txid_arg); + LDKOutPoint ret_var = OutPoint_new(txid_arg_ref, index_arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t OutPoint_clone_ptr(LDKOutPoint *NONNULL_PTR arg) { + LDKOutPoint ret_var = OutPoint_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_OutPoint_clone_ptr(int64_t arg) { + LDKOutPoint arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = OutPoint_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_OutPoint_clone(int64_t orig) { + LDKOutPoint orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKOutPoint ret_var = OutPoint_clone(&orig_conv); + int64_t ret_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_OutPoint_eq(int64_t a, int64_t b) { + LDKOutPoint a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKOutPoint b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = OutPoint_eq(&a_conv, &b_conv); + return ret_conv; +} + +int64_t CS_LDK_OutPoint_hash(int64_t o) { + LDKOutPoint o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = OutPoint_hash(&o_conv); + return ret_conv; +} + +jstring CS_LDK_OutPoint_to_str(int64_t o) { + LDKOutPoint o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = OutPoint_to_str(&o_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +int8_tArray CS_LDK_OutPoint_write(int64_t obj) { + LDKOutPoint obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = OutPoint_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_OutPoint_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); + *ret_conv = OutPoint_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_InboundHTLCErr_free(int64_t this_obj) { + LDKInboundHTLCErr this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InboundHTLCErr_free(this_obj_conv); +} + +int16_t CS_LDK_InboundHTLCErr_get_err_code(int64_t this_ptr) { + LDKInboundHTLCErr this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int16_t ret_conv = InboundHTLCErr_get_err_code(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_InboundHTLCErr_set_err_code(int64_t this_ptr, int16_t val) { + LDKInboundHTLCErr this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + InboundHTLCErr_set_err_code(&this_ptr_conv, val); +} + +int8_tArray CS_LDK_InboundHTLCErr_get_err_data(int64_t this_ptr) { + LDKInboundHTLCErr this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u8Z ret_var = InboundHTLCErr_get_err_data(&this_ptr_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +void CS_LDK_InboundHTLCErr_set_err_data(int64_t this_ptr, int8_tArray val) { + LDKInboundHTLCErr this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u8Z val_ref; + val_ref.datalen = val->arr_len; + val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val); + InboundHTLCErr_set_err_data(&this_ptr_conv, val_ref); +} + +jstring CS_LDK_InboundHTLCErr_get_msg(int64_t this_ptr) { + LDKInboundHTLCErr this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKStr ret_str = InboundHTLCErr_get_msg(&this_ptr_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +void CS_LDK_InboundHTLCErr_set_msg(int64_t this_ptr, jstring val) { + LDKInboundHTLCErr this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKStr val_conv = str_ref_to_owned_c(val); + InboundHTLCErr_set_msg(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_InboundHTLCErr_new(int16_t err_code_arg, int8_tArray err_data_arg, jstring msg_arg) { + LDKCVec_u8Z err_data_arg_ref; + err_data_arg_ref.datalen = err_data_arg->arr_len; + err_data_arg_ref.data = MALLOC(err_data_arg_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(err_data_arg_ref.data, err_data_arg->elems, err_data_arg_ref.datalen); FREE(err_data_arg); + LDKStr msg_arg_conv = str_ref_to_owned_c(msg_arg); + LDKInboundHTLCErr ret_var = InboundHTLCErr_new(err_code_arg, err_data_arg_ref, msg_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t InboundHTLCErr_clone_ptr(LDKInboundHTLCErr *NONNULL_PTR arg) { + LDKInboundHTLCErr ret_var = InboundHTLCErr_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_InboundHTLCErr_clone_ptr(int64_t arg) { + LDKInboundHTLCErr arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = InboundHTLCErr_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_InboundHTLCErr_clone(int64_t orig) { + LDKInboundHTLCErr orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKInboundHTLCErr ret_var = InboundHTLCErr_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int64_t CS_LDK_InboundHTLCErr_hash(int64_t o) { + LDKInboundHTLCErr o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = InboundHTLCErr_hash(&o_conv); + return ret_conv; +} + +jboolean CS_LDK_InboundHTLCErr_eq(int64_t a, int64_t b) { + LDKInboundHTLCErr a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKInboundHTLCErr b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = InboundHTLCErr_eq(&a_conv, &b_conv); + return ret_conv; +} + +int64_t CS_LDK_peel_payment_onion(int64_t msg, int64_t node_signer, int64_t logger, int32_t cur_height, jboolean accept_mpp_keysend, jboolean allow_skimmed_fees) { + LDKUpdateAddHTLC msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + void* node_signer_ptr = untag_ptr(node_signer); + if (ptr_is_owned(node_signer)) { CHECK_ACCESS(node_signer_ptr); } + LDKNodeSigner* node_signer_conv = (LDKNodeSigner*)node_signer_ptr; + void* logger_ptr = untag_ptr(logger); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + LDKCResult_PendingHTLCInfoInboundHTLCErrZ* ret_conv = MALLOC(sizeof(LDKCResult_PendingHTLCInfoInboundHTLCErrZ), "LDKCResult_PendingHTLCInfoInboundHTLCErrZ"); + *ret_conv = peel_payment_onion(&msg_conv, node_signer_conv, logger_conv, cur_height, accept_mpp_keysend, allow_skimmed_fees); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_PendingHTLCRouting_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); + LDKPendingHTLCRouting this_ptr_conv = *(LDKPendingHTLCRouting*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + PendingHTLCRouting_free(this_ptr_conv); +} + +static inline uint64_t PendingHTLCRouting_clone_ptr(LDKPendingHTLCRouting *NONNULL_PTR arg) { + LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); + *ret_copy = PendingHTLCRouting_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_PendingHTLCRouting_clone_ptr(int64_t arg) { + LDKPendingHTLCRouting* arg_conv = (LDKPendingHTLCRouting*)untag_ptr(arg); + int64_t ret_conv = PendingHTLCRouting_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_PendingHTLCRouting_clone(int64_t orig) { + LDKPendingHTLCRouting* orig_conv = (LDKPendingHTLCRouting*)untag_ptr(orig); + LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); + *ret_copy = PendingHTLCRouting_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_PendingHTLCRouting_forward(int64_t onion_packet, int64_t short_channel_id, int64_t blinded) { + LDKOnionPacket onion_packet_conv; + onion_packet_conv.inner = untag_ptr(onion_packet); + onion_packet_conv.is_owned = ptr_is_owned(onion_packet); + CHECK_INNER_FIELD_ACCESS_OR_NULL(onion_packet_conv); + onion_packet_conv = OnionPacket_clone(&onion_packet_conv); + LDKBlindedForward blinded_conv; + blinded_conv.inner = untag_ptr(blinded); + blinded_conv.is_owned = ptr_is_owned(blinded); + CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_conv); + blinded_conv = BlindedForward_clone(&blinded_conv); + LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); + *ret_copy = PendingHTLCRouting_forward(onion_packet_conv, short_channel_id, blinded_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_PendingHTLCRouting_receive(int64_t payment_data, int64_t payment_metadata, int64_t payment_context, int32_t incoming_cltv_expiry, int8_tArray phantom_shared_secret, int64_tArray custom_tlvs, jboolean requires_blinded_error) { + LDKFinalOnionHopData payment_data_conv; + payment_data_conv.inner = untag_ptr(payment_data); + payment_data_conv.is_owned = ptr_is_owned(payment_data); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_data_conv); + payment_data_conv = FinalOnionHopData_clone(&payment_data_conv); + void* payment_metadata_ptr = untag_ptr(payment_metadata); + CHECK_ACCESS(payment_metadata_ptr); + LDKCOption_CVec_u8ZZ payment_metadata_conv = *(LDKCOption_CVec_u8ZZ*)(payment_metadata_ptr); + payment_metadata_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(payment_metadata)); + void* payment_context_ptr = untag_ptr(payment_context); + CHECK_ACCESS(payment_context_ptr); + LDKCOption_PaymentContextZ payment_context_conv = *(LDKCOption_PaymentContextZ*)(payment_context_ptr); + payment_context_conv = COption_PaymentContextZ_clone((LDKCOption_PaymentContextZ*)untag_ptr(payment_context)); + LDKThirtyTwoBytes phantom_shared_secret_ref; + CHECK(phantom_shared_secret->arr_len == 32); + memcpy(phantom_shared_secret_ref.data, phantom_shared_secret->elems, 32); FREE(phantom_shared_secret); + LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs_constr; + custom_tlvs_constr.datalen = custom_tlvs->arr_len; + if (custom_tlvs_constr.datalen > 0) + custom_tlvs_constr.data = MALLOC(custom_tlvs_constr.datalen * sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKCVec_C2Tuple_u64CVec_u8ZZZ Elements"); + else + custom_tlvs_constr.data = NULL; + 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); + LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); + *ret_copy = PendingHTLCRouting_receive(payment_data_conv, payment_metadata_conv, payment_context_conv, incoming_cltv_expiry, phantom_shared_secret_ref, custom_tlvs_constr, requires_blinded_error); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_PendingHTLCRouting_receive_keysend(int64_t payment_data, int8_tArray payment_preimage, int64_t payment_metadata, int32_t incoming_cltv_expiry, int64_tArray custom_tlvs, jboolean requires_blinded_error) { + LDKFinalOnionHopData payment_data_conv; + payment_data_conv.inner = untag_ptr(payment_data); + payment_data_conv.is_owned = ptr_is_owned(payment_data); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_data_conv); + payment_data_conv = FinalOnionHopData_clone(&payment_data_conv); + LDKThirtyTwoBytes payment_preimage_ref; + CHECK(payment_preimage->arr_len == 32); + memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); + void* payment_metadata_ptr = untag_ptr(payment_metadata); + CHECK_ACCESS(payment_metadata_ptr); + LDKCOption_CVec_u8ZZ payment_metadata_conv = *(LDKCOption_CVec_u8ZZ*)(payment_metadata_ptr); + payment_metadata_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(payment_metadata)); + LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs_constr; + custom_tlvs_constr.datalen = custom_tlvs->arr_len; + if (custom_tlvs_constr.datalen > 0) + custom_tlvs_constr.data = MALLOC(custom_tlvs_constr.datalen * sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKCVec_C2Tuple_u64CVec_u8ZZZ Elements"); + else + custom_tlvs_constr.data = NULL; + 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); + LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); + *ret_copy = PendingHTLCRouting_receive_keysend(payment_data_conv, payment_preimage_ref, payment_metadata_conv, incoming_cltv_expiry, custom_tlvs_constr, requires_blinded_error); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_BlindedForward_free(int64_t this_obj) { + LDKBlindedForward this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + BlindedForward_free(this_obj_conv); +} + +int8_tArray CS_LDK_BlindedForward_get_inbound_blinding_point(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_inbound_blinding_point(&this_ptr_conv).compressed_form, 33); + return ret_arr; +} + +void CS_LDK_BlindedForward_set_inbound_blinding_point(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_inbound_blinding_point(&this_ptr_conv, val_ref); +} + +int32_t CS_LDK_BlindedForward_get_failure(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; + int32_t ret_conv = LDKBlindedFailure_to_cs(BlindedForward_get_failure(&this_ptr_conv)); + return ret_conv; +} + +void CS_LDK_BlindedForward_set_failure(int64_t this_ptr, int32_t val) { + LDKBlindedForward this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBlindedFailure val_conv = LDKBlindedFailure_from_cs(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) { + 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); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t BlindedForward_clone_ptr(LDKBlindedForward *NONNULL_PTR arg) { + LDKBlindedForward ret_var = BlindedForward_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_BlindedForward_clone_ptr(int64_t arg) { + LDKBlindedForward arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = BlindedForward_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_BlindedForward_clone(int64_t orig) { + LDKBlindedForward orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKBlindedForward ret_var = BlindedForward_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int64_t CS_LDK_BlindedForward_hash(int64_t o) { + LDKBlindedForward o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = BlindedForward_hash(&o_conv); + return ret_conv; +} + +jboolean CS_LDK_BlindedForward_eq(int64_t a, int64_t b) { + LDKBlindedForward a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); @@ -40555,1632 +41132,2908 @@ jboolean CS_LDK_BlindedForward_eq(int64_t a, int64_t b) { return ret_conv; } -void CS_LDK_PendingHTLCInfo_free(int64_t this_obj) { - LDKPendingHTLCInfo this_obj_conv; +void CS_LDK_PendingHTLCInfo_free(int64_t this_obj) { + LDKPendingHTLCInfo this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + PendingHTLCInfo_free(this_obj_conv); +} + +int64_t CS_LDK_PendingHTLCInfo_get_routing(int64_t this_ptr) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); + *ret_copy = PendingHTLCInfo_get_routing(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_PendingHTLCInfo_set_routing(int64_t this_ptr, int64_t val) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKPendingHTLCRouting val_conv = *(LDKPendingHTLCRouting*)(val_ptr); + val_conv = PendingHTLCRouting_clone((LDKPendingHTLCRouting*)untag_ptr(val)); + PendingHTLCInfo_set_routing(&this_ptr_conv, val_conv); +} + +int8_tArray CS_LDK_PendingHTLCInfo_get_incoming_shared_secret(int64_t this_ptr) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *PendingHTLCInfo_get_incoming_shared_secret(&this_ptr_conv), 32); + return ret_arr; +} + +void CS_LDK_PendingHTLCInfo_set_incoming_shared_secret(int64_t this_ptr, int8_tArray val) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + PendingHTLCInfo_set_incoming_shared_secret(&this_ptr_conv, val_ref); +} + +int8_tArray CS_LDK_PendingHTLCInfo_get_payment_hash(int64_t this_ptr) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *PendingHTLCInfo_get_payment_hash(&this_ptr_conv), 32); + return ret_arr; +} + +void CS_LDK_PendingHTLCInfo_set_payment_hash(int64_t this_ptr, int8_tArray val) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + PendingHTLCInfo_set_payment_hash(&this_ptr_conv, val_ref); +} + +int64_t CS_LDK_PendingHTLCInfo_get_incoming_amt_msat(int64_t this_ptr) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = PendingHTLCInfo_get_incoming_amt_msat(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_PendingHTLCInfo_set_incoming_amt_msat(int64_t this_ptr, int64_t val) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + PendingHTLCInfo_set_incoming_amt_msat(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_PendingHTLCInfo_get_outgoing_amt_msat(int64_t this_ptr) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = PendingHTLCInfo_get_outgoing_amt_msat(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_PendingHTLCInfo_set_outgoing_amt_msat(int64_t this_ptr, int64_t val) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + PendingHTLCInfo_set_outgoing_amt_msat(&this_ptr_conv, val); +} + +int32_t CS_LDK_PendingHTLCInfo_get_outgoing_cltv_value(int64_t this_ptr) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = PendingHTLCInfo_get_outgoing_cltv_value(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_PendingHTLCInfo_set_outgoing_cltv_value(int64_t this_ptr, int32_t val) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + PendingHTLCInfo_set_outgoing_cltv_value(&this_ptr_conv, val); +} + +int64_t CS_LDK_PendingHTLCInfo_get_skimmed_fee_msat(int64_t this_ptr) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = PendingHTLCInfo_get_skimmed_fee_msat(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_PendingHTLCInfo_set_skimmed_fee_msat(int64_t this_ptr, int64_t val) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + PendingHTLCInfo_set_skimmed_fee_msat(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_PendingHTLCInfo_new(int64_t routing_arg, int8_tArray incoming_shared_secret_arg, int8_tArray payment_hash_arg, int64_t incoming_amt_msat_arg, int64_t outgoing_amt_msat_arg, int32_t outgoing_cltv_value_arg, int64_t skimmed_fee_msat_arg) { + void* routing_arg_ptr = untag_ptr(routing_arg); + CHECK_ACCESS(routing_arg_ptr); + LDKPendingHTLCRouting routing_arg_conv = *(LDKPendingHTLCRouting*)(routing_arg_ptr); + routing_arg_conv = PendingHTLCRouting_clone((LDKPendingHTLCRouting*)untag_ptr(routing_arg)); + LDKThirtyTwoBytes incoming_shared_secret_arg_ref; + CHECK(incoming_shared_secret_arg->arr_len == 32); + memcpy(incoming_shared_secret_arg_ref.data, incoming_shared_secret_arg->elems, 32); FREE(incoming_shared_secret_arg); + LDKThirtyTwoBytes payment_hash_arg_ref; + CHECK(payment_hash_arg->arr_len == 32); + memcpy(payment_hash_arg_ref.data, payment_hash_arg->elems, 32); FREE(payment_hash_arg); + void* incoming_amt_msat_arg_ptr = untag_ptr(incoming_amt_msat_arg); + CHECK_ACCESS(incoming_amt_msat_arg_ptr); + LDKCOption_u64Z incoming_amt_msat_arg_conv = *(LDKCOption_u64Z*)(incoming_amt_msat_arg_ptr); + incoming_amt_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(incoming_amt_msat_arg)); + void* skimmed_fee_msat_arg_ptr = untag_ptr(skimmed_fee_msat_arg); + CHECK_ACCESS(skimmed_fee_msat_arg_ptr); + LDKCOption_u64Z skimmed_fee_msat_arg_conv = *(LDKCOption_u64Z*)(skimmed_fee_msat_arg_ptr); + skimmed_fee_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(skimmed_fee_msat_arg)); + LDKPendingHTLCInfo ret_var = PendingHTLCInfo_new(routing_arg_conv, incoming_shared_secret_arg_ref, payment_hash_arg_ref, incoming_amt_msat_arg_conv, outgoing_amt_msat_arg, outgoing_cltv_value_arg, skimmed_fee_msat_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t PendingHTLCInfo_clone_ptr(LDKPendingHTLCInfo *NONNULL_PTR arg) { + LDKPendingHTLCInfo ret_var = PendingHTLCInfo_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_PendingHTLCInfo_clone_ptr(int64_t arg) { + LDKPendingHTLCInfo arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = PendingHTLCInfo_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_PendingHTLCInfo_clone(int64_t orig) { + LDKPendingHTLCInfo orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKPendingHTLCInfo ret_var = PendingHTLCInfo_clone(&orig_conv); + int64_t ret_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_BlindedFailure_clone(int64_t orig) { + LDKBlindedFailure* orig_conv = (LDKBlindedFailure*)untag_ptr(orig); + int32_t ret_conv = LDKBlindedFailure_to_cs(BlindedFailure_clone(orig_conv)); + return ret_conv; +} + +int32_t CS_LDK_BlindedFailure_from_introduction_node() { + int32_t ret_conv = LDKBlindedFailure_to_cs(BlindedFailure_from_introduction_node()); + return ret_conv; +} + +int32_t CS_LDK_BlindedFailure_from_blinded_node() { + int32_t ret_conv = LDKBlindedFailure_to_cs(BlindedFailure_from_blinded_node()); + return ret_conv; +} + +int64_t CS_LDK_BlindedFailure_hash(int64_t o) { + LDKBlindedFailure* o_conv = (LDKBlindedFailure*)untag_ptr(o); + int64_t ret_conv = BlindedFailure_hash(o_conv); + return ret_conv; +} + +jboolean CS_LDK_BlindedFailure_eq(int64_t a, int64_t b) { + LDKBlindedFailure* a_conv = (LDKBlindedFailure*)untag_ptr(a); + LDKBlindedFailure* b_conv = (LDKBlindedFailure*)untag_ptr(b); + jboolean ret_conv = BlindedFailure_eq(a_conv, b_conv); + return ret_conv; +} + +void CS_LDK_FailureCode_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); + LDKFailureCode this_ptr_conv = *(LDKFailureCode*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + FailureCode_free(this_ptr_conv); +} + +static inline uint64_t FailureCode_clone_ptr(LDKFailureCode *NONNULL_PTR arg) { + LDKFailureCode *ret_copy = MALLOC(sizeof(LDKFailureCode), "LDKFailureCode"); + *ret_copy = FailureCode_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_FailureCode_clone_ptr(int64_t arg) { + LDKFailureCode* arg_conv = (LDKFailureCode*)untag_ptr(arg); + int64_t ret_conv = FailureCode_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_FailureCode_clone(int64_t orig) { + LDKFailureCode* orig_conv = (LDKFailureCode*)untag_ptr(orig); + LDKFailureCode *ret_copy = MALLOC(sizeof(LDKFailureCode), "LDKFailureCode"); + *ret_copy = FailureCode_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_FailureCode_temporary_node_failure() { + LDKFailureCode *ret_copy = MALLOC(sizeof(LDKFailureCode), "LDKFailureCode"); + *ret_copy = FailureCode_temporary_node_failure(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_FailureCode_required_node_feature_missing() { + LDKFailureCode *ret_copy = MALLOC(sizeof(LDKFailureCode), "LDKFailureCode"); + *ret_copy = FailureCode_required_node_feature_missing(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_FailureCode_incorrect_or_unknown_payment_details() { + LDKFailureCode *ret_copy = MALLOC(sizeof(LDKFailureCode), "LDKFailureCode"); + *ret_copy = FailureCode_incorrect_or_unknown_payment_details(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_FailureCode_invalid_onion_payload(int64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKCOption_C2Tuple_u64u16ZZ a_conv = *(LDKCOption_C2Tuple_u64u16ZZ*)(a_ptr); + a_conv = COption_C2Tuple_u64u16ZZ_clone((LDKCOption_C2Tuple_u64u16ZZ*)untag_ptr(a)); + LDKFailureCode *ret_copy = MALLOC(sizeof(LDKFailureCode), "LDKFailureCode"); + *ret_copy = FailureCode_invalid_onion_payload(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_ChannelManager_free(int64_t this_obj) { + LDKChannelManager this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PendingHTLCInfo_free(this_obj_conv); + ChannelManager_free(this_obj_conv); } -int64_t CS_LDK_PendingHTLCInfo_get_routing(int64_t this_ptr) { - LDKPendingHTLCInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); - *ret_copy = PendingHTLCInfo_get_routing(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_ChainParameters_free(int64_t this_obj) { + LDKChainParameters this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChainParameters_free(this_obj_conv); } -void CS_LDK_PendingHTLCInfo_set_routing(int64_t this_ptr, int64_t val) { - LDKPendingHTLCInfo this_ptr_conv; +int32_t CS_LDK_ChainParameters_get_network(int64_t this_ptr) { + LDKChainParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKPendingHTLCRouting val_conv = *(LDKPendingHTLCRouting*)(val_ptr); - val_conv = PendingHTLCRouting_clone((LDKPendingHTLCRouting*)untag_ptr(val)); - PendingHTLCInfo_set_routing(&this_ptr_conv, val_conv); + int32_t ret_conv = LDKNetwork_to_cs(ChainParameters_get_network(&this_ptr_conv)); + return ret_conv; } -int8_tArray CS_LDK_PendingHTLCInfo_get_incoming_shared_secret(int64_t this_ptr) { - LDKPendingHTLCInfo this_ptr_conv; +void CS_LDK_ChainParameters_set_network(int64_t this_ptr, int32_t val) { + LDKChainParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *PendingHTLCInfo_get_incoming_shared_secret(&this_ptr_conv), 32); - return ret_arr; + LDKNetwork val_conv = LDKNetwork_from_cs(val); + ChainParameters_set_network(&this_ptr_conv, val_conv); } -void CS_LDK_PendingHTLCInfo_set_incoming_shared_secret(int64_t this_ptr, int8_tArray val) { - LDKPendingHTLCInfo this_ptr_conv; +int64_t CS_LDK_ChainParameters_get_best_block(int64_t this_ptr) { + LDKChainParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - PendingHTLCInfo_set_incoming_shared_secret(&this_ptr_conv, val_ref); + LDKBestBlock ret_var = ChainParameters_get_best_block(&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_PendingHTLCInfo_get_payment_hash(int64_t this_ptr) { - LDKPendingHTLCInfo this_ptr_conv; +void CS_LDK_ChainParameters_set_best_block(int64_t this_ptr, int64_t val) { + LDKChainParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *PendingHTLCInfo_get_payment_hash(&this_ptr_conv), 32); - return ret_arr; + LDKBestBlock val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = BestBlock_clone(&val_conv); + ChainParameters_set_best_block(&this_ptr_conv, val_conv); } -void CS_LDK_PendingHTLCInfo_set_payment_hash(int64_t this_ptr, int8_tArray val) { - LDKPendingHTLCInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - PendingHTLCInfo_set_payment_hash(&this_ptr_conv, val_ref); +int64_t CS_LDK_ChainParameters_new(int32_t network_arg, int64_t best_block_arg) { + LDKNetwork network_arg_conv = LDKNetwork_from_cs(network_arg); + LDKBestBlock best_block_arg_conv; + best_block_arg_conv.inner = untag_ptr(best_block_arg); + best_block_arg_conv.is_owned = ptr_is_owned(best_block_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(best_block_arg_conv); + best_block_arg_conv = BestBlock_clone(&best_block_arg_conv); + LDKChainParameters ret_var = ChainParameters_new(network_arg_conv, best_block_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -int64_t CS_LDK_PendingHTLCInfo_get_incoming_amt_msat(int64_t this_ptr) { - LDKPendingHTLCInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = PendingHTLCInfo_get_incoming_amt_msat(&this_ptr_conv); +static inline uint64_t ChainParameters_clone_ptr(LDKChainParameters *NONNULL_PTR arg) { + LDKChainParameters ret_var = ChainParameters_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_ChainParameters_clone_ptr(int64_t arg) { + LDKChainParameters arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = ChainParameters_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_ChainParameters_clone(int64_t orig) { + LDKChainParameters orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKChainParameters ret_var = ChainParameters_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +void CS_LDK_RecentPaymentDetails_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); + LDKRecentPaymentDetails this_ptr_conv = *(LDKRecentPaymentDetails*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + RecentPaymentDetails_free(this_ptr_conv); +} + +static inline uint64_t RecentPaymentDetails_clone_ptr(LDKRecentPaymentDetails *NONNULL_PTR arg) { + LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); + *ret_copy = RecentPaymentDetails_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } +int64_t CS_LDK_RecentPaymentDetails_clone_ptr(int64_t arg) { + LDKRecentPaymentDetails* arg_conv = (LDKRecentPaymentDetails*)untag_ptr(arg); + int64_t ret_conv = RecentPaymentDetails_clone_ptr(arg_conv); + return ret_conv; +} -void CS_LDK_PendingHTLCInfo_set_incoming_amt_msat(int64_t this_ptr, int64_t val) { - LDKPendingHTLCInfo this_ptr_conv; +int64_t CS_LDK_RecentPaymentDetails_clone(int64_t orig) { + LDKRecentPaymentDetails* orig_conv = (LDKRecentPaymentDetails*)untag_ptr(orig); + LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); + *ret_copy = RecentPaymentDetails_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_RecentPaymentDetails_awaiting_invoice(int8_tArray payment_id) { + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); + *ret_copy = RecentPaymentDetails_awaiting_invoice(payment_id_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_RecentPaymentDetails_pending(int8_tArray payment_id, int8_tArray payment_hash, int64_t total_msat) { + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); + *ret_copy = RecentPaymentDetails_pending(payment_id_ref, payment_hash_ref, total_msat); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_RecentPaymentDetails_fulfilled(int8_tArray payment_id, int64_t payment_hash) { + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + void* payment_hash_ptr = untag_ptr(payment_hash); + CHECK_ACCESS(payment_hash_ptr); + LDKCOption_ThirtyTwoBytesZ payment_hash_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_ptr); + payment_hash_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash)); + LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); + *ret_copy = RecentPaymentDetails_fulfilled(payment_id_ref, payment_hash_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_RecentPaymentDetails_abandoned(int8_tArray payment_id, int8_tArray payment_hash) { + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); + *ret_copy = RecentPaymentDetails_abandoned(payment_id_ref, payment_hash_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_PhantomRouteHints_free(int64_t this_obj) { + LDKPhantomRouteHints this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + PhantomRouteHints_free(this_obj_conv); +} + +int64_tArray CS_LDK_PhantomRouteHints_get_channels(int64_t this_ptr) { + LDKPhantomRouteHints this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - PendingHTLCInfo_set_incoming_amt_msat(&this_ptr_conv, val_conv); + LDKCVec_ChannelDetailsZ ret_var = PhantomRouteHints_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 q = 0; q < ret_var.datalen; q++) { + LDKChannelDetails ret_conv_16_var = ret_var.data[q]; + int64_t ret_conv_16_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); + ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned); + ret_arr_ptr[q] = ret_conv_16_ref; + } + + FREE(ret_var.data); + return ret_arr; } -int64_t CS_LDK_PendingHTLCInfo_get_outgoing_amt_msat(int64_t this_ptr) { - LDKPendingHTLCInfo this_ptr_conv; +void CS_LDK_PhantomRouteHints_set_channels(int64_t this_ptr, int64_tArray val) { + LDKPhantomRouteHints this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = PendingHTLCInfo_get_outgoing_amt_msat(&this_ptr_conv); - return ret_conv; + LDKCVec_ChannelDetailsZ val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = val->elems; + for (size_t q = 0; q < val_constr.datalen; q++) { + int64_t val_conv_16 = val_vals[q]; + LDKChannelDetails val_conv_16_conv; + val_conv_16_conv.inner = untag_ptr(val_conv_16); + val_conv_16_conv.is_owned = ptr_is_owned(val_conv_16); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv); + val_conv_16_conv = ChannelDetails_clone(&val_conv_16_conv); + val_constr.data[q] = val_conv_16_conv; + } + FREE(val); + PhantomRouteHints_set_channels(&this_ptr_conv, val_constr); } -void CS_LDK_PendingHTLCInfo_set_outgoing_amt_msat(int64_t this_ptr, int64_t val) { - LDKPendingHTLCInfo this_ptr_conv; +int64_t CS_LDK_PhantomRouteHints_get_phantom_scid(int64_t this_ptr) { + LDKPhantomRouteHints this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - PendingHTLCInfo_set_outgoing_amt_msat(&this_ptr_conv, val); + int64_t ret_conv = PhantomRouteHints_get_phantom_scid(&this_ptr_conv); + return ret_conv; } -int32_t CS_LDK_PendingHTLCInfo_get_outgoing_cltv_value(int64_t this_ptr) { - LDKPendingHTLCInfo this_ptr_conv; +void CS_LDK_PhantomRouteHints_set_phantom_scid(int64_t this_ptr, int64_t val) { + LDKPhantomRouteHints this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int32_t ret_conv = PendingHTLCInfo_get_outgoing_cltv_value(&this_ptr_conv); - return ret_conv; + PhantomRouteHints_set_phantom_scid(&this_ptr_conv, val); } -void CS_LDK_PendingHTLCInfo_set_outgoing_cltv_value(int64_t this_ptr, int32_t val) { - LDKPendingHTLCInfo this_ptr_conv; +int8_tArray CS_LDK_PhantomRouteHints_get_real_node_pubkey(int64_t this_ptr) { + LDKPhantomRouteHints this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - PendingHTLCInfo_set_outgoing_cltv_value(&this_ptr_conv, val); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, PhantomRouteHints_get_real_node_pubkey(&this_ptr_conv).compressed_form, 33); + return ret_arr; } -int64_t CS_LDK_PendingHTLCInfo_get_skimmed_fee_msat(int64_t this_ptr) { - LDKPendingHTLCInfo this_ptr_conv; +void CS_LDK_PhantomRouteHints_set_real_node_pubkey(int64_t this_ptr, int8_tArray val) { + LDKPhantomRouteHints this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = PendingHTLCInfo_get_skimmed_fee_msat(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + PhantomRouteHints_set_real_node_pubkey(&this_ptr_conv, val_ref); +} + +int64_t CS_LDK_PhantomRouteHints_new(int64_tArray channels_arg, int64_t phantom_scid_arg, int8_tArray real_node_pubkey_arg) { + LDKCVec_ChannelDetailsZ channels_arg_constr; + channels_arg_constr.datalen = channels_arg->arr_len; + if (channels_arg_constr.datalen > 0) + channels_arg_constr.data = MALLOC(channels_arg_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); + else + channels_arg_constr.data = NULL; + int64_t* channels_arg_vals = channels_arg->elems; + for (size_t q = 0; q < channels_arg_constr.datalen; q++) { + int64_t channels_arg_conv_16 = channels_arg_vals[q]; + LDKChannelDetails channels_arg_conv_16_conv; + channels_arg_conv_16_conv.inner = untag_ptr(channels_arg_conv_16); + channels_arg_conv_16_conv.is_owned = ptr_is_owned(channels_arg_conv_16); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channels_arg_conv_16_conv); + channels_arg_conv_16_conv = ChannelDetails_clone(&channels_arg_conv_16_conv); + channels_arg_constr.data[q] = channels_arg_conv_16_conv; + } + FREE(channels_arg); + LDKPublicKey real_node_pubkey_arg_ref; + CHECK(real_node_pubkey_arg->arr_len == 33); + memcpy(real_node_pubkey_arg_ref.compressed_form, real_node_pubkey_arg->elems, 33); FREE(real_node_pubkey_arg); + LDKPhantomRouteHints ret_var = PhantomRouteHints_new(channels_arg_constr, phantom_scid_arg, real_node_pubkey_arg_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t PhantomRouteHints_clone_ptr(LDKPhantomRouteHints *NONNULL_PTR arg) { + LDKPhantomRouteHints ret_var = PhantomRouteHints_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_PhantomRouteHints_clone_ptr(int64_t arg) { + LDKPhantomRouteHints arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = PhantomRouteHints_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_PhantomRouteHints_clone(int64_t orig) { + LDKPhantomRouteHints orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKPhantomRouteHints ret_var = PhantomRouteHints_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int64_t CS_LDK_ChannelManager_new(int64_t fee_est, int64_t chain_monitor, int64_t tx_broadcaster, int64_t router, int64_t logger, int64_t entropy_source, int64_t node_signer, int64_t signer_provider, int64_t config, int64_t params, int32_t current_timestamp) { + void* fee_est_ptr = untag_ptr(fee_est); + CHECK_ACCESS(fee_est_ptr); + LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)(fee_est_ptr); + if (fee_est_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_est_conv); + } + void* chain_monitor_ptr = untag_ptr(chain_monitor); + CHECK_ACCESS(chain_monitor_ptr); + LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr); + if (chain_monitor_conv.free == LDKWatch_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKWatch_JCalls_cloned(&chain_monitor_conv); + } + void* tx_broadcaster_ptr = untag_ptr(tx_broadcaster); + CHECK_ACCESS(tx_broadcaster_ptr); + LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr); + if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv); + } + void* router_ptr = untag_ptr(router); + CHECK_ACCESS(router_ptr); + LDKRouter router_conv = *(LDKRouter*)(router_ptr); + if (router_conv.free == LDKRouter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKRouter_JCalls_cloned(&router_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* signer_provider_ptr = untag_ptr(signer_provider); + CHECK_ACCESS(signer_provider_ptr); + LDKSignerProvider signer_provider_conv = *(LDKSignerProvider*)(signer_provider_ptr); + if (signer_provider_conv.free == LDKSignerProvider_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKSignerProvider_JCalls_cloned(&signer_provider_conv); + } + LDKUserConfig config_conv; + config_conv.inner = untag_ptr(config); + config_conv.is_owned = ptr_is_owned(config); + CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv); + config_conv = UserConfig_clone(&config_conv); + LDKChainParameters params_conv; + params_conv.inner = untag_ptr(params); + params_conv.is_owned = ptr_is_owned(params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); + params_conv = ChainParameters_clone(¶ms_conv); + LDKChannelManager ret_var = ChannelManager_new(fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, router_conv, logger_conv, entropy_source_conv, node_signer_conv, signer_provider_conv, config_conv, params_conv, current_timestamp); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int64_t CS_LDK_ChannelManager_get_current_default_configuration(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; + LDKUserConfig ret_var = ChannelManager_get_current_default_configuration(&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_PendingHTLCInfo_set_skimmed_fee_msat(int64_t this_ptr, int64_t val) { - LDKPendingHTLCInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - PendingHTLCInfo_set_skimmed_fee_msat(&this_ptr_conv, val_conv); +int64_t CS_LDK_ChannelManager_create_channel(int64_t this_arg, int8_tArray their_network_key, int64_t channel_value_satoshis, int64_t push_msat, int8_tArray user_channel_id, int64_t temporary_channel_id, int64_t override_config) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKPublicKey their_network_key_ref; + CHECK(their_network_key->arr_len == 33); + memcpy(their_network_key_ref.compressed_form, their_network_key->elems, 33); FREE(their_network_key); + LDKU128 user_channel_id_ref; + CHECK(user_channel_id->arr_len == 16); + memcpy(user_channel_id_ref.le_bytes, user_channel_id->elems, 16); FREE(user_channel_id); + LDKChannelId temporary_channel_id_conv; + temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); + temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); + temporary_channel_id_conv = ChannelId_clone(&temporary_channel_id_conv); + LDKUserConfig override_config_conv; + override_config_conv.inner = untag_ptr(override_config); + override_config_conv.is_owned = ptr_is_owned(override_config); + CHECK_INNER_FIELD_ACCESS_OR_NULL(override_config_conv); + override_config_conv = UserConfig_clone(&override_config_conv); + LDKCResult_ChannelIdAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdAPIErrorZ), "LDKCResult_ChannelIdAPIErrorZ"); + *ret_conv = ChannelManager_create_channel(&this_arg_conv, their_network_key_ref, channel_value_satoshis, push_msat, user_channel_id_ref, temporary_channel_id_conv, override_config_conv); + return tag_ptr(ret_conv, true); +} + +int64_tArray CS_LDK_ChannelManager_list_channels(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; + LDKCVec_ChannelDetailsZ ret_var = ChannelManager_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 q = 0; q < ret_var.datalen; q++) { + LDKChannelDetails ret_conv_16_var = ret_var.data[q]; + int64_t ret_conv_16_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); + ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned); + ret_arr_ptr[q] = ret_conv_16_ref; + } + + FREE(ret_var.data); + return ret_arr; +} + +int64_tArray CS_LDK_ChannelManager_list_usable_channels(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; + LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_usable_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 q = 0; q < ret_var.datalen; q++) { + LDKChannelDetails ret_conv_16_var = ret_var.data[q]; + int64_t ret_conv_16_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); + ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned); + ret_arr_ptr[q] = ret_conv_16_ref; + } + + FREE(ret_var.data); + return ret_arr; } -int64_t CS_LDK_PendingHTLCInfo_new(int64_t routing_arg, int8_tArray incoming_shared_secret_arg, int8_tArray payment_hash_arg, int64_t incoming_amt_msat_arg, int64_t outgoing_amt_msat_arg, int32_t outgoing_cltv_value_arg, int64_t skimmed_fee_msat_arg) { - void* routing_arg_ptr = untag_ptr(routing_arg); - CHECK_ACCESS(routing_arg_ptr); - LDKPendingHTLCRouting routing_arg_conv = *(LDKPendingHTLCRouting*)(routing_arg_ptr); - routing_arg_conv = PendingHTLCRouting_clone((LDKPendingHTLCRouting*)untag_ptr(routing_arg)); - LDKThirtyTwoBytes incoming_shared_secret_arg_ref; - CHECK(incoming_shared_secret_arg->arr_len == 32); - memcpy(incoming_shared_secret_arg_ref.data, incoming_shared_secret_arg->elems, 32); FREE(incoming_shared_secret_arg); - LDKThirtyTwoBytes payment_hash_arg_ref; - CHECK(payment_hash_arg->arr_len == 32); - memcpy(payment_hash_arg_ref.data, payment_hash_arg->elems, 32); FREE(payment_hash_arg); - void* incoming_amt_msat_arg_ptr = untag_ptr(incoming_amt_msat_arg); - CHECK_ACCESS(incoming_amt_msat_arg_ptr); - LDKCOption_u64Z incoming_amt_msat_arg_conv = *(LDKCOption_u64Z*)(incoming_amt_msat_arg_ptr); - incoming_amt_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(incoming_amt_msat_arg)); - void* skimmed_fee_msat_arg_ptr = untag_ptr(skimmed_fee_msat_arg); - CHECK_ACCESS(skimmed_fee_msat_arg_ptr); - LDKCOption_u64Z skimmed_fee_msat_arg_conv = *(LDKCOption_u64Z*)(skimmed_fee_msat_arg_ptr); - skimmed_fee_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(skimmed_fee_msat_arg)); - LDKPendingHTLCInfo ret_var = PendingHTLCInfo_new(routing_arg_conv, incoming_shared_secret_arg_ref, payment_hash_arg_ref, incoming_amt_msat_arg_conv, outgoing_amt_msat_arg, outgoing_cltv_value_arg, skimmed_fee_msat_arg_conv); - int64_t ret_ref = 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_ChannelManager_list_channels_with_counterparty(int64_t this_arg, int8_tArray counterparty_node_id) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKPublicKey counterparty_node_id_ref; + CHECK(counterparty_node_id->arr_len == 33); + memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); + LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_channels_with_counterparty(&this_arg_conv, counterparty_node_id_ref); + 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 q = 0; q < ret_var.datalen; q++) { + LDKChannelDetails ret_conv_16_var = ret_var.data[q]; + int64_t ret_conv_16_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); + ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned); + ret_arr_ptr[q] = ret_conv_16_ref; + } + + FREE(ret_var.data); + return ret_arr; } -static inline uint64_t PendingHTLCInfo_clone_ptr(LDKPendingHTLCInfo *NONNULL_PTR arg) { - LDKPendingHTLCInfo ret_var = PendingHTLCInfo_clone(arg); - int64_t ret_ref = 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_ChannelManager_list_recent_payments(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; + LDKCVec_RecentPaymentDetailsZ ret_var = ChannelManager_list_recent_payments(&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 w = 0; w < ret_var.datalen; w++) { + LDKRecentPaymentDetails *ret_conv_22_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); + *ret_conv_22_copy = ret_var.data[w]; + int64_t ret_conv_22_ref = tag_ptr(ret_conv_22_copy, true); + ret_arr_ptr[w] = ret_conv_22_ref; + } + + FREE(ret_var.data); + return ret_arr; } -int64_t CS_LDK_PendingHTLCInfo_clone_ptr(int64_t arg) { - LDKPendingHTLCInfo arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = PendingHTLCInfo_clone_ptr(&arg_conv); - return ret_conv; + +int64_t CS_LDK_ChannelManager_close_channel(int64_t this_arg, int64_t channel_id, int8_tArray counterparty_node_id) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv.is_owned = false; + LDKPublicKey counterparty_node_id_ref; + CHECK(counterparty_node_id->arr_len == 33); + memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_close_channel(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_PendingHTLCInfo_clone(int64_t orig) { - LDKPendingHTLCInfo orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKPendingHTLCInfo ret_var = PendingHTLCInfo_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +int64_t CS_LDK_ChannelManager_close_channel_with_feerate_and_script(int64_t this_arg, int64_t channel_id, int8_tArray counterparty_node_id, int64_t target_feerate_sats_per_1000_weight, int64_t shutdown_script) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv.is_owned = false; + LDKPublicKey counterparty_node_id_ref; + CHECK(counterparty_node_id->arr_len == 33); + memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); + void* target_feerate_sats_per_1000_weight_ptr = untag_ptr(target_feerate_sats_per_1000_weight); + CHECK_ACCESS(target_feerate_sats_per_1000_weight_ptr); + LDKCOption_u32Z target_feerate_sats_per_1000_weight_conv = *(LDKCOption_u32Z*)(target_feerate_sats_per_1000_weight_ptr); + target_feerate_sats_per_1000_weight_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(target_feerate_sats_per_1000_weight)); + LDKShutdownScript shutdown_script_conv; + shutdown_script_conv.inner = untag_ptr(shutdown_script); + shutdown_script_conv.is_owned = ptr_is_owned(shutdown_script); + CHECK_INNER_FIELD_ACCESS_OR_NULL(shutdown_script_conv); + shutdown_script_conv = ShutdownScript_clone(&shutdown_script_conv); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_close_channel_with_feerate_and_script(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref, target_feerate_sats_per_1000_weight_conv, shutdown_script_conv); + return tag_ptr(ret_conv, true); } -int32_t CS_LDK_BlindedFailure_clone(int64_t orig) { - LDKBlindedFailure* orig_conv = (LDKBlindedFailure*)untag_ptr(orig); - int32_t ret_conv = LDKBlindedFailure_to_cs(BlindedFailure_clone(orig_conv)); - return ret_conv; +int64_t CS_LDK_ChannelManager_force_close_broadcasting_latest_txn(int64_t this_arg, int64_t channel_id, int8_tArray counterparty_node_id) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv.is_owned = false; + LDKPublicKey counterparty_node_id_ref; + CHECK(counterparty_node_id->arr_len == 33); + memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_force_close_broadcasting_latest_txn(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref); + return tag_ptr(ret_conv, true); } -int32_t CS_LDK_BlindedFailure_from_introduction_node() { - int32_t ret_conv = LDKBlindedFailure_to_cs(BlindedFailure_from_introduction_node()); - return ret_conv; +int64_t CS_LDK_ChannelManager_force_close_without_broadcasting_txn(int64_t this_arg, int64_t channel_id, int8_tArray counterparty_node_id) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv.is_owned = false; + LDKPublicKey counterparty_node_id_ref; + CHECK(counterparty_node_id->arr_len == 33); + memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_force_close_without_broadcasting_txn(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref); + return tag_ptr(ret_conv, true); } -int32_t CS_LDK_BlindedFailure_from_blinded_node() { - int32_t ret_conv = LDKBlindedFailure_to_cs(BlindedFailure_from_blinded_node()); - return ret_conv; +void CS_LDK_ChannelManager_force_close_all_channels_broadcasting_latest_txn(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; + ChannelManager_force_close_all_channels_broadcasting_latest_txn(&this_arg_conv); } -int64_t CS_LDK_BlindedFailure_hash(int64_t o) { - LDKBlindedFailure* o_conv = (LDKBlindedFailure*)untag_ptr(o); - int64_t ret_conv = BlindedFailure_hash(o_conv); - return ret_conv; +void CS_LDK_ChannelManager_force_close_all_channels_without_broadcasting_txn(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; + ChannelManager_force_close_all_channels_without_broadcasting_txn(&this_arg_conv); } -jboolean CS_LDK_BlindedFailure_eq(int64_t a, int64_t b) { - LDKBlindedFailure* a_conv = (LDKBlindedFailure*)untag_ptr(a); - LDKBlindedFailure* b_conv = (LDKBlindedFailure*)untag_ptr(b); - jboolean ret_conv = BlindedFailure_eq(a_conv, b_conv); - return ret_conv; +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) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKRoute route_conv; + route_conv.inner = untag_ptr(route); + route_conv.is_owned = ptr_is_owned(route); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); + route_conv.is_owned = false; + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKRecipientOnionFields recipient_onion_conv; + recipient_onion_conv.inner = untag_ptr(recipient_onion); + recipient_onion_conv.is_owned = ptr_is_owned(recipient_onion); + CHECK_INNER_FIELD_ACCESS_OR_NULL(recipient_onion_conv); + recipient_onion_conv = RecipientOnionFields_clone(&recipient_onion_conv); + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); + *ret_conv = ChannelManager_send_payment_with_route(&this_arg_conv, &route_conv, payment_hash_ref, recipient_onion_conv, payment_id_ref); + return tag_ptr(ret_conv, true); } -void CS_LDK_FailureCode_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); - LDKFailureCode this_ptr_conv = *(LDKFailureCode*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - FailureCode_free(this_ptr_conv); +int64_t CS_LDK_ChannelManager_send_payment(int64_t this_arg, int8_tArray payment_hash, int64_t recipient_onion, int8_tArray payment_id, int64_t route_params, int64_t retry_strategy) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKRecipientOnionFields recipient_onion_conv; + recipient_onion_conv.inner = untag_ptr(recipient_onion); + recipient_onion_conv.is_owned = ptr_is_owned(recipient_onion); + CHECK_INNER_FIELD_ACCESS_OR_NULL(recipient_onion_conv); + recipient_onion_conv = RecipientOnionFields_clone(&recipient_onion_conv); + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + LDKRouteParameters route_params_conv; + route_params_conv.inner = untag_ptr(route_params); + route_params_conv.is_owned = ptr_is_owned(route_params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); + route_params_conv = RouteParameters_clone(&route_params_conv); + void* retry_strategy_ptr = untag_ptr(retry_strategy); + CHECK_ACCESS(retry_strategy_ptr); + LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr); + retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy)); + LDKCResult_NoneRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneRetryableSendFailureZ), "LDKCResult_NoneRetryableSendFailureZ"); + *ret_conv = ChannelManager_send_payment(&this_arg_conv, payment_hash_ref, recipient_onion_conv, payment_id_ref, route_params_conv, retry_strategy_conv); + return tag_ptr(ret_conv, true); } -static inline uint64_t FailureCode_clone_ptr(LDKFailureCode *NONNULL_PTR arg) { - LDKFailureCode *ret_copy = MALLOC(sizeof(LDKFailureCode), "LDKFailureCode"); - *ret_copy = FailureCode_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void CS_LDK_ChannelManager_abandon_payment(int64_t this_arg, int8_tArray payment_id) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + ChannelManager_abandon_payment(&this_arg_conv, payment_id_ref); } -int64_t CS_LDK_FailureCode_clone_ptr(int64_t arg) { - LDKFailureCode* arg_conv = (LDKFailureCode*)untag_ptr(arg); - int64_t ret_conv = FailureCode_clone_ptr(arg_conv); - return ret_conv; + +int64_t CS_LDK_ChannelManager_send_spontaneous_payment(int64_t this_arg, int64_t route, int64_t payment_preimage, int64_t recipient_onion, int8_tArray payment_id) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKRoute route_conv; + route_conv.inner = untag_ptr(route); + route_conv.is_owned = ptr_is_owned(route); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); + route_conv.is_owned = false; + void* payment_preimage_ptr = untag_ptr(payment_preimage); + CHECK_ACCESS(payment_preimage_ptr); + LDKCOption_ThirtyTwoBytesZ payment_preimage_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_preimage_ptr); + payment_preimage_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_preimage)); + LDKRecipientOnionFields recipient_onion_conv; + recipient_onion_conv.inner = untag_ptr(recipient_onion); + recipient_onion_conv.is_owned = ptr_is_owned(recipient_onion); + CHECK_INNER_FIELD_ACCESS_OR_NULL(recipient_onion_conv); + recipient_onion_conv = RecipientOnionFields_clone(&recipient_onion_conv); + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + LDKCResult_ThirtyTwoBytesPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesPaymentSendFailureZ), "LDKCResult_ThirtyTwoBytesPaymentSendFailureZ"); + *ret_conv = ChannelManager_send_spontaneous_payment(&this_arg_conv, &route_conv, payment_preimage_conv, recipient_onion_conv, payment_id_ref); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_FailureCode_clone(int64_t orig) { - LDKFailureCode* orig_conv = (LDKFailureCode*)untag_ptr(orig); - LDKFailureCode *ret_copy = MALLOC(sizeof(LDKFailureCode), "LDKFailureCode"); - *ret_copy = FailureCode_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_ChannelManager_send_spontaneous_payment_with_retry(int64_t this_arg, int64_t payment_preimage, int64_t recipient_onion, int8_tArray payment_id, int64_t route_params, int64_t retry_strategy) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + void* payment_preimage_ptr = untag_ptr(payment_preimage); + CHECK_ACCESS(payment_preimage_ptr); + LDKCOption_ThirtyTwoBytesZ payment_preimage_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_preimage_ptr); + payment_preimage_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_preimage)); + LDKRecipientOnionFields recipient_onion_conv; + recipient_onion_conv.inner = untag_ptr(recipient_onion); + recipient_onion_conv.is_owned = ptr_is_owned(recipient_onion); + CHECK_INNER_FIELD_ACCESS_OR_NULL(recipient_onion_conv); + recipient_onion_conv = RecipientOnionFields_clone(&recipient_onion_conv); + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + LDKRouteParameters route_params_conv; + route_params_conv.inner = untag_ptr(route_params); + route_params_conv.is_owned = ptr_is_owned(route_params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); + route_params_conv = RouteParameters_clone(&route_params_conv); + void* retry_strategy_ptr = untag_ptr(retry_strategy); + CHECK_ACCESS(retry_strategy_ptr); + LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr); + retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy)); + LDKCResult_ThirtyTwoBytesRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesRetryableSendFailureZ), "LDKCResult_ThirtyTwoBytesRetryableSendFailureZ"); + *ret_conv = ChannelManager_send_spontaneous_payment_with_retry(&this_arg_conv, payment_preimage_conv, recipient_onion_conv, payment_id_ref, route_params_conv, retry_strategy_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_FailureCode_temporary_node_failure() { - LDKFailureCode *ret_copy = MALLOC(sizeof(LDKFailureCode), "LDKFailureCode"); - *ret_copy = FailureCode_temporary_node_failure(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_ChannelManager_send_probe(int64_t this_arg, int64_t path) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKPath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv = Path_clone(&path_conv); + LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ), "LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ"); + *ret_conv = ChannelManager_send_probe(&this_arg_conv, path_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_FailureCode_required_node_feature_missing() { - LDKFailureCode *ret_copy = MALLOC(sizeof(LDKFailureCode), "LDKFailureCode"); - *ret_copy = FailureCode_required_node_feature_missing(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_ChannelManager_send_spontaneous_preflight_probes(int64_t this_arg, int8_tArray node_id, int64_t amount_msat, int32_t final_cltv_expiry_delta, int64_t liquidity_limit_multiplier) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + void* liquidity_limit_multiplier_ptr = untag_ptr(liquidity_limit_multiplier); + CHECK_ACCESS(liquidity_limit_multiplier_ptr); + LDKCOption_u64Z liquidity_limit_multiplier_conv = *(LDKCOption_u64Z*)(liquidity_limit_multiplier_ptr); + liquidity_limit_multiplier_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(liquidity_limit_multiplier)); + LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ), "LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ"); + *ret_conv = ChannelManager_send_spontaneous_preflight_probes(&this_arg_conv, node_id_ref, amount_msat, final_cltv_expiry_delta, liquidity_limit_multiplier_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_FailureCode_incorrect_or_unknown_payment_details() { - LDKFailureCode *ret_copy = MALLOC(sizeof(LDKFailureCode), "LDKFailureCode"); - *ret_copy = FailureCode_incorrect_or_unknown_payment_details(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_ChannelManager_send_preflight_probes(int64_t this_arg, int64_t route_params, int64_t liquidity_limit_multiplier) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKRouteParameters route_params_conv; + route_params_conv.inner = untag_ptr(route_params); + route_params_conv.is_owned = ptr_is_owned(route_params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); + route_params_conv = RouteParameters_clone(&route_params_conv); + void* liquidity_limit_multiplier_ptr = untag_ptr(liquidity_limit_multiplier); + CHECK_ACCESS(liquidity_limit_multiplier_ptr); + LDKCOption_u64Z liquidity_limit_multiplier_conv = *(LDKCOption_u64Z*)(liquidity_limit_multiplier_ptr); + liquidity_limit_multiplier_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(liquidity_limit_multiplier)); + LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ), "LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ"); + *ret_conv = ChannelManager_send_preflight_probes(&this_arg_conv, route_params_conv, liquidity_limit_multiplier_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_FailureCode_invalid_onion_payload(int64_t a) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKCOption_C2Tuple_u64u16ZZ a_conv = *(LDKCOption_C2Tuple_u64u16ZZ*)(a_ptr); - a_conv = COption_C2Tuple_u64u16ZZ_clone((LDKCOption_C2Tuple_u64u16ZZ*)untag_ptr(a)); - LDKFailureCode *ret_copy = MALLOC(sizeof(LDKFailureCode), "LDKFailureCode"); - *ret_copy = FailureCode_invalid_onion_payload(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_ChannelManager_funding_transaction_generated(int64_t this_arg, int64_t temporary_channel_id, int8_tArray counterparty_node_id, int8_tArray funding_transaction) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelId temporary_channel_id_conv; + temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); + temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); + temporary_channel_id_conv.is_owned = false; + LDKPublicKey counterparty_node_id_ref; + CHECK(counterparty_node_id->arr_len == 33); + memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); + LDKTransaction funding_transaction_ref; + funding_transaction_ref.datalen = funding_transaction->arr_len; + funding_transaction_ref.data = MALLOC(funding_transaction_ref.datalen, "LDKTransaction Bytes"); + memcpy(funding_transaction_ref.data, funding_transaction->elems, funding_transaction_ref.datalen); FREE(funding_transaction); + funding_transaction_ref.data_is_owned = true; + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_funding_transaction_generated(&this_arg_conv, &temporary_channel_id_conv, counterparty_node_id_ref, funding_transaction_ref); + return tag_ptr(ret_conv, true); } -void CS_LDK_ChannelManager_free(int64_t this_obj) { - LDKChannelManager this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelManager_free(this_obj_conv); +int64_t CS_LDK_ChannelManager_batch_funding_transaction_generated(int64_t this_arg, int64_tArray temporary_channels, int8_tArray funding_transaction) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_C2Tuple_ChannelIdPublicKeyZZ temporary_channels_constr; + temporary_channels_constr.datalen = temporary_channels->arr_len; + if (temporary_channels_constr.datalen > 0) + temporary_channels_constr.data = MALLOC(temporary_channels_constr.datalen * sizeof(LDKC2Tuple_ChannelIdPublicKeyZ), "LDKCVec_C2Tuple_ChannelIdPublicKeyZZ Elements"); + else + temporary_channels_constr.data = NULL; + int64_t* temporary_channels_vals = temporary_channels->elems; + for (size_t e = 0; e < temporary_channels_constr.datalen; e++) { + int64_t temporary_channels_conv_30 = temporary_channels_vals[e]; + void* temporary_channels_conv_30_ptr = untag_ptr(temporary_channels_conv_30); + CHECK_ACCESS(temporary_channels_conv_30_ptr); + LDKC2Tuple_ChannelIdPublicKeyZ temporary_channels_conv_30_conv = *(LDKC2Tuple_ChannelIdPublicKeyZ*)(temporary_channels_conv_30_ptr); + temporary_channels_conv_30_conv = C2Tuple_ChannelIdPublicKeyZ_clone((LDKC2Tuple_ChannelIdPublicKeyZ*)untag_ptr(temporary_channels_conv_30)); + temporary_channels_constr.data[e] = temporary_channels_conv_30_conv; + } + FREE(temporary_channels); + LDKTransaction funding_transaction_ref; + funding_transaction_ref.datalen = funding_transaction->arr_len; + funding_transaction_ref.data = MALLOC(funding_transaction_ref.datalen, "LDKTransaction Bytes"); + memcpy(funding_transaction_ref.data, funding_transaction->elems, funding_transaction_ref.datalen); FREE(funding_transaction); + funding_transaction_ref.data_is_owned = true; + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_batch_funding_transaction_generated(&this_arg_conv, temporary_channels_constr, funding_transaction_ref); + return tag_ptr(ret_conv, true); } -void CS_LDK_ChainParameters_free(int64_t this_obj) { - LDKChainParameters this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChainParameters_free(this_obj_conv); +int64_t CS_LDK_ChannelManager_update_partial_channel_config(int64_t this_arg, int8_tArray counterparty_node_id, int64_tArray channel_ids, int64_t config_update) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKPublicKey counterparty_node_id_ref; + CHECK(counterparty_node_id->arr_len == 33); + memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); + LDKCVec_ChannelIdZ channel_ids_constr; + channel_ids_constr.datalen = channel_ids->arr_len; + if (channel_ids_constr.datalen > 0) + channel_ids_constr.data = MALLOC(channel_ids_constr.datalen * sizeof(LDKChannelId), "LDKCVec_ChannelIdZ Elements"); + else + channel_ids_constr.data = NULL; + int64_t* channel_ids_vals = channel_ids->elems; + for (size_t l = 0; l < channel_ids_constr.datalen; l++) { + int64_t channel_ids_conv_11 = channel_ids_vals[l]; + LDKChannelId channel_ids_conv_11_conv; + channel_ids_conv_11_conv.inner = untag_ptr(channel_ids_conv_11); + channel_ids_conv_11_conv.is_owned = ptr_is_owned(channel_ids_conv_11); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_ids_conv_11_conv); + channel_ids_conv_11_conv = ChannelId_clone(&channel_ids_conv_11_conv); + channel_ids_constr.data[l] = channel_ids_conv_11_conv; + } + FREE(channel_ids); + LDKChannelConfigUpdate config_update_conv; + config_update_conv.inner = untag_ptr(config_update); + config_update_conv.is_owned = ptr_is_owned(config_update); + CHECK_INNER_FIELD_ACCESS_OR_NULL(config_update_conv); + config_update_conv.is_owned = false; + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_update_partial_channel_config(&this_arg_conv, counterparty_node_id_ref, channel_ids_constr, &config_update_conv); + return tag_ptr(ret_conv, true); } -int32_t CS_LDK_ChainParameters_get_network(int64_t this_ptr) { - LDKChainParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int32_t ret_conv = LDKNetwork_to_cs(ChainParameters_get_network(&this_ptr_conv)); - return ret_conv; +int64_t CS_LDK_ChannelManager_update_channel_config(int64_t this_arg, int8_tArray counterparty_node_id, int64_tArray channel_ids, int64_t config) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKPublicKey counterparty_node_id_ref; + CHECK(counterparty_node_id->arr_len == 33); + memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); + LDKCVec_ChannelIdZ channel_ids_constr; + channel_ids_constr.datalen = channel_ids->arr_len; + if (channel_ids_constr.datalen > 0) + channel_ids_constr.data = MALLOC(channel_ids_constr.datalen * sizeof(LDKChannelId), "LDKCVec_ChannelIdZ Elements"); + else + channel_ids_constr.data = NULL; + int64_t* channel_ids_vals = channel_ids->elems; + for (size_t l = 0; l < channel_ids_constr.datalen; l++) { + int64_t channel_ids_conv_11 = channel_ids_vals[l]; + LDKChannelId channel_ids_conv_11_conv; + channel_ids_conv_11_conv.inner = untag_ptr(channel_ids_conv_11); + channel_ids_conv_11_conv.is_owned = ptr_is_owned(channel_ids_conv_11); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_ids_conv_11_conv); + channel_ids_conv_11_conv = ChannelId_clone(&channel_ids_conv_11_conv); + channel_ids_constr.data[l] = channel_ids_conv_11_conv; + } + FREE(channel_ids); + LDKChannelConfig config_conv; + config_conv.inner = untag_ptr(config); + config_conv.is_owned = ptr_is_owned(config); + CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv); + config_conv.is_owned = false; + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_update_channel_config(&this_arg_conv, counterparty_node_id_ref, channel_ids_constr, &config_conv); + return tag_ptr(ret_conv, true); } -void CS_LDK_ChainParameters_set_network(int64_t this_ptr, int32_t val) { - LDKChainParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKNetwork val_conv = LDKNetwork_from_cs(val); - ChainParameters_set_network(&this_ptr_conv, val_conv); +int64_t CS_LDK_ChannelManager_forward_intercepted_htlc(int64_t this_arg, int8_tArray intercept_id, int64_t next_hop_channel_id, int8_tArray next_node_id, int64_t amt_to_forward_msat) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKThirtyTwoBytes intercept_id_ref; + CHECK(intercept_id->arr_len == 32); + memcpy(intercept_id_ref.data, intercept_id->elems, 32); FREE(intercept_id); + LDKChannelId next_hop_channel_id_conv; + next_hop_channel_id_conv.inner = untag_ptr(next_hop_channel_id); + next_hop_channel_id_conv.is_owned = ptr_is_owned(next_hop_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(next_hop_channel_id_conv); + next_hop_channel_id_conv.is_owned = false; + LDKPublicKey next_node_id_ref; + CHECK(next_node_id->arr_len == 33); + memcpy(next_node_id_ref.compressed_form, next_node_id->elems, 33); FREE(next_node_id); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_forward_intercepted_htlc(&this_arg_conv, intercept_id_ref, &next_hop_channel_id_conv, next_node_id_ref, amt_to_forward_msat); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChainParameters_get_best_block(int64_t this_ptr) { - LDKChainParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKBestBlock ret_var = ChainParameters_get_best_block(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +int64_t CS_LDK_ChannelManager_fail_intercepted_htlc(int64_t this_arg, int8_tArray intercept_id) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKThirtyTwoBytes intercept_id_ref; + CHECK(intercept_id->arr_len == 32); + memcpy(intercept_id_ref.data, intercept_id->elems, 32); FREE(intercept_id); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_fail_intercepted_htlc(&this_arg_conv, intercept_id_ref); + return tag_ptr(ret_conv, true); } -void CS_LDK_ChainParameters_set_best_block(int64_t this_ptr, int64_t val) { - LDKChainParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKBestBlock val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = BestBlock_clone(&val_conv); - ChainParameters_set_best_block(&this_ptr_conv, val_conv); +void CS_LDK_ChannelManager_process_pending_htlc_forwards(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; + ChannelManager_process_pending_htlc_forwards(&this_arg_conv); } -int64_t CS_LDK_ChainParameters_new(int32_t network_arg, int64_t best_block_arg) { - LDKNetwork network_arg_conv = LDKNetwork_from_cs(network_arg); - LDKBestBlock best_block_arg_conv; - best_block_arg_conv.inner = untag_ptr(best_block_arg); - best_block_arg_conv.is_owned = ptr_is_owned(best_block_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(best_block_arg_conv); - best_block_arg_conv = BestBlock_clone(&best_block_arg_conv); - LDKChainParameters ret_var = ChainParameters_new(network_arg_conv, best_block_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +void CS_LDK_ChannelManager_timer_tick_occurred(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; + ChannelManager_timer_tick_occurred(&this_arg_conv); } -static inline uint64_t ChainParameters_clone_ptr(LDKChainParameters *NONNULL_PTR arg) { - LDKChainParameters ret_var = ChainParameters_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -int64_t CS_LDK_ChainParameters_clone_ptr(int64_t arg) { - LDKChainParameters arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = ChainParameters_clone_ptr(&arg_conv); - return ret_conv; +void CS_LDK_ChannelManager_fail_htlc_backwards(int64_t this_arg, int8_tArray payment_hash) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + uint8_t payment_hash_arr[32]; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_arr, payment_hash->elems, 32); FREE(payment_hash); + uint8_t (*payment_hash_ref)[32] = &payment_hash_arr; + ChannelManager_fail_htlc_backwards(&this_arg_conv, payment_hash_ref); } -int64_t CS_LDK_ChainParameters_clone(int64_t orig) { - LDKChainParameters orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKChainParameters ret_var = ChainParameters_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +void CS_LDK_ChannelManager_fail_htlc_backwards_with_reason(int64_t this_arg, int8_tArray payment_hash, int64_t failure_code) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + uint8_t payment_hash_arr[32]; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_arr, payment_hash->elems, 32); FREE(payment_hash); + uint8_t (*payment_hash_ref)[32] = &payment_hash_arr; + void* failure_code_ptr = untag_ptr(failure_code); + CHECK_ACCESS(failure_code_ptr); + LDKFailureCode failure_code_conv = *(LDKFailureCode*)(failure_code_ptr); + failure_code_conv = FailureCode_clone((LDKFailureCode*)untag_ptr(failure_code)); + ChannelManager_fail_htlc_backwards_with_reason(&this_arg_conv, payment_hash_ref, failure_code_conv); } -void CS_LDK_CounterpartyForwardingInfo_free(int64_t this_obj) { - LDKCounterpartyForwardingInfo this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - CounterpartyForwardingInfo_free(this_obj_conv); +void CS_LDK_ChannelManager_claim_funds(int64_t this_arg, int8_tArray payment_preimage) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKThirtyTwoBytes payment_preimage_ref; + CHECK(payment_preimage->arr_len == 32); + memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); + ChannelManager_claim_funds(&this_arg_conv, payment_preimage_ref); } -int32_t CS_LDK_CounterpartyForwardingInfo_get_fee_base_msat(int64_t this_ptr) { - LDKCounterpartyForwardingInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int32_t ret_conv = CounterpartyForwardingInfo_get_fee_base_msat(&this_ptr_conv); - return ret_conv; +void CS_LDK_ChannelManager_claim_funds_with_known_custom_tlvs(int64_t this_arg, int8_tArray payment_preimage) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKThirtyTwoBytes payment_preimage_ref; + CHECK(payment_preimage->arr_len == 32); + memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); + ChannelManager_claim_funds_with_known_custom_tlvs(&this_arg_conv, payment_preimage_ref); } -void CS_LDK_CounterpartyForwardingInfo_set_fee_base_msat(int64_t this_ptr, int32_t val) { - LDKCounterpartyForwardingInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - CounterpartyForwardingInfo_set_fee_base_msat(&this_ptr_conv, val); +int8_tArray CS_LDK_ChannelManager_get_our_node_id(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; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, ChannelManager_get_our_node_id(&this_arg_conv).compressed_form, 33); + return ret_arr; } -int32_t CS_LDK_CounterpartyForwardingInfo_get_fee_proportional_millionths(int64_t this_ptr) { - LDKCounterpartyForwardingInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int32_t ret_conv = CounterpartyForwardingInfo_get_fee_proportional_millionths(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_ChannelManager_accept_inbound_channel(int64_t this_arg, int64_t temporary_channel_id, int8_tArray counterparty_node_id, int8_tArray user_channel_id) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelId temporary_channel_id_conv; + temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); + temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); + temporary_channel_id_conv.is_owned = false; + LDKPublicKey counterparty_node_id_ref; + CHECK(counterparty_node_id->arr_len == 33); + memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); + LDKU128 user_channel_id_ref; + CHECK(user_channel_id->arr_len == 16); + memcpy(user_channel_id_ref.le_bytes, user_channel_id->elems, 16); FREE(user_channel_id); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_accept_inbound_channel(&this_arg_conv, &temporary_channel_id_conv, counterparty_node_id_ref, user_channel_id_ref); + return tag_ptr(ret_conv, true); } -void CS_LDK_CounterpartyForwardingInfo_set_fee_proportional_millionths(int64_t this_ptr, int32_t val) { - LDKCounterpartyForwardingInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - CounterpartyForwardingInfo_set_fee_proportional_millionths(&this_ptr_conv, val); +int64_t CS_LDK_ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(int64_t this_arg, int64_t temporary_channel_id, int8_tArray counterparty_node_id, int8_tArray user_channel_id) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelId temporary_channel_id_conv; + temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); + temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); + temporary_channel_id_conv.is_owned = false; + LDKPublicKey counterparty_node_id_ref; + CHECK(counterparty_node_id->arr_len == 33); + memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); + LDKU128 user_channel_id_ref; + CHECK(user_channel_id->arr_len == 16); + memcpy(user_channel_id_ref.le_bytes, user_channel_id->elems, 16); FREE(user_channel_id); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(&this_arg_conv, &temporary_channel_id_conv, counterparty_node_id_ref, user_channel_id_ref); + return tag_ptr(ret_conv, true); } -int16_t CS_LDK_CounterpartyForwardingInfo_get_cltv_expiry_delta(int64_t this_ptr) { - LDKCounterpartyForwardingInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int16_t ret_conv = CounterpartyForwardingInfo_get_cltv_expiry_delta(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_ChannelManager_create_offer_builder(int64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ"); + *ret_conv = ChannelManager_create_offer_builder(&this_arg_conv); + return tag_ptr(ret_conv, true); } -void CS_LDK_CounterpartyForwardingInfo_set_cltv_expiry_delta(int64_t this_ptr, int16_t val) { - LDKCounterpartyForwardingInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - CounterpartyForwardingInfo_set_cltv_expiry_delta(&this_ptr_conv, val); +int64_t CS_LDK_ChannelManager_create_refund_builder(int64_t this_arg, int64_t amount_msats, int64_t absolute_expiry, int8_tArray payment_id, int64_t retry_strategy, int64_t max_total_routing_fee_msat) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + void* retry_strategy_ptr = untag_ptr(retry_strategy); + CHECK_ACCESS(retry_strategy_ptr); + LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr); + retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy)); + void* max_total_routing_fee_msat_ptr = untag_ptr(max_total_routing_fee_msat); + CHECK_ACCESS(max_total_routing_fee_msat_ptr); + LDKCOption_u64Z max_total_routing_fee_msat_conv = *(LDKCOption_u64Z*)(max_total_routing_fee_msat_ptr); + max_total_routing_fee_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(max_total_routing_fee_msat)); + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ"); + *ret_conv = ChannelManager_create_refund_builder(&this_arg_conv, amount_msats, absolute_expiry, payment_id_ref, retry_strategy_conv, max_total_routing_fee_msat_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CounterpartyForwardingInfo_new(int32_t fee_base_msat_arg, int32_t fee_proportional_millionths_arg, int16_t cltv_expiry_delta_arg) { - LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +int64_t CS_LDK_ChannelManager_pay_for_offer(int64_t this_arg, int64_t offer, int64_t quantity, int64_t amount_msats, int64_t payer_note, int8_tArray payment_id, int64_t retry_strategy, int64_t max_total_routing_fee_msat) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKOffer offer_conv; + offer_conv.inner = untag_ptr(offer); + offer_conv.is_owned = ptr_is_owned(offer); + CHECK_INNER_FIELD_ACCESS_OR_NULL(offer_conv); + offer_conv.is_owned = false; + void* quantity_ptr = untag_ptr(quantity); + CHECK_ACCESS(quantity_ptr); + LDKCOption_u64Z quantity_conv = *(LDKCOption_u64Z*)(quantity_ptr); + quantity_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(quantity)); + void* amount_msats_ptr = untag_ptr(amount_msats); + CHECK_ACCESS(amount_msats_ptr); + LDKCOption_u64Z amount_msats_conv = *(LDKCOption_u64Z*)(amount_msats_ptr); + amount_msats_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amount_msats)); + void* payer_note_ptr = untag_ptr(payer_note); + CHECK_ACCESS(payer_note_ptr); + LDKCOption_StrZ payer_note_conv = *(LDKCOption_StrZ*)(payer_note_ptr); + payer_note_conv = COption_StrZ_clone((LDKCOption_StrZ*)untag_ptr(payer_note)); + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + void* retry_strategy_ptr = untag_ptr(retry_strategy); + CHECK_ACCESS(retry_strategy_ptr); + LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr); + retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy)); + void* max_total_routing_fee_msat_ptr = untag_ptr(max_total_routing_fee_msat); + CHECK_ACCESS(max_total_routing_fee_msat_ptr); + LDKCOption_u64Z max_total_routing_fee_msat_conv = *(LDKCOption_u64Z*)(max_total_routing_fee_msat_ptr); + max_total_routing_fee_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(max_total_routing_fee_msat)); + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = ChannelManager_pay_for_offer(&this_arg_conv, &offer_conv, quantity_conv, amount_msats_conv, payer_note_conv, payment_id_ref, retry_strategy_conv, max_total_routing_fee_msat_conv); + return tag_ptr(ret_conv, true); } -static inline uint64_t CounterpartyForwardingInfo_clone_ptr(LDKCounterpartyForwardingInfo *NONNULL_PTR arg) { - LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -int64_t CS_LDK_CounterpartyForwardingInfo_clone_ptr(int64_t arg) { - LDKCounterpartyForwardingInfo arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = CounterpartyForwardingInfo_clone_ptr(&arg_conv); - return ret_conv; +int64_t CS_LDK_ChannelManager_request_refund_payment(int64_t this_arg, int64_t refund) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKRefund refund_conv; + refund_conv.inner = untag_ptr(refund); + refund_conv.is_owned = ptr_is_owned(refund); + CHECK_INNER_FIELD_ACCESS_OR_NULL(refund_conv); + refund_conv.is_owned = false; + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ), "LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ"); + *ret_conv = ChannelManager_request_refund_payment(&this_arg_conv, &refund_conv); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CounterpartyForwardingInfo_clone(int64_t orig) { - LDKCounterpartyForwardingInfo orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_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_ChannelManager_create_inbound_payment(int64_t this_arg, int64_t min_value_msat, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + void* min_value_msat_ptr = untag_ptr(min_value_msat); + CHECK_ACCESS(min_value_msat_ptr); + LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); + min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat)); + void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); + CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); + LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); + min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); + LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ), "LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ"); + *ret_conv = ChannelManager_create_inbound_payment(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); + return tag_ptr(ret_conv, true); } -void CS_LDK_ChannelCounterparty_free(int64_t this_obj) { - LDKChannelCounterparty this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelCounterparty_free(this_obj_conv); +int64_t CS_LDK_ChannelManager_create_inbound_payment_for_hash(int64_t this_arg, int8_tArray payment_hash, int64_t min_value_msat, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + void* min_value_msat_ptr = untag_ptr(min_value_msat); + CHECK_ACCESS(min_value_msat_ptr); + LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); + min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat)); + void* min_final_cltv_expiry_ptr = untag_ptr(min_final_cltv_expiry); + CHECK_ACCESS(min_final_cltv_expiry_ptr); + LDKCOption_u16Z min_final_cltv_expiry_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_ptr); + min_final_cltv_expiry_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry)); + LDKCResult_ThirtyTwoBytesNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesNoneZ), "LDKCResult_ThirtyTwoBytesNoneZ"); + *ret_conv = ChannelManager_create_inbound_payment_for_hash(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs, min_final_cltv_expiry_conv); + return tag_ptr(ret_conv, true); } -int8_tArray CS_LDK_ChannelCounterparty_get_node_id(int64_t this_ptr) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, ChannelCounterparty_get_node_id(&this_ptr_conv).compressed_form, 33); - return ret_arr; +int64_t CS_LDK_ChannelManager_get_payment_preimage(int64_t this_arg, int8_tArray payment_hash, int8_tArray payment_secret) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKThirtyTwoBytes payment_secret_ref; + CHECK(payment_secret->arr_len == 32); + memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret); + LDKCResult_ThirtyTwoBytesAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesAPIErrorZ), "LDKCResult_ThirtyTwoBytesAPIErrorZ"); + *ret_conv = ChannelManager_get_payment_preimage(&this_arg_conv, payment_hash_ref, payment_secret_ref); + return tag_ptr(ret_conv, true); } -void CS_LDK_ChannelCounterparty_set_node_id(int64_t this_ptr, int8_tArray val) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - ChannelCounterparty_set_node_id(&this_ptr_conv, val_ref); +int64_t CS_LDK_ChannelManager_get_phantom_scid(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; + int64_t ret_conv = ChannelManager_get_phantom_scid(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_ChannelCounterparty_get_features(int64_t this_ptr) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKInitFeatures ret_var = ChannelCounterparty_get_features(&this_ptr_conv); +int64_t CS_LDK_ChannelManager_get_phantom_route_hints(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; + LDKPhantomRouteHints ret_var = ChannelManager_get_phantom_route_hints(&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_ChannelCounterparty_set_features(int64_t this_ptr, int64_t val) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKInitFeatures val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = InitFeatures_clone(&val_conv); - ChannelCounterparty_set_features(&this_ptr_conv, val_conv); -} - -int64_t CS_LDK_ChannelCounterparty_get_unspendable_punishment_reserve(int64_t this_ptr) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelCounterparty_get_unspendable_punishment_reserve(&this_ptr_conv); +int64_t CS_LDK_ChannelManager_get_intercept_scid(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; + int64_t ret_conv = ChannelManager_get_intercept_scid(&this_arg_conv); return ret_conv; } -void CS_LDK_ChannelCounterparty_set_unspendable_punishment_reserve(int64_t this_ptr, int64_t val) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelCounterparty_set_unspendable_punishment_reserve(&this_ptr_conv, val); -} - -int64_t CS_LDK_ChannelCounterparty_get_forwarding_info(int64_t this_ptr) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCounterpartyForwardingInfo ret_var = ChannelCounterparty_get_forwarding_info(&this_ptr_conv); +int64_t CS_LDK_ChannelManager_compute_inflight_htlcs(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; + LDKInFlightHtlcs ret_var = ChannelManager_compute_inflight_htlcs(&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_ChannelCounterparty_set_forwarding_info(int64_t this_ptr, int64_t val) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCounterpartyForwardingInfo val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = CounterpartyForwardingInfo_clone(&val_conv); - ChannelCounterparty_set_forwarding_info(&this_ptr_conv, val_conv); +int64_t CS_LDK_ChannelManager_as_MessageSendEventsProvider(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; + LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); + *ret_ret = ChannelManager_as_MessageSendEventsProvider(&this_arg_conv); + return tag_ptr(ret_ret, true); } -int64_t CS_LDK_ChannelCounterparty_get_outbound_htlc_minimum_msat(int64_t this_ptr) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelCounterparty_get_outbound_htlc_minimum_msat(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_ChannelManager_as_EventsProvider(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; + LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); + *ret_ret = ChannelManager_as_EventsProvider(&this_arg_conv); + return tag_ptr(ret_ret, true); } -void CS_LDK_ChannelCounterparty_set_outbound_htlc_minimum_msat(int64_t this_ptr, int64_t val) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - ChannelCounterparty_set_outbound_htlc_minimum_msat(&this_ptr_conv, val_conv); +int64_t CS_LDK_ChannelManager_as_Listen(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; + LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); + *ret_ret = ChannelManager_as_Listen(&this_arg_conv); + return tag_ptr(ret_ret, true); } -int64_t CS_LDK_ChannelCounterparty_get_outbound_htlc_maximum_msat(int64_t this_ptr) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelCounterparty_get_outbound_htlc_maximum_msat(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +int64_t CS_LDK_ChannelManager_as_Confirm(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; + LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); + *ret_ret = ChannelManager_as_Confirm(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +int64_t CS_LDK_ChannelManager_get_event_or_persistence_needed_future(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; + LDKFuture ret_var = ChannelManager_get_event_or_persistence_needed_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; } -void CS_LDK_ChannelCounterparty_set_outbound_htlc_maximum_msat(int64_t this_ptr, int64_t val) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - ChannelCounterparty_set_outbound_htlc_maximum_msat(&this_ptr_conv, val_conv); +jboolean CS_LDK_ChannelManager_get_and_clear_needs_persistence(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; + jboolean ret_conv = ChannelManager_get_and_clear_needs_persistence(&this_arg_conv); + return ret_conv; } -int64_t CS_LDK_ChannelCounterparty_new(int8_tArray node_id_arg, int64_t features_arg, int64_t unspendable_punishment_reserve_arg, int64_t forwarding_info_arg, int64_t outbound_htlc_minimum_msat_arg, int64_t outbound_htlc_maximum_msat_arg) { - LDKPublicKey node_id_arg_ref; - CHECK(node_id_arg->arr_len == 33); - memcpy(node_id_arg_ref.compressed_form, node_id_arg->elems, 33); FREE(node_id_arg); - LDKInitFeatures features_arg_conv; - features_arg_conv.inner = untag_ptr(features_arg); - features_arg_conv.is_owned = ptr_is_owned(features_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); - features_arg_conv = InitFeatures_clone(&features_arg_conv); - LDKCounterpartyForwardingInfo forwarding_info_arg_conv; - forwarding_info_arg_conv.inner = untag_ptr(forwarding_info_arg); - forwarding_info_arg_conv.is_owned = ptr_is_owned(forwarding_info_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(forwarding_info_arg_conv); - forwarding_info_arg_conv = CounterpartyForwardingInfo_clone(&forwarding_info_arg_conv); - void* outbound_htlc_minimum_msat_arg_ptr = untag_ptr(outbound_htlc_minimum_msat_arg); - CHECK_ACCESS(outbound_htlc_minimum_msat_arg_ptr); - LDKCOption_u64Z outbound_htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(outbound_htlc_minimum_msat_arg_ptr); - outbound_htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_htlc_minimum_msat_arg)); - void* outbound_htlc_maximum_msat_arg_ptr = untag_ptr(outbound_htlc_maximum_msat_arg); - CHECK_ACCESS(outbound_htlc_maximum_msat_arg_ptr); - LDKCOption_u64Z outbound_htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(outbound_htlc_maximum_msat_arg_ptr); - outbound_htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_htlc_maximum_msat_arg)); - LDKChannelCounterparty ret_var = ChannelCounterparty_new(node_id_arg_ref, features_arg_conv, unspendable_punishment_reserve_arg, forwarding_info_arg_conv, outbound_htlc_minimum_msat_arg_conv, outbound_htlc_maximum_msat_arg_conv); +int64_t CS_LDK_ChannelManager_current_best_block(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; + LDKBestBlock ret_var = ChannelManager_current_best_block(&this_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t ChannelCounterparty_clone_ptr(LDKChannelCounterparty *NONNULL_PTR arg) { - LDKChannelCounterparty ret_var = ChannelCounterparty_clone(arg); +int64_t CS_LDK_ChannelManager_node_features(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; + LDKNodeFeatures ret_var = ChannelManager_node_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_ChannelCounterparty_clone_ptr(int64_t arg) { - LDKChannelCounterparty arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = ChannelCounterparty_clone_ptr(&arg_conv); - return ret_conv; -} -int64_t CS_LDK_ChannelCounterparty_clone(int64_t orig) { - LDKChannelCounterparty orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKChannelCounterparty ret_var = ChannelCounterparty_clone(&orig_conv); +int64_t CS_LDK_ChannelManager_channel_features(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; + LDKChannelFeatures ret_var = ChannelManager_channel_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_ChannelDetails_free(int64_t this_obj) { - LDKChannelDetails this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelDetails_free(this_obj_conv); -} - -int64_t CS_LDK_ChannelDetails_get_channel_id(int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelId ret_var = ChannelDetails_get_channel_id(&this_ptr_conv); +int64_t CS_LDK_ChannelManager_channel_type_features(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; + LDKChannelTypeFeatures ret_var = ChannelManager_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; } -void CS_LDK_ChannelDetails_set_channel_id(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelId val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelId_clone(&val_conv); - ChannelDetails_set_channel_id(&this_ptr_conv, val_conv); -} - -int64_t CS_LDK_ChannelDetails_get_counterparty(int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelCounterparty ret_var = ChannelDetails_get_counterparty(&this_ptr_conv); +int64_t CS_LDK_ChannelManager_init_features(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; + LDKInitFeatures ret_var = ChannelManager_init_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_ChannelDetails_set_counterparty(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelCounterparty val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelCounterparty_clone(&val_conv); - ChannelDetails_set_counterparty(&this_ptr_conv, val_conv); +int64_t CS_LDK_ChannelManager_as_ChannelMessageHandler(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; + LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler"); + *ret_ret = ChannelManager_as_ChannelMessageHandler(&this_arg_conv); + return tag_ptr(ret_ret, true); } -int64_t CS_LDK_ChannelDetails_get_funding_txo(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; - LDKOutPoint ret_var = ChannelDetails_get_funding_txo(&this_ptr_conv); +int64_t CS_LDK_ChannelManager_as_OffersMessageHandler(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; + LDKOffersMessageHandler* ret_ret = MALLOC(sizeof(LDKOffersMessageHandler), "LDKOffersMessageHandler"); + *ret_ret = ChannelManager_as_OffersMessageHandler(&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); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeIdLookUp* ret_ret = MALLOC(sizeof(LDKNodeIdLookUp), "LDKNodeIdLookUp"); + *ret_ret = ChannelManager_as_NodeIdLookUp(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +int64_t CS_LDK_provided_init_features(int64_t config) { + LDKUserConfig config_conv; + config_conv.inner = untag_ptr(config); + config_conv.is_owned = ptr_is_owned(config); + CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv); + config_conv.is_owned = false; + LDKInitFeatures ret_var = provided_init_features(&config_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -void CS_LDK_ChannelDetails_set_funding_txo(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKOutPoint val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = OutPoint_clone(&val_conv); - ChannelDetails_set_funding_txo(&this_ptr_conv, val_conv); +int8_tArray CS_LDK_PhantomRouteHints_write(int64_t obj) { + LDKPhantomRouteHints obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = PhantomRouteHints_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_PhantomRouteHints_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ"); + *ret_conv = PhantomRouteHints_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray CS_LDK_BlindedForward_write(int64_t obj) { + LDKBlindedForward obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = BlindedForward_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_BlindedForward_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_BlindedForwardDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedForwardDecodeErrorZ), "LDKCResult_BlindedForwardDecodeErrorZ"); + *ret_conv = BlindedForward_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray CS_LDK_PendingHTLCRouting_write(int64_t obj) { + LDKPendingHTLCRouting* obj_conv = (LDKPendingHTLCRouting*)untag_ptr(obj); + LDKCVec_u8Z ret_var = PendingHTLCRouting_write(obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_PendingHTLCRouting_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_PendingHTLCRoutingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PendingHTLCRoutingDecodeErrorZ), "LDKCResult_PendingHTLCRoutingDecodeErrorZ"); + *ret_conv = PendingHTLCRouting_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray CS_LDK_PendingHTLCInfo_write(int64_t obj) { + LDKPendingHTLCInfo obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = PendingHTLCInfo_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_PendingHTLCInfo_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_PendingHTLCInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PendingHTLCInfoDecodeErrorZ), "LDKCResult_PendingHTLCInfoDecodeErrorZ"); + *ret_conv = PendingHTLCInfo_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray CS_LDK_BlindedFailure_write(int64_t obj) { + LDKBlindedFailure* obj_conv = (LDKBlindedFailure*)untag_ptr(obj); + LDKCVec_u8Z ret_var = BlindedFailure_write(obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_BlindedFailure_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_BlindedFailureDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedFailureDecodeErrorZ), "LDKCResult_BlindedFailureDecodeErrorZ"); + *ret_conv = BlindedFailure_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray CS_LDK_ChannelManager_write(int64_t obj) { + LDKChannelManager obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ChannelManager_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +void CS_LDK_ChannelManagerReadArgs_free(int64_t this_obj) { + LDKChannelManagerReadArgs this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelManagerReadArgs_free(this_obj_conv); } -int64_t CS_LDK_ChannelDetails_get_channel_type(int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +int64_t CS_LDK_ChannelManagerReadArgs_get_entropy_source(int64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelTypeFeatures ret_var = ChannelDetails_get_channel_type(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + // WARNING: This object doesn't live past this scope, needs clone! + int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_entropy_source(&this_ptr_conv), false); + return ret_ret; } -void CS_LDK_ChannelDetails_set_channel_type(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; +void CS_LDK_ChannelManagerReadArgs_set_entropy_source(int64_t this_ptr, int64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelTypeFeatures val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelTypeFeatures_clone(&val_conv); - ChannelDetails_set_channel_type(&this_ptr_conv, val_conv); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKEntropySource val_conv = *(LDKEntropySource*)(val_ptr); + if (val_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&val_conv); + } + ChannelManagerReadArgs_set_entropy_source(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelDetails_get_short_channel_id(int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +int64_t CS_LDK_ChannelManagerReadArgs_get_node_signer(int64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelDetails_get_short_channel_id(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + // WARNING: This object doesn't live past this scope, needs clone! + int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_node_signer(&this_ptr_conv), false); + return ret_ret; } -void CS_LDK_ChannelDetails_set_short_channel_id(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; +void CS_LDK_ChannelManagerReadArgs_set_node_signer(int64_t this_ptr, int64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; void* val_ptr = untag_ptr(val); CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - ChannelDetails_set_short_channel_id(&this_ptr_conv, val_conv); + LDKNodeSigner val_conv = *(LDKNodeSigner*)(val_ptr); + if (val_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&val_conv); + } + ChannelManagerReadArgs_set_node_signer(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelDetails_get_outbound_scid_alias(int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +int64_t CS_LDK_ChannelManagerReadArgs_get_signer_provider(int64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelDetails_get_outbound_scid_alias(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + // WARNING: This object doesn't live past this scope, needs clone! + int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_signer_provider(&this_ptr_conv), false); + return ret_ret; } -void CS_LDK_ChannelDetails_set_outbound_scid_alias(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; +void CS_LDK_ChannelManagerReadArgs_set_signer_provider(int64_t this_ptr, int64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; void* val_ptr = untag_ptr(val); CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - ChannelDetails_set_outbound_scid_alias(&this_ptr_conv, val_conv); + LDKSignerProvider val_conv = *(LDKSignerProvider*)(val_ptr); + if (val_conv.free == LDKSignerProvider_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKSignerProvider_JCalls_cloned(&val_conv); + } + ChannelManagerReadArgs_set_signer_provider(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelDetails_get_inbound_scid_alias(int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +int64_t CS_LDK_ChannelManagerReadArgs_get_fee_estimator(int64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelDetails_get_inbound_scid_alias(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + // WARNING: This object doesn't live past this scope, needs clone! + int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_fee_estimator(&this_ptr_conv), false); + return ret_ret; } -void CS_LDK_ChannelDetails_set_inbound_scid_alias(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; +void CS_LDK_ChannelManagerReadArgs_set_fee_estimator(int64_t this_ptr, int64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; void* val_ptr = untag_ptr(val); CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - ChannelDetails_set_inbound_scid_alias(&this_ptr_conv, val_conv); + LDKFeeEstimator val_conv = *(LDKFeeEstimator*)(val_ptr); + if (val_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&val_conv); + } + ChannelManagerReadArgs_set_fee_estimator(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelDetails_get_channel_value_satoshis(int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +int64_t CS_LDK_ChannelManagerReadArgs_get_chain_monitor(int64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelDetails_get_channel_value_satoshis(&this_ptr_conv); - return ret_conv; + // WARNING: This object doesn't live past this scope, needs clone! + int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_chain_monitor(&this_ptr_conv), false); + return ret_ret; } -void CS_LDK_ChannelDetails_set_channel_value_satoshis(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; +void CS_LDK_ChannelManagerReadArgs_set_chain_monitor(int64_t this_ptr, int64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelDetails_set_channel_value_satoshis(&this_ptr_conv, val); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKWatch val_conv = *(LDKWatch*)(val_ptr); + if (val_conv.free == LDKWatch_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKWatch_JCalls_cloned(&val_conv); + } + ChannelManagerReadArgs_set_chain_monitor(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelDetails_get_unspendable_punishment_reserve(int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +int64_t CS_LDK_ChannelManagerReadArgs_get_tx_broadcaster(int64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelDetails_get_unspendable_punishment_reserve(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + // WARNING: This object doesn't live past this scope, needs clone! + int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv), false); + return ret_ret; } -void CS_LDK_ChannelDetails_set_unspendable_punishment_reserve(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; +void CS_LDK_ChannelManagerReadArgs_set_tx_broadcaster(int64_t this_ptr, int64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; void* val_ptr = untag_ptr(val); CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - ChannelDetails_set_unspendable_punishment_reserve(&this_ptr_conv, val_conv); + LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)(val_ptr); + if (val_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&val_conv); + } + ChannelManagerReadArgs_set_tx_broadcaster(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_ChannelDetails_get_user_channel_id(int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +int64_t CS_LDK_ChannelManagerReadArgs_get_router(int64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(16, __LINE__); - memcpy(ret_arr->elems, ChannelDetails_get_user_channel_id(&this_ptr_conv).le_bytes, 16); - return ret_arr; + // WARNING: This object doesn't live past this scope, needs clone! + int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_router(&this_ptr_conv), false); + return ret_ret; } -void CS_LDK_ChannelDetails_set_user_channel_id(int64_t this_ptr, int8_tArray val) { - LDKChannelDetails this_ptr_conv; +void CS_LDK_ChannelManagerReadArgs_set_router(int64_t this_ptr, int64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKU128 val_ref; - CHECK(val->arr_len == 16); - memcpy(val_ref.le_bytes, val->elems, 16); FREE(val); - ChannelDetails_set_user_channel_id(&this_ptr_conv, val_ref); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKRouter val_conv = *(LDKRouter*)(val_ptr); + if (val_conv.free == LDKRouter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKRouter_JCalls_cloned(&val_conv); + } + ChannelManagerReadArgs_set_router(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelDetails_get_feerate_sat_per_1000_weight(int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +int64_t CS_LDK_ChannelManagerReadArgs_get_logger(int64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); - *ret_copy = ChannelDetails_get_feerate_sat_per_1000_weight(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + // WARNING: This object doesn't live past this scope, needs clone! + int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_logger(&this_ptr_conv), false); + return ret_ret; } -void CS_LDK_ChannelDetails_set_feerate_sat_per_1000_weight(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; +void CS_LDK_ChannelManagerReadArgs_set_logger(int64_t this_ptr, int64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; void* val_ptr = untag_ptr(val); CHECK_ACCESS(val_ptr); - LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); - val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val)); - ChannelDetails_set_feerate_sat_per_1000_weight(&this_ptr_conv, val_conv); + LDKLogger val_conv = *(LDKLogger*)(val_ptr); + if (val_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&val_conv); + } + ChannelManagerReadArgs_set_logger(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelDetails_get_balance_msat(int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +int64_t CS_LDK_ChannelManagerReadArgs_get_default_config(int64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelDetails_get_balance_msat(&this_ptr_conv); - return ret_conv; + LDKUserConfig ret_var = ChannelManagerReadArgs_get_default_config(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_ChannelDetails_set_balance_msat(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; +void CS_LDK_ChannelManagerReadArgs_set_default_config(int64_t this_ptr, int64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelDetails_set_balance_msat(&this_ptr_conv, val); + LDKUserConfig val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = UserConfig_clone(&val_conv); + ChannelManagerReadArgs_set_default_config(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelDetails_get_outbound_capacity_msat(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; - int64_t ret_conv = ChannelDetails_get_outbound_capacity_msat(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_ChannelManagerReadArgs_new(int64_t entropy_source, int64_t node_signer, int64_t signer_provider, int64_t fee_estimator, int64_t chain_monitor, int64_t tx_broadcaster, int64_t router, int64_t logger, int64_t default_config, int64_tArray channel_monitors) { + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* signer_provider_ptr = untag_ptr(signer_provider); + CHECK_ACCESS(signer_provider_ptr); + LDKSignerProvider signer_provider_conv = *(LDKSignerProvider*)(signer_provider_ptr); + if (signer_provider_conv.free == LDKSignerProvider_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKSignerProvider_JCalls_cloned(&signer_provider_conv); + } + void* fee_estimator_ptr = untag_ptr(fee_estimator); + CHECK_ACCESS(fee_estimator_ptr); + LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); + if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); + } + void* chain_monitor_ptr = untag_ptr(chain_monitor); + CHECK_ACCESS(chain_monitor_ptr); + LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr); + if (chain_monitor_conv.free == LDKWatch_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKWatch_JCalls_cloned(&chain_monitor_conv); + } + void* tx_broadcaster_ptr = untag_ptr(tx_broadcaster); + CHECK_ACCESS(tx_broadcaster_ptr); + LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr); + if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv); + } + void* router_ptr = untag_ptr(router); + CHECK_ACCESS(router_ptr); + LDKRouter router_conv = *(LDKRouter*)(router_ptr); + if (router_conv.free == LDKRouter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKRouter_JCalls_cloned(&router_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKUserConfig default_config_conv; + default_config_conv.inner = untag_ptr(default_config); + default_config_conv.is_owned = ptr_is_owned(default_config); + CHECK_INNER_FIELD_ACCESS_OR_NULL(default_config_conv); + default_config_conv = UserConfig_clone(&default_config_conv); + LDKCVec_ChannelMonitorZ channel_monitors_constr; + channel_monitors_constr.datalen = channel_monitors->arr_len; + if (channel_monitors_constr.datalen > 0) + channel_monitors_constr.data = MALLOC(channel_monitors_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements"); + else + channel_monitors_constr.data = NULL; + int64_t* channel_monitors_vals = channel_monitors->elems; + for (size_t q = 0; q < channel_monitors_constr.datalen; q++) { + int64_t channel_monitors_conv_16 = channel_monitors_vals[q]; + LDKChannelMonitor channel_monitors_conv_16_conv; + channel_monitors_conv_16_conv.inner = untag_ptr(channel_monitors_conv_16); + channel_monitors_conv_16_conv.is_owned = ptr_is_owned(channel_monitors_conv_16); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_monitors_conv_16_conv); + channel_monitors_conv_16_conv.is_owned = false; + channel_monitors_constr.data[q] = channel_monitors_conv_16_conv; + } + FREE(channel_monitors); + LDKChannelManagerReadArgs ret_var = ChannelManagerReadArgs_new(entropy_source_conv, node_signer_conv, signer_provider_conv, fee_estimator_conv, chain_monitor_conv, tx_broadcaster_conv, router_conv, logger_conv, default_config_conv, channel_monitors_constr); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_ChannelDetails_set_outbound_capacity_msat(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelDetails_set_outbound_capacity_msat(&this_ptr_conv, val); +int64_t CS_LDK_C2Tuple_ThirtyTwoBytesChannelManagerZ_read(int8_tArray ser, int64_t arg) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKChannelManagerReadArgs arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + // WARNING: we need a move here but no clone is available for LDKChannelManagerReadArgs + + LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ"); + *ret_conv = C2Tuple_ThirtyTwoBytesChannelManagerZ_read(ser_ref, arg_conv); + FREE(ser); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelDetails_get_next_outbound_htlc_limit_msat(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; - int64_t ret_conv = ChannelDetails_get_next_outbound_htlc_limit_msat(&this_ptr_conv); - return ret_conv; +void CS_LDK_DelayedPaymentBasepoint_free(int64_t this_obj) { + LDKDelayedPaymentBasepoint this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + DelayedPaymentBasepoint_free(this_obj_conv); } -void CS_LDK_ChannelDetails_set_next_outbound_htlc_limit_msat(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; +int8_tArray CS_LDK_DelayedPaymentBasepoint_get_a(int64_t this_ptr) { + LDKDelayedPaymentBasepoint this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelDetails_set_next_outbound_htlc_limit_msat(&this_ptr_conv, val); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, DelayedPaymentBasepoint_get_a(&this_ptr_conv).compressed_form, 33); + return ret_arr; } -int64_t CS_LDK_ChannelDetails_get_next_outbound_htlc_minimum_msat(int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +void CS_LDK_DelayedPaymentBasepoint_set_a(int64_t this_ptr, int8_tArray val) { + LDKDelayedPaymentBasepoint this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelDetails_get_next_outbound_htlc_minimum_msat(&this_ptr_conv); - return ret_conv; + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + DelayedPaymentBasepoint_set_a(&this_ptr_conv, val_ref); } -void CS_LDK_ChannelDetails_set_next_outbound_htlc_minimum_msat(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelDetails_set_next_outbound_htlc_minimum_msat(&this_ptr_conv, val); +int64_t CS_LDK_DelayedPaymentBasepoint_new(int8_tArray a_arg) { + LDKPublicKey a_arg_ref; + CHECK(a_arg->arr_len == 33); + memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg); + LDKDelayedPaymentBasepoint ret_var = DelayedPaymentBasepoint_new(a_arg_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -int64_t CS_LDK_ChannelDetails_get_inbound_capacity_msat(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; - int64_t ret_conv = ChannelDetails_get_inbound_capacity_msat(&this_ptr_conv); +jboolean CS_LDK_DelayedPaymentBasepoint_eq(int64_t a, int64_t b) { + LDKDelayedPaymentBasepoint a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKDelayedPaymentBasepoint b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = DelayedPaymentBasepoint_eq(&a_conv, &b_conv); return ret_conv; } -void CS_LDK_ChannelDetails_set_inbound_capacity_msat(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelDetails_set_inbound_capacity_msat(&this_ptr_conv, val); +static inline uint64_t DelayedPaymentBasepoint_clone_ptr(LDKDelayedPaymentBasepoint *NONNULL_PTR arg) { + LDKDelayedPaymentBasepoint ret_var = DelayedPaymentBasepoint_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_DelayedPaymentBasepoint_clone_ptr(int64_t arg) { + LDKDelayedPaymentBasepoint arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = DelayedPaymentBasepoint_clone_ptr(&arg_conv); + return ret_conv; } -int64_t CS_LDK_ChannelDetails_get_confirmations_required(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; - LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); - *ret_copy = ChannelDetails_get_confirmations_required(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +int64_t CS_LDK_DelayedPaymentBasepoint_clone(int64_t orig) { + LDKDelayedPaymentBasepoint orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKDelayedPaymentBasepoint ret_var = DelayedPaymentBasepoint_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -void CS_LDK_ChannelDetails_set_confirmations_required(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); - val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val)); - ChannelDetails_set_confirmations_required(&this_ptr_conv, val_conv); +int64_t CS_LDK_DelayedPaymentBasepoint_hash(int64_t o) { + LDKDelayedPaymentBasepoint o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = DelayedPaymentBasepoint_hash(&o_conv); + return ret_conv; } -int64_t CS_LDK_ChannelDetails_get_confirmations(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; - LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); - *ret_copy = ChannelDetails_get_confirmations(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int8_tArray CS_LDK_DelayedPaymentBasepoint_to_public_key(int64_t this_arg) { + LDKDelayedPaymentBasepoint this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, DelayedPaymentBasepoint_to_public_key(&this_arg_conv).compressed_form, 33); + return ret_arr; } -void CS_LDK_ChannelDetails_set_confirmations(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); - val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val)); - ChannelDetails_set_confirmations(&this_ptr_conv, val_conv); +int8_tArray CS_LDK_DelayedPaymentBasepoint_derive_add_tweak(int64_t this_arg, int8_tArray per_commitment_point) { + LDKDelayedPaymentBasepoint this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKPublicKey per_commitment_point_ref; + CHECK(per_commitment_point->arr_len == 33); + memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, DelayedPaymentBasepoint_derive_add_tweak(&this_arg_conv, per_commitment_point_ref).data, 32); + return ret_arr; +} + +int8_tArray CS_LDK_DelayedPaymentBasepoint_write(int64_t obj) { + LDKDelayedPaymentBasepoint obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = DelayedPaymentBasepoint_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -int64_t CS_LDK_ChannelDetails_get_force_close_spend_delay(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; - LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); - *ret_copy = ChannelDetails_get_force_close_spend_delay(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_DelayedPaymentBasepoint_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_DelayedPaymentBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentBasepointDecodeErrorZ), "LDKCResult_DelayedPaymentBasepointDecodeErrorZ"); + *ret_conv = DelayedPaymentBasepoint_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -void CS_LDK_ChannelDetails_set_force_close_spend_delay(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr); - val_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(val)); - ChannelDetails_set_force_close_spend_delay(&this_ptr_conv, val_conv); +void CS_LDK_DelayedPaymentKey_free(int64_t this_obj) { + LDKDelayedPaymentKey this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + DelayedPaymentKey_free(this_obj_conv); } -jboolean CS_LDK_ChannelDetails_get_is_outbound(int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +int8_tArray CS_LDK_DelayedPaymentKey_get_a(int64_t this_ptr) { + LDKDelayedPaymentKey this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - jboolean ret_conv = ChannelDetails_get_is_outbound(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, DelayedPaymentKey_get_a(&this_ptr_conv).compressed_form, 33); + return ret_arr; } -void CS_LDK_ChannelDetails_set_is_outbound(int64_t this_ptr, jboolean val) { - LDKChannelDetails this_ptr_conv; +void CS_LDK_DelayedPaymentKey_set_a(int64_t this_ptr, int8_tArray val) { + LDKDelayedPaymentKey this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelDetails_set_is_outbound(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + DelayedPaymentKey_set_a(&this_ptr_conv, val_ref); } -jboolean CS_LDK_ChannelDetails_get_is_channel_ready(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_channel_ready(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_DelayedPaymentKey_new(int8_tArray a_arg) { + LDKPublicKey a_arg_ref; + CHECK(a_arg->arr_len == 33); + memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg); + LDKDelayedPaymentKey ret_var = DelayedPaymentKey_new(a_arg_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_ChannelDetails_set_is_channel_ready(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_channel_ready(&this_ptr_conv, val); +jboolean CS_LDK_DelayedPaymentKey_eq(int64_t a, int64_t b) { + LDKDelayedPaymentKey a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKDelayedPaymentKey b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = DelayedPaymentKey_eq(&a_conv, &b_conv); + return ret_conv; } -int64_t CS_LDK_ChannelDetails_get_channel_shutdown_state(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; - LDKCOption_ChannelShutdownStateZ *ret_copy = MALLOC(sizeof(LDKCOption_ChannelShutdownStateZ), "LDKCOption_ChannelShutdownStateZ"); - *ret_copy = ChannelDetails_get_channel_shutdown_state(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +static inline uint64_t DelayedPaymentKey_clone_ptr(LDKDelayedPaymentKey *NONNULL_PTR arg) { + LDKDelayedPaymentKey ret_var = DelayedPaymentKey_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } +int64_t CS_LDK_DelayedPaymentKey_clone_ptr(int64_t arg) { + LDKDelayedPaymentKey arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = DelayedPaymentKey_clone_ptr(&arg_conv); + return ret_conv; +} -void CS_LDK_ChannelDetails_set_channel_shutdown_state(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_ChannelShutdownStateZ val_conv = *(LDKCOption_ChannelShutdownStateZ*)(val_ptr); - val_conv = COption_ChannelShutdownStateZ_clone((LDKCOption_ChannelShutdownStateZ*)untag_ptr(val)); - ChannelDetails_set_channel_shutdown_state(&this_ptr_conv, val_conv); +int64_t CS_LDK_DelayedPaymentKey_clone(int64_t orig) { + LDKDelayedPaymentKey orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKDelayedPaymentKey ret_var = DelayedPaymentKey_clone(&orig_conv); + int64_t ret_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_ChannelDetails_get_is_usable(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_usable(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_DelayedPaymentKey_from_basepoint(int64_t countersignatory_basepoint, int8_tArray per_commitment_point) { + LDKDelayedPaymentBasepoint countersignatory_basepoint_conv; + countersignatory_basepoint_conv.inner = untag_ptr(countersignatory_basepoint); + countersignatory_basepoint_conv.is_owned = ptr_is_owned(countersignatory_basepoint); + CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_basepoint_conv); + countersignatory_basepoint_conv.is_owned = false; + LDKPublicKey per_commitment_point_ref; + CHECK(per_commitment_point->arr_len == 33); + memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point); + LDKDelayedPaymentKey ret_var = DelayedPaymentKey_from_basepoint(&countersignatory_basepoint_conv, per_commitment_point_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_ChannelDetails_set_is_usable(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_usable(&this_ptr_conv, val); +int64_t CS_LDK_DelayedPaymentKey_from_secret_key(int8_tArray sk) { + uint8_t sk_arr[32]; + CHECK(sk->arr_len == 32); + memcpy(sk_arr, sk->elems, 32); FREE(sk); + uint8_t (*sk_ref)[32] = &sk_arr; + LDKDelayedPaymentKey ret_var = DelayedPaymentKey_from_secret_key(sk_ref); + int64_t ret_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_ChannelDetails_get_is_public(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); - return ret_conv; +int8_tArray CS_LDK_DelayedPaymentKey_to_public_key(int64_t this_arg) { + LDKDelayedPaymentKey this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, DelayedPaymentKey_to_public_key(&this_arg_conv).compressed_form, 33); + return ret_arr; } -void CS_LDK_ChannelDetails_set_is_public(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); +int8_tArray CS_LDK_DelayedPaymentKey_write(int64_t obj) { + LDKDelayedPaymentKey obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = DelayedPaymentKey_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -int64_t CS_LDK_ChannelDetails_get_inbound_htlc_minimum_msat(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; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelDetails_get_inbound_htlc_minimum_msat(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t CS_LDK_DelayedPaymentKey_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_DelayedPaymentKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentKeyDecodeErrorZ), "LDKCResult_DelayedPaymentKeyDecodeErrorZ"); + *ret_conv = DelayedPaymentKey_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -void CS_LDK_ChannelDetails_set_inbound_htlc_minimum_msat(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - ChannelDetails_set_inbound_htlc_minimum_msat(&this_ptr_conv, val_conv); +void CS_LDK_HtlcBasepoint_free(int64_t this_obj) { + LDKHtlcBasepoint this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + HtlcBasepoint_free(this_obj_conv); } -int64_t CS_LDK_ChannelDetails_get_inbound_htlc_maximum_msat(int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +int8_tArray CS_LDK_HtlcBasepoint_get_a(int64_t this_ptr) { + LDKHtlcBasepoint this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelDetails_get_inbound_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(33, __LINE__); + memcpy(ret_arr->elems, HtlcBasepoint_get_a(&this_ptr_conv).compressed_form, 33); + return ret_arr; } -void CS_LDK_ChannelDetails_set_inbound_htlc_maximum_msat(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; +void CS_LDK_HtlcBasepoint_set_a(int64_t this_ptr, int8_tArray val) { + LDKHtlcBasepoint this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - ChannelDetails_set_inbound_htlc_maximum_msat(&this_ptr_conv, val_conv); + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + HtlcBasepoint_set_a(&this_ptr_conv, val_ref); } -int64_t CS_LDK_ChannelDetails_get_config(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; - LDKChannelConfig ret_var = ChannelDetails_get_config(&this_ptr_conv); +int64_t CS_LDK_HtlcBasepoint_new(int8_tArray a_arg) { + LDKPublicKey a_arg_ref; + CHECK(a_arg->arr_len == 33); + memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg); + LDKHtlcBasepoint ret_var = HtlcBasepoint_new(a_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -void CS_LDK_ChannelDetails_set_config(int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelConfig val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelConfig_clone(&val_conv); - ChannelDetails_set_config(&this_ptr_conv, val_conv); +jboolean CS_LDK_HtlcBasepoint_eq(int64_t a, int64_t b) { + LDKHtlcBasepoint a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKHtlcBasepoint b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = HtlcBasepoint_eq(&a_conv, &b_conv); + return ret_conv; } -static inline uint64_t ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg) { - LDKChannelDetails ret_var = ChannelDetails_clone(arg); +static inline uint64_t HtlcBasepoint_clone_ptr(LDKHtlcBasepoint *NONNULL_PTR arg) { + LDKHtlcBasepoint ret_var = HtlcBasepoint_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_ChannelDetails_clone_ptr(int64_t arg) { - LDKChannelDetails arg_conv; +int64_t CS_LDK_HtlcBasepoint_clone_ptr(int64_t arg) { + LDKHtlcBasepoint arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = ChannelDetails_clone_ptr(&arg_conv); + int64_t ret_conv = HtlcBasepoint_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_ChannelDetails_clone(int64_t orig) { - LDKChannelDetails orig_conv; +int64_t CS_LDK_HtlcBasepoint_clone(int64_t orig) { + LDKHtlcBasepoint orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKChannelDetails ret_var = ChannelDetails_clone(&orig_conv); + LDKHtlcBasepoint ret_var = HtlcBasepoint_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_ChannelDetails_get_inbound_payment_scid(int64_t this_arg) { - LDKChannelDetails this_arg_conv; +int64_t CS_LDK_HtlcBasepoint_hash(int64_t o) { + LDKHtlcBasepoint o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = HtlcBasepoint_hash(&o_conv); + return ret_conv; +} + +int8_tArray CS_LDK_HtlcBasepoint_to_public_key(int64_t this_arg) { + LDKHtlcBasepoint this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelDetails_get_inbound_payment_scid(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, HtlcBasepoint_to_public_key(&this_arg_conv).compressed_form, 33); + return ret_arr; } -int64_t CS_LDK_ChannelDetails_get_outbound_payment_scid(int64_t this_arg) { - LDKChannelDetails this_arg_conv; +int8_tArray CS_LDK_HtlcBasepoint_derive_add_tweak(int64_t this_arg, int8_tArray per_commitment_point) { + LDKHtlcBasepoint this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelDetails_get_outbound_payment_scid(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKPublicKey per_commitment_point_ref; + CHECK(per_commitment_point->arr_len == 33); + memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, HtlcBasepoint_derive_add_tweak(&this_arg_conv, per_commitment_point_ref).data, 32); + return ret_arr; } -int32_t CS_LDK_ChannelShutdownState_clone(int64_t orig) { - LDKChannelShutdownState* orig_conv = (LDKChannelShutdownState*)untag_ptr(orig); - int32_t ret_conv = LDKChannelShutdownState_to_cs(ChannelShutdownState_clone(orig_conv)); - return ret_conv; +int8_tArray CS_LDK_HtlcBasepoint_write(int64_t obj) { + LDKHtlcBasepoint obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = HtlcBasepoint_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -int32_t CS_LDK_ChannelShutdownState_not_shutting_down() { - int32_t ret_conv = LDKChannelShutdownState_to_cs(ChannelShutdownState_not_shutting_down()); - return ret_conv; +int64_t CS_LDK_HtlcBasepoint_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_HtlcBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcBasepointDecodeErrorZ), "LDKCResult_HtlcBasepointDecodeErrorZ"); + *ret_conv = HtlcBasepoint_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -int32_t CS_LDK_ChannelShutdownState_shutdown_initiated() { - int32_t ret_conv = LDKChannelShutdownState_to_cs(ChannelShutdownState_shutdown_initiated()); - return ret_conv; +void CS_LDK_HtlcKey_free(int64_t this_obj) { + LDKHtlcKey this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + HtlcKey_free(this_obj_conv); } -int32_t CS_LDK_ChannelShutdownState_resolving_htlcs() { - int32_t ret_conv = LDKChannelShutdownState_to_cs(ChannelShutdownState_resolving_htlcs()); - return ret_conv; +int8_tArray CS_LDK_HtlcKey_get_a(int64_t this_ptr) { + LDKHtlcKey this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, HtlcKey_get_a(&this_ptr_conv).compressed_form, 33); + return ret_arr; } -int32_t CS_LDK_ChannelShutdownState_negotiating_closing_fee() { - int32_t ret_conv = LDKChannelShutdownState_to_cs(ChannelShutdownState_negotiating_closing_fee()); - return ret_conv; +void CS_LDK_HtlcKey_set_a(int64_t this_ptr, int8_tArray val) { + LDKHtlcKey this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + HtlcKey_set_a(&this_ptr_conv, val_ref); } -int32_t CS_LDK_ChannelShutdownState_shutdown_complete() { - int32_t ret_conv = LDKChannelShutdownState_to_cs(ChannelShutdownState_shutdown_complete()); - return ret_conv; +int64_t CS_LDK_HtlcKey_new(int8_tArray a_arg) { + LDKPublicKey a_arg_ref; + CHECK(a_arg->arr_len == 33); + memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg); + LDKHtlcKey ret_var = HtlcKey_new(a_arg_ref); + int64_t ret_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_ChannelShutdownState_eq(int64_t a, int64_t b) { - LDKChannelShutdownState* a_conv = (LDKChannelShutdownState*)untag_ptr(a); - LDKChannelShutdownState* b_conv = (LDKChannelShutdownState*)untag_ptr(b); - jboolean ret_conv = ChannelShutdownState_eq(a_conv, b_conv); +jboolean CS_LDK_HtlcKey_eq(int64_t a, int64_t b) { + LDKHtlcKey a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKHtlcKey b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = HtlcKey_eq(&a_conv, &b_conv); return ret_conv; } -void CS_LDK_RecentPaymentDetails_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); - LDKRecentPaymentDetails this_ptr_conv = *(LDKRecentPaymentDetails*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - RecentPaymentDetails_free(this_ptr_conv); -} - -static inline uint64_t RecentPaymentDetails_clone_ptr(LDKRecentPaymentDetails *NONNULL_PTR arg) { - LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); - *ret_copy = RecentPaymentDetails_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); +static inline uint64_t HtlcKey_clone_ptr(LDKHtlcKey *NONNULL_PTR arg) { + LDKHtlcKey ret_var = HtlcKey_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_RecentPaymentDetails_clone_ptr(int64_t arg) { - LDKRecentPaymentDetails* arg_conv = (LDKRecentPaymentDetails*)untag_ptr(arg); - int64_t ret_conv = RecentPaymentDetails_clone_ptr(arg_conv); +int64_t CS_LDK_HtlcKey_clone_ptr(int64_t arg) { + LDKHtlcKey arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = HtlcKey_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_RecentPaymentDetails_clone(int64_t orig) { - LDKRecentPaymentDetails* orig_conv = (LDKRecentPaymentDetails*)untag_ptr(orig); - LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); - *ret_copy = RecentPaymentDetails_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_RecentPaymentDetails_awaiting_invoice(int8_tArray payment_id) { - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); - *ret_copy = RecentPaymentDetails_awaiting_invoice(payment_id_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_RecentPaymentDetails_pending(int8_tArray payment_id, int8_tArray payment_hash, int64_t total_msat) { - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); - *ret_copy = RecentPaymentDetails_pending(payment_id_ref, payment_hash_ref, total_msat); - int64_t ret_ref = tag_ptr(ret_copy, true); +int64_t CS_LDK_HtlcKey_clone(int64_t orig) { + LDKHtlcKey orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKHtlcKey ret_var = HtlcKey_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_RecentPaymentDetails_fulfilled(int8_tArray payment_id, int64_t payment_hash) { - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - void* payment_hash_ptr = untag_ptr(payment_hash); - CHECK_ACCESS(payment_hash_ptr); - LDKCOption_ThirtyTwoBytesZ payment_hash_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_ptr); - payment_hash_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash)); - LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); - *ret_copy = RecentPaymentDetails_fulfilled(payment_id_ref, payment_hash_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +int64_t CS_LDK_HtlcKey_from_basepoint(int64_t countersignatory_basepoint, int8_tArray per_commitment_point) { + LDKHtlcBasepoint countersignatory_basepoint_conv; + countersignatory_basepoint_conv.inner = untag_ptr(countersignatory_basepoint); + countersignatory_basepoint_conv.is_owned = ptr_is_owned(countersignatory_basepoint); + CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_basepoint_conv); + countersignatory_basepoint_conv.is_owned = false; + LDKPublicKey per_commitment_point_ref; + CHECK(per_commitment_point->arr_len == 33); + memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point); + LDKHtlcKey ret_var = HtlcKey_from_basepoint(&countersignatory_basepoint_conv, per_commitment_point_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_RecentPaymentDetails_abandoned(int8_tArray payment_id, int8_tArray payment_hash) { - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); - *ret_copy = RecentPaymentDetails_abandoned(payment_id_ref, payment_hash_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); +int64_t CS_LDK_HtlcKey_from_secret_key(int8_tArray sk) { + uint8_t sk_arr[32]; + CHECK(sk->arr_len == 32); + memcpy(sk_arr, sk->elems, 32); FREE(sk); + uint8_t (*sk_ref)[32] = &sk_arr; + LDKHtlcKey ret_var = HtlcKey_from_secret_key(sk_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -void CS_LDK_PhantomRouteHints_free(int64_t this_obj) { - LDKPhantomRouteHints this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PhantomRouteHints_free(this_obj_conv); +int8_tArray CS_LDK_HtlcKey_to_public_key(int64_t this_arg) { + LDKHtlcKey this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, HtlcKey_to_public_key(&this_arg_conv).compressed_form, 33); + return ret_arr; } -int64_tArray CS_LDK_PhantomRouteHints_get_channels(int64_t this_ptr) { - LDKPhantomRouteHints this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_ChannelDetailsZ ret_var = PhantomRouteHints_get_channels(&this_ptr_conv); - 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 q = 0; q < ret_var.datalen; q++) { - LDKChannelDetails ret_conv_16_var = ret_var.data[q]; - int64_t ret_conv_16_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); - ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned); - ret_arr_ptr[q] = ret_conv_16_ref; - } - - FREE(ret_var.data); +int8_tArray CS_LDK_HtlcKey_write(int64_t obj) { + LDKHtlcKey obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = HtlcKey_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); return ret_arr; } -void CS_LDK_PhantomRouteHints_set_channels(int64_t this_ptr, int64_tArray val) { - LDKPhantomRouteHints this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_ChannelDetailsZ val_constr; - val_constr.datalen = val->arr_len; - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = val->elems; - for (size_t q = 0; q < val_constr.datalen; q++) { - int64_t val_conv_16 = val_vals[q]; - LDKChannelDetails val_conv_16_conv; - val_conv_16_conv.inner = untag_ptr(val_conv_16); - val_conv_16_conv.is_owned = ptr_is_owned(val_conv_16); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv); - val_conv_16_conv = ChannelDetails_clone(&val_conv_16_conv); - val_constr.data[q] = val_conv_16_conv; - } - FREE(val); - PhantomRouteHints_set_channels(&this_ptr_conv, val_constr); +int64_t CS_LDK_HtlcKey_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_HtlcKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcKeyDecodeErrorZ), "LDKCResult_HtlcKeyDecodeErrorZ"); + *ret_conv = HtlcKey_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -int64_t CS_LDK_PhantomRouteHints_get_phantom_scid(int64_t this_ptr) { - LDKPhantomRouteHints this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = PhantomRouteHints_get_phantom_scid(&this_ptr_conv); - return ret_conv; +int8_tArray CS_LDK_add_public_key_tweak(int8_tArray base_point, int8_tArray tweak) { + LDKPublicKey base_point_ref; + CHECK(base_point->arr_len == 33); + memcpy(base_point_ref.compressed_form, base_point->elems, 33); FREE(base_point); + uint8_t tweak_arr[32]; + CHECK(tweak->arr_len == 32); + memcpy(tweak_arr, tweak->elems, 32); FREE(tweak); + uint8_t (*tweak_ref)[32] = &tweak_arr; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, add_public_key_tweak(base_point_ref, tweak_ref).compressed_form, 33); + return ret_arr; } -void CS_LDK_PhantomRouteHints_set_phantom_scid(int64_t this_ptr, int64_t val) { - LDKPhantomRouteHints this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - PhantomRouteHints_set_phantom_scid(&this_ptr_conv, val); +void CS_LDK_RevocationBasepoint_free(int64_t this_obj) { + LDKRevocationBasepoint this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + RevocationBasepoint_free(this_obj_conv); } -int8_tArray CS_LDK_PhantomRouteHints_get_real_node_pubkey(int64_t this_ptr) { - LDKPhantomRouteHints this_ptr_conv; +int8_tArray CS_LDK_RevocationBasepoint_get_a(int64_t this_ptr) { + LDKRevocationBasepoint this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, PhantomRouteHints_get_real_node_pubkey(&this_ptr_conv).compressed_form, 33); + memcpy(ret_arr->elems, RevocationBasepoint_get_a(&this_ptr_conv).compressed_form, 33); return ret_arr; } -void CS_LDK_PhantomRouteHints_set_real_node_pubkey(int64_t this_ptr, int8_tArray val) { - LDKPhantomRouteHints this_ptr_conv; +void CS_LDK_RevocationBasepoint_set_a(int64_t this_ptr, int8_tArray val) { + LDKRevocationBasepoint this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -42188,1213 +44041,882 @@ void CS_LDK_PhantomRouteHints_set_real_node_pubkey(int64_t this_ptr, int8_tArra LDKPublicKey val_ref; CHECK(val->arr_len == 33); memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - PhantomRouteHints_set_real_node_pubkey(&this_ptr_conv, val_ref); + RevocationBasepoint_set_a(&this_ptr_conv, val_ref); } -int64_t CS_LDK_PhantomRouteHints_new(int64_tArray channels_arg, int64_t phantom_scid_arg, int8_tArray real_node_pubkey_arg) { - LDKCVec_ChannelDetailsZ channels_arg_constr; - channels_arg_constr.datalen = channels_arg->arr_len; - if (channels_arg_constr.datalen > 0) - channels_arg_constr.data = MALLOC(channels_arg_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); - else - channels_arg_constr.data = NULL; - int64_t* channels_arg_vals = channels_arg->elems; - for (size_t q = 0; q < channels_arg_constr.datalen; q++) { - int64_t channels_arg_conv_16 = channels_arg_vals[q]; - LDKChannelDetails channels_arg_conv_16_conv; - channels_arg_conv_16_conv.inner = untag_ptr(channels_arg_conv_16); - channels_arg_conv_16_conv.is_owned = ptr_is_owned(channels_arg_conv_16); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channels_arg_conv_16_conv); - channels_arg_conv_16_conv = ChannelDetails_clone(&channels_arg_conv_16_conv); - channels_arg_constr.data[q] = channels_arg_conv_16_conv; - } - FREE(channels_arg); - LDKPublicKey real_node_pubkey_arg_ref; - CHECK(real_node_pubkey_arg->arr_len == 33); - memcpy(real_node_pubkey_arg_ref.compressed_form, real_node_pubkey_arg->elems, 33); FREE(real_node_pubkey_arg); - LDKPhantomRouteHints ret_var = PhantomRouteHints_new(channels_arg_constr, phantom_scid_arg, real_node_pubkey_arg_ref); +int64_t CS_LDK_RevocationBasepoint_new(int8_tArray a_arg) { + LDKPublicKey a_arg_ref; + CHECK(a_arg->arr_len == 33); + memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg); + LDKRevocationBasepoint ret_var = RevocationBasepoint_new(a_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t PhantomRouteHints_clone_ptr(LDKPhantomRouteHints *NONNULL_PTR arg) { - LDKPhantomRouteHints ret_var = PhantomRouteHints_clone(arg); +jboolean CS_LDK_RevocationBasepoint_eq(int64_t a, int64_t b) { + LDKRevocationBasepoint a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKRevocationBasepoint b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = RevocationBasepoint_eq(&a_conv, &b_conv); + return ret_conv; +} + +static inline uint64_t RevocationBasepoint_clone_ptr(LDKRevocationBasepoint *NONNULL_PTR arg) { + LDKRevocationBasepoint ret_var = RevocationBasepoint_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_PhantomRouteHints_clone_ptr(int64_t arg) { - LDKPhantomRouteHints arg_conv; +int64_t CS_LDK_RevocationBasepoint_clone_ptr(int64_t arg) { + LDKRevocationBasepoint arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = PhantomRouteHints_clone_ptr(&arg_conv); + int64_t ret_conv = RevocationBasepoint_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_PhantomRouteHints_clone(int64_t orig) { - LDKPhantomRouteHints orig_conv; +int64_t CS_LDK_RevocationBasepoint_clone(int64_t orig) { + LDKRevocationBasepoint orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKPhantomRouteHints ret_var = PhantomRouteHints_clone(&orig_conv); + LDKRevocationBasepoint ret_var = RevocationBasepoint_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_ChannelManager_new(int64_t fee_est, int64_t chain_monitor, int64_t tx_broadcaster, int64_t router, int64_t logger, int64_t entropy_source, int64_t node_signer, int64_t signer_provider, int64_t config, int64_t params, int32_t current_timestamp) { - void* fee_est_ptr = untag_ptr(fee_est); - CHECK_ACCESS(fee_est_ptr); - LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)(fee_est_ptr); - if (fee_est_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&fee_est_conv); - } - void* chain_monitor_ptr = untag_ptr(chain_monitor); - CHECK_ACCESS(chain_monitor_ptr); - LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr); - if (chain_monitor_conv.free == LDKWatch_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKWatch_JCalls_cloned(&chain_monitor_conv); - } - void* tx_broadcaster_ptr = untag_ptr(tx_broadcaster); - CHECK_ACCESS(tx_broadcaster_ptr); - LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr); - if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv); - } - void* router_ptr = untag_ptr(router); - CHECK_ACCESS(router_ptr); - LDKRouter router_conv = *(LDKRouter*)(router_ptr); - if (router_conv.free == LDKRouter_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKRouter_JCalls_cloned(&router_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* signer_provider_ptr = untag_ptr(signer_provider); - CHECK_ACCESS(signer_provider_ptr); - LDKSignerProvider signer_provider_conv = *(LDKSignerProvider*)(signer_provider_ptr); - if (signer_provider_conv.free == LDKSignerProvider_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKSignerProvider_JCalls_cloned(&signer_provider_conv); - } - LDKUserConfig config_conv; - config_conv.inner = untag_ptr(config); - config_conv.is_owned = ptr_is_owned(config); - CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv); - config_conv = UserConfig_clone(&config_conv); - LDKChainParameters params_conv; - params_conv.inner = untag_ptr(params); - params_conv.is_owned = ptr_is_owned(params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); - params_conv = ChainParameters_clone(¶ms_conv); - LDKChannelManager ret_var = ChannelManager_new(fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, router_conv, logger_conv, entropy_source_conv, node_signer_conv, signer_provider_conv, config_conv, params_conv, current_timestamp); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +int64_t CS_LDK_RevocationBasepoint_hash(int64_t o) { + LDKRevocationBasepoint o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = RevocationBasepoint_hash(&o_conv); + return ret_conv; } -int64_t CS_LDK_ChannelManager_get_current_default_configuration(int64_t this_arg) { - LDKChannelManager this_arg_conv; +int8_tArray CS_LDK_RevocationBasepoint_to_public_key(int64_t this_arg) { + LDKRevocationBasepoint this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKUserConfig ret_var = ChannelManager_get_current_default_configuration(&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 ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, RevocationBasepoint_to_public_key(&this_arg_conv).compressed_form, 33); + return ret_arr; } -int64_t CS_LDK_ChannelManager_create_channel(int64_t this_arg, int8_tArray their_network_key, int64_t channel_value_satoshis, int64_t push_msat, int8_tArray user_channel_id, int64_t temporary_channel_id, int64_t override_config) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPublicKey their_network_key_ref; - CHECK(their_network_key->arr_len == 33); - memcpy(their_network_key_ref.compressed_form, their_network_key->elems, 33); FREE(their_network_key); - LDKU128 user_channel_id_ref; - CHECK(user_channel_id->arr_len == 16); - memcpy(user_channel_id_ref.le_bytes, user_channel_id->elems, 16); FREE(user_channel_id); - LDKChannelId temporary_channel_id_conv; - temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); - temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); - temporary_channel_id_conv = ChannelId_clone(&temporary_channel_id_conv); - LDKUserConfig override_config_conv; - override_config_conv.inner = untag_ptr(override_config); - override_config_conv.is_owned = ptr_is_owned(override_config); - CHECK_INNER_FIELD_ACCESS_OR_NULL(override_config_conv); - override_config_conv = UserConfig_clone(&override_config_conv); - LDKCResult_ChannelIdAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdAPIErrorZ), "LDKCResult_ChannelIdAPIErrorZ"); - *ret_conv = ChannelManager_create_channel(&this_arg_conv, their_network_key_ref, channel_value_satoshis, push_msat, user_channel_id_ref, temporary_channel_id_conv, override_config_conv); +int8_tArray CS_LDK_RevocationBasepoint_write(int64_t obj) { + LDKRevocationBasepoint obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = RevocationBasepoint_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_RevocationBasepoint_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_RevocationBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationBasepointDecodeErrorZ), "LDKCResult_RevocationBasepointDecodeErrorZ"); + *ret_conv = RevocationBasepoint_read(ser_ref); + FREE(ser); return tag_ptr(ret_conv, true); } -int64_tArray CS_LDK_ChannelManager_list_channels(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; - LDKCVec_ChannelDetailsZ ret_var = ChannelManager_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 q = 0; q < ret_var.datalen; q++) { - LDKChannelDetails ret_conv_16_var = ret_var.data[q]; - int64_t ret_conv_16_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); - ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned); - ret_arr_ptr[q] = ret_conv_16_ref; - } - - FREE(ret_var.data); - return ret_arr; +void CS_LDK_RevocationKey_free(int64_t this_obj) { + LDKRevocationKey this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + RevocationKey_free(this_obj_conv); } -int64_tArray CS_LDK_ChannelManager_list_usable_channels(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; - LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_usable_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 q = 0; q < ret_var.datalen; q++) { - LDKChannelDetails ret_conv_16_var = ret_var.data[q]; - int64_t ret_conv_16_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); - ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned); - ret_arr_ptr[q] = ret_conv_16_ref; - } - - FREE(ret_var.data); +int8_tArray CS_LDK_RevocationKey_get_a(int64_t this_ptr) { + LDKRevocationKey this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, RevocationKey_get_a(&this_ptr_conv).compressed_form, 33); return ret_arr; } -int64_tArray CS_LDK_ChannelManager_list_channels_with_counterparty(int64_t this_arg, int8_tArray counterparty_node_id) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPublicKey counterparty_node_id_ref; - CHECK(counterparty_node_id->arr_len == 33); - memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); - LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_channels_with_counterparty(&this_arg_conv, counterparty_node_id_ref); - 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 q = 0; q < ret_var.datalen; q++) { - LDKChannelDetails ret_conv_16_var = ret_var.data[q]; - int64_t ret_conv_16_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); - ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned); - ret_arr_ptr[q] = ret_conv_16_ref; - } - - FREE(ret_var.data); - return ret_arr; +void CS_LDK_RevocationKey_set_a(int64_t this_ptr, int8_tArray val) { + LDKRevocationKey this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + RevocationKey_set_a(&this_ptr_conv, val_ref); } -int64_tArray CS_LDK_ChannelManager_list_recent_payments(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; - LDKCVec_RecentPaymentDetailsZ ret_var = ChannelManager_list_recent_payments(&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 w = 0; w < ret_var.datalen; w++) { - LDKRecentPaymentDetails *ret_conv_22_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); - *ret_conv_22_copy = ret_var.data[w]; - int64_t ret_conv_22_ref = tag_ptr(ret_conv_22_copy, true); - ret_arr_ptr[w] = ret_conv_22_ref; - } - - FREE(ret_var.data); - return ret_arr; +int64_t CS_LDK_RevocationKey_new(int8_tArray a_arg) { + LDKPublicKey a_arg_ref; + CHECK(a_arg->arr_len == 33); + memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg); + LDKRevocationKey ret_var = RevocationKey_new(a_arg_ref); + int64_t ret_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_RevocationKey_eq(int64_t a, int64_t b) { + LDKRevocationKey a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKRevocationKey b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = RevocationKey_eq(&a_conv, &b_conv); + return ret_conv; +} + +static inline uint64_t RevocationKey_clone_ptr(LDKRevocationKey *NONNULL_PTR arg) { + LDKRevocationKey ret_var = RevocationKey_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_RevocationKey_clone_ptr(int64_t arg) { + LDKRevocationKey arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = RevocationKey_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_RevocationKey_clone(int64_t orig) { + LDKRevocationKey orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKRevocationKey ret_var = RevocationKey_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -int64_t CS_LDK_ChannelManager_close_channel(int64_t this_arg, int64_t channel_id, int8_tArray counterparty_node_id) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelId channel_id_conv; - channel_id_conv.inner = untag_ptr(channel_id); - channel_id_conv.is_owned = ptr_is_owned(channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); - channel_id_conv.is_owned = false; - LDKPublicKey counterparty_node_id_ref; - CHECK(counterparty_node_id->arr_len == 33); - memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_close_channel(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_RevocationKey_hash(int64_t o) { + LDKRevocationKey o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = RevocationKey_hash(&o_conv); + return ret_conv; } -int64_t CS_LDK_ChannelManager_close_channel_with_feerate_and_script(int64_t this_arg, int64_t channel_id, int8_tArray counterparty_node_id, int64_t target_feerate_sats_per_1000_weight, int64_t shutdown_script) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelId channel_id_conv; - channel_id_conv.inner = untag_ptr(channel_id); - channel_id_conv.is_owned = ptr_is_owned(channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); - channel_id_conv.is_owned = false; - LDKPublicKey counterparty_node_id_ref; - CHECK(counterparty_node_id->arr_len == 33); - memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); - void* target_feerate_sats_per_1000_weight_ptr = untag_ptr(target_feerate_sats_per_1000_weight); - CHECK_ACCESS(target_feerate_sats_per_1000_weight_ptr); - LDKCOption_u32Z target_feerate_sats_per_1000_weight_conv = *(LDKCOption_u32Z*)(target_feerate_sats_per_1000_weight_ptr); - target_feerate_sats_per_1000_weight_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(target_feerate_sats_per_1000_weight)); - LDKShutdownScript shutdown_script_conv; - shutdown_script_conv.inner = untag_ptr(shutdown_script); - shutdown_script_conv.is_owned = ptr_is_owned(shutdown_script); - CHECK_INNER_FIELD_ACCESS_OR_NULL(shutdown_script_conv); - shutdown_script_conv = ShutdownScript_clone(&shutdown_script_conv); - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_close_channel_with_feerate_and_script(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref, target_feerate_sats_per_1000_weight_conv, shutdown_script_conv); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_RevocationKey_from_basepoint(int64_t countersignatory_basepoint, int8_tArray per_commitment_point) { + LDKRevocationBasepoint countersignatory_basepoint_conv; + countersignatory_basepoint_conv.inner = untag_ptr(countersignatory_basepoint); + countersignatory_basepoint_conv.is_owned = ptr_is_owned(countersignatory_basepoint); + CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_basepoint_conv); + countersignatory_basepoint_conv.is_owned = false; + LDKPublicKey per_commitment_point_ref; + CHECK(per_commitment_point->arr_len == 33); + memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point); + LDKRevocationKey ret_var = RevocationKey_from_basepoint(&countersignatory_basepoint_conv, per_commitment_point_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -int64_t CS_LDK_ChannelManager_force_close_broadcasting_latest_txn(int64_t this_arg, int64_t channel_id, int8_tArray counterparty_node_id) { - LDKChannelManager this_arg_conv; +int8_tArray CS_LDK_RevocationKey_to_public_key(int64_t this_arg) { + LDKRevocationKey this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKChannelId channel_id_conv; - channel_id_conv.inner = untag_ptr(channel_id); - channel_id_conv.is_owned = ptr_is_owned(channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); - channel_id_conv.is_owned = false; - LDKPublicKey counterparty_node_id_ref; - CHECK(counterparty_node_id->arr_len == 33); - memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_force_close_broadcasting_latest_txn(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref); - return tag_ptr(ret_conv, true); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, RevocationKey_to_public_key(&this_arg_conv).compressed_form, 33); + return ret_arr; } -int64_t CS_LDK_ChannelManager_force_close_without_broadcasting_txn(int64_t this_arg, int64_t channel_id, int8_tArray counterparty_node_id) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelId channel_id_conv; - channel_id_conv.inner = untag_ptr(channel_id); - channel_id_conv.is_owned = ptr_is_owned(channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); - channel_id_conv.is_owned = false; - LDKPublicKey counterparty_node_id_ref; - CHECK(counterparty_node_id->arr_len == 33); - memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_force_close_without_broadcasting_txn(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref); +int8_tArray CS_LDK_RevocationKey_write(int64_t obj) { + LDKRevocationKey obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = RevocationKey_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_RevocationKey_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_RevocationKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationKeyDecodeErrorZ), "LDKCResult_RevocationKeyDecodeErrorZ"); + *ret_conv = RevocationKey_read(ser_ref); + FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_ChannelManager_force_close_all_channels_broadcasting_latest_txn(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; - ChannelManager_force_close_all_channels_broadcasting_latest_txn(&this_arg_conv); +int32_t CS_LDK_InboundHTLCStateDetails_clone(int64_t orig) { + LDKInboundHTLCStateDetails* orig_conv = (LDKInboundHTLCStateDetails*)untag_ptr(orig); + int32_t ret_conv = LDKInboundHTLCStateDetails_to_cs(InboundHTLCStateDetails_clone(orig_conv)); + return ret_conv; } -void CS_LDK_ChannelManager_force_close_all_channels_without_broadcasting_txn(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; - ChannelManager_force_close_all_channels_without_broadcasting_txn(&this_arg_conv); +int32_t CS_LDK_InboundHTLCStateDetails_awaiting_remote_revoke_to_add() { + int32_t ret_conv = LDKInboundHTLCStateDetails_to_cs(InboundHTLCStateDetails_awaiting_remote_revoke_to_add()); + return ret_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) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKRoute route_conv; - route_conv.inner = untag_ptr(route); - route_conv.is_owned = ptr_is_owned(route); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); - route_conv.is_owned = false; - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - LDKRecipientOnionFields recipient_onion_conv; - recipient_onion_conv.inner = untag_ptr(recipient_onion); - recipient_onion_conv.is_owned = ptr_is_owned(recipient_onion); - CHECK_INNER_FIELD_ACCESS_OR_NULL(recipient_onion_conv); - recipient_onion_conv = RecipientOnionFields_clone(&recipient_onion_conv); - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); - *ret_conv = ChannelManager_send_payment_with_route(&this_arg_conv, &route_conv, payment_hash_ref, recipient_onion_conv, payment_id_ref); - return tag_ptr(ret_conv, true); +int32_t CS_LDK_InboundHTLCStateDetails_committed() { + int32_t ret_conv = LDKInboundHTLCStateDetails_to_cs(InboundHTLCStateDetails_committed()); + return ret_conv; } -int64_t CS_LDK_ChannelManager_send_payment(int64_t this_arg, int8_tArray payment_hash, int64_t recipient_onion, int8_tArray payment_id, int64_t route_params, int64_t retry_strategy) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - LDKRecipientOnionFields recipient_onion_conv; - recipient_onion_conv.inner = untag_ptr(recipient_onion); - recipient_onion_conv.is_owned = ptr_is_owned(recipient_onion); - CHECK_INNER_FIELD_ACCESS_OR_NULL(recipient_onion_conv); - recipient_onion_conv = RecipientOnionFields_clone(&recipient_onion_conv); - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - LDKRouteParameters route_params_conv; - route_params_conv.inner = untag_ptr(route_params); - route_params_conv.is_owned = ptr_is_owned(route_params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); - route_params_conv = RouteParameters_clone(&route_params_conv); - void* retry_strategy_ptr = untag_ptr(retry_strategy); - CHECK_ACCESS(retry_strategy_ptr); - LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr); - retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy)); - LDKCResult_NoneRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneRetryableSendFailureZ), "LDKCResult_NoneRetryableSendFailureZ"); - *ret_conv = ChannelManager_send_payment(&this_arg_conv, payment_hash_ref, recipient_onion_conv, payment_id_ref, route_params_conv, retry_strategy_conv); - return tag_ptr(ret_conv, true); +int32_t CS_LDK_InboundHTLCStateDetails_awaiting_remote_revoke_to_remove_fulfill() { + int32_t ret_conv = LDKInboundHTLCStateDetails_to_cs(InboundHTLCStateDetails_awaiting_remote_revoke_to_remove_fulfill()); + return ret_conv; } -void CS_LDK_ChannelManager_abandon_payment(int64_t this_arg, int8_tArray payment_id) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - ChannelManager_abandon_payment(&this_arg_conv, payment_id_ref); +int32_t CS_LDK_InboundHTLCStateDetails_awaiting_remote_revoke_to_remove_fail() { + int32_t ret_conv = LDKInboundHTLCStateDetails_to_cs(InboundHTLCStateDetails_awaiting_remote_revoke_to_remove_fail()); + return ret_conv; } -int64_t CS_LDK_ChannelManager_send_spontaneous_payment(int64_t this_arg, int64_t route, int64_t payment_preimage, int64_t recipient_onion, int8_tArray payment_id) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKRoute route_conv; - route_conv.inner = untag_ptr(route); - route_conv.is_owned = ptr_is_owned(route); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); - route_conv.is_owned = false; - void* payment_preimage_ptr = untag_ptr(payment_preimage); - CHECK_ACCESS(payment_preimage_ptr); - LDKCOption_ThirtyTwoBytesZ payment_preimage_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_preimage_ptr); - payment_preimage_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_preimage)); - LDKRecipientOnionFields recipient_onion_conv; - recipient_onion_conv.inner = untag_ptr(recipient_onion); - recipient_onion_conv.is_owned = ptr_is_owned(recipient_onion); - CHECK_INNER_FIELD_ACCESS_OR_NULL(recipient_onion_conv); - recipient_onion_conv = RecipientOnionFields_clone(&recipient_onion_conv); - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - LDKCResult_ThirtyTwoBytesPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesPaymentSendFailureZ), "LDKCResult_ThirtyTwoBytesPaymentSendFailureZ"); - *ret_conv = ChannelManager_send_spontaneous_payment(&this_arg_conv, &route_conv, payment_preimage_conv, recipient_onion_conv, payment_id_ref); - return tag_ptr(ret_conv, true); +int8_tArray CS_LDK_InboundHTLCStateDetails_write(int64_t obj) { + LDKInboundHTLCStateDetails* obj_conv = (LDKInboundHTLCStateDetails*)untag_ptr(obj); + LDKCVec_u8Z ret_var = InboundHTLCStateDetails_write(obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -int64_t CS_LDK_ChannelManager_send_spontaneous_payment_with_retry(int64_t this_arg, int64_t payment_preimage, int64_t recipient_onion, int8_tArray payment_id, int64_t route_params, int64_t retry_strategy) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - void* payment_preimage_ptr = untag_ptr(payment_preimage); - CHECK_ACCESS(payment_preimage_ptr); - LDKCOption_ThirtyTwoBytesZ payment_preimage_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_preimage_ptr); - payment_preimage_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_preimage)); - LDKRecipientOnionFields recipient_onion_conv; - recipient_onion_conv.inner = untag_ptr(recipient_onion); - recipient_onion_conv.is_owned = ptr_is_owned(recipient_onion); - CHECK_INNER_FIELD_ACCESS_OR_NULL(recipient_onion_conv); - recipient_onion_conv = RecipientOnionFields_clone(&recipient_onion_conv); - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - LDKRouteParameters route_params_conv; - route_params_conv.inner = untag_ptr(route_params); - route_params_conv.is_owned = ptr_is_owned(route_params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); - route_params_conv = RouteParameters_clone(&route_params_conv); - void* retry_strategy_ptr = untag_ptr(retry_strategy); - CHECK_ACCESS(retry_strategy_ptr); - LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr); - retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy)); - LDKCResult_ThirtyTwoBytesRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesRetryableSendFailureZ), "LDKCResult_ThirtyTwoBytesRetryableSendFailureZ"); - *ret_conv = ChannelManager_send_spontaneous_payment_with_retry(&this_arg_conv, payment_preimage_conv, recipient_onion_conv, payment_id_ref, route_params_conv, retry_strategy_conv); +int64_t CS_LDK_InboundHTLCStateDetails_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ), "LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ"); + *ret_conv = InboundHTLCStateDetails_read(ser_ref); + FREE(ser); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelManager_send_probe(int64_t this_arg, int64_t path) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPath path_conv; - path_conv.inner = untag_ptr(path); - path_conv.is_owned = ptr_is_owned(path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); - path_conv = Path_clone(&path_conv); - LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ), "LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ"); - *ret_conv = ChannelManager_send_probe(&this_arg_conv, path_conv); - return tag_ptr(ret_conv, true); +void CS_LDK_InboundHTLCDetails_free(int64_t this_obj) { + LDKInboundHTLCDetails this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InboundHTLCDetails_free(this_obj_conv); } -int64_t CS_LDK_ChannelManager_send_spontaneous_preflight_probes(int64_t this_arg, int8_tArray node_id, int64_t amount_msat, int32_t final_cltv_expiry_delta, int64_t liquidity_limit_multiplier) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - void* liquidity_limit_multiplier_ptr = untag_ptr(liquidity_limit_multiplier); - CHECK_ACCESS(liquidity_limit_multiplier_ptr); - LDKCOption_u64Z liquidity_limit_multiplier_conv = *(LDKCOption_u64Z*)(liquidity_limit_multiplier_ptr); - liquidity_limit_multiplier_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(liquidity_limit_multiplier)); - LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ), "LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ"); - *ret_conv = ChannelManager_send_spontaneous_preflight_probes(&this_arg_conv, node_id_ref, amount_msat, final_cltv_expiry_delta, liquidity_limit_multiplier_conv); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_InboundHTLCDetails_get_htlc_id(int64_t this_ptr) { + LDKInboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = InboundHTLCDetails_get_htlc_id(&this_ptr_conv); + return ret_conv; } -int64_t CS_LDK_ChannelManager_send_preflight_probes(int64_t this_arg, int64_t route_params, int64_t liquidity_limit_multiplier) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKRouteParameters route_params_conv; - route_params_conv.inner = untag_ptr(route_params); - route_params_conv.is_owned = ptr_is_owned(route_params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); - route_params_conv = RouteParameters_clone(&route_params_conv); - void* liquidity_limit_multiplier_ptr = untag_ptr(liquidity_limit_multiplier); - CHECK_ACCESS(liquidity_limit_multiplier_ptr); - LDKCOption_u64Z liquidity_limit_multiplier_conv = *(LDKCOption_u64Z*)(liquidity_limit_multiplier_ptr); - liquidity_limit_multiplier_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(liquidity_limit_multiplier)); - LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ), "LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ"); - *ret_conv = ChannelManager_send_preflight_probes(&this_arg_conv, route_params_conv, liquidity_limit_multiplier_conv); - return tag_ptr(ret_conv, true); +void CS_LDK_InboundHTLCDetails_set_htlc_id(int64_t this_ptr, int64_t val) { + LDKInboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + InboundHTLCDetails_set_htlc_id(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelManager_funding_transaction_generated(int64_t this_arg, int64_t temporary_channel_id, int8_tArray counterparty_node_id, int8_tArray funding_transaction) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelId temporary_channel_id_conv; - temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); - temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); - temporary_channel_id_conv.is_owned = false; - LDKPublicKey counterparty_node_id_ref; - CHECK(counterparty_node_id->arr_len == 33); - memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); - LDKTransaction funding_transaction_ref; - funding_transaction_ref.datalen = funding_transaction->arr_len; - funding_transaction_ref.data = MALLOC(funding_transaction_ref.datalen, "LDKTransaction Bytes"); - memcpy(funding_transaction_ref.data, funding_transaction->elems, funding_transaction_ref.datalen); FREE(funding_transaction); - funding_transaction_ref.data_is_owned = true; - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_funding_transaction_generated(&this_arg_conv, &temporary_channel_id_conv, counterparty_node_id_ref, funding_transaction_ref); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_InboundHTLCDetails_get_amount_msat(int64_t this_ptr) { + LDKInboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = InboundHTLCDetails_get_amount_msat(&this_ptr_conv); + return ret_conv; } -int64_t CS_LDK_ChannelManager_batch_funding_transaction_generated(int64_t this_arg, int64_tArray temporary_channels, int8_tArray funding_transaction) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_C2Tuple_ChannelIdPublicKeyZZ temporary_channels_constr; - temporary_channels_constr.datalen = temporary_channels->arr_len; - if (temporary_channels_constr.datalen > 0) - temporary_channels_constr.data = MALLOC(temporary_channels_constr.datalen * sizeof(LDKC2Tuple_ChannelIdPublicKeyZ), "LDKCVec_C2Tuple_ChannelIdPublicKeyZZ Elements"); - else - temporary_channels_constr.data = NULL; - int64_t* temporary_channels_vals = temporary_channels->elems; - for (size_t e = 0; e < temporary_channels_constr.datalen; e++) { - int64_t temporary_channels_conv_30 = temporary_channels_vals[e]; - void* temporary_channels_conv_30_ptr = untag_ptr(temporary_channels_conv_30); - CHECK_ACCESS(temporary_channels_conv_30_ptr); - LDKC2Tuple_ChannelIdPublicKeyZ temporary_channels_conv_30_conv = *(LDKC2Tuple_ChannelIdPublicKeyZ*)(temporary_channels_conv_30_ptr); - temporary_channels_conv_30_conv = C2Tuple_ChannelIdPublicKeyZ_clone((LDKC2Tuple_ChannelIdPublicKeyZ*)untag_ptr(temporary_channels_conv_30)); - temporary_channels_constr.data[e] = temporary_channels_conv_30_conv; - } - FREE(temporary_channels); - LDKTransaction funding_transaction_ref; - funding_transaction_ref.datalen = funding_transaction->arr_len; - funding_transaction_ref.data = MALLOC(funding_transaction_ref.datalen, "LDKTransaction Bytes"); - memcpy(funding_transaction_ref.data, funding_transaction->elems, funding_transaction_ref.datalen); FREE(funding_transaction); - funding_transaction_ref.data_is_owned = true; - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_batch_funding_transaction_generated(&this_arg_conv, temporary_channels_constr, funding_transaction_ref); - return tag_ptr(ret_conv, true); +void CS_LDK_InboundHTLCDetails_set_amount_msat(int64_t this_ptr, int64_t val) { + LDKInboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + InboundHTLCDetails_set_amount_msat(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelManager_update_partial_channel_config(int64_t this_arg, int8_tArray counterparty_node_id, int64_tArray channel_ids, int64_t config_update) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPublicKey counterparty_node_id_ref; - CHECK(counterparty_node_id->arr_len == 33); - memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); - LDKCVec_ChannelIdZ channel_ids_constr; - channel_ids_constr.datalen = channel_ids->arr_len; - if (channel_ids_constr.datalen > 0) - channel_ids_constr.data = MALLOC(channel_ids_constr.datalen * sizeof(LDKChannelId), "LDKCVec_ChannelIdZ Elements"); - else - channel_ids_constr.data = NULL; - int64_t* channel_ids_vals = channel_ids->elems; - for (size_t l = 0; l < channel_ids_constr.datalen; l++) { - int64_t channel_ids_conv_11 = channel_ids_vals[l]; - LDKChannelId channel_ids_conv_11_conv; - channel_ids_conv_11_conv.inner = untag_ptr(channel_ids_conv_11); - channel_ids_conv_11_conv.is_owned = ptr_is_owned(channel_ids_conv_11); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_ids_conv_11_conv); - channel_ids_conv_11_conv = ChannelId_clone(&channel_ids_conv_11_conv); - channel_ids_constr.data[l] = channel_ids_conv_11_conv; - } - FREE(channel_ids); - LDKChannelConfigUpdate config_update_conv; - config_update_conv.inner = untag_ptr(config_update); - config_update_conv.is_owned = ptr_is_owned(config_update); - CHECK_INNER_FIELD_ACCESS_OR_NULL(config_update_conv); - config_update_conv.is_owned = false; - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_update_partial_channel_config(&this_arg_conv, counterparty_node_id_ref, channel_ids_constr, &config_update_conv); - return tag_ptr(ret_conv, true); +int32_t CS_LDK_InboundHTLCDetails_get_cltv_expiry(int64_t this_ptr) { + LDKInboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = InboundHTLCDetails_get_cltv_expiry(&this_ptr_conv); + return ret_conv; } -int64_t CS_LDK_ChannelManager_update_channel_config(int64_t this_arg, int8_tArray counterparty_node_id, int64_tArray channel_ids, int64_t config) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPublicKey counterparty_node_id_ref; - CHECK(counterparty_node_id->arr_len == 33); - memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); - LDKCVec_ChannelIdZ channel_ids_constr; - channel_ids_constr.datalen = channel_ids->arr_len; - if (channel_ids_constr.datalen > 0) - channel_ids_constr.data = MALLOC(channel_ids_constr.datalen * sizeof(LDKChannelId), "LDKCVec_ChannelIdZ Elements"); - else - channel_ids_constr.data = NULL; - int64_t* channel_ids_vals = channel_ids->elems; - for (size_t l = 0; l < channel_ids_constr.datalen; l++) { - int64_t channel_ids_conv_11 = channel_ids_vals[l]; - LDKChannelId channel_ids_conv_11_conv; - channel_ids_conv_11_conv.inner = untag_ptr(channel_ids_conv_11); - channel_ids_conv_11_conv.is_owned = ptr_is_owned(channel_ids_conv_11); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_ids_conv_11_conv); - channel_ids_conv_11_conv = ChannelId_clone(&channel_ids_conv_11_conv); - channel_ids_constr.data[l] = channel_ids_conv_11_conv; - } - FREE(channel_ids); - LDKChannelConfig config_conv; - config_conv.inner = untag_ptr(config); - config_conv.is_owned = ptr_is_owned(config); - CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv); - config_conv.is_owned = false; - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_update_channel_config(&this_arg_conv, counterparty_node_id_ref, channel_ids_constr, &config_conv); - return tag_ptr(ret_conv, true); +void CS_LDK_InboundHTLCDetails_set_cltv_expiry(int64_t this_ptr, int32_t val) { + LDKInboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + InboundHTLCDetails_set_cltv_expiry(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelManager_forward_intercepted_htlc(int64_t this_arg, int8_tArray intercept_id, int64_t next_hop_channel_id, int8_tArray next_node_id, int64_t amt_to_forward_msat) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKThirtyTwoBytes intercept_id_ref; - CHECK(intercept_id->arr_len == 32); - memcpy(intercept_id_ref.data, intercept_id->elems, 32); FREE(intercept_id); - LDKChannelId next_hop_channel_id_conv; - next_hop_channel_id_conv.inner = untag_ptr(next_hop_channel_id); - next_hop_channel_id_conv.is_owned = ptr_is_owned(next_hop_channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(next_hop_channel_id_conv); - next_hop_channel_id_conv.is_owned = false; - LDKPublicKey next_node_id_ref; - CHECK(next_node_id->arr_len == 33); - memcpy(next_node_id_ref.compressed_form, next_node_id->elems, 33); FREE(next_node_id); - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_forward_intercepted_htlc(&this_arg_conv, intercept_id_ref, &next_hop_channel_id_conv, next_node_id_ref, amt_to_forward_msat); - return tag_ptr(ret_conv, true); +int8_tArray CS_LDK_InboundHTLCDetails_get_payment_hash(int64_t this_ptr) { + LDKInboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *InboundHTLCDetails_get_payment_hash(&this_ptr_conv), 32); + return ret_arr; } -int64_t CS_LDK_ChannelManager_fail_intercepted_htlc(int64_t this_arg, int8_tArray intercept_id) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKThirtyTwoBytes intercept_id_ref; - CHECK(intercept_id->arr_len == 32); - memcpy(intercept_id_ref.data, intercept_id->elems, 32); FREE(intercept_id); - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_fail_intercepted_htlc(&this_arg_conv, intercept_id_ref); - return tag_ptr(ret_conv, true); +void CS_LDK_InboundHTLCDetails_set_payment_hash(int64_t this_ptr, int8_tArray val) { + LDKInboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + InboundHTLCDetails_set_payment_hash(&this_ptr_conv, val_ref); } -void CS_LDK_ChannelManager_process_pending_htlc_forwards(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; - ChannelManager_process_pending_htlc_forwards(&this_arg_conv); +int64_t CS_LDK_InboundHTLCDetails_get_state(int64_t this_ptr) { + LDKInboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_InboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_InboundHTLCStateDetailsZ), "LDKCOption_InboundHTLCStateDetailsZ"); + *ret_copy = InboundHTLCDetails_get_state(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_ChannelManager_timer_tick_occurred(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; - ChannelManager_timer_tick_occurred(&this_arg_conv); +void CS_LDK_InboundHTLCDetails_set_state(int64_t this_ptr, int64_t val) { + LDKInboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_InboundHTLCStateDetailsZ val_conv = *(LDKCOption_InboundHTLCStateDetailsZ*)(val_ptr); + val_conv = COption_InboundHTLCStateDetailsZ_clone((LDKCOption_InboundHTLCStateDetailsZ*)untag_ptr(val)); + InboundHTLCDetails_set_state(&this_ptr_conv, val_conv); } -void CS_LDK_ChannelManager_fail_htlc_backwards(int64_t this_arg, int8_tArray payment_hash) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - uint8_t payment_hash_arr[32]; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_arr, payment_hash->elems, 32); FREE(payment_hash); - uint8_t (*payment_hash_ref)[32] = &payment_hash_arr; - ChannelManager_fail_htlc_backwards(&this_arg_conv, payment_hash_ref); +jboolean CS_LDK_InboundHTLCDetails_get_is_dust(int64_t this_ptr) { + LDKInboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + jboolean ret_conv = InboundHTLCDetails_get_is_dust(&this_ptr_conv); + return ret_conv; } -void CS_LDK_ChannelManager_fail_htlc_backwards_with_reason(int64_t this_arg, int8_tArray payment_hash, int64_t failure_code) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - uint8_t payment_hash_arr[32]; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_arr, payment_hash->elems, 32); FREE(payment_hash); - uint8_t (*payment_hash_ref)[32] = &payment_hash_arr; - void* failure_code_ptr = untag_ptr(failure_code); - CHECK_ACCESS(failure_code_ptr); - LDKFailureCode failure_code_conv = *(LDKFailureCode*)(failure_code_ptr); - failure_code_conv = FailureCode_clone((LDKFailureCode*)untag_ptr(failure_code)); - ChannelManager_fail_htlc_backwards_with_reason(&this_arg_conv, payment_hash_ref, failure_code_conv); +void CS_LDK_InboundHTLCDetails_set_is_dust(int64_t this_ptr, jboolean val) { + LDKInboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + InboundHTLCDetails_set_is_dust(&this_ptr_conv, val); } -void CS_LDK_ChannelManager_claim_funds(int64_t this_arg, int8_tArray payment_preimage) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKThirtyTwoBytes payment_preimage_ref; - CHECK(payment_preimage->arr_len == 32); - memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); - ChannelManager_claim_funds(&this_arg_conv, payment_preimage_ref); +int64_t CS_LDK_InboundHTLCDetails_new(int64_t htlc_id_arg, int64_t amount_msat_arg, int32_t cltv_expiry_arg, int8_tArray payment_hash_arg, int64_t state_arg, jboolean is_dust_arg) { + LDKThirtyTwoBytes payment_hash_arg_ref; + CHECK(payment_hash_arg->arr_len == 32); + memcpy(payment_hash_arg_ref.data, payment_hash_arg->elems, 32); FREE(payment_hash_arg); + void* state_arg_ptr = untag_ptr(state_arg); + CHECK_ACCESS(state_arg_ptr); + LDKCOption_InboundHTLCStateDetailsZ state_arg_conv = *(LDKCOption_InboundHTLCStateDetailsZ*)(state_arg_ptr); + state_arg_conv = COption_InboundHTLCStateDetailsZ_clone((LDKCOption_InboundHTLCStateDetailsZ*)untag_ptr(state_arg)); + LDKInboundHTLCDetails ret_var = InboundHTLCDetails_new(htlc_id_arg, amount_msat_arg, cltv_expiry_arg, payment_hash_arg_ref, state_arg_conv, is_dust_arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_ChannelManager_claim_funds_with_known_custom_tlvs(int64_t this_arg, int8_tArray payment_preimage) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKThirtyTwoBytes payment_preimage_ref; - CHECK(payment_preimage->arr_len == 32); - memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); - ChannelManager_claim_funds_with_known_custom_tlvs(&this_arg_conv, payment_preimage_ref); +static inline uint64_t InboundHTLCDetails_clone_ptr(LDKInboundHTLCDetails *NONNULL_PTR arg) { + LDKInboundHTLCDetails ret_var = InboundHTLCDetails_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_InboundHTLCDetails_clone_ptr(int64_t arg) { + LDKInboundHTLCDetails arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = InboundHTLCDetails_clone_ptr(&arg_conv); + return ret_conv; } -int8_tArray CS_LDK_ChannelManager_get_our_node_id(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; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, ChannelManager_get_our_node_id(&this_arg_conv).compressed_form, 33); +int64_t CS_LDK_InboundHTLCDetails_clone(int64_t orig) { + LDKInboundHTLCDetails orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKInboundHTLCDetails ret_var = InboundHTLCDetails_clone(&orig_conv); + int64_t ret_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_InboundHTLCDetails_write(int64_t obj) { + LDKInboundHTLCDetails obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = InboundHTLCDetails_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_ChannelManager_accept_inbound_channel(int64_t this_arg, int64_t temporary_channel_id, int8_tArray counterparty_node_id, int8_tArray user_channel_id) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelId temporary_channel_id_conv; - temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); - temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); - temporary_channel_id_conv.is_owned = false; - LDKPublicKey counterparty_node_id_ref; - CHECK(counterparty_node_id->arr_len == 33); - memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); - LDKU128 user_channel_id_ref; - CHECK(user_channel_id->arr_len == 16); - memcpy(user_channel_id_ref.le_bytes, user_channel_id->elems, 16); FREE(user_channel_id); - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_accept_inbound_channel(&this_arg_conv, &temporary_channel_id_conv, counterparty_node_id_ref, user_channel_id_ref); +int64_t CS_LDK_InboundHTLCDetails_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_InboundHTLCDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InboundHTLCDetailsDecodeErrorZ), "LDKCResult_InboundHTLCDetailsDecodeErrorZ"); + *ret_conv = InboundHTLCDetails_read(ser_ref); + FREE(ser); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(int64_t this_arg, int64_t temporary_channel_id, int8_tArray counterparty_node_id, int8_tArray user_channel_id) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelId temporary_channel_id_conv; - temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); - temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); - temporary_channel_id_conv.is_owned = false; - LDKPublicKey counterparty_node_id_ref; - CHECK(counterparty_node_id->arr_len == 33); - memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); - LDKU128 user_channel_id_ref; - CHECK(user_channel_id->arr_len == 16); - memcpy(user_channel_id_ref.le_bytes, user_channel_id->elems, 16); FREE(user_channel_id); - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(&this_arg_conv, &temporary_channel_id_conv, counterparty_node_id_ref, user_channel_id_ref); - return tag_ptr(ret_conv, true); +int32_t CS_LDK_OutboundHTLCStateDetails_clone(int64_t orig) { + LDKOutboundHTLCStateDetails* orig_conv = (LDKOutboundHTLCStateDetails*)untag_ptr(orig); + int32_t ret_conv = LDKOutboundHTLCStateDetails_to_cs(OutboundHTLCStateDetails_clone(orig_conv)); + return ret_conv; } -int64_t CS_LDK_ChannelManager_create_offer_builder(int64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ"); - *ret_conv = ChannelManager_create_offer_builder(&this_arg_conv); - return tag_ptr(ret_conv, true); +int32_t CS_LDK_OutboundHTLCStateDetails_awaiting_remote_revoke_to_add() { + int32_t ret_conv = LDKOutboundHTLCStateDetails_to_cs(OutboundHTLCStateDetails_awaiting_remote_revoke_to_add()); + return ret_conv; } -int64_t CS_LDK_ChannelManager_create_refund_builder(int64_t this_arg, int64_t amount_msats, int64_t absolute_expiry, int8_tArray payment_id, int64_t retry_strategy, int64_t max_total_routing_fee_msat) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - void* retry_strategy_ptr = untag_ptr(retry_strategy); - CHECK_ACCESS(retry_strategy_ptr); - LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr); - retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy)); - void* max_total_routing_fee_msat_ptr = untag_ptr(max_total_routing_fee_msat); - CHECK_ACCESS(max_total_routing_fee_msat_ptr); - LDKCOption_u64Z max_total_routing_fee_msat_conv = *(LDKCOption_u64Z*)(max_total_routing_fee_msat_ptr); - max_total_routing_fee_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(max_total_routing_fee_msat)); - LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ"); - *ret_conv = ChannelManager_create_refund_builder(&this_arg_conv, amount_msats, absolute_expiry, payment_id_ref, retry_strategy_conv, max_total_routing_fee_msat_conv); - return tag_ptr(ret_conv, true); +int32_t CS_LDK_OutboundHTLCStateDetails_committed() { + int32_t ret_conv = LDKOutboundHTLCStateDetails_to_cs(OutboundHTLCStateDetails_committed()); + return ret_conv; } -int64_t CS_LDK_ChannelManager_pay_for_offer(int64_t this_arg, int64_t offer, int64_t quantity, int64_t amount_msats, int64_t payer_note, int8_tArray payment_id, int64_t retry_strategy, int64_t max_total_routing_fee_msat) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOffer offer_conv; - offer_conv.inner = untag_ptr(offer); - offer_conv.is_owned = ptr_is_owned(offer); - CHECK_INNER_FIELD_ACCESS_OR_NULL(offer_conv); - offer_conv.is_owned = false; - void* quantity_ptr = untag_ptr(quantity); - CHECK_ACCESS(quantity_ptr); - LDKCOption_u64Z quantity_conv = *(LDKCOption_u64Z*)(quantity_ptr); - quantity_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(quantity)); - void* amount_msats_ptr = untag_ptr(amount_msats); - CHECK_ACCESS(amount_msats_ptr); - LDKCOption_u64Z amount_msats_conv = *(LDKCOption_u64Z*)(amount_msats_ptr); - amount_msats_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amount_msats)); - void* payer_note_ptr = untag_ptr(payer_note); - CHECK_ACCESS(payer_note_ptr); - LDKCOption_StrZ payer_note_conv = *(LDKCOption_StrZ*)(payer_note_ptr); - payer_note_conv = COption_StrZ_clone((LDKCOption_StrZ*)untag_ptr(payer_note)); - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - void* retry_strategy_ptr = untag_ptr(retry_strategy); - CHECK_ACCESS(retry_strategy_ptr); - LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr); - retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy)); - void* max_total_routing_fee_msat_ptr = untag_ptr(max_total_routing_fee_msat); - CHECK_ACCESS(max_total_routing_fee_msat_ptr); - LDKCOption_u64Z max_total_routing_fee_msat_conv = *(LDKCOption_u64Z*)(max_total_routing_fee_msat_ptr); - max_total_routing_fee_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(max_total_routing_fee_msat)); - LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); - *ret_conv = ChannelManager_pay_for_offer(&this_arg_conv, &offer_conv, quantity_conv, amount_msats_conv, payer_note_conv, payment_id_ref, retry_strategy_conv, max_total_routing_fee_msat_conv); - return tag_ptr(ret_conv, true); +int32_t CS_LDK_OutboundHTLCStateDetails_awaiting_remote_revoke_to_remove_success() { + int32_t ret_conv = LDKOutboundHTLCStateDetails_to_cs(OutboundHTLCStateDetails_awaiting_remote_revoke_to_remove_success()); + return ret_conv; } -int64_t CS_LDK_ChannelManager_request_refund_payment(int64_t this_arg, int64_t refund) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKRefund refund_conv; - refund_conv.inner = untag_ptr(refund); - refund_conv.is_owned = ptr_is_owned(refund); - CHECK_INNER_FIELD_ACCESS_OR_NULL(refund_conv); - refund_conv.is_owned = false; - LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ), "LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ"); - *ret_conv = ChannelManager_request_refund_payment(&this_arg_conv, &refund_conv); - return tag_ptr(ret_conv, true); +int32_t CS_LDK_OutboundHTLCStateDetails_awaiting_remote_revoke_to_remove_failure() { + int32_t ret_conv = LDKOutboundHTLCStateDetails_to_cs(OutboundHTLCStateDetails_awaiting_remote_revoke_to_remove_failure()); + return ret_conv; } -int64_t CS_LDK_ChannelManager_create_inbound_payment(int64_t this_arg, int64_t min_value_msat, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - void* min_value_msat_ptr = untag_ptr(min_value_msat); - CHECK_ACCESS(min_value_msat_ptr); - LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); - min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat)); - void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); - CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); - LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); - min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); - LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ), "LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ"); - *ret_conv = ChannelManager_create_inbound_payment(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); - return tag_ptr(ret_conv, true); +int8_tArray CS_LDK_OutboundHTLCStateDetails_write(int64_t obj) { + LDKOutboundHTLCStateDetails* obj_conv = (LDKOutboundHTLCStateDetails*)untag_ptr(obj); + LDKCVec_u8Z ret_var = OutboundHTLCStateDetails_write(obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; } -int64_t CS_LDK_ChannelManager_create_inbound_payment_for_hash(int64_t this_arg, int8_tArray payment_hash, int64_t min_value_msat, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - void* min_value_msat_ptr = untag_ptr(min_value_msat); - CHECK_ACCESS(min_value_msat_ptr); - LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); - min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat)); - void* min_final_cltv_expiry_ptr = untag_ptr(min_final_cltv_expiry); - CHECK_ACCESS(min_final_cltv_expiry_ptr); - LDKCOption_u16Z min_final_cltv_expiry_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_ptr); - min_final_cltv_expiry_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry)); - LDKCResult_ThirtyTwoBytesNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesNoneZ), "LDKCResult_ThirtyTwoBytesNoneZ"); - *ret_conv = ChannelManager_create_inbound_payment_for_hash(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs, min_final_cltv_expiry_conv); +int64_t CS_LDK_OutboundHTLCStateDetails_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ), "LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ"); + *ret_conv = OutboundHTLCStateDetails_read(ser_ref); + FREE(ser); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelManager_get_payment_preimage(int64_t this_arg, int8_tArray payment_hash, int8_tArray payment_secret) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - LDKThirtyTwoBytes payment_secret_ref; - CHECK(payment_secret->arr_len == 32); - memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret); - LDKCResult_ThirtyTwoBytesAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesAPIErrorZ), "LDKCResult_ThirtyTwoBytesAPIErrorZ"); - *ret_conv = ChannelManager_get_payment_preimage(&this_arg_conv, payment_hash_ref, payment_secret_ref); - return tag_ptr(ret_conv, true); +void CS_LDK_OutboundHTLCDetails_free(int64_t this_obj) { + LDKOutboundHTLCDetails this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OutboundHTLCDetails_free(this_obj_conv); } -int64_t CS_LDK_ChannelManager_get_phantom_scid(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; - int64_t ret_conv = ChannelManager_get_phantom_scid(&this_arg_conv); +int64_t CS_LDK_OutboundHTLCDetails_get_htlc_id(int64_t this_ptr) { + LDKOutboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = OutboundHTLCDetails_get_htlc_id(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_OutboundHTLCDetails_set_htlc_id(int64_t this_ptr, int64_t val) { + LDKOutboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + OutboundHTLCDetails_set_htlc_id(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_OutboundHTLCDetails_get_amount_msat(int64_t this_ptr) { + LDKOutboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = OutboundHTLCDetails_get_amount_msat(&this_ptr_conv); return ret_conv; } -int64_t CS_LDK_ChannelManager_get_phantom_route_hints(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; - LDKPhantomRouteHints ret_var = ChannelManager_get_phantom_route_hints(&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_OutboundHTLCDetails_set_amount_msat(int64_t this_ptr, int64_t val) { + LDKOutboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + OutboundHTLCDetails_set_amount_msat(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelManager_get_intercept_scid(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; - int64_t ret_conv = ChannelManager_get_intercept_scid(&this_arg_conv); +int32_t CS_LDK_OutboundHTLCDetails_get_cltv_expiry(int64_t this_ptr) { + LDKOutboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = OutboundHTLCDetails_get_cltv_expiry(&this_ptr_conv); return ret_conv; } -int64_t CS_LDK_ChannelManager_compute_inflight_htlcs(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; - LDKInFlightHtlcs ret_var = ChannelManager_compute_inflight_htlcs(&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_OutboundHTLCDetails_set_cltv_expiry(int64_t this_ptr, int32_t val) { + LDKOutboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + OutboundHTLCDetails_set_cltv_expiry(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelManager_as_MessageSendEventsProvider(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; - LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); - *ret_ret = ChannelManager_as_MessageSendEventsProvider(&this_arg_conv); - return tag_ptr(ret_ret, true); +int8_tArray CS_LDK_OutboundHTLCDetails_get_payment_hash(int64_t this_ptr) { + LDKOutboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *OutboundHTLCDetails_get_payment_hash(&this_ptr_conv), 32); + return ret_arr; } -int64_t CS_LDK_ChannelManager_as_EventsProvider(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; - LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); - *ret_ret = ChannelManager_as_EventsProvider(&this_arg_conv); - return tag_ptr(ret_ret, true); +void CS_LDK_OutboundHTLCDetails_set_payment_hash(int64_t this_ptr, int8_tArray val) { + LDKOutboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + OutboundHTLCDetails_set_payment_hash(&this_ptr_conv, val_ref); } -int64_t CS_LDK_ChannelManager_as_Listen(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; - LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); - *ret_ret = ChannelManager_as_Listen(&this_arg_conv); - return tag_ptr(ret_ret, true); +int64_t CS_LDK_OutboundHTLCDetails_get_state(int64_t this_ptr) { + LDKOutboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_OutboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_OutboundHTLCStateDetailsZ), "LDKCOption_OutboundHTLCStateDetailsZ"); + *ret_copy = OutboundHTLCDetails_get_state(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_ChannelManager_as_Confirm(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; - LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); - *ret_ret = ChannelManager_as_Confirm(&this_arg_conv); - return tag_ptr(ret_ret, true); +void CS_LDK_OutboundHTLCDetails_set_state(int64_t this_ptr, int64_t val) { + LDKOutboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_OutboundHTLCStateDetailsZ val_conv = *(LDKCOption_OutboundHTLCStateDetailsZ*)(val_ptr); + val_conv = COption_OutboundHTLCStateDetailsZ_clone((LDKCOption_OutboundHTLCStateDetailsZ*)untag_ptr(val)); + OutboundHTLCDetails_set_state(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelManager_get_event_or_persistence_needed_future(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; - LDKFuture ret_var = ChannelManager_get_event_or_persistence_needed_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); +int64_t CS_LDK_OutboundHTLCDetails_get_skimmed_fee_msat(int64_t this_ptr) { + LDKOutboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = OutboundHTLCDetails_get_skimmed_fee_msat(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -jboolean CS_LDK_ChannelManager_get_and_clear_needs_persistence(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; - jboolean ret_conv = ChannelManager_get_and_clear_needs_persistence(&this_arg_conv); +void CS_LDK_OutboundHTLCDetails_set_skimmed_fee_msat(int64_t this_ptr, int64_t val) { + LDKOutboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + OutboundHTLCDetails_set_skimmed_fee_msat(&this_ptr_conv, val_conv); +} + +jboolean CS_LDK_OutboundHTLCDetails_get_is_dust(int64_t this_ptr) { + LDKOutboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + jboolean ret_conv = OutboundHTLCDetails_get_is_dust(&this_ptr_conv); return ret_conv; } -int64_t CS_LDK_ChannelManager_current_best_block(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; - LDKBestBlock ret_var = ChannelManager_current_best_block(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +void CS_LDK_OutboundHTLCDetails_set_is_dust(int64_t this_ptr, jboolean val) { + LDKOutboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + OutboundHTLCDetails_set_is_dust(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelManager_node_features(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; - LDKNodeFeatures ret_var = ChannelManager_node_features(&this_arg_conv); +int64_t CS_LDK_OutboundHTLCDetails_new(int64_t htlc_id_arg, int64_t amount_msat_arg, int32_t cltv_expiry_arg, int8_tArray payment_hash_arg, int64_t state_arg, int64_t skimmed_fee_msat_arg, jboolean is_dust_arg) { + void* htlc_id_arg_ptr = untag_ptr(htlc_id_arg); + CHECK_ACCESS(htlc_id_arg_ptr); + LDKCOption_u64Z htlc_id_arg_conv = *(LDKCOption_u64Z*)(htlc_id_arg_ptr); + htlc_id_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_id_arg)); + LDKThirtyTwoBytes payment_hash_arg_ref; + CHECK(payment_hash_arg->arr_len == 32); + memcpy(payment_hash_arg_ref.data, payment_hash_arg->elems, 32); FREE(payment_hash_arg); + void* state_arg_ptr = untag_ptr(state_arg); + CHECK_ACCESS(state_arg_ptr); + LDKCOption_OutboundHTLCStateDetailsZ state_arg_conv = *(LDKCOption_OutboundHTLCStateDetailsZ*)(state_arg_ptr); + state_arg_conv = COption_OutboundHTLCStateDetailsZ_clone((LDKCOption_OutboundHTLCStateDetailsZ*)untag_ptr(state_arg)); + void* skimmed_fee_msat_arg_ptr = untag_ptr(skimmed_fee_msat_arg); + CHECK_ACCESS(skimmed_fee_msat_arg_ptr); + LDKCOption_u64Z skimmed_fee_msat_arg_conv = *(LDKCOption_u64Z*)(skimmed_fee_msat_arg_ptr); + skimmed_fee_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(skimmed_fee_msat_arg)); + LDKOutboundHTLCDetails ret_var = OutboundHTLCDetails_new(htlc_id_arg_conv, amount_msat_arg, cltv_expiry_arg, payment_hash_arg_ref, state_arg_conv, skimmed_fee_msat_arg_conv, is_dust_arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_ChannelManager_channel_features(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; - LDKChannelFeatures ret_var = ChannelManager_channel_features(&this_arg_conv); +static inline uint64_t OutboundHTLCDetails_clone_ptr(LDKOutboundHTLCDetails *NONNULL_PTR arg) { + LDKOutboundHTLCDetails ret_var = OutboundHTLCDetails_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } +int64_t CS_LDK_OutboundHTLCDetails_clone_ptr(int64_t arg) { + LDKOutboundHTLCDetails arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = OutboundHTLCDetails_clone_ptr(&arg_conv); + return ret_conv; +} -int64_t CS_LDK_ChannelManager_channel_type_features(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; - LDKChannelTypeFeatures ret_var = ChannelManager_channel_type_features(&this_arg_conv); +int64_t CS_LDK_OutboundHTLCDetails_clone(int64_t orig) { + LDKOutboundHTLCDetails orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKOutboundHTLCDetails ret_var = OutboundHTLCDetails_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_ChannelManager_init_features(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; - LDKInitFeatures ret_var = ChannelManager_init_features(&this_arg_conv); +int8_tArray CS_LDK_OutboundHTLCDetails_write(int64_t obj) { + LDKOutboundHTLCDetails obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = OutboundHTLCDetails_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_OutboundHTLCDetails_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_OutboundHTLCDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutboundHTLCDetailsDecodeErrorZ), "LDKCResult_OutboundHTLCDetailsDecodeErrorZ"); + *ret_conv = OutboundHTLCDetails_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_CounterpartyForwardingInfo_free(int64_t this_obj) { + LDKCounterpartyForwardingInfo this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + CounterpartyForwardingInfo_free(this_obj_conv); +} + +int32_t CS_LDK_CounterpartyForwardingInfo_get_fee_base_msat(int64_t this_ptr) { + LDKCounterpartyForwardingInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = CounterpartyForwardingInfo_get_fee_base_msat(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_CounterpartyForwardingInfo_set_fee_base_msat(int64_t this_ptr, int32_t val) { + LDKCounterpartyForwardingInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + CounterpartyForwardingInfo_set_fee_base_msat(&this_ptr_conv, val); +} + +int32_t CS_LDK_CounterpartyForwardingInfo_get_fee_proportional_millionths(int64_t this_ptr) { + LDKCounterpartyForwardingInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = CounterpartyForwardingInfo_get_fee_proportional_millionths(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_CounterpartyForwardingInfo_set_fee_proportional_millionths(int64_t this_ptr, int32_t val) { + LDKCounterpartyForwardingInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + CounterpartyForwardingInfo_set_fee_proportional_millionths(&this_ptr_conv, val); +} + +int16_t CS_LDK_CounterpartyForwardingInfo_get_cltv_expiry_delta(int64_t this_ptr) { + LDKCounterpartyForwardingInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int16_t ret_conv = CounterpartyForwardingInfo_get_cltv_expiry_delta(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_CounterpartyForwardingInfo_set_cltv_expiry_delta(int64_t this_ptr, int16_t val) { + LDKCounterpartyForwardingInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + CounterpartyForwardingInfo_set_cltv_expiry_delta(&this_ptr_conv, val); +} + +int64_t CS_LDK_CounterpartyForwardingInfo_new(int32_t fee_base_msat_arg, int32_t fee_proportional_millionths_arg, int16_t cltv_expiry_delta_arg) { + LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_ChannelManager_as_ChannelMessageHandler(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; - LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler"); - *ret_ret = ChannelManager_as_ChannelMessageHandler(&this_arg_conv); - return tag_ptr(ret_ret, true); -} - -int64_t CS_LDK_ChannelManager_as_OffersMessageHandler(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; - LDKOffersMessageHandler* ret_ret = MALLOC(sizeof(LDKOffersMessageHandler), "LDKOffersMessageHandler"); - *ret_ret = ChannelManager_as_OffersMessageHandler(&this_arg_conv); - return tag_ptr(ret_ret, true); +static inline uint64_t CounterpartyForwardingInfo_clone_ptr(LDKCounterpartyForwardingInfo *NONNULL_PTR arg) { + LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } - -int64_t CS_LDK_ChannelManager_as_NodeIdLookUp(int64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeIdLookUp* ret_ret = MALLOC(sizeof(LDKNodeIdLookUp), "LDKNodeIdLookUp"); - *ret_ret = ChannelManager_as_NodeIdLookUp(&this_arg_conv); - return tag_ptr(ret_ret, true); +int64_t CS_LDK_CounterpartyForwardingInfo_clone_ptr(int64_t arg) { + LDKCounterpartyForwardingInfo arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = CounterpartyForwardingInfo_clone_ptr(&arg_conv); + return ret_conv; } -int64_t CS_LDK_provided_init_features(int64_t config) { - LDKUserConfig config_conv; - config_conv.inner = untag_ptr(config); - config_conv.is_owned = ptr_is_owned(config); - CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv); - config_conv.is_owned = false; - LDKInitFeatures ret_var = provided_init_features(&config_conv); +int64_t CS_LDK_CounterpartyForwardingInfo_clone(int64_t orig) { + LDKCounterpartyForwardingInfo orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_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); @@ -43424,1419 +44946,1212 @@ int64_t CS_LDK_CounterpartyForwardingInfo_read(int8_tArray ser) { return tag_ptr(ret_conv, true); } -int8_tArray CS_LDK_ChannelCounterparty_write(int64_t obj) { - LDKChannelCounterparty obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ChannelCounterparty_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); +void CS_LDK_ChannelCounterparty_free(int64_t this_obj) { + LDKChannelCounterparty this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelCounterparty_free(this_obj_conv); +} + +int8_tArray CS_LDK_ChannelCounterparty_get_node_id(int64_t this_ptr) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, ChannelCounterparty_get_node_id(&this_ptr_conv).compressed_form, 33); return ret_arr; } -int64_t CS_LDK_ChannelCounterparty_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); - *ret_conv = ChannelCounterparty_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void CS_LDK_ChannelCounterparty_set_node_id(int64_t this_ptr, int8_tArray val) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + ChannelCounterparty_set_node_id(&this_ptr_conv, val_ref); } -int8_tArray CS_LDK_ChannelDetails_write(int64_t obj) { - LDKChannelDetails obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ChannelDetails_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +int64_t CS_LDK_ChannelCounterparty_get_features(int64_t this_ptr) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKInitFeatures ret_var = ChannelCounterparty_get_features(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -int64_t CS_LDK_ChannelDetails_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); - *ret_conv = ChannelDetails_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void CS_LDK_ChannelCounterparty_set_features(int64_t this_ptr, int64_t val) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKInitFeatures val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = InitFeatures_clone(&val_conv); + ChannelCounterparty_set_features(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_PhantomRouteHints_write(int64_t obj) { - LDKPhantomRouteHints obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = PhantomRouteHints_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +int64_t CS_LDK_ChannelCounterparty_get_unspendable_punishment_reserve(int64_t this_ptr) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ChannelCounterparty_get_unspendable_punishment_reserve(&this_ptr_conv); + return ret_conv; } -int64_t CS_LDK_PhantomRouteHints_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ"); - *ret_conv = PhantomRouteHints_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void CS_LDK_ChannelCounterparty_set_unspendable_punishment_reserve(int64_t this_ptr, int64_t val) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelCounterparty_set_unspendable_punishment_reserve(&this_ptr_conv, val); } -int8_tArray CS_LDK_BlindedForward_write(int64_t obj) { - LDKBlindedForward obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = BlindedForward_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +int64_t CS_LDK_ChannelCounterparty_get_forwarding_info(int64_t this_ptr) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCounterpartyForwardingInfo ret_var = ChannelCounterparty_get_forwarding_info(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -int64_t CS_LDK_BlindedForward_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_BlindedForwardDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedForwardDecodeErrorZ), "LDKCResult_BlindedForwardDecodeErrorZ"); - *ret_conv = BlindedForward_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void CS_LDK_ChannelCounterparty_set_forwarding_info(int64_t this_ptr, int64_t val) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCounterpartyForwardingInfo val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = CounterpartyForwardingInfo_clone(&val_conv); + ChannelCounterparty_set_forwarding_info(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_PendingHTLCRouting_write(int64_t obj) { - LDKPendingHTLCRouting* obj_conv = (LDKPendingHTLCRouting*)untag_ptr(obj); - LDKCVec_u8Z ret_var = PendingHTLCRouting_write(obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +int64_t CS_LDK_ChannelCounterparty_get_outbound_htlc_minimum_msat(int64_t this_ptr) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelCounterparty_get_outbound_htlc_minimum_msat(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_PendingHTLCRouting_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_PendingHTLCRoutingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PendingHTLCRoutingDecodeErrorZ), "LDKCResult_PendingHTLCRoutingDecodeErrorZ"); - *ret_conv = PendingHTLCRouting_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void CS_LDK_ChannelCounterparty_set_outbound_htlc_minimum_msat(int64_t this_ptr, int64_t val) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + ChannelCounterparty_set_outbound_htlc_minimum_msat(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_PendingHTLCInfo_write(int64_t obj) { - LDKPendingHTLCInfo obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = PendingHTLCInfo_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +int64_t CS_LDK_ChannelCounterparty_get_outbound_htlc_maximum_msat(int64_t this_ptr) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelCounterparty_get_outbound_htlc_maximum_msat(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_PendingHTLCInfo_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_PendingHTLCInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PendingHTLCInfoDecodeErrorZ), "LDKCResult_PendingHTLCInfoDecodeErrorZ"); - *ret_conv = PendingHTLCInfo_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void CS_LDK_ChannelCounterparty_set_outbound_htlc_maximum_msat(int64_t this_ptr, int64_t val) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + ChannelCounterparty_set_outbound_htlc_maximum_msat(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_BlindedFailure_write(int64_t obj) { - LDKBlindedFailure* obj_conv = (LDKBlindedFailure*)untag_ptr(obj); - LDKCVec_u8Z ret_var = BlindedFailure_write(obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +int64_t CS_LDK_ChannelCounterparty_new(int8_tArray node_id_arg, int64_t features_arg, int64_t unspendable_punishment_reserve_arg, int64_t forwarding_info_arg, int64_t outbound_htlc_minimum_msat_arg, int64_t outbound_htlc_maximum_msat_arg) { + LDKPublicKey node_id_arg_ref; + CHECK(node_id_arg->arr_len == 33); + memcpy(node_id_arg_ref.compressed_form, node_id_arg->elems, 33); FREE(node_id_arg); + LDKInitFeatures features_arg_conv; + features_arg_conv.inner = untag_ptr(features_arg); + features_arg_conv.is_owned = ptr_is_owned(features_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); + features_arg_conv = InitFeatures_clone(&features_arg_conv); + LDKCounterpartyForwardingInfo forwarding_info_arg_conv; + forwarding_info_arg_conv.inner = untag_ptr(forwarding_info_arg); + forwarding_info_arg_conv.is_owned = ptr_is_owned(forwarding_info_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(forwarding_info_arg_conv); + forwarding_info_arg_conv = CounterpartyForwardingInfo_clone(&forwarding_info_arg_conv); + void* outbound_htlc_minimum_msat_arg_ptr = untag_ptr(outbound_htlc_minimum_msat_arg); + CHECK_ACCESS(outbound_htlc_minimum_msat_arg_ptr); + LDKCOption_u64Z outbound_htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(outbound_htlc_minimum_msat_arg_ptr); + outbound_htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_htlc_minimum_msat_arg)); + void* outbound_htlc_maximum_msat_arg_ptr = untag_ptr(outbound_htlc_maximum_msat_arg); + CHECK_ACCESS(outbound_htlc_maximum_msat_arg_ptr); + LDKCOption_u64Z outbound_htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(outbound_htlc_maximum_msat_arg_ptr); + outbound_htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_htlc_maximum_msat_arg)); + LDKChannelCounterparty ret_var = ChannelCounterparty_new(node_id_arg_ref, features_arg_conv, unspendable_punishment_reserve_arg, forwarding_info_arg_conv, outbound_htlc_minimum_msat_arg_conv, outbound_htlc_maximum_msat_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -int64_t CS_LDK_BlindedFailure_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_BlindedFailureDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedFailureDecodeErrorZ), "LDKCResult_BlindedFailureDecodeErrorZ"); - *ret_conv = BlindedFailure_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +static inline uint64_t ChannelCounterparty_clone_ptr(LDKChannelCounterparty *NONNULL_PTR arg) { + LDKChannelCounterparty ret_var = ChannelCounterparty_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_ChannelCounterparty_clone_ptr(int64_t arg) { + LDKChannelCounterparty arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = ChannelCounterparty_clone_ptr(&arg_conv); + return ret_conv; } -int8_tArray CS_LDK_ChannelManager_write(int64_t obj) { - LDKChannelManager obj_conv; +int64_t CS_LDK_ChannelCounterparty_clone(int64_t orig) { + LDKChannelCounterparty orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKChannelCounterparty ret_var = ChannelCounterparty_clone(&orig_conv); + int64_t ret_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_ChannelCounterparty_write(int64_t obj) { + LDKChannelCounterparty obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ChannelManager_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -int8_tArray CS_LDK_ChannelShutdownState_write(int64_t obj) { - LDKChannelShutdownState* obj_conv = (LDKChannelShutdownState*)untag_ptr(obj); - LDKCVec_u8Z ret_var = ChannelShutdownState_write(obj_conv); + LDKCVec_u8Z ret_var = ChannelCounterparty_write(&obj_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_ChannelShutdownState_read(int8_tArray ser) { +int64_t CS_LDK_ChannelCounterparty_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_ChannelShutdownStateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelShutdownStateDecodeErrorZ), "LDKCResult_ChannelShutdownStateDecodeErrorZ"); - *ret_conv = ChannelShutdownState_read(ser_ref); + LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); + *ret_conv = ChannelCounterparty_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_ChannelManagerReadArgs_free(int64_t this_obj) { - LDKChannelManagerReadArgs this_obj_conv; +void CS_LDK_ChannelDetails_free(int64_t this_obj) { + LDKChannelDetails this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelManagerReadArgs_free(this_obj_conv); + ChannelDetails_free(this_obj_conv); } -int64_t CS_LDK_ChannelManagerReadArgs_get_entropy_source(int64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +int64_t CS_LDK_ChannelDetails_get_channel_id(int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - // WARNING: This object doesn't live past this scope, needs clone! - int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_entropy_source(&this_ptr_conv), false); - return ret_ret; + LDKChannelId ret_var = ChannelDetails_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_ChannelManagerReadArgs_set_entropy_source(int64_t this_ptr, int64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +void CS_LDK_ChannelDetails_set_channel_id(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKEntropySource val_conv = *(LDKEntropySource*)(val_ptr); - if (val_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&val_conv); - } - ChannelManagerReadArgs_set_entropy_source(&this_ptr_conv, val_conv); + LDKChannelId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelId_clone(&val_conv); + ChannelDetails_set_channel_id(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelManagerReadArgs_get_node_signer(int64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +int64_t CS_LDK_ChannelDetails_get_counterparty(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; - // WARNING: This object doesn't live past this scope, needs clone! - int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_node_signer(&this_ptr_conv), false); - return ret_ret; + LDKChannelCounterparty ret_var = ChannelDetails_get_counterparty(&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_ChannelManagerReadArgs_set_node_signer(int64_t this_ptr, int64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +void CS_LDK_ChannelDetails_set_counterparty(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKNodeSigner val_conv = *(LDKNodeSigner*)(val_ptr); - if (val_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&val_conv); - } - ChannelManagerReadArgs_set_node_signer(&this_ptr_conv, val_conv); + LDKChannelCounterparty val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelCounterparty_clone(&val_conv); + ChannelDetails_set_counterparty(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelManagerReadArgs_get_signer_provider(int64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +int64_t CS_LDK_ChannelDetails_get_funding_txo(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; - // WARNING: This object doesn't live past this scope, needs clone! - int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_signer_provider(&this_ptr_conv), false); - return ret_ret; + LDKOutPoint ret_var = ChannelDetails_get_funding_txo(&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_ChannelManagerReadArgs_set_signer_provider(int64_t this_ptr, int64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +void CS_LDK_ChannelDetails_set_funding_txo(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKSignerProvider val_conv = *(LDKSignerProvider*)(val_ptr); - if (val_conv.free == LDKSignerProvider_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKSignerProvider_JCalls_cloned(&val_conv); - } - ChannelManagerReadArgs_set_signer_provider(&this_ptr_conv, val_conv); + LDKOutPoint val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = OutPoint_clone(&val_conv); + ChannelDetails_set_funding_txo(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelManagerReadArgs_get_fee_estimator(int64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +int64_t CS_LDK_ChannelDetails_get_channel_type(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; - // WARNING: This object doesn't live past this scope, needs clone! - int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_fee_estimator(&this_ptr_conv), false); - return ret_ret; + LDKChannelTypeFeatures ret_var = ChannelDetails_get_channel_type(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_ChannelManagerReadArgs_set_fee_estimator(int64_t this_ptr, int64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +void CS_LDK_ChannelDetails_set_channel_type(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKFeeEstimator val_conv = *(LDKFeeEstimator*)(val_ptr); - if (val_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&val_conv); - } - ChannelManagerReadArgs_set_fee_estimator(&this_ptr_conv, val_conv); + LDKChannelTypeFeatures val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelTypeFeatures_clone(&val_conv); + ChannelDetails_set_channel_type(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelManagerReadArgs_get_chain_monitor(int64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +int64_t CS_LDK_ChannelDetails_get_short_channel_id(int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - // WARNING: This object doesn't live past this scope, needs clone! - int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_chain_monitor(&this_ptr_conv), false); - return ret_ret; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_short_channel_id(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_ChannelManagerReadArgs_set_chain_monitor(int64_t this_ptr, int64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +void CS_LDK_ChannelDetails_set_short_channel_id(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; void* val_ptr = untag_ptr(val); CHECK_ACCESS(val_ptr); - LDKWatch val_conv = *(LDKWatch*)(val_ptr); - if (val_conv.free == LDKWatch_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKWatch_JCalls_cloned(&val_conv); - } - ChannelManagerReadArgs_set_chain_monitor(&this_ptr_conv, val_conv); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + ChannelDetails_set_short_channel_id(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelManagerReadArgs_get_tx_broadcaster(int64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +int64_t CS_LDK_ChannelDetails_get_outbound_scid_alias(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; - // WARNING: This object doesn't live past this scope, needs clone! - int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv), false); - return ret_ret; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_outbound_scid_alias(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_ChannelManagerReadArgs_set_tx_broadcaster(int64_t this_ptr, int64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +void CS_LDK_ChannelDetails_set_outbound_scid_alias(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; void* val_ptr = untag_ptr(val); CHECK_ACCESS(val_ptr); - LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)(val_ptr); - if (val_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&val_conv); - } - ChannelManagerReadArgs_set_tx_broadcaster(&this_ptr_conv, val_conv); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + ChannelDetails_set_outbound_scid_alias(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelManagerReadArgs_get_router(int64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +int64_t CS_LDK_ChannelDetails_get_inbound_scid_alias(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; - // WARNING: This object doesn't live past this scope, needs clone! - int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_router(&this_ptr_conv), false); - return ret_ret; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_inbound_scid_alias(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_ChannelManagerReadArgs_set_router(int64_t this_ptr, int64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +void CS_LDK_ChannelDetails_set_inbound_scid_alias(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; void* val_ptr = untag_ptr(val); CHECK_ACCESS(val_ptr); - LDKRouter val_conv = *(LDKRouter*)(val_ptr); - if (val_conv.free == LDKRouter_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKRouter_JCalls_cloned(&val_conv); - } - ChannelManagerReadArgs_set_router(&this_ptr_conv, val_conv); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + ChannelDetails_set_inbound_scid_alias(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelManagerReadArgs_get_logger(int64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +int64_t CS_LDK_ChannelDetails_get_channel_value_satoshis(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; - // WARNING: This object doesn't live past this scope, needs clone! - int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_logger(&this_ptr_conv), false); - return ret_ret; + int64_t ret_conv = ChannelDetails_get_channel_value_satoshis(&this_ptr_conv); + return ret_conv; } -void CS_LDK_ChannelManagerReadArgs_set_logger(int64_t this_ptr, int64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +void CS_LDK_ChannelDetails_set_channel_value_satoshis(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKLogger val_conv = *(LDKLogger*)(val_ptr); - if (val_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&val_conv); - } - ChannelManagerReadArgs_set_logger(&this_ptr_conv, val_conv); + ChannelDetails_set_channel_value_satoshis(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelManagerReadArgs_get_default_config(int64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +int64_t CS_LDK_ChannelDetails_get_unspendable_punishment_reserve(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; - LDKUserConfig ret_var = ChannelManagerReadArgs_get_default_config(&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); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_unspendable_punishment_reserve(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void CS_LDK_ChannelManagerReadArgs_set_default_config(int64_t this_ptr, int64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +void CS_LDK_ChannelDetails_set_unspendable_punishment_reserve(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKUserConfig val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = UserConfig_clone(&val_conv); - ChannelManagerReadArgs_set_default_config(&this_ptr_conv, val_conv); -} - -int64_t CS_LDK_ChannelManagerReadArgs_new(int64_t entropy_source, int64_t node_signer, int64_t signer_provider, int64_t fee_estimator, int64_t chain_monitor, int64_t tx_broadcaster, int64_t router, int64_t logger, int64_t default_config, int64_tArray channel_monitors) { - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* signer_provider_ptr = untag_ptr(signer_provider); - CHECK_ACCESS(signer_provider_ptr); - LDKSignerProvider signer_provider_conv = *(LDKSignerProvider*)(signer_provider_ptr); - if (signer_provider_conv.free == LDKSignerProvider_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKSignerProvider_JCalls_cloned(&signer_provider_conv); - } - void* fee_estimator_ptr = untag_ptr(fee_estimator); - CHECK_ACCESS(fee_estimator_ptr); - LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); - } - void* chain_monitor_ptr = untag_ptr(chain_monitor); - CHECK_ACCESS(chain_monitor_ptr); - LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr); - if (chain_monitor_conv.free == LDKWatch_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKWatch_JCalls_cloned(&chain_monitor_conv); - } - void* tx_broadcaster_ptr = untag_ptr(tx_broadcaster); - CHECK_ACCESS(tx_broadcaster_ptr); - LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr); - if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv); - } - void* router_ptr = untag_ptr(router); - CHECK_ACCESS(router_ptr); - LDKRouter router_conv = *(LDKRouter*)(router_ptr); - if (router_conv.free == LDKRouter_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKRouter_JCalls_cloned(&router_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKUserConfig default_config_conv; - default_config_conv.inner = untag_ptr(default_config); - default_config_conv.is_owned = ptr_is_owned(default_config); - CHECK_INNER_FIELD_ACCESS_OR_NULL(default_config_conv); - default_config_conv = UserConfig_clone(&default_config_conv); - LDKCVec_ChannelMonitorZ channel_monitors_constr; - channel_monitors_constr.datalen = channel_monitors->arr_len; - if (channel_monitors_constr.datalen > 0) - channel_monitors_constr.data = MALLOC(channel_monitors_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements"); - else - channel_monitors_constr.data = NULL; - int64_t* channel_monitors_vals = channel_monitors->elems; - for (size_t q = 0; q < channel_monitors_constr.datalen; q++) { - int64_t channel_monitors_conv_16 = channel_monitors_vals[q]; - LDKChannelMonitor channel_monitors_conv_16_conv; - channel_monitors_conv_16_conv.inner = untag_ptr(channel_monitors_conv_16); - channel_monitors_conv_16_conv.is_owned = ptr_is_owned(channel_monitors_conv_16); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_monitors_conv_16_conv); - channel_monitors_conv_16_conv.is_owned = false; - channel_monitors_constr.data[q] = channel_monitors_conv_16_conv; - } - FREE(channel_monitors); - LDKChannelManagerReadArgs ret_var = ChannelManagerReadArgs_new(entropy_source_conv, node_signer_conv, signer_provider_conv, fee_estimator_conv, chain_monitor_conv, tx_broadcaster_conv, router_conv, logger_conv, default_config_conv, channel_monitors_constr); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -int64_t CS_LDK_C2Tuple_ThirtyTwoBytesChannelManagerZ_read(int8_tArray ser, int64_t arg) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKChannelManagerReadArgs arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - // WARNING: we need a move here but no clone is available for LDKChannelManagerReadArgs - - LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ"); - *ret_conv = C2Tuple_ThirtyTwoBytesChannelManagerZ_read(ser_ref, arg_conv); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -void CS_LDK_DelayedPaymentBasepoint_free(int64_t this_obj) { - LDKDelayedPaymentBasepoint this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - DelayedPaymentBasepoint_free(this_obj_conv); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + ChannelDetails_set_unspendable_punishment_reserve(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_DelayedPaymentBasepoint_get_a(int64_t this_ptr) { - LDKDelayedPaymentBasepoint this_ptr_conv; +int8_tArray CS_LDK_ChannelDetails_get_user_channel_id(int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, DelayedPaymentBasepoint_get_a(&this_ptr_conv).compressed_form, 33); + int8_tArray ret_arr = init_int8_tArray(16, __LINE__); + memcpy(ret_arr->elems, ChannelDetails_get_user_channel_id(&this_ptr_conv).le_bytes, 16); return ret_arr; } -void CS_LDK_DelayedPaymentBasepoint_set_a(int64_t this_ptr, int8_tArray val) { - LDKDelayedPaymentBasepoint this_ptr_conv; +void CS_LDK_ChannelDetails_set_user_channel_id(int64_t this_ptr, int8_tArray val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - DelayedPaymentBasepoint_set_a(&this_ptr_conv, val_ref); -} - -int64_t CS_LDK_DelayedPaymentBasepoint_new(int8_tArray a_arg) { - LDKPublicKey a_arg_ref; - CHECK(a_arg->arr_len == 33); - memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg); - LDKDelayedPaymentBasepoint ret_var = DelayedPaymentBasepoint_new(a_arg_ref); - int64_t ret_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_DelayedPaymentBasepoint_eq(int64_t a, int64_t b) { - LDKDelayedPaymentBasepoint a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKDelayedPaymentBasepoint b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = DelayedPaymentBasepoint_eq(&a_conv, &b_conv); - return ret_conv; + LDKU128 val_ref; + CHECK(val->arr_len == 16); + memcpy(val_ref.le_bytes, val->elems, 16); FREE(val); + ChannelDetails_set_user_channel_id(&this_ptr_conv, val_ref); } -static inline uint64_t DelayedPaymentBasepoint_clone_ptr(LDKDelayedPaymentBasepoint *NONNULL_PTR arg) { - LDKDelayedPaymentBasepoint ret_var = DelayedPaymentBasepoint_clone(arg); - 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_ChannelDetails_get_feerate_sat_per_1000_weight(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; + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = ChannelDetails_get_feerate_sat_per_1000_weight(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_DelayedPaymentBasepoint_clone_ptr(int64_t arg) { - LDKDelayedPaymentBasepoint arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = DelayedPaymentBasepoint_clone_ptr(&arg_conv); - return ret_conv; -} -int64_t CS_LDK_DelayedPaymentBasepoint_clone(int64_t orig) { - LDKDelayedPaymentBasepoint orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKDelayedPaymentBasepoint ret_var = DelayedPaymentBasepoint_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +void CS_LDK_ChannelDetails_set_feerate_sat_per_1000_weight(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); + val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val)); + ChannelDetails_set_feerate_sat_per_1000_weight(&this_ptr_conv, val_conv); } -int64_t CS_LDK_DelayedPaymentBasepoint_hash(int64_t o) { - LDKDelayedPaymentBasepoint o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = DelayedPaymentBasepoint_hash(&o_conv); +int64_t CS_LDK_ChannelDetails_get_balance_msat(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; + int64_t ret_conv = ChannelDetails_get_balance_msat(&this_ptr_conv); return ret_conv; } -int8_tArray CS_LDK_DelayedPaymentBasepoint_to_public_key(int64_t this_arg) { - LDKDelayedPaymentBasepoint this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, DelayedPaymentBasepoint_to_public_key(&this_arg_conv).compressed_form, 33); - return ret_arr; -} - -int8_tArray CS_LDK_DelayedPaymentBasepoint_derive_add_tweak(int64_t this_arg, int8_tArray per_commitment_point) { - LDKDelayedPaymentBasepoint this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPublicKey per_commitment_point_ref; - CHECK(per_commitment_point->arr_len == 33); - memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point); - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, DelayedPaymentBasepoint_derive_add_tweak(&this_arg_conv, per_commitment_point_ref).data, 32); - return ret_arr; -} - -int8_tArray CS_LDK_DelayedPaymentBasepoint_write(int64_t obj) { - LDKDelayedPaymentBasepoint obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = DelayedPaymentBasepoint_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -int64_t CS_LDK_DelayedPaymentBasepoint_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_DelayedPaymentBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentBasepointDecodeErrorZ), "LDKCResult_DelayedPaymentBasepointDecodeErrorZ"); - *ret_conv = DelayedPaymentBasepoint_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -void CS_LDK_DelayedPaymentKey_free(int64_t this_obj) { - LDKDelayedPaymentKey this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - DelayedPaymentKey_free(this_obj_conv); +void CS_LDK_ChannelDetails_set_balance_msat(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelDetails_set_balance_msat(&this_ptr_conv, val); } -int8_tArray CS_LDK_DelayedPaymentKey_get_a(int64_t this_ptr) { - LDKDelayedPaymentKey this_ptr_conv; +int64_t CS_LDK_ChannelDetails_get_outbound_capacity_msat(int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, DelayedPaymentKey_get_a(&this_ptr_conv).compressed_form, 33); - return ret_arr; + int64_t ret_conv = ChannelDetails_get_outbound_capacity_msat(&this_ptr_conv); + return ret_conv; } -void CS_LDK_DelayedPaymentKey_set_a(int64_t this_ptr, int8_tArray val) { - LDKDelayedPaymentKey this_ptr_conv; +void CS_LDK_ChannelDetails_set_outbound_capacity_msat(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - DelayedPaymentKey_set_a(&this_ptr_conv, val_ref); -} - -int64_t CS_LDK_DelayedPaymentKey_new(int8_tArray a_arg) { - LDKPublicKey a_arg_ref; - CHECK(a_arg->arr_len == 33); - memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg); - LDKDelayedPaymentKey ret_var = DelayedPaymentKey_new(a_arg_ref); - int64_t ret_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_DelayedPaymentKey_eq(int64_t a, int64_t b) { - LDKDelayedPaymentKey a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKDelayedPaymentKey b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = DelayedPaymentKey_eq(&a_conv, &b_conv); - return ret_conv; + ChannelDetails_set_outbound_capacity_msat(&this_ptr_conv, val); } -static inline uint64_t DelayedPaymentKey_clone_ptr(LDKDelayedPaymentKey *NONNULL_PTR arg) { - LDKDelayedPaymentKey ret_var = DelayedPaymentKey_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -int64_t CS_LDK_DelayedPaymentKey_clone_ptr(int64_t arg) { - LDKDelayedPaymentKey arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = DelayedPaymentKey_clone_ptr(&arg_conv); +int64_t CS_LDK_ChannelDetails_get_next_outbound_htlc_limit_msat(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; + int64_t ret_conv = ChannelDetails_get_next_outbound_htlc_limit_msat(&this_ptr_conv); return ret_conv; } -int64_t CS_LDK_DelayedPaymentKey_clone(int64_t orig) { - LDKDelayedPaymentKey orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKDelayedPaymentKey ret_var = DelayedPaymentKey_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +void CS_LDK_ChannelDetails_set_next_outbound_htlc_limit_msat(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelDetails_set_next_outbound_htlc_limit_msat(&this_ptr_conv, val); } -int64_t CS_LDK_DelayedPaymentKey_from_basepoint(int64_t countersignatory_basepoint, int8_tArray per_commitment_point) { - LDKDelayedPaymentBasepoint countersignatory_basepoint_conv; - countersignatory_basepoint_conv.inner = untag_ptr(countersignatory_basepoint); - countersignatory_basepoint_conv.is_owned = ptr_is_owned(countersignatory_basepoint); - CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_basepoint_conv); - countersignatory_basepoint_conv.is_owned = false; - LDKPublicKey per_commitment_point_ref; - CHECK(per_commitment_point->arr_len == 33); - memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point); - LDKDelayedPaymentKey ret_var = DelayedPaymentKey_from_basepoint(&countersignatory_basepoint_conv, per_commitment_point_ref); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +int64_t CS_LDK_ChannelDetails_get_next_outbound_htlc_minimum_msat(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; + int64_t ret_conv = ChannelDetails_get_next_outbound_htlc_minimum_msat(&this_ptr_conv); + return ret_conv; } -int64_t CS_LDK_DelayedPaymentKey_from_secret_key(int8_tArray sk) { - uint8_t sk_arr[32]; - CHECK(sk->arr_len == 32); - memcpy(sk_arr, sk->elems, 32); FREE(sk); - uint8_t (*sk_ref)[32] = &sk_arr; - LDKDelayedPaymentKey ret_var = DelayedPaymentKey_from_secret_key(sk_ref); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +void CS_LDK_ChannelDetails_set_next_outbound_htlc_minimum_msat(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelDetails_set_next_outbound_htlc_minimum_msat(&this_ptr_conv, val); } -int8_tArray CS_LDK_DelayedPaymentKey_to_public_key(int64_t this_arg) { - LDKDelayedPaymentKey this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, DelayedPaymentKey_to_public_key(&this_arg_conv).compressed_form, 33); - return ret_arr; +int64_t CS_LDK_ChannelDetails_get_inbound_capacity_msat(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; + int64_t ret_conv = ChannelDetails_get_inbound_capacity_msat(&this_ptr_conv); + return ret_conv; } -int8_tArray CS_LDK_DelayedPaymentKey_write(int64_t obj) { - LDKDelayedPaymentKey obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = DelayedPaymentKey_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +void CS_LDK_ChannelDetails_set_inbound_capacity_msat(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelDetails_set_inbound_capacity_msat(&this_ptr_conv, val); } -int64_t CS_LDK_DelayedPaymentKey_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_DelayedPaymentKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentKeyDecodeErrorZ), "LDKCResult_DelayedPaymentKeyDecodeErrorZ"); - *ret_conv = DelayedPaymentKey_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_ChannelDetails_get_confirmations_required(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; + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = ChannelDetails_get_confirmations_required(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_HtlcBasepoint_free(int64_t this_obj) { - LDKHtlcBasepoint this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - HtlcBasepoint_free(this_obj_conv); +void CS_LDK_ChannelDetails_set_confirmations_required(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); + val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val)); + ChannelDetails_set_confirmations_required(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_HtlcBasepoint_get_a(int64_t this_ptr) { - LDKHtlcBasepoint this_ptr_conv; +int64_t CS_LDK_ChannelDetails_get_confirmations(int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, HtlcBasepoint_get_a(&this_ptr_conv).compressed_form, 33); - return ret_arr; + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = ChannelDetails_get_confirmations(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_HtlcBasepoint_set_a(int64_t this_ptr, int8_tArray val) { - LDKHtlcBasepoint this_ptr_conv; +void CS_LDK_ChannelDetails_set_confirmations(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - HtlcBasepoint_set_a(&this_ptr_conv, val_ref); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); + val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val)); + ChannelDetails_set_confirmations(&this_ptr_conv, val_conv); } -int64_t CS_LDK_HtlcBasepoint_new(int8_tArray a_arg) { - LDKPublicKey a_arg_ref; - CHECK(a_arg->arr_len == 33); - memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg); - LDKHtlcBasepoint ret_var = HtlcBasepoint_new(a_arg_ref); - 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_ChannelDetails_get_force_close_spend_delay(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; + LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); + *ret_copy = ChannelDetails_get_force_close_spend_delay(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -jboolean CS_LDK_HtlcBasepoint_eq(int64_t a, int64_t b) { - LDKHtlcBasepoint a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKHtlcBasepoint b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = HtlcBasepoint_eq(&a_conv, &b_conv); - return ret_conv; +void CS_LDK_ChannelDetails_set_force_close_spend_delay(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr); + val_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(val)); + ChannelDetails_set_force_close_spend_delay(&this_ptr_conv, val_conv); } -static inline uint64_t HtlcBasepoint_clone_ptr(LDKHtlcBasepoint *NONNULL_PTR arg) { - LDKHtlcBasepoint ret_var = HtlcBasepoint_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -int64_t CS_LDK_HtlcBasepoint_clone_ptr(int64_t arg) { - LDKHtlcBasepoint arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = HtlcBasepoint_clone_ptr(&arg_conv); +jboolean CS_LDK_ChannelDetails_get_is_outbound(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_outbound(&this_ptr_conv); return ret_conv; } -int64_t CS_LDK_HtlcBasepoint_clone(int64_t orig) { - LDKHtlcBasepoint orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKHtlcBasepoint ret_var = HtlcBasepoint_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +void CS_LDK_ChannelDetails_set_is_outbound(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_outbound(&this_ptr_conv, val); } -int64_t CS_LDK_HtlcBasepoint_hash(int64_t o) { - LDKHtlcBasepoint o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = HtlcBasepoint_hash(&o_conv); +jboolean CS_LDK_ChannelDetails_get_is_channel_ready(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_channel_ready(&this_ptr_conv); return ret_conv; } -int8_tArray CS_LDK_HtlcBasepoint_to_public_key(int64_t this_arg) { - LDKHtlcBasepoint this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, HtlcBasepoint_to_public_key(&this_arg_conv).compressed_form, 33); - return ret_arr; +void CS_LDK_ChannelDetails_set_is_channel_ready(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_channel_ready(&this_ptr_conv, val); } -int8_tArray CS_LDK_HtlcBasepoint_derive_add_tweak(int64_t this_arg, int8_tArray per_commitment_point) { - LDKHtlcBasepoint this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPublicKey per_commitment_point_ref; - CHECK(per_commitment_point->arr_len == 33); - memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point); - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, HtlcBasepoint_derive_add_tweak(&this_arg_conv, per_commitment_point_ref).data, 32); - return ret_arr; +int64_t CS_LDK_ChannelDetails_get_channel_shutdown_state(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; + LDKCOption_ChannelShutdownStateZ *ret_copy = MALLOC(sizeof(LDKCOption_ChannelShutdownStateZ), "LDKCOption_ChannelShutdownStateZ"); + *ret_copy = ChannelDetails_get_channel_shutdown_state(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int8_tArray CS_LDK_HtlcBasepoint_write(int64_t obj) { - LDKHtlcBasepoint obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = HtlcBasepoint_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +void CS_LDK_ChannelDetails_set_channel_shutdown_state(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_ChannelShutdownStateZ val_conv = *(LDKCOption_ChannelShutdownStateZ*)(val_ptr); + val_conv = COption_ChannelShutdownStateZ_clone((LDKCOption_ChannelShutdownStateZ*)untag_ptr(val)); + ChannelDetails_set_channel_shutdown_state(&this_ptr_conv, val_conv); } -int64_t CS_LDK_HtlcBasepoint_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_HtlcBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcBasepointDecodeErrorZ), "LDKCResult_HtlcBasepointDecodeErrorZ"); - *ret_conv = HtlcBasepoint_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +jboolean CS_LDK_ChannelDetails_get_is_usable(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_usable(&this_ptr_conv); + return ret_conv; } -void CS_LDK_HtlcKey_free(int64_t this_obj) { - LDKHtlcKey this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - HtlcKey_free(this_obj_conv); +void CS_LDK_ChannelDetails_set_is_usable(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_usable(&this_ptr_conv, val); } -int8_tArray CS_LDK_HtlcKey_get_a(int64_t this_ptr) { - LDKHtlcKey this_ptr_conv; +jboolean CS_LDK_ChannelDetails_get_is_public(int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, HtlcKey_get_a(&this_ptr_conv).compressed_form, 33); - return ret_arr; + jboolean ret_conv = ChannelDetails_get_is_public(&this_ptr_conv); + return ret_conv; } -void CS_LDK_HtlcKey_set_a(int64_t this_ptr, int8_tArray val) { - LDKHtlcKey this_ptr_conv; +void CS_LDK_ChannelDetails_set_is_public(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; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - HtlcKey_set_a(&this_ptr_conv, val_ref); + ChannelDetails_set_is_public(&this_ptr_conv, val); } -int64_t CS_LDK_HtlcKey_new(int8_tArray a_arg) { - LDKPublicKey a_arg_ref; - CHECK(a_arg->arr_len == 33); - memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg); - LDKHtlcKey ret_var = HtlcKey_new(a_arg_ref); - 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_ChannelDetails_get_inbound_htlc_minimum_msat(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; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_inbound_htlc_minimum_msat(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -jboolean CS_LDK_HtlcKey_eq(int64_t a, int64_t b) { - LDKHtlcKey a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKHtlcKey b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = HtlcKey_eq(&a_conv, &b_conv); - return ret_conv; -} - -static inline uint64_t HtlcKey_clone_ptr(LDKHtlcKey *NONNULL_PTR arg) { - LDKHtlcKey ret_var = HtlcKey_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -int64_t CS_LDK_HtlcKey_clone_ptr(int64_t arg) { - LDKHtlcKey arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = HtlcKey_clone_ptr(&arg_conv); - return ret_conv; +void CS_LDK_ChannelDetails_set_inbound_htlc_minimum_msat(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + ChannelDetails_set_inbound_htlc_minimum_msat(&this_ptr_conv, val_conv); } -int64_t CS_LDK_HtlcKey_clone(int64_t orig) { - LDKHtlcKey orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKHtlcKey ret_var = HtlcKey_clone(&orig_conv); - 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_ChannelDetails_get_inbound_htlc_maximum_msat(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; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_inbound_htlc_maximum_msat(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_HtlcKey_from_basepoint(int64_t countersignatory_basepoint, int8_tArray per_commitment_point) { - LDKHtlcBasepoint countersignatory_basepoint_conv; - countersignatory_basepoint_conv.inner = untag_ptr(countersignatory_basepoint); - countersignatory_basepoint_conv.is_owned = ptr_is_owned(countersignatory_basepoint); - CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_basepoint_conv); - countersignatory_basepoint_conv.is_owned = false; - LDKPublicKey per_commitment_point_ref; - CHECK(per_commitment_point->arr_len == 33); - memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point); - LDKHtlcKey ret_var = HtlcKey_from_basepoint(&countersignatory_basepoint_conv, per_commitment_point_ref); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +void CS_LDK_ChannelDetails_set_inbound_htlc_maximum_msat(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + ChannelDetails_set_inbound_htlc_maximum_msat(&this_ptr_conv, val_conv); } -int64_t CS_LDK_HtlcKey_from_secret_key(int8_tArray sk) { - uint8_t sk_arr[32]; - CHECK(sk->arr_len == 32); - memcpy(sk_arr, sk->elems, 32); FREE(sk); - uint8_t (*sk_ref)[32] = &sk_arr; - LDKHtlcKey ret_var = HtlcKey_from_secret_key(sk_ref); +int64_t CS_LDK_ChannelDetails_get_config(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; + LDKChannelConfig ret_var = ChannelDetails_get_config(&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_HtlcKey_to_public_key(int64_t this_arg) { - LDKHtlcKey this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, HtlcKey_to_public_key(&this_arg_conv).compressed_form, 33); - return ret_arr; -} - -int8_tArray CS_LDK_HtlcKey_write(int64_t obj) { - LDKHtlcKey obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = HtlcKey_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -int64_t CS_LDK_HtlcKey_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_HtlcKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcKeyDecodeErrorZ), "LDKCResult_HtlcKeyDecodeErrorZ"); - *ret_conv = HtlcKey_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void CS_LDK_ChannelDetails_set_config(int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelConfig val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelConfig_clone(&val_conv); + ChannelDetails_set_config(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_add_public_key_tweak(int8_tArray base_point, int8_tArray tweak) { - LDKPublicKey base_point_ref; - CHECK(base_point->arr_len == 33); - memcpy(base_point_ref.compressed_form, base_point->elems, 33); FREE(base_point); - uint8_t tweak_arr[32]; - CHECK(tweak->arr_len == 32); - memcpy(tweak_arr, tweak->elems, 32); FREE(tweak); - uint8_t (*tweak_ref)[32] = &tweak_arr; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, add_public_key_tweak(base_point_ref, tweak_ref).compressed_form, 33); +int64_tArray CS_LDK_ChannelDetails_get_pending_inbound_htlcs(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; + LDKCVec_InboundHTLCDetailsZ ret_var = ChannelDetails_get_pending_inbound_htlcs(&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 u = 0; u < ret_var.datalen; u++) { + LDKInboundHTLCDetails 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_RevocationBasepoint_free(int64_t this_obj) { - LDKRevocationBasepoint this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - RevocationBasepoint_free(this_obj_conv); +void CS_LDK_ChannelDetails_set_pending_inbound_htlcs(int64_t this_ptr, int64_tArray val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_InboundHTLCDetailsZ val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKInboundHTLCDetails), "LDKCVec_InboundHTLCDetailsZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = val->elems; + for (size_t u = 0; u < val_constr.datalen; u++) { + int64_t val_conv_20 = val_vals[u]; + LDKInboundHTLCDetails val_conv_20_conv; + val_conv_20_conv.inner = untag_ptr(val_conv_20); + val_conv_20_conv.is_owned = ptr_is_owned(val_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_20_conv); + val_conv_20_conv = InboundHTLCDetails_clone(&val_conv_20_conv); + val_constr.data[u] = val_conv_20_conv; + } + FREE(val); + ChannelDetails_set_pending_inbound_htlcs(&this_ptr_conv, val_constr); } -int8_tArray CS_LDK_RevocationBasepoint_get_a(int64_t this_ptr) { - LDKRevocationBasepoint this_ptr_conv; +int64_tArray CS_LDK_ChannelDetails_get_pending_outbound_htlcs(int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, RevocationBasepoint_get_a(&this_ptr_conv).compressed_form, 33); + LDKCVec_OutboundHTLCDetailsZ ret_var = ChannelDetails_get_pending_outbound_htlcs(&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 v = 0; v < ret_var.datalen; v++) { + LDKOutboundHTLCDetails ret_conv_21_var = ret_var.data[v]; + int64_t ret_conv_21_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_21_var); + ret_conv_21_ref = tag_ptr(ret_conv_21_var.inner, ret_conv_21_var.is_owned); + ret_arr_ptr[v] = ret_conv_21_ref; + } + + FREE(ret_var.data); return ret_arr; } -void CS_LDK_RevocationBasepoint_set_a(int64_t this_ptr, int8_tArray val) { - LDKRevocationBasepoint this_ptr_conv; +void CS_LDK_ChannelDetails_set_pending_outbound_htlcs(int64_t this_ptr, int64_tArray val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - RevocationBasepoint_set_a(&this_ptr_conv, val_ref); + LDKCVec_OutboundHTLCDetailsZ val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKOutboundHTLCDetails), "LDKCVec_OutboundHTLCDetailsZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = val->elems; + for (size_t v = 0; v < val_constr.datalen; v++) { + int64_t val_conv_21 = val_vals[v]; + LDKOutboundHTLCDetails val_conv_21_conv; + val_conv_21_conv.inner = untag_ptr(val_conv_21); + val_conv_21_conv.is_owned = ptr_is_owned(val_conv_21); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_21_conv); + val_conv_21_conv = OutboundHTLCDetails_clone(&val_conv_21_conv); + val_constr.data[v] = val_conv_21_conv; + } + FREE(val); + ChannelDetails_set_pending_outbound_htlcs(&this_ptr_conv, val_constr); } -int64_t CS_LDK_RevocationBasepoint_new(int8_tArray a_arg) { - LDKPublicKey a_arg_ref; - CHECK(a_arg->arr_len == 33); - memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg); - LDKRevocationBasepoint ret_var = RevocationBasepoint_new(a_arg_ref); +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) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); + LDKChannelCounterparty counterparty_arg_conv; + counterparty_arg_conv.inner = untag_ptr(counterparty_arg); + counterparty_arg_conv.is_owned = ptr_is_owned(counterparty_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_arg_conv); + counterparty_arg_conv = ChannelCounterparty_clone(&counterparty_arg_conv); + LDKOutPoint funding_txo_arg_conv; + funding_txo_arg_conv.inner = untag_ptr(funding_txo_arg); + funding_txo_arg_conv.is_owned = ptr_is_owned(funding_txo_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_arg_conv); + funding_txo_arg_conv = OutPoint_clone(&funding_txo_arg_conv); + LDKChannelTypeFeatures channel_type_arg_conv; + channel_type_arg_conv.inner = untag_ptr(channel_type_arg); + channel_type_arg_conv.is_owned = ptr_is_owned(channel_type_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_arg_conv); + channel_type_arg_conv = ChannelTypeFeatures_clone(&channel_type_arg_conv); + void* short_channel_id_arg_ptr = untag_ptr(short_channel_id_arg); + CHECK_ACCESS(short_channel_id_arg_ptr); + LDKCOption_u64Z short_channel_id_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_arg_ptr); + short_channel_id_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id_arg)); + void* outbound_scid_alias_arg_ptr = untag_ptr(outbound_scid_alias_arg); + CHECK_ACCESS(outbound_scid_alias_arg_ptr); + LDKCOption_u64Z outbound_scid_alias_arg_conv = *(LDKCOption_u64Z*)(outbound_scid_alias_arg_ptr); + outbound_scid_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_scid_alias_arg)); + void* inbound_scid_alias_arg_ptr = untag_ptr(inbound_scid_alias_arg); + CHECK_ACCESS(inbound_scid_alias_arg_ptr); + LDKCOption_u64Z inbound_scid_alias_arg_conv = *(LDKCOption_u64Z*)(inbound_scid_alias_arg_ptr); + inbound_scid_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_scid_alias_arg)); + void* unspendable_punishment_reserve_arg_ptr = untag_ptr(unspendable_punishment_reserve_arg); + CHECK_ACCESS(unspendable_punishment_reserve_arg_ptr); + LDKCOption_u64Z unspendable_punishment_reserve_arg_conv = *(LDKCOption_u64Z*)(unspendable_punishment_reserve_arg_ptr); + LDKU128 user_channel_id_arg_ref; + CHECK(user_channel_id_arg->arr_len == 16); + memcpy(user_channel_id_arg_ref.le_bytes, user_channel_id_arg->elems, 16); FREE(user_channel_id_arg); + void* feerate_sat_per_1000_weight_arg_ptr = untag_ptr(feerate_sat_per_1000_weight_arg); + CHECK_ACCESS(feerate_sat_per_1000_weight_arg_ptr); + LDKCOption_u32Z feerate_sat_per_1000_weight_arg_conv = *(LDKCOption_u32Z*)(feerate_sat_per_1000_weight_arg_ptr); + feerate_sat_per_1000_weight_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(feerate_sat_per_1000_weight_arg)); + void* confirmations_required_arg_ptr = untag_ptr(confirmations_required_arg); + CHECK_ACCESS(confirmations_required_arg_ptr); + LDKCOption_u32Z confirmations_required_arg_conv = *(LDKCOption_u32Z*)(confirmations_required_arg_ptr); + confirmations_required_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(confirmations_required_arg)); + void* confirmations_arg_ptr = untag_ptr(confirmations_arg); + CHECK_ACCESS(confirmations_arg_ptr); + LDKCOption_u32Z confirmations_arg_conv = *(LDKCOption_u32Z*)(confirmations_arg_ptr); + confirmations_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(confirmations_arg)); + void* force_close_spend_delay_arg_ptr = untag_ptr(force_close_spend_delay_arg); + CHECK_ACCESS(force_close_spend_delay_arg_ptr); + LDKCOption_u16Z force_close_spend_delay_arg_conv = *(LDKCOption_u16Z*)(force_close_spend_delay_arg_ptr); + force_close_spend_delay_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(force_close_spend_delay_arg)); + void* channel_shutdown_state_arg_ptr = untag_ptr(channel_shutdown_state_arg); + CHECK_ACCESS(channel_shutdown_state_arg_ptr); + LDKCOption_ChannelShutdownStateZ channel_shutdown_state_arg_conv = *(LDKCOption_ChannelShutdownStateZ*)(channel_shutdown_state_arg_ptr); + channel_shutdown_state_arg_conv = COption_ChannelShutdownStateZ_clone((LDKCOption_ChannelShutdownStateZ*)untag_ptr(channel_shutdown_state_arg)); + void* inbound_htlc_minimum_msat_arg_ptr = untag_ptr(inbound_htlc_minimum_msat_arg); + CHECK_ACCESS(inbound_htlc_minimum_msat_arg_ptr); + LDKCOption_u64Z inbound_htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(inbound_htlc_minimum_msat_arg_ptr); + inbound_htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_htlc_minimum_msat_arg)); + void* inbound_htlc_maximum_msat_arg_ptr = untag_ptr(inbound_htlc_maximum_msat_arg); + CHECK_ACCESS(inbound_htlc_maximum_msat_arg_ptr); + LDKCOption_u64Z inbound_htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(inbound_htlc_maximum_msat_arg_ptr); + inbound_htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_htlc_maximum_msat_arg)); + LDKChannelConfig config_arg_conv; + config_arg_conv.inner = untag_ptr(config_arg); + config_arg_conv.is_owned = ptr_is_owned(config_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(config_arg_conv); + config_arg_conv = ChannelConfig_clone(&config_arg_conv); + LDKCVec_InboundHTLCDetailsZ pending_inbound_htlcs_arg_constr; + pending_inbound_htlcs_arg_constr.datalen = pending_inbound_htlcs_arg->arr_len; + if (pending_inbound_htlcs_arg_constr.datalen > 0) + pending_inbound_htlcs_arg_constr.data = MALLOC(pending_inbound_htlcs_arg_constr.datalen * sizeof(LDKInboundHTLCDetails), "LDKCVec_InboundHTLCDetailsZ Elements"); + else + pending_inbound_htlcs_arg_constr.data = NULL; + int64_t* pending_inbound_htlcs_arg_vals = pending_inbound_htlcs_arg->elems; + for (size_t u = 0; u < pending_inbound_htlcs_arg_constr.datalen; u++) { + int64_t pending_inbound_htlcs_arg_conv_20 = pending_inbound_htlcs_arg_vals[u]; + LDKInboundHTLCDetails pending_inbound_htlcs_arg_conv_20_conv; + pending_inbound_htlcs_arg_conv_20_conv.inner = untag_ptr(pending_inbound_htlcs_arg_conv_20); + pending_inbound_htlcs_arg_conv_20_conv.is_owned = ptr_is_owned(pending_inbound_htlcs_arg_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(pending_inbound_htlcs_arg_conv_20_conv); + pending_inbound_htlcs_arg_conv_20_conv = InboundHTLCDetails_clone(&pending_inbound_htlcs_arg_conv_20_conv); + pending_inbound_htlcs_arg_constr.data[u] = pending_inbound_htlcs_arg_conv_20_conv; + } + FREE(pending_inbound_htlcs_arg); + LDKCVec_OutboundHTLCDetailsZ pending_outbound_htlcs_arg_constr; + pending_outbound_htlcs_arg_constr.datalen = pending_outbound_htlcs_arg->arr_len; + if (pending_outbound_htlcs_arg_constr.datalen > 0) + pending_outbound_htlcs_arg_constr.data = MALLOC(pending_outbound_htlcs_arg_constr.datalen * sizeof(LDKOutboundHTLCDetails), "LDKCVec_OutboundHTLCDetailsZ Elements"); + else + pending_outbound_htlcs_arg_constr.data = NULL; + int64_t* pending_outbound_htlcs_arg_vals = pending_outbound_htlcs_arg->elems; + for (size_t v = 0; v < pending_outbound_htlcs_arg_constr.datalen; v++) { + int64_t pending_outbound_htlcs_arg_conv_21 = pending_outbound_htlcs_arg_vals[v]; + LDKOutboundHTLCDetails pending_outbound_htlcs_arg_conv_21_conv; + pending_outbound_htlcs_arg_conv_21_conv.inner = untag_ptr(pending_outbound_htlcs_arg_conv_21); + pending_outbound_htlcs_arg_conv_21_conv.is_owned = ptr_is_owned(pending_outbound_htlcs_arg_conv_21); + CHECK_INNER_FIELD_ACCESS_OR_NULL(pending_outbound_htlcs_arg_conv_21_conv); + pending_outbound_htlcs_arg_conv_21_conv = OutboundHTLCDetails_clone(&pending_outbound_htlcs_arg_conv_21_conv); + pending_outbound_htlcs_arg_constr.data[v] = pending_outbound_htlcs_arg_conv_21_conv; + } + FREE(pending_outbound_htlcs_arg); + LDKChannelDetails ret_var = ChannelDetails_new(channel_id_arg_conv, counterparty_arg_conv, funding_txo_arg_conv, channel_type_arg_conv, short_channel_id_arg_conv, outbound_scid_alias_arg_conv, inbound_scid_alias_arg_conv, channel_value_satoshis_arg, unspendable_punishment_reserve_arg_conv, user_channel_id_arg_ref, feerate_sat_per_1000_weight_arg_conv, balance_msat_arg, outbound_capacity_msat_arg, next_outbound_htlc_limit_msat_arg, next_outbound_htlc_minimum_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg_conv, confirmations_arg_conv, force_close_spend_delay_arg_conv, is_outbound_arg, is_channel_ready_arg, channel_shutdown_state_arg_conv, is_usable_arg, is_public_arg, inbound_htlc_minimum_msat_arg_conv, inbound_htlc_maximum_msat_arg_conv, config_arg_conv, pending_inbound_htlcs_arg_constr, pending_outbound_htlcs_arg_constr); int64_t ret_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_RevocationBasepoint_eq(int64_t a, int64_t b) { - LDKRevocationBasepoint a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKRevocationBasepoint b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = RevocationBasepoint_eq(&a_conv, &b_conv); - return ret_conv; -} - -static inline uint64_t RevocationBasepoint_clone_ptr(LDKRevocationBasepoint *NONNULL_PTR arg) { - LDKRevocationBasepoint ret_var = RevocationBasepoint_clone(arg); +static inline uint64_t ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg) { + LDKChannelDetails ret_var = ChannelDetails_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_RevocationBasepoint_clone_ptr(int64_t arg) { - LDKRevocationBasepoint arg_conv; +int64_t CS_LDK_ChannelDetails_clone_ptr(int64_t arg) { + LDKChannelDetails arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = RevocationBasepoint_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelDetails_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_RevocationBasepoint_clone(int64_t orig) { - LDKRevocationBasepoint orig_conv; +int64_t CS_LDK_ChannelDetails_clone(int64_t orig) { + LDKChannelDetails orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKRevocationBasepoint ret_var = RevocationBasepoint_clone(&orig_conv); + LDKChannelDetails ret_var = ChannelDetails_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_RevocationBasepoint_hash(int64_t o) { - LDKRevocationBasepoint o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = RevocationBasepoint_hash(&o_conv); - return ret_conv; +int64_t CS_LDK_ChannelDetails_get_inbound_payment_scid(int64_t this_arg) { + LDKChannelDetails this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_inbound_payment_scid(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int8_tArray CS_LDK_RevocationBasepoint_to_public_key(int64_t this_arg) { - LDKRevocationBasepoint this_arg_conv; +int64_t CS_LDK_ChannelDetails_get_outbound_payment_scid(int64_t this_arg) { + LDKChannelDetails this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, RevocationBasepoint_to_public_key(&this_arg_conv).compressed_form, 33); - return ret_arr; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_outbound_payment_scid(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int8_tArray CS_LDK_RevocationBasepoint_write(int64_t obj) { - LDKRevocationBasepoint obj_conv; +int8_tArray CS_LDK_ChannelDetails_write(int64_t obj) { + LDKChannelDetails obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = RevocationBasepoint_write(&obj_conv); + LDKCVec_u8Z ret_var = ChannelDetails_write(&obj_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_RevocationBasepoint_read(int8_tArray ser) { +int64_t CS_LDK_ChannelDetails_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_RevocationBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationBasepointDecodeErrorZ), "LDKCResult_RevocationBasepointDecodeErrorZ"); - *ret_conv = RevocationBasepoint_read(ser_ref); + LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); + *ret_conv = ChannelDetails_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void CS_LDK_RevocationKey_free(int64_t this_obj) { - LDKRevocationKey this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - RevocationKey_free(this_obj_conv); -} - -int8_tArray CS_LDK_RevocationKey_get_a(int64_t this_ptr) { - LDKRevocationKey this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, RevocationKey_get_a(&this_ptr_conv).compressed_form, 33); - return ret_arr; -} - -void CS_LDK_RevocationKey_set_a(int64_t this_ptr, int8_tArray val) { - LDKRevocationKey this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - RevocationKey_set_a(&this_ptr_conv, val_ref); -} - -int64_t CS_LDK_RevocationKey_new(int8_tArray a_arg) { - LDKPublicKey a_arg_ref; - CHECK(a_arg->arr_len == 33); - memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg); - LDKRevocationKey ret_var = RevocationKey_new(a_arg_ref); - int64_t ret_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_ChannelShutdownState_clone(int64_t orig) { + LDKChannelShutdownState* orig_conv = (LDKChannelShutdownState*)untag_ptr(orig); + int32_t ret_conv = LDKChannelShutdownState_to_cs(ChannelShutdownState_clone(orig_conv)); + return ret_conv; } -jboolean CS_LDK_RevocationKey_eq(int64_t a, int64_t b) { - LDKRevocationKey a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKRevocationKey b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = RevocationKey_eq(&a_conv, &b_conv); +int32_t CS_LDK_ChannelShutdownState_not_shutting_down() { + int32_t ret_conv = LDKChannelShutdownState_to_cs(ChannelShutdownState_not_shutting_down()); return ret_conv; } -static inline uint64_t RevocationKey_clone_ptr(LDKRevocationKey *NONNULL_PTR arg) { - LDKRevocationKey ret_var = RevocationKey_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -int64_t CS_LDK_RevocationKey_clone_ptr(int64_t arg) { - LDKRevocationKey arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = RevocationKey_clone_ptr(&arg_conv); +int32_t CS_LDK_ChannelShutdownState_shutdown_initiated() { + int32_t ret_conv = LDKChannelShutdownState_to_cs(ChannelShutdownState_shutdown_initiated()); return ret_conv; } -int64_t CS_LDK_RevocationKey_clone(int64_t orig) { - LDKRevocationKey orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKRevocationKey ret_var = RevocationKey_clone(&orig_conv); - int64_t ret_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_ChannelShutdownState_resolving_htlcs() { + int32_t ret_conv = LDKChannelShutdownState_to_cs(ChannelShutdownState_resolving_htlcs()); + return ret_conv; } -int64_t CS_LDK_RevocationKey_hash(int64_t o) { - LDKRevocationKey o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = RevocationKey_hash(&o_conv); +int32_t CS_LDK_ChannelShutdownState_negotiating_closing_fee() { + int32_t ret_conv = LDKChannelShutdownState_to_cs(ChannelShutdownState_negotiating_closing_fee()); return ret_conv; } -int64_t CS_LDK_RevocationKey_from_basepoint(int64_t countersignatory_basepoint, int8_tArray per_commitment_point) { - LDKRevocationBasepoint countersignatory_basepoint_conv; - countersignatory_basepoint_conv.inner = untag_ptr(countersignatory_basepoint); - countersignatory_basepoint_conv.is_owned = ptr_is_owned(countersignatory_basepoint); - CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_basepoint_conv); - countersignatory_basepoint_conv.is_owned = false; - LDKPublicKey per_commitment_point_ref; - CHECK(per_commitment_point->arr_len == 33); - memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point); - LDKRevocationKey ret_var = RevocationKey_from_basepoint(&countersignatory_basepoint_conv, per_commitment_point_ref); - int64_t ret_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_ChannelShutdownState_shutdown_complete() { + int32_t ret_conv = LDKChannelShutdownState_to_cs(ChannelShutdownState_shutdown_complete()); + return ret_conv; } -int8_tArray CS_LDK_RevocationKey_to_public_key(int64_t this_arg) { - LDKRevocationKey this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, RevocationKey_to_public_key(&this_arg_conv).compressed_form, 33); - return ret_arr; +jboolean CS_LDK_ChannelShutdownState_eq(int64_t a, int64_t b) { + LDKChannelShutdownState* a_conv = (LDKChannelShutdownState*)untag_ptr(a); + LDKChannelShutdownState* b_conv = (LDKChannelShutdownState*)untag_ptr(b); + jboolean ret_conv = ChannelShutdownState_eq(a_conv, b_conv); + return ret_conv; } -int8_tArray CS_LDK_RevocationKey_write(int64_t obj) { - LDKRevocationKey obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = RevocationKey_write(&obj_conv); +int8_tArray CS_LDK_ChannelShutdownState_write(int64_t obj) { + LDKChannelShutdownState* obj_conv = (LDKChannelShutdownState*)untag_ptr(obj); + LDKCVec_u8Z ret_var = ChannelShutdownState_write(obj_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } -int64_t CS_LDK_RevocationKey_read(int8_tArray ser) { +int64_t CS_LDK_ChannelShutdownState_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_RevocationKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationKeyDecodeErrorZ), "LDKCResult_RevocationKeyDecodeErrorZ"); - *ret_conv = RevocationKey_read(ser_ref); + LDKCResult_ChannelShutdownStateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelShutdownStateDecodeErrorZ), "LDKCResult_ChannelShutdownStateDecodeErrorZ"); + *ret_conv = ChannelShutdownState_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } @@ -51789,6 +53104,14 @@ jboolean CS_LDK_SocketAddressParseError_eq(int64_t a, int64_t b) { return ret_conv; } +jstring CS_LDK_SocketAddressParseError_to_str(int64_t o) { + LDKSocketAddressParseError* o_conv = (LDKSocketAddressParseError*)untag_ptr(o); + LDKStr ret_str = SocketAddressParseError_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_parse_onion_address(jstring host, int16_t port) { LDKStr host_conv = str_ref_to_owned_c(host); LDKCResult_SocketAddressSocketAddressParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SocketAddressSocketAddressParseErrorZ), "LDKCResult_SocketAddressSocketAddressParseErrorZ"); @@ -55040,6 +56363,14 @@ int8_tArray CS_LDK_TrampolineOnionPacket_write(int64_t obj) { return ret_arr; } +jstring CS_LDK_DecodeError_to_str(int64_t o) { + LDKDecodeError* o_conv = (LDKDecodeError*)untag_ptr(o); + LDKStr ret_str = DecodeError_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_AcceptChannel_write(int64_t obj) { LDKAcceptChannel obj_conv; obj_conv.inner = untag_ptr(obj); @@ -56724,6 +58055,18 @@ int64_t CS_LDK_PeerHandleError_clone(int64_t orig) { return ret_ref; } +jstring CS_LDK_PeerHandleError_to_str(int64_t o) { + LDKPeerHandleError o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = PeerHandleError_to_str(&o_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + void CS_LDK_PeerManager_free(int64_t this_obj) { LDKPeerManager this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -62973,6 +64316,18 @@ jboolean CS_LDK_ShutdownScript_is_compatible(int64_t this_arg, int64_t features return ret_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); @@ -63189,6 +64544,18 @@ int64_t CS_LDK_ChannelId_read(int8_tArray 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_Retry_free(int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -64558,6 +65925,18 @@ int64_t CS_LDK_Offer_from_str(jstring s) { 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); @@ -65862,6 +67241,18 @@ int64_t CS_LDK_InvoiceError_from_string(jstring s) { return ret_ref; } +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; +} + int8_tArray CS_LDK_InvoiceError_write(int64_t obj) { LDKInvoiceError obj_conv; obj_conv.inner = untag_ptr(obj); @@ -67973,6 +69364,18 @@ int64_t CS_LDK_Refund_from_str(jstring s) { 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; +} + 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)); @@ -68228,6 +69631,18 @@ int64_t CS_LDK_NodeId_as_pubkey(int64_t this_arg) { 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); @@ -68705,6 +70120,18 @@ jboolean CS_LDK_ChannelUpdateInfo_eq(int64_t a, int64_t b) { return ret_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); + return ret_conv; +} + int8_tArray CS_LDK_ChannelUpdateInfo_write(int64_t obj) { LDKChannelUpdateInfo obj_conv; obj_conv.inner = untag_ptr(obj); @@ -68981,6 +70408,18 @@ int64_t CS_LDK_ChannelInfo_get_directional_info(int64_t this_arg, int8_t channe return ret_ref; } +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; +} + int8_tArray CS_LDK_ChannelInfo_write(int64_t obj) { LDKChannelInfo obj_conv; obj_conv.inner = untag_ptr(obj); @@ -69645,6 +71084,18 @@ jboolean CS_LDK_NodeAlias_eq(int64_t a, int64_t b) { 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); @@ -69823,6 +71274,18 @@ jboolean CS_LDK_NodeInfo_is_tor_only(int64_t this_arg) { 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); @@ -69876,6 +71339,18 @@ int64_t CS_LDK_NetworkGraph_read(int8_tArray ser, int64_t arg) { 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); @@ -71339,6 +72814,18 @@ int64_t CS_LDK_Route_get_total_amount(int64_t this_arg) { 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; obj_conv.inner = untag_ptr(obj); @@ -79268,6 +80755,14 @@ jboolean CS_LDK_ClosureReason_eq(int64_t a, int64_t b) { 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); + 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); diff --git a/c_sharp/src/org/ldk/enums/InboundHTLCStateDetails.cs b/c_sharp/src/org/ldk/enums/InboundHTLCStateDetails.cs new file mode 100644 index 00000000..ac2a4e49 --- /dev/null +++ b/c_sharp/src/org/ldk/enums/InboundHTLCStateDetails.cs @@ -0,0 +1,47 @@ +namespace org { namespace ldk { namespace enums {/** + * Exposes the state of pending inbound HTLCs. + * + * At a high level, an HTLC being forwarded from one Lightning node to another Lightning node goes + * through the following states in the state machine: + * - Announced for addition by the originating node through the update_add_htlc message. + * - Added to the commitment transaction of the receiving node and originating node in turn + * through the exchange of commitment_signed and revoke_and_ack messages. + * - Announced for resolution (fulfillment or failure) by the receiving node through either one of + * the update_fulfill_htlc, update_fail_htlc, and update_fail_malformed_htlc messages. + * - Removed from the commitment transaction of the originating node and receiving node in turn + * through the exchange of commitment_signed and revoke_and_ack messages. + * + * This can be used to inspect what next message an HTLC is waiting for to advance its state. + */ +public enum InboundHTLCStateDetails { + /** + * We have added this HTLC in our commitment transaction by receiving commitment_signed and + * returning revoke_and_ack. We are awaiting the appropriate revoke_and_ack's from the remote + * before this HTLC is included on the remote commitment transaction. + */ + LDKInboundHTLCStateDetails_AwaitingRemoteRevokeToAdd, + /** + * This HTLC has been included in the commitment_signed and revoke_and_ack messages on both sides + * and is included in both commitment transactions. + * + * This HTLC is now safe to either forward or be claimed as a payment by us. The HTLC will + * remain in this state until the forwarded upstream HTLC has been resolved and we resolve this + * HTLC correspondingly, or until we claim it as a payment. If it is part of a multipart + * payment, it will only be claimed together with other required parts. + */ + LDKInboundHTLCStateDetails_Committed, + /** + * We have received the preimage for this HTLC and it is being removed by fulfilling it with + * update_fulfill_htlc. This HTLC is still on both commitment transactions, but we are awaiting + * the appropriate revoke_and_ack's from the remote before this HTLC is removed from the remote + * commitment transaction after update_fulfill_htlc. + */ + LDKInboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFulfill, + /** + * The HTLC is being removed by failing it with update_fail_htlc or update_fail_malformed_htlc. + * This HTLC is still on both commitment transactions, but we are awaiting the appropriate + * revoke_and_ack's from the remote before this HTLC is removed from the remote commitment + * transaction. + */ + LDKInboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFail, +}} } } diff --git a/c_sharp/src/org/ldk/enums/OutboundHTLCStateDetails.cs b/c_sharp/src/org/ldk/enums/OutboundHTLCStateDetails.cs new file mode 100644 index 00000000..d917c27d --- /dev/null +++ b/c_sharp/src/org/ldk/enums/OutboundHTLCStateDetails.cs @@ -0,0 +1,44 @@ +namespace org { namespace ldk { namespace enums {/** + * Exposes the state of pending outbound HTLCs. + * + * At a high level, an HTLC being forwarded from one Lightning node to another Lightning node goes + * through the following states in the state machine: + * - Announced for addition by the originating node through the update_add_htlc message. + * - Added to the commitment transaction of the receiving node and originating node in turn + * through the exchange of commitment_signed and revoke_and_ack messages. + * - Announced for resolution (fulfillment or failure) by the receiving node through either one of + * the update_fulfill_htlc, update_fail_htlc, and update_fail_malformed_htlc messages. + * - Removed from the commitment transaction of the originating node and receiving node in turn + * through the exchange of commitment_signed and revoke_and_ack messages. + * + * This can be used to inspect what next message an HTLC is waiting for to advance its state. + */ +public enum OutboundHTLCStateDetails { + /** + * We are awaiting the appropriate revoke_and_ack's from the remote before the HTLC is added + * on the remote's commitment transaction after update_add_htlc. + */ + LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToAdd, + /** + * The HTLC has been added to the remote's commitment transaction by sending commitment_signed + * and receiving revoke_and_ack in return. + * + * The HTLC will remain in this state until the remote node resolves the HTLC, or until we + * unilaterally close the channel due to a timeout with an uncooperative remote node. + */ + LDKOutboundHTLCStateDetails_Committed, + /** + * The HTLC has been fulfilled successfully by the remote with a preimage in update_fulfill_htlc, + * and we removed the HTLC from our commitment transaction by receiving commitment_signed and + * returning revoke_and_ack. We are awaiting the appropriate revoke_and_ack's from the remote + * for the removal from its commitment transaction. + */ + LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveSuccess, + /** + * The HTLC has been failed by the remote with update_fail_htlc or update_fail_malformed_htlc, + * and we removed the HTLC from our commitment transaction by receiving commitment_signed and + * returning revoke_and_ack. We are awaiting the appropriate revoke_and_ack's from the remote + * for the removal from its commitment transaction. + */ + LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFailure, +}} } } diff --git a/c_sharp/src/org/ldk/impl/bindings.cs b/c_sharp/src/org/ldk/impl/bindings.cs index 4e16b9cb..1737fdc6 100644 --- a/c_sharp/src/org/ldk/impl/bindings.cs +++ b/c_sharp/src/org/ldk/impl/bindings.cs @@ -825,8 +825,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_u64u16Z_get_b")] public static extern short C2Tuple_u64u16Z_get_b(long _owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_C2Tuple_u64u16ZZ_ty_from_ptr")] public static extern long LDKCOption_C2Tuple_u64u16ZZ_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_C2Tuple_u64u16ZZ_Some_get_some")] public static extern long LDKCOption_C2Tuple_u64u16ZZ_Some_get_some(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_ChannelShutdownStateZ_ty_from_ptr")] public static extern long LDKCOption_ChannelShutdownStateZ_ty_from_ptr(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_ChannelShutdownStateZ_Some_get_some")] public static extern ChannelShutdownState LDKCOption_ChannelShutdownStateZ_Some_get_some(long ptr); // struct LDKChannelId CResult_ChannelIdAPIErrorZ_get_ok(LDKCResult_ChannelIdAPIErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelIdAPIErrorZ_get_ok")] public static extern long CResult_ChannelIdAPIErrorZ_get_ok(long _owner); // struct LDKAPIError CResult_ChannelIdAPIErrorZ_get_err(LDKCResult_ChannelIdAPIErrorZ *NONNULL_PTR owner); @@ -910,18 +908,6 @@ internal class bindings { [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); - // struct LDKCounterpartyForwardingInfo CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok")] public static extern long CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err")] public static extern long CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(long _owner); - // struct LDKChannelCounterparty CResult_ChannelCounterpartyDecodeErrorZ_get_ok(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_get_ok")] public static extern long CResult_ChannelCounterpartyDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_ChannelCounterpartyDecodeErrorZ_get_err(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_get_err")] public static extern long CResult_ChannelCounterpartyDecodeErrorZ_get_err(long _owner); - // struct LDKChannelDetails CResult_ChannelDetailsDecodeErrorZ_get_ok(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelDetailsDecodeErrorZ_get_ok")] public static extern long CResult_ChannelDetailsDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_ChannelDetailsDecodeErrorZ_get_err(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelDetailsDecodeErrorZ_get_err")] public static extern long CResult_ChannelDetailsDecodeErrorZ_get_err(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); @@ -959,10 +945,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedFailureDecodeErrorZ_get_ok")] public static extern BlindedFailure CResult_BlindedFailureDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_BlindedFailureDecodeErrorZ_get_err(LDKCResult_BlindedFailureDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedFailureDecodeErrorZ_get_err")] public static extern long CResult_BlindedFailureDecodeErrorZ_get_err(long _owner); - // enum LDKChannelShutdownState CResult_ChannelShutdownStateDecodeErrorZ_get_ok(LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR owner); - [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); public interface LDKWatch { long watch_channel(long funding_txo, long monitor); ChannelMonitorUpdateStatus update_channel(long funding_txo, long update); @@ -1639,6 +1621,44 @@ internal class bindings { [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); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_get_ok")] public static extern long CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_get_err(LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_get_err")] public static extern long CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_get_err(long _owner); + // struct LDKInboundHTLCDetails CResult_InboundHTLCDetailsDecodeErrorZ_get_ok(LDKCResult_InboundHTLCDetailsDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InboundHTLCDetailsDecodeErrorZ_get_ok")] public static extern long CResult_InboundHTLCDetailsDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_InboundHTLCDetailsDecodeErrorZ_get_err(LDKCResult_InboundHTLCDetailsDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InboundHTLCDetailsDecodeErrorZ_get_err")] public static extern long CResult_InboundHTLCDetailsDecodeErrorZ_get_err(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_OutboundHTLCStateDetailsZ_ty_from_ptr")] public static extern long LDKCOption_OutboundHTLCStateDetailsZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_OutboundHTLCStateDetailsZ_Some_get_some")] public static extern OutboundHTLCStateDetails LDKCOption_OutboundHTLCStateDetailsZ_Some_get_some(long ptr); + // struct LDKCOption_OutboundHTLCStateDetailsZ CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_get_ok(LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_get_ok")] public static extern long CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_get_err(LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_get_err")] public static extern long CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_get_err(long _owner); + // struct LDKOutboundHTLCDetails CResult_OutboundHTLCDetailsDecodeErrorZ_get_ok(LDKCResult_OutboundHTLCDetailsDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutboundHTLCDetailsDecodeErrorZ_get_ok")] public static extern long CResult_OutboundHTLCDetailsDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_OutboundHTLCDetailsDecodeErrorZ_get_err(LDKCResult_OutboundHTLCDetailsDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutboundHTLCDetailsDecodeErrorZ_get_err")] public static extern long CResult_OutboundHTLCDetailsDecodeErrorZ_get_err(long _owner); + // struct LDKCounterpartyForwardingInfo CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok")] public static extern long CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err")] public static extern long CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(long _owner); + // struct LDKChannelCounterparty CResult_ChannelCounterpartyDecodeErrorZ_get_ok(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_get_ok")] public static extern long CResult_ChannelCounterpartyDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_ChannelCounterpartyDecodeErrorZ_get_err(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_get_err")] public static extern long CResult_ChannelCounterpartyDecodeErrorZ_get_err(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_ChannelShutdownStateZ_ty_from_ptr")] public static extern long LDKCOption_ChannelShutdownStateZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_ChannelShutdownStateZ_Some_get_some")] public static extern ChannelShutdownState LDKCOption_ChannelShutdownStateZ_Some_get_some(long ptr); + // struct LDKChannelDetails CResult_ChannelDetailsDecodeErrorZ_get_ok(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelDetailsDecodeErrorZ_get_ok")] public static extern long CResult_ChannelDetailsDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_ChannelDetailsDecodeErrorZ_get_err(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelDetailsDecodeErrorZ_get_err")] public static extern long CResult_ChannelDetailsDecodeErrorZ_get_err(long _owner); + // enum LDKChannelShutdownState CResult_ChannelShutdownStateDecodeErrorZ_get_ok(LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR owner); + [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 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); @@ -4236,16 +4256,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C2Tuple_u64u16ZZ_clone_ptr")] public static extern long COption_C2Tuple_u64u16ZZ_clone_ptr(long _arg); // struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_clone(const struct LDKCOption_C2Tuple_u64u16ZZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C2Tuple_u64u16ZZ_clone")] public static extern long COption_C2Tuple_u64u16ZZ_clone(long _orig); - // struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_some(enum LDKChannelShutdownState o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ChannelShutdownStateZ_some")] public static extern long COption_ChannelShutdownStateZ_some(ChannelShutdownState _o); - // struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_none(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ChannelShutdownStateZ_none")] public static extern long COption_ChannelShutdownStateZ_none(); - // void COption_ChannelShutdownStateZ_free(struct LDKCOption_ChannelShutdownStateZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ChannelShutdownStateZ_free")] public static extern void COption_ChannelShutdownStateZ_free(long __res); - // uint64_t COption_ChannelShutdownStateZ_clone_ptr(LDKCOption_ChannelShutdownStateZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ChannelShutdownStateZ_clone_ptr")] public static extern long COption_ChannelShutdownStateZ_clone_ptr(long _arg); - // struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_clone(const struct LDKCOption_ChannelShutdownStateZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ChannelShutdownStateZ_clone")] public static extern long COption_ChannelShutdownStateZ_clone(long _orig); // struct LDKCResult_ChannelIdAPIErrorZ CResult_ChannelIdAPIErrorZ_ok(struct LDKChannelId o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelIdAPIErrorZ_ok")] public static extern long CResult_ChannelIdAPIErrorZ_ok(long _o); // struct LDKCResult_ChannelIdAPIErrorZ CResult_ChannelIdAPIErrorZ_err(struct LDKAPIError e); @@ -4420,42 +4430,6 @@ internal class bindings { [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 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(struct LDKCounterpartyForwardingInfo o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_ok")] public static extern long CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(long _o); - // struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_err")] public static extern long CResult_CounterpartyForwardingInfoDecodeErrorZ_err(long _e); - // bool CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok")] public static extern bool CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(long _o); - // void CResult_CounterpartyForwardingInfoDecodeErrorZ_free(struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_free")] public static extern void CResult_CounterpartyForwardingInfoDecodeErrorZ_free(long __res); - // uint64_t CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr")] public static extern long CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone")] public static extern long CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(long _orig); - // struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_ok(struct LDKChannelCounterparty o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_ok")] public static extern long CResult_ChannelCounterpartyDecodeErrorZ_ok(long _o); - // struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_err")] public static extern long CResult_ChannelCounterpartyDecodeErrorZ_err(long _e); - // bool CResult_ChannelCounterpartyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_is_ok")] public static extern bool CResult_ChannelCounterpartyDecodeErrorZ_is_ok(long _o); - // void CResult_ChannelCounterpartyDecodeErrorZ_free(struct LDKCResult_ChannelCounterpartyDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_free")] public static extern void CResult_ChannelCounterpartyDecodeErrorZ_free(long __res); - // uint64_t CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr")] public static extern long CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_clone(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_clone")] public static extern long CResult_ChannelCounterpartyDecodeErrorZ_clone(long _orig); - // struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_ok(struct LDKChannelDetails o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelDetailsDecodeErrorZ_ok")] public static extern long CResult_ChannelDetailsDecodeErrorZ_ok(long _o); - // struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelDetailsDecodeErrorZ_err")] public static extern long CResult_ChannelDetailsDecodeErrorZ_err(long _e); - // bool CResult_ChannelDetailsDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelDetailsDecodeErrorZ_is_ok")] public static extern bool CResult_ChannelDetailsDecodeErrorZ_is_ok(long _o); - // void CResult_ChannelDetailsDecodeErrorZ_free(struct LDKCResult_ChannelDetailsDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelDetailsDecodeErrorZ_free")] public static extern void CResult_ChannelDetailsDecodeErrorZ_free(long __res); - // uint64_t CResult_ChannelDetailsDecodeErrorZ_clone_ptr(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelDetailsDecodeErrorZ_clone_ptr")] public static extern long CResult_ChannelDetailsDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_clone(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelDetailsDecodeErrorZ_clone")] public static extern long CResult_ChannelDetailsDecodeErrorZ_clone(long _orig); // 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); @@ -4516,18 +4490,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedFailureDecodeErrorZ_clone_ptr")] public static extern long CResult_BlindedFailureDecodeErrorZ_clone_ptr(long _arg); // struct LDKCResult_BlindedFailureDecodeErrorZ CResult_BlindedFailureDecodeErrorZ_clone(const struct LDKCResult_BlindedFailureDecodeErrorZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedFailureDecodeErrorZ_clone")] public static extern long CResult_BlindedFailureDecodeErrorZ_clone(long _orig); - // struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_ok(enum LDKChannelShutdownState o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_ok")] public static extern long CResult_ChannelShutdownStateDecodeErrorZ_ok(ChannelShutdownState _o); - // struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_err")] public static extern long CResult_ChannelShutdownStateDecodeErrorZ_err(long _e); - // bool CResult_ChannelShutdownStateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_is_ok")] public static extern bool CResult_ChannelShutdownStateDecodeErrorZ_is_ok(long _o); - // void CResult_ChannelShutdownStateDecodeErrorZ_free(struct LDKCResult_ChannelShutdownStateDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_free")] public static extern void CResult_ChannelShutdownStateDecodeErrorZ_free(long __res); - // uint64_t CResult_ChannelShutdownStateDecodeErrorZ_clone_ptr(LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_clone_ptr")] public static extern long CResult_ChannelShutdownStateDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_clone(const struct LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_clone")] public static extern long CResult_ChannelShutdownStateDecodeErrorZ_clone(long _orig); // void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_ChannelMonitorZ_free")] public static extern void CVec_ChannelMonitorZ_free(long __res); // struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ C2Tuple_ThirtyTwoBytesChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b); @@ -5658,6 +5620,136 @@ internal class bindings { [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); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_InboundHTLCStateDetailsZ_none")] public static extern long COption_InboundHTLCStateDetailsZ_none(); + // void COption_InboundHTLCStateDetailsZ_free(struct LDKCOption_InboundHTLCStateDetailsZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_InboundHTLCStateDetailsZ_free")] public static extern void COption_InboundHTLCStateDetailsZ_free(long __res); + // uint64_t COption_InboundHTLCStateDetailsZ_clone_ptr(LDKCOption_InboundHTLCStateDetailsZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_InboundHTLCStateDetailsZ_clone_ptr")] public static extern long COption_InboundHTLCStateDetailsZ_clone_ptr(long _arg); + // struct LDKCOption_InboundHTLCStateDetailsZ COption_InboundHTLCStateDetailsZ_clone(const struct LDKCOption_InboundHTLCStateDetailsZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_InboundHTLCStateDetailsZ_clone")] public static extern long COption_InboundHTLCStateDetailsZ_clone(long _orig); + // struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_ok(struct LDKCOption_InboundHTLCStateDetailsZ o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_ok")] public static extern long CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_ok(long _o); + // struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_err")] public static extern long CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_err(long _e); + // bool CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_is_ok(const struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_is_ok")] public static extern bool CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_is_ok(long _o); + // void CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_free(struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_free")] public static extern void CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_free(long __res); + // uint64_t CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_clone_ptr(LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_clone_ptr")] public static extern long CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_clone(const struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_clone")] public static extern long CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_clone(long _orig); + // struct LDKCResult_InboundHTLCDetailsDecodeErrorZ CResult_InboundHTLCDetailsDecodeErrorZ_ok(struct LDKInboundHTLCDetails o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InboundHTLCDetailsDecodeErrorZ_ok")] public static extern long CResult_InboundHTLCDetailsDecodeErrorZ_ok(long _o); + // struct LDKCResult_InboundHTLCDetailsDecodeErrorZ CResult_InboundHTLCDetailsDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InboundHTLCDetailsDecodeErrorZ_err")] public static extern long CResult_InboundHTLCDetailsDecodeErrorZ_err(long _e); + // bool CResult_InboundHTLCDetailsDecodeErrorZ_is_ok(const struct LDKCResult_InboundHTLCDetailsDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InboundHTLCDetailsDecodeErrorZ_is_ok")] public static extern bool CResult_InboundHTLCDetailsDecodeErrorZ_is_ok(long _o); + // void CResult_InboundHTLCDetailsDecodeErrorZ_free(struct LDKCResult_InboundHTLCDetailsDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InboundHTLCDetailsDecodeErrorZ_free")] public static extern void CResult_InboundHTLCDetailsDecodeErrorZ_free(long __res); + // uint64_t CResult_InboundHTLCDetailsDecodeErrorZ_clone_ptr(LDKCResult_InboundHTLCDetailsDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InboundHTLCDetailsDecodeErrorZ_clone_ptr")] public static extern long CResult_InboundHTLCDetailsDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_InboundHTLCDetailsDecodeErrorZ CResult_InboundHTLCDetailsDecodeErrorZ_clone(const struct LDKCResult_InboundHTLCDetailsDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InboundHTLCDetailsDecodeErrorZ_clone")] public static extern long CResult_InboundHTLCDetailsDecodeErrorZ_clone(long _orig); + // struct LDKCOption_OutboundHTLCStateDetailsZ COption_OutboundHTLCStateDetailsZ_some(enum LDKOutboundHTLCStateDetails o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_OutboundHTLCStateDetailsZ_some")] public static extern long COption_OutboundHTLCStateDetailsZ_some(OutboundHTLCStateDetails _o); + // struct LDKCOption_OutboundHTLCStateDetailsZ COption_OutboundHTLCStateDetailsZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_OutboundHTLCStateDetailsZ_none")] public static extern long COption_OutboundHTLCStateDetailsZ_none(); + // void COption_OutboundHTLCStateDetailsZ_free(struct LDKCOption_OutboundHTLCStateDetailsZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_OutboundHTLCStateDetailsZ_free")] public static extern void COption_OutboundHTLCStateDetailsZ_free(long __res); + // uint64_t COption_OutboundHTLCStateDetailsZ_clone_ptr(LDKCOption_OutboundHTLCStateDetailsZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_OutboundHTLCStateDetailsZ_clone_ptr")] public static extern long COption_OutboundHTLCStateDetailsZ_clone_ptr(long _arg); + // struct LDKCOption_OutboundHTLCStateDetailsZ COption_OutboundHTLCStateDetailsZ_clone(const struct LDKCOption_OutboundHTLCStateDetailsZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_OutboundHTLCStateDetailsZ_clone")] public static extern long COption_OutboundHTLCStateDetailsZ_clone(long _orig); + // struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_ok(struct LDKCOption_OutboundHTLCStateDetailsZ o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_ok")] public static extern long CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_ok(long _o); + // struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_err")] public static extern long CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_err(long _e); + // bool CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_is_ok(const struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_is_ok")] public static extern bool CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_is_ok(long _o); + // void CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_free(struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_free")] public static extern void CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_free(long __res); + // uint64_t CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_clone_ptr(LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_clone_ptr")] public static extern long CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_clone(const struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_clone")] public static extern long CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_clone(long _orig); + // struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ CResult_OutboundHTLCDetailsDecodeErrorZ_ok(struct LDKOutboundHTLCDetails o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutboundHTLCDetailsDecodeErrorZ_ok")] public static extern long CResult_OutboundHTLCDetailsDecodeErrorZ_ok(long _o); + // struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ CResult_OutboundHTLCDetailsDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutboundHTLCDetailsDecodeErrorZ_err")] public static extern long CResult_OutboundHTLCDetailsDecodeErrorZ_err(long _e); + // bool CResult_OutboundHTLCDetailsDecodeErrorZ_is_ok(const struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutboundHTLCDetailsDecodeErrorZ_is_ok")] public static extern bool CResult_OutboundHTLCDetailsDecodeErrorZ_is_ok(long _o); + // void CResult_OutboundHTLCDetailsDecodeErrorZ_free(struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutboundHTLCDetailsDecodeErrorZ_free")] public static extern void CResult_OutboundHTLCDetailsDecodeErrorZ_free(long __res); + // uint64_t CResult_OutboundHTLCDetailsDecodeErrorZ_clone_ptr(LDKCResult_OutboundHTLCDetailsDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutboundHTLCDetailsDecodeErrorZ_clone_ptr")] public static extern long CResult_OutboundHTLCDetailsDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ CResult_OutboundHTLCDetailsDecodeErrorZ_clone(const struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutboundHTLCDetailsDecodeErrorZ_clone")] public static extern long CResult_OutboundHTLCDetailsDecodeErrorZ_clone(long _orig); + // struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(struct LDKCounterpartyForwardingInfo o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_ok")] public static extern long CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(long _o); + // struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_err")] public static extern long CResult_CounterpartyForwardingInfoDecodeErrorZ_err(long _e); + // bool CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok")] public static extern bool CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(long _o); + // void CResult_CounterpartyForwardingInfoDecodeErrorZ_free(struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_free")] public static extern void CResult_CounterpartyForwardingInfoDecodeErrorZ_free(long __res); + // uint64_t CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr")] public static extern long CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone")] public static extern long CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(long _orig); + // struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_ok(struct LDKChannelCounterparty o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_ok")] public static extern long CResult_ChannelCounterpartyDecodeErrorZ_ok(long _o); + // struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_err")] public static extern long CResult_ChannelCounterpartyDecodeErrorZ_err(long _e); + // bool CResult_ChannelCounterpartyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_is_ok")] public static extern bool CResult_ChannelCounterpartyDecodeErrorZ_is_ok(long _o); + // void CResult_ChannelCounterpartyDecodeErrorZ_free(struct LDKCResult_ChannelCounterpartyDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_free")] public static extern void CResult_ChannelCounterpartyDecodeErrorZ_free(long __res); + // uint64_t CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr")] public static extern long CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_clone(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_clone")] public static extern long CResult_ChannelCounterpartyDecodeErrorZ_clone(long _orig); + // struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_some(enum LDKChannelShutdownState o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ChannelShutdownStateZ_some")] public static extern long COption_ChannelShutdownStateZ_some(ChannelShutdownState _o); + // struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ChannelShutdownStateZ_none")] public static extern long COption_ChannelShutdownStateZ_none(); + // void COption_ChannelShutdownStateZ_free(struct LDKCOption_ChannelShutdownStateZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ChannelShutdownStateZ_free")] public static extern void COption_ChannelShutdownStateZ_free(long __res); + // uint64_t COption_ChannelShutdownStateZ_clone_ptr(LDKCOption_ChannelShutdownStateZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ChannelShutdownStateZ_clone_ptr")] public static extern long COption_ChannelShutdownStateZ_clone_ptr(long _arg); + // struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_clone(const struct LDKCOption_ChannelShutdownStateZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ChannelShutdownStateZ_clone")] public static extern long COption_ChannelShutdownStateZ_clone(long _orig); + // void CVec_InboundHTLCDetailsZ_free(struct LDKCVec_InboundHTLCDetailsZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_InboundHTLCDetailsZ_free")] public static extern void CVec_InboundHTLCDetailsZ_free(long __res); + // void CVec_OutboundHTLCDetailsZ_free(struct LDKCVec_OutboundHTLCDetailsZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_OutboundHTLCDetailsZ_free")] public static extern void CVec_OutboundHTLCDetailsZ_free(long __res); + // struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_ok(struct LDKChannelDetails o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelDetailsDecodeErrorZ_ok")] public static extern long CResult_ChannelDetailsDecodeErrorZ_ok(long _o); + // struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelDetailsDecodeErrorZ_err")] public static extern long CResult_ChannelDetailsDecodeErrorZ_err(long _e); + // bool CResult_ChannelDetailsDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelDetailsDecodeErrorZ_is_ok")] public static extern bool CResult_ChannelDetailsDecodeErrorZ_is_ok(long _o); + // void CResult_ChannelDetailsDecodeErrorZ_free(struct LDKCResult_ChannelDetailsDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelDetailsDecodeErrorZ_free")] public static extern void CResult_ChannelDetailsDecodeErrorZ_free(long __res); + // uint64_t CResult_ChannelDetailsDecodeErrorZ_clone_ptr(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelDetailsDecodeErrorZ_clone_ptr")] public static extern long CResult_ChannelDetailsDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_clone(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelDetailsDecodeErrorZ_clone")] public static extern long CResult_ChannelDetailsDecodeErrorZ_clone(long _orig); + // struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_ok(enum LDKChannelShutdownState o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_ok")] public static extern long CResult_ChannelShutdownStateDecodeErrorZ_ok(ChannelShutdownState _o); + // struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_err")] public static extern long CResult_ChannelShutdownStateDecodeErrorZ_err(long _e); + // bool CResult_ChannelShutdownStateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_is_ok")] public static extern bool CResult_ChannelShutdownStateDecodeErrorZ_is_ok(long _o); + // void CResult_ChannelShutdownStateDecodeErrorZ_free(struct LDKCResult_ChannelShutdownStateDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_free")] public static extern void CResult_ChannelShutdownStateDecodeErrorZ_free(long __res); + // uint64_t CResult_ChannelShutdownStateDecodeErrorZ_clone_ptr(LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_clone_ptr")] public static extern long CResult_ChannelShutdownStateDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_clone(const struct LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR orig); + [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_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_ok(struct LDKOffersMessage o); @@ -6638,6 +6730,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Hostname_eq")] public static extern bool Hostname_eq(long _a, long _b); // MUST_USE_RES uint8_t Hostname_len(const struct LDKHostname *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Hostname_len")] public static extern byte Hostname_len(long _this_arg); + // struct LDKStr Hostname_to_str(const struct LDKHostname *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Hostname_to_str")] public static extern long Hostname_to_str(long _o); // struct LDKCVec_u8Z Hostname_write(const struct LDKHostname *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Hostname_write")] public static extern long Hostname_write(long _obj); // struct LDKCResult_HostnameDecodeErrorZ Hostname_read(struct LDKu8slice ser); @@ -6726,6 +6820,8 @@ internal class bindings { [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); @@ -6734,6 +6830,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PrintableString_set_a")] public static extern void PrintableString_set_a(long _this_ptr, long _val); // MUST_USE_RES struct LDKPrintableString PrintableString_new(struct LDKStr a_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PrintableString_new")] public static extern long PrintableString_new(long _a_arg); + // 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); @@ -6848,6 +6946,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Level_eq")] public static extern bool Level_eq(long _a, long _b); // uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Level_hash")] public static extern long Level_hash(long _o); + // struct LDKStr Level_to_str(const enum LDKLevel *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Level_to_str")] public static extern long Level_to_str(long _o); // MUST_USE_RES enum LDKLevel Level_max(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Level_max")] public static extern Level Level_max(); // void Record_free(struct LDKRecord this_obj); @@ -7404,6 +7504,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutPoint_eq")] public static extern bool OutPoint_eq(long _a, long _b); // uint64_t OutPoint_hash(const struct LDKOutPoint *NONNULL_PTR o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutPoint_hash")] public static extern long OutPoint_hash(long _o); + // struct LDKStr OutPoint_to_str(const struct LDKOutPoint *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutPoint_to_str")] public static extern long OutPoint_to_str(long _o); // struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutPoint_write")] public static extern long OutPoint_write(long _obj); // struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser); @@ -7544,190 +7646,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChainParameters_clone_ptr")] public static extern long ChainParameters_clone_ptr(long _arg); // struct LDKChainParameters ChainParameters_clone(const struct LDKChainParameters *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChainParameters_clone")] public static extern long ChainParameters_clone(long _orig); - // void CounterpartyForwardingInfo_free(struct LDKCounterpartyForwardingInfo this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyForwardingInfo_free")] public static extern void CounterpartyForwardingInfo_free(long _this_obj); - // uint32_t CounterpartyForwardingInfo_get_fee_base_msat(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyForwardingInfo_get_fee_base_msat")] public static extern int CounterpartyForwardingInfo_get_fee_base_msat(long _this_ptr); - // void CounterpartyForwardingInfo_set_fee_base_msat(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyForwardingInfo_set_fee_base_msat")] public static extern void CounterpartyForwardingInfo_set_fee_base_msat(long _this_ptr, int _val); - // uint32_t CounterpartyForwardingInfo_get_fee_proportional_millionths(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyForwardingInfo_get_fee_proportional_millionths")] public static extern int CounterpartyForwardingInfo_get_fee_proportional_millionths(long _this_ptr); - // void CounterpartyForwardingInfo_set_fee_proportional_millionths(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyForwardingInfo_set_fee_proportional_millionths")] public static extern void CounterpartyForwardingInfo_set_fee_proportional_millionths(long _this_ptr, int _val); - // uint16_t CounterpartyForwardingInfo_get_cltv_expiry_delta(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyForwardingInfo_get_cltv_expiry_delta")] public static extern short CounterpartyForwardingInfo_get_cltv_expiry_delta(long _this_ptr); - // void CounterpartyForwardingInfo_set_cltv_expiry_delta(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint16_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyForwardingInfo_set_cltv_expiry_delta")] public static extern void CounterpartyForwardingInfo_set_cltv_expiry_delta(long _this_ptr, short _val); - // MUST_USE_RES struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_new(uint32_t fee_base_msat_arg, uint32_t fee_proportional_millionths_arg, uint16_t cltv_expiry_delta_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyForwardingInfo_new")] public static extern long CounterpartyForwardingInfo_new(int _fee_base_msat_arg, int _fee_proportional_millionths_arg, short _cltv_expiry_delta_arg); - // uint64_t CounterpartyForwardingInfo_clone_ptr(LDKCounterpartyForwardingInfo *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyForwardingInfo_clone_ptr")] public static extern long CounterpartyForwardingInfo_clone_ptr(long _arg); - // struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_clone(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyForwardingInfo_clone")] public static extern long CounterpartyForwardingInfo_clone(long _orig); - // void ChannelCounterparty_free(struct LDKChannelCounterparty this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_free")] public static extern void ChannelCounterparty_free(long _this_obj); - // struct LDKPublicKey ChannelCounterparty_get_node_id(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_get_node_id")] public static extern long ChannelCounterparty_get_node_id(long _this_ptr); - // void ChannelCounterparty_set_node_id(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_set_node_id")] public static extern void ChannelCounterparty_set_node_id(long _this_ptr, long _val); - // struct LDKInitFeatures ChannelCounterparty_get_features(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_get_features")] public static extern long ChannelCounterparty_get_features(long _this_ptr); - // void ChannelCounterparty_set_features(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKInitFeatures val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_set_features")] public static extern void ChannelCounterparty_set_features(long _this_ptr, long _val); - // uint64_t ChannelCounterparty_get_unspendable_punishment_reserve(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_get_unspendable_punishment_reserve")] public static extern long ChannelCounterparty_get_unspendable_punishment_reserve(long _this_ptr); - // void ChannelCounterparty_set_unspendable_punishment_reserve(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_set_unspendable_punishment_reserve")] public static extern void ChannelCounterparty_set_unspendable_punishment_reserve(long _this_ptr, long _val); - // struct LDKCounterpartyForwardingInfo ChannelCounterparty_get_forwarding_info(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_get_forwarding_info")] public static extern long ChannelCounterparty_get_forwarding_info(long _this_ptr); - // void ChannelCounterparty_set_forwarding_info(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCounterpartyForwardingInfo val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_set_forwarding_info")] public static extern void ChannelCounterparty_set_forwarding_info(long _this_ptr, long _val); - // struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_minimum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_get_outbound_htlc_minimum_msat")] public static extern long ChannelCounterparty_get_outbound_htlc_minimum_msat(long _this_ptr); - // void ChannelCounterparty_set_outbound_htlc_minimum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_set_outbound_htlc_minimum_msat")] public static extern void ChannelCounterparty_set_outbound_htlc_minimum_msat(long _this_ptr, long _val); - // struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_maximum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_get_outbound_htlc_maximum_msat")] public static extern long ChannelCounterparty_get_outbound_htlc_maximum_msat(long _this_ptr); - // void ChannelCounterparty_set_outbound_htlc_maximum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_set_outbound_htlc_maximum_msat")] public static extern void ChannelCounterparty_set_outbound_htlc_maximum_msat(long _this_ptr, long _val); - // MUST_USE_RES struct LDKChannelCounterparty ChannelCounterparty_new(struct LDKPublicKey node_id_arg, struct LDKInitFeatures features_arg, uint64_t unspendable_punishment_reserve_arg, struct LDKCounterpartyForwardingInfo forwarding_info_arg, struct LDKCOption_u64Z outbound_htlc_minimum_msat_arg, struct LDKCOption_u64Z outbound_htlc_maximum_msat_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_new")] public static extern long ChannelCounterparty_new(long _node_id_arg, long _features_arg, long _unspendable_punishment_reserve_arg, long _forwarding_info_arg, long _outbound_htlc_minimum_msat_arg, long _outbound_htlc_maximum_msat_arg); - // uint64_t ChannelCounterparty_clone_ptr(LDKChannelCounterparty *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_clone_ptr")] public static extern long ChannelCounterparty_clone_ptr(long _arg); - // struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_clone")] public static extern long ChannelCounterparty_clone(long _orig); - // void ChannelDetails_free(struct LDKChannelDetails this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_free")] public static extern void ChannelDetails_free(long _this_obj); - // struct LDKChannelId ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_channel_id")] public static extern long ChannelDetails_get_channel_id(long _this_ptr); - // void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelId val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_channel_id")] public static extern void ChannelDetails_set_channel_id(long _this_ptr, long _val); - // struct LDKChannelCounterparty ChannelDetails_get_counterparty(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_counterparty")] public static extern long ChannelDetails_get_counterparty(long _this_ptr); - // void ChannelDetails_set_counterparty(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelCounterparty val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_counterparty")] public static extern void ChannelDetails_set_counterparty(long _this_ptr, long _val); - // struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_funding_txo")] public static extern long ChannelDetails_get_funding_txo(long _this_ptr); - // void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_funding_txo")] public static extern void ChannelDetails_set_funding_txo(long _this_ptr, long _val); - // struct LDKChannelTypeFeatures ChannelDetails_get_channel_type(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_channel_type")] public static extern long ChannelDetails_get_channel_type(long _this_ptr); - // void ChannelDetails_set_channel_type(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_channel_type")] public static extern void ChannelDetails_set_channel_type(long _this_ptr, long _val); - // struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_short_channel_id")] public static extern long ChannelDetails_get_short_channel_id(long _this_ptr); - // void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_short_channel_id")] public static extern void ChannelDetails_set_short_channel_id(long _this_ptr, long _val); - // struct LDKCOption_u64Z ChannelDetails_get_outbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_outbound_scid_alias")] public static extern long ChannelDetails_get_outbound_scid_alias(long _this_ptr); - // void ChannelDetails_set_outbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_outbound_scid_alias")] public static extern void ChannelDetails_set_outbound_scid_alias(long _this_ptr, long _val); - // struct LDKCOption_u64Z ChannelDetails_get_inbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_inbound_scid_alias")] public static extern long ChannelDetails_get_inbound_scid_alias(long _this_ptr); - // void ChannelDetails_set_inbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_inbound_scid_alias")] public static extern void ChannelDetails_set_inbound_scid_alias(long _this_ptr, long _val); - // uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_channel_value_satoshis")] public static extern long ChannelDetails_get_channel_value_satoshis(long _this_ptr); - // void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_channel_value_satoshis")] public static extern void ChannelDetails_set_channel_value_satoshis(long _this_ptr, long _val); - // struct LDKCOption_u64Z ChannelDetails_get_unspendable_punishment_reserve(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_unspendable_punishment_reserve")] public static extern long ChannelDetails_get_unspendable_punishment_reserve(long _this_ptr); - // void ChannelDetails_set_unspendable_punishment_reserve(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_unspendable_punishment_reserve")] public static extern void ChannelDetails_set_unspendable_punishment_reserve(long _this_ptr, long _val); - // struct LDKU128 ChannelDetails_get_user_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_user_channel_id")] public static extern long ChannelDetails_get_user_channel_id(long _this_ptr); - // void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKU128 val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_user_channel_id")] public static extern void ChannelDetails_set_user_channel_id(long _this_ptr, long _val); - // struct LDKCOption_u32Z ChannelDetails_get_feerate_sat_per_1000_weight(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_feerate_sat_per_1000_weight")] public static extern long ChannelDetails_get_feerate_sat_per_1000_weight(long _this_ptr); - // void ChannelDetails_set_feerate_sat_per_1000_weight(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_feerate_sat_per_1000_weight")] public static extern void ChannelDetails_set_feerate_sat_per_1000_weight(long _this_ptr, long _val); - // uint64_t ChannelDetails_get_balance_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_balance_msat")] public static extern long ChannelDetails_get_balance_msat(long _this_ptr); - // void ChannelDetails_set_balance_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_balance_msat")] public static extern void ChannelDetails_set_balance_msat(long _this_ptr, long _val); - // uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_outbound_capacity_msat")] public static extern long ChannelDetails_get_outbound_capacity_msat(long _this_ptr); - // void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_outbound_capacity_msat")] public static extern void ChannelDetails_set_outbound_capacity_msat(long _this_ptr, long _val); - // uint64_t ChannelDetails_get_next_outbound_htlc_limit_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_next_outbound_htlc_limit_msat")] public static extern long ChannelDetails_get_next_outbound_htlc_limit_msat(long _this_ptr); - // void ChannelDetails_set_next_outbound_htlc_limit_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_next_outbound_htlc_limit_msat")] public static extern void ChannelDetails_set_next_outbound_htlc_limit_msat(long _this_ptr, long _val); - // uint64_t ChannelDetails_get_next_outbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_next_outbound_htlc_minimum_msat")] public static extern long ChannelDetails_get_next_outbound_htlc_minimum_msat(long _this_ptr); - // void ChannelDetails_set_next_outbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_next_outbound_htlc_minimum_msat")] public static extern void ChannelDetails_set_next_outbound_htlc_minimum_msat(long _this_ptr, long _val); - // uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_inbound_capacity_msat")] public static extern long ChannelDetails_get_inbound_capacity_msat(long _this_ptr); - // void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_inbound_capacity_msat")] public static extern void ChannelDetails_set_inbound_capacity_msat(long _this_ptr, long _val); - // struct LDKCOption_u32Z ChannelDetails_get_confirmations_required(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_confirmations_required")] public static extern long ChannelDetails_get_confirmations_required(long _this_ptr); - // void ChannelDetails_set_confirmations_required(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_confirmations_required")] public static extern void ChannelDetails_set_confirmations_required(long _this_ptr, long _val); - // struct LDKCOption_u32Z ChannelDetails_get_confirmations(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_confirmations")] public static extern long ChannelDetails_get_confirmations(long _this_ptr); - // void ChannelDetails_set_confirmations(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_confirmations")] public static extern void ChannelDetails_set_confirmations(long _this_ptr, long _val); - // struct LDKCOption_u16Z ChannelDetails_get_force_close_spend_delay(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_force_close_spend_delay")] public static extern long ChannelDetails_get_force_close_spend_delay(long _this_ptr); - // void ChannelDetails_set_force_close_spend_delay(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_force_close_spend_delay")] public static extern void ChannelDetails_set_force_close_spend_delay(long _this_ptr, long _val); - // bool ChannelDetails_get_is_outbound(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_is_outbound")] public static extern bool ChannelDetails_get_is_outbound(long _this_ptr); - // void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_is_outbound")] public static extern void ChannelDetails_set_is_outbound(long _this_ptr, bool _val); - // bool ChannelDetails_get_is_channel_ready(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_is_channel_ready")] public static extern bool ChannelDetails_get_is_channel_ready(long _this_ptr); - // void ChannelDetails_set_is_channel_ready(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_is_channel_ready")] public static extern void ChannelDetails_set_is_channel_ready(long _this_ptr, bool _val); - // struct LDKCOption_ChannelShutdownStateZ ChannelDetails_get_channel_shutdown_state(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_channel_shutdown_state")] public static extern long ChannelDetails_get_channel_shutdown_state(long _this_ptr); - // void ChannelDetails_set_channel_shutdown_state(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_ChannelShutdownStateZ val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_channel_shutdown_state")] public static extern void ChannelDetails_set_channel_shutdown_state(long _this_ptr, long _val); - // bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - [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); - // 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); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_inbound_htlc_minimum_msat")] public static extern void ChannelDetails_set_inbound_htlc_minimum_msat(long _this_ptr, long _val); - // struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_maximum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_inbound_htlc_maximum_msat")] public static extern long ChannelDetails_get_inbound_htlc_maximum_msat(long _this_ptr); - // void ChannelDetails_set_inbound_htlc_maximum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_inbound_htlc_maximum_msat")] public static extern void ChannelDetails_set_inbound_htlc_maximum_msat(long _this_ptr, long _val); - // struct LDKChannelConfig ChannelDetails_get_config(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_config")] public static extern long ChannelDetails_get_config(long _this_ptr); - // void ChannelDetails_set_config(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelConfig val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_config")] public static extern void ChannelDetails_set_config(long _this_ptr, long _val); - // 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); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_clone")] public static extern long ChannelDetails_clone(long _orig); - // MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_inbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_inbound_payment_scid")] public static extern long ChannelDetails_get_inbound_payment_scid(long _this_arg); - // MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_outbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_outbound_payment_scid")] public static extern long ChannelDetails_get_outbound_payment_scid(long _this_arg); - // enum LDKChannelShutdownState ChannelShutdownState_clone(const enum LDKChannelShutdownState *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelShutdownState_clone")] public static extern ChannelShutdownState ChannelShutdownState_clone(long _orig); - // enum LDKChannelShutdownState ChannelShutdownState_not_shutting_down(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelShutdownState_not_shutting_down")] public static extern ChannelShutdownState ChannelShutdownState_not_shutting_down(); - // enum LDKChannelShutdownState ChannelShutdownState_shutdown_initiated(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelShutdownState_shutdown_initiated")] public static extern ChannelShutdownState ChannelShutdownState_shutdown_initiated(); - // enum LDKChannelShutdownState ChannelShutdownState_resolving_htlcs(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelShutdownState_resolving_htlcs")] public static extern ChannelShutdownState ChannelShutdownState_resolving_htlcs(); - // enum LDKChannelShutdownState ChannelShutdownState_negotiating_closing_fee(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelShutdownState_negotiating_closing_fee")] public static extern ChannelShutdownState ChannelShutdownState_negotiating_closing_fee(); - // enum LDKChannelShutdownState ChannelShutdownState_shutdown_complete(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelShutdownState_shutdown_complete")] public static extern ChannelShutdownState ChannelShutdownState_shutdown_complete(); - // bool ChannelShutdownState_eq(const enum LDKChannelShutdownState *NONNULL_PTR a, const enum LDKChannelShutdownState *NONNULL_PTR b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelShutdownState_eq")] public static extern bool ChannelShutdownState_eq(long _a, long _b); // void RecentPaymentDetails_free(struct LDKRecentPaymentDetails this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RecentPaymentDetails_free")] public static extern void RecentPaymentDetails_free(long _this_ptr); // uint64_t RecentPaymentDetails_clone_ptr(LDKRecentPaymentDetails *NONNULL_PTR arg); @@ -7886,18 +7804,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_as_NodeIdLookUp")] public static extern long ChannelManager_as_NodeIdLookUp(long _this_arg); // struct LDKInitFeatures provided_init_features(const struct LDKUserConfig *NONNULL_PTR config); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_provided_init_features")] public static extern long provided_init_features(long _config); - // struct LDKCVec_u8Z CounterpartyForwardingInfo_write(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyForwardingInfo_write")] public static extern long CounterpartyForwardingInfo_write(long _obj); - // struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CounterpartyForwardingInfo_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyForwardingInfo_read")] public static extern long CounterpartyForwardingInfo_read(long _ser); - // struct LDKCVec_u8Z ChannelCounterparty_write(const struct LDKChannelCounterparty *NONNULL_PTR obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_write")] public static extern long ChannelCounterparty_write(long _obj); - // struct LDKCResult_ChannelCounterpartyDecodeErrorZ ChannelCounterparty_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_read")] public static extern long ChannelCounterparty_read(long _ser); - // struct LDKCVec_u8Z ChannelDetails_write(const struct LDKChannelDetails *NONNULL_PTR obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_write")] public static extern long ChannelDetails_write(long _obj); - // struct LDKCResult_ChannelDetailsDecodeErrorZ ChannelDetails_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_read")] public static extern long ChannelDetails_read(long _ser); // struct LDKCVec_u8Z PhantomRouteHints_write(const struct LDKPhantomRouteHints *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomRouteHints_write")] public static extern long PhantomRouteHints_write(long _obj); // struct LDKCResult_PhantomRouteHintsDecodeErrorZ PhantomRouteHints_read(struct LDKu8slice ser); @@ -7920,10 +7826,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedFailure_read")] public static extern long BlindedFailure_read(long _ser); // struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_write")] public static extern long ChannelManager_write(long _obj); - // struct LDKCVec_u8Z ChannelShutdownState_write(const enum LDKChannelShutdownState *NONNULL_PTR obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelShutdownState_write")] public static extern long ChannelShutdownState_write(long _obj); - // struct LDKCResult_ChannelShutdownStateDecodeErrorZ ChannelShutdownState_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelShutdownState_read")] public static extern long ChannelShutdownState_read(long _ser); // void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManagerReadArgs_free")] public static extern void ChannelManagerReadArgs_free(long _this_obj); // const struct LDKEntropySource *ChannelManagerReadArgs_get_entropy_source(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr); @@ -8110,6 +8012,320 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RevocationKey_write")] public static extern long RevocationKey_write(long _obj); // struct LDKCResult_RevocationKeyDecodeErrorZ RevocationKey_read(struct LDKu8slice ser); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RevocationKey_read")] public static extern long RevocationKey_read(long _ser); + // enum LDKInboundHTLCStateDetails InboundHTLCStateDetails_clone(const enum LDKInboundHTLCStateDetails *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InboundHTLCStateDetails_clone")] public static extern InboundHTLCStateDetails InboundHTLCStateDetails_clone(long _orig); + // enum LDKInboundHTLCStateDetails InboundHTLCStateDetails_awaiting_remote_revoke_to_add(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InboundHTLCStateDetails_awaiting_remote_revoke_to_add")] public static extern InboundHTLCStateDetails InboundHTLCStateDetails_awaiting_remote_revoke_to_add(); + // enum LDKInboundHTLCStateDetails InboundHTLCStateDetails_committed(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InboundHTLCStateDetails_committed")] public static extern InboundHTLCStateDetails InboundHTLCStateDetails_committed(); + // enum LDKInboundHTLCStateDetails InboundHTLCStateDetails_awaiting_remote_revoke_to_remove_fulfill(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InboundHTLCStateDetails_awaiting_remote_revoke_to_remove_fulfill")] public static extern InboundHTLCStateDetails InboundHTLCStateDetails_awaiting_remote_revoke_to_remove_fulfill(); + // enum LDKInboundHTLCStateDetails InboundHTLCStateDetails_awaiting_remote_revoke_to_remove_fail(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InboundHTLCStateDetails_awaiting_remote_revoke_to_remove_fail")] public static extern InboundHTLCStateDetails InboundHTLCStateDetails_awaiting_remote_revoke_to_remove_fail(); + // struct LDKCVec_u8Z InboundHTLCStateDetails_write(const enum LDKInboundHTLCStateDetails *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InboundHTLCStateDetails_write")] public static extern long InboundHTLCStateDetails_write(long _obj); + // struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ InboundHTLCStateDetails_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InboundHTLCStateDetails_read")] public static extern long InboundHTLCStateDetails_read(long _ser); + // void InboundHTLCDetails_free(struct LDKInboundHTLCDetails this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InboundHTLCDetails_free")] public static extern void InboundHTLCDetails_free(long _this_obj); + // uint64_t InboundHTLCDetails_get_htlc_id(const struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InboundHTLCDetails_get_htlc_id")] public static extern long InboundHTLCDetails_get_htlc_id(long _this_ptr); + // void InboundHTLCDetails_set_htlc_id(struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InboundHTLCDetails_set_htlc_id")] public static extern void InboundHTLCDetails_set_htlc_id(long _this_ptr, long _val); + // uint64_t InboundHTLCDetails_get_amount_msat(const struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InboundHTLCDetails_get_amount_msat")] public static extern long InboundHTLCDetails_get_amount_msat(long _this_ptr); + // void InboundHTLCDetails_set_amount_msat(struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InboundHTLCDetails_set_amount_msat")] public static extern void InboundHTLCDetails_set_amount_msat(long _this_ptr, long _val); + // uint32_t InboundHTLCDetails_get_cltv_expiry(const struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InboundHTLCDetails_get_cltv_expiry")] public static extern int InboundHTLCDetails_get_cltv_expiry(long _this_ptr); + // void InboundHTLCDetails_set_cltv_expiry(struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr, uint32_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InboundHTLCDetails_set_cltv_expiry")] public static extern void InboundHTLCDetails_set_cltv_expiry(long _this_ptr, int _val); + // const uint8_t (*InboundHTLCDetails_get_payment_hash(const struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InboundHTLCDetails_get_payment_hash")] public static extern long InboundHTLCDetails_get_payment_hash(long _this_ptr); + // void InboundHTLCDetails_set_payment_hash(struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InboundHTLCDetails_set_payment_hash")] public static extern void InboundHTLCDetails_set_payment_hash(long _this_ptr, long _val); + // struct LDKCOption_InboundHTLCStateDetailsZ InboundHTLCDetails_get_state(const struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InboundHTLCDetails_get_state")] public static extern long InboundHTLCDetails_get_state(long _this_ptr); + // void InboundHTLCDetails_set_state(struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr, struct LDKCOption_InboundHTLCStateDetailsZ val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InboundHTLCDetails_set_state")] public static extern void InboundHTLCDetails_set_state(long _this_ptr, long _val); + // bool InboundHTLCDetails_get_is_dust(const struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InboundHTLCDetails_get_is_dust")] public static extern bool InboundHTLCDetails_get_is_dust(long _this_ptr); + // void InboundHTLCDetails_set_is_dust(struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr, bool val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InboundHTLCDetails_set_is_dust")] public static extern void InboundHTLCDetails_set_is_dust(long _this_ptr, bool _val); + // MUST_USE_RES struct LDKInboundHTLCDetails InboundHTLCDetails_new(uint64_t htlc_id_arg, uint64_t amount_msat_arg, uint32_t cltv_expiry_arg, struct LDKThirtyTwoBytes payment_hash_arg, struct LDKCOption_InboundHTLCStateDetailsZ state_arg, bool is_dust_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InboundHTLCDetails_new")] public static extern long InboundHTLCDetails_new(long _htlc_id_arg, long _amount_msat_arg, int _cltv_expiry_arg, long _payment_hash_arg, long _state_arg, bool _is_dust_arg); + // uint64_t InboundHTLCDetails_clone_ptr(LDKInboundHTLCDetails *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InboundHTLCDetails_clone_ptr")] public static extern long InboundHTLCDetails_clone_ptr(long _arg); + // struct LDKInboundHTLCDetails InboundHTLCDetails_clone(const struct LDKInboundHTLCDetails *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InboundHTLCDetails_clone")] public static extern long InboundHTLCDetails_clone(long _orig); + // struct LDKCVec_u8Z InboundHTLCDetails_write(const struct LDKInboundHTLCDetails *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InboundHTLCDetails_write")] public static extern long InboundHTLCDetails_write(long _obj); + // struct LDKCResult_InboundHTLCDetailsDecodeErrorZ InboundHTLCDetails_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InboundHTLCDetails_read")] public static extern long InboundHTLCDetails_read(long _ser); + // enum LDKOutboundHTLCStateDetails OutboundHTLCStateDetails_clone(const enum LDKOutboundHTLCStateDetails *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutboundHTLCStateDetails_clone")] public static extern OutboundHTLCStateDetails OutboundHTLCStateDetails_clone(long _orig); + // enum LDKOutboundHTLCStateDetails OutboundHTLCStateDetails_awaiting_remote_revoke_to_add(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutboundHTLCStateDetails_awaiting_remote_revoke_to_add")] public static extern OutboundHTLCStateDetails OutboundHTLCStateDetails_awaiting_remote_revoke_to_add(); + // enum LDKOutboundHTLCStateDetails OutboundHTLCStateDetails_committed(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutboundHTLCStateDetails_committed")] public static extern OutboundHTLCStateDetails OutboundHTLCStateDetails_committed(); + // enum LDKOutboundHTLCStateDetails OutboundHTLCStateDetails_awaiting_remote_revoke_to_remove_success(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutboundHTLCStateDetails_awaiting_remote_revoke_to_remove_success")] public static extern OutboundHTLCStateDetails OutboundHTLCStateDetails_awaiting_remote_revoke_to_remove_success(); + // enum LDKOutboundHTLCStateDetails OutboundHTLCStateDetails_awaiting_remote_revoke_to_remove_failure(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutboundHTLCStateDetails_awaiting_remote_revoke_to_remove_failure")] public static extern OutboundHTLCStateDetails OutboundHTLCStateDetails_awaiting_remote_revoke_to_remove_failure(); + // struct LDKCVec_u8Z OutboundHTLCStateDetails_write(const enum LDKOutboundHTLCStateDetails *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutboundHTLCStateDetails_write")] public static extern long OutboundHTLCStateDetails_write(long _obj); + // struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ OutboundHTLCStateDetails_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutboundHTLCStateDetails_read")] public static extern long OutboundHTLCStateDetails_read(long _ser); + // void OutboundHTLCDetails_free(struct LDKOutboundHTLCDetails this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutboundHTLCDetails_free")] public static extern void OutboundHTLCDetails_free(long _this_obj); + // struct LDKCOption_u64Z OutboundHTLCDetails_get_htlc_id(const struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutboundHTLCDetails_get_htlc_id")] public static extern long OutboundHTLCDetails_get_htlc_id(long _this_ptr); + // void OutboundHTLCDetails_set_htlc_id(struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutboundHTLCDetails_set_htlc_id")] public static extern void OutboundHTLCDetails_set_htlc_id(long _this_ptr, long _val); + // uint64_t OutboundHTLCDetails_get_amount_msat(const struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutboundHTLCDetails_get_amount_msat")] public static extern long OutboundHTLCDetails_get_amount_msat(long _this_ptr); + // void OutboundHTLCDetails_set_amount_msat(struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutboundHTLCDetails_set_amount_msat")] public static extern void OutboundHTLCDetails_set_amount_msat(long _this_ptr, long _val); + // uint32_t OutboundHTLCDetails_get_cltv_expiry(const struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutboundHTLCDetails_get_cltv_expiry")] public static extern int OutboundHTLCDetails_get_cltv_expiry(long _this_ptr); + // void OutboundHTLCDetails_set_cltv_expiry(struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr, uint32_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutboundHTLCDetails_set_cltv_expiry")] public static extern void OutboundHTLCDetails_set_cltv_expiry(long _this_ptr, int _val); + // const uint8_t (*OutboundHTLCDetails_get_payment_hash(const struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutboundHTLCDetails_get_payment_hash")] public static extern long OutboundHTLCDetails_get_payment_hash(long _this_ptr); + // void OutboundHTLCDetails_set_payment_hash(struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutboundHTLCDetails_set_payment_hash")] public static extern void OutboundHTLCDetails_set_payment_hash(long _this_ptr, long _val); + // struct LDKCOption_OutboundHTLCStateDetailsZ OutboundHTLCDetails_get_state(const struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutboundHTLCDetails_get_state")] public static extern long OutboundHTLCDetails_get_state(long _this_ptr); + // void OutboundHTLCDetails_set_state(struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr, struct LDKCOption_OutboundHTLCStateDetailsZ val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutboundHTLCDetails_set_state")] public static extern void OutboundHTLCDetails_set_state(long _this_ptr, long _val); + // struct LDKCOption_u64Z OutboundHTLCDetails_get_skimmed_fee_msat(const struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutboundHTLCDetails_get_skimmed_fee_msat")] public static extern long OutboundHTLCDetails_get_skimmed_fee_msat(long _this_ptr); + // void OutboundHTLCDetails_set_skimmed_fee_msat(struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutboundHTLCDetails_set_skimmed_fee_msat")] public static extern void OutboundHTLCDetails_set_skimmed_fee_msat(long _this_ptr, long _val); + // bool OutboundHTLCDetails_get_is_dust(const struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutboundHTLCDetails_get_is_dust")] public static extern bool OutboundHTLCDetails_get_is_dust(long _this_ptr); + // void OutboundHTLCDetails_set_is_dust(struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr, bool val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutboundHTLCDetails_set_is_dust")] public static extern void OutboundHTLCDetails_set_is_dust(long _this_ptr, bool _val); + // MUST_USE_RES struct LDKOutboundHTLCDetails OutboundHTLCDetails_new(struct LDKCOption_u64Z htlc_id_arg, uint64_t amount_msat_arg, uint32_t cltv_expiry_arg, struct LDKThirtyTwoBytes payment_hash_arg, struct LDKCOption_OutboundHTLCStateDetailsZ state_arg, struct LDKCOption_u64Z skimmed_fee_msat_arg, bool is_dust_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutboundHTLCDetails_new")] public static extern long OutboundHTLCDetails_new(long _htlc_id_arg, long _amount_msat_arg, int _cltv_expiry_arg, long _payment_hash_arg, long _state_arg, long _skimmed_fee_msat_arg, bool _is_dust_arg); + // uint64_t OutboundHTLCDetails_clone_ptr(LDKOutboundHTLCDetails *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutboundHTLCDetails_clone_ptr")] public static extern long OutboundHTLCDetails_clone_ptr(long _arg); + // struct LDKOutboundHTLCDetails OutboundHTLCDetails_clone(const struct LDKOutboundHTLCDetails *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutboundHTLCDetails_clone")] public static extern long OutboundHTLCDetails_clone(long _orig); + // struct LDKCVec_u8Z OutboundHTLCDetails_write(const struct LDKOutboundHTLCDetails *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutboundHTLCDetails_write")] public static extern long OutboundHTLCDetails_write(long _obj); + // struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ OutboundHTLCDetails_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutboundHTLCDetails_read")] public static extern long OutboundHTLCDetails_read(long _ser); + // void CounterpartyForwardingInfo_free(struct LDKCounterpartyForwardingInfo this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyForwardingInfo_free")] public static extern void CounterpartyForwardingInfo_free(long _this_obj); + // uint32_t CounterpartyForwardingInfo_get_fee_base_msat(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyForwardingInfo_get_fee_base_msat")] public static extern int CounterpartyForwardingInfo_get_fee_base_msat(long _this_ptr); + // void CounterpartyForwardingInfo_set_fee_base_msat(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyForwardingInfo_set_fee_base_msat")] public static extern void CounterpartyForwardingInfo_set_fee_base_msat(long _this_ptr, int _val); + // uint32_t CounterpartyForwardingInfo_get_fee_proportional_millionths(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyForwardingInfo_get_fee_proportional_millionths")] public static extern int CounterpartyForwardingInfo_get_fee_proportional_millionths(long _this_ptr); + // void CounterpartyForwardingInfo_set_fee_proportional_millionths(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyForwardingInfo_set_fee_proportional_millionths")] public static extern void CounterpartyForwardingInfo_set_fee_proportional_millionths(long _this_ptr, int _val); + // uint16_t CounterpartyForwardingInfo_get_cltv_expiry_delta(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyForwardingInfo_get_cltv_expiry_delta")] public static extern short CounterpartyForwardingInfo_get_cltv_expiry_delta(long _this_ptr); + // void CounterpartyForwardingInfo_set_cltv_expiry_delta(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint16_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyForwardingInfo_set_cltv_expiry_delta")] public static extern void CounterpartyForwardingInfo_set_cltv_expiry_delta(long _this_ptr, short _val); + // MUST_USE_RES struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_new(uint32_t fee_base_msat_arg, uint32_t fee_proportional_millionths_arg, uint16_t cltv_expiry_delta_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyForwardingInfo_new")] public static extern long CounterpartyForwardingInfo_new(int _fee_base_msat_arg, int _fee_proportional_millionths_arg, short _cltv_expiry_delta_arg); + // uint64_t CounterpartyForwardingInfo_clone_ptr(LDKCounterpartyForwardingInfo *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyForwardingInfo_clone_ptr")] public static extern long CounterpartyForwardingInfo_clone_ptr(long _arg); + // struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_clone(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyForwardingInfo_clone")] public static extern long CounterpartyForwardingInfo_clone(long _orig); + // struct LDKCVec_u8Z CounterpartyForwardingInfo_write(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyForwardingInfo_write")] public static extern long CounterpartyForwardingInfo_write(long _obj); + // struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CounterpartyForwardingInfo_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyForwardingInfo_read")] public static extern long CounterpartyForwardingInfo_read(long _ser); + // void ChannelCounterparty_free(struct LDKChannelCounterparty this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_free")] public static extern void ChannelCounterparty_free(long _this_obj); + // struct LDKPublicKey ChannelCounterparty_get_node_id(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_get_node_id")] public static extern long ChannelCounterparty_get_node_id(long _this_ptr); + // void ChannelCounterparty_set_node_id(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_set_node_id")] public static extern void ChannelCounterparty_set_node_id(long _this_ptr, long _val); + // struct LDKInitFeatures ChannelCounterparty_get_features(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_get_features")] public static extern long ChannelCounterparty_get_features(long _this_ptr); + // void ChannelCounterparty_set_features(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKInitFeatures val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_set_features")] public static extern void ChannelCounterparty_set_features(long _this_ptr, long _val); + // uint64_t ChannelCounterparty_get_unspendable_punishment_reserve(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_get_unspendable_punishment_reserve")] public static extern long ChannelCounterparty_get_unspendable_punishment_reserve(long _this_ptr); + // void ChannelCounterparty_set_unspendable_punishment_reserve(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_set_unspendable_punishment_reserve")] public static extern void ChannelCounterparty_set_unspendable_punishment_reserve(long _this_ptr, long _val); + // struct LDKCounterpartyForwardingInfo ChannelCounterparty_get_forwarding_info(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_get_forwarding_info")] public static extern long ChannelCounterparty_get_forwarding_info(long _this_ptr); + // void ChannelCounterparty_set_forwarding_info(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCounterpartyForwardingInfo val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_set_forwarding_info")] public static extern void ChannelCounterparty_set_forwarding_info(long _this_ptr, long _val); + // struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_minimum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_get_outbound_htlc_minimum_msat")] public static extern long ChannelCounterparty_get_outbound_htlc_minimum_msat(long _this_ptr); + // void ChannelCounterparty_set_outbound_htlc_minimum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_set_outbound_htlc_minimum_msat")] public static extern void ChannelCounterparty_set_outbound_htlc_minimum_msat(long _this_ptr, long _val); + // struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_maximum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_get_outbound_htlc_maximum_msat")] public static extern long ChannelCounterparty_get_outbound_htlc_maximum_msat(long _this_ptr); + // void ChannelCounterparty_set_outbound_htlc_maximum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_set_outbound_htlc_maximum_msat")] public static extern void ChannelCounterparty_set_outbound_htlc_maximum_msat(long _this_ptr, long _val); + // MUST_USE_RES struct LDKChannelCounterparty ChannelCounterparty_new(struct LDKPublicKey node_id_arg, struct LDKInitFeatures features_arg, uint64_t unspendable_punishment_reserve_arg, struct LDKCounterpartyForwardingInfo forwarding_info_arg, struct LDKCOption_u64Z outbound_htlc_minimum_msat_arg, struct LDKCOption_u64Z outbound_htlc_maximum_msat_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_new")] public static extern long ChannelCounterparty_new(long _node_id_arg, long _features_arg, long _unspendable_punishment_reserve_arg, long _forwarding_info_arg, long _outbound_htlc_minimum_msat_arg, long _outbound_htlc_maximum_msat_arg); + // uint64_t ChannelCounterparty_clone_ptr(LDKChannelCounterparty *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_clone_ptr")] public static extern long ChannelCounterparty_clone_ptr(long _arg); + // struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_clone")] public static extern long ChannelCounterparty_clone(long _orig); + // struct LDKCVec_u8Z ChannelCounterparty_write(const struct LDKChannelCounterparty *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_write")] public static extern long ChannelCounterparty_write(long _obj); + // struct LDKCResult_ChannelCounterpartyDecodeErrorZ ChannelCounterparty_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_read")] public static extern long ChannelCounterparty_read(long _ser); + // void ChannelDetails_free(struct LDKChannelDetails this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_free")] public static extern void ChannelDetails_free(long _this_obj); + // struct LDKChannelId ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_channel_id")] public static extern long ChannelDetails_get_channel_id(long _this_ptr); + // void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelId val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_channel_id")] public static extern void ChannelDetails_set_channel_id(long _this_ptr, long _val); + // struct LDKChannelCounterparty ChannelDetails_get_counterparty(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_counterparty")] public static extern long ChannelDetails_get_counterparty(long _this_ptr); + // void ChannelDetails_set_counterparty(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelCounterparty val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_counterparty")] public static extern void ChannelDetails_set_counterparty(long _this_ptr, long _val); + // struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_funding_txo")] public static extern long ChannelDetails_get_funding_txo(long _this_ptr); + // void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_funding_txo")] public static extern void ChannelDetails_set_funding_txo(long _this_ptr, long _val); + // struct LDKChannelTypeFeatures ChannelDetails_get_channel_type(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_channel_type")] public static extern long ChannelDetails_get_channel_type(long _this_ptr); + // void ChannelDetails_set_channel_type(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_channel_type")] public static extern void ChannelDetails_set_channel_type(long _this_ptr, long _val); + // struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_short_channel_id")] public static extern long ChannelDetails_get_short_channel_id(long _this_ptr); + // void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_short_channel_id")] public static extern void ChannelDetails_set_short_channel_id(long _this_ptr, long _val); + // struct LDKCOption_u64Z ChannelDetails_get_outbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_outbound_scid_alias")] public static extern long ChannelDetails_get_outbound_scid_alias(long _this_ptr); + // void ChannelDetails_set_outbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_outbound_scid_alias")] public static extern void ChannelDetails_set_outbound_scid_alias(long _this_ptr, long _val); + // struct LDKCOption_u64Z ChannelDetails_get_inbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_inbound_scid_alias")] public static extern long ChannelDetails_get_inbound_scid_alias(long _this_ptr); + // void ChannelDetails_set_inbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_inbound_scid_alias")] public static extern void ChannelDetails_set_inbound_scid_alias(long _this_ptr, long _val); + // uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_channel_value_satoshis")] public static extern long ChannelDetails_get_channel_value_satoshis(long _this_ptr); + // void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_channel_value_satoshis")] public static extern void ChannelDetails_set_channel_value_satoshis(long _this_ptr, long _val); + // struct LDKCOption_u64Z ChannelDetails_get_unspendable_punishment_reserve(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_unspendable_punishment_reserve")] public static extern long ChannelDetails_get_unspendable_punishment_reserve(long _this_ptr); + // void ChannelDetails_set_unspendable_punishment_reserve(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_unspendable_punishment_reserve")] public static extern void ChannelDetails_set_unspendable_punishment_reserve(long _this_ptr, long _val); + // struct LDKU128 ChannelDetails_get_user_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_user_channel_id")] public static extern long ChannelDetails_get_user_channel_id(long _this_ptr); + // void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKU128 val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_user_channel_id")] public static extern void ChannelDetails_set_user_channel_id(long _this_ptr, long _val); + // struct LDKCOption_u32Z ChannelDetails_get_feerate_sat_per_1000_weight(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_feerate_sat_per_1000_weight")] public static extern long ChannelDetails_get_feerate_sat_per_1000_weight(long _this_ptr); + // void ChannelDetails_set_feerate_sat_per_1000_weight(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_feerate_sat_per_1000_weight")] public static extern void ChannelDetails_set_feerate_sat_per_1000_weight(long _this_ptr, long _val); + // uint64_t ChannelDetails_get_balance_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_balance_msat")] public static extern long ChannelDetails_get_balance_msat(long _this_ptr); + // void ChannelDetails_set_balance_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_balance_msat")] public static extern void ChannelDetails_set_balance_msat(long _this_ptr, long _val); + // uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_outbound_capacity_msat")] public static extern long ChannelDetails_get_outbound_capacity_msat(long _this_ptr); + // void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_outbound_capacity_msat")] public static extern void ChannelDetails_set_outbound_capacity_msat(long _this_ptr, long _val); + // uint64_t ChannelDetails_get_next_outbound_htlc_limit_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_next_outbound_htlc_limit_msat")] public static extern long ChannelDetails_get_next_outbound_htlc_limit_msat(long _this_ptr); + // void ChannelDetails_set_next_outbound_htlc_limit_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_next_outbound_htlc_limit_msat")] public static extern void ChannelDetails_set_next_outbound_htlc_limit_msat(long _this_ptr, long _val); + // uint64_t ChannelDetails_get_next_outbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_next_outbound_htlc_minimum_msat")] public static extern long ChannelDetails_get_next_outbound_htlc_minimum_msat(long _this_ptr); + // void ChannelDetails_set_next_outbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_next_outbound_htlc_minimum_msat")] public static extern void ChannelDetails_set_next_outbound_htlc_minimum_msat(long _this_ptr, long _val); + // uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_inbound_capacity_msat")] public static extern long ChannelDetails_get_inbound_capacity_msat(long _this_ptr); + // void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_inbound_capacity_msat")] public static extern void ChannelDetails_set_inbound_capacity_msat(long _this_ptr, long _val); + // struct LDKCOption_u32Z ChannelDetails_get_confirmations_required(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_confirmations_required")] public static extern long ChannelDetails_get_confirmations_required(long _this_ptr); + // void ChannelDetails_set_confirmations_required(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_confirmations_required")] public static extern void ChannelDetails_set_confirmations_required(long _this_ptr, long _val); + // struct LDKCOption_u32Z ChannelDetails_get_confirmations(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_confirmations")] public static extern long ChannelDetails_get_confirmations(long _this_ptr); + // void ChannelDetails_set_confirmations(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_confirmations")] public static extern void ChannelDetails_set_confirmations(long _this_ptr, long _val); + // struct LDKCOption_u16Z ChannelDetails_get_force_close_spend_delay(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_force_close_spend_delay")] public static extern long ChannelDetails_get_force_close_spend_delay(long _this_ptr); + // void ChannelDetails_set_force_close_spend_delay(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_force_close_spend_delay")] public static extern void ChannelDetails_set_force_close_spend_delay(long _this_ptr, long _val); + // bool ChannelDetails_get_is_outbound(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_is_outbound")] public static extern bool ChannelDetails_get_is_outbound(long _this_ptr); + // void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_is_outbound")] public static extern void ChannelDetails_set_is_outbound(long _this_ptr, bool _val); + // bool ChannelDetails_get_is_channel_ready(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_is_channel_ready")] public static extern bool ChannelDetails_get_is_channel_ready(long _this_ptr); + // void ChannelDetails_set_is_channel_ready(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_is_channel_ready")] public static extern void ChannelDetails_set_is_channel_ready(long _this_ptr, bool _val); + // struct LDKCOption_ChannelShutdownStateZ ChannelDetails_get_channel_shutdown_state(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_channel_shutdown_state")] public static extern long ChannelDetails_get_channel_shutdown_state(long _this_ptr); + // void ChannelDetails_set_channel_shutdown_state(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_ChannelShutdownStateZ val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_channel_shutdown_state")] public static extern void ChannelDetails_set_channel_shutdown_state(long _this_ptr, long _val); + // bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + [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); + // 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); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_inbound_htlc_minimum_msat")] public static extern void ChannelDetails_set_inbound_htlc_minimum_msat(long _this_ptr, long _val); + // struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_maximum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_inbound_htlc_maximum_msat")] public static extern long ChannelDetails_get_inbound_htlc_maximum_msat(long _this_ptr); + // void ChannelDetails_set_inbound_htlc_maximum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_inbound_htlc_maximum_msat")] public static extern void ChannelDetails_set_inbound_htlc_maximum_msat(long _this_ptr, long _val); + // struct LDKChannelConfig ChannelDetails_get_config(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_config")] public static extern long ChannelDetails_get_config(long _this_ptr); + // void ChannelDetails_set_config(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelConfig val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_config")] public static extern void ChannelDetails_set_config(long _this_ptr, long _val); + // struct LDKCVec_InboundHTLCDetailsZ ChannelDetails_get_pending_inbound_htlcs(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_pending_inbound_htlcs")] public static extern long ChannelDetails_get_pending_inbound_htlcs(long _this_ptr); + // void ChannelDetails_set_pending_inbound_htlcs(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCVec_InboundHTLCDetailsZ val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_pending_inbound_htlcs")] public static extern void ChannelDetails_set_pending_inbound_htlcs(long _this_ptr, long _val); + // struct LDKCVec_OutboundHTLCDetailsZ ChannelDetails_get_pending_outbound_htlcs(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + [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); + // 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); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_clone")] public static extern long ChannelDetails_clone(long _orig); + // MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_inbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_inbound_payment_scid")] public static extern long ChannelDetails_get_inbound_payment_scid(long _this_arg); + // MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_outbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_outbound_payment_scid")] public static extern long ChannelDetails_get_outbound_payment_scid(long _this_arg); + // struct LDKCVec_u8Z ChannelDetails_write(const struct LDKChannelDetails *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_write")] public static extern long ChannelDetails_write(long _obj); + // struct LDKCResult_ChannelDetailsDecodeErrorZ ChannelDetails_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_read")] public static extern long ChannelDetails_read(long _ser); + // enum LDKChannelShutdownState ChannelShutdownState_clone(const enum LDKChannelShutdownState *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelShutdownState_clone")] public static extern ChannelShutdownState ChannelShutdownState_clone(long _orig); + // enum LDKChannelShutdownState ChannelShutdownState_not_shutting_down(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelShutdownState_not_shutting_down")] public static extern ChannelShutdownState ChannelShutdownState_not_shutting_down(); + // enum LDKChannelShutdownState ChannelShutdownState_shutdown_initiated(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelShutdownState_shutdown_initiated")] public static extern ChannelShutdownState ChannelShutdownState_shutdown_initiated(); + // enum LDKChannelShutdownState ChannelShutdownState_resolving_htlcs(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelShutdownState_resolving_htlcs")] public static extern ChannelShutdownState ChannelShutdownState_resolving_htlcs(); + // enum LDKChannelShutdownState ChannelShutdownState_negotiating_closing_fee(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelShutdownState_negotiating_closing_fee")] public static extern ChannelShutdownState ChannelShutdownState_negotiating_closing_fee(); + // enum LDKChannelShutdownState ChannelShutdownState_shutdown_complete(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelShutdownState_shutdown_complete")] public static extern ChannelShutdownState ChannelShutdownState_shutdown_complete(); + // bool ChannelShutdownState_eq(const enum LDKChannelShutdownState *NONNULL_PTR a, const enum LDKChannelShutdownState *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelShutdownState_eq")] public static extern bool ChannelShutdownState_eq(long _a, long _b); + // struct LDKCVec_u8Z ChannelShutdownState_write(const enum LDKChannelShutdownState *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelShutdownState_write")] public static extern long ChannelShutdownState_write(long _obj); + // struct LDKCResult_ChannelShutdownStateDecodeErrorZ ChannelShutdownState_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelShutdownState_read")] public static extern long ChannelShutdownState_read(long _ser); // void ExpandedKey_free(struct LDKExpandedKey this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ExpandedKey_free")] public static extern void ExpandedKey_free(long _this_obj); // MUST_USE_RES struct LDKExpandedKey ExpandedKey_new(const uint8_t (*key_material)[32]); @@ -9246,6 +9462,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SocketAddressParseError_hash")] public static extern long SocketAddressParseError_hash(long _o); // bool SocketAddressParseError_eq(const enum LDKSocketAddressParseError *NONNULL_PTR a, const enum LDKSocketAddressParseError *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SocketAddressParseError_eq")] public static extern bool SocketAddressParseError_eq(long _a, long _b); + // struct LDKStr SocketAddressParseError_to_str(const enum LDKSocketAddressParseError *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SocketAddressParseError_to_str")] public static extern long SocketAddressParseError_to_str(long _o); // struct LDKCResult_SocketAddressSocketAddressParseErrorZ parse_onion_address(struct LDKStr host, uint16_t port); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_parse_onion_address")] public static extern long parse_onion_address(long _host, short _port); // struct LDKStr SocketAddress_to_str(const struct LDKSocketAddress *NONNULL_PTR o); @@ -9746,6 +9964,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrampolineOnionPacket_eq")] public static extern bool TrampolineOnionPacket_eq(long _a, long _b); // struct LDKCVec_u8Z TrampolineOnionPacket_write(const struct LDKTrampolineOnionPacket *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrampolineOnionPacket_write")] public static extern long TrampolineOnionPacket_write(long _obj); + // struct LDKStr DecodeError_to_str(const struct LDKDecodeError *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DecodeError_to_str")] public static extern long DecodeError_to_str(long _o); // struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_write")] public static extern long AcceptChannel_write(long _obj); // struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser); @@ -10036,6 +10256,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerHandleError_clone_ptr")] public static extern long PeerHandleError_clone_ptr(long _arg); // struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerHandleError_clone")] public static extern long PeerHandleError_clone(long _orig); + // struct LDKStr PeerHandleError_to_str(const struct LDKPeerHandleError *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerHandleError_to_str")] public static extern long PeerHandleError_to_str(long _o); // void PeerManager_free(struct LDKPeerManager this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerManager_free")] public static extern void PeerManager_free(long _this_obj); // MUST_USE_RES struct LDKPeerManager PeerManager_new(struct LDKMessageHandler message_handler, uint32_t current_time, const uint8_t (*ephemeral_random_data)[32], struct LDKLogger logger, struct LDKNodeSigner node_signer); @@ -11118,6 +11340,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ShutdownScript_as_legacy_pubkey")] public static extern long ShutdownScript_as_legacy_pubkey(long _this_arg); // MUST_USE_RES bool ShutdownScript_is_compatible(const struct LDKShutdownScript *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR features); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ShutdownScript_is_compatible")] public static extern bool ShutdownScript_is_compatible(long _this_arg, long _features); + // struct LDKStr ShutdownScript_to_str(const struct LDKShutdownScript *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ShutdownScript_to_str")] public static extern long ShutdownScript_to_str(long _o); // void ChannelId_free(struct LDKChannelId this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelId_free")] public static extern void ChannelId_free(long _this_obj); // const uint8_t (*ChannelId_get_a(const struct LDKChannelId *NONNULL_PTR this_ptr))[32]; @@ -11154,6 +11378,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelId_write")] public static extern long ChannelId_write(long _obj); // struct LDKCResult_ChannelIdDecodeErrorZ ChannelId_read(struct LDKu8slice ser); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelId_read")] public static extern long ChannelId_read(long _ser); + // 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); // 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); @@ -11388,6 +11614,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Quantity_one")] public static extern long Quantity_one(); // struct LDKCResult_OfferBolt12ParseErrorZ Offer_from_str(struct LDKStr s); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_from_str")] public static extern long Offer_from_str(long _s); + // struct LDKStr Offer_to_str(const struct LDKOffer *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_to_str")] public static extern long Offer_to_str(long _o); // void InvoiceWithExplicitSigningPubkeyBuilder_free(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceWithExplicitSigningPubkeyBuilder_free")] public static extern void InvoiceWithExplicitSigningPubkeyBuilder_free(long _this_obj); // void InvoiceWithDerivedSigningPubkeyBuilder_free(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_obj); @@ -11606,6 +11834,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ErroneousField_clone")] public static extern long ErroneousField_clone(long _orig); // MUST_USE_RES struct LDKInvoiceError InvoiceError_from_string(struct LDKStr s); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceError_from_string")] public static extern long InvoiceError_from_string(long _s); + // struct LDKStr InvoiceError_to_str(const struct LDKInvoiceError *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceError_to_str")] public static extern long InvoiceError_to_str(long _o); // struct LDKCVec_u8Z InvoiceError_write(const struct LDKInvoiceError *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceError_write")] public static extern long InvoiceError_write(long _obj); // struct LDKCResult_InvoiceErrorDecodeErrorZ InvoiceError_read(struct LDKu8slice ser); @@ -11962,6 +12192,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Refund_write")] public static extern long Refund_write(long _obj); // struct LDKCResult_RefundBolt12ParseErrorZ Refund_from_str(struct LDKStr s); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Refund_from_str")] public static extern long Refund_from_str(long _s); + // struct LDKStr Refund_to_str(const struct LDKRefund *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Refund_to_str")] public static extern long Refund_to_str(long _o); // enum LDKUtxoLookupError UtxoLookupError_clone(const enum LDKUtxoLookupError *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UtxoLookupError_clone")] public static extern UtxoLookupError UtxoLookupError_clone(long _orig); // enum LDKUtxoLookupError UtxoLookupError_unknown_chain(void); @@ -12008,6 +12240,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeId_as_array")] public static extern long NodeId_as_array(long _this_arg); // MUST_USE_RES struct LDKCResult_PublicKeySecp256k1ErrorZ NodeId_as_pubkey(const struct LDKNodeId *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeId_as_pubkey")] public static extern long NodeId_as_pubkey(long _this_arg); + // struct LDKStr NodeId_to_str(const struct LDKNodeId *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeId_to_str")] public static extern long NodeId_to_str(long _o); // uint64_t NodeId_hash(const struct LDKNodeId *NONNULL_PTR o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeId_hash")] public static extern long NodeId_hash(long _o); // struct LDKCVec_u8Z NodeId_write(const struct LDKNodeId *NONNULL_PTR obj); @@ -12092,6 +12326,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdateInfo_clone")] public static extern long ChannelUpdateInfo_clone(long _orig); // bool ChannelUpdateInfo_eq(const struct LDKChannelUpdateInfo *NONNULL_PTR a, const struct LDKChannelUpdateInfo *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdateInfo_eq")] public static extern bool ChannelUpdateInfo_eq(long _a, long _b); + // struct LDKStr ChannelUpdateInfo_to_str(const struct LDKChannelUpdateInfo *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdateInfo_to_str")] public static extern long ChannelUpdateInfo_to_str(long _o); // struct LDKCVec_u8Z ChannelUpdateInfo_write(const struct LDKChannelUpdateInfo *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdateInfo_write")] public static extern long ChannelUpdateInfo_write(long _obj); // struct LDKCResult_ChannelUpdateInfoDecodeErrorZ ChannelUpdateInfo_read(struct LDKu8slice ser); @@ -12134,6 +12370,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelInfo_eq")] public static extern bool ChannelInfo_eq(long _a, long _b); // MUST_USE_RES struct LDKChannelUpdateInfo ChannelInfo_get_directional_info(const struct LDKChannelInfo *NONNULL_PTR this_arg, uint8_t channel_flags); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelInfo_get_directional_info")] public static extern long ChannelInfo_get_directional_info(long _this_arg, byte _channel_flags); + // struct LDKStr ChannelInfo_to_str(const struct LDKChannelInfo *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelInfo_to_str")] public static extern long ChannelInfo_to_str(long _o); // struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelInfo_write")] public static extern long ChannelInfo_write(long _obj); // struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser); @@ -12248,6 +12486,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAlias_hash")] public static extern long NodeAlias_hash(long _o); // bool NodeAlias_eq(const struct LDKNodeAlias *NONNULL_PTR a, const struct LDKNodeAlias *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAlias_eq")] public static extern bool NodeAlias_eq(long _a, long _b); + // struct LDKStr NodeAlias_to_str(const struct LDKNodeAlias *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAlias_to_str")] public static extern long NodeAlias_to_str(long _o); // struct LDKCVec_u8Z NodeAlias_write(const struct LDKNodeAlias *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAlias_write")] public static extern long NodeAlias_write(long _obj); // struct LDKCResult_NodeAliasDecodeErrorZ NodeAlias_read(struct LDKu8slice ser); @@ -12272,6 +12512,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeInfo_eq")] public static extern bool NodeInfo_eq(long _a, long _b); // MUST_USE_RES bool NodeInfo_is_tor_only(const struct LDKNodeInfo *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeInfo_is_tor_only")] public static extern bool NodeInfo_is_tor_only(long _this_arg); + // struct LDKStr NodeInfo_to_str(const struct LDKNodeInfo *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeInfo_to_str")] public static extern long NodeInfo_to_str(long _o); // struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeInfo_write")] public static extern long NodeInfo_write(long _obj); // struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser); @@ -12280,6 +12522,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkGraph_write")] public static extern long NetworkGraph_write(long _obj); // struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser, struct LDKLogger arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkGraph_read")] public static extern long NetworkGraph_read(long _ser, long _arg); + // struct LDKStr NetworkGraph_to_str(const struct LDKNetworkGraph *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkGraph_to_str")] public static extern long NetworkGraph_to_str(long _o); // MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(enum LDKNetwork network, struct LDKLogger logger); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkGraph_new")] public static extern long NetworkGraph_new(Network _network, long _logger); // MUST_USE_RES struct LDKReadOnlyNetworkGraph NetworkGraph_read_only(const struct LDKNetworkGraph *NONNULL_PTR this_arg); @@ -12484,6 +12728,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Route_get_total_fees")] public static extern long Route_get_total_fees(long _this_arg); // MUST_USE_RES uint64_t Route_get_total_amount(const struct LDKRoute *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Route_get_total_amount")] public static extern long Route_get_total_amount(long _this_arg); + // struct LDKStr Route_to_str(const struct LDKRoute *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Route_to_str")] public static extern long Route_to_str(long _o); // struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Route_write")] public static extern long Route_write(long _obj); // struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser); @@ -13778,6 +14024,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_htlcs_timed_out")] public static extern long ClosureReason_htlcs_timed_out(); // bool ClosureReason_eq(const struct LDKClosureReason *NONNULL_PTR a, const struct LDKClosureReason *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_eq")] public static extern bool ClosureReason_eq(long _a, long _b); + // struct LDKStr ClosureReason_to_str(const struct LDKClosureReason *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_to_str")] public static extern long ClosureReason_to_str(long _o); // struct LDKCVec_u8Z ClosureReason_write(const struct LDKClosureReason *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_write")] public static extern long ClosureReason_write(long _obj); // struct LDKCResult_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(struct LDKu8slice ser); diff --git a/c_sharp/src/org/ldk/structs/ChannelDetails.cs b/c_sharp/src/org/ldk/structs/ChannelDetails.cs index 2295e2ea..4fdf88de 100644 --- a/c_sharp/src/org/ldk/structs/ChannelDetails.cs +++ b/c_sharp/src/org/ldk/structs/ChannelDetails.cs @@ -8,6 +8,9 @@ namespace org { namespace ldk { namespace structs { /** * Details of a channel, as returned by [`ChannelManager::list_channels`] and [`ChannelManager::list_usable_channels`] + * + * [`ChannelManager::list_channels`]: crate::ln::channelmanager::ChannelManager::list_channels + * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels */ public class ChannelDetails : CommonBase { internal ChannelDetails(object _dummy, long ptr) : base(ptr) { } @@ -821,6 +824,134 @@ public class ChannelDetails : CommonBase { if (this != null) { this.ptrs_to.AddLast(val); }; } + /** + * Pending inbound HTLCs. + * + * This field is empty for objects serialized with LDK versions prior to 0.0.122. + */ + public InboundHTLCDetails[] get_pending_inbound_htlcs() { + long ret = bindings.ChannelDetails_get_pending_inbound_htlcs(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + int ret_conv_20_len = InternalUtils.getArrayLength(ret); + InboundHTLCDetails[] ret_conv_20_arr = new InboundHTLCDetails[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.InboundHTLCDetails ret_conv_20_hu_conv = null; if (ret_conv_20 < 0 || ret_conv_20 > 4096) { ret_conv_20_hu_conv = new org.ldk.structs.InboundHTLCDetails(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_20_arr; + } + + /** + * Pending inbound HTLCs. + * + * This field is empty for objects serialized with LDK versions prior to 0.0.122. + */ + public void set_pending_inbound_htlcs(InboundHTLCDetails[] val) { + 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); }; }; + } + + /** + * Pending outbound HTLCs. + * + * This field is empty for objects serialized with LDK versions prior to 0.0.122. + */ + public OutboundHTLCDetails[] get_pending_outbound_htlcs() { + long ret = bindings.ChannelDetails_get_pending_outbound_htlcs(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + int ret_conv_21_len = InternalUtils.getArrayLength(ret); + OutboundHTLCDetails[] ret_conv_21_arr = new OutboundHTLCDetails[ret_conv_21_len]; + for (int v = 0; v < ret_conv_21_len; v++) { + long ret_conv_21 = InternalUtils.getU64ArrayElem(ret, v); + org.ldk.structs.OutboundHTLCDetails ret_conv_21_hu_conv = null; if (ret_conv_21 < 0 || ret_conv_21 > 4096) { ret_conv_21_hu_conv = new org.ldk.structs.OutboundHTLCDetails(null, ret_conv_21); } + if (ret_conv_21_hu_conv != null) { ret_conv_21_hu_conv.ptrs_to.AddLast(this); }; + ret_conv_21_arr[v] = ret_conv_21_hu_conv; + } + bindings.free_buffer(ret); + return ret_conv_21_arr; + } + + /** + * Pending outbound HTLCs. + * + * This field is empty for objects serialized with LDK versions prior to 0.0.122. + */ + public void set_pending_outbound_htlcs(OutboundHTLCDetails[] val) { + 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); }; }; + } + + /** + * Constructs a new ChannelDetails given each field + * + * Note that funding_txo_arg (or a relevant inner pointer) may be NULL or all-0s to represent None + * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None + * Note that config_arg (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public static ChannelDetails of(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))); + GC.KeepAlive(channel_id_arg); + GC.KeepAlive(counterparty_arg); + GC.KeepAlive(funding_txo_arg); + GC.KeepAlive(channel_type_arg); + GC.KeepAlive(short_channel_id_arg); + GC.KeepAlive(outbound_scid_alias_arg); + GC.KeepAlive(inbound_scid_alias_arg); + GC.KeepAlive(channel_value_satoshis_arg); + GC.KeepAlive(unspendable_punishment_reserve_arg); + GC.KeepAlive(user_channel_id_arg); + GC.KeepAlive(feerate_sat_per_1000_weight_arg); + GC.KeepAlive(balance_msat_arg); + GC.KeepAlive(outbound_capacity_msat_arg); + GC.KeepAlive(next_outbound_htlc_limit_msat_arg); + GC.KeepAlive(next_outbound_htlc_minimum_msat_arg); + GC.KeepAlive(inbound_capacity_msat_arg); + GC.KeepAlive(confirmations_required_arg); + GC.KeepAlive(confirmations_arg); + GC.KeepAlive(force_close_spend_delay_arg); + GC.KeepAlive(is_outbound_arg); + GC.KeepAlive(is_channel_ready_arg); + GC.KeepAlive(channel_shutdown_state_arg); + GC.KeepAlive(is_usable_arg); + GC.KeepAlive(is_public_arg); + GC.KeepAlive(inbound_htlc_minimum_msat_arg); + GC.KeepAlive(inbound_htlc_maximum_msat_arg); + GC.KeepAlive(config_arg); + GC.KeepAlive(pending_inbound_htlcs_arg); + GC.KeepAlive(pending_outbound_htlcs_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelDetails ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelDetails(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(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; + } + internal long clone_ptr() { long ret = bindings.ChannelDetails_clone_ptr(this.ptr); GC.KeepAlive(this); @@ -863,6 +994,8 @@ public class ChannelDetails : CommonBase { * * This is either the [`ChannelDetails::short_channel_id`], if set, or the * [`ChannelDetails::outbound_scid_alias`]. See those for more information. + * + * [`Route`]: crate::routing::router::Route */ public Option_u64Z get_outbound_payment_scid() { long ret = bindings.ChannelDetails_get_outbound_payment_scid(this.ptr); diff --git a/c_sharp/src/org/ldk/structs/ChannelId.cs b/c_sharp/src/org/ldk/structs/ChannelId.cs index 466e7271..b3615fe6 100644 --- a/c_sharp/src/org/ldk/structs/ChannelId.cs +++ b/c_sharp/src/org/ldk/structs/ChannelId.cs @@ -220,5 +220,16 @@ public class ChannelId : CommonBase { return ret_hu_conv; } + /** + * Get the string representation of a ChannelId object + */ + public string to_str() { + long ret = bindings.ChannelId_to_str(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + string ret_conv = InternalUtils.decodeString(ret); + return ret_conv; + } + } } } } diff --git a/c_sharp/src/org/ldk/structs/ChannelInfo.cs b/c_sharp/src/org/ldk/structs/ChannelInfo.cs index cf9775c8..e1a30b94 100644 --- a/c_sharp/src/org/ldk/structs/ChannelInfo.cs +++ b/c_sharp/src/org/ldk/structs/ChannelInfo.cs @@ -238,6 +238,17 @@ public class ChannelInfo : CommonBase { return ret_hu_conv; } + /** + * Get the string representation of a ChannelInfo object + */ + public string to_str() { + long ret = bindings.ChannelInfo_to_str(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + string ret_conv = InternalUtils.decodeString(ret); + return ret_conv; + } + /** * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read */ diff --git a/c_sharp/src/org/ldk/structs/ChannelUpdateInfo.cs b/c_sharp/src/org/ldk/structs/ChannelUpdateInfo.cs index 604865b2..cbf72512 100644 --- a/c_sharp/src/org/ldk/structs/ChannelUpdateInfo.cs +++ b/c_sharp/src/org/ldk/structs/ChannelUpdateInfo.cs @@ -218,6 +218,17 @@ public class ChannelUpdateInfo : CommonBase { if (!(o is ChannelUpdateInfo)) return false; return this.eq((ChannelUpdateInfo)o); } + /** + * Get the string representation of a ChannelUpdateInfo object + */ + public string to_str() { + long ret = bindings.ChannelUpdateInfo_to_str(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + string ret_conv = InternalUtils.decodeString(ret); + return ret_conv; + } + /** * Serialize the ChannelUpdateInfo object into a byte array which can be read by ChannelUpdateInfo_read */ diff --git a/c_sharp/src/org/ldk/structs/ClosureReason.cs b/c_sharp/src/org/ldk/structs/ClosureReason.cs index 6bf19ab1..e5d17977 100644 --- a/c_sharp/src/org/ldk/structs/ClosureReason.cs +++ b/c_sharp/src/org/ldk/structs/ClosureReason.cs @@ -300,6 +300,17 @@ public class ClosureReason : CommonBase { if (!(o is ClosureReason)) return false; return this.eq((ClosureReason)o); } + /** + * Get the string representation of a ClosureReason object + */ + public string to_str() { + long ret = bindings.ClosureReason_to_str(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + string ret_conv = InternalUtils.decodeString(ret); + return ret_conv; + } + /** * Serialize the ClosureReason object into a byte array which can be read by ClosureReason_read */ diff --git a/c_sharp/src/org/ldk/structs/DecodeError.cs b/c_sharp/src/org/ldk/structs/DecodeError.cs index 574b6b7f..bb86b834 100644 --- a/c_sharp/src/org/ldk/structs/DecodeError.cs +++ b/c_sharp/src/org/ldk/structs/DecodeError.cs @@ -206,5 +206,16 @@ public class DecodeError : CommonBase { if (!(o is DecodeError)) return false; return this.eq((DecodeError)o); } + /** + * Get the string representation of a DecodeError object + */ + public string to_str() { + long ret = bindings.DecodeError_to_str(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + string ret_conv = InternalUtils.decodeString(ret); + return ret_conv; + } + } } } } diff --git a/c_sharp/src/org/ldk/structs/Hostname.cs b/c_sharp/src/org/ldk/structs/Hostname.cs index b5f0ec54..c585b013 100644 --- a/c_sharp/src/org/ldk/structs/Hostname.cs +++ b/c_sharp/src/org/ldk/structs/Hostname.cs @@ -77,6 +77,17 @@ public class Hostname : CommonBase { return ret; } + /** + * Get the string representation of a Hostname object + */ + public string to_str() { + long ret = bindings.Hostname_to_str(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + string ret_conv = InternalUtils.decodeString(ret); + return ret_conv; + } + /** * Serialize the Hostname object into a byte array which can be read by Hostname_read */ diff --git a/c_sharp/src/org/ldk/structs/InboundHTLCDetails.cs b/c_sharp/src/org/ldk/structs/InboundHTLCDetails.cs new file mode 100644 index 00000000..fd089bff --- /dev/null +++ b/c_sharp/src/org/ldk/structs/InboundHTLCDetails.cs @@ -0,0 +1,233 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * Exposes details around pending inbound HTLCs. + */ +public class InboundHTLCDetails : CommonBase { + internal InboundHTLCDetails(object _dummy, long ptr) : base(ptr) { } + ~InboundHTLCDetails() { + if (ptr != 0) { bindings.InboundHTLCDetails_free(ptr); } + } + + /** + * The HTLC ID. + * The IDs are incremented by 1 starting from 0 for each offered HTLC. + * They are unique per channel and inbound/outbound direction, unless an HTLC was only announced + * and not part of any commitment transaction. + */ + public long get_htlc_id() { + long ret = bindings.InboundHTLCDetails_get_htlc_id(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The HTLC ID. + * The IDs are incremented by 1 starting from 0 for each offered HTLC. + * They are unique per channel and inbound/outbound direction, unless an HTLC was only announced + * and not part of any commitment transaction. + */ + public void set_htlc_id(long val) { + bindings.InboundHTLCDetails_set_htlc_id(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The amount in msat. + */ + public long get_amount_msat() { + long ret = bindings.InboundHTLCDetails_get_amount_msat(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The amount in msat. + */ + public void set_amount_msat(long val) { + bindings.InboundHTLCDetails_set_amount_msat(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The block height at which this HTLC expires. + */ + public int get_cltv_expiry() { + int ret = bindings.InboundHTLCDetails_get_cltv_expiry(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The block height at which this HTLC expires. + */ + public void set_cltv_expiry(int val) { + bindings.InboundHTLCDetails_set_cltv_expiry(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The payment hash. + */ + public byte[] get_payment_hash() { + long ret = bindings.InboundHTLCDetails_get_payment_hash(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * The payment hash. + */ + public void set_payment_hash(byte[] val) { + bindings.InboundHTLCDetails_set_payment_hash(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The state of the HTLC in the state machine. + * + * Determines on which commitment transactions the HTLC is included and what message the HTLC is + * waiting for to advance to the next state. + * + * See [`InboundHTLCStateDetails`] for information on the specific states. + * + * LDK will always fill this field in, but when downgrading to prior versions of LDK, new + * states may result in `None` here. + */ + public Option_InboundHTLCStateDetailsZ get_state() { + long ret = bindings.InboundHTLCDetails_get_state(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_InboundHTLCStateDetailsZ ret_hu_conv = org.ldk.structs.Option_InboundHTLCStateDetailsZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The state of the HTLC in the state machine. + * + * Determines on which commitment transactions the HTLC is included and what message the HTLC is + * waiting for to advance to the next state. + * + * See [`InboundHTLCStateDetails`] for information on the specific states. + * + * LDK will always fill this field in, but when downgrading to prior versions of LDK, new + * states may result in `None` here. + */ + public void set_state(org.ldk.structs.Option_InboundHTLCStateDetailsZ val) { + bindings.InboundHTLCDetails_set_state(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * Whether the HTLC has an output below the local dust limit. If so, the output will be trimmed + * from the local commitment transaction and added to the commitment transaction fee. + * For non-anchor channels, this takes into account the cost of the second-stage HTLC + * transactions as well. + * + * When the local commitment transaction is broadcasted as part of a unilateral closure, + * the value of this HTLC will therefore not be claimable but instead burned as a transaction + * fee. + * + * Note that dust limits are specific to each party. An HTLC can be dust for the local + * commitment transaction but not for the counterparty's commitment transaction and vice versa. + */ + public bool get_is_dust() { + bool ret = bindings.InboundHTLCDetails_get_is_dust(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Whether the HTLC has an output below the local dust limit. If so, the output will be trimmed + * from the local commitment transaction and added to the commitment transaction fee. + * For non-anchor channels, this takes into account the cost of the second-stage HTLC + * transactions as well. + * + * When the local commitment transaction is broadcasted as part of a unilateral closure, + * the value of this HTLC will therefore not be claimable but instead burned as a transaction + * fee. + * + * Note that dust limits are specific to each party. An HTLC can be dust for the local + * commitment transaction but not for the counterparty's commitment transaction and vice versa. + */ + public void set_is_dust(bool val) { + bindings.InboundHTLCDetails_set_is_dust(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Constructs a new InboundHTLCDetails given each field + */ + public static InboundHTLCDetails of(long htlc_id_arg, long amount_msat_arg, int cltv_expiry_arg, byte[] payment_hash_arg, org.ldk.structs.Option_InboundHTLCStateDetailsZ state_arg, bool is_dust_arg) { + long ret = bindings.InboundHTLCDetails_new(htlc_id_arg, amount_msat_arg, cltv_expiry_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash_arg, 32)), state_arg.ptr, is_dust_arg); + GC.KeepAlive(htlc_id_arg); + GC.KeepAlive(amount_msat_arg); + GC.KeepAlive(cltv_expiry_arg); + GC.KeepAlive(payment_hash_arg); + GC.KeepAlive(state_arg); + GC.KeepAlive(is_dust_arg); + 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; + } + + internal long clone_ptr() { + long ret = bindings.InboundHTLCDetails_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the InboundHTLCDetails + */ + public InboundHTLCDetails clone() { + long ret = bindings.InboundHTLCDetails_clone(this.ptr); + GC.KeepAlive(this); + 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(this); }; + return ret_hu_conv; + } + + /** + * Serialize the InboundHTLCDetails object into a byte array which can be read by InboundHTLCDetails_read + */ + public byte[] write() { + long ret = bindings.InboundHTLCDetails_write(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Read a InboundHTLCDetails from a byte array, created by InboundHTLCDetails_write + */ + public static Result_InboundHTLCDetailsDecodeErrorZ read(byte[] ser) { + long ret = bindings.InboundHTLCDetails_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InboundHTLCDetailsDecodeErrorZ ret_hu_conv = Result_InboundHTLCDetailsDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/InvoiceError.cs b/c_sharp/src/org/ldk/structs/InvoiceError.cs index a251e7a7..78194b68 100644 --- a/c_sharp/src/org/ldk/structs/InvoiceError.cs +++ b/c_sharp/src/org/ldk/structs/InvoiceError.cs @@ -119,6 +119,17 @@ public class InvoiceError : CommonBase { return ret_hu_conv; } + /** + * Get the string representation of a InvoiceError object + */ + public string to_str() { + long ret = bindings.InvoiceError_to_str(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + string ret_conv = InternalUtils.decodeString(ret); + return ret_conv; + } + /** * Serialize the InvoiceError object into a byte array which can be read by InvoiceError_read */ diff --git a/c_sharp/src/org/ldk/structs/NetworkGraph.cs b/c_sharp/src/org/ldk/structs/NetworkGraph.cs index 34fcb9e4..24f4931f 100644 --- a/c_sharp/src/org/ldk/structs/NetworkGraph.cs +++ b/c_sharp/src/org/ldk/structs/NetworkGraph.cs @@ -63,6 +63,17 @@ public class NetworkGraph : CommonBase { return ret_hu_conv; } + /** + * Get the string representation of a NetworkGraph object + */ + public string to_str() { + long ret = bindings.NetworkGraph_to_str(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + string ret_conv = InternalUtils.decodeString(ret); + return ret_conv; + } + /** * Creates a new, empty, network graph. */ diff --git a/c_sharp/src/org/ldk/structs/NodeAlias.cs b/c_sharp/src/org/ldk/structs/NodeAlias.cs index 8eaed432..db21a3a4 100644 --- a/c_sharp/src/org/ldk/structs/NodeAlias.cs +++ b/c_sharp/src/org/ldk/structs/NodeAlias.cs @@ -91,6 +91,17 @@ public class NodeAlias : CommonBase { if (!(o is NodeAlias)) return false; return this.eq((NodeAlias)o); } + /** + * Get the string representation of a NodeAlias object + */ + public string to_str() { + long ret = bindings.NodeAlias_to_str(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + string ret_conv = InternalUtils.decodeString(ret); + return ret_conv; + } + /** * Serialize the NodeAlias object into a byte array which can be read by NodeAlias_read */ diff --git a/c_sharp/src/org/ldk/structs/NodeId.cs b/c_sharp/src/org/ldk/structs/NodeId.cs index c994ad56..a7a211ad 100644 --- a/c_sharp/src/org/ldk/structs/NodeId.cs +++ b/c_sharp/src/org/ldk/structs/NodeId.cs @@ -89,6 +89,17 @@ public class NodeId : CommonBase { return ret_hu_conv; } + /** + * Get the string representation of a NodeId object + */ + public string to_str() { + long ret = bindings.NodeId_to_str(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + string ret_conv = InternalUtils.decodeString(ret); + return ret_conv; + } + /** * Generates a non-cryptographic 64-bit hash of the NodeId. */ diff --git a/c_sharp/src/org/ldk/structs/NodeInfo.cs b/c_sharp/src/org/ldk/structs/NodeInfo.cs index 2f1c0a22..e7975e61 100644 --- a/c_sharp/src/org/ldk/structs/NodeInfo.cs +++ b/c_sharp/src/org/ldk/structs/NodeInfo.cs @@ -127,6 +127,17 @@ public class NodeInfo : CommonBase { return ret; } + /** + * Get the string representation of a NodeInfo object + */ + public string to_str() { + long ret = bindings.NodeInfo_to_str(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + string ret_conv = InternalUtils.decodeString(ret); + return ret_conv; + } + /** * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read */ diff --git a/c_sharp/src/org/ldk/structs/Offer.cs b/c_sharp/src/org/ldk/structs/Offer.cs index 61159556..3db5c844 100644 --- a/c_sharp/src/org/ldk/structs/Offer.cs +++ b/c_sharp/src/org/ldk/structs/Offer.cs @@ -364,5 +364,16 @@ public class Offer : CommonBase { return ret_hu_conv; } + /** + * Get the string representation of a Offer object + */ + public string to_str() { + long ret = bindings.Offer_to_str(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + string ret_conv = InternalUtils.decodeString(ret); + return ret_conv; + } + } } } } diff --git a/c_sharp/src/org/ldk/structs/Option_ChannelShutdownStateZ.cs b/c_sharp/src/org/ldk/structs/Option_ChannelShutdownStateZ.cs index a6954e59..957a1c8a 100644 --- a/c_sharp/src/org/ldk/structs/Option_ChannelShutdownStateZ.cs +++ b/c_sharp/src/org/ldk/structs/Option_ChannelShutdownStateZ.cs @@ -6,7 +6,7 @@ using System; namespace org { namespace ldk { namespace structs { /** - * An enum which can either contain a crate::lightning::ln::channelmanager::ChannelShutdownState or not + * An enum which can either contain a crate::lightning::ln::channel_state::ChannelShutdownState or not */ public class Option_ChannelShutdownStateZ : CommonBase { protected Option_ChannelShutdownStateZ(object _dummy, long ptr) : base(ptr) { } @@ -37,7 +37,7 @@ public class Option_ChannelShutdownStateZ : CommonBase { } } /** - * Constructs a new COption_ChannelShutdownStateZ containing a crate::lightning::ln::channelmanager::ChannelShutdownState + * Constructs a new COption_ChannelShutdownStateZ containing a crate::lightning::ln::channel_state::ChannelShutdownState */ public static Option_ChannelShutdownStateZ some(ChannelShutdownState o) { long ret = bindings.COption_ChannelShutdownStateZ_some(o); diff --git a/c_sharp/src/org/ldk/structs/Option_InboundHTLCStateDetailsZ.cs b/c_sharp/src/org/ldk/structs/Option_InboundHTLCStateDetailsZ.cs new file mode 100644 index 00000000..ea7f20d3 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Option_InboundHTLCStateDetailsZ.cs @@ -0,0 +1,82 @@ +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::ln::channel_state::InboundHTLCStateDetails or not + */ +public class Option_InboundHTLCStateDetailsZ : CommonBase { + protected Option_InboundHTLCStateDetailsZ(object _dummy, long ptr) : base(ptr) { } + ~Option_InboundHTLCStateDetailsZ() { + if (ptr != 0) { bindings.COption_InboundHTLCStateDetailsZ_free(ptr); } + } + + internal static Option_InboundHTLCStateDetailsZ constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKCOption_InboundHTLCStateDetailsZ_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Option_InboundHTLCStateDetailsZ_Some(ptr); + case 1: return new Option_InboundHTLCStateDetailsZ_None(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Option_InboundHTLCStateDetailsZ of type Some */ + public class Option_InboundHTLCStateDetailsZ_Some : Option_InboundHTLCStateDetailsZ { + public InboundHTLCStateDetails some; + internal Option_InboundHTLCStateDetailsZ_Some(long ptr) : base(null, ptr) { + this.some = bindings.LDKCOption_InboundHTLCStateDetailsZ_Some_get_some(ptr); + } + } + /** A Option_InboundHTLCStateDetailsZ of type None */ + public class Option_InboundHTLCStateDetailsZ_None : Option_InboundHTLCStateDetailsZ { + internal Option_InboundHTLCStateDetailsZ_None(long ptr) : base(null, ptr) { + } + } + /** + * Constructs a new COption_InboundHTLCStateDetailsZ containing a crate::lightning::ln::channel_state::InboundHTLCStateDetails + */ + public static Option_InboundHTLCStateDetailsZ some(InboundHTLCStateDetails o) { + long ret = bindings.COption_InboundHTLCStateDetailsZ_some(o); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_InboundHTLCStateDetailsZ ret_hu_conv = org.ldk.structs.Option_InboundHTLCStateDetailsZ.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_InboundHTLCStateDetailsZ containing nothing + */ + public static Option_InboundHTLCStateDetailsZ none() { + long ret = bindings.COption_InboundHTLCStateDetailsZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_InboundHTLCStateDetailsZ ret_hu_conv = org.ldk.structs.Option_InboundHTLCStateDetailsZ.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_InboundHTLCStateDetailsZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new COption_InboundHTLCStateDetailsZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_InboundHTLCStateDetailsZ clone() { + long ret = bindings.COption_InboundHTLCStateDetailsZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_InboundHTLCStateDetailsZ ret_hu_conv = org.ldk.structs.Option_InboundHTLCStateDetailsZ.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_OutboundHTLCStateDetailsZ.cs b/c_sharp/src/org/ldk/structs/Option_OutboundHTLCStateDetailsZ.cs new file mode 100644 index 00000000..ef5944ab --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Option_OutboundHTLCStateDetailsZ.cs @@ -0,0 +1,82 @@ +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::ln::channel_state::OutboundHTLCStateDetails or not + */ +public class Option_OutboundHTLCStateDetailsZ : CommonBase { + protected Option_OutboundHTLCStateDetailsZ(object _dummy, long ptr) : base(ptr) { } + ~Option_OutboundHTLCStateDetailsZ() { + if (ptr != 0) { bindings.COption_OutboundHTLCStateDetailsZ_free(ptr); } + } + + internal static Option_OutboundHTLCStateDetailsZ constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKCOption_OutboundHTLCStateDetailsZ_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Option_OutboundHTLCStateDetailsZ_Some(ptr); + case 1: return new Option_OutboundHTLCStateDetailsZ_None(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Option_OutboundHTLCStateDetailsZ of type Some */ + public class Option_OutboundHTLCStateDetailsZ_Some : Option_OutboundHTLCStateDetailsZ { + public OutboundHTLCStateDetails some; + internal Option_OutboundHTLCStateDetailsZ_Some(long ptr) : base(null, ptr) { + this.some = bindings.LDKCOption_OutboundHTLCStateDetailsZ_Some_get_some(ptr); + } + } + /** A Option_OutboundHTLCStateDetailsZ of type None */ + public class Option_OutboundHTLCStateDetailsZ_None : Option_OutboundHTLCStateDetailsZ { + internal Option_OutboundHTLCStateDetailsZ_None(long ptr) : base(null, ptr) { + } + } + /** + * Constructs a new COption_OutboundHTLCStateDetailsZ containing a crate::lightning::ln::channel_state::OutboundHTLCStateDetails + */ + public static Option_OutboundHTLCStateDetailsZ some(OutboundHTLCStateDetails o) { + long ret = bindings.COption_OutboundHTLCStateDetailsZ_some(o); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_OutboundHTLCStateDetailsZ ret_hu_conv = org.ldk.structs.Option_OutboundHTLCStateDetailsZ.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_OutboundHTLCStateDetailsZ containing nothing + */ + public static Option_OutboundHTLCStateDetailsZ none() { + long ret = bindings.COption_OutboundHTLCStateDetailsZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_OutboundHTLCStateDetailsZ ret_hu_conv = org.ldk.structs.Option_OutboundHTLCStateDetailsZ.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_OutboundHTLCStateDetailsZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new COption_OutboundHTLCStateDetailsZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_OutboundHTLCStateDetailsZ clone() { + long ret = bindings.COption_OutboundHTLCStateDetailsZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_OutboundHTLCStateDetailsZ ret_hu_conv = org.ldk.structs.Option_OutboundHTLCStateDetailsZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/OutPoint.cs b/c_sharp/src/org/ldk/structs/OutPoint.cs index 69da1bb4..b7058423 100644 --- a/c_sharp/src/org/ldk/structs/OutPoint.cs +++ b/c_sharp/src/org/ldk/structs/OutPoint.cs @@ -116,6 +116,17 @@ public class OutPoint : CommonBase { public override int GetHashCode() { return (int)this.hash(); } + /** + * Get the string representation of a OutPoint object + */ + public string to_str() { + long ret = bindings.OutPoint_to_str(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + string ret_conv = InternalUtils.decodeString(ret); + return ret_conv; + } + /** * Serialize the OutPoint object into a byte array which can be read by OutPoint_read */ diff --git a/c_sharp/src/org/ldk/structs/OutboundHTLCDetails.cs b/c_sharp/src/org/ldk/structs/OutboundHTLCDetails.cs new file mode 100644 index 00000000..05130de9 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/OutboundHTLCDetails.cs @@ -0,0 +1,266 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * Exposes details around pending outbound HTLCs. + */ +public class OutboundHTLCDetails : CommonBase { + internal OutboundHTLCDetails(object _dummy, long ptr) : base(ptr) { } + ~OutboundHTLCDetails() { + if (ptr != 0) { bindings.OutboundHTLCDetails_free(ptr); } + } + + /** + * The HTLC ID. + * The IDs are incremented by 1 starting from 0 for each offered HTLC. + * They are unique per channel and inbound/outbound direction, unless an HTLC was only announced + * and not part of any commitment transaction. + * + * Not present when we are awaiting a remote revocation and the HTLC is not added yet. + */ + public Option_u64Z get_htlc_id() { + long ret = bindings.OutboundHTLCDetails_get_htlc_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 HTLC ID. + * The IDs are incremented by 1 starting from 0 for each offered HTLC. + * They are unique per channel and inbound/outbound direction, unless an HTLC was only announced + * and not part of any commitment transaction. + * + * Not present when we are awaiting a remote revocation and the HTLC is not added yet. + */ + public void set_htlc_id(org.ldk.structs.Option_u64Z val) { + bindings.OutboundHTLCDetails_set_htlc_id(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * The amount in msat. + */ + public long get_amount_msat() { + long ret = bindings.OutboundHTLCDetails_get_amount_msat(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The amount in msat. + */ + public void set_amount_msat(long val) { + bindings.OutboundHTLCDetails_set_amount_msat(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The block height at which this HTLC expires. + */ + public int get_cltv_expiry() { + int ret = bindings.OutboundHTLCDetails_get_cltv_expiry(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The block height at which this HTLC expires. + */ + public void set_cltv_expiry(int val) { + bindings.OutboundHTLCDetails_set_cltv_expiry(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The payment hash. + */ + public byte[] get_payment_hash() { + long ret = bindings.OutboundHTLCDetails_get_payment_hash(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * The payment hash. + */ + public void set_payment_hash(byte[] val) { + bindings.OutboundHTLCDetails_set_payment_hash(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The state of the HTLC in the state machine. + * + * Determines on which commitment transactions the HTLC is included and what message the HTLC is + * waiting for to advance to the next state. + * + * See [`OutboundHTLCStateDetails`] for information on the specific states. + * + * LDK will always fill this field in, but when downgrading to prior versions of LDK, new + * states may result in `None` here. + */ + public Option_OutboundHTLCStateDetailsZ get_state() { + long ret = bindings.OutboundHTLCDetails_get_state(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_OutboundHTLCStateDetailsZ ret_hu_conv = org.ldk.structs.Option_OutboundHTLCStateDetailsZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The state of the HTLC in the state machine. + * + * Determines on which commitment transactions the HTLC is included and what message the HTLC is + * waiting for to advance to the next state. + * + * See [`OutboundHTLCStateDetails`] for information on the specific states. + * + * LDK will always fill this field in, but when downgrading to prior versions of LDK, new + * states may result in `None` here. + */ + public void set_state(org.ldk.structs.Option_OutboundHTLCStateDetailsZ val) { + bindings.OutboundHTLCDetails_set_state(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * The extra fee being skimmed off the top of this HTLC. + */ + public Option_u64Z get_skimmed_fee_msat() { + long ret = bindings.OutboundHTLCDetails_get_skimmed_fee_msat(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 extra fee being skimmed off the top of this HTLC. + */ + public void set_skimmed_fee_msat(org.ldk.structs.Option_u64Z val) { + bindings.OutboundHTLCDetails_set_skimmed_fee_msat(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * Whether the HTLC has an output below the local dust limit. If so, the output will be trimmed + * from the local commitment transaction and added to the commitment transaction fee. + * For non-anchor channels, this takes into account the cost of the second-stage HTLC + * transactions as well. + * + * When the local commitment transaction is broadcasted as part of a unilateral closure, + * the value of this HTLC will therefore not be claimable but instead burned as a transaction + * fee. + * + * Note that dust limits are specific to each party. An HTLC can be dust for the local + * commitment transaction but not for the counterparty's commitment transaction and vice versa. + */ + public bool get_is_dust() { + bool ret = bindings.OutboundHTLCDetails_get_is_dust(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Whether the HTLC has an output below the local dust limit. If so, the output will be trimmed + * from the local commitment transaction and added to the commitment transaction fee. + * For non-anchor channels, this takes into account the cost of the second-stage HTLC + * transactions as well. + * + * When the local commitment transaction is broadcasted as part of a unilateral closure, + * the value of this HTLC will therefore not be claimable but instead burned as a transaction + * fee. + * + * Note that dust limits are specific to each party. An HTLC can be dust for the local + * commitment transaction but not for the counterparty's commitment transaction and vice versa. + */ + public void set_is_dust(bool val) { + bindings.OutboundHTLCDetails_set_is_dust(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Constructs a new OutboundHTLCDetails given each field + */ + public static OutboundHTLCDetails of(org.ldk.structs.Option_u64Z htlc_id_arg, long amount_msat_arg, int cltv_expiry_arg, byte[] payment_hash_arg, org.ldk.structs.Option_OutboundHTLCStateDetailsZ state_arg, org.ldk.structs.Option_u64Z skimmed_fee_msat_arg, bool is_dust_arg) { + long ret = bindings.OutboundHTLCDetails_new(htlc_id_arg.ptr, amount_msat_arg, cltv_expiry_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash_arg, 32)), state_arg.ptr, skimmed_fee_msat_arg.ptr, is_dust_arg); + GC.KeepAlive(htlc_id_arg); + GC.KeepAlive(amount_msat_arg); + GC.KeepAlive(cltv_expiry_arg); + GC.KeepAlive(payment_hash_arg); + GC.KeepAlive(state_arg); + GC.KeepAlive(skimmed_fee_msat_arg); + GC.KeepAlive(is_dust_arg); + 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; + } + + internal long clone_ptr() { + long ret = bindings.OutboundHTLCDetails_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the OutboundHTLCDetails + */ + public OutboundHTLCDetails clone() { + long ret = bindings.OutboundHTLCDetails_clone(this.ptr); + GC.KeepAlive(this); + 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(this); }; + return ret_hu_conv; + } + + /** + * Serialize the OutboundHTLCDetails object into a byte array which can be read by OutboundHTLCDetails_read + */ + public byte[] write() { + long ret = bindings.OutboundHTLCDetails_write(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Read a OutboundHTLCDetails from a byte array, created by OutboundHTLCDetails_write + */ + public static Result_OutboundHTLCDetailsDecodeErrorZ read(byte[] ser) { + long ret = bindings.OutboundHTLCDetails_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OutboundHTLCDetailsDecodeErrorZ ret_hu_conv = Result_OutboundHTLCDetailsDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/PeerHandleError.cs b/c_sharp/src/org/ldk/structs/PeerHandleError.cs index 3085dee7..6fa6e50e 100644 --- a/c_sharp/src/org/ldk/structs/PeerHandleError.cs +++ b/c_sharp/src/org/ldk/structs/PeerHandleError.cs @@ -46,5 +46,16 @@ public class PeerHandleError : CommonBase { return ret_hu_conv; } + /** + * Get the string representation of a PeerHandleError object + */ + public string to_str() { + long ret = bindings.PeerHandleError_to_str(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + string ret_conv = InternalUtils.decodeString(ret); + return ret_conv; + } + } } } } diff --git a/c_sharp/src/org/ldk/structs/PrintableString.cs b/c_sharp/src/org/ldk/structs/PrintableString.cs index 075cad4f..9a2a8b60 100644 --- a/c_sharp/src/org/ldk/structs/PrintableString.cs +++ b/c_sharp/src/org/ldk/structs/PrintableString.cs @@ -42,5 +42,16 @@ public class PrintableString : CommonBase { return ret_hu_conv; } + /** + * Get the string representation of a PrintableString object + */ + public string to_str() { + long ret = bindings.PrintableString_to_str(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + string ret_conv = InternalUtils.decodeString(ret); + return ret_conv; + } + } } } } diff --git a/c_sharp/src/org/ldk/structs/Refund.cs b/c_sharp/src/org/ldk/structs/Refund.cs index 218d31e5..f9a20662 100644 --- a/c_sharp/src/org/ldk/structs/Refund.cs +++ b/c_sharp/src/org/ldk/structs/Refund.cs @@ -243,5 +243,16 @@ public class Refund : CommonBase { return ret_hu_conv; } + /** + * Get the string representation of a Refund object + */ + public string to_str() { + long ret = bindings.Refund_to_str(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + string ret_conv = InternalUtils.decodeString(ret); + return ret_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 new file mode 100644 index 00000000..153d8d21 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_COption_InboundHTLCStateDetailsZDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_COption_InboundHTLCStateDetailsZDecodeErrorZ : CommonBase { + Result_COption_InboundHTLCStateDetailsZDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_COption_InboundHTLCStateDetailsZDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_free(ptr); } + } + + internal static Result_COption_InboundHTLCStateDetailsZDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_is_ok(ptr)) { + return new Result_COption_InboundHTLCStateDetailsZDecodeErrorZ_OK(null, ptr); + } else { + return new Result_COption_InboundHTLCStateDetailsZDecodeErrorZ_Err(null, ptr); + } + } + public class Result_COption_InboundHTLCStateDetailsZDecodeErrorZ_OK : Result_COption_InboundHTLCStateDetailsZDecodeErrorZ { + public readonly Option_InboundHTLCStateDetailsZ res; + internal Result_COption_InboundHTLCStateDetailsZDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_get_ok(ptr); + org.ldk.structs.Option_InboundHTLCStateDetailsZ res_hu_conv = org.ldk.structs.Option_InboundHTLCStateDetailsZ.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_InboundHTLCStateDetailsZDecodeErrorZ_Err : Result_COption_InboundHTLCStateDetailsZDecodeErrorZ { + public readonly DecodeError err; + internal Result_COption_InboundHTLCStateDetailsZDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_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_InboundHTLCStateDetailsZDecodeErrorZ in the success state. + */ + public static Result_COption_InboundHTLCStateDetailsZDecodeErrorZ ok(org.ldk.structs.Option_InboundHTLCStateDetailsZ o) { + long ret = bindings.CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_ok(o.ptr); + 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; + } + + /** + * Creates a new CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ in the error state. + */ + public static Result_COption_InboundHTLCStateDetailsZDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_err(e.ptr); + 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; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_COption_InboundHTLCStateDetailsZDecodeErrorZ clone() { + long ret = bindings.CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_InboundHTLCStateDetailsZDecodeErrorZ ret_hu_conv = Result_COption_InboundHTLCStateDetailsZDecodeErrorZ.constr_from_ptr(ret); + 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 new file mode 100644 index 00000000..6caee8bb --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ : CommonBase { + Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_free(ptr); } + } + + internal static Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_is_ok(ptr)) { + return new Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ_OK(null, ptr); + } else { + return new Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ_Err(null, ptr); + } + } + public class Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ_OK : Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ { + public readonly Option_OutboundHTLCStateDetailsZ res; + internal Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_get_ok(ptr); + org.ldk.structs.Option_OutboundHTLCStateDetailsZ res_hu_conv = org.ldk.structs.Option_OutboundHTLCStateDetailsZ.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_OutboundHTLCStateDetailsZDecodeErrorZ_Err : Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ { + public readonly DecodeError err; + internal Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_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_OutboundHTLCStateDetailsZDecodeErrorZ in the success state. + */ + public static Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ ok(org.ldk.structs.Option_OutboundHTLCStateDetailsZ o) { + long ret = bindings.CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_ok(o.ptr); + 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; + } + + /** + * Creates a new CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ in the error state. + */ + public static Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_err(e.ptr); + 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; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ clone() { + long ret = bindings.CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ ret_hu_conv = Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ.constr_from_ptr(ret); + 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 new file mode 100644 index 00000000..1039db70 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_InboundHTLCDetailsDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_InboundHTLCDetailsDecodeErrorZ : CommonBase { + Result_InboundHTLCDetailsDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_InboundHTLCDetailsDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_InboundHTLCDetailsDecodeErrorZ_free(ptr); } + } + + internal static Result_InboundHTLCDetailsDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_InboundHTLCDetailsDecodeErrorZ_is_ok(ptr)) { + return new Result_InboundHTLCDetailsDecodeErrorZ_OK(null, ptr); + } else { + return new Result_InboundHTLCDetailsDecodeErrorZ_Err(null, ptr); + } + } + public class Result_InboundHTLCDetailsDecodeErrorZ_OK : Result_InboundHTLCDetailsDecodeErrorZ { + public readonly InboundHTLCDetails res; + internal Result_InboundHTLCDetailsDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_InboundHTLCDetailsDecodeErrorZ_get_ok(ptr); + org.ldk.structs.InboundHTLCDetails res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.InboundHTLCDetails(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_InboundHTLCDetailsDecodeErrorZ_Err : Result_InboundHTLCDetailsDecodeErrorZ { + public readonly DecodeError err; + internal Result_InboundHTLCDetailsDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_InboundHTLCDetailsDecodeErrorZ_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_InboundHTLCDetailsDecodeErrorZ in the success state. + */ + public static Result_InboundHTLCDetailsDecodeErrorZ ok(org.ldk.structs.InboundHTLCDetails o) { + long ret = bindings.CResult_InboundHTLCDetailsDecodeErrorZ_ok(o.ptr); + 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; + } + + /** + * Creates a new CResult_InboundHTLCDetailsDecodeErrorZ in the error state. + */ + public static Result_InboundHTLCDetailsDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_InboundHTLCDetailsDecodeErrorZ_err(e.ptr); + 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; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_InboundHTLCDetailsDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_InboundHTLCDetailsDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_InboundHTLCDetailsDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_InboundHTLCDetailsDecodeErrorZ clone() { + long ret = bindings.CResult_InboundHTLCDetailsDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InboundHTLCDetailsDecodeErrorZ ret_hu_conv = Result_InboundHTLCDetailsDecodeErrorZ.constr_from_ptr(ret); + 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 new file mode 100644 index 00000000..8a084cd1 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_OutboundHTLCDetailsDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_OutboundHTLCDetailsDecodeErrorZ : CommonBase { + Result_OutboundHTLCDetailsDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_OutboundHTLCDetailsDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_OutboundHTLCDetailsDecodeErrorZ_free(ptr); } + } + + internal static Result_OutboundHTLCDetailsDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_OutboundHTLCDetailsDecodeErrorZ_is_ok(ptr)) { + return new Result_OutboundHTLCDetailsDecodeErrorZ_OK(null, ptr); + } else { + return new Result_OutboundHTLCDetailsDecodeErrorZ_Err(null, ptr); + } + } + public class Result_OutboundHTLCDetailsDecodeErrorZ_OK : Result_OutboundHTLCDetailsDecodeErrorZ { + public readonly OutboundHTLCDetails res; + internal Result_OutboundHTLCDetailsDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_OutboundHTLCDetailsDecodeErrorZ_get_ok(ptr); + org.ldk.structs.OutboundHTLCDetails res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.OutboundHTLCDetails(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_OutboundHTLCDetailsDecodeErrorZ_Err : Result_OutboundHTLCDetailsDecodeErrorZ { + public readonly DecodeError err; + internal Result_OutboundHTLCDetailsDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_OutboundHTLCDetailsDecodeErrorZ_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_OutboundHTLCDetailsDecodeErrorZ in the success state. + */ + public static Result_OutboundHTLCDetailsDecodeErrorZ ok(org.ldk.structs.OutboundHTLCDetails o) { + long ret = bindings.CResult_OutboundHTLCDetailsDecodeErrorZ_ok(o.ptr); + 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; + } + + /** + * Creates a new CResult_OutboundHTLCDetailsDecodeErrorZ in the error state. + */ + public static Result_OutboundHTLCDetailsDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_OutboundHTLCDetailsDecodeErrorZ_err(e.ptr); + 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; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_OutboundHTLCDetailsDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_OutboundHTLCDetailsDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_OutboundHTLCDetailsDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_OutboundHTLCDetailsDecodeErrorZ clone() { + long ret = bindings.CResult_OutboundHTLCDetailsDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OutboundHTLCDetailsDecodeErrorZ ret_hu_conv = Result_OutboundHTLCDetailsDecodeErrorZ.constr_from_ptr(ret); + 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 4e28b913..d5a7f296 100644 --- a/c_sharp/src/org/ldk/structs/Route.cs +++ b/c_sharp/src/org/ldk/structs/Route.cs @@ -176,6 +176,17 @@ public class Route : CommonBase { return ret; } + /** + * Get the string representation of a Route object + */ + public string to_str() { + long ret = bindings.Route_to_str(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + string ret_conv = InternalUtils.decodeString(ret); + return ret_conv; + } + /** * Serialize the Route object into a byte array which can be read by Route_read */ diff --git a/c_sharp/src/org/ldk/structs/ShutdownScript.cs b/c_sharp/src/org/ldk/structs/ShutdownScript.cs index 485cb08b..8ffbf5d3 100644 --- a/c_sharp/src/org/ldk/structs/ShutdownScript.cs +++ b/c_sharp/src/org/ldk/structs/ShutdownScript.cs @@ -154,5 +154,16 @@ public class ShutdownScript : CommonBase { return ret; } + /** + * Get the string representation of a ShutdownScript object + */ + public string to_str() { + long ret = bindings.ShutdownScript_to_str(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + string ret_conv = InternalUtils.decodeString(ret); + return ret_conv; + } + } } } } diff --git a/c_sharp/src/org/ldk/structs/UntrustedString.cs b/c_sharp/src/org/ldk/structs/UntrustedString.cs index 5625f1d9..c23c97ba 100644 --- a/c_sharp/src/org/ldk/structs/UntrustedString.cs +++ b/c_sharp/src/org/ldk/structs/UntrustedString.cs @@ -110,5 +110,16 @@ public class UntrustedString : CommonBase { return ret_hu_conv; } + /** + * Get the string representation of a UntrustedString object + */ + public string to_str() { + long ret = bindings.UntrustedString_to_str(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + string ret_conv = InternalUtils.decodeString(ret); + return ret_conv; + } + } } } } diff --git a/c_sharp/src/org/ldk/structs/UtilMethods.cs b/c_sharp/src/org/ldk/structs/UtilMethods.cs index cd6af6e2..281808f7 100644 --- a/c_sharp/src/org/ldk/structs/UtilMethods.cs +++ b/c_sharp/src/org/ldk/structs/UtilMethods.cs @@ -299,6 +299,28 @@ public class UtilMethods { return ret_conv; } + /** + * Read a InboundHTLCStateDetails from a byte array, created by InboundHTLCStateDetails_write + */ + public static Result_COption_InboundHTLCStateDetailsZDecodeErrorZ InboundHTLCStateDetails_read(byte[] ser) { + long ret = bindings.InboundHTLCStateDetails_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_InboundHTLCStateDetailsZDecodeErrorZ ret_hu_conv = Result_COption_InboundHTLCStateDetailsZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Read a OutboundHTLCStateDetails from a byte array, created by OutboundHTLCStateDetails_write + */ + public static Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ OutboundHTLCStateDetails_read(byte[] ser) { + long ret = bindings.OutboundHTLCStateDetails_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ ret_hu_conv = Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + /** * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment`], but no * `ChannelManager` is required. Useful for generating invoices for [phantom node payments] without -- 2.30.2